MX6: Correct calculation of PLL_SYS
PATCH 1/1 MX6: Correct calculation of PLL_SYS
DIV_SELECT is used as Fout = Fin * div_select / 2.0, so we should do the shift after the multiply to avoid rounding errors
Signed-off-by Andre Renaud <[email protected]>
--- arch/arm/cpu/armv7/mx6/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/mx6/clock.c +1 -1
@@ -80,7 +80,7 @@ static u32 decode_pll(enum pll_clocks pll, u32 infreq) div =__raw_readl (&imx_ccm->analog_pll_sys); div &=BM_ANADIG_PLL_SYS_DIV_SELECT ; -return infreq * (div >>1 ); +return (infreq * div) >>1 ;case PLL_BUS : div =__raw_readl (&imx_ccm->analog_pll_528); div &=BM_ANADIG_PLL_528_DIV_SELECT ;
Signature · 1 line
1.7.9.5
PATCH 1/1 MX6: Correct calculation of PLL_SYS
arch/arm/cpu/armv7/mx6/clock.c
Quoted 11 lines · Andre Renaud
DIV_SELECTis used as Fout = Fin *div_select/ 2.0, so we should do the shift after the multiply to avoid rounding errorsSigned-off-by Andre Renaud <[email protected]>--- arch/arm/cpu/armv7/mx6/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/cpu/armv7/mx6/clock.c +0
-1--- a/arch/arm/cpu/armv7/mx6/clock.c
Applied to u-boot-imx, as a fix, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================