linux_dsm_epyc7002/drivers/clk/st
Peter Griffin edc30077c9 clk: st: STiH410: Fix pdiv and fdiv divisor when setting rate
Debugging eMMC on upstream kernels it has been noticed that when the
targetpack configures MMC0 clock to 200Mhz (required to switch to
HS200) then everything works OK. However if the kernel sets the
clock rate using clk_set_rate, then the eMMC card initialisation
fails with timeouts. Lower clock speeds (the default being 50Mhz)
work ok, but they we fail to get good eMMC transfer rates.

Looking through the vendor kernel clock driver reveals Giuseppe
had already fixed this issue, but the patch hasn't made its way
upstream.

The issue is fixed by changing the logic to manage the pdiv and
fdiv divisors used for setting the rate inside the flexgen driver code.

Pdiv is mainly targeted for low freq results, while fdiv should be
used for divs =< 64. The other way can lead to 'duty cycle'
issues.

I have changed the original patch to keep the original behaviour
in cases where the div is >64 which matches the original comment
and patch description more closely. Although no clocks appear to hit
this case currently when booting an upstream kernel.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
2015-01-20 10:09:13 -08:00
..
clk-flexgen.c clk: st: STiH410: Fix pdiv and fdiv divisor when setting rate 2015-01-20 10:09:13 -08:00
clkgen-fsyn.c clk: st: Update frequency tables for fs660c32 and fs432c65 2014-07-28 22:37:09 -07:00
clkgen-mux.c clk: st: Use round to closest divider flag 2014-07-28 22:37:16 -07:00
clkgen-pll.c clk: st: STiH407: Support for clockgenA9 2014-07-28 22:37:04 -07:00
clkgen.h clk: st: Support for PLLs inside ClockGenA(s) 2014-03-25 15:58:56 -07:00
Makefile clk: st: STiH407: Support for Flexgen Clocks 2014-07-28 22:36:24 -07:00