Skip to contentSkip to conversation

Add support for Actions Semi Owl socinfo

PATCH In review Cristian Ciocaltea 4 participants 24 messages Mar 30, 2021 – Apr 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Add support for Actions Semi Owl socinfo

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

This has been tested on the S500 SoC based RoseapplePi SBC.

Thanks,
Cristi

Changes in v2:
- Exposed the memory range for reading the SoC serial number under /reserved-memory DT node, according to Rob's review; as a consequence added a new binding document (actions,owl-soc-serial.yaml) and updated owl-socinfo.yaml

- Replaced the unportable usage of system_serial_{low,high} globals with a public API to provide external access to SoC serial number parts (e.g. Owl Ethernet MAC driver will use this to generate a stable MAC address)

- Rebased patch series on v5.12-rc5

Cristian Ciocaltea (6):
dt-bindings: reserved-memory: Add Owl SoC serial number binding
dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding
soc: actions: Add Actions Semi Owl socinfo driver
arm: dts: owl-s500: Add reserved-memory range for Owl SoC serial
number
arm: dts: owl-s500: Add socinfo support
MAINTAINERS: Add entries for Owl reserved-memory and socinfo bindings

 .../actions,owl-soc-serial.yaml               |  53 ++++++
 .../bindings/soc/actions/owl-socinfo.yaml     |  57 +++++++
 MAINTAINERS                                   |   2 +
 arch/arm/boot/dts/owl-s500.dtsi               |  13 +-
 drivers/soc/actions/Kconfig                   |   8 +
 drivers/soc/actions/Makefile                  |   1 +
 drivers/soc/actions/owl-socinfo.c             | 152 ++++++++++++++++++
 include/linux/soc/actions/owl-serial-number.h |  20 +++
 8 files changed, 305 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
 create mode 100644 drivers/soc/actions/owl-socinfo.c
 create mode 100644 include/linux/soc/actions/owl-serial-number.h
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/6 dt-bindings: reserved-memory: Add Owl SoC serial number binding

Add devicetree binding for the Actions Semi Owl SoC serial number reserved-memory range.

---
 .../actions,owl-soc-serial.yaml               | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +53 -0
new file mode 100644
index 000000000000..41b71f47ee6c
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reserved-memory/actions,owl-soc-serial.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl reserved-memory for SoC serial number
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+description: |
+  Provide access to the memory region where the two parts of the Actions
+  Semi Owl SoC serial number (low & high) can be read from. This information
+  is provided by the bootloader, hence expose it under /reserved-memory node.
+
+  Please refer to reserved-memory.txt in this directory for common binding
+  part and usage.
+
+  This is currently supported only on the S500 SoC variant.
+
+properties:
+  compatible:
+    oneOf:
+      - const: actions,owl-soc-serial
+      - items:
+          - enum:
+              - actions,s500-soc-serial
+          - const: actions,owl-soc-serial
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+
+examples:
+  - |
+    reserved-memory {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges;
+
+        soc_serial: soc-serial@800 {
+            compatible = "actions,s500-soc-serial", "actions,owl-soc-serial";
+            reg = <0x800 0x8>;
+        };
+    };
+
+...
Signature · 1 line
2.31.1
maintainer
#2 lore raw

Re: [PATCH v2 1/6] dt-bindings: reserved-memory: Add Owl SoC serial number binding

Quoted 54 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl SoC serial number reserved-memory range.

---
 .../actions,owl-soc-serial.yaml               | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +39 -0
