Skip to contentSkip to conversation

Add a MicroBlaze remoteproc driver and binding

PATCH In review Ben Levinsky 4 participants 15 messages Apr 14 – Apr 15

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

cover Add a MicroBlaze remoteproc driver and binding

This series adds initial remoteproc support for AMD MicroBlaze soft processors.

The binding models the MicroBlaze remote processor as a child node whose reg property describes the executable firmware memory window in the MicroBlaze-local address space. The parent bus ranges property provides the standard devicetree address translation to the Linux-visible system physical address.

The driver uses that translated memory window as the executable remoteproc carveout and coredump segment, holds the MicroBlaze in reset through an active-low GPIO until firmware loading completes, and allows the firmware image to be selected with the optional firmware-name property. Firmware images without a resource table are also accepted.

This initial series focuses on basic load/start/stop support for a single executable memory window. It does not add any transport or mailbox integration.

Ben Levinsky (2):
dt-bindings: remoteproc: add AMD MicroBlaze binding
remoteproc: add AMD MicroBlaze driver

 .../bindings/remoteproc/amd,microblaze.yaml   |  67 ++++++
 MAINTAINERS                                   |   7 +
 drivers/remoteproc/Kconfig                    |  15 ++
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/amd_microblaze_rproc.c     | 202 ++++++++++++++++++
 5 files changed, 292 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml
 create mode 100644 drivers/remoteproc/amd_microblaze_rproc.c
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 dt-bindings: remoteproc: add AMD MicroBlaze binding

Describe an AMD MicroBlaze remote processor controlled through the remoteproc framework.

The binding models the MicroBlaze remoteproc device as a child node whose reg property describes the executable firmware memory window in the MicroBlaze-local address space. The parent bus node provides standard devicetree address translation through ranges so Linux can access the same memory through the system physical address space.

An active-low reset GPIO holds the MicroBlaze in reset until firmware loading completes.

---
 .../bindings/remoteproc/amd,microblaze.yaml   | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +67 -0
new file mode 100644
index 000000000000..2811610204a9
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze
+
+  reg:
+    maxItems: 1
+    description:
+      MicroBlaze-local address and size of the executable firmware memory
+      window.
+
+  firmware-name:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    / {
+      #address-cells = <2>;
+      #size-cells = <2>;
+
+      bus@b0000000 {
+        compatible = "simple-pm-bus";
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x0 0xb0000000 0x40000>;
+
+        remoteproc@0 {
+          compatible = "amd,microblaze";
+          reg = <0x0 0x40000>;
+          reset-gpios = <&mbv_reset_gpio 0 GPIO_ACTIVE_LOW>;
+        };
+      };
+    };
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 10 lines · Ben Levinsky

Describe an AMD MicroBlaze remote processor controlled through the remoteproc framework.

The binding models the MicroBlaze remoteproc device as a child node whose reg property describes the executable firmware memory window in the MicroBlaze-local address space. The parent bus node provides standard devicetree address translation through ranges so Linux can access the same memory through the system physical address space.

Quoted 9 lines

An active-low reset GPIO holds the MicroBlaze in reset until firmware loading completes.

---
 .../bindings/remoteproc/amd,microblaze.yaml   | 67 +++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/remoteproc/amd,microblaze.example.dtb: /: 'compatible' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/remoteproc/amd,microblaze.example.dtb: /: 'model' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/remoteproc/amd,microblaze.example.dtb: bus@b0000000 (simple-pm-bus): 'anyOf' conditional failed, one must be fixed:
'clocks' is a required property
'power-domains' is a required property
from schema $id: http://devicetree.org/schemas/bus/simple-pm-bus.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

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.

#3 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

In reply to Ben Levinsky

On 14/04/2026 18:15, Ben Levinsky wrote:

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/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 14

Quoted 12 lines

+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +9 -0
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.

Describe hardware, not Linux frameworks. IOW, Linux framework is here irrelevant.

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +12 -0
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze

