diff mbox series

[1/4] dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding

Message ID 95105518f61408743d17783099ed9c373a3dfe18.1616178258.git.cristian.ciocaltea@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add support for Actions Semi Owl soc info | expand

Commit Message

Cristian Ciocaltea March 19, 2021, 6:27 p.m. UTC
Add devicetree binding for the Actions Semi Owl SoCs info module.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
---
 .../bindings/soc/actions/owl-socinfo.yaml     | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml

Comments

Rob Herring (Arm) March 27, 2021, 4:30 p.m. UTC | #1
On Fri, Mar 19, 2021 at 08:27:59PM +0200, Cristian Ciocaltea wrote:
> Add devicetree binding for the Actions Semi Owl SoCs info module.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> ---
>  .../bindings/soc/actions/owl-socinfo.yaml     | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
> 
> diff --git a/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml b/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
> new file mode 100644
> index 000000000000..3fcb1f584fdf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/soc/actions/owl-socinfo.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Actions Semi Owl SoC info module
> +
> +maintainers:
> +  - Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> +
> +description: |
> +  Actions Semi Owl SoC info module provides access to various information
> +  about the S500, S700 and S900 SoC variants, such as serial number or id.
> +
> +patternProperties:
> +  "^soc(@[0-9a-f]+)?$":

Make this a $nodename property.

> +    type: object
> +    properties:

And move this up to top-level.

You need a custom 'select' entry to exclude 'simple-bus'.

> +      compatible:
> +        items:
> +          - enum:
> +              - actions,s500-soc
> +              - actions,s700-soc
> +              - actions,s900-soc
> +          - const: simple-bus
> +
> +      "#address-cells":
> +        enum: [1, 2]
> +
> +      "#size-cells":
> +        enum: [1, 2]
> +
> +      ranges: true
> +
> +      actions,serial-number-addrs:
> +        description: |
> +          Contains the physical addresses in DDR memory where the two parts
> +          of the serial number (low & high) can be read from.
> +          This is currently supported only on the S500 SoC variant.
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        minItems: 2
> +        maxItems: 2

Humm, it doesn't really seem you have an actual device or bus here, but 
are abusing DT to create your socinfo device.

As the only property is data in main memory, you should do a compatible 
for that memory region and put it under reserved-memory. You need that 
anyway to prevent the kernel from using the memory, right?

Rob
Cristian Ciocaltea March 29, 2021, 10:21 p.m. UTC | #2
On Sat, Mar 27, 2021 at 10:30:06AM -0600, Rob Herring wrote:
> On Fri, Mar 19, 2021 at 08:27:59PM +0200, Cristian Ciocaltea wrote:
> > Add devicetree binding for the Actions Semi Owl SoCs info module.
> > 
> > Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> > ---
> >  .../bindings/soc/actions/owl-socinfo.yaml     | 71 +++++++++++++++++++

[...]

> > +
> > +patternProperties:
> > +  "^soc(@[0-9a-f]+)?$":
> 
> Make this a $nodename property.
> 
> > +    type: object
> > +    properties:
> 
> And move this up to top-level.
> 
> You need a custom 'select' entry to exclude 'simple-bus'.

Indeed, I missed it..

> > +      compatible:
> > +        items:
> > +          - enum:
> > +              - actions,s500-soc
> > +              - actions,s700-soc
> > +              - actions,s900-soc
> > +          - const: simple-bus
> > +
> > +      "#address-cells":
> > +        enum: [1, 2]
> > +
> > +      "#size-cells":
> > +        enum: [1, 2]
> > +
> > +      ranges: true
> > +
> > +      actions,serial-number-addrs:
> > +        description: |
> > +          Contains the physical addresses in DDR memory where the two parts
> > +          of the serial number (low & high) can be read from.
> > +          This is currently supported only on the S500 SoC variant.
> > +        $ref: /schemas/types.yaml#/definitions/uint32-array
> > +        minItems: 2
> > +        maxItems: 2
> 
> Humm, it doesn't really seem you have an actual device or bus here, but 
> are abusing DT to create your socinfo device.
> 
> As the only property is data in main memory, you should do a compatible 
> for that memory region and put it under reserved-memory. You need that 
> anyway to prevent the kernel from using the memory, right?

Right, this region should be exposed as reserved-memory. Will handle
it in the next revision.

> Rob

Thanks for the review,
Cristi
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml b/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
new file mode 100644
index 000000000000..3fcb1f584fdf
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
@@ -0,0 +1,71 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/actions/owl-socinfo.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl SoC info module
+
+maintainers:
+  - Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
+
+description: |
+  Actions Semi Owl SoC info module provides access to various information
+  about the S500, S700 and S900 SoC variants, such as serial number or id.
+
+patternProperties:
+  "^soc(@[0-9a-f]+)?$":
+    type: object
+    properties:
+      compatible:
+        items:
+          - enum:
+              - actions,s500-soc
+              - actions,s700-soc
+              - actions,s900-soc
+          - const: simple-bus
+
+      "#address-cells":
+        enum: [1, 2]
+
+      "#size-cells":
+        enum: [1, 2]
+
+      ranges: true
+
+      actions,serial-number-addrs:
+        description: |
+          Contains the physical addresses in DDR memory where the two parts
+          of the serial number (low & high) can be read from.
+          This is currently supported only on the S500 SoC variant.
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 2
+        maxItems: 2
+
+    required:
+      - compatible
+
+    additionalProperties:
+      type: object
+
+additionalProperties: true
+
+examples:
+  - |
+    / {
+        compatible = "roseapplepi,roseapplepi", "actions,s500";
+        model = "Roseapple Pi";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        soc {
+            compatible = "actions,s500-soc", "simple-bus";
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+            actions,serial-number-addrs = <0x800>, /* S/N Low */
+                                          <0x804>; /* S/N High */
+        };
+    };
+
+...