2024-04-12 00:22:41

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH 0/3] pinctrl: scmi: support i.MX95 OEM extensions

ARM SCMI v3.2 Table 24 Pin Configuration Type and Enumerations:
'192 -255 OEM specific units'.

i.MX95 System Manager FW supports SCMI PINCTRL protocol, but uses
OEM Pin Configuration type, so extend the driver to support custom
params.

This patchset depends on [1].

[1] https://lore.kernel.org/all/[email protected]/

Signed-off-by: Peng Fan <[email protected]>
---
Peng Fan (3):
dt-bindings: pinctrl: support i.MX95 SCMI pinctrl
dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl
pinctrl: scmi: support i.MX OEM pin configuration type

.../devicetree/bindings/firmware/arm,scmi.yaml | 8 ++--
.../bindings/pinctrl/nxp,imx95-pinctrl.yaml | 44 ++++++++++++++++++++++
drivers/pinctrl/pinctrl-scmi.c | 23 +++++++++++
drivers/pinctrl/pinctrl-scmi.h | 15 ++++++++
4 files changed, 87 insertions(+), 3 deletions(-)
---
base-commit: 6bd4dec347319b2e0b713a88956470e352f493fa
change-id: 20240412-pinctrl-scmi-oem-v1-494ca2ab1480

Best regards,
--
Peng Fan <[email protected]>



2024-04-12 00:32:19

by Peng Fan (OSS)

[permalink] [raw]
Subject: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl

From: Peng Fan <[email protected]>

i.MX95 SCMI Pinctrl uses OEM specific units, so add '$ref' to
'/schemas/pinctrl/nxp,imx95-pinctrl.yaml' and an example.

Signed-off-by: Peng Fan <[email protected]>
---
Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index e9d3f043c4ed..ebc6c083b538 100644
--- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -249,9 +249,11 @@ properties:

protocol@19:
type: object
- allOf:
- - $ref: '#/$defs/protocol-node'
- - $ref: /schemas/pinctrl/pinctrl.yaml
+ anyOf:
+ - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
+ - allOf:
+ - $ref: '#/$defs/protocol-node'
+ - $ref: /schemas/pinctrl/pinctrl.yaml

unevaluatedProperties: false


--
2.37.1


2024-04-12 15:12:52

by Frank Li

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl

On Fri, Apr 12, 2024 at 08:29:26AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <[email protected]>
>
> i.MX95 SCMI Pinctrl uses OEM specific units, so add '$ref' to
> '/schemas/pinctrl/nxp,imx95-pinctrl.yaml' and an example.

where 'example'?

Frank

>
> Signed-off-by: Peng Fan <[email protected]>
> ---
> Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> index e9d3f043c4ed..ebc6c083b538 100644
> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> @@ -249,9 +249,11 @@ properties:
>
> protocol@19:
> type: object
> - allOf:
> - - $ref: '#/$defs/protocol-node'
> - - $ref: /schemas/pinctrl/pinctrl.yaml
> + anyOf:
> + - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
> + - allOf:
> + - $ref: '#/$defs/protocol-node'
> + - $ref: /schemas/pinctrl/pinctrl.yaml
>
> unevaluatedProperties: false
>
>
> --
> 2.37.1
>

2024-04-13 06:01:31

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl

> Subject: Re: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95
> SCMI Pinctrl
>
> On Fri, Apr 12, 2024 at 08:29:26AM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <[email protected]>
> >
> > i.MX95 SCMI Pinctrl uses OEM specific units, so add '$ref' to
> > '/schemas/pinctrl/nxp,imx95-pinctrl.yaml' and an example.
>
> where 'example'?

I was thinking to add the whole example including pinctrl/bbm/misc
using a separate patch after all the vendor stuff got accepted.

Thanks,
Peng.

