aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-06-05 16:16:36 +0200
committerMikael Olsson <mikael.olsson@arm.com>2023-09-25 15:01:34 +0200
commit9d0ea8bc126833da28508a0836d02fa437489bab (patch)
tree06146e7e3093c0a35fdb8c7973225ed678bd15f3 /README.md
parenta45260efce33ecb55a37545212ff9e5da244c4e9 (diff)
downloadethos-u-linux-driver-stack-9d0ea8bc126833da28508a0836d02fa437489bab.tar.gz
Add resource table entry for address translation
To avoid having to use a hardcoded memory map to translate between the Linux physical addresses to device addresses in the firmware, a new entry type has been added to the resource table that allows the NPU remoteproc driver to provide the memory map to the firmware. With this change, the device tree layout has been changed to wrap the ethosu-rproc node with an ethosu parent node that represents the NPU subsystem. This makes it possible to use the APIs provided by the Linux kernel to perform address translation etc. The "ethosu,dma-ranges" property has been removed from ethosu-proc because the ethosu parent node provides information for how to translate between the Linux Kernel physical addresses and device addresses with a "dma-ranges" property. Change-Id: I48719ee808a5e9391c5a3e967042d26dd92d5026 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'README.md')
-rw-r--r--README.md87
1 files changed, 47 insertions, 40 deletions
diff --git a/README.md b/README.md
index 4bcd34b..1b9a692 100644
--- a/README.md
+++ b/README.md
@@ -96,6 +96,12 @@ modified to insert an Ethos-U subsystem in one of the M-class slots. Mailbox
communication is based on the Arm MHU v2, and the reset is controlled using a IO
mapped bridge.
+## ethosu
+
+The `ethosu` device represents the Ethos-U subsystem and contains a
+`dma-ranges` entry that specifies how to translate between the Linux kernel
+physical addresses and bus (Cortex-M) addresses.
+
## ethosu-rproc
The [Ethos-U remoteproc driver](remoteproc/ethosu_remoteproc.c) is used to load
@@ -111,20 +117,17 @@ The `memory-region` entry references the shared memory pool. This is the memory
region used to allocate DMA buffers for the virtio rpmsg message queues and
other memory resources.
-The `ethosu,dma-ranges` is specific to the Ethos-U remoteproc driver, and is
-used to translate Linux physical addresses into DMA addresses. The reason for
-not using `dma-range` directly is that `dma-ranges` is not fully supported by
-the
-[virtio_ring.c](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/virtio/virtio_ring.c)
-kernel driver. Buffers sent to the firmware will contain Linux physical
-addresses instead of DMA addresses.
-
The `reset` entry is referencing the driver used to control reset for the
subsystem.
The `mboxes` entry is referencing the MHU v2 driver used for mailbox
communication.
+Note `dma-ranges` is not fully supported by the
+[virtio_ring.c](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/virtio/virtio_ring.c)
+kernel driver. Therefore, buffers sent to the firmware will contain Linux
+physical addresses instead of DMA addresses.
+
## Corstone-1000 DTB
```
@@ -169,38 +172,42 @@ communication.
reg-names = "rstreg", "streg";
};
- /* - compatible : "arm,ethosu-rproc"
- * - reg : Memory regions reserved for firmware binary
- * - ethosu,dma-ranges : Address translation from bus address (Cortex-M)
- * to Linux kernel physical address
- * - bus address (#address-cells)
- * - physical address (#address-cells)
- * - size (#size-cells)
- * - memory-region : Memory region for allocation of DMA buffers
- * - mboxes : Mailbox driver used to raise interrupts on
- * remote CPU
- * - resets : Reset driver used to reset remote CPU
- */
- ethosu-rproc {
- compatible = "arm,ethosu-rproc";
-
- // Address mapping from DMA to physical
- ethosu,dma-ranges = <0x00000000 0x44000000 0x00200000>,
- <0x60000000 0x80000000 0x10000000>;
-
- reg = <0x44000000 0x00200000>,
- <0x84000000 0x01000000>;
- reg-names = "rom", "shared";
-
- // Memory region to allocate buffers from
- memory-region = <&rproc_reserved>;
-
- // Mailbox IRQ communication
- mboxes = <&mbox_es0mhu0 0>, <&mbox_es0mhu0 0>;
- mbox-names = "tx", "rx";
-
- // Reset handler
- resets = <&cs1k_rst_es0 0>;
+
+ ethosu {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ ranges;
+
+ // Address mapping from bus address (Cortex-M) to Linux kernel physical address
+ dma-ranges = <0x00000000 0x44000000 0x00200000>,
+ <0x60000000 0x80000000 0x10000000>;
+
+
+ /* - compatible : "arm,ethosu-rproc"
+ * - reg : Memory regions reserved for firmware binary
+ * - memory-region : Memory region for allocation of DMA buffers
+ * - mboxes : Mailbox driver used to raise interrupts on
+ * remote CPU
+ * - resets : Reset driver used to reset remote CPU
+ */
+ ethosu-rproc {
+ compatible = "arm,ethosu-rproc";
+
+ reg = <0x44000000 0x00200000>,
+ <0x84000000 0x01000000>;
+ reg-names = "rom", "shared";
+
+ // Memory region to allocate buffers from
+ memory-region = <&rproc_reserved>;
+
+ // Mailbox IRQ communication
+ mboxes = <&mbox_es0mhu0 0>, <&mbox_es0mhu0 0>;
+ mbox-names = "tx", "rx";
+
+ // Reset handler
+ resets = <&cs1k_rst_es0 0>;
+ };
};
};
```