Commit 39bd2b6a authored by Rob Herring's avatar Rob Herring
Browse files

dt-bindings: Improve phandle-array schemas



The 'phandle-array' type is a bit ambiguous. It can be either just an
array of phandles or an array of phandles plus args. Many schemas for
phandle-array properties aren't clear in the schema which case applies
though the description usually describes it.

The array of phandles case boils down to needing:

items:
  maxItems: 1

The phandle plus args cases should typically take this form:

items:
  - items:
      - description: A phandle
      - description: 1st arg cell
      - description: 2nd arg cell

With this change, some examples need updating so that the bracketing of
property values matches the schema.

Signed-off-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarGeorgi Djakov <djakov@kernel.org>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: default avatarStephen Boyd <sboyd@kernel.org>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.kernel.org/r/20220119015038.2433585-1-robh@kernel.org
parent 5a04982d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ properties:

  cpu-idle-states:
    $ref: '/schemas/types.yaml#/definitions/phandle-array'
    items:
      maxItems: 1
    description: |
      List of phandles to idle state nodes supported
      by this cpu (see ./idle-states.yaml).
+40 −40
Original line number Diff line number Diff line
@@ -337,8 +337,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x0>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@1 {
@@ -346,8 +346,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x1>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@100 {
@@ -355,8 +355,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x100>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@101 {
@@ -364,8 +364,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x101>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@10000 {
@@ -373,8 +373,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x10000>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@10001 {
@@ -382,8 +382,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x10001>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@10100 {
@@ -391,8 +391,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x10100>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@10101 {
@@ -400,8 +400,8 @@ examples:
            compatible = "arm,cortex-a57";
            reg = <0x0 0x10101>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_0_0 &CPU_SLEEP_0_0
                   &CLUSTER_RETENTION_0 &CLUSTER_SLEEP_0>;
            cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
                    <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
        };

        cpu@100000000 {
@@ -409,8 +409,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x0>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100000001 {
@@ -418,8 +418,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x1>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100000100 {
@@ -427,8 +427,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x100>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100000101 {
@@ -436,8 +436,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x101>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100010000 {
@@ -445,8 +445,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x10000>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100010001 {
@@ -454,8 +454,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x10001>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100010100 {
@@ -463,8 +463,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x10100>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        cpu@100010101 {
@@ -472,8 +472,8 @@ examples:
            compatible = "arm,cortex-a53";
            reg = <0x1 0x10101>;
            enable-method = "psci";
            cpu-idle-states = <&CPU_RETENTION_1_0 &CPU_SLEEP_1_0
                   &CLUSTER_RETENTION_1 &CLUSTER_SLEEP_1>;
            cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
                    <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
        };

        idle-states {
@@ -567,56 +567,56 @@ examples:
            device_type = "cpu";
            compatible = "arm,cortex-a15";
            reg = <0x0>;
            cpu-idle-states = <&cpu_sleep_0_0 &cluster_sleep_0>;
            cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
        };

        cpu@1 {
            device_type = "cpu";
            compatible = "arm,cortex-a15";
            reg = <0x1>;
            cpu-idle-states = <&cpu_sleep_0_0 &cluster_sleep_0>;
            cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
        };

        cpu@2 {
            device_type = "cpu";
            compatible = "arm,cortex-a15";
            reg = <0x2>;
            cpu-idle-states = <&cpu_sleep_0_0 &cluster_sleep_0>;
            cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
        };

        cpu@3 {
            device_type = "cpu";
            compatible = "arm,cortex-a15";
            reg = <0x3>;
            cpu-idle-states = <&cpu_sleep_0_0 &cluster_sleep_0>;
            cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
        };

        cpu@100 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x100>;
            cpu-idle-states = <&cpu_sleep_1_0 &cluster_sleep_1>;
            cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
        };

        cpu@101 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x101>;
            cpu-idle-states = <&cpu_sleep_1_0 &cluster_sleep_1>;
            cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
        };

        cpu@102 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x102>;
            cpu-idle-states = <&cpu_sleep_1_0 &cluster_sleep_1>;
            cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
        };

        cpu@103 {
            device_type = "cpu";
            compatible = "arm,cortex-a7";
            reg = <0x103>;
            cpu-idle-states = <&cpu_sleep_1_0 &cluster_sleep_1>;
            cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
        };

        idle-states {
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ properties:

  interrupt-affinity:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1
    description:
      When using SPIs, specifies a list of phandles to CPU
      nodes corresponding directly to the affinity of
+3 −0
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ properties:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    minItems: 1
    maxItems: 8
    items:
      minItems: 2
      maxItems: 2

  calxeda,tx-atten:
    description: |
+4 −1
Original line number Diff line number Diff line
@@ -35,7 +35,10 @@ properties:
      The SRAM that needs to be claimed to access the display engine
      bus.
    $ref: /schemas/types.yaml#/definitions/phandle-array
    maxItems: 1
    items:
      - items:
          - description: phandle to SRAM
          - description: register value for device

  ranges: true

Loading