2023-10-27 06:28:52

by Oleksii Moisieiev

[permalink] [raw]
Subject: [RFC v5 5/5] 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]>

---
Changes v3 -> v4
- reworked protocol@19 format
---
.../bindings/firmware/arm,scmi.yaml | 53 +++++++++++++++++++
1 file changed, 53 insertions(+)

diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index 5824c43e9893..5318fe72354e 100644
--- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -233,6 +233,39 @@ properties:
reg:
const: 0x18

+ protocol@19:
+ type: object
+ allOf:
+ - $ref: "#/$defs/protocol-node"
+ - $ref: "../pinctrl/pinctrl.yaml"
+ unevaluatedProperties: false
+
+ properties:
+ reg:
+ const: 0x19
+
+ '#pinctrl-cells':
+ const: 0
+
+ patternProperties:
+ '-pins$':
+ type: object
+ allOf:
+ - $ref: "../pinctrl/pincfg-node.yaml#"
+ - $ref: "../pinctrl/pinmux-node.yaml#"
+ unevaluatedProperties: false
+
+ 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.
+
+ required:
+ - reg
+
additionalProperties: false

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

--
2.25.1


2023-10-27 08:56:44

by Krzysztof Kozlowski

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

On 27/10/2023 08:28, Oleksii Moisieiev wrote:
> Add new SCMI v3.2 pinctrl protocol bindings definitions and example.
>
> Signed-off-by: Oleksii Moisieiev <[email protected]>
>
> ---
> Changes v3 -> v4
> - reworked protocol@19 format
> ---
> .../bindings/firmware/arm,scmi.yaml | 53 +++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> index 5824c43e9893..5318fe72354e 100644
> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> @@ -233,6 +233,39 @@ properties:
> reg:
> const: 0x18
>
> + protocol@19:
> + type: object
> + allOf:
> + - $ref: "#/$defs/protocol-node"
> + - $ref: "../pinctrl/pinctrl.yaml"

This is a friendly reminder during the review process.

It seems my previous comments were not fully addressed. Maybe my
feedback got lost between the quotes, maybe you just forgot to apply it.
Please go back to the previous discussion and either implement all
requested changes or keep discussing them.

Thank you.


It does not look like you tested the bindings, at least after quick
look. Please run `make dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).
Maybe you need to update your dtschema and yamllint.


Best regards,
Krzysztof

2023-10-27 11:55:18

by Rob Herring

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


On Fri, 27 Oct 2023 06:28:11 +0000, Oleksii Moisieiev wrote:
> Add new SCMI v3.2 pinctrl protocol bindings definitions and example.
>
> Signed-off-by: Oleksii Moisieiev <[email protected]>
>
> ---
> Changes v3 -> v4
> - reworked protocol@19 format
> ---
> .../bindings/firmware/arm,scmi.yaml | 53 +++++++++++++++++++
> 1 file changed, 53 insertions(+)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/firmware/arm,scmi.yaml:244:15: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/firmware/arm,scmi.yaml:258:19: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/firmware/arm,scmi.yaml:259:19: [error] string value is redundantly quoted with any quotes (quoted-strings)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/e9285b4377242e4d888391be987cbb99caf8c573.1698353854.git.oleksii_moisieiev@epam.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.

2023-11-01 14:10:01

by Oleksii Moisieiev

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



On 27.10.23 11:56, Krzysztof Kozlowski wrote:
> On 27/10/2023 08:28, Oleksii Moisieiev wrote:
>> Add new SCMI v3.2 pinctrl protocol bindings definitions and example.
>>
>> Signed-off-by: Oleksii Moisieiev <[email protected]>
>>
>> ---
>> Changes v3 -> v4
>> - reworked protocol@19 format
>> ---
>> .../bindings/firmware/arm,scmi.yaml | 53 +++++++++++++++++++
>> 1 file changed, 53 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> index 5824c43e9893..5318fe72354e 100644
>> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> @@ -233,6 +233,39 @@ properties:
>> reg:
>> const: 0x18
>>
>> + protocol@19:
>> + type: object
>> + allOf:
>> + - $ref: "#/$defs/protocol-node"
>> + - $ref: "../pinctrl/pinctrl.yaml"
>
> This is a friendly reminder during the review process.
>
> It seems my previous comments were not fully addressed. Maybe my
> feedback got lost between the quotes, maybe you just forgot to apply it.
> Please go back to the previous discussion and either implement all
> requested changes or keep discussing them.
>
> Thank you.


Hi Krzysztof,

I'm sorry for the inconvenience.
The intention behind sharing this RFC was to initiate the review process
for the changes I've been making to the pinctrl driver, aligning it with
the updates in the DEN0056E beta2 document.

I am still actively working on these changes, and I fully intend to
address and resolve the binding issues and all previously mentioned
comments in the final v5 patch series.

Best regards,
Oleksii.

>
> It does not look like you tested the bindings, at least after quick
> look. Please run `make dt_binding_check` (see
> Documentation/devicetree/bindings/writing-schema.rst for instructions).
> Maybe you need to update your dtschema and yamllint.
>
>
> Best regards,
> Krzysztof
>

2023-11-06 13:12:58

by Linus Walleij

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

On Fri, Oct 27, 2023 at 8:28 AM Oleksii Moisieiev
<[email protected]> wrote:

> + keys_pins: keys-pins {
> + pins = "GP_5_17", "GP_5_20", "GP_5_22", "GP_2_1";
> + bias-pull-up;
> + };

This is kind of interesting and relates to my question about naming groups and
functions of GPIO pins.

Here we see four pins suspiciously named "GP_*" which I read as
"generic purpose"
and they are not muxed to *any* function, yes pulled up.

I would have expected something like:

keys_pins: keys-pins {
groups = "GP_5_17_grp", "GP_5_20_grp", "GP_5_22_grp", "GP_2_1_grp";
function = "gpio";
pins = "GP_5_17", "GP_5_20", "GP_5_22", "GP_2_1";
bias-pull-up;
};

I hope this illustrates what I see as a problem in not designing in
GPIO as an explicit
function, I get the impression that these pins are GPIO because it is hardware
default.

Yours,
Linus Walleij