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

clk: imx: imx93: add mcore_booted module paratemter

Add mcore_booted boot parameter which could simplify AMP clock
management. To i.MX93, there is CCM(clock control Module) to generate
clock root clock, anatop(analog PLL module) to generate PLL, and LPCG
(clock gating) to gate clocks to peripherals. As below:
anatop->ccm->lpcg->peripheral

Linux handles the clock management and the auxiliary core is under
control of Linux. Although there is per hardware domain control for LPCG
and CCM, auxiliary core normally only use LPCG hardware domain control
to avoid linux gate off the clk to peripherals and leave CCM ana anatop
to Linux.

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

authored by

Peng Fan and committed by
Abel Vesa
a740d735 e0408971

+9 -1
+7 -1
drivers/clk/imx/clk-composite-93.c
··· 222 222 hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 223 223 mux_hw, &clk_mux_ro_ops, div_hw, 224 224 &clk_divider_ro_ops, NULL, NULL, flags); 225 - } else { 225 + } else if (!mcore_booted) { 226 226 gate = kzalloc(sizeof(*gate), GFP_KERNEL); 227 227 if (!gate) 228 228 goto fail; ··· 236 236 hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 237 237 mux_hw, &imx93_clk_composite_mux_ops, div_hw, 238 238 &imx93_clk_composite_divider_ops, gate_hw, 239 + &imx93_clk_composite_gate_ops, 240 + flags | CLK_SET_RATE_NO_REPARENT); 241 + } else { 242 + hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, 243 + mux_hw, &imx93_clk_composite_mux_ops, div_hw, 244 + &imx93_clk_composite_divider_ops, NULL, 239 245 &imx93_clk_composite_gate_ops, 240 246 flags | CLK_SET_RATE_NO_REPARENT); 241 247 }
+2
drivers/clk/imx/clk-imx93.c
··· 352 352 }, 353 353 }; 354 354 module_platform_driver(imx93_clk_driver); 355 + module_param(mcore_booted, bool, 0444); 356 + MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not"); 355 357 356 358 MODULE_DESCRIPTION("NXP i.MX93 clock driver"); 357 359 MODULE_LICENSE("GPL v2");