]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: imx: lpcg-scu: SW workaround for errata (e10858)
authorPeng Fan <peng.fan@nxp.com>
Sun, 27 Oct 2024 12:00:07 +0000 (20:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:01 +0000 (19:51 +0100)
commit55eb217f8f80d457a8e6d1bbe4d06359dd7ec07e
treef4514e104942b03f9e422533c562121c38ea4bbc
parent6ce29bc3bb9fc9ca33529339209b5783474a0ab1
clk: imx: lpcg-scu: SW workaround for errata (e10858)

[ Upstream commit 5ee063fac85656bea9cfe3570af147ba1701ba18 ]

Back-to-back LPCG writes can be ignored by the LPCG register due to
a HW bug. The writes need to be separated by at least 4 cycles of
the gated clock. See https://www.nxp.com.cn/docs/en/errata/IMX8_1N94W.pdf

The workaround is implemented as follows:
1. For clocks running greater than or equal to 24MHz, a read
followed by the write will provide sufficient delay.
2. For clocks running below 24MHz, add a delay of 4 clock cylces
after the write to the LPCG register.

Fixes: 2f77296d3df9 ("clk: imx: add lpcg clock support")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20241027-imx-clk-v1-v3-1-89152574d1d7@nxp.com
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/imx/clk-lpcg-scu.c