For VEK385 Versal2 OpenAMP communication, use DDR ELF loading (ELFLOAD) instead of tightly coupled memory (TCM) boot.
DDR ELF loading gives you more memory for OpenAMP applications. It is also the standard method for remote processor (remoteproc)-based firmware loading. Refer to
Reference: AMD UG1186 - Boot Modes and Remote Processor Lifecycle Management
| Feature | DDR Boot (ELFLOAD) | TCM Boot |
|---|---|---|
| Firmware location | DDR at 0x9800100 by default |
ATCM/BTCM at 0xeba00000
|
| Maximum firmware size | Configurable | Limited by TCM size, about 96 KB total |
| Remote processor support | Lifecycle management and RPMsg | Lifecycle management only |
| Power consumption | DDR always on | TCM can use less power |
Note: TCM boot is not currently supported for OpenAMP IPC on VEK385
r52 cores. Use DDR boot for all OpenAMP applications.
How DDR Boot Works
The DDR boot process works as follows:
- Linux remote processor (remoteproc) reads the ELF file from
/lib/firmware/. - Specify the firmware name through sysfs:
echo <elf name> > /sys/class/remoteproc/remoteproc0/firmware - The remoteproc driver opens and parses the ELF file.
- The driver identifies the loadable segments (LOAD type) and the resource table section. It also reads virtual addresses (VA), physical addresses (PA), and sizes.
- The driver maps ELF segment addresses to DDR and TCM memory regions.
-
.text(code),.data(initialized data),.bss(uninitialized data) sections - Segments are written to DDR starting at
0x9800100 - Resource table is identified and tracked separately
-
- The driver sets the R52 boot address to the ELF entry point and the control register to boot out of ELF-specified vector table location.
- The driver releases the R52 core from reset.
- EEMI calls to PMC power on R52 domain
- TCMs are powered but not used for boot
- R52 begins execution from DDR entry point
Zephyr Configuration for DDR Boot
- Set the
zephyr,sramproperty in thechosennode. This property tells the Zephyr build system where Linux loads the firmware.chosen { zephyr,sram = "/reserved-memory/ddrboot@9800100"; /* ... */ };This property affects:
- Linker script generation: Zephyr's build system generates a linker
script that places code/data at
0x9800100 - Memory layout: Ensures all sections (.text, .data, .bss) fit within the 383 KB region
- Resource table placement: Resource table is placed at a fixed offset that remoteproc can find
- Linker script generation: Zephyr's build system generates a linker
script that places code/data at
- Review the linker script effect. When you set
zephyr,sram = "/reserved-memory/ddrboot@9800100", the generated linker script includes memory placement like this:MEMORY { SRAM (wx) : ORIGIN = 0x09800100, LENGTH = 0x5ff00 /* 383 KB */ } SECTIONS { .text : { *(.text*) } > SRAM .data : { *(.data*) } > SRAM .bss : { *(.bss*) } > SRAM } - Verify the build output. After you build the firmware, verify the ELF
configuration.
- Check the ELF entry point.
- Check the program headers.
# Check ELF entry point arm-none-eabi-readelf -h rpmsg_multi_services.elf | grep "Entry point" # Expected: Entry point address: 0x9800100 # Check program headers arm-none-eabi-readelf -l rpmsg_multi_services.elf # Expected: LOAD segments starting at 0x09800100 - Configure Linux remote processor DDR boot. The remoteproc driver selects DDR
boot or TCM boot by checking the reserved memory node name in the device tree.
The string
ddrbootin the node name triggers ELFLOAD mode. - Define the reserved memory note. Use
ddrbootin the reserved memory node name:reserved-memory { /* Node name must be "ddrboot" to trigger ELFLOAD */ ddrboot_label: ddrboot@9800100 { phandle = <0x269>; device_type = "memory"; no-map; reg = <0x0 0x9800100 0x0 0x5ff00>; /* 383 KB */ }; }; - Reference the DDR boot region in the remote processor node. Make sure that the
memory-regionproperty includes theddrbootnode:remoteproc@eba00000 { r52f@0 { compatible = "xlnx,versal2-r52f"; memory-region = <&rsctbl9800000>, /* Resource table */ <&vdev0buffer>, /* Shared buffer */ <&vdev0vring0>, /* TX vring */ <&vdev0vring1>, /* RX vring */ <&ddrboot_label>; /* DDR boot region */ /* ... */ }; }; - Follow the naming convention:
-
ddrboot@<address>triggers DDR boot or ELFLOAD. -
tcm@<address>triggers TCM boot.
-
| Issue | Symptom | Solution |
|---|---|---|
| Wrong node name | Firmware does not load | Make sure that the reserved memory node name contains
ddrboot
|
| Wrong entry point | r52 does not start | Make sure that the ELF entry point matches the DDR region at
0x9800100
|
| Overlapping regions | Boot fails | Make sure that the ddrboot region does not
overlap the vrings or buffers |
| Memory corruption | Random crashes | Make sure that the DDR region uses no-map in the
device tree |
| Size overflow | Load fails | If the firmware is larger than 383 KB, increase the
ddrboot region size |