All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@nxp.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH V2 1/2] clk: imx: add mcore_booted module paratemter
Date: Tue, 12 Apr 2022 10:58:50 +0300	[thread overview]
Message-ID: <YlUxOjpk3i0dSxGR@abelvesa> (raw)
In-Reply-To: <20220228124112.3974242-1-peng.fan@oss.nxp.com>

On 22-02-28 20:41:11, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> 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>

I agree with this approach since every other option complicates things
more.

Reviewed-by: Abel Vesa <abel.vesa@nxp.com>

> ---
>
> V2:
>  Switch to use module parameter, tested on i.MX8MP-EVK
>
>  drivers/clk/imx/clk-imx8mm.c | 2 ++
>  drivers/clk/imx/clk-imx8mn.c | 2 ++
>  drivers/clk/imx/clk-imx8mp.c | 2 ++
>  drivers/clk/imx/clk-imx8mq.c | 2 ++
>  drivers/clk/imx/clk.c        | 3 +++
>  drivers/clk/imx/clk.h        | 1 +
>  6 files changed, 12 insertions(+)
>
> diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
> index e8cbe181ec06..a452fd1bb891 100644
> --- a/drivers/clk/imx/clk-imx8mm.c
> +++ b/drivers/clk/imx/clk-imx8mm.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c
> index 92fcbab4f5be..dc69b7464b3d 100644
> --- a/drivers/clk/imx/clk-imx8mn.c
> +++ b/drivers/clk/imx/clk-imx8mn.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> index 18f5b7c3ca9d..250e45d9f844 100644
> --- a/drivers/clk/imx/clk-imx8mp.c
> +++ b/drivers/clk/imx/clk-imx8mp.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk-imx8mq.c b/drivers/clk/imx/clk-imx8mq.c
> index 83cc2b1c3294..33897b56130d 100644
> --- a/drivers/clk/imx/clk-imx8mq.c
> +++ b/drivers/clk/imx/clk-imx8mq.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
> index 7cc669934253..4bd6ad060eea 100644
> --- a/drivers/clk/imx/clk.c
> +++ b/drivers/clk/imx/clk.c
> @@ -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;
> diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
> index a7cbbcd1a3f4..5061a06468df 100644
> --- a/drivers/clk/imx/clk.h
> +++ b/drivers/clk/imx/clk.h
> @@ -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);
> --
> 2.25.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Abel Vesa <abel.vesa@nxp.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH V2 1/2] clk: imx: add mcore_booted module paratemter
Date: Tue, 12 Apr 2022 10:58:50 +0300	[thread overview]
Message-ID: <YlUxOjpk3i0dSxGR@abelvesa> (raw)
In-Reply-To: <20220228124112.3974242-1-peng.fan@oss.nxp.com>

On 22-02-28 20:41:11, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> 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>

I agree with this approach since every other option complicates things
more.

Reviewed-by: Abel Vesa <abel.vesa@nxp.com>

> ---
>
> V2:
>  Switch to use module parameter, tested on i.MX8MP-EVK
>
>  drivers/clk/imx/clk-imx8mm.c | 2 ++
>  drivers/clk/imx/clk-imx8mn.c | 2 ++
>  drivers/clk/imx/clk-imx8mp.c | 2 ++
>  drivers/clk/imx/clk-imx8mq.c | 2 ++
>  drivers/clk/imx/clk.c        | 3 +++
>  drivers/clk/imx/clk.h        | 1 +
>  6 files changed, 12 insertions(+)
>
> diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
> index e8cbe181ec06..a452fd1bb891 100644
> --- a/drivers/clk/imx/clk-imx8mm.c
> +++ b/drivers/clk/imx/clk-imx8mm.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk-imx8mn.c b/drivers/clk/imx/clk-imx8mn.c
> index 92fcbab4f5be..dc69b7464b3d 100644
> --- a/drivers/clk/imx/clk-imx8mn.c
> +++ b/drivers/clk/imx/clk-imx8mn.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
> index 18f5b7c3ca9d..250e45d9f844 100644
> --- a/drivers/clk/imx/clk-imx8mp.c
> +++ b/drivers/clk/imx/clk-imx8mp.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk-imx8mq.c b/drivers/clk/imx/clk-imx8mq.c
> index 83cc2b1c3294..33897b56130d 100644
> --- a/drivers/clk/imx/clk-imx8mq.c
> +++ b/drivers/clk/imx/clk-imx8mq.c
> @@ -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");
> diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c
> index 7cc669934253..4bd6ad060eea 100644
> --- a/drivers/clk/imx/clk.c
> +++ b/drivers/clk/imx/clk.c
> @@ -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;
> diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
> index a7cbbcd1a3f4..5061a06468df 100644
> --- a/drivers/clk/imx/clk.h
> +++ b/drivers/clk/imx/clk.h
> @@ -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);
> --
> 2.25.1
>

  parent reply	other threads:[~2022-04-12  8:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 12:41 [PATCH V2 1/2] clk: imx: add mcore_booted module paratemter Peng Fan (OSS)
2022-02-28 12:41 ` Peng Fan (OSS)
2022-02-28 12:41 ` [PATCH V2 2/2] clk: imx8m: check mcore_booted before register clk Peng Fan (OSS)
2022-02-28 12:41   ` Peng Fan (OSS)
2022-03-17 19:38   ` Stephen Boyd
2022-03-17 19:38     ` Stephen Boyd
2022-03-18  1:15     ` Peng Fan
2022-03-18  1:15       ` Peng Fan
2022-04-12  8:11   ` Abel Vesa
2022-04-12  8:11     ` Abel Vesa
2022-04-12  8:14     ` Abel Vesa
2022-04-12  8:14       ` Abel Vesa
2022-03-17 19:37 ` [PATCH V2 1/2] clk: imx: add mcore_booted module paratemter Stephen Boyd
2022-03-17 19:37   ` Stephen Boyd
2022-03-18  1:14   ` Peng Fan
2022-03-18  1:14     ` Peng Fan
2022-04-12  7:58 ` Abel Vesa [this message]
2022-04-12  7:58   ` Abel Vesa
2022-04-12 10:48 ` Abel Vesa
2022-04-12 10:48   ` Abel Vesa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YlUxOjpk3i0dSxGR@abelvesa \
    --to=abel.vesa@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.