Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi-ng: h6: Fix clock divider range on some clocks

While comparing clocks between the H6 and H616, some of the M factor
ranges were found to be wrong: the manual says they are only covering
two bits [1:0], but our code had "5" in the number-of-bits field.

By writing 0xff into that register in U-Boot and via FEL, it could be
confirmed that bits [4:2] are indeed masked off, so the manual is right.

Change to number of bits in the affected clock's description.

Fixes: 524353ea480b ("clk: sunxi-ng: add support for the Allwinner H6 CCU")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210118000912.28116-1-andre.przywara@arm.com

authored by

Andre Przywara and committed by
Maxime Ripard
04ef6795 eec9d9b7

+4 -4
+4 -4
drivers/clk/sunxi-ng/ccu-sun50i-h6.c
··· 237 237 static SUNXI_CCU_MP_WITH_MUX(psi_ahb1_ahb2_clk, "psi-ahb1-ahb2", 238 238 psi_ahb1_ahb2_parents, 239 239 0x510, 240 - 0, 5, /* M */ 240 + 0, 2, /* M */ 241 241 8, 2, /* P */ 242 242 24, 2, /* mux */ 243 243 0); ··· 246 246 "psi-ahb1-ahb2", 247 247 "pll-periph0" }; 248 248 static SUNXI_CCU_MP_WITH_MUX(ahb3_clk, "ahb3", ahb3_apb1_apb2_parents, 0x51c, 249 - 0, 5, /* M */ 249 + 0, 2, /* M */ 250 250 8, 2, /* P */ 251 251 24, 2, /* mux */ 252 252 0); 253 253 254 254 static SUNXI_CCU_MP_WITH_MUX(apb1_clk, "apb1", ahb3_apb1_apb2_parents, 0x520, 255 - 0, 5, /* M */ 255 + 0, 2, /* M */ 256 256 8, 2, /* P */ 257 257 24, 2, /* mux */ 258 258 0); 259 259 260 260 static SUNXI_CCU_MP_WITH_MUX(apb2_clk, "apb2", ahb3_apb1_apb2_parents, 0x524, 261 - 0, 5, /* M */ 261 + 0, 2, /* M */ 262 262 8, 2, /* P */ 263 263 24, 2, /* mux */ 264 264 0);