microblaze is architecture, so this feels way too generic. You need SoC specific compatibles and I suggest do not reference architecture, but name or the function of the processor, if there are such.

Quoted 24 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +24 -0
+
+  reg:
+    maxItems: 1
+    description:
+      MicroBlaze-local address and size of the executable firmware memory
+      window.
+
+  firmware-name:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 60

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +10 -0
+    / {
+      #address-cells = <2>;
+      #size-cells = <2>;
+
+      bus@b0000000 {
+        compatible = "simple-pm-bus";
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x0 0xb0000000 0x40000>;
+

Drop all above.

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 67

Quoted 7 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +7 -0
+        remoteproc@0 {
+          compatible = "amd,microblaze";
+          reg = <0x0 0x40000>;
+          reset-gpios = <&mbv_reset_gpio 0 GPIO_ACTIVE_LOW>;
+        };
+      };
+    };

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 23 lines · Krzysztof Kozlowski

On 14/04/2026 18:15, Ben Levinsky wrote:

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/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 14

Quoted 12 lines

+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +9 -0
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.

Describe hardware, not Linux frameworks. IOW, Linux framework is here irrelevant.

Quoted 16 lines

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +12 -0
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze

microblaze is architecture, so this feels way too generic. You need SoC specific compatibles and I suggest do not reference architecture, but name or the function of the processor, if there are such.

I have been arguing internally that I think when you look at driver itself it can be pretty much generic loader for any firmware and doesn't really matter if target subsystem is Microblaze/Risc-V/whatever based. And I was suggesting them to use more generic name.

Because at the end of day reg property is pointing to location where firmware should be loaded and gpio is a way how to start that subsystem and there is nothing Microblaze specific.

I can also imagine that the same driver could be extended with optional power domain, power regulator and clock properties if there is a need to drive them before subsystem gets out of reset.

Does it make sense?

Thanks,
Michal

#5 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 43 lines · Michal Simek
Quoted 23 lines · Krzysztof Kozlowski

On 14/04/2026 18:15, Ben Levinsky wrote:

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/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 14

Quoted 12 lines

+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +9 -0
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.

Describe hardware, not Linux frameworks. IOW, Linux framework is here irrelevant.

Quoted 16 lines

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +12 -0
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze

microblaze is architecture, so this feels way too generic. You need SoC specific compatibles and I suggest do not reference architecture, but name or the function of the processor, if there are such.

Quoted 2 lines

I have been arguing internally that I think when you look at driver itself it can be pretty much generic loader for any firmware and doesn't really matter if

Luckily I don't speak about driver :)

Quoted 2 lines

target subsystem is Microblaze/Risc-V/whatever based. And I was suggesting them to use more generic name.

So the binding is for drivers - generic loader? Then simply no. Not suitable for DT.

Quoted 10 lines

Because at the end of day reg property is pointing to location where firmware should be loaded and gpio is a way how to start that subsystem and there is nothing Microblaze specific.

I can also imagine that the same driver could be extended with optional power domain, power regulator and clock properties if there is a need to drive them before subsystem gets out of reset.

Does it make sense?

Yes, drop from DT. No need for generic stuff. Or describe the hardware.

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 44 lines · Krzysztof Kozlowski
Quoted 43 lines · Michal Simek
Quoted 39 lines · Krzysztof Kozlowski

On 14/04/2026 18:15, Ben Levinsky wrote:

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/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 14

Quoted 12 lines

+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +9 -0
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.

Describe hardware, not Linux frameworks. IOW, Linux framework is here irrelevant.

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +12 -0
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze

microblaze is architecture, so this feels way too generic. You need SoC specific compatibles and I suggest do not reference architecture, but name or the function of the processor, if there are such.

Quoted 4 lines
Quoted 2 lines

I have been arguing internally that I think when you look at driver itself it can be pretty much generic loader for any firmware and doesn't really matter if

Luckily I don't speak about driver :)