new file mode 100644
index 000000000000..41b71f47ee6c
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reserved-memory/actions,owl-soc-serial.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl reserved-memory for SoC serial number
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+description: |
+  Provide access to the memory region where the two parts of the Actions
+  Semi Owl SoC serial number (low & high) can be read from. This information
+  is provided by the bootloader, hence expose it under /reserved-memory node.
+
+  Please refer to reserved-memory.txt in this directory for common binding
+  part and usage.
+
+  This is currently supported only on the S500 SoC variant.
+
+properties:
+  compatible:
+    oneOf:
+      - const: actions,owl-soc-serial
+      - items:
+          - enum:
+              - actions,s500-soc-serial
+          - const: actions,owl-soc-serial
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+

Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +10 -0
+examples:
+  - |
+    reserved-memory {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges;
+
+        soc_serial: soc-serial@800 {
+            compatible = "actions,s500-soc-serial", "actions,owl-soc-serial";
+            reg = <0x800 0x8>;

You end up wasting a whole page of memory for 8 bytes. It may be better to copy this to a DT property ('serial-number' is already a defined root property).

Rob

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

Re: [PATCH v2 1/6] dt-bindings: reserved-memory: Add Owl SoC serial number binding

Quoted 61 lines · Rob Herring
Quoted 60 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl SoC serial number reserved-memory range.

---
 .../actions,owl-soc-serial.yaml               | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +45 -0
new file mode 100644
index 000000000000..41b71f47ee6c
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reserved-memory/actions,owl-soc-serial.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl reserved-memory for SoC serial number
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+description: |
+  Provide access to the memory region where the two parts of the Actions
+  Semi Owl SoC serial number (low & high) can be read from. This information
+  is provided by the bootloader, hence expose it under /reserved-memory node.
+
+  Please refer to reserved-memory.txt in this directory for common binding
+  part and usage.
+
+  This is currently supported only on the S500 SoC variant.
+
+properties:
+  compatible:
+    oneOf:
+      - const: actions,owl-soc-serial
+      - items:
+          - enum:
+              - actions,s500-soc-serial
+          - const: actions,owl-soc-serial
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+
+examples:
+  - |
+    reserved-memory {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges;
Quoted 8 lines

Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml line 49

Quoted 4 lines
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +4 -0
+
+        soc_serial: soc-serial@800 {
+            compatible = "actions,s500-soc-serial", "actions,owl-soc-serial";
+            reg = <0x800 0x8>;

You end up wasting a whole page of memory for 8 bytes. It may be better to copy this to a DT property ('serial-number' is already a defined root property).

Actually there is more information provided by the vendor bootloader in this memory page, so we might use it once we are able to decode it. For the moment I could only identify the serial number.

Thanks,
Cristi

Quoted 1 line

Rob

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

Re: [PATCH v2 1/6] dt-bindings: reserved-memory: Add Owl SoC serial number binding

Quoted 71 lines · Cristian Ciocaltea
Quoted 61 lines · Rob Herring
Quoted 60 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl SoC serial number reserved-memory range.

---
 .../actions,owl-soc-serial.yaml               | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +45 -0
new file mode 100644
index 000000000000..41b71f47ee6c
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reserved-memory/actions,owl-soc-serial.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl reserved-memory for SoC serial number
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+description: |
+  Provide access to the memory region where the two parts of the Actions
+  Semi Owl SoC serial number (low & high) can be read from. This information
+  is provided by the bootloader, hence expose it under /reserved-memory node.
+
+  Please refer to reserved-memory.txt in this directory for common binding
+  part and usage.
+
+  This is currently supported only on the S500 SoC variant.
+
+properties:
+  compatible:
+    oneOf:
+      - const: actions,owl-soc-serial
+      - items:
+          - enum:
+              - actions,s500-soc-serial
+          - const: actions,owl-soc-serial
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+
+examples:
+  - |
+    reserved-memory {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges;
Quoted 8 lines

Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml line 49

Quoted 4 lines
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +4 -0
+
+        soc_serial: soc-serial@800 {
+            compatible = "actions,s500-soc-serial", "actions,owl-soc-serial";
+            reg = <0x800 0x8>;

You end up wasting a whole page of memory for 8 bytes. It may be better to copy this to a DT property ('serial-number' is already a defined root property).

Quoted 1 line

Actually there is more information provided by the vendor bootloader

Then you should call it as socinfo or something not soc_serial.

Thanks,
Mani

Quoted 7 lines

in this memory page, so we might use it once we are able to decode it. For the moment I could only identify the serial number.

Thanks,
Cristi

Quoted 1 line

Rob

#5 lore raw

Re: [PATCH v2 1/6] dt-bindings: reserved-memory: Add Owl SoC serial number binding

Quoted 72 lines · Manivannan Sadhasivam
Quoted 71 lines · Cristian Ciocaltea
Quoted 69 lines · Rob Herring
Quoted 54 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl SoC serial number reserved-memory range.

---
 .../actions,owl-soc-serial.yaml               | 53 +++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +39 -0
new file mode 100644
index 000000000000..41b71f47ee6c
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reserved-memory/actions,owl-soc-serial.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl reserved-memory for SoC serial number
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+description: |
+  Provide access to the memory region where the two parts of the Actions
+  Semi Owl SoC serial number (low & high) can be read from. This information
+  is provided by the bootloader, hence expose it under /reserved-memory node.
+
+  Please refer to reserved-memory.txt in this directory for common binding
+  part and usage.
+
+  This is currently supported only on the S500 SoC variant.
+
+properties:
+  compatible:
+    oneOf:
+      - const: actions,owl-soc-serial
+      - items:
+          - enum:
+              - actions,s500-soc-serial
+          - const: actions,owl-soc-serial
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
+

Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml line 49

Quoted 10 lines
Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml new file +10 -0
+examples:
+  - |
+    reserved-memory {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges;
+
+        soc_serial: soc-serial@800 {
+            compatible = "actions,s500-soc-serial", "actions,owl-soc-serial";
+            reg = <0x800 0x8>;

You end up wasting a whole page of memory for 8 bytes. It may be better to copy this to a DT property ('serial-number' is already a defined root property).

Quoted 3 lines
Quoted 1 line

Actually there is more information provided by the vendor bootloader

Then you should call it as socinfo or something not soc_serial.

Agree, maybe 'bootinfo' or 'fwinfo', to suggest it is coming from firmware / bootloader.

Thanks for reviewing,
Cristi

Quoted 10 lines

Thanks,
Mani

Quoted 7 lines

in this memory page, so we might use it once we are able to decode it. For the moment I could only identify the serial number.

Thanks,
Cristi

Quoted 1 line

Rob

#6 lore raw

PATCH v2 2/6 dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding

In reply to Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl socinfo driver.

---
 .../bindings/soc/actions/owl-socinfo.yaml     | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +57 -0
new file mode 100644
index 000000000000..01e4a8b4f5ac
@@ -0,0 +1,57 @@
+# 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 <[email protected]>
+
+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.
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+      - const: simple-bus
+
+required:
+  - compatible
+
+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;
+        };
+    };
+
+...
Signature · 1 line
2.31.1
maintainer
#7 lore raw

Re: [PATCH v2 2/6] dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding

Quoted 54 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl socinfo driver.

---
 .../bindings/soc/actions/owl-socinfo.yaml     | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +40 -0
new file mode 100644
index 000000000000..01e4a8b4f5ac
@@ -0,0 +1,57 @@
+# 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 <[email protected]>
+
+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.
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+      - const: simple-bus
+
+required:
+  - compatible
+
+additionalProperties: true
+

Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +10 -0
+examples:
+  - |
+    / {
+        compatible = "roseapplepi,roseapplepi", "actions,s500";
+        model = "Roseapple Pi";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        soc {
+            compatible = "actions,s500-soc", "simple-bus";

What's the actual h/w for this bus? Still looks like abuse of DT to create your virtual soc_info driver.

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +7 -0
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+        };
+    };
+
+...
Signature · 1 line
2.31.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#8 lore raw

Re: [PATCH v2 2/6] dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding

Quoted 60 lines · Rob Herring
Quoted 59 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl socinfo driver.

---
 .../bindings/soc/actions/owl-socinfo.yaml     | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +45 -0
new file mode 100644
index 000000000000..01e4a8b4f5ac
@@ -0,0 +1,57 @@
+# 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 <[email protected]>
+
+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.
+
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+      - const: simple-bus
+
+required:
+  - compatible
+
+additionalProperties: true
+
+examples:
+  - |
+    / {
+        compatible = "roseapplepi,roseapplepi", "actions,s500";
+        model = "Roseapple Pi";
Quoted 8 lines

Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml line 50

Quoted 5 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +5 -0
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        soc {
+            compatible = "actions,s500-soc", "simple-bus";

What's the actual h/w for this bus? Still looks like abuse of DT to create your virtual soc_info driver.

Right, there is no bus involved in accessing soc info, but I assumed the already existing soc node in common DTS is a good candidate for binding the driver. (e.g. arch/arm/boot/dts/owl-s500.dtsi)

Should I, instead, create a dedicated sub-node?

Thanks,
Cristi

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +7 -0
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+        };
+    };
+
+...
Signature · 1 line
2.31.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#9 lore raw

Re: [PATCH v2 2/6] dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding

In reply to Cristian Ciocaltea
Quoted 2 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl socinfo driver.

Devicetree binding shouldn't be added for a driver instead for an IP or hw.

Quoted 17 lines
---
 .../bindings/soc/actions/owl-socinfo.yaml     | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +5 -0
new file mode 100644
index 000000000000..01e4a8b4f5ac
@@ -0,0 +1,57 @@
+# 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#

Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +10 -0
+
+title: Actions Semi Owl SoC info module
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+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.
+

S700/S900 are not yet confirmed, so please avoid them.

Quoted 25 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +25 -0
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+      - const: simple-bus
+
+required:
+  - compatible
+
+additionalProperties: true
+

Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +10 -0
+examples:
+  - |
+    / {
+        compatible = "roseapplepi,roseapplepi", "actions,s500";
+        model = "Roseapple Pi";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        soc {
+            compatible = "actions,s500-soc", "simple-bus";

No. This shouldn't fall under /soc. I think you should added a separate compatible for the reserved memory itself and add a corresponding socinfo driver under drivers/soc.

This way it is obvious that the information is contained in a memory region and a driver is used for parsing that.

Thanks,
Mani

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +7 -0
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+        };
+    };
+
+...
Signature · 1 line
2.31.1
#10 lore raw

Re: [PATCH v2 2/6] dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding

Quoted 76 lines · Manivannan Sadhasivam
Quoted 2 lines · Cristian Ciocaltea

Add devicetree binding for the Actions Semi Owl socinfo driver.

Devicetree binding shouldn't be added for a driver instead for an IP or hw.

Quoted 17 lines
---
 .../bindings/soc/actions/owl-socinfo.yaml     | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +5 -0
new file mode 100644
index 000000000000..01e4a8b4f5ac
@@ -0,0 +1,57 @@
+# 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#

Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml line 15

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +10 -0
+
+title: Actions Semi Owl SoC info module
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+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.
+

S700/S900 are not yet confirmed, so please avoid them.

Quoted 25 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +25 -0
+select:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - actions,s500-soc
+          - actions,s700-soc
+          - actions,s900-soc
+      - const: simple-bus
+
+required:
+  - compatible
+
+additionalProperties: true
+

Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml line 50

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +10 -0
+examples:
+  - |
+    / {
+        compatible = "roseapplepi,roseapplepi", "actions,s500";
+        model = "Roseapple Pi";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        soc {
+            compatible = "actions,s500-soc", "simple-bus";

No. This shouldn't fall under /soc. I think you should added a separate compatible for the reserved memory itself and add a corresponding socinfo driver under drivers/soc.

Quoted 2 lines

This way it is obvious that the information is contained in a memory region and a driver is used for parsing that.

I avoided on purpose to bind the driver on the reserved memory node in order to be able to handle also the S700 and S900 SoCs, for which we currently provide (only) the following information: machine, family, soc_id.

I assumed the serial_number is not mandatory and we can use the driver as it is for all SoC variants. I don't know how the serial number for S700 and S900 could be read, but I think it is very likely they require a different access method.

Hence my intention was to keep the driver generic, not coupled strictly with the serial number information.

Regards,
Cristi

Quoted 13 lines

Thanks,
Mani

Quoted 10 lines
Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml new file +7 -0
+            #address-cells = <1>;
+            #size-cells = <1>;
+            ranges;
+        };
+    };
+
+...
Signature · 1 line
2.31.1
#11 lore raw

PATCH v2 3/6 soc: actions: Add Actions Semi Owl socinfo driver

In reply to Cristian Ciocaltea

The driver provides information about the Action Semi Owl family of SoCs (S500, S700 and S900) to user space via sysfs: machine, family, soc_id, serial_number.

Note the serial number is currently provided only for the S500 SoC variant.

---
 drivers/soc/actions/Kconfig                   |   8 +
 drivers/soc/actions/Makefile                  |   1 +
 drivers/soc/actions/owl-socinfo.c             | 152 ++++++++++++++++++
 include/linux/soc/actions/owl-serial-number.h |  20 +++
 4 files changed, 181 insertions(+)
 create mode 100644 drivers/soc/actions/owl-socinfo.c
 create mode 100644 include/linux/soc/actions/owl-serial-number.h
drivers/soc/actions/Kconfig +8 -0
index 1aca2058a40c..15faade9282d 100644
@@ -14,4 +14,12 @@ config OWL_PM_DOMAINS
 	  power-gating on Actions Semiconductor S500, S700 and S900 SoCs.
 	  If unsure, say 'n'.
 
+config OWL_SOCINFO
+	bool "Actions Semi Owl SoC info driver"
+	default ARCH_ACTIONS
+	select SOC_BUS
+	help
+	  Say 'y' here to support the Action Semiconductor Owl socinfo
+	  driver, providing information about the SoC to user space.
+
 endif
drivers/soc/actions/Makefile +1 -0
index 4db9e7b050e5..4b2591d3089f 100644
@@ -2,3 +2,4 @@
 
 obj-$(CONFIG_OWL_PM_DOMAINS_HELPER) += owl-sps-helper.o
 obj-$(CONFIG_OWL_PM_DOMAINS) += owl-sps.o
+obj-$(CONFIG_OWL_SOCINFO) += owl-socinfo.o
drivers/soc/actions/owl-socinfo.c new file +152 -0

152 lines not on this page · raw message

include/linux/soc/actions/owl-serial-number.h new file +20 -0
new file mode 100644
index 000000000000..f8595417668f
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2021 Cristian Ciocaltea <[email protected]>
+ */
+
+#ifndef __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__
+#define __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__
+
+#if IS_ENABLED(CONFIG_OWL_SOCINFO)
+u32 owl_get_soc_serial_low(void);
+u32 owl_get_soc_serial_high(void);
+#else
+static inline u32 owl_get_soc_serial_low(void)
+{ return 0; }
+
+static inline u32 owl_get_soc_serial_high(void)
+{ return 0; }
+#endif /* CONFIG_OWL_SOCINFO */
+
+#endif /* __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__ */
Signature · 1 line
2.31.1
#12 lore raw

Re: [PATCH v2 3/6] soc: actions: Add Actions Semi Owl socinfo driver

Quoted 22 lines · Cristian Ciocaltea

The driver provides information about the Action Semi Owl family of SoCs (S500, S700 and S900) to user space via sysfs: machine, family, soc_id, serial_number.

Note the serial number is currently provided only for the S500 SoC variant.

---
 drivers/soc/actions/Kconfig                   |   8 +
 drivers/soc/actions/Makefile                  |   1 +
 drivers/soc/actions/owl-socinfo.c             | 152 ++++++++++++++++++
 include/linux/soc/actions/owl-serial-number.h |  20 +++
 4 files changed, 181 insertions(+)
 create mode 100644 drivers/soc/actions/owl-socinfo.c
 create mode 100644 include/linux/soc/actions/owl-serial-number.h
drivers/soc/actions/Kconfig +0 -0
index 1aca2058a40c..15faade9282d 100644

drivers/soc/actions/Kconfig config OWL_PM_DOMAINS · line 22

Quoted 9 lines
drivers/soc/actions/Kconfig +6 -0
@@ -14,4 +14,12 @@ config OWL_PM_DOMAINS
 	  power-gating on Actions Semiconductor S500, S700 and S900 SoCs.
 	  If unsure, say 'n'.
 
+config OWL_SOCINFO
+	bool "Actions Semi Owl SoC info driver"
+	default ARCH_ACTIONS
+	select SOC_BUS
+	help
+	  Say 'y' here to support the Action Semiconductor Owl socinfo

Actions Semi

Quoted 18 lines
drivers/soc/actions/Kconfig +2 -0
+	  driver, providing information about the SoC to user space.
+
 endif
drivers/soc/actions/Makefile +1 -0
index 4db9e7b050e5..4b2591d3089f 100644
@@ -2,3 +2,4 @@
 
 obj-$(CONFIG_OWL_PM_DOMAINS_HELPER) += owl-sps-helper.o
 obj-$(CONFIG_OWL_PM_DOMAINS) += owl-sps.o
+obj-$(CONFIG_OWL_SOCINFO) += owl-socinfo.o
drivers/soc/actions/owl-socinfo.c new file +0 -0
new file mode 100644
index 000000000000..f28eafac3792
@@ -0,0 +1,152 @@

[...]

drivers/soc/actions/owl-socinfo.c line 53

Quoted 13 lines

+ * Access SoC's serial number stored by the bootloader in DDR memory.
+ */

drivers/soc/actions/owl-socinfo.c new file +11 -0
+static int owl_socinfo_read_serial_rmem(struct device *dev)
+{
+	struct reserved_mem *rmem;
+	struct device_node *np;
+	int ret = 0;
+
+	np = of_find_compatible_node(NULL, NULL, "actions,owl-soc-serial");
+	if (!np)
+		return -ENXIO;
+
+	rmem = of_reserved_mem_lookup(np);

If you do this correctly, you could use "pdev->dev.of_node" here instead of using "of_find_compatible_node()" for getting np.

Quoted 6 lines
drivers/soc/actions/owl-socinfo.c new file +6 -0
+	if (!rmem) {
+		dev_err(dev, "failed to acquire reserved memory region\n");
+		ret = -EINVAL;
+		goto out_put;
+	}
+

[...]

drivers/soc/actions/owl-socinfo.c line 136

Quoted 4 lines
drivers/soc/actions/owl-socinfo.c new file +4 -0
+static const struct of_device_id owl_socinfo_of_match[] = {
+	{ .compatible = "actions,s500-soc", .data = &s500_soc_info, },
+	{ .compatible = "actions,s700-soc", .data = &s700_soc_info, },
+	{ .compatible = "actions,s900-soc", .data = &s900_soc_info, },

Please don't add S700/S900 for now.

Quoted 23 lines
drivers/soc/actions/owl-socinfo.c new file +16 -0
+	{ }
+};
+
+static struct platform_driver owl_socinfo_platform_driver = {
+	.probe = owl_socinfo_probe,
+	.driver = {
+		.name = "owl-socinfo",
+		.of_match_table = owl_socinfo_of_match,
+	},
+};
+
+static int __init owl_socinfo_init(void)
+{
+	return platform_driver_register(&owl_socinfo_platform_driver);
+}
+subsys_initcall(owl_socinfo_init);
include/linux/soc/actions/owl-serial-number.h new file +1 -0
new file mode 100644
index 000000000000..f8595417668f
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */

include/linux/soc/actions/owl-serial-number.h line 11

Quoted 10 lines
include/linux/soc/actions/owl-serial-number.h new file +10 -0
+/*
+ * Copyright (c) 2021 Cristian Ciocaltea <[email protected]>
+ */
+
+#ifndef __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__
+#define __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__
+
+#if IS_ENABLED(CONFIG_OWL_SOCINFO)
+u32 owl_get_soc_serial_low(void);
+u32 owl_get_soc_serial_high(void);

Where are these APIs used?

Thanks,
Mani

Quoted 12 lines
include/linux/soc/actions/owl-serial-number.h new file +9 -0
+#else
+static inline u32 owl_get_soc_serial_low(void)
+{ return 0; }
+
+static inline u32 owl_get_soc_serial_high(void)
+{ return 0; }
+#endif /* CONFIG_OWL_SOCINFO */
+
+#endif /* __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__ */
Signature · 1 line
2.31.1
#13 lore raw

Re: [PATCH v2 3/6] soc: actions: Add Actions Semi Owl socinfo driver

Quoted 56 lines · Manivannan Sadhasivam
Quoted 22 lines · Cristian Ciocaltea

The driver provides information about the Action Semi Owl family of SoCs (S500, S700 and S900) to user space via sysfs: machine, family, soc_id, serial_number.

Note the serial number is currently provided only for the S500 SoC variant.

---
 drivers/soc/actions/Kconfig                   |   8 +
 drivers/soc/actions/Makefile                  |   1 +
 drivers/soc/actions/owl-socinfo.c             | 152 ++++++++++++++++++
 include/linux/soc/actions/owl-serial-number.h |  20 +++
 4 files changed, 181 insertions(+)
 create mode 100644 drivers/soc/actions/owl-socinfo.c
 create mode 100644 include/linux/soc/actions/owl-serial-number.h
drivers/soc/actions/Kconfig +0 -0
index 1aca2058a40c..15faade9282d 100644

drivers/soc/actions/Kconfig config OWL_PM_DOMAINS · line 22

Quoted 9 lines
drivers/soc/actions/Kconfig +6 -0
@@ -14,4 +14,12 @@ config OWL_PM_DOMAINS
 	  power-gating on Actions Semiconductor S500, S700 and S900 SoCs.
 	  If unsure, say 'n'.
 
+config OWL_SOCINFO
+	bool "Actions Semi Owl SoC info driver"
+	default ARCH_ACTIONS
+	select SOC_BUS
+	help
+	  Say 'y' here to support the Action Semiconductor Owl socinfo

Actions Semi

Quoted 18 lines
drivers/soc/actions/Kconfig +2 -0
+	  driver, providing information about the SoC to user space.
+
 endif
drivers/soc/actions/Makefile +1 -0
index 4db9e7b050e5..4b2591d3089f 100644
@@ -2,3 +2,4 @@
 
 obj-$(CONFIG_OWL_PM_DOMAINS_HELPER) += owl-sps-helper.o
 obj-$(CONFIG_OWL_PM_DOMAINS) += owl-sps.o
+obj-$(CONFIG_OWL_SOCINFO) += owl-socinfo.o
drivers/soc/actions/owl-socinfo.c new file +0 -0
new file mode 100644
index 000000000000..f28eafac3792
@@ -0,0 +1,152 @@

[...]

Quoted 16 lines

drivers/soc/actions/owl-socinfo.c line 53

Quoted 13 lines

+ * Access SoC's serial number stored by the bootloader in DDR memory.
+ */

drivers/soc/actions/owl-socinfo.c new file +11 -0
+static int owl_socinfo_read_serial_rmem(struct device *dev)
+{
+	struct reserved_mem *rmem;
+	struct device_node *np;
+	int ret = 0;
+
+	np = of_find_compatible_node(NULL, NULL, "actions,owl-soc-serial");
+	if (!np)
+		return -ENXIO;
+
+	rmem = of_reserved_mem_lookup(np);

If you do this correctly, you could use "pdev->dev.of_node" here instead of using "of_find_compatible_node()" for getting np.

Right, as previously explained, my intention was to avoid binding the driver on the serial number node in order to keep it generic enough.

Quoted 9 lines
Quoted 6 lines
drivers/soc/actions/owl-socinfo.c new file +6 -0
+	if (!rmem) {
+		dev_err(dev, "failed to acquire reserved memory region\n");
+		ret = -EINVAL;
+		goto out_put;
+	}
+

[...]

Quoted 6 lines

drivers/soc/actions/owl-socinfo.c line 136

Quoted 4 lines
drivers/soc/actions/owl-socinfo.c new file +4 -0
+static const struct of_device_id owl_socinfo_of_match[] = {
+	{ .compatible = "actions,s500-soc", .data = &s500_soc_info, },
+	{ .compatible = "actions,s700-soc", .data = &s700_soc_info, },
+	{ .compatible = "actions,s900-soc", .data = &s900_soc_info, },

Please don't add S700/S900 for now.

I assumed we can use the driver for S700/S900, even though the serial number is not provided for them.

Quoted 27 lines
Quoted 27 lines
drivers/soc/actions/owl-socinfo.c new file +16 -0
+	{ }
+};
+
+static struct platform_driver owl_socinfo_platform_driver = {
+	.probe = owl_socinfo_probe,
+	.driver = {
+		.name = "owl-socinfo",
+		.of_match_table = owl_socinfo_of_match,
+	},
+};
+
+static int __init owl_socinfo_init(void)
+{
+	return platform_driver_register(&owl_socinfo_platform_driver);
+}
+subsys_initcall(owl_socinfo_init);
include/linux/soc/actions/owl-serial-number.h new file +5 -0
new file mode 100644
index 000000000000..f8595417668f
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2021 Cristian Ciocaltea <[email protected]>
+ */
+
Quoted 8 lines

include/linux/soc/actions/owl-serial-number.h line 11

Quoted 6 lines
include/linux/soc/actions/owl-serial-number.h new file +6 -0
+#ifndef __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__
+#define __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__
+
+#if IS_ENABLED(CONFIG_OWL_SOCINFO)
+u32 owl_get_soc_serial_low(void);
+u32 owl_get_soc_serial_high(void);

Where are these APIs used?

This will be used by the Ethernet MAC driver to generate a stable address. Initially I used the global 'system_serial_{low,high}' variables to pass this information outside the driver, but that is not portable, i.e. only supported on ARM32, not ARM64.

Thanks for the review,
Cristi

Quoted 15 lines

Thanks,
Mani

Quoted 12 lines
include/linux/soc/actions/owl-serial-number.h new file +9 -0
+#else
+static inline u32 owl_get_soc_serial_low(void)
+{ return 0; }
+
+static inline u32 owl_get_soc_serial_high(void)
+{ return 0; }
+#endif /* CONFIG_OWL_SOCINFO */
+
+#endif /* __SOC_ACTIONS_OWL_SERIAL_NUMBER_H__ */
Signature · 1 line
2.31.1
#14 lore raw

PATCH v2 4/6 arm: dts: owl-s500: Add reserved-memory range for Owl SoC serial number

In reply to Cristian Ciocaltea

Provide access to the reserved memory region where the Actions Semi Owl S500 SoC serial number can be read from.

---
 arch/arm/boot/dts/owl-s500.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/owl-s500.dtsi +11 -0
index 739b4b9cec8c..e4c61a9c6e39 100644
@@ -23,6 +23,17 @@ aliases {
 	chosen {
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		soc_serial: soc-serial@800 {
+			compatible = "actions,s500-soc-serial", "actions,owl-soc-serial";
+			reg = <0x800 0x8>;
+		};
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 1 line
2.31.1
#15 lore raw

PATCH v2 5/6 arm: dts: owl-s500: Add socinfo support

In reply to Cristian Ciocaltea

Update soc node compatible property to enable support for the Actions Semi Owl soc info driver.

---
 arch/arm/boot/dts/owl-s500.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/owl-s500.dtsi +1 -1
index e4c61a9c6e39..a8eb276e5ac1 100644
@@ -91,7 +91,7 @@ losc: losc {
 	};
 
 	soc {
-		compatible = "simple-bus";
+		compatible = "actions,s500-soc", "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
Signature · 1 line
2.31.1
#16 lore raw

PATCH v2 6/6 MAINTAINERS: Add entries for Owl reserved-memory and socinfo bindings

In reply to Cristian Ciocaltea

Add entries for the Actions Semi Owl reserved-memory and socinfo bindings.

---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index bea5ac8a5e47..48b7f7d097ae 100644
@@ -1533,6 +1533,8 @@ F:	Documentation/devicetree/bindings/mmc/owl-mmc.yaml
 F:	Documentation/devicetree/bindings/net/actions,owl-emac.yaml
 F:	Documentation/devicetree/bindings/pinctrl/actions,*
 F:	Documentation/devicetree/bindings/power/actions,owl-sps.txt
+F:	Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
+F:	Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
 F:	Documentation/devicetree/bindings/timer/actions,owl-timer.txt
 F:	arch/arm/boot/dts/owl-*
 F:	arch/arm/mach-actions/
Signature · 1 line
2.31.1
#17 lore raw
In reply to Cristian Ciocaltea
Quoted 9 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

This has been tested on the S500 SoC based RoseapplePi SBC.

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

Thanks,
Mani

Quoted 42 lines

Thanks,
Cristi

Changes in v2:
- Exposed the memory range for reading the SoC serial number under /reserved-memory DT node, according to Rob's review; as a consequence added a new binding document (actions,owl-soc-serial.yaml) and updated owl-socinfo.yaml

- Replaced the unportable usage of system_serial_{low,high} globals with a public API to provide external access to SoC serial number parts (e.g. Owl Ethernet MAC driver will use this to generate a stable MAC address)

- Rebased patch series on v5.12-rc5

Cristian Ciocaltea (6):
dt-bindings: reserved-memory: Add Owl SoC serial number binding
dt-bindings: soc: actions: Add Actions Semi Owl socinfo binding
soc: actions: Add Actions Semi Owl socinfo driver
arm: dts: owl-s500: Add reserved-memory range for Owl SoC serial
number
arm: dts: owl-s500: Add socinfo support
MAINTAINERS: Add entries for Owl reserved-memory and socinfo bindings

 .../actions,owl-soc-serial.yaml               |  53 ++++++
 .../bindings/soc/actions/owl-socinfo.yaml     |  57 +++++++
 MAINTAINERS                                   |   2 +
 arch/arm/boot/dts/owl-s500.dtsi               |  13 +-
 drivers/soc/actions/Kconfig                   |   8 +
 drivers/soc/actions/Makefile                  |   1 +
 drivers/soc/actions/owl-socinfo.c             | 152 ++++++++++++++++++
 include/linux/soc/actions/owl-serial-number.h |  20 +++
 8 files changed, 305 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/reserved-memory/actions,owl-soc-serial.yaml
 create mode 100644 Documentation/devicetree/bindings/soc/actions/owl-socinfo.yaml
 create mode 100644 drivers/soc/actions/owl-socinfo.c
 create mode 100644 include/linux/soc/actions/owl-serial-number.h
Signature · 1 line
2.31.1
#18 lore raw

Hi Mani,

Quoted 8 lines · Manivannan Sadhasivam
Quoted 7 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

Quoted 6 lines
Quoted 2 lines

This has been tested on the S500 SoC based RoseapplePi SBC.

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

No, the soc_id is not provided by the bootloader, or at least I couldn't identify any related implementation. Instead, I provided this via the driver itself, since I've encountered this approach in some other soc drivers as well (e.g. imx/soc-imx.c, versatile/soc-integrator.c).

Thanks,
Cristi

Quoted 2 lines

Thanks,
Mani

[...]

#19 lore raw
Quoted 14 lines · Cristian Ciocaltea

Hi Mani,

Quoted 11 lines · Manivannan Sadhasivam
Quoted 9 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

This has been tested on the S500 SoC based RoseapplePi SBC.

Quoted 9 lines
Quoted 3 lines

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

No, the soc_id is not provided by the bootloader, or at least I couldn't identify any related implementation. Instead, I provided this via the driver itself, since I've encountered this approach in some other soc drivers as well (e.g. imx/soc-imx.c, versatile/soc-integrator.c).

Sorry, I was referring to serial_number. Since your comment says so, can you point to the corresponding code?

Thanks,
Mani

Quoted 7 lines

Thanks,
Cristi

Quoted 2 lines

Thanks,
Mani

[...]

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#20 lore raw

Hi,

Quoted 17 lines · Manivannan Sadhasivam
Quoted 16 lines · Cristian Ciocaltea
Quoted 14 lines · Manivannan Sadhasivam
Quoted 9 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

This has been tested on the S500 SoC based RoseapplePi SBC.

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

Quoted 8 lines
Quoted 5 lines

No, the soc_id is not provided by the bootloader, or at least I couldn't identify any related implementation. Instead, I provided this via the driver itself, since I've encountered this approach in some other soc drivers as well (e.g. imx/soc-imx.c, versatile/soc-integrator.c).

Sorry, I was referring to serial_number. Since your comment says so, can you point to the corresponding code?

Seconded that this needs to be better understood. If this is just a convention of some downstream U-Boot that's not implemented in mainline (and maybe not even for Guitar or Labrador? tested on RoseapplePi only), it might not be worth its own reserved-memory based kernel driver?

Implementing a standard interface such as DMI tables or a DT property in mainline U-Boot may be more useful then. Is it still Mani's S900 only?

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#21 lore raw

Hi Mani, Andreas,

Quoted 26 lines · Andreas Färber

Hi,

Quoted 23 lines · Manivannan Sadhasivam
Quoted 21 lines · Cristian Ciocaltea
Quoted 8 lines · Manivannan Sadhasivam
Quoted 7 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

Quoted 6 lines
Quoted 2 lines

This has been tested on the S500 SoC based RoseapplePi SBC.

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

No, the soc_id is not provided by the bootloader, or at least I couldn't identify any related implementation. Instead, I provided this via the driver itself, since I've encountered this approach in some other soc drivers as well (e.g. imx/soc-imx.c, versatile/soc-integrator.c).

Quoted 7 lines
Quoted 2 lines

Sorry, I was referring to serial_number. Since your comment says so, can you point to the corresponding code?

Seconded that this needs to be better understood. If this is just a convention of some downstream U-Boot that's not implemented in mainline (and maybe not even for Guitar or Labrador? tested on RoseapplePi only), it might not be worth its own reserved-memory based kernel driver?

The serial number is actually provided by the s500-bootloader for which Actions did not provide the source code, at least it is not available in the xapp github repo. I did not find anything related to this in downstream U-Boot.

Kind regards,
Cristi

Quoted 11 lines

Implementing a standard interface such as DMI tables or a DT property in mainline U-Boot may be more useful then. Is it still Mani's S900 only?

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)
#22 lore raw

+ Matheus

Quoted 37 lines · Cristian Ciocaltea

Hi Mani, Andreas,

Quoted 26 lines · Andreas Färber

Hi,

Quoted 23 lines · Manivannan Sadhasivam
Quoted 21 lines · Cristian Ciocaltea
Quoted 8 lines · Manivannan Sadhasivam
Quoted 7 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

Quoted 6 lines
Quoted 2 lines

This has been tested on the S500 SoC based RoseapplePi SBC.

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

No, the soc_id is not provided by the bootloader, or at least I couldn't identify any related implementation. Instead, I provided this via the driver itself, since I've encountered this approach in some other soc drivers as well (e.g. imx/soc-imx.c, versatile/soc-integrator.c).

Quoted 7 lines
Quoted 2 lines

Sorry, I was referring to serial_number. Since your comment says so, can you point to the corresponding code?

Seconded that this needs to be better understood. If this is just a convention of some downstream U-Boot that's not implemented in mainline (and maybe not even for Guitar or Labrador? tested on RoseapplePi only), it might not be worth its own reserved-memory based kernel driver?

Quoted 5 lines

The serial number is actually provided by the s500-bootloader for which Actions did not provide the source code, at least it is not available in the xapp github repo. I did not find anything related to this in downstream U-Boot.

Hmm, then we can consider this as the firmware dependent property. But can we get consensus that this is common for all S500 SoCs? Maybe, Matheus can verify it on Labrador?

I don't think adding a SOCINFO driver for a single board is a good idea.

Thanks,
Mani

Quoted 14 lines

Kind regards,
Cristi

Quoted 11 lines

Implementing a standard interface such as DMI tables or a DT property in mainline U-Boot may be more useful then. Is it still Mani's S900 only?

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#23 lore raw
Quoted 40 lines · Manivannan Sadhasivam

+ Matheus

Quoted 37 lines · Cristian Ciocaltea

Hi Mani, Andreas,

Quoted 33 lines · Andreas Färber

Hi,

Quoted 17 lines · Manivannan Sadhasivam
Quoted 16 lines · Cristian Ciocaltea
Quoted 14 lines · Manivannan Sadhasivam
Quoted 9 lines · Cristian Ciocaltea

This patchset adds a socinfo driver which provides information about Actions Semi Owl SoCs to user space via sysfs: machine, family, soc_id, serial_number.

Please note the serial number is currently available only for the S500 SoC variant.

This has been tested on the S500 SoC based RoseapplePi SBC.

Is this the soc_id provided by the vendor bootloader (uboot)? If so, under what basis it provides? I don't think the SoC has the provision for soc_id based on HW parameters.

Quoted 8 lines
Quoted 5 lines

No, the soc_id is not provided by the bootloader, or at least I couldn't identify any related implementation. Instead, I provided this via the driver itself, since I've encountered this approach in some other soc drivers as well (e.g. imx/soc-imx.c, versatile/soc-integrator.c).

Sorry, I was referring to serial_number. Since your comment says so, can you point to the corresponding code?

Seconded that this needs to be better understood. If this is just a convention of some downstream U-Boot that's not implemented in mainline (and maybe not even for Guitar or Labrador? tested on RoseapplePi only), it might not be worth its own reserved-memory based kernel driver?

Quoted 8 lines
Quoted 5 lines

The serial number is actually provided by the s500-bootloader for which Actions did not provide the source code, at least it is not available in the xapp github repo. I did not find anything related to this in downstream U-Boot.

Hmm, then we can consider this as the firmware dependent property. But can we get consensus that this is common for all S500 SoCs?

This should work on all S500 SoCs, as the downstream Linux kernel doesn't use any conditional logic around reading those memory locations. Please see "owl_check_revision()" in arch/arm/mach-owl/board-owl.c, from any of the following repos:

* https://github.com/xapp-le/kernel
* https://github.com/LeMaker/linux-actions

Quoted 2 lines

Maybe,
Matheus can verify it on Labrador?

The verification is pretty straightforward: the serial number is dumped on the serial console by the s500 bootloader right before starting U-boot:

load uboot: load address is 0x8000000, entry point is 0x8000040 in fourth
chip serial no = 9d,4b,f,6d,31,46,e,8,
[...]
U-Boot 2015.04 (Apr 23 2020 - 23:01:25)Actions-Semi

The socinfo driver should provide the equivalent information, but in reversed order (due to integer representation on LE arch):

  $ cat /sys/devices/soc0/serial_number
  080e46316d0f4b9d
Quoted 1 line

I don't think adding a SOCINFO driver for a single board is a good idea.

The driver could be used for all Owl SoC variants, including S700 and S900, even though accessing the serial number is currently supported only on S500.

Unfortunately I do only have this S500 SoC based SBC to experiment with, therefore I cannot enable new features for the hardware I'm not able to validate.

Btw, do you know where I could get an S700 or S900 board from? I couldn't find any so far..

Thanks,
Cristi

Quoted 17 lines

Thanks,
Mani

Quoted 14 lines

Kind regards,
Cristi

Quoted 11 lines

Implementing a standard interface such as DMI tables or a DT property in mainline U-Boot may be more useful then. Is it still Mani's S900 only?

Regards,
Andreas

Signature · 4 lines
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel