clk: imx: add mcore_booted module paratemter
authorPeng Fan <peng.fan@nxp.com>
Mon, 28 Feb 2022 12:41:11 +0000 (20:41 +0800)
committerAbel Vesa <abel.vesa@nxp.com>
Tue, 12 Apr 2022 08:17:43 +0000 (11:17 +0300)
Add mcore_booted boot parameter which could simplify AMP clock
management. To i.MX8M, there is CCM(clock control Module) to generate
clock root clock, anatop(analog PLL module) to generate PLL, and CCGR
(clock gating) to gate clocks to peripherals. As below:
  anatop->ccm->ccgr->peripheral

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

Per NXP hardware design, because CCGR already support gate to
peripherals, and clk root gate power leakage is negligible. So
when in AMP case, we could not register the clk root gate.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/20220228124112.3974242-1-peng.fan@oss.nxp.com
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
drivers/clk/imx/clk-imx8mm.c
drivers/clk/imx/clk-imx8mn.c
drivers/clk/imx/clk-imx8mp.c
drivers/clk/imx/clk-imx8mq.c
drivers/clk/imx/clk.c
drivers/clk/imx/clk.h

index e8cbe181ec06d6dfe4739bf42da669e7539a44fa..a452fd1bb8914921b358546ff5a4fcdb8515a051 100644 (file)
@@ -639,6 +639,8 @@ static struct platform_driver imx8mm_clk_driver = {
        },
 };
 module_platform_driver(imx8mm_clk_driver);
+module_param(mcore_booted, bool, S_IRUGO);
+MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
 
 MODULE_AUTHOR("Bai Ping <ping.bai@nxp.com>");
 MODULE_DESCRIPTION("NXP i.MX8MM clock driver");
index 92fcbab4f5bee3747e0695c0b23ce9f2fbbc5079..dc69b7464b3d20727c9f4db9328e753ab48d431d 100644 (file)
@@ -594,6 +594,8 @@ static struct platform_driver imx8mn_clk_driver = {
        },
 };
 module_platform_driver(imx8mn_clk_driver);
+module_param(mcore_booted, bool, S_IRUGO);
+MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
 
 MODULE_AUTHOR("Anson Huang <Anson.Huang@nxp.com>");
 MODULE_DESCRIPTION("NXP i.MX8MN clock driver");
index 18f5b7c3ca9d878f35f9390de38396165618c977..250e45d9f844d17820766dde41762ba6bd069988 100644 (file)
@@ -721,6 +721,8 @@ static struct platform_driver imx8mp_clk_driver = {
        },
 };
 module_platform_driver(imx8mp_clk_driver);
+module_param(mcore_booted, bool, S_IRUGO);
+MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
 
 MODULE_AUTHOR("Anson Huang <Anson.Huang@nxp.com>");
 MODULE_DESCRIPTION("NXP i.MX8MP clock driver");
index a9e69b6355edcdea88c2c572bd57acc07d4e671a..9f57b06b143c1a5278db3e0a891d9ae65c9d438d 100644 (file)
@@ -632,6 +632,8 @@ static struct platform_driver imx8mq_clk_driver = {
        },
 };
 module_platform_driver(imx8mq_clk_driver);
+module_param(mcore_booted, bool, S_IRUGO);
+MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
 
 MODULE_AUTHOR("Abel Vesa <abel.vesa@nxp.com>");
 MODULE_DESCRIPTION("NXP i.MX8MQ clock driver");
index 7cc669934253a210e300b5e9d597091e9a6b1897..4bd6ad060eea588abfc3670cb20431f66f265635 100644 (file)
@@ -17,6 +17,9 @@
 DEFINE_SPINLOCK(imx_ccm_lock);
 EXPORT_SYMBOL_GPL(imx_ccm_lock);
 
+bool mcore_booted;
+EXPORT_SYMBOL_GPL(mcore_booted);
+
 void imx_unregister_clocks(struct clk *clks[], unsigned int count)
 {
        unsigned int i;
index a7cbbcd1a3f46b5e74107920edd0f0275f92b1a4..5061a06468df8d0bc78329179b30a323ba87eb0a 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/clk-provider.h>
 
 extern spinlock_t imx_ccm_lock;
+extern bool mcore_booted;
 
 void imx_check_clocks(struct clk *clks[], unsigned int count);
 void imx_check_clk_hws(struct clk_hw *clks[], unsigned int count);