:-)

Quoted 12 lines
Quoted 3 lines

target subsystem is Microblaze/Risc-V/whatever based. And I was suggesting them to use more generic name.

So the binding is for drivers - generic loader? Then simply no. Not suitable for DT.

Quoted 5 lines

Because at the end of day reg property is pointing to location where firmware should be loaded and gpio is a way how to start that subsystem and there is nothing Microblaze specific.

Quoted 7 lines
Quoted 5 lines

I can also imagine that the same driver could be extended with optional power domain, power regulator and clock properties if there is a need to drive them before subsystem gets out of reset.

Does it make sense?

Yes, drop from DT. No need for generic stuff. Or describe the hardware.

You need to describe that connection to HW. GPIOs, memory location, etc. It means there must be any description.

Thanks,
Michal

#7 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 7 lines · Michal Simek
Quoted 4 lines
Quoted 2 lines

Does it make sense?

Yes, drop from DT. No need for generic stuff. Or describe the hardware.

You need to describe that connection to HW. GPIOs, memory location, etc. It means there must be any description.

No, you can write user-space driver or pass everything through SW nodes. No need for DT description.

But if you want a DT description, then it must be for the specific hardware, since the hardware is not generic.

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Michal Simek
Quoted 4 lines
Quoted 2 lines

Does it make sense?

Yes, drop from DT. No need for generic stuff. Or describe the hardware.

You need to describe that connection to HW. GPIOs, memory location, etc. It means there must be any description.

No, you can write user-space driver or pass everything through SW nodes. No need for DT description.

The firmware memory typically sits behind AXI-to-AXI bridges and

interconnect switches. The bus topology varies between FPGA designs.

DT ranges-based address translation is the standard way to describe

this, and pushing it into userspace would just mean hardcoding what

ranges already provides.

I don't think SW nodes should be used here.

Quoted 3 lines

But if you want a DT description, then it must be for the specific hardware, since the hardware is not generic.

But there is specific HW loaded. It is loaded at power up and don't change over life cycle. What I am just saying that access to this fixed HW (in fpga) is generic. At this stage memory and gpio only.

What I was trying to say is that the hardware topology (memory window +

reset GPIO) is the same regardless of the soft-core cpu (MicroBlaze, RISC-V, etc.)/fpga, so naming it after the ISA architecture felt wrong to me

too.

When I look at other bindings. For example this one. Documentation/devicetree/bindings/remoteproc/qcom,glink-rpm-edge.yaml

the compatible describes the communication mechanism (FIFO-based G-Link), not the specific processor behind it.

Our case is similar the compatible describes the control mechanism firmware loaded through a memory window, processor started via GPIO reset. What sits behind that interface varies and is opaque to the binding.

Would something like "amd,mem-gpio-rproc" be acceptable, following the same pattern where the compatible identifies the interface mechanism?

Thanks,
Michal

#9 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 37 lines · Michal Simek
Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Michal Simek
Quoted 4 lines
Quoted 2 lines

Does it make sense?

Yes, drop from DT. No need for generic stuff. Or describe the hardware.

You need to describe that connection to HW. GPIOs, memory location, etc. It means there must be any description.

No, you can write user-space driver or pass everything through SW nodes. No need for DT description.

The firmware memory typically sits behind AXI-to-AXI bridges and

interconnect switches. The bus topology varies between FPGA designs.

DT ranges-based address translation is the standard way to describe

this, and pushing it into userspace would just mean hardcoding what

ranges already provides.

I don't think SW nodes should be used here.

Quoted 3 lines

But if you want a DT description, then it must be for the specific hardware, since the hardware is not generic.

But there is specific HW loaded. It is loaded at power up and don't change over life cycle. What I am just saying that access to this fixed HW (in fpga) is generic. At this stage memory and gpio only.

What I was trying to say is that the hardware topology (memory window +

Quoted 7 lines

reset GPIO) is the same regardless of the soft-core cpu (MicroBlaze, RISC-V, etc.)/fpga, so naming it after the ISA architecture felt wrong to me

