Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx: Add some delay before deassert the reset

Some of the PCCs on i.MX8ULP have a sw_rst bit to control the peripheral
reset through SW method. For peripherals like GPU that need sync reset,
some delay is necessary befere & after release the reset to make sure the
HW is reset into a known status. So add some delay before & after release
reset.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20250801072153.1974428-1-ping.bai@nxp.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

authored by

Jacky Bai and committed by
Abel Vesa
25b47635 3a866087

+13
+13
drivers/clk/imx/clk-composite-7ulp.c
··· 7 7 8 8 #include <linux/bits.h> 9 9 #include <linux/clk-provider.h> 10 + #include <linux/delay.h> 10 11 #include <linux/err.h> 11 12 #include <linux/io.h> 12 13 #include <linux/slab.h> ··· 37 36 if (ret) 38 37 return ret; 39 38 39 + /* Make sure the IP's clock is ready before release reset */ 40 + udelay(1); 41 + 40 42 spin_lock_irqsave(gate->lock, flags); 41 43 /* 42 44 * release the sw reset for peripherals associated with ··· 50 46 writel(val, gate->reg); 51 47 52 48 spin_unlock_irqrestore(gate->lock, flags); 49 + 50 + /* 51 + * Read back the register to make sure the previous write has been 52 + * done in the target HW register. For IP like GPU, after deassert 53 + * the reset, need to wait for a while to make sure the sync reset 54 + * is done 55 + */ 56 + readl(gate->reg); 57 + udelay(1); 53 58 54 59 return 0; 55 60 }