[PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks

Peng Fan (OSS) posted 2 patches 3 years, 6 months ago
.../bindings/clock/imx8m-clock.yaml           |  4 ++++
.../bindings/clock/imx93-clock.yaml           |  4 ++++
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                         | 21 +++++++++++++++++++
drivers/clk/imx/clk.h                         |  2 ++
8 files changed, 39 insertions(+)
[PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks
Posted by Peng Fan (OSS) 3 years, 6 months ago
From: Peng Fan <peng.fan@nxp.com>

V3:
 Rename to fsl,always-on-clocks 

V2:
 Use protected-clocks
 https://lore.kernel.org/all/20220816130327.2987710-1-peng.fan@oss.nxp.com/

V1:
 Use fsl,protected-clocks
 https://lore.kernel.org/all/20220815033632.1687854-1-peng.fan@oss.nxp.com/

There are two cases that I wanna this property could serve:
Virtualization: root cell linux run in parallel with inmate cell
AMP: M7/4 runs in parallel with A53

The major case is:
Jailhouse hypervisor only support partition, so devices are partitioned.
But there is only CCM module that provides clock, the CCM is handled by
root cell linux, need make sure the root cell linux not shutdown the
clocks using by inmate cell.

I was thinking whether need to provide a rate entry to ask root cell
configure the clk rate for inmate cell. But NXP downstream not have it,
see https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/clk/imx/clk-imx8mp.c?h=lf-5.15.y#n690
So just leave the property as uint32-array.

This patchset could also benifit AMP case, check the two commits
commit 19565ea12d61 ("clk: imx: add mcore_booted module paratemter")
commit d097cc045b64 ("clk: imx8mp: remove SYS PLL 1/2 clock gates")
Although I not plan to drop the upper two patches, this patchset
exposes opportunity for better power consumption.

Peng Fan (2):
  dt-bindings: clock: imx8m/imx93: introduce fsl,always-on-clocks
    property
  clk: imx: support fsl,always-on-clocks

 .../bindings/clock/imx8m-clock.yaml           |  4 ++++
 .../bindings/clock/imx93-clock.yaml           |  4 ++++
 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                         | 21 +++++++++++++++++++
 drivers/clk/imx/clk.h                         |  2 ++
 8 files changed, 39 insertions(+)

-- 
2.37.1
Re: [PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks
Posted by Alexander Stein 3 years, 6 months ago
Hello,

Am Dienstag, 13. September 2022, 11:21:34 CEST schrieb Peng Fan (OSS):
> From: Peng Fan <peng.fan@nxp.com>
> 
> V3:
>  Rename to fsl,always-on-clocks
> 
> V2:
>  Use protected-clocks
>  https://lore.kernel.org/all/20220816130327.2987710-1-peng.fan@oss.nxp.com/
> 
> V1:
>  Use fsl,protected-clocks
>  https://lore.kernel.org/all/20220815033632.1687854-1-peng.fan@oss.nxp.com/
> 
> There are two cases that I wanna this property could serve:
> Virtualization: root cell linux run in parallel with inmate cell
> AMP: M7/4 runs in parallel with A53
> 
> The major case is:
> Jailhouse hypervisor only support partition, so devices are partitioned.
> But there is only CCM module that provides clock, the CCM is handled by
> root cell linux, need make sure the root cell linux not shutdown the
> clocks using by inmate cell.
> 
> I was thinking whether need to provide a rate entry to ask root cell
> configure the clk rate for inmate cell. But NXP downstream not have it,
> see
> https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/clk/imx/c
> lk-imx8mp.c?h=lf-5.15.y#n690 So just leave the property as uint32-array.
> 
> This patchset could also benifit AMP case, check the two commits
> commit 19565ea12d61 ("clk: imx: add mcore_booted module paratemter")
> commit d097cc045b64 ("clk: imx8mp: remove SYS PLL 1/2 clock gates")
> Although I not plan to drop the upper two patches, this patchset
> exposes opportunity for better power consumption.

Has this the same intention/effect as 'critical-clocks' from [1]? I guess in 
both cases you want to keep clocks enabled, even though there is no (local) 
user.

Best regards,
Alexander

[1] https://lore.kernel.org/linux-clk/20220517235919.200375-1-marex@denx.de/

> Peng Fan (2):
>   dt-bindings: clock: imx8m/imx93: introduce fsl,always-on-clocks
>     property
>   clk: imx: support fsl,always-on-clocks
> 
>  .../bindings/clock/imx8m-clock.yaml           |  4 ++++
>  .../bindings/clock/imx93-clock.yaml           |  4 ++++
>  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                         | 21 +++++++++++++++++++
>  drivers/clk/imx/clk.h                         |  2 ++
>  8 files changed, 39 insertions(+)
Re: [PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks
Posted by Marco Felsch 3 years, 6 months ago
Hi Peng,

On 22-09-13, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> V3:
>  Rename to fsl,always-on-clocks 
> 
> V2:
>  Use protected-clocks
>  https://lore.kernel.org/all/20220816130327.2987710-1-peng.fan@oss.nxp.com/
> 
> V1:
>  Use fsl,protected-clocks
>  https://lore.kernel.org/all/20220815033632.1687854-1-peng.fan@oss.nxp.com/
> 
> There are two cases that I wanna this property could serve:
> Virtualization: root cell linux run in parallel with inmate cell
> AMP: M7/4 runs in parallel with A53
> 
> The major case is:
> Jailhouse hypervisor only support partition, so devices are partitioned.
> But there is only CCM module that provides clock, the CCM is handled by
> root cell linux, need make sure the root cell linux not shutdown the
> clocks using by inmate cell.
> 
> I was thinking whether need to provide a rate entry to ask root cell
> configure the clk rate for inmate cell. But NXP downstream not have it,
> see https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/clk/imx/clk-imx8mp.c?h=lf-5.15.y#n690
> So just leave the property as uint32-array.

Can you please check my recent proposal? I recently stumbled over such
an issue on the mx8mm-evk as well but with the 32k clock provided by the
pmic. Unfortunately I forgot to add you to the to list, I will change
that. If that proposal will fix your problem, I would like to go the
generic way.

https://patchwork.kernel.org/project/linux-clk/list/?series=676522

Regards,
  Marco


> 
> This patchset could also benifit AMP case, check the two commits
> commit 19565ea12d61 ("clk: imx: add mcore_booted module paratemter")
> commit d097cc045b64 ("clk: imx8mp: remove SYS PLL 1/2 clock gates")
> Although I not plan to drop the upper two patches, this patchset
> exposes opportunity for better power consumption.
> 
> Peng Fan (2):
>   dt-bindings: clock: imx8m/imx93: introduce fsl,always-on-clocks
>     property
>   clk: imx: support fsl,always-on-clocks
> 
>  .../bindings/clock/imx8m-clock.yaml           |  4 ++++
>  .../bindings/clock/imx93-clock.yaml           |  4 ++++
>  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                         | 21 +++++++++++++++++++
>  drivers/clk/imx/clk.h                         |  2 ++
>  8 files changed, 39 insertions(+)
> 
> -- 
> 2.37.1
> 
> 
>
Re: [PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks
Posted by Krzysztof Kozlowski 3 years, 6 months ago
On 13/09/2022 12:29, Marco Felsch wrote:
> Hi Peng,
> 
> On 22-09-13, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> V3:
>>  Rename to fsl,always-on-clocks 
>>
>> V2:
>>  Use protected-clocks
>>  https://lore.kernel.org/all/20220816130327.2987710-1-peng.fan@oss.nxp.com/
>>
>> V1:
>>  Use fsl,protected-clocks
>>  https://lore.kernel.org/all/20220815033632.1687854-1-peng.fan@oss.nxp.com/
>>
>> There are two cases that I wanna this property could serve:
>> Virtualization: root cell linux run in parallel with inmate cell
>> AMP: M7/4 runs in parallel with A53
>>
>> The major case is:
>> Jailhouse hypervisor only support partition, so devices are partitioned.
>> But there is only CCM module that provides clock, the CCM is handled by
>> root cell linux, need make sure the root cell linux not shutdown the
>> clocks using by inmate cell.
>>
>> I was thinking whether need to provide a rate entry to ask root cell
>> configure the clk rate for inmate cell. But NXP downstream not have it,
>> see https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/clk/imx/clk-imx8mp.c?h=lf-5.15.y#n690
>> So just leave the property as uint32-array.
> 
> Can you please check my recent proposal? I recently stumbled over such
> an issue on the mx8mm-evk as well but with the 32k clock provided by the
> pmic. Unfortunately I forgot to add you to the to list, I will change
> that. If that proposal will fix your problem, I would like to go the
> generic way.
> 
> https://patchwork.kernel.org/project/linux-clk/list/?series=676522

Your proposal does not change bindings. You cannot introduce new
properties without documenting them in the bindings.

Unless you documented them somewhere, but this is no reflected in
Patchwork at all.


Best regards,
Krzysztof
Re: [PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks
Posted by Marco Felsch 3 years, 6 months ago
On 22-09-13, Krzysztof Kozlowski wrote:
> On 13/09/2022 12:29, Marco Felsch wrote:
> > Hi Peng,
> > 
> > On 22-09-13, Peng Fan (OSS) wrote:
> >> From: Peng Fan <peng.fan@nxp.com>
> >>
> >> V3:
> >>  Rename to fsl,always-on-clocks 
> >>
> >> V2:
> >>  Use protected-clocks
> >>  https://lore.kernel.org/all/20220816130327.2987710-1-peng.fan@oss.nxp.com/
> >>
> >> V1:
> >>  Use fsl,protected-clocks
> >>  https://lore.kernel.org/all/20220815033632.1687854-1-peng.fan@oss.nxp.com/
> >>
> >> There are two cases that I wanna this property could serve:
> >> Virtualization: root cell linux run in parallel with inmate cell
> >> AMP: M7/4 runs in parallel with A53
> >>
> >> The major case is:
> >> Jailhouse hypervisor only support partition, so devices are partitioned.
> >> But there is only CCM module that provides clock, the CCM is handled by
> >> root cell linux, need make sure the root cell linux not shutdown the
> >> clocks using by inmate cell.
> >>
> >> I was thinking whether need to provide a rate entry to ask root cell
> >> configure the clk rate for inmate cell. But NXP downstream not have it,
> >> see https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/clk/imx/clk-imx8mp.c?h=lf-5.15.y#n690
> >> So just leave the property as uint32-array.
> > 
> > Can you please check my recent proposal? I recently stumbled over such
> > an issue on the mx8mm-evk as well but with the 32k clock provided by the
> > pmic. Unfortunately I forgot to add you to the to list, I will change
> > that. If that proposal will fix your problem, I would like to go the
> > generic way.
> > 
> > https://patchwork.kernel.org/project/linux-clk/list/?series=676522
> 
> Your proposal does not change bindings. You cannot introduce new
> properties without documenting them in the bindings.

As said, it is a proposal. Bindings will be added if it would be
accepted.

Regards,
  Marco
Re: [PATCH V3 0/2] clk: imx: introduce fsl,always-on-clocks
Posted by Peng Fan 3 years, 6 months ago

On 9/13/2022 6:29 PM, Marco Felsch wrote:
> Hi Peng,
> 
> On 22-09-13, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> V3:
>>   Rename to fsl,always-on-clocks
>>
>> V2:
>>   Use protected-clocks
>>   https://lore.kernel.org/all/20220816130327.2987710-1-peng.fan@oss.nxp.com/
>>
>> V1:
>>   Use fsl,protected-clocks
>>   https://lore.kernel.org/all/20220815033632.1687854-1-peng.fan@oss.nxp.com/
>>
>> There are two cases that I wanna this property could serve:
>> Virtualization: root cell linux run in parallel with inmate cell
>> AMP: M7/4 runs in parallel with A53
>>
>> The major case is:
>> Jailhouse hypervisor only support partition, so devices are partitioned.
>> But there is only CCM module that provides clock, the CCM is handled by
>> root cell linux, need make sure the root cell linux not shutdown the
>> clocks using by inmate cell.
>>
>> I was thinking whether need to provide a rate entry to ask root cell
>> configure the clk rate for inmate cell. But NXP downstream not have it,
>> see https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/clk/imx/clk-imx8mp.c?h=lf-5.15.y#n690
>> So just leave the property as uint32-array.
> 
> Can you please check my recent proposal? I recently stumbled over such
> an issue on the mx8mm-evk as well but with the 32k clock provided by the
> pmic. Unfortunately I forgot to add you to the to list, I will change
> that. If that proposal will fix your problem, I would like to go the
> generic way.

I vote for a generic solution.

Thanks,
Peng.

> 
> https://patchwork.kernel.org/project/linux-clk/list/?series=676522
> 
> Regards,
>    Marco
> 
> 
>>
>> This patchset could also benifit AMP case, check the two commits
>> commit 19565ea12d61 ("clk: imx: add mcore_booted module paratemter")
>> commit d097cc045b64 ("clk: imx8mp: remove SYS PLL 1/2 clock gates")
>> Although I not plan to drop the upper two patches, this patchset
>> exposes opportunity for better power consumption.
>>
>> Peng Fan (2):
>>    dt-bindings: clock: imx8m/imx93: introduce fsl,always-on-clocks
>>      property
>>    clk: imx: support fsl,always-on-clocks
>>
>>   .../bindings/clock/imx8m-clock.yaml           |  4 ++++
>>   .../bindings/clock/imx93-clock.yaml           |  4 ++++
>>   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                         | 21 +++++++++++++++++++
>>   drivers/clk/imx/clk.h                         |  2 ++
>>   8 files changed, 39 insertions(+)
>>
>> -- 
>> 2.37.1
>>
>>
>>