too.

When I look at other bindings. For example this one. Documentation/devicetree/bindings/remoteproc/qcom,glink-rpm-edge.yaml

That's a subnode of other device. Not an independent device.

Plus I dislike most of Qualcomm remoteproc bindings and find them way to downstreamish, written to match downstream approaches without respecting DT rules.

Quoted 6 lines

the compatible describes the communication mechanism (FIFO-based G-Link), not the specific processor behind it.

Quoted 7 lines

Our case is similar the compatible describes the control mechanism firmware loaded through a memory window, processor started via GPIO reset. What sits behind that interface varies and is opaque to the binding.

Would something like "amd,mem-gpio-rproc" be acceptable, following the same pattern where the compatible identifies the interface mechanism?

Not for me. You have a very specific physical remote processor. That's what you write bindings for.

Best regards,
Krzysztof

#10 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 63 lines · Krzysztof Kozlowski
Quoted 37 lines · Michal Simek
Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Michal Simek
Quoted 4 lines
Quoted 2 lines

Does it make sense?

Yes, drop from DT. No need for generic stuff. Or describe the hardware.

You need to describe that connection to HW. GPIOs, memory location, etc. It means there must be any description.

No, you can write user-space driver or pass everything through SW nodes. No need for DT description.

The firmware memory typically sits behind AXI-to-AXI bridges and

interconnect switches. The bus topology varies between FPGA designs.

DT ranges-based address translation is the standard way to describe

this, and pushing it into userspace would just mean hardcoding what

ranges already provides.

I don't think SW nodes should be used here.

Quoted 3 lines

But if you want a DT description, then it must be for the specific hardware, since the hardware is not generic.

But there is specific HW loaded. It is loaded at power up and don't change over life cycle. What I am just saying that access to this fixed HW (in fpga) is generic. At this stage memory and gpio only.

What I was trying to say is that the hardware topology (memory window +

Quoted 7 lines

reset GPIO) is the same regardless of the soft-core cpu (MicroBlaze, RISC-V, etc.)/fpga, so naming it after the ISA architecture felt wrong to me

too.

When I look at other bindings. For example this one. Documentation/devicetree/bindings/remoteproc/qcom,glink-rpm-edge.yaml

That's a subnode of other device. Not an independent device.

Plus I dislike most of Qualcomm remoteproc bindings and find them way to downstreamish, written to match downstream approaches without respecting DT rules.

Quoted 11 lines

the compatible describes the communication mechanism (FIFO-based G-Link), not the specific processor behind it.

Our case is similar the compatible describes the control mechanism firmware loaded through a memory window, processor started via GPIO reset. What sits behind that interface varies and is opaque to the binding.

Quoted 5 lines
Quoted 2 lines

Would something like "amd,mem-gpio-rproc" be acceptable, following the same pattern where the compatible identifies the interface mechanism?

Not for me. You have a very specific physical remote processor. That's what you write bindings for.

And we have it which is Microblaze with bram (block ram) which is mapped to host CPU memory range which is going to be loaded by firmware and start by toggling gpio. I think what we only don't have is proper compatible string which will describe this HW. If you don't like generic name we can describe it specifically for this configuration.

amd,microblaze-mem-gpio-rproc for example without any generic fallback.

Or we could create a spec, design recommendation for this type of configuration if that helps.

What do you suggest?

Thanks,
Michal

maintainer
#11 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

In reply to Michal Simek
Quoted 44 lines · Michal Simek
Quoted 23 lines · Krzysztof Kozlowski

On 14/04/2026 18:15, Ben Levinsky wrote:

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/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 14

Quoted 12 lines

+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +9 -0
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.

Describe hardware, not Linux frameworks. IOW, Linux framework is here irrelevant.

Quoted 16 lines

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +12 -0
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze

microblaze is architecture, so this feels way too generic. You need SoC specific compatibles and I suggest do not reference architecture, but name or the function of the processor, if there are such.

Quoted 4 lines

I have been arguing internally that I think when you look at driver itself it can be pretty much generic loader for any firmware and doesn't really matter if target subsystem is Microblaze/Risc-V/whatever based. And I was suggesting them to use more generic name.

Generic to AMD though, not everyone, right?

I agree it probably doesn't matter what the processor arch is. The compatible just needs to be specific enough when there's some quirk/feature in the interface to the operating system, that we can distinguish the specific implementation *without* a DT update.

Quoted 7 lines

Because at the end of day reg property is pointing to location where firmware should be loaded and gpio is a way how to start that subsystem and there is nothing Microblaze specific.

I can also imagine that the same driver could be extended with optional power domain, power regulator and clock properties if there is a need to drive them before subsystem gets out of reset.

That never works because then there's timing/ordering constraints for enabling/disabling all those resources. Then we end up with a never ending stream of properties added which results in a poorly designed binding.

Rob

#12 lore raw

Re: [PATCH 1/2] dt-bindings: remoteproc: add AMD MicroBlaze binding

Quoted 50 lines · Rob Herring
Quoted 44 lines · Michal Simek
Quoted 23 lines · Krzysztof Kozlowski

On 14/04/2026 18:15, Ben Levinsky wrote:

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/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 14

Quoted 12 lines

+---
+$id: http://devicetree.org/schemas/remoteproc/amd,microblaze.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +9 -0
+
+title: AMD MicroBlaze remote processor
+
+maintainers:
+  - Ben Levinsky <[email protected]>
+
+description:
+  MicroBlaze remote processor controlled by Linux through the remoteproc
+  framework.

Describe hardware, not Linux frameworks. IOW, Linux framework is here irrelevant.

Quoted 16 lines

Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml line 26

Quoted 12 lines
Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml new file +12 -0
+
+  The executable firmware memory window is described in the
+  MicroBlaze-local address space by the node's reg property and translated
+  to the system physical address space with standard devicetree address
+  translation provided by the parent bus node's ranges property.
+
+properties:
+  $nodename:
+    pattern: "^remoteproc@[0-9a-f]+$"
+
+  compatible:
+    const: amd,microblaze

microblaze is architecture, so this feels way too generic. You need SoC specific compatibles and I suggest do not reference architecture, but name or the function of the processor, if there are such.

Quoted 4 lines

I have been arguing internally that I think when you look at driver itself it can be pretty much generic loader for any firmware and doesn't really matter if target subsystem is Microblaze/Risc-V/whatever based. And I was suggesting them to use more generic name.

Quoted 6 lines

Generic to AMD though, not everyone, right?

I agree it probably doesn't matter what the processor arch is. The compatible just needs to be specific enough when there's some quirk/feature in the interface to the operating system, that we can distinguish the specific implementation *without* a DT update.

If any fpga vendor creates the same configuration description will be the same for them too. But not a problem with having it generic to AMD only.

I think the point is to come up with proper compatible string which you will agree on.

Quoted 5 lines
Quoted 5 lines

Because at the end of day reg property is pointing to location where firmware should be loaded and gpio is a way how to start that subsystem and there is nothing Microblaze specific.

Quoted 8 lines
Quoted 3 lines

I can also imagine that the same driver could be extended with optional power domain, power regulator and clock properties if there is a need to drive them before subsystem gets out of reset.

That never works because then there's timing/ordering constraints for enabling/disabling all those resources. Then we end up with a never ending stream of properties added which results in a poorly designed binding.

Actually even current binding should have clock described and handled because clock has to be enabled before releasing GPIO out of reset. If it is coming outside of chip it should still be modeled.

Anyway I don't think we have ever end in a never ending stream of properties for our IP and this is not going to be the case too.

Thanks,
Michal

#13 lore raw

PATCH 2/2 remoteproc: add AMD MicroBlaze driver