>
> Frank
>
> >
> > Signed-off-by: Peng Fan <[email protected]>
> > ---
> > Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > index e9d3f043c4ed..ebc6c083b538 100644
> > --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > @@ -249,9 +249,11 @@ properties:
> >
> > protocol@19:
> > type: object
> > - allOf:
> > - - $ref: '#/$defs/protocol-node'
> > - - $ref: /schemas/pinctrl/pinctrl.yaml
> > + anyOf:
> > + - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
> > + - allOf:
> > + - $ref: '#/$defs/protocol-node'
> > + - $ref: /schemas/pinctrl/pinctrl.yaml
> >
> > unevaluatedProperties: false
> >
> >
> > --
> > 2.37.1
> >

2024-04-15 22:56:49

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl

On Fri, Apr 12, 2024 at 08:29:26AM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <[email protected]>
>
> i.MX95 SCMI Pinctrl uses OEM specific units, so add '$ref' to
> '/schemas/pinctrl/nxp,imx95-pinctrl.yaml' and an example.
>
> Signed-off-by: Peng Fan <[email protected]>
> ---
> Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> index e9d3f043c4ed..ebc6c083b538 100644
> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> @@ -249,9 +249,11 @@ properties:
>
> protocol@19:
> type: object
> - allOf:
> - - $ref: '#/$defs/protocol-node'
> - - $ref: /schemas/pinctrl/pinctrl.yaml

I don't think anything from here was actually used...


> + anyOf:
> + - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
> + - allOf:
> + - $ref: '#/$defs/protocol-node'

This must always apply and should not be under the anyOf.

> + - $ref: /schemas/pinctrl/pinctrl.yaml
>
> unevaluatedProperties: false
>
>
> --
> 2.37.1
>

2024-04-16 03:07:45

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl

Hi Rob,

> Subject: Re: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95
> SCMI Pinctrl
>
> On Fri, Apr 12, 2024 at 08:29:26AM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <[email protected]>
> >
> > i.MX95 SCMI Pinctrl uses OEM specific units, so add '$ref' to
> > '/schemas/pinctrl/nxp,imx95-pinctrl.yaml' and an example.
> >
> > Signed-off-by: Peng Fan <[email protected]>
> > ---
> > Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > index e9d3f043c4ed..ebc6c083b538 100644
> > --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > @@ -249,9 +249,11 @@ properties:
> >
> > protocol@19:
> > type: object
> > - allOf:
> > - - $ref: '#/$defs/protocol-node'
> > - - $ref: /schemas/pinctrl/pinctrl.yaml
>
> I don't think anything from here was actually used...

You mean this not used?
allOf:
- $ref: '#/$defs/protocol-node'
- $ref: /schemas/pinctrl/pinctrl.yaml

Or below?
>
>
> > + anyOf:
> > + - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
> > + - allOf:
> > + - $ref: '#/$defs/protocol-node'
>
> This must always apply and should not be under the anyOf.

I just try in arm,scmi.yaml:
protocol@19:
type: object
allOf:
- $ref: '#/$defs/protocol-node'
- anyOf:
- $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
- $ref: /schemas/pinctrl/pinctrl.yaml

unevaluatedProperties: false

And in nxp,imx95-pinctrl.yaml:
patternProperties:
'grp$':
type: object
additionalProperties: false

patternProperties:
'[a-f0-9]+$':
type: object
unevaluatedProperties: false

But the following example always reports:
pinctrl_usdhc1: usdhc1grp {
sd1-pin0 {
pins = "sd1cmd";
nxp,func-id = <0>;
nxp,pin-conf = <0x138e>;
};
};

arm,scmi.example.dtb: scmi: protocol@19: Unevaluated properties are not allowed ('usdhc1grp' was unexpected)

Do you have any suggestions on how to write the yaml correct?

Thanks,
Peng.

>
> > + - $ref: /schemas/pinctrl/pinctrl.yaml
> >
> > unevaluatedProperties: false
> >
> >
> > --
> > 2.37.1
> >

2024-04-16 06:41:42

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95 SCMI Pinctrl

