clk: microchip: mpfs: don't reset disabled peripherals
Subsystems (3)
Conor Dooley
maintainerPATCH v2 1/1 clk: microchip: mpfs: don't reset disabled peripherals
The current clock driver for PolarFire SoC puts the hardware behind "periph" clocks into reset if their clock is disabled. CONFIG_PM was recently added to the riscv defconfig and exposed issues caused by this behaviour, where the Cadence GEM was being put into reset between its bringup & the PHY bringup:
https://lore.kernel.org/linux-riscv/[email protected]/
Fix this (for now) by removing the reset from mpfs_periph_clk_disable.
---
Changes since v1:
The first stage bootloader takes most, but not all, of the peripherals out of reset. In v1 all code touching the reset reg was removed, but in v2 the code taking peripherals out of reset is kept to cover the edge case peripherals.
The permanent fix will be to move the reset stuff its own driver.
drivers/clk/microchip/clk-mpfs.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/clk/microchip/clk-mpfs.c +0 -4
@@ -200,10 +200,6 @@ static void mpfs_periph_clk_disable(struct clk_hw *hw)spin_lock_irqsave (&mpfs_clk_lock, flags); - reg =readl_relaxed (base_addr +REG_SUBBLK_RESET_CR ); - val = reg | (1u << periph->shift); -writel_relaxed (val, base_addr +REG_SUBBLK_RESET_CR ); - reg =readl_relaxed (base_addr +REG_SUBBLK_CLOCK_CR ); val = reg & ~(1u << periph->shift);writel_relaxed (val, base_addr +REG_SUBBLK_CLOCK_CR );
Signature · 1 line
2.35.1
Quoting Conor Dooley (2022-04-11 00:23:41)
Quoted 6 lines
The current clock driver for PolarFire SoC puts the hardware behind "periph" clocks into reset if their clock is disabled.
CONFIG_PMwas recently added to the riscv defconfig and exposed issues caused by this behaviour, where the Cadence GEM was being put into reset between its bringup & the PHY bringup:
Quoted 8 lines
https://lore.kernel.org/linux-riscv/[email protected]/
Fix this (for now) by removing the reset from
mpfs_periph_clk_disable.Fixes 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC")Reviewed-by Daire McNamara <[email protected]>Signed-off-by Conor Dooley <[email protected]>---
Applied to clk-fixes
[email protected]
maintainerQuoted 11 lines · Stephen Boyd
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Quoting Conor Dooley (2022-04-11 00:23:41)
Quoted 8 lines
The current clock driver for PolarFire SoC puts the hardware behind "periph" clocks into reset if their clock is disabled.
CONFIG_PMwas recently added to the riscv defconfig and exposed issues caused by this behaviour, where the Cadence GEM was being put into reset between its bringup & the PHY bringup:
Quoted 8 lines
Quoted 6 lines
Fix this (for now) by removing the reset from
mpfs_periph_clk_disable.Fixes 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC")Reviewed-by Daire McNamara <[email protected]>Signed-off-by Conor Dooley <[email protected]>---
Applied to clk-fixes
thanks!