Skip to contentSkip to conversation

clk: at91: sam9x60: fix programmable clock prescaler

PATCH Applied [email protected] 2 participants 2 messages Dec 10, 2019 – Jan 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: at91: sam9x60: fix programmable clock prescaler

From: Eugen Hristev <[email protected]>

The prescaler works as parent rate divided by (PRES + 1) (is_pres_direct == 1) It does not work in the way of parent rate shifted to the right by (PRES + 1), which means division by 2^(PRES + 1) (is_pres_direct == 0)
Thus is_pres_direct must be enabled for this SoC, to make the right computation. This field was added in
commit 45b06682113b ("clk: at91: fix programmable clock for sama5d2") SAM9X60 has the same field as SAMA5D2 in the PCK

Fixes 01e2113de9a5 ("clk: at91: add sam9x60 pmc driver")
---
 drivers/clk/at91/sam9x60.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/at91/sam9x60.c +1 -0
index 86238d5..77398ae 100644
@@ -47,6 +47,7 @@ static const struct clk_programmable_layout sam9x60_programmable_layout = {
 	.pres_shift = 8,
 	.css_mask = 0x1f,
 	.have_slck_mck = 0,
+	.is_pres_direct = 1,
 };
 
 static const struct clk_pcr_layout sam9x60_pcr_layout = {
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

Quoting [email protected] (2019-12-10 03:25:19)

Quoted 10 lines

From: Eugen Hristev <[email protected]>

The prescaler works as parent rate divided by (PRES + 1) (is_pres_direct == 1) It does not work in the way of parent rate shifted to the right by (PRES + 1), which means division by 2^(PRES + 1) (is_pres_direct == 0)
Thus is_pres_direct must be enabled for this SoC, to make the right computation. This field was added in
commit 45b06682113b ("clk: at91: fix programmable clock for sama5d2") SAM9X60 has the same field as SAMA5D2 in the PCK

Quoted 3 lines
Fixes 01e2113de9a5 ("clk: at91: add sam9x60 pmc driver")

---

Applied to clk-next