mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] peci: aspeed: Clear clock_divider value before setting it
@ 2024-04-17 13:48 Iwona Winiarska
  2024-04-17 23:41 ` Andrew Jeffery
  0 siblings, 1 reply; 5+ messages in thread
From: Iwona Winiarska @ 2024-04-17 13:48 UTC (permalink / raw)
  To: openbmc, linux-kernel, linux-aspeed, linux-arm-kernel
  Cc: Billy Tsai, Iwona Winiarska

PECI clock divider is programmed on 10:8 bits of PECI Control register.
Before setting a new value, clear bits read from hardware.

Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
---
 drivers/peci/controller/peci-aspeed.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 7fdc25afcf2f..de7046e6b9c4 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -351,6 +351,7 @@ static int clk_aspeed_peci_set_rate(struct clk_hw *hw, unsigned long rate,
 	clk_aspeed_peci_find_div_values(this_rate, &msg_timing, &clk_div_exp);
 
 	val = readl(aspeed_peci->base + ASPEED_PECI_CTRL);
+	val &= ~ASPEED_PECI_CTRL_CLK_DIV_MASK;
 	val |= FIELD_PREP(ASPEED_PECI_CTRL_CLK_DIV_MASK, clk_div_exp);
 	writel(val, aspeed_peci->base + ASPEED_PECI_CTRL);
 
-- 
2.44.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-12  2:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 13:48 [PATCH] peci: aspeed: Clear clock_divider value before setting it Iwona Winiarska
2024-04-17 23:41 ` Andrew Jeffery
2024-04-18 13:41   ` Winiarska, Iwona
2024-04-18 23:25     ` Andrew Jeffery
2024-06-12  2:23       ` Billy Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome