From e5d3b4e36e1e9ac6701a6f337b601420c7d88779 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 20 Apr 2021 00:39:55 +0200 Subject: [PATCH] soc/amd/picasso/acp: use clrsetbits32 in acp_update32 Use existing functionality instead of reinventing it. TEST=none Signed-off-by: Felix Held Change-Id: Iaeab5cce05ccd860bc8de3775b7d1420653497a3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52525 Reviewed-by: Angel Pons Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/acp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/soc/amd/picasso/acp.c b/src/soc/amd/picasso/acp.c index 822c48a119..d1ae21cec4 100644 --- a/src/soc/amd/picasso/acp.c +++ b/src/soc/amd/picasso/acp.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -17,12 +18,7 @@ static void acp_update32(uintptr_t bar, uint32_t reg, uint32_t clear, uint32_t set) { - uint32_t val; - - val = read32((void *)(bar + reg)); - val &= ~clear; - val |= set; - write32((void *)(bar + reg), val); + clrsetbits32((void *)(bar + reg), clear, set); } static void init(struct device *dev)