In reply to Ben Levinsky

Add an AMD MicroBlaze remoteproc driver.

The driver parses the executable firmware memory window from the remoteproc device node's reg property, interprets that address and size in the MicroBlaze-local address space, and then uses standard devicetree address translation through the parent bus ranges property to obtain the corresponding Linux-visible system physical address.

The resulting translated region is registered as the executable remoteproc carveout and coredump segment.

The MicroBlaze is controlled through an active-low reset GPIO and kept in reset until firmware loading completes.

The firmware-name property is optional, allowing firmware to be assigned later through the remoteproc framework.

---
 MAINTAINERS                               |   7 +
 drivers/remoteproc/Kconfig                |  15 ++
 drivers/remoteproc/Makefile               |   1 +
 drivers/remoteproc/amd_microblaze_rproc.c | 202 ++++++++++++++++++++++
 4 files changed, 225 insertions(+)
 create mode 100644 drivers/remoteproc/amd_microblaze_rproc.c
MAINTAINERS +7 -0
index a7e30df8ba5d..a70397b9ca71 100644
@@ -1172,6 +1172,13 @@ F:	drivers/gpu/drm/amd/include/vi_structs.h
 F:	include/uapi/linux/kfd_ioctl.h
 F:	include/uapi/linux/kfd_sysfs.h
 
+AMD MICROBLAZE REMOTEPROC DRIVER
+M:	Ben Levinsky <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/remoteproc/amd,microblaze.yaml
+F:	drivers/remoteproc/amd_microblaze_rproc.c
+
 AMD MP2 I2C DRIVER
 M:	Elie Morisse <[email protected]>
 M:	Shyam Sundar S K <[email protected]>
drivers/remoteproc/Kconfig +15 -0
index ee54436fea5a..76de743241a7 100644
@@ -23,6 +23,21 @@ config REMOTEPROC_CDEV
 
 	  It's safe to say N if you don't want to use this interface.
 
+config AMD_MICROBLAZE_REMOTEPROC
+	tristate "AMD MicroBlaze remoteproc support"
+	depends on OF
+	depends on GPIOLIB || COMPILE_TEST
+	help
+	  Say y or m here to support a MicroBlaze remote processor controlled
+	  by Linux through the remoteproc framework.
+
+	  This driver matches designs where executable firmware memory is
+	  described in the MicroBlaze-local address space and translated to
+	  the system physical address space with standard devicetree address
+	  translation.
+
+	  If unsure, say N.
+
 config IMX_REMOTEPROC
 	tristate "i.MX remoteproc support"
 	depends on ARCH_MXC
drivers/remoteproc/Makefile +1 -0
index 1c7598b8475d..8717a0aec2e6 100644
@@ -11,6 +11,7 @@ remoteproc-y				+= remoteproc_sysfs.o
 remoteproc-y				+= remoteproc_virtio.o
 remoteproc-y				+= remoteproc_elf_loader.o
 obj-$(CONFIG_REMOTEPROC_CDEV)		+= remoteproc_cdev.o
+obj-$(CONFIG_AMD_MICROBLAZE_REMOTEPROC)	+= amd_microblaze_rproc.o
 obj-$(CONFIG_IMX_REMOTEPROC)		+= imx_rproc.o
 obj-$(CONFIG_IMX_DSP_REMOTEPROC)	+= imx_dsp_rproc.o
 obj-$(CONFIG_INGENIC_VPU_RPROC)		+= ingenic_rproc.o
drivers/remoteproc/amd_microblaze_rproc.c new file +202 -0

202 lines not on this page · raw message

Signature · 1 line
2.34.1
#14 lore raw

Re: [PATCH 2/2] remoteproc: add AMD MicroBlaze driver

Quoted 9 lines · Ben Levinsky

Add an AMD MicroBlaze remoteproc driver.

The driver parses the executable firmware memory window from the remoteproc device node's reg property, interprets that address and size in the MicroBlaze-local address space, and then uses standard devicetree address translation through the parent bus ranges property to obtain the corresponding Linux-visible system physical address.

