Re: [PATCH 8/8] dt-bindings: firmware: arm,scmi: Convert to json schema

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 26, 2021 at 07:28:07PM +0100, Sudeep Holla wrote:
> Convert the old text format binding for System Control and Management Interface
> (SCMI) Message Protocol into the new and shiny YAML format.
> 
> Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> Cc: Cristian Marussi <cristian.marussi@xxxxxxx>
> Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
> Cc: Jim Quinlan <jim2101024@xxxxxxxxx>
> Cc: Etienne Carriere <etienne.carriere@xxxxxxxxxx>
> Cc: Peter Hilber <peter.hilber@xxxxxxxxxxxxxxx>
> Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
> ---
>  .../devicetree/bindings/arm/arm,scmi.txt      | 224 ---------------
>  .../bindings/firmware/arm,scmi.yaml           | 270 ++++++++++++++++++
>  2 files changed, 270 insertions(+), 224 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/arm,scmi.txt
>  create mode 100644 Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> 
> Hi,
> 
> I have converted all the bindings except the below regulator part of the
> binding. This needs to be addressed before merging ofcourse. Just posting
> the remaining changes to get feedback and also ask suggestion for the below:
> 
>         scmi_voltage: protocol@17 {
>           reg = <0x17>;
>           regulators {
>             regulator_devX: regulator@0 {
>               reg = <0x0>;
>               regulator-max-microvolt = <3300000>;
>             };
> 
>             regulator_devY: regulator@9 {
>               reg = <0x9>;
>               regulator-min-microvolt = <500000>;
>               regulator-max-microvolt = <4200000>;
>             };
>           };
>         };
> 
> I will reply with things I have tried separately to avoid confusion with this
> the patch here.
>

Below is the patch I have tried. I even started without a separate binding
for scmi regulator. Irrespective of what I have tried so far, I keep getting
the same error, I even added '#address-cells' and '#size-cells' to the node
but makes no difference.

Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml
Documentation/devicetree/bindings/firmware/arm,scmi.example.dts:62.19-31: Warning (reg_format): /example-0/firmware/scmi/protocol@17/regulators/regulator@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
Documentation/devicetree/bindings/firmware/arm,scmi.example.dts:67.19-31: Warning (reg_format): /example-0/firmware/scmi/protocol@17/regulators/regulator@9:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml: Warning (pci_device_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml: Warning (simple_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/firmware/arm,scmi.example.dts:61.45-64.19: Warning (avoid_default_addr_size): /example-0/firmware/scmi/protocol@17/regulators/regulator@0: Relying on default #address-cells value
Documentation/devicetree/bindings/firmware/arm,scmi.example.dts:61.45-64.19: Warning (avoid_default_addr_size): /example-0/firmware/scmi/protocol@17/regulators/regulator@0: Relying on default #size-cells value
Documentation/devicetree/bindings/firmware/arm,scmi.example.dts:66.45-70.19: Warning (avoid_default_addr_size): /example-0/firmware/scmi/protocol@17/regulators/regulator@9: Relying on default #address-cells value
Documentation/devicetree/bindings/firmware/arm,scmi.example.dts:66.45-70.19: Warning (avoid_default_addr_size): /example-0/firmware/scmi/protocol@17/regulators/regulator@9: Relying on default #size-cells value
Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml: Warning (unique_unit_address): Failed prerequisite 'avoid_default_addr_size'
  CHECK   Documentation/devicetree/bindings/firmware/arm,scmi.example.dt.yaml


Regards,
Sudeep

--->8

diff --git c/Documentation/devicetree/bindings/firmware/arm,scmi.yaml i/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index 36072585fc45..1fe23ef36adf 100644
--- c/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ i/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -101,6 +101,10 @@ description: |
       '#thermal-sensor-cells':
         const: 1
 
+  '^regulator@[0-9]+$':
+    type: object
+    $ref: "/schemas/regulator/arm,scmi-regulator.yaml#"
+
 required:
   - compatible
   - shmem
@@ -173,6 +177,21 @@ description: |
 
         scmi_voltage: protocol@17 {
           reg = <0x17>;
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          regulators {
+            regulator_devX: regulator@0 {
+              reg = <0x0>;
+              regulator-max-microvolt = <3300000>;
+            };
+
+            regulator_devY: regulator@9 {
+              reg = <0x9>;
+              regulator-min-microvolt = <500000>;
+              regulator-max-microvolt = <4200000>;
+            };
+          };
         };
       };
     };
diff --git c/Documentation/devicetree/bindings/regulator/arm,scmi-regulator.yaml i/Documentation/devicetree/bindings/regulator/arm,scmi-regulator.yaml
new file mode 100644
index 000000000000..2111676e3494
--- /dev/null
+++ i/Documentation/devicetree/bindings/regulator/arm,scmi-regulator.yaml
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/arm,scmi-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM SCMI controlled voltage regulators
+
+maintainers:
+  - Sudeep Holla <sudeep.holla@xxxxxxx>
+
+description:
+  Any property defined as part of the core regulator binding, defined in
+  regulator.yaml, can also be used.
+
+allOf:
+  - $ref: "regulator.yaml#"
+
+properties:
+  reg:
+    maxItems: 1
+    description: Identifier for the voltage regulator.
+
+required:
+  - reg
+
+unevaluatedProperties: false



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux