Use the following device tree reference:
- GitHub repository: meta-amd-adaptive-socs
- File: versal-2ve-2vm-vek385-sdt-seg-cortexr52-0-zephyr.dts
- Configure the chosen
node:
chosen { stdout-path = "serial1:115200n8"; bootargs = "earlycon=pl011,mmio32,0xf1930000 console=ttyAMA1,115200"; /* OpenAMP IPC shared memory region */ zephyr,ipc_shm = "/reserved-memory/ipc@9860000"; /* Firmware load region for ELF boot */ zephyr,sram = "/reserved-memory/ddrboot@9800100"; }; - Review the key chosen properties:
-
zephyr,ipc_shm: Points to shared memory for VirtIO vrings and buffers -
zephyr,sram: DDR region where Linux remoteproc loads the Zephyr ELF
-
- Define reserved memory on the Zephyr
side:
Thereserved-memory { #size-cells = <0x2>; #address-cells = <0x2>; ranges; /* Firmware boot region - must match Linux DT */ ddrboot@9800100 { phandle = <0x269>; device_type = "memory"; no-map; reg = <0x0 0x9800100 0x0 0x5ff00>; }; /* IPC shared memory - includes vrings and buffers */ ipc@9860000 { phandle = <0x26b>; compatible = "mmio-sram"; reg = <0x0 0x9860000 0x0 0x48000>; /* 288 KB total */ }; };ipc@9860000region includes both vrings and the shared buffer pool (0x9860000to0x98a8000). - Configure the IPI mailbox on the Zephyr
side:
ipi_nobuf2: mailbox@eb3b1000 { compatible = "xlnx,mbox-versal-ipi-mailbox"; interrupt-parent = <&gic_r52>; interrupts = <0x0 0x41 0x4 0xa0>; reg = <0x0 0xeb3b1000 0x0 0x1000>; xlnx,ipi-id = <0xb>; /* RPU IPI ID (no-buffer) */ #address-cells = <0x2>; #size-cells = <0x2>; ranges; /* RPU to APU IPI channel */ ipi_2_nobuf_to_ipi_1_nobuf: child@eb3b0000 { compatible = "xlnx,mbox-versal-ipi-dest-mailbox"; #mbox-cells = <0x1>; xlnx,ipi-id = <0xa>; /* Target APU no-buf IPI */ reg = <0x0 0xeb3b0000 0x0 0x1000>; reg-names = "ctrl"; }; }; /* Mailbox consumer binding for Zephyr IPC driver */ mbox-consumer { compatible = "vnd,mbox-consumer"; mboxes = <&ipi_2_nobuf_to_ipi_1_nobuf 0x0>, /* TX to APU */ <&ipi_2_nobuf_to_ipi_1_nobuf 0x1>; /* RX from APU */ mbox-names = "tx", "rx"; }; - Configure the Zephyr firmware:
- Use the OpenAMP System Reference - RPMsg Multi Services application.
- Project configuration
(
prj.conf):CONFIG_KERNEL_BIN_NAME="rpmsg_multi_services" CONFIG_PRINTK=n CONFIG_IPM=y CONFIG_MAIN_STACK_SIZE=1024 CONFIG_HEAP_MEM_POOL_SIZE=1024 CONFIG_OPENAMP=y CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF=8 CONFIG_OPENAMP_RSC_TABLE=y CONFIG_OPENAMP_MASTER=n
- Review the application structure
-
src/main_remote.c: main application that implements RPMsg endpoints -
boards/: board-specific overlays; usekv260_r5.overlayas a reference for Zynq -
prj.conf: Zephyr project configuration -
CMakeLists.txt: build configuration
-