> Subject: RE: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support i.MX95
> SCMI Pinctrl
>
> Hi Rob,
>
> > Subject: Re: [PATCH 2/3] dt-bindings: firmware: arm,scmi: support
> > i.MX95 SCMI Pinctrl
> >
> > On Fri, Apr 12, 2024 at 08:29:26AM +0800, Peng Fan (OSS) wrote:
> > > From: Peng Fan <[email protected]>
> > >
> > > i.MX95 SCMI Pinctrl uses OEM specific units, so add '$ref' to
> > > '/schemas/pinctrl/nxp,imx95-pinctrl.yaml' and an example.
> > >
> > > Signed-off-by: Peng Fan <[email protected]>
> > > ---
> > > Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 8
> > > +++++---
> > > 1 file changed, 5 insertions(+), 3 deletions(-)
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > > b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > > index e9d3f043c4ed..ebc6c083b538 100644
> > > --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > > +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> > > @@ -249,9 +249,11 @@ properties:
> > >
> > > protocol@19:
> > > type: object
> > > - allOf:
> > > - - $ref: '#/$defs/protocol-node'
> > > - - $ref: /schemas/pinctrl/pinctrl.yaml
> >
> > I don't think anything from here was actually used...
>

After some check, I work out the following:
diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index e9d3f043c4ed..26b7395c4326 100644
--- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -262,9 +262,12 @@ properties:
patternProperties:
'-pins$':
type: object
- allOf:
- - $ref: /schemas/pinctrl/pincfg-node.yaml#
- - $ref: /schemas/pinctrl/pinmux-node.yaml#
+ anyOf:
+ - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
+ - allOf:
+ - $ref: /schemas/pinctrl/pincfg-node.yaml#
+ - $ref: /schemas/pinctrl/pinmux-node.yaml#
+
unevaluatedProperties: false

description:

The nxp,imx95-pinctrl.yaml:
+patternProperties:
+ '[a-f0-9]+$':
+ type: object
+ unevaluatedProperties: false
+
+ properties:
+ pins:
+ $ref: /schemas/types.yaml#/definitions/string
+ description: name of the pin
+
+ nxp,func-id:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Indicates the PAD connections which function module
+
+ nxp,pin-conf:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: The PAD configuration
+
+ nxp,daisy-id:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: The select input register ID
+
+ nxp,daisy-conf:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: The select input register value
+
+additionalProperties: true


The node will as below:
scmi_pinctrl: protocol@19 {
reg = <0x19>;

sd-pins {
sd1cmd {
pins = "sd1cmd";
nxp,func-id = <0>;
nxp,pin-conf = <0x138e>;
};
sd1data0 {
pins = "sd1data0";
nxp,func-id = <0>;
nxp,pin-conf = <0x138e>;
};
};

I will use the upper in v2.

Thanks,
Peng.
> You mean this not used?
> allOf:
> - $ref: '#/$defs/protocol-node'
> - $ref: /schemas/pinctrl/pinctrl.yaml
>
> Or below?
> >
> >
> > > + anyOf:
> > > + - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
> > > + - allOf:
> > > + - $ref: '#/$defs/protocol-node'
> >
> > This must always apply and should not be under the anyOf.
>
> I just try in arm,scmi.yaml:
> protocol@19:
> type: object
> allOf:
> - $ref: '#/$defs/protocol-node'
> - anyOf:
> - $ref: /schemas/pinctrl/nxp,imx95-pinctrl.yaml
> - $ref: /schemas/pinctrl/pinctrl.yaml
>
> unevaluatedProperties: false
>
> And in nxp,imx95-pinctrl.yaml:
> patternProperties:
> 'grp$':
> type: object
> additionalProperties: false
>
> patternProperties:
> '[a-f0-9]+$':
> type: object
> unevaluatedProperties: false
>
> But the following example always reports:
> pinctrl_usdhc1: usdhc1grp {
> sd1-pin0 {
> pins = "sd1cmd";
> nxp,func-id = <0>;
> nxp,pin-conf = <0x138e>;
> };
> };
>
> arm,scmi.example.dtb: scmi: protocol@19: Unevaluated properties are not
> allowed ('usdhc1grp' was unexpected)
>
> Do you have any suggestions on how to write the yaml correct?
>
> Thanks,
> Peng.
>
> >
> > > + - $ref: /schemas/pinctrl/pinctrl.yaml
> > >
> > > unevaluatedProperties: false
> > >
> > >
> > > --
> > > 2.37.1
> > >