Quoted 9 lines

The resulting translated region is registered as the executable remoteproc carveout and coredump segment.

The MicroBlaze is controlled through an active-low reset GPIO and kept in reset until firmware loading completes.

The firmware-name property is optional, allowing firmware to be assigned later through the remoteproc framework.

Fix your commit msg so it uses sane style, not some indentation.

Look at how other commits are written, if you have doubts.

...

drivers/remoteproc/amd_microblaze_rproc.c line 98

Quoted 6 lines
drivers/remoteproc/amd_microblaze_rproc.c new file +6 -0
+
+static int mb_rproc_start(struct rproc *rproc)
+{
+	struct mb_rproc *mb = rproc->priv;
+
+	/* reset-gpios is declared active-low, so logical 0 releases reset */

If reset-gpios is declared active-high, then logical 0 also releases reset.

Drop comment, not correct.

Quoted 72 lines
drivers/remoteproc/amd_microblaze_rproc.c new file +72 -0
+	gpiod_set_value_cansleep(mb->reset, 0);
+
+	return 0;
+}
+
+static int mb_rproc_stop(struct rproc *rproc)
+{
+	struct mb_rproc *mb = rproc->priv;
+
+	/* reset-gpios is declared active-low, so logical 1 asserts reset */
+	gpiod_set_value_cansleep(mb->reset, 1);
+
+	return 0;
+}
+
+static int mb_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
+{
+	int ret;
+
+	ret = rproc_elf_load_rsc_table(rproc, fw);
+	if (ret == -EINVAL) {
+		dev_dbg(&rproc->dev, "no resource table found\n");
+		return 0;
+	}
+
+	return ret;
+}
+
+static const struct rproc_ops mb_rproc_ops = {
+	.prepare	= mb_rproc_prepare,
+	.start		= mb_rproc_start,
+	.stop		= mb_rproc_stop,
+	.load		= rproc_elf_load_segments,
+	.sanity_check	= rproc_elf_sanity_check,
+	.get_boot_addr	= rproc_elf_get_boot_addr,
+	.parse_fw	= mb_rproc_parse_fw,
+};
+
+static int mb_rproc_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct mb_rproc *mb;
+	struct rproc *rproc;
+	const char *fw_name = NULL;
+	int ret;
+
+	ret = rproc_of_parse_firmware(dev, 0, &fw_name);
+	if (ret < 0 && ret != -EINVAL)
+		return dev_err_probe(dev, ret,
+				     "failed to parse firmware-name property\n");
+
+	rproc = devm_rproc_alloc(dev, dev_name(dev), &mb_rproc_ops, fw_name,
+				 sizeof(*mb));
+	if (!rproc)
+		return -ENOMEM;
+
+	mb = rproc->priv;
+	mb->dev = dev;
+
+	/*
+	 * Keep the MicroBlaze in reset until remoteproc has finished loading
+	 * firmware into the executable memory window described by reg and
+	 * translated through the parent bus ranges property.
+	 */
+	mb->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(mb->reset))
+		return dev_err_probe(dev, PTR_ERR(mb->reset),
+				     "failed to get reset gpio\n");
+
+	rproc->auto_boot = false;
+
+	ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));

drivers/remoteproc/amd_microblaze_rproc.c line 180

Quoted 10 lines
drivers/remoteproc/amd_microblaze_rproc.c new file +10 -0
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to set DMA mask\n");
+
+	platform_set_drvdata(pdev, rproc);
+
+	ret = devm_rproc_add(dev, rproc);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register rproc\n");
+
+	dev_dbg(dev, "MicroBlaze remoteproc registered\n");

Drop. This does not look like useful printk message. Drivers should be silent on success:
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/coding-style.rst#L913
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/debugging/driver_development_debugging_guide.rst#L79

Core already gives way to see probe success.

Best regards,
Krzysztof