All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Peng Fan <peng.fan@nxp.com>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	Abel Vesa <abelvesa@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock features
Date: Mon, 18 Mar 2024 15:07:42 +0100	[thread overview]
Message-ID: <20240318140742.3pfn5h6wqhbtgbmj@pengutronix.de> (raw)
In-Reply-To: <DU0PR04MB94177A4081547764F600635E882D2@DU0PR04MB9417.eurprd04.prod.outlook.com>

On 24-03-18, Peng Fan wrote:
> > Subject: Re: [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock
> > features
> > 
> > On 24-03-18, Peng Fan wrote:
> > > Hi Marco,
> > >
> > > > Subject: Re: [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock
> > > > features
> > > >
> > > > Hi Peng,
> > > >
> > > > thank for the patchset.
> > > >
> > > > On 24-03-14, Peng Fan (OSS) wrote:
> > > > > i.MX95's several MIXes has BLK CTL module which could be used for
> > > > > clk settings, QoS settings, Misc settings for a MIX. This patchset
> > > > > is to add the clk feature support, including dt-bindings
> > > >
> > > > I have to ask since there is almost no public documentation
> > > > available yet. The
> > > > i.MX95 does have an system-controller for managing pinmux settings
> > > > and power-domains, right?
> > >
> > > Yes.
> > >
> > > If this is the case, why not making use of it via the
> > > > standard scmi_pm_domain.c driver?
> > >
> > > The SCMI firmware not handle the BLK CTL stuff, but blk ctl stuff is a
> > > mix of clk, qos, module specific things. It is not good for SCMI
> > > firmare to handle it.
> > 
> > Currently most of the blk-ctrl users do use the blk-ctrl as power-domain
> > consumer, except for the isi and the audio part. 
> 
> Yes, for i.MX8M.
> 
> > So as I said above the
> > scmi_pm_domain.c should be able to supply this. The audio blk-ctrl could be
> > abstracted via the clk-scmi.c driver. The ISI is another topic.
> 
> Pengutronix rejected the efforts for putting blk ctrl stuff in ATF for i.MX8M
> before. So we take the kernel power domain approach to handle blk ctrl
> clk gating.

AFAIK the problem here was that your proposal had an layering violation
even worse it was an layering inversion since the TF-A (lower layer)
code updated CCM registers which were under control of Linux (upper
layer).

> > What you're are going to do here is to put pinctrl etc into SCMI firmware and
> > power-control into Linux, which sound to me like an 50/50 approach and
> > IMHO is rather sub-optimal. 
> 
> Now back to i.MX95 which supports function safety.
> 
> The SCMI firmware only handle CCM/SRC/GPC for clock/power, it not
> handle blk ctrl.

I know that.

> The BLK CTRL registers are not only for clk gating, it has other
> module specific functions.

I suspected that this is the case for i.MX95 too :/

> Moving BLK CTRL to SCMI firmware, means linux accessing module
> specific functions needs go through vendor SCMI protocol.

Right and here it's a bit complicated to have an proper interface.
Therefore I'm not again the solution of keeping the blk-ctrl within
Linux.

> And BLK CTRL stuff is MIX level stuff, it is not SOC level stuff as
> CCM which is system critical resource.

Hm.. it's still SoC level albeit the area is more limited to specific
functions like HSIO, MEDIA, GPU, ...

> (BLK CTLR, I mean non system critical BLK CTRL, such as GPU,VPU,DISP)

What's system critical is up to the system design but I get your point
that having an safe DISP stack is not going to happen.

> The other approach is to let ATF as SCMI server to handle BLK CTRL stuff,
> But I not see benefits.

How is that any different from putting it into the system-controller
firmware.

> > To quote your online available fact sheet:
> > 
> > 8<----------------------------------------------------------
> > ENERGY FLEX ARCHITECTURE
> > 
> > The i,MX 95 family is designed to be configurable and scalable, with multiple
> > heterogenous processing domains.
> > This includes an application domain with up to 6 Arm Cortex A55 cores, a
> > high-performance real-time domain with Arm Cortex M7, and low-
> > power/safety domain with Arm Cortex M33, each able to access interfaces
> > including CAN-FD, 10GbE networking, PCIe Gen 3 x1 interfaces, and
> > accelerators such as V2X, ISP, and VPU.
> > 8<----------------------------------------------------------
> > 
> > 8<----------------------------------------------------------
> > HIGH-PERFORMANCE COMPUTE
> > The i.MX 95 family capabilities include a multi-core application domain with
> > up to six Arm Cortex(r)-A55 cores, as well as two independent real-time
> > domains for safety/low-power, and high-performance real-time use,
> > consisting of high-performance Arm Cortex-M7 and Arm Cortex-M33 CPUs,
> > combining low-power, real-time, and high-performance processing. The i.MX
> > 95 family is designed to enable ISO 26262 ASIL-B and SIL-2 IEC 61508
> > compliant platforms, with the safety domain serving as a critical capability for
> > many automotive and industrial applications.
> > ...
> > 8<----------------------------------------------------------
> > 
> > To me this sound like we can turn of the power/clock of an hardware block
> > which was assigned to a core running SIL-2 certified software from an non-
> > critical core running Linux if we follow that approach. Also the
> > SIL-2 software requires the non-critical software to turn on the power of these
> > hardware blocks. Is this correct?
> 
> Non-critical software not able to turn off power/clock of a critical resource in
> safety software domain.
> Safety software not require non-safety software to turn on power/clocks.

Due to lack of documentation I don't know how you implemented this in
HW/SW, also the system-design is telling us which parts should be seen
as safe and which don't. However I get your point, VPUMIX is not going
to be a part of the safe partition albeit it "could" due to complexity.

> CCM/SRC/GPC is handled by SCMI firmware, agent w/o safety needs use
> SCMI API to request SCMI firmware to enable clock/power for a module.
> The SCMI firmware will check whether the agent is allowed to touch
> a clock entry or a power entry.

I got this. I still don't like the 50/50 approach but I also get your
point about the GPR registers which is the only valid argument to me of
not putting the blk-ctrl handling into the system-controller firmware.

Regards,
  Marco

WARNING: multiple messages have this Message-ID (diff)
From: Marco Felsch <m.felsch@pengutronix.de>
To: Peng Fan <peng.fan@nxp.com>
Cc: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	Abel Vesa <abelvesa@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock features
Date: Mon, 18 Mar 2024 15:07:42 +0100	[thread overview]
Message-ID: <20240318140742.3pfn5h6wqhbtgbmj@pengutronix.de> (raw)
In-Reply-To: <DU0PR04MB94177A4081547764F600635E882D2@DU0PR04MB9417.eurprd04.prod.outlook.com>

On 24-03-18, Peng Fan wrote:
> > Subject: Re: [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock
> > features
> > 
> > On 24-03-18, Peng Fan wrote:
> > > Hi Marco,
> > >
> > > > Subject: Re: [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock
> > > > features
> > > >
> > > > Hi Peng,
> > > >
> > > > thank for the patchset.
> > > >
> > > > On 24-03-14, Peng Fan (OSS) wrote:
> > > > > i.MX95's several MIXes has BLK CTL module which could be used for
> > > > > clk settings, QoS settings, Misc settings for a MIX. This patchset
> > > > > is to add the clk feature support, including dt-bindings
> > > >
> > > > I have to ask since there is almost no public documentation
> > > > available yet. The
> > > > i.MX95 does have an system-controller for managing pinmux settings
> > > > and power-domains, right?
> > >
> > > Yes.
> > >
> > > If this is the case, why not making use of it via the
> > > > standard scmi_pm_domain.c driver?
> > >
> > > The SCMI firmware not handle the BLK CTL stuff, but blk ctl stuff is a
> > > mix of clk, qos, module specific things. It is not good for SCMI
> > > firmare to handle it.
> > 
> > Currently most of the blk-ctrl users do use the blk-ctrl as power-domain
> > consumer, except for the isi and the audio part. 
> 
> Yes, for i.MX8M.
> 
> > So as I said above the
> > scmi_pm_domain.c should be able to supply this. The audio blk-ctrl could be
> > abstracted via the clk-scmi.c driver. The ISI is another topic.
> 
> Pengutronix rejected the efforts for putting blk ctrl stuff in ATF for i.MX8M
> before. So we take the kernel power domain approach to handle blk ctrl
> clk gating.

AFAIK the problem here was that your proposal had an layering violation
even worse it was an layering inversion since the TF-A (lower layer)
code updated CCM registers which were under control of Linux (upper
layer).

> > What you're are going to do here is to put pinctrl etc into SCMI firmware and
> > power-control into Linux, which sound to me like an 50/50 approach and
> > IMHO is rather sub-optimal. 
> 
> Now back to i.MX95 which supports function safety.
> 
> The SCMI firmware only handle CCM/SRC/GPC for clock/power, it not
> handle blk ctrl.

I know that.

> The BLK CTRL registers are not only for clk gating, it has other
> module specific functions.

I suspected that this is the case for i.MX95 too :/

> Moving BLK CTRL to SCMI firmware, means linux accessing module
> specific functions needs go through vendor SCMI protocol.

Right and here it's a bit complicated to have an proper interface.
Therefore I'm not again the solution of keeping the blk-ctrl within
Linux.

> And BLK CTRL stuff is MIX level stuff, it is not SOC level stuff as
> CCM which is system critical resource.

Hm.. it's still SoC level albeit the area is more limited to specific
functions like HSIO, MEDIA, GPU, ...

> (BLK CTLR, I mean non system critical BLK CTRL, such as GPU,VPU,DISP)

What's system critical is up to the system design but I get your point
that having an safe DISP stack is not going to happen.

> The other approach is to let ATF as SCMI server to handle BLK CTRL stuff,
> But I not see benefits.

How is that any different from putting it into the system-controller
firmware.

> > To quote your online available fact sheet:
> > 
> > 8<----------------------------------------------------------
> > ENERGY FLEX ARCHITECTURE
> > 
> > The i,MX 95 family is designed to be configurable and scalable, with multiple
> > heterogenous processing domains.
> > This includes an application domain with up to 6 Arm Cortex A55 cores, a
> > high-performance real-time domain with Arm Cortex M7, and low-
> > power/safety domain with Arm Cortex M33, each able to access interfaces
> > including CAN-FD, 10GbE networking, PCIe Gen 3 x1 interfaces, and
> > accelerators such as V2X, ISP, and VPU.
> > 8<----------------------------------------------------------
> > 
> > 8<----------------------------------------------------------
> > HIGH-PERFORMANCE COMPUTE
> > The i.MX 95 family capabilities include a multi-core application domain with
> > up to six Arm Cortex(r)-A55 cores, as well as two independent real-time
> > domains for safety/low-power, and high-performance real-time use,
> > consisting of high-performance Arm Cortex-M7 and Arm Cortex-M33 CPUs,
> > combining low-power, real-time, and high-performance processing. The i.MX
> > 95 family is designed to enable ISO 26262 ASIL-B and SIL-2 IEC 61508
> > compliant platforms, with the safety domain serving as a critical capability for
> > many automotive and industrial applications.
> > ...
> > 8<----------------------------------------------------------
> > 
> > To me this sound like we can turn of the power/clock of an hardware block
> > which was assigned to a core running SIL-2 certified software from an non-
> > critical core running Linux if we follow that approach. Also the
> > SIL-2 software requires the non-critical software to turn on the power of these
> > hardware blocks. Is this correct?
> 
> Non-critical software not able to turn off power/clock of a critical resource in
> safety software domain.
> Safety software not require non-safety software to turn on power/clocks.

Due to lack of documentation I don't know how you implemented this in
HW/SW, also the system-design is telling us which parts should be seen
as safe and which don't. However I get your point, VPUMIX is not going
to be a part of the safe partition albeit it "could" due to complexity.

> CCM/SRC/GPC is handled by SCMI firmware, agent w/o safety needs use
> SCMI API to request SCMI firmware to enable clock/power for a module.
> The SCMI firmware will check whether the agent is allowed to touch
> a clock entry or a power entry.

I got this. I still don't like the 50/50 approach but I also get your
point about the GPR registers which is the only valid argument to me of
not putting the blk-ctrl handling into the system-controller firmware.

Regards,
  Marco

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

  reply	other threads:[~2024-03-18 14:08 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 13:25 [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock features Peng Fan (OSS)
2024-03-14 13:25 ` Peng Fan (OSS)
2024-03-14 13:25 ` [PATCH v4 1/6] dt-bindindgs: clock: nxp: support i.MX95 VPU CSR module Peng Fan (OSS)
2024-03-14 13:25   ` Peng Fan (OSS)
2024-03-15 16:54   ` Rob Herring
2024-03-15 16:54     ` Rob Herring
2024-03-15 20:47   ` Krzysztof Kozlowski
2024-03-15 20:47     ` Krzysztof Kozlowski
2024-03-18  7:15     ` Peng Fan
2024-03-18  7:15       ` Peng Fan
2024-03-14 13:25 ` [PATCH v4 2/6] dt-bindindgs: clock: nxp: support i.MX95 Camera " Peng Fan (OSS)
2024-03-14 13:25   ` Peng Fan (OSS)
2024-03-15 17:24   ` Rob Herring
2024-03-15 17:24     ` Rob Herring
2024-03-14 13:25 ` [PATCH v4 3/6] dt-bindindgs: clock: nxp: support i.MX95 Display Master " Peng Fan (OSS)
2024-03-14 13:25   ` Peng Fan (OSS)
2024-03-15 17:26   ` Rob Herring
2024-03-15 17:26     ` Rob Herring
2024-03-14 13:25 ` [PATCH v4 4/6] dt-bindindgs: clock: nxp: support i.MX95 LVDS " Peng Fan (OSS)
2024-03-14 13:25   ` Peng Fan (OSS)
2024-03-15 17:27   ` Rob Herring
2024-03-15 17:27     ` Rob Herring
2024-03-14 13:25 ` [PATCH v4 5/6] dt-bindindgs: clock: nxp: support i.MX95 Display " Peng Fan (OSS)
2024-03-14 13:25   ` Peng Fan (OSS)
2024-03-15 20:49   ` Krzysztof Kozlowski
2024-03-15 20:49     ` Krzysztof Kozlowski
2024-03-18 12:37     ` Peng Fan
2024-03-18 12:37       ` Peng Fan
2024-03-18 15:44       ` Krzysztof Kozlowski
2024-03-18 15:44         ` Krzysztof Kozlowski
2024-03-14 13:25 ` [PATCH v4 6/6] clk: imx: add i.MX95 BLK CTL clk driver Peng Fan (OSS)
2024-03-14 13:25   ` Peng Fan (OSS)
2024-03-17 15:59 ` [PATCH v4 0/6] Add support i.MX95 BLK CTL module clock features Marco Felsch
2024-03-17 15:59   ` Marco Felsch
2024-03-18  1:22   ` Peng Fan
2024-03-18  1:22     ` Peng Fan
2024-03-18  9:59     ` Marco Felsch
2024-03-18  9:59       ` Marco Felsch
2024-03-18 11:01       ` Peng Fan
2024-03-18 11:01         ` Peng Fan
2024-03-18 14:07         ` Marco Felsch [this message]
2024-03-18 14:07           ` Marco Felsch
2024-03-18 23:11           ` Peng Fan
2024-03-18 23:11             ` Peng Fan
2024-03-19  7:17             ` Marco Felsch
2024-03-19  7:17               ` Marco Felsch

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=20240318140742.3pfn5h6wqhbtgbmj@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=abelvesa@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=robh@kernel.org \
    --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.