Skip to content

clk: imx: add i.MX93 clk gate

Steve Best requested to merge sfbest/centos-stream-9:2181924 into main

Bugzilla: http://bugzilla.redhat.com/2181924

Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=51590819

Tested: Did sanity boot testing on (nxp-imx8mquad-01.edge1) system.

commit 0836c8604a0bfaed2396d7e2aecb4146f8c07cca Author: Peng Fan peng.fan@nxp.com Date: Tue Aug 30 11:31:34 2022 +0800

clk: imx: add i.MX93 clk gate

i.MX93 LPCG is different from i.MX8M CCGR. Although imx_clk_hw_gate4_flags
is used here, it not strictly match i.MX93. i.MX93 has such design:
 - LPCG_DIRECT use BIT0 as on/off gate when LPCG_AUTHEN CPU_LPM is 0
 - LPCG_LPM_CUR use BIT[2:0] as on/off gate when LPCG_AUTHEN CPU_LPM is 1

The current implementation suppose CPU_LPM is 0, and use LPCG_DIRECT
BIT[1:0] as on/off gate. Although BIT1 is touched, actually BIT1 is
reserved.

And imx_clk_hw_gate4_flags use mask 0x3 to determine whether the clk
is enabled or not, but i.MX93 LPCG only use BIT0 to control when CPU_LPM
is 0. So clk disabled unused during kernel boot not able to gate off
the unused clocks.

To match i.MX93 LPCG, introduce imx93_clk_gate.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20220830033137.4149542-6-peng.fan@oss.nxp.com

Signed-off-by: Steve Best sbest@redhat.com

Merge request reports