From 28980fdf8526bb5e761d77011bb0ca921f3313ff Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Wed, 15 Jul 2020 23:19:41 -0700 Subject: [PATCH] soc/amd/picasso: Use read-modify-write for ACP_I2S_PIN_CONFIG This change uses read-modify-write to update ACP_I2S_PIN_CONFIG instead of a write operation since the other bits in the register are reserved. Change-Id: Ic64e1907858ec293c5f759e627d19c00d748a30e Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/c/coreboot/+/43503 Reviewed-by: Aaron Durbin Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/soc/amd/picasso/acp.c | 2 +- src/soc/amd/picasso/include/soc/acp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/amd/picasso/acp.c b/src/soc/amd/picasso/acp.c index b598e646b2..4efef186c9 100644 --- a/src/soc/amd/picasso/acp.c +++ b/src/soc/amd/picasso/acp.c @@ -41,7 +41,7 @@ static void init(struct device *dev) } bar = (uintptr_t)res->base; - write32((void *)(bar + ACP_I2S_PIN_CONFIG), cfg->acp_pin_cfg); + acp_update32(bar, ACP_I2S_PIN_CONFIG, PIN_CONFIG_MASK, cfg->acp_pin_cfg); /* Enable ACP_PME_EN and ACP_I2S_WAKE_EN for I2S_WAKE event */ acp_update32(bar, ACP_I2S_WAKE_EN, WAKE_EN_MASK, !!cfg->acp_i2s_wake_enable); diff --git a/src/soc/amd/picasso/include/soc/acp.h b/src/soc/amd/picasso/include/soc/acp.h index 36bd6fb68b..545a372100 100644 --- a/src/soc/amd/picasso/include/soc/acp.h +++ b/src/soc/amd/picasso/include/soc/acp.h @@ -5,6 +5,7 @@ /* Bus A D0F5 - Audio Processor */ #define ACP_I2S_PIN_CONFIG 0x1400 /* HDA, Soundwire, I2S */ +#define PIN_CONFIG_MASK (7 << 0) #define ACP_I2S_WAKE_EN 0x1414 #define WAKE_EN_MASK (1 << 0) #define ACP_PME_EN 0x1418