diff mbox series

[1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports

Message ID 1580994086-17850-2-git-send-email-peng.fan@nxp.com
State Changes Requested, archived
Headers show
Series firmware: arm_scmi: add smc/hvc transports support | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Peng Fan Feb. 6, 2020, 1:01 p.m. UTC
From: Peng Fan <peng.fan@nxp.com>

SCMI could use SMC/HVC as tranports, so add into devicetree
binding doc.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Rob Herring Feb. 6, 2020, 9:59 p.m. UTC | #1
On Thu, Feb 06, 2020 at 09:01:25PM +0800, peng.fan@nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> SCMI could use SMC/HVC as tranports, so add into devicetree
> binding doc.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> index f493d69e6194..03cff8b55a93 100644
> --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> @@ -14,7 +14,7 @@ Required properties:
>  
>  The scmi node with the following properties shall be under the /firmware/ node.
>  
> -- compatible : shall be "arm,scmi"
> +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
>  - mboxes: List of phandle and mailbox channel specifiers. It should contain
>  	  exactly one or two mailboxes, one for transmitting messages("tx")
>  	  and another optional for receiving the notifications("rx") if
> @@ -25,6 +25,8 @@ The scmi node with the following properties shall be under the /firmware/ node.
>  	  protocol identifier for a given sub-node.
>  - #size-cells : should be '0' as 'reg' property doesn't have any size
>  	  associated with it.
> +- arm,smc-id : SMC id required when using smc transports
> +- arm,hvc-id : HVC id required when using hvc transports

Don't the SMC ids get standardized?

>  
>  Optional properties:
>  
> -- 
> 2.16.4
>
Peng Fan Feb. 7, 2020, 8:10 a.m. UTC | #2
> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> 
> On Thu, Feb 06, 2020 at 09:01:25PM +0800, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > SCMI could use SMC/HVC as tranports, so add into devicetree binding
> > doc.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > index f493d69e6194..03cff8b55a93 100644
> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > @@ -14,7 +14,7 @@ Required properties:
> >
> >  The scmi node with the following properties shall be under the /firmware/
> node.
> >
> > -- compatible : shall be "arm,scmi"
> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> >  - mboxes: List of phandle and mailbox channel specifiers. It should contain
> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> >  	  and another optional for receiving the notifications("rx") if @@
> > -25,6 +25,8 @@ The scmi node with the following properties shall be under
> the /firmware/ node.
> >  	  protocol identifier for a given sub-node.
> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> >  	  associated with it.
> > +- arm,smc-id : SMC id required when using smc transports
> > +- arm,hvc-id : HVC id required when using hvc transports
> 
> Don't the SMC ids get standardized?

For now, there is no standard SCMI SMC/HVC ID.

Sudeep, Is there any plan from ARM? Or how you think about this patch?

Thanks,
Peng.

> 
> >
> >  Optional properties:
> >
> > --
> > 2.16.4
> >
Marc Zyngier Feb. 7, 2020, 10:08 a.m. UTC | #3
On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> SCMI could use SMC/HVC as tranports, so add into devicetree
> binding doc.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> index f493d69e6194..03cff8b55a93 100644
> --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> @@ -14,7 +14,7 @@ Required properties:
> 
>  The scmi node with the following properties shall be under the 
> /firmware/ node.
> 
> -- compatible : shall be "arm,scmi"
> +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
>  - mboxes: List of phandle and mailbox channel specifiers. It should 
> contain
>  	  exactly one or two mailboxes, one for transmitting messages("tx")
>  	  and another optional for receiving the notifications("rx") if
> @@ -25,6 +25,8 @@ The scmi node with the following properties shall be
> under the /firmware/ node.
>  	  protocol identifier for a given sub-node.
>  - #size-cells : should be '0' as 'reg' property doesn't have any size
>  	  associated with it.
> +- arm,smc-id : SMC id required when using smc transports
> +- arm,hvc-id : HVC id required when using hvc transports
> 
>  Optional properties:

Not directly related to DT: Why do we need to distinguish between SMC 
and HVC?
Other SMC/HVC capable protocols are able to pick the right one based on 
the PSCI
conduit.

This is how the Spectre mitigations work already. Why is that any 
different?

Thanks,

         M.
Sudeep Holla Feb. 7, 2020, 10:47 a.m. UTC | #4
On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > SCMI could use SMC/HVC as tranports, so add into devicetree
> > binding doc.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > index f493d69e6194..03cff8b55a93 100644
> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > @@ -14,7 +14,7 @@ Required properties:
> >
> >  The scmi node with the following properties shall be under the
> > /firmware/ node.
> >
> > -- compatible : shall be "arm,scmi"
> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> >  - mboxes: List of phandle and mailbox channel specifiers. It should
> > contain
> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> >  	  and another optional for receiving the notifications("rx") if
> > @@ -25,6 +25,8 @@ The scmi node with the following properties shall be
> > under the /firmware/ node.
> >  	  protocol identifier for a given sub-node.
> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> >  	  associated with it.
> > +- arm,smc-id : SMC id required when using smc transports
> > +- arm,hvc-id : HVC id required when using hvc transports
> >
> >  Optional properties:
>
> Not directly related to DT: Why do we need to distinguish between SMC and
> HVC?

IIUC you want just one property to get the function ID ? Does that align
with what you are saying ? I wanted to ask the same question and I see
no need for 2 different properties.

> Other SMC/HVC capable protocols are able to pick the right one based on the
> PSCI conduit.
>

This make it clear, but I am asking to  be sure.

> This is how the Spectre mitigations work already. Why is that any different?
>

I don't see any need for it to be different.

--
Regards,
Sudeep
Marc Zyngier Feb. 7, 2020, 10:55 a.m. UTC | #5
On 2020-02-07 10:47, Sudeep Holla wrote:
> On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
>> On 2020-02-06 13:01, peng.fan@nxp.com wrote:
>> > From: Peng Fan <peng.fan@nxp.com>
>> >
>> > SCMI could use SMC/HVC as tranports, so add into devicetree
>> > binding doc.
>> >
>> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> > ---
>> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > index f493d69e6194..03cff8b55a93 100644
>> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > @@ -14,7 +14,7 @@ Required properties:
>> >
>> >  The scmi node with the following properties shall be under the
>> > /firmware/ node.
>> >
>> > -- compatible : shall be "arm,scmi"
>> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
>> >  - mboxes: List of phandle and mailbox channel specifiers. It should
>> > contain
>> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
>> >  	  and another optional for receiving the notifications("rx") if
>> > @@ -25,6 +25,8 @@ The scmi node with the following properties shall be
>> > under the /firmware/ node.
>> >  	  protocol identifier for a given sub-node.
>> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
>> >  	  associated with it.
>> > +- arm,smc-id : SMC id required when using smc transports
>> > +- arm,hvc-id : HVC id required when using hvc transports
>> >
>> >  Optional properties:
>> 
>> Not directly related to DT: Why do we need to distinguish between SMC 
>> and
>> HVC?
> 
> IIUC you want just one property to get the function ID ? Does that 
> align
> with what you are saying ? I wanted to ask the same question and I see
> no need for 2 different properties.

Exactly. Using SMC or HVC should come from the context, and there is 
zero
value in having different different IDs, depending on the conduit.

We *really* want SMC and HVC to behave the same way. Any attempt to make
them different should just be NAKed.

Thanks,

         M.
Peng Fan Feb. 7, 2020, 10:55 a.m. UTC | #6
> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> 
> On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> > On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > SCMI could use SMC/HVC as tranports, so add into devicetree binding
> > > doc.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > index f493d69e6194..03cff8b55a93 100644
> > > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > @@ -14,7 +14,7 @@ Required properties:
> > >
> > >  The scmi node with the following properties shall be under the
> > > /firmware/ node.
> > >
> > > -- compatible : shall be "arm,scmi"
> > > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> > >  - mboxes: List of phandle and mailbox channel specifiers. It should
> > > contain
> > >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> > >  	  and another optional for receiving the notifications("rx") if @@
> > > -25,6 +25,8 @@ The scmi node with the following properties shall be
> > > under the /firmware/ node.
> > >  	  protocol identifier for a given sub-node.
> > >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> > >  	  associated with it.
> > > +- arm,smc-id : SMC id required when using smc transports
> > > +- arm,hvc-id : HVC id required when using hvc transports
> > >
> > >  Optional properties:
> >
> > Not directly related to DT: Why do we need to distinguish between SMC
> > and HVC?
> 
> IIUC you want just one property to get the function ID ? Does that align with
> what you are saying ? I wanted to ask the same question and I see no need for
> 2 different properties.

The multiple protocols might use SMC or HVC. Saying

 Protocol@x {
    method="smc";
    arm,func-id=<0x....>
 };
 Protocol@y {
    method="hvc";
    arm,func-id=<0x....>
 };

With my propose:

Protocol@x {
    arm,smc-id=<0x....>
 };
 Protocol@y {
    arm,hvc-id=<0x....>
 };

No need an extra method property to indicate it is smc or hvc.
The driver use take arm,smc-id as SMC, arm,hvc-id as HVC.

Thanks,
Peng.

> 
> > Other SMC/HVC capable protocols are able to pick the right one based
> > on the PSCI conduit.
> >
> 
> This make it clear, but I am asking to  be sure.
> 
> > This is how the Spectre mitigations work already. Why is that any different?
> >
> 
> I don't see any need for it to be different.
> 
> --
> Regards,
> Sudeep
Sudeep Holla Feb. 7, 2020, 10:56 a.m. UTC | #7
On Thu, Feb 06, 2020 at 02:59:47PM -0700, Rob Herring wrote:
> On Thu, Feb 06, 2020 at 09:01:25PM +0800, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > SCMI could use SMC/HVC as tranports, so add into devicetree
> > binding doc.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > index f493d69e6194..03cff8b55a93 100644
> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > @@ -14,7 +14,7 @@ Required properties:
> >
> >  The scmi node with the following properties shall be under the /firmware/ node.
> >
> > -- compatible : shall be "arm,scmi"
> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> >  - mboxes: List of phandle and mailbox channel specifiers. It should contain
> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> >  	  and another optional for receiving the notifications("rx") if
> > @@ -25,6 +25,8 @@ The scmi node with the following properties shall be under the /firmware/ node.
> >  	  protocol identifier for a given sub-node.
> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> >  	  associated with it.
> > +- arm,smc-id : SMC id required when using smc transports
> > +- arm,hvc-id : HVC id required when using hvc transports
>
> Don't the SMC ids get standardized?
>

Unfortunately no. Please don't ask me why ;) as there's no technical reason
to not standardize it. I pushed hard for it, but for this particular case the
SMC/HVC transport is considered to be outside the SCMI protocol standards as
it's transport related.

I completely agree it is total non-sense. I will try to convince them showing
this discussion as reference but can't guarantee anything.

--
Regards,
Sudeep
Peng Fan Feb. 7, 2020, 11 a.m. UTC | #8
> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> 
> On 2020-02-07 10:47, Sudeep Holla wrote:
> > On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> >> On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> >> > From: Peng Fan <peng.fan@nxp.com>
> >> >
> >> > SCMI could use SMC/HVC as tranports, so add into devicetree binding
> >> > doc.
> >> >
> >> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> >> > ---
> >> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> >> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> >> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> >> > index f493d69e6194..03cff8b55a93 100644
> >> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> >> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> >> > @@ -14,7 +14,7 @@ Required properties:
> >> >
> >> >  The scmi node with the following properties shall be under the
> >> > /firmware/ node.
> >> >
> >> > -- compatible : shall be "arm,scmi"
> >> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> >> >  - mboxes: List of phandle and mailbox channel specifiers. It
> >> > should contain
> >> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> >> >  	  and another optional for receiving the notifications("rx") if
> >> > @@ -25,6 +25,8 @@ The scmi node with the following properties shall
> >> > be under the /firmware/ node.
> >> >  	  protocol identifier for a given sub-node.
> >> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> >> >  	  associated with it.
> >> > +- arm,smc-id : SMC id required when using smc transports
> >> > +- arm,hvc-id : HVC id required when using hvc transports
> >> >
> >> >  Optional properties:
> >>
> >> Not directly related to DT: Why do we need to distinguish between SMC
> >> and HVC?
> >
> > IIUC you want just one property to get the function ID ? Does that
> > align with what you are saying ? I wanted to ask the same question and
> > I see no need for 2 different properties.
> 
> Exactly. Using SMC or HVC should come from the context, and there is zero
> value in having different different IDs, depending on the conduit.
> 
> We *really* want SMC and HVC to behave the same way. Any attempt to
> make them different should just be NAKed.

ok. Then just like psci node,
Add a "method" property for each protocol, and add "arm,func-id" to
indicate the ID.

How about this?

Thanks,
Peng.



> 
> Thanks,
> 
>          M.
> --
> Jazz is not dead. It just smells funny...
Marc Zyngier Feb. 7, 2020, 11:01 a.m. UTC | #9
On 2020-02-07 10:55, Peng Fan wrote:
>> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc 
>> transports
>> 
>> On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
>> > On 2020-02-06 13:01, peng.fan@nxp.com wrote:
>> > > From: Peng Fan <peng.fan@nxp.com>
>> > >
>> > > SCMI could use SMC/HVC as tranports, so add into devicetree binding
>> > > doc.
>> > >
>> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> > > ---
>> > >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
>> > >  1 file changed, 3 insertions(+), 1 deletion(-)
>> > >
>> > > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > > index f493d69e6194..03cff8b55a93 100644
>> > > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> > > @@ -14,7 +14,7 @@ Required properties:
>> > >
>> > >  The scmi node with the following properties shall be under the
>> > > /firmware/ node.
>> > >
>> > > -- compatible : shall be "arm,scmi"
>> > > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
>> > >  - mboxes: List of phandle and mailbox channel specifiers. It should
>> > > contain
>> > >  	  exactly one or two mailboxes, one for transmitting messages("tx")
>> > >  	  and another optional for receiving the notifications("rx") if @@
>> > > -25,6 +25,8 @@ The scmi node with the following properties shall be
>> > > under the /firmware/ node.
>> > >  	  protocol identifier for a given sub-node.
>> > >  - #size-cells : should be '0' as 'reg' property doesn't have any size
>> > >  	  associated with it.
>> > > +- arm,smc-id : SMC id required when using smc transports
>> > > +- arm,hvc-id : HVC id required when using hvc transports
>> > >
>> > >  Optional properties:
>> >
>> > Not directly related to DT: Why do we need to distinguish between SMC
>> > and HVC?
>> 
>> IIUC you want just one property to get the function ID ? Does that 
>> align with
>> what you are saying ? I wanted to ask the same question and I see no 
>> need for
>> 2 different properties.
> 
> The multiple protocols might use SMC or HVC. Saying
> 
>  Protocol@x {
>     method="smc";
>     arm,func-id=<0x....>
>  };
>  Protocol@y {
>     method="hvc";
>     arm,func-id=<0x....>
>  };
> 
> With my propose:
> 
> Protocol@x {
>     arm,smc-id=<0x....>
>  };
>  Protocol@y {
>     arm,hvc-id=<0x....>
>  };
> 
> No need an extra method property to indicate it is smc or hvc.
> The driver use take arm,smc-id as SMC, arm,hvc-id as HVC.

You're missing the point. I do not want to see different IDs depending 
on
Whether we use HVC and SMC. They *MUST* have the same value, and the 
right
way to enforce this is to disallow any indication of the conduit.

An even better thing would be for ARM to mandate the ID, so that vendors
can be deprived of their special "value add" once and for all.

Thanks,

         M.
Sudeep Holla Feb. 7, 2020, 11:06 a.m. UTC | #10
On Fri, Feb 07, 2020 at 10:55:44AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> >
> > On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> > > On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> > > > From: Peng Fan <peng.fan@nxp.com>
> > > >
> > > > SCMI could use SMC/HVC as tranports, so add into devicetree binding
> > > > doc.
> > > >
> > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > ---
> > > >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > index f493d69e6194..03cff8b55a93 100644
> > > > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > @@ -14,7 +14,7 @@ Required properties:
> > > >
> > > >  The scmi node with the following properties shall be under the
> > > > /firmware/ node.
> > > >
> > > > -- compatible : shall be "arm,scmi"
> > > > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> > > >  - mboxes: List of phandle and mailbox channel specifiers. It should
> > > > contain
> > > >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> > > >  	  and another optional for receiving the notifications("rx") if @@
> > > > -25,6 +25,8 @@ The scmi node with the following properties shall be
> > > > under the /firmware/ node.
> > > >  	  protocol identifier for a given sub-node.
> > > >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> > > >  	  associated with it.
> > > > +- arm,smc-id : SMC id required when using smc transports
> > > > +- arm,hvc-id : HVC id required when using hvc transports
> > > >
> > > >  Optional properties:
> > >
> > > Not directly related to DT: Why do we need to distinguish between SMC
> > > and HVC?
> >
> > IIUC you want just one property to get the function ID ? Does that align with
> > what you are saying ? I wanted to ask the same question and I see no need for
> > 2 different properties.
>
> The multiple protocols might use SMC or HVC. Saying
>
>  Protocol@x {
>     method="smc";
>     arm,func-id=<0x....>
>  };
>  Protocol@y {
>     method="hvc";
>     arm,func-id=<0x....>
>  };
>

Wow, stop there. Please don't do that. You either use SMC or HVC consistently.
Not both at the same time. Any particular reasons for trying such crazy things.

> With my propose:
>
> Protocol@x {
>     arm,smc-id=<0x....>
>  };
>  Protocol@y {
>     arm,hvc-id=<0x....>
>  };
>
> No need an extra method property to indicate it is smc or hvc.
> The driver use take arm,smc-id as SMC, arm,hvc-id as HVC.
>

NACK, just have one function ID, I am not very particular on the name
'smc-id' is just fine for me. But only one function ID for any conduit
used and that is chosen by PSCI/SMCCC.

If you need multiple channels(unique per protocol) then I suggest go for
an channel ID or you can even manage just with shmem associated with it
(I prefer latter but again I am fine either way)

--
Regards,
Sudeep
Marc Zyngier Feb. 7, 2020, 11:09 a.m. UTC | #11
On 2020-02-07 11:00, Peng Fan wrote:
>> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc 
>> transports
>> 
>> On 2020-02-07 10:47, Sudeep Holla wrote:
>> > On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
>> >> On 2020-02-06 13:01, peng.fan@nxp.com wrote:
>> >> > From: Peng Fan <peng.fan@nxp.com>
>> >> >
>> >> > SCMI could use SMC/HVC as tranports, so add into devicetree binding
>> >> > doc.
>> >> >
>> >> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> >> > ---
>> >> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
>> >> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >> >
>> >> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> >> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> >> > index f493d69e6194..03cff8b55a93 100644
>> >> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> >> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
>> >> > @@ -14,7 +14,7 @@ Required properties:
>> >> >
>> >> >  The scmi node with the following properties shall be under the
>> >> > /firmware/ node.
>> >> >
>> >> > -- compatible : shall be "arm,scmi"
>> >> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
>> >> >  - mboxes: List of phandle and mailbox channel specifiers. It
>> >> > should contain
>> >> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
>> >> >  	  and another optional for receiving the notifications("rx") if
>> >> > @@ -25,6 +25,8 @@ The scmi node with the following properties shall
>> >> > be under the /firmware/ node.
>> >> >  	  protocol identifier for a given sub-node.
>> >> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
>> >> >  	  associated with it.
>> >> > +- arm,smc-id : SMC id required when using smc transports
>> >> > +- arm,hvc-id : HVC id required when using hvc transports
>> >> >
>> >> >  Optional properties:
>> >>
>> >> Not directly related to DT: Why do we need to distinguish between SMC
>> >> and HVC?
>> >
>> > IIUC you want just one property to get the function ID ? Does that
>> > align with what you are saying ? I wanted to ask the same question and
>> > I see no need for 2 different properties.
>> 
>> Exactly. Using SMC or HVC should come from the context, and there is 
>> zero
>> value in having different different IDs, depending on the conduit.
>> 
>> We *really* want SMC and HVC to behave the same way. Any attempt to
>> make them different should just be NAKed.
> 
> ok. Then just like psci node,
> Add a "method" property for each protocol, and add "arm,func-id" to
> indicate the ID.
> 
> How about this?

Or rather just a function ID, full stop. the conduit *MUST* be inherited
from the PSCI context.

         M.
Peng Fan Feb. 7, 2020, 11:19 a.m. UTC | #12
> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> 
> On Fri, Feb 07, 2020 at 10:55:44AM +0000, Peng Fan wrote:
> > > Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc
> > > transports
> > >
> > > On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> > > > On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> > > > > From: Peng Fan <peng.fan@nxp.com>
> > > > >
> > > > > SCMI could use SMC/HVC as tranports, so add into devicetree
> > > > > binding doc.
> > > > >
> > > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> > > > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > > index f493d69e6194..03cff8b55a93 100644
> > > > > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > > @@ -14,7 +14,7 @@ Required properties:
> > > > >
> > > > >  The scmi node with the following properties shall be under the
> > > > > /firmware/ node.
> > > > >
> > > > > -- compatible : shall be "arm,scmi"
> > > > > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> > > > >  - mboxes: List of phandle and mailbox channel specifiers. It
> > > > > should contain
> > > > >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> > > > >  	  and another optional for receiving the notifications("rx")
> > > > > if @@
> > > > > -25,6 +25,8 @@ The scmi node with the following properties shall
> > > > > be under the /firmware/ node.
> > > > >  	  protocol identifier for a given sub-node.
> > > > >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> > > > >  	  associated with it.
> > > > > +- arm,smc-id : SMC id required when using smc transports
> > > > > +- arm,hvc-id : HVC id required when using hvc transports
> > > > >
> > > > >  Optional properties:
> > > >
> > > > Not directly related to DT: Why do we need to distinguish between
> > > > SMC and HVC?
> > >
> > > IIUC you want just one property to get the function ID ? Does that
> > > align with what you are saying ? I wanted to ask the same question
> > > and I see no need for
> > > 2 different properties.
> >
> > The multiple protocols might use SMC or HVC. Saying
> >
> >  Protocol@x {
> >     method="smc";
> >     arm,func-id=<0x....>
> >  };
> >  Protocol@y {
> >     method="hvc";
> >     arm,func-id=<0x....>
> >  };
> >
> 
> Wow, stop there. Please don't do that. You either use SMC or HVC
> consistently.
> Not both at the same time. Any particular reasons for trying such crazy things.
> 
> > With my propose:
> >
> > Protocol@x {
> >     arm,smc-id=<0x....>
> >  };
> >  Protocol@y {
> >     arm,hvc-id=<0x....>
> >  };
> >
> > No need an extra method property to indicate it is smc or hvc.
> > The driver use take arm,smc-id as SMC, arm,hvc-id as HVC.
> >
> 
> NACK, just have one function ID, I am not very particular on the name 'smc-id'
> is just fine for me. But only one function ID for any conduit used and that is
> chosen by PSCI/SMCCC.
> 
> If you need multiple channels(unique per protocol) then I suggest go for an
> channel ID or you can even manage just with shmem associated with it (I
> prefer latter but again I am fine either way)

Ok. Just follow Marc suggested
Parse the conduit from PSCI context. Then only add 'smc-id' property in scmi
node, and take protocol reg as arg1. Is this ok for you?

Thanks,
Peng.

> 
> --
> Regards,
> Sudeep
Sudeep Holla Feb. 7, 2020, 11:32 a.m. UTC | #13
On Fri, Feb 07, 2020 at 11:09:48AM +0000, Marc Zyngier wrote:
> On 2020-02-07 11:00, Peng Fan wrote:
> > > Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc
> > > transports
> > > 
> > > On 2020-02-07 10:47, Sudeep Holla wrote:
> > > > On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> > > >> On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> > > >> > From: Peng Fan <peng.fan@nxp.com>
> > > >> >
> > > >> > SCMI could use SMC/HVC as tranports, so add into devicetree binding
> > > >> > doc.
> > > >> >
> > > >> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > >> > ---
> > > >> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> > > >> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > >> >
> > > >> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > >> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > >> > index f493d69e6194..03cff8b55a93 100644
> > > >> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > >> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > >> > @@ -14,7 +14,7 @@ Required properties:
> > > >> >
> > > >> >  The scmi node with the following properties shall be under the
> > > >> > /firmware/ node.
> > > >> >
> > > >> > -- compatible : shall be "arm,scmi"
> > > >> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> > > >> >  - mboxes: List of phandle and mailbox channel specifiers. It
> > > >> > should contain
> > > >> >  	  exactly one or two mailboxes, one for transmitting messages("tx")
> > > >> >  	  and another optional for receiving the notifications("rx") if
> > > >> > @@ -25,6 +25,8 @@ The scmi node with the following properties shall
> > > >> > be under the /firmware/ node.
> > > >> >  	  protocol identifier for a given sub-node.
> > > >> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> > > >> >  	  associated with it.
> > > >> > +- arm,smc-id : SMC id required when using smc transports
> > > >> > +- arm,hvc-id : HVC id required when using hvc transports
> > > >> >
> > > >> >  Optional properties:
> > > >>
> > > >> Not directly related to DT: Why do we need to distinguish between SMC
> > > >> and HVC?
> > > >
> > > > IIUC you want just one property to get the function ID ? Does that
> > > > align with what you are saying ? I wanted to ask the same question and
> > > > I see no need for 2 different properties.
> > > 
> > > Exactly. Using SMC or HVC should come from the context, and there is
> > > zero
> > > value in having different different IDs, depending on the conduit.
> > > 
> > > We *really* want SMC and HVC to behave the same way. Any attempt to
> > > make them different should just be NAKed.
> > 
> > ok. Then just like psci node,
> > Add a "method" property for each protocol, and add "arm,func-id" to
> > indicate the ID.
> > 
> > How about this?
> 
> Or rather just a function ID, full stop. the conduit *MUST* be inherited
> from the PSCI context.

Absolutely, this is what I was expecting.

Peng,

You have already introduced a compatible for smc/hvc transport
instead of default mailbox, why do you need anything more ? Just
use SMC or HVC conduit from PSCI/SMCCC. I don't think you need anything
more than the function ID.

--
Regards,
Sudeep
Peng Fan Feb. 7, 2020, 11:46 a.m. UTC | #14
> Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> 
> On Fri, Feb 07, 2020 at 11:09:48AM +0000, Marc Zyngier wrote:
> > On 2020-02-07 11:00, Peng Fan wrote:
> > > > Subject: Re: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc
> > > > transports
> > > >
> > > > On 2020-02-07 10:47, Sudeep Holla wrote:
> > > > > On Fri, Feb 07, 2020 at 10:08:36AM +0000, Marc Zyngier wrote:
> > > > >> On 2020-02-06 13:01, peng.fan@nxp.com wrote:
> > > > >> > From: Peng Fan <peng.fan@nxp.com>
> > > > >> >
> > > > >> > SCMI could use SMC/HVC as tranports, so add into devicetree
> > > > >> > binding doc.
> > > > >> >
> > > > >> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > > >> > ---
> > > > >> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> > > > >> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > > >> >
> > > > >> > diff --git
> > > > >> > a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > >> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > >> > index f493d69e6194..03cff8b55a93 100644
> > > > >> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > >> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > > > >> > @@ -14,7 +14,7 @@ Required properties:
> > > > >> >
> > > > >> >  The scmi node with the following properties shall be under
> > > > >> > the /firmware/ node.
> > > > >> >
> > > > >> > -- compatible : shall be "arm,scmi"
> > > > >> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
> > > > >> >  - mboxes: List of phandle and mailbox channel specifiers. It
> > > > >> > should contain
> > > > >> >  	  exactly one or two mailboxes, one for transmitting
> messages("tx")
> > > > >> >  	  and another optional for receiving the
> > > > >> > notifications("rx") if @@ -25,6 +25,8 @@ The scmi node with
> > > > >> > the following properties shall be under the /firmware/ node.
> > > > >> >  	  protocol identifier for a given sub-node.
> > > > >> >  - #size-cells : should be '0' as 'reg' property doesn't have any size
> > > > >> >  	  associated with it.
> > > > >> > +- arm,smc-id : SMC id required when using smc transports
> > > > >> > +- arm,hvc-id : HVC id required when using hvc transports
> > > > >> >
> > > > >> >  Optional properties:
> > > > >>
> > > > >> Not directly related to DT: Why do we need to distinguish
> > > > >> between SMC and HVC?
> > > > >
> > > > > IIUC you want just one property to get the function ID ? Does
> > > > > that align with what you are saying ? I wanted to ask the same
> > > > > question and I see no need for 2 different properties.
> > > >
> > > > Exactly. Using SMC or HVC should come from the context, and there
> > > > is zero value in having different different IDs, depending on the
> > > > conduit.
> > > >
> > > > We *really* want SMC and HVC to behave the same way. Any attempt
> > > > to make them different should just be NAKed.
> > >
> > > ok. Then just like psci node,
> > > Add a "method" property for each protocol, and add "arm,func-id" to
> > > indicate the ID.
> > >
> > > How about this?
> >
> > Or rather just a function ID, full stop. the conduit *MUST* be
> > inherited from the PSCI context.
> 
> Absolutely, this is what I was expecting.
> 
> Peng,
> 
> You have already introduced a compatible for smc/hvc transport instead of
> default mailbox, why do you need anything more ? 

No.

Just use SMC or HVC
> conduit from PSCI/SMCCC. I don't think you need anything more than the
> function ID.

Yes, only function ID for now. If function ID could not be standardized in short
term, I could first mark smc-id optional in dt bindings, then smc transports
driver will first parse smc-id, abort if not exist. When ARM has standarlized
ID, we could switch to use that ID if smc-id not exist.

Thanks,
Peng.

> 
> --
> Regards,
> Sudeep
Peng Fan Feb. 10, 2020, 12:59 a.m. UTC | #15
> Subject: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> 
> From: Peng Fan <peng.fan@nxp.com>
> 
> SCMI could use SMC/HVC as tranports, so add into devicetree binding doc.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> index f493d69e6194..03cff8b55a93 100644
> --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> @@ -14,7 +14,7 @@ Required properties:
> 
>  The scmi node with the following properties shall be under the /firmware/
> node.
> 
> -- compatible : shall be "arm,scmi"
> +- compatible : shall be "arm,scmi" or "arm,scmi-smc"

One question here, are you fine with compatible "arm,scmi-smc" or
add a new property 'transport' such as:
transport = "mailbox"; for mailbox
transport = "smc"; for smc and hvc.

Thanks,
Peng.

>  - mboxes: List of phandle and mailbox channel specifiers. It should contain
>  	  exactly one or two mailboxes, one for transmitting messages("tx")
>  	  and another optional for receiving the notifications("rx") if @@ -25,6
> +25,8 @@ The scmi node with the following properties shall be under the
> /firmware/ node.
>  	  protocol identifier for a given sub-node.
>  - #size-cells : should be '0' as 'reg' property doesn't have any size
>  	  associated with it.
> +- arm,smc-id : SMC id required when using smc transports
> +- arm,hvc-id : HVC id required when using hvc transports
> 
>  Optional properties:
> 
> --
> 2.16.4
Sudeep Holla Feb. 11, 2020, 12:02 p.m. UTC | #16
On Mon, Feb 10, 2020 at 12:59:43AM +0000, Peng Fan wrote:
> > Subject: [PATCH 1/2] dt-bindings: arm: arm,scmi: add smc/hvc transports
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > SCMI could use SMC/HVC as tranports, so add into devicetree binding doc.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  Documentation/devicetree/bindings/arm/arm,scmi.txt | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > index f493d69e6194..03cff8b55a93 100644
> > --- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > +++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
> > @@ -14,7 +14,7 @@ Required properties:
> >
> >  The scmi node with the following properties shall be under the /firmware/
> > node.
> >
> > -- compatible : shall be "arm,scmi"
> > +- compatible : shall be "arm,scmi" or "arm,scmi-smc"
>
> One question here, are you fine with compatible "arm,scmi-smc" or
> add a new property 'transport' such as:

Not required.

> transport = "mailbox"; for mailbox
> transport = "smc"; for smc and hvc.
>
Each transport will have it's own specific property like mailboxes for
mailbox, smc/hvc function IDs for SMC/HVC. That should be sufficient.

--
Regards,
Sudeep
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/arm,scmi.txt b/Documentation/devicetree/bindings/arm/arm,scmi.txt
index f493d69e6194..03cff8b55a93 100644
--- a/Documentation/devicetree/bindings/arm/arm,scmi.txt
+++ b/Documentation/devicetree/bindings/arm/arm,scmi.txt
@@ -14,7 +14,7 @@  Required properties:
 
 The scmi node with the following properties shall be under the /firmware/ node.
 
-- compatible : shall be "arm,scmi"
+- compatible : shall be "arm,scmi" or "arm,scmi-smc"
 - mboxes: List of phandle and mailbox channel specifiers. It should contain
 	  exactly one or two mailboxes, one for transmitting messages("tx")
 	  and another optional for receiving the notifications("rx") if
@@ -25,6 +25,8 @@  The scmi node with the following properties shall be under the /firmware/ node.
 	  protocol identifier for a given sub-node.
 - #size-cells : should be '0' as 'reg' property doesn't have any size
 	  associated with it.
+- arm,smc-id : SMC id required when using smc transports
+- arm,hvc-id : HVC id required when using hvc transports
 
 Optional properties: