2023-04-26 13:37:30

by Oleksii Moisieiev

[permalink] [raw]
Subject: [RFC v2 3/3] dt-bindings: firmware: arm,scmi: Add support for pinctrl protocol

Add new SCMI v3.2 pinctrl protocol bindings definitions and example.

Signed-off-by: Oleksii Moisieiev <[email protected]>
---
.../bindings/firmware/arm,scmi.yaml | 77 +++++++++++++++++++
1 file changed, 77 insertions(+)

diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index 2f7c51c75e85..41ba5b8d8151 100644
--- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -212,6 +212,63 @@ properties:
reg:
const: 0x18

+ protocol@19:
+ $ref: '#/$defs/protocol-node'
+
+ properties:
+ reg:
+ const: 0x19
+
+ '#pinctrl-cells':
+ const: 0
+
+ allOf:
+ - $ref: "/schemas/pinctrl/pinctrl.yaml#"
+
+ required:
+ - reg
+
+ additionalProperties:
+ anyOf:
+ - type: object
+ allOf:
+ - $ref: /schemas/pinctrl/pincfg-node.yaml#
+ - $ref: /schemas/pinctrl/pinmux-node.yaml#
+
+ description:
+ A pin multiplexing sub-node describe how to configure a
+ set of pins is some desired function.
+ A single sub-node may define several pin configurations.
+ This sub-node is using default pinctrl bindings to configure
+ pin multiplexing and using SCMI protocol to apply specified
+ configuration using SCMI protocol.
+
+ properties:
+ phandle: true
+ function: true
+ groups: true
+ pins: true
+ bias-bus-hold: true
+ bias-disable: true
+ bias-high-impedance: true
+ bias-pull-up: true
+ bias-pull-default: true
+ bias-pull-down: true
+ drive-open-drain: true
+ drive-open-source: true
+ drive-push-pull: true
+ drive-strength: true
+ input-debounce: true
+ input-value: true
+ input-schmitt: true
+ low-power-mode: true
+ output-mode: true
+ output-value: true
+ power-source: true
+ skew-rate: true
+
+ additionalProperties: true
+
additionalProperties: false

$defs:
@@ -356,6 +413,26 @@ examples:
scmi_powercap: protocol@18 {
reg = <0x18>;
};
+
+ scmi_pinctrl: protocol@19 {
+ reg = <0x19>;
+ #pinctrl-cells = <0>;
+
+ i2c2 {
+ groups = "i2c2_a", "i2c2_b";
+ function = "i2c2";
+ };
+
+ pins_mdio {
+ groups = "avb_mdio";
+ drive-strength = <24>;
+ };
+
+ keys_pins: keys {
+ pins = "GP_5_17", "GP_5_20", "GP_5_22", "GP_2_1";
+ bias-pull-up;
+ };
+ };
};
};

--
2.25.1


2023-04-27 07:11:32

by Michal Simek

[permalink] [raw]
Subject: Re: [RFC v2 3/3] dt-bindings: firmware: arm,scmi: Add support for pinctrl protocol



On 4/26/23 15:26, Oleksii Moisieiev wrote:
> Add new SCMI v3.2 pinctrl protocol bindings definitions and example.
>
> Signed-off-by: Oleksii Moisieiev <[email protected]>
> ---
> .../bindings/firmware/arm,scmi.yaml | 77 +++++++++++++++++++
> 1 file changed, 77 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> index 2f7c51c75e85..41ba5b8d8151 100644
> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> @@ -212,6 +212,63 @@ properties:
> reg:
> const: 0x18
>
> + protocol@19:
> + $ref: '#/$defs/protocol-node'
> +
> + properties:
> + reg:
> + const: 0x19
> +
> + '#pinctrl-cells':
> + const: 0
> +

As I said. pinctrl has also gpio part and based on discussion with SCMI guys
this protocol can be also used for simple gpio. That's why here should be also
listed #gpio-cells to be able to use this functionality.

And for complete implementation it should be also added to driver it but of
course this can be added later by separate patch.

