[4/7] dt-bindings: remoteproc: add allwinner sun55i rproc binding

Message ID 20260922034711.190253-5-tcmichals@gmail.com (mailing list archive)
State New
Headers
Series remoteproc/mailbox: add Allwinner A523/A527/T527 E907 RISC-V support |

Commit Message

Tim Michals Sept. 22, 2026, 3:47 a.m. UTC
Add Device Tree binding schema for the Allwinner XuanTie E906/E907
RISC-V remote processor found on A523, A527, and T527 SoCs.

The remoteproc node manages the co-processor lifecycle (clocks, resets,
boot vector) and IPC (hardware mailbox). Memory regions are expressed
via reg entries named "cfg", "r_sram", "r_sram1", and "remap".

Cc: Bjorn Andersson <andersson@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Samuel Holland <samuel@sholland.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: linux-remoteproc@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-sunxi@lists.linux.dev
Signed-off-by: Tim Michals <tcmichals@gmail.com>
---
 .../remoteproc/allwinner,sun55i-rproc.yaml    | 152 ++++++++++++++++++
 1 file changed, 152 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
  

Comments

sashiko-bot@kernel.org Sept. 22, 2026, 3:56 a.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:
- [Low] dt-bindings: missing closing brace in device tree example
- [Low] dt-bindings: missing schema constraints for memory-region-names
- [Low] dt-bindings: missing schema enforcement for required r_sram regions
- [Low] dt-bindings: unnecessary status property redeclaration
- [Low] dt-bindings: unused arm-gic.h include in example
--

commit 1c1864dc9cdb1b1b685e0f8e7074d843ba81bbee
Author: Tim Michals <tcmichals@gmail.com>

dt-bindings: remoteproc: add allwinner sun55i rproc binding
    
Add Device Tree binding schema for the Allwinner XuanTie E906/E907
RISC-V remote processor found on A523, A527, and T527 SoCs.

> diff --git a/Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
> new file mode 100644
> index 0000000000000..5d8b929f60b67
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
> @@ -0,0 +1,152 @@

[ ... ]

> +  reg:
> +    minItems: 1
> +    maxItems: 4
> +    description: |
> +      Memory-mapped register regions. The following named regions are
> +      supported (all optional except at least one of r_sram or r_sram1):
> +        "cfg"    - RISC-V core control and boot-vector registers (0x07130000)
> +        "r_sram" - Dedicated MCU SRAM Space 0 (0x07280000 / 0x07200000; 256-512 KB)
> +        "r_sram1"- Switchable MCU SRAM Space 1 / SRAMA3_2 (0x072c0000 / 0x07280000; 256-512 KB)
> +        "remap"  - Hardware Remap Control Register (offset 0x364)
> +
> +  reg-names:
> +    minItems: 1
> +    maxItems: 4
> +    items:
> +      enum: [cfg, r_sram, r_sram1, remap]

[Severity: Low]
The description mentions a hardware requirement that at least one of "r_sram"
or "r_sram1" must be present. Should this constraint be enforced in the schema
(for example, using an anyOf block with contains on reg-names) so that a
device tree omitting both won't silently pass validation?

[ ... ]

> +  memory-region-names:
> +    description:
> +      Names corresponding to the memory-region phandle list entries.
> +      Recognized values are "vram", "dram", and "trace".

[Severity: Low]
Does this property need JSON schema constraints to enforce the allowed string
values? Without items and enum definitions, the schema allows any string
value or arbitrary array lengths to pass validation silently.

[ ... ]

> +  interrupt-names:
> +    items:
> +      - const: crash
> +
> +  status: true

[Severity: Low]
Is this redeclaration of the status property needed? Core device tree schemas
already declare the status property globally, so redeclaring it here without
strict constraints seems unnecessary.

[ ... ]

> +examples:
> +  - |
> +    #include <dt-bindings/clock/sun55i-a523-ccu.h>
> +    #include <dt-bindings/reset/sun55i-a523-ccu.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>

[Severity: Low]
Is this include needed? There are no interrupts defined in the example node,
so the macros from arm-gic.h appear to be unused dead code.

