ARM: i.MX28: shift frac value in _CLK_SET_RATE
Subsystems (3)
PATCH 1/1 ARM: i.MX28: shift frac value in _CLK_SET_RATE
Noticed when setting SSP0 in clk_set_rate, _CLK_SET_RATE attempts to reset the clock divider for the SSP0 parent clock, in this case IO0FRAC. Bits 24-29 of HW_CLKCTRL_FRAC0 are cleared correctly, but when the new frac value is written the value isn't shifted up to write the correct bit-field. This results in IO0FRAC being set to 0 and CPUFRAC being corrupted.
This should occur when writing IO1FRAC, EMIFRAC in HW_CLKCTRL_FRAC0 and GPMIFRAC, HSADCFRAC in HW_CLKCTRL_FRAC1.
Tested on custom i.MX28 board with SSP0 SPI driver.
--- arch/arm/mach-mxs/clock-mx28.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mxs/clock-mx28.c +1 -1
@@ -349,7 +349,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \ \ reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ reg &= ~BM_CLKCTRL_##fr##_##fs##FRAC; \ - reg |= frac; \ + reg |= frac<<BP_CLKCTRL_##fr##_##fs##FRAC; \ __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ } \ \
Signature · 1 line
1.7.1
PATCH 1/1 ARM: i.MX28: shift frac value in _CLK_SET_RATE
Quoted 7 lines · Matt Burtch
Noticed when setting SSP0 in
clk_set_rate,_CLK_SET_RATEattempts to reset the clock divider for the SSP0 parent clock, in this case IO0FRAC. Bits 24-29 ofHW_CLKCTRL_FRAC0are cleared correctly, but when the new frac value is written the value isn't shifted up to write the correct bit-field. This results in IO0FRAC being set to 0 and CPUFRAC being corrupted.
Quoted 6 lines
This should occur when writing IO1FRAC, EMIFRAC in
HW_CLKCTRL_FRAC0and GPMIFRAC, HSADCFRAC inHW_CLKCTRL_FRAC1.Tested on custom i.MX28 board with SSP0 SPI driver.
Signed-off-by Matt Burtch <[email protected]>
Maybe 'Cc: stable at kernel.org'?
Quoted 9 lines
--- arch/arm/mach-mxs/clock-mx28.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/arm/mach-mxs/clock-mx28.c +0
-0
arch/arm/mach-mxs/clock-mx28.c static int name##_set_rate(struct clk *clk, unsigned long rate) \ · line 352
Quoted 5 lines
arch/arm/mach-mxs/clock-mx28.c +1
-1@@ -349,7 +349,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \ \ reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ reg &= ~BM_CLKCTRL_##fr##_##fs##FRAC; \ - reg |= frac; \ + reg |= frac<<BP_CLKCTRL_##fr##_##fs##FRAC; \
Add space before and after "<<"?
arch/arm/mach-mxs/clock-mx28.c static int name##_set_rate(struct clk *clk, unsigned long rate) \ · line 355
Quoted 4 lines
arch/arm/mach-mxs/clock-mx28.c +0
-0__raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##fr); \ } \ \
Otherwise,
Signature · 2 lines
Regards, Shawn