Thanks,
Michal

2023-04-27 07:24:23

by Oleksii Moisieiev

[permalink] [raw]
Subject: Re: [RFC v2 3/3] dt-bindings: firmware: arm,scmi: Add support for pinctrl protocol



On 27.04.23 10:07, Michal Simek wrote:
>
>
> On 4/26/23 15:26, Oleksii Moisieiev wrote:
>> Add new SCMI v3.2 pinctrl protocol bindings definitions and example.
>>
>> Signed-off-by: Oleksii Moisieiev <[email protected]>
>> ---
>>   .../bindings/firmware/arm,scmi.yaml           | 77 +++++++++++++++++++
>>   1 file changed, 77 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> index 2f7c51c75e85..41ba5b8d8151 100644
>> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> @@ -212,6 +212,63 @@ properties:
>>         reg:
>>           const: 0x18
>> +  protocol@19:
>> +    $ref: '#/$defs/protocol-node'
>> +
>> +    properties:
>> +      reg:
>> +        const: 0x19
>> +
>> +      '#pinctrl-cells':
>> +        const: 0
>> +
>
> As I said. pinctrl has also gpio part and based on discussion with SCMI
> guys this protocol can be also used for simple gpio. That's why here
> should be also listed #gpio-cells to be able to use this functionality.
>
> And for complete implementation it should be also added to driver it but
> of course this can be added later by separate patch.
>
> Thanks,
> Michal
>

Hi Michal,

The plan is to add gpio support as the separate patch on top of this
patch series.

Oleksii.

2023-04-28 10:23:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [RFC v2 3/3] dt-bindings: firmware: arm,scmi: Add support for pinctrl protocol

On 26/04/2023 15:26, Oleksii Moisieiev wrote:
> Add new SCMI v3.2 pinctrl protocol bindings definitions and example.
>
> Signed-off-by: Oleksii Moisieiev <[email protected]>

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.

You missed several entries, including DT list, so this won't be tested.
I won't be doing full review, no point if patch is not tested.

> ---
> .../bindings/firmware/arm,scmi.yaml | 77 +++++++++++++++++++
> 1 file changed, 77 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> index 2f7c51c75e85..41ba5b8d8151 100644
> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> @@ -212,6 +212,63 @@ properties:
> reg:
> const: 0x18
>
> + protocol@19:
> + $ref: '#/$defs/protocol-node'
> +
> + properties:
> + reg:
> + const: 0x19
> +
> + '#pinctrl-cells':
> + const: 0
> +
> + allOf:
> + - $ref: "/schemas/pinctrl/pinctrl.yaml#"

Drop quotes.

> +
> + required:
> + - reg
> +
> + additionalProperties:
> + anyOf:
> + - type: object
> + allOf:
> + - $ref: /schemas/pinctrl/pincfg-node.yaml#
> + - $ref: /schemas/pinctrl/pinmux-node.yaml#
> +
> + description:
> + A pin multiplexing sub-node describe how to configure a
> + set of pins is some desired function.
> + A single sub-node may define several pin configurations.
> + This sub-node is using default pinctrl bindings to configure
> + pin multiplexing and using SCMI protocol to apply specified
> + configuration using SCMI protocol.
> +
> + properties:
> + phandle: true

What's this?

> + function: true
> + groups: true
> + pins: true
> + bias-bus-hold: true
> + bias-disable: true
> + bias-high-impedance: true
> + bias-pull-up: true
> + bias-pull-default: true
> + bias-pull-down: true
> + drive-open-drain: true
> + drive-open-source: true
> + drive-push-pull: true
> + drive-strength: true
> + input-debounce: true
> + input-value: true
> + input-schmitt: true
> + low-power-mode: true
> + output-mode: true
> + output-value: true
> + power-source: true
> + skew-rate: true
> +
> + additionalProperties: true

This should be false... but if it is true, then listing all properties
does not make sense. And anyway usual way is to make it instead
unevaluatedProperties:false. I have troubles understanding your goal here.

Best regards,
Krzysztof