> +
> +    remoteproc@7130000 {
> +        compatible = "allwinner,sun55i-a523-rproc";
> +        reg = <0x07130000 0x1000>,
> +              <0x07280000 0x40000>,
> +              <0x072c0000 0x40000>,
> +              <0x07010364 0x4>;
> +        reg-names = "cfg", "r_sram", "r_sram1", "remap";
> +        clocks = <&mcu_ccu CLK_BUS_MCU_RISCV_CFG>,
> +                 <&mcu_ccu CLK_MCU_RISCV>;
> +        clock-names = "bus", "core";
> +        resets = <&mcu_ccu RST_BUS_MCU_RISCV_CFG>,
> +                 <&mcu_ccu RST_BUS_MCU_RISCV_CORE>;
> +        reset-names = "cfg", "core";
> +        mboxes = <&msgbox 0>, <&msgbox 1>;
> +        mbox-names = "rx", "tx";
> +        firmware-name = "testBasic.elf";

[Severity: Low]
Is there a missing closing brace and semicolon at the end of this example
node? Without it, dtc may report a syntax error when the dt_binding_check
build target compiles the example.
  
Krzysztof Kozlowski Sept. 22, 2026, 8:58 a.m. UTC | #2
On 22/09/2026 05:47, Tim Michals wrote:
> Add Device Tree binding schema for the Allwinner XuanTie E906/E907
> RISC-V remote processor found on A523, A527, and T527 SoCs.
> 

A nit, subject: drop second/last, redundant "binding". The "dt-bindings"
prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v7.1-rc7/source/Documentation/devicetree/bindings/submitting-patches.rst#L23

...

> +  resets:
> +    minItems: 1
> +    maxItems: 4
> +    description: |
> +      CCU reset lines. Typical resets are "cfg" (configuration block),
> +      "core" (CPU core), "sram" (SRAM interconnect), and "msgbox" (mailbox interconnect).
> +
> +  reset-names:
> +    minItems: 1
> +    maxItems: 4
> +    items:
> +      enum: [cfg, core, sram, msgbox]

Nope, this cannot be flexible. Please open existing code to see how this
is done.

Same comments everywhere else. I don't get why your previous patch had
it correct and here you decided to implement it completely different
style which almost does not exist in the kernel.

> +
> +  mboxes:
> +    minItems: 2

Drpo

> +    maxItems: 2
> +    description:
> +      Exactly two mailbox channels from the Allwinner CPUX_MSGBOX controller —
> +      one receive channel (RISC-V-to-ARM) and one transmit channel
> +      (ARM-to-RISC-V) — used for VirtIO RPMsg kick notifications.
> +
> +  mbox-names:
> +    items:
> +      - const: rx
> +      - const: tx
> +
> +  firmware-name:
> +    $ref: /schemas/types.yaml#/definitions/string

Drop. Instead maxItems. See existing code.

> +    description:
> +      Name of the ELF firmware image to load from /lib/firmware/.
> +      Defaults to "riscv-firmware.elf" if not specified.
> +
> +  memory-region:
> +    description:
> +      Optional phandle list of reserved memory regions for VirtIO vring
> +      buffers or DDR carveouts. Region names "vram" and "dram" are
> +      recognized; "trace" selects the RemoteProc trace buffer carveout.

List the items instead.

> +
> +  memory-region-names:
> +    description:
> +      Names corresponding to the memory-region phandle list entries.
> +      Recognized values are "vram", "dram", and "trace".

List the items instead.

> +
> +  interrupts:
> +    maxItems: 1
> +    description:
> +      Optional hardware crash-notification interrupt. When present the
> +      driver calls rproc_report_crash() on assertion.
> +
> +  interrupt-names:
> +    items:
> +      - const: crash
> +
> +  status: true
> +

Drop


Best regards,
Krzysztof
  
Rob Herring (Arm) Sept. 22, 2026, 12:46 p.m. UTC | #3
On Mon, 21 Sep 2026 22:47:08 -0500, Tim Michals wrote:
> Add Device Tree binding schema for the Allwinner XuanTie E906/E907
> RISC-V remote processor found on A523, A527, and T527 SoCs.
> 
> The remoteproc node manages the co-processor lifecycle (clocks, resets,
> boot vector) and IPC (hardware mailbox). Memory regions are expressed
> via reg entries named "cfg", "r_sram", "r_sram1", and "remap".
> 
> Cc: Bjorn Andersson <andersson@kernel.org>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Samuel Holland <samuel@sholland.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: linux-remoteproc@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-sunxi@lists.linux.dev
> Signed-off-by: Tim Michals <tcmichals@gmail.com>
> ---
>  .../remoteproc/allwinner,sun55i-rproc.yaml    | 152 ++++++++++++++++++
>  1 file changed, 152 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Lexical error: Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.example.dts:29.32-53 Unexpected 'CLK_BUS_MCU_RISCV_CFG'
Lexical error: Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.example.dts:30.32-45 Unexpected 'CLK_MCU_RISCV'
Lexical error: Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.example.dts:32.32-53 Unexpected 'RST_BUS_MCU_RISCV_CFG'
Lexical error: Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.example.dts:33.32-54 Unexpected 'RST_BUS_MCU_RISCV_CORE'
Error: Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.example.dts:40.3-41.1 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.dtbs:140: Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/linux-dt-review/Makefile:1714: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20260922034711.190253-5-tcmichals@gmail.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.
  

Patch

diff --git a/Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
new file mode 100644
index 000000000000..5d8b929f60b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/remoteproc/allwinner,sun55i-rproc.yaml
@@ -0,0 +1,152 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/remoteproc/allwinner,sun55i-rproc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner XuanTie E906/E907 RISC-V Remoteproc
+
+maintainers:
+  - Jernej Skrabec <jernej.skrabec@gmail.com>
+  - Samuel Holland <samuel@sholland.org>
+  - Tim Michals <tcmichals@gmail.com>
+
+description: |
+  The Allwinner T527, A527, and A523 (sun55i) SoCs integrate a T-Head
+  (XuanTie) E906 or E907 RISC-V co-processor alongside the ARM Cortex-A55
+  cluster. The co-processor runs bare-metal firmware loaded and lifecycle-
+  managed by the Linux remoteproc framework.
+
+  The driver controls CCU-integrated clocks (bus, core) and resets
+  (cfg, core), programs the hardware boot-vector register, maps
+  internal SRAM (SRAM_A3) windows, and connects to the Allwinner
+  hardware mailbox (CPUX_MSGBOX) for VirtIO RPMsg IPC.
+
+properties:
+  compatible:
+    enum:
+      - allwinner,sun55i-a523-rproc
+      - allwinner,sun55i-a527-rproc
+      - allwinner,sun55i-t527-rproc
+
+  reg:
+    minItems: 1
+    maxItems: 4
+    description: |
+      Memory-mapped register regions. The following named regions are
+      supported (all optional except at least one of r_sram or r_sram1):
+        "cfg"    - RISC-V core control and boot-vector registers (0x07130000)
+        "r_sram" - Dedicated MCU SRAM Space 0 (0x07280000 / 0x07200000; 256-512 KB)
+        "r_sram1"- Switchable MCU SRAM Space 1 / SRAMA3_2 (0x072c0000 / 0x07280000; 256-512 KB)
+        "remap"  - Hardware Remap Control Register (offset 0x364)
+
+  reg-names:
+    minItems: 1
+    maxItems: 4
+    items:
+      enum: [cfg, r_sram, r_sram1, remap]
+
+  clocks:
+    minItems: 1
+    maxItems: 5
+    description: |
+      CCU clocks required for co-processor operation. Typical clocks are
+      "parent" (PLL source), "bus" (interconnect gate), "core" (CPU gate),
+      "sram" (SRAM interconnect gate), and "msgbox" (mailbox interconnect gate).
+
+  clock-names:
+    minItems: 1
+    maxItems: 5
+    items:
+      enum: [parent, bus, core, sram, msgbox]
+
+  resets:
+    minItems: 1
+    maxItems: 4
+    description: |
+      CCU reset lines. Typical resets are "cfg" (configuration block),
+      "core" (CPU core), "sram" (SRAM interconnect), and "msgbox" (mailbox interconnect).
+
+  reset-names:
+    minItems: 1
+    maxItems: 4
+    items:
+      enum: [cfg, core, sram, msgbox]
+
+  mboxes:
+    minItems: 2
+    maxItems: 2
+    description:
+      Exactly two mailbox channels from the Allwinner CPUX_MSGBOX controller —
+      one receive channel (RISC-V-to-ARM) and one transmit channel
+      (ARM-to-RISC-V) — used for VirtIO RPMsg kick notifications.
+
+  mbox-names:
+    items:
+      - const: rx
+      - const: tx
+
+  firmware-name:
+    $ref: /schemas/types.yaml#/definitions/string
+    description:
+      Name of the ELF firmware image to load from /lib/firmware/.
+      Defaults to "riscv-firmware.elf" if not specified.
+
+  memory-region:
+    description:
+      Optional phandle list of reserved memory regions for VirtIO vring
+      buffers or DDR carveouts. Region names "vram" and "dram" are
+      recognized; "trace" selects the RemoteProc trace buffer carveout.
+
+  memory-region-names:
+    description:
+      Names corresponding to the memory-region phandle list entries.
+      Recognized values are "vram", "dram", and "trace".
+
+  interrupts:
+    maxItems: 1
+    description:
+      Optional hardware crash-notification interrupt. When present the
+      driver calls rproc_report_crash() on assertion.
+
+  interrupt-names:
+    items:
+      - const: crash
+
+  status: true
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+  - mboxes
+  - mbox-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/sun55i-a523-ccu.h>
+    #include <dt-bindings/reset/sun55i-a523-ccu.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    remoteproc@7130000 {
+        compatible = "allwinner,sun55i-a523-rproc";
+        reg = <0x07130000 0x1000>,
+              <0x07280000 0x40000>,
+              <0x072c0000 0x40000>,
+              <0x07010364 0x4>;
+        reg-names = "cfg", "r_sram", "r_sram1", "remap";
+        clocks = <&mcu_ccu CLK_BUS_MCU_RISCV_CFG>,
+                 <&mcu_ccu CLK_MCU_RISCV>;
+        clock-names = "bus", "core";
+        resets = <&mcu_ccu RST_BUS_MCU_RISCV_CFG>,
+                 <&mcu_ccu RST_BUS_MCU_RISCV_CORE>;
+        reset-names = "cfg", "core";
+        mboxes = <&msgbox 0>, <&msgbox 1>;
+        mbox-names = "rx", "tx";
+        firmware-name = "testBasic.elf";