Skip to content

Commit

Permalink
dtb: Add Xilinx baremetal demo compatible DTB for v6.5 kernel
Browse files Browse the repository at this point in the history
The Xilinx baremetal apps as built by Xilinx v2023.2 use a different
mailbox configuration than the Zephyr examples do.

We wish to align these in the future but for now we need a different DTB.
We can not use the Xilinx v2023.2 built DTB as it is not compatible with
the upstream remoteproc driver (it is still using the pre-upstream driver.)

This change adds an overlay for this configuration and then also applies
it to make complete dtbs.  Boot configs can either apply the overlays at
boot time or use the complete dtbs.

Signed-off-by: Bill Mills <bill.mills@linaro.org>
  • Loading branch information
wmamills committed Nov 18, 2023
1 parent 1907df6 commit d7bbc47
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 2 deletions.
16 changes: 14 additions & 2 deletions examples/linux/dts/xilinx/Makefile
@@ -1,11 +1,12 @@
# Build Devicetree Binaries and Devicetree Binary Overlays

DTBS := zcu102-openamp-lockstep.dtb zcu102-openamp-split.dtb
DTBS += kria-openamp-lockstep.dtb kria-openamp-split.dtb
DTBS += kv260-openamp-lockstep.dtb kv260-openamp-split.dtb
DTBS += zynqmp-smk-k26-revA.dtb zynqmp-zcu102-rev1.0.dtb
DTBS += zcu102-xilinx-bm-lockstep.dtb kv260-xilinx-bm-lockstep.dtb

DTBOS := zynqmp-split.dtbo zcu102-openamp.dtbo zynqmp-openamp.dtbo
DTBOS += zynqmp-sck-kv-g-revB.dtbo
DTBOS += zynqmp-sck-kv-g-revB.dtbo xilinx-openamp-for-v6.5.dtbo

# any file to test we have a valid kernel source dir
XILINX_DTS_DIR := $(LINUX_SRC_DIR)/arch/arm64/boot/dts/xilinx
Expand Down Expand Up @@ -86,5 +87,16 @@ kv260-openamp-split.dtb: \
zynqmp-split.dtbo
fdtoverlay -o $@ -i $(filter-out .linux-src-check,$^)

zcu102-xilinx-bm-lockstep.dtb: \
zynqmp-zcu102-rev1.0.dtb \
xilinx-openamp-for-v6.5.dtbo \
zcu102-openamp.dtbo
fdtoverlay -o $@ -i $(filter-out .linux-src-check,$^)

kv260-xilinx-bm-lockstep.dtb: \
zynqmp-smk-k26-revA.dtb zynqmp-sck-kv-g-revB.dtbo \
xilinx-openamp-for-v6.5.dtbo
fdtoverlay -o $@ -i $(filter-out .linux-src-check,$^)

clean:
rm -f $(DTBS) $(DTBOS) $(DTBCS) *.pp .linux-src-check $(DTB_KERNEL_SRC)
112 changes: 112 additions & 0 deletions examples/linux/dts/xilinx/xilinx-openamp-for-v6.5.dtso
@@ -0,0 +1,112 @@
/* Applies to all zynqmp boards to configure the IPC & memory for OpenAMP */

/dts-v1/;
/plugin/;

&{/} {
#address-cells = <2>;
#size-cells = <2>;

reserved-memory {
#address-cells = <0x02>;
#size-cells = <0x02>;
ranges;

rproc_0_fw_image: memory@3ed00000 {
no-map;
reg = <0x0 0x3ed00000 0x0 0x40000>;
};

rpu0vdev0vring0: vdev0vring0@3ed40000 {
no-map;
reg = <0x00 0x3ed40000 0x00 0x4000>;
};

rpu0vdev0vring1: vdev0vring1@3ed44000 {
no-map;
reg = <0x00 0x3ed44000 0x00 0x4000>;
};

rpu0vdev0buffer: vdev0buffer@3ed48000 {
no-map;
compatible = "shared-dma-pool";
reg = <0x00 0x3ed48000 0x00 0x100000>;
};

};

zynqmp_ipi1 {
compatible = "xlnx,zynqmp-ipi-mailbox";
interrupt-parent = <&gic>;
interrupts = <0x00 0x1d 0x04>;
xlnx,ipi-id = <0x07>; /* bare-metal apps send on channel 7 */
#address-cells = <0x01>;
#size-cells = <0x01>;
ranges;

ipi_mailbox_rpu0: mailbox@ff990600 {
reg = <0xff990600 0x20>,
<0xff990620 0x20>,
<0xff9900c0 0x20>,
<0xff9900e0 0x20>;
reg-names = "local_request_region",
"local_response_region",
"remote_request_region",
"remote_response_region";
#mbox-cells = <0x01>;
xlnx,ipi-id = <0x01>; /* host still sends to RPU0 on ch 1 */
};
};

#if 0
zynqmp_ipi {
#address-cells = <2>;
#size-cells = <2>;
ranges;

ipi_mailbox_rpu0: mailbox@ff990040 {
reg = <0x00 0xff990040 0x00 0x20>,
<0x00 0xff990060 0x00 0x20>,
<0x00 0xff990200 0x00 0x20>,
< 0x00 0xff990220 0x00 0x20>;
reg-names = "local_request_region",
"local_response_region",
"remote_request_region",
"remote_response_region";
#mbox-cells = <0x01>;
xlnx,ipi-id = <0x01>;
};

ipi_mailbox_rpu1: mailbox@ff990080 {
reg = <0x00 0xff990420 0x00 0x20>,
<0x00 0xff990440 0x00 0x20>,
<0x00 0xff990260 0x00 0x20>,
<0x00 0xff990280 0x00 0x20>;
reg-names = "local_request_region",
"local_response_region",
"remote_request_region",
"remote_response_region";
#mbox-cells = <0x01>;
xlnx,ipi-id = <0x02>;
};
};
#endif

remoteproc: remoteproc {
r5f-0 {
memory-region = <&rproc_0_fw_image>, <&rpu0vdev0vring0>,
<&rpu0vdev0vring1>, <&rpu0vdev0buffer>;
mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
mbox-names = "tx", "rx";
};

#if 0
r5f-1 {
memory-region = <&rproc_1_fw_image>, <&rpu1vdev1vring0>,
<&rpu1vdev1vring1>, <&rpu1vdev1buffer>;
mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
mbox-names = "tx", "rx";
};
#endif
};
};

0 comments on commit d7bbc47

Please sign in to comment.