sunxi: clock: H6/H616: Fix PLL clock factor encodings
authorAndre Przywara <andre.przywara@arm.com>
Wed, 5 May 2021 12:53:05 +0000 (13:53 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Sat, 10 Jul 2021 00:22:09 +0000 (01:22 +0100)
commitf9d1324775a08c7892b31b26f24169e024b665ec
tree60e14937a7a7a5e4535de7a14755775b7d812f0c
parent0d5824cbc9ee1e608c1597117aac1c129c519630
sunxi: clock: H6/H616: Fix PLL clock factor encodings

Most clock factors and dividers in the H6 PLLs use a "+1 encoding",
which we were missing on two occasions.

This fixes the MMC clock setup on the H6, which could be slightly off due
to the wrong parent frequency:
mmc 2 set mod-clk req 52000000 parent 1176000000 n 2 m 12 rate 49000000

Also the CPU frequency (PLL1) was a tad too high before.

For PLL5 (DRAM) we already accounted for this +1, but in the DRAM code
itself, not in the bit field macro. Move this there to be aligned with
what the other SoCs and other PLLs do.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h
arch/arm/mach-sunxi/clock_sun50i_h6.c
arch/arm/mach-sunxi/dram_sun50i_h6.c
arch/arm/mach-sunxi/dram_sun50i_h616.c