imx8ulp: clock: Fix lcd clock algo
Subsystems (3)
PATCH 1/1 imx8ulp: clock: Fix lcd clock algo
The div loop uses reassign and reuse parent_rate, which causes the parent rate reference to be wrong after the first loop, the resulting clock becomes incorrect for div != 1.
Fixes 829e06bf4175 ("imx8ulp: clock: Add MIPI DSI clock and DCNano clock")
Signed-off-by Loic Poulain <[email protected]>
--- arch/arm/mach-imx/imx8ulp/clock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm/mach-imx/imx8ulp/clock.c +2 -3
@@ -381,10 +381,9 @@ void mxs_set_lcdclk(u32 base_addr, u32 freq_in_khz)debug ("PLL4 rate %ukhz\n" , pll4_rate);for (pfd =12 ; pfd <=35 ; pfd++) { - parent_rate = pll4_rate; - parent_rate = parent_rate *18 / pfd; -for (div =1 ; div <=64 ; div++) { + parent_rate = pll4_rate; + parent_rate = parent_rate *18 / pfd; parent_rate = parent_rate / div;for (pcd =0 ; pcd <8 ; pcd++) {
Signature · 1 line
2.7.4
Quoted 6 lines · Loic Poulain
The div loop uses reassign and reuse
parent_rate, which causes the parent rate reference to be wrong after the first loop, the resulting clock becomes incorrect for div != 1.Fixes 829e06bf4175 ("imx8ulp: clock: Add MIPI DSI clock and DCNano clock")Signed-off-by Loic Poulain <[email protected]>
Reviewed-by Peng Fan <[email protected]>
Quoted 22 lines
--- arch/arm/mach-imx/imx8ulp/clock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)arch/arm/mach-imx/imx8ulp/clock.c +2
-3@@ -381,10 +381,9 @@ void mxs_set_lcdclk(u32 base_addr, u32 freq_in_khz)debug ("PLL4 rate %ukhz\n" , pll4_rate);for (pfd =12 ; pfd <=35 ; pfd++) { - parent_rate = pll4_rate; - parent_rate = parent_rate *18 / pfd; -for (div =1 ; div <=64 ; div++) { + parent_rate = pll4_rate; + parent_rate = parent_rate *18 / pfd; parent_rate = parent_rate / div;for (pcd =0 ; pcd <8 ; pcd++) {
PATCH 1/1 imx8ulp: clock: Fix lcd clock algo
In reply to Loic PoulainQuoted 6 lines
The div loop uses reassign and reuse
parent_rate, which causes the parent rate reference to be wrong after the first loop, the resulting clock becomes incorrect for div != 1.Fixes 829e06bf4175 ("imx8ulp: clock: Add MIPI DSI clock and DCNano clock")Signed-off-by Loic Poulain <[email protected]>Reviewed-by Peng Fan <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================