The resource table is a data structure that describes the resources that OpenAMP communication needs. These resources can include memory carveouts, vrings, and trace buffers. The resource table resides at a known memory location. The Linux remote processor (remoteproc) framework parses it during firmware loading.
Overview
The resource table contains the following information:
- Version and offsets
- Header information
- Carveout entries
- Shared memory regions (if using carveouts)
- VirtIO device entries
- VRing configurations for RPMsg transport
- Trace buffer entries
- For remote logging (optional)
Implementation in Zephyr
If
CONFIG_OPENAMP_RSC_TABLE=y, Zephyr automatically generates a
resource table. The application code accesses it through OpenAMP
APIs.#include <resource_table.h>
static void *rsc_table;
static size_t rcs_size;
/* Get resource table from Zephyr OpenAMP subsystem */
rsc_table_get(&rsc_table, &rcs_size);
/* Register with libmetal */
metal_io_init(&device->regions[1], rsc_table,
&rsc_tab_physmap, rcs_size, -1, 0, NULL);
/* Access vring descriptors */
struct fw_rsc_vdev_vring *vring_rsc;
vring_rsc = rsc_table_get_vring0(rsc_table); /* TX vring */
vring_rsc = rsc_table_get_vring1(rsc_table); /* RX vring */
/* Convert resource table to virtio device */
rproc_virtio_create_vdev(VIRTIO_DEV_DEVICE, VDEV_ID,
rsc_table_to_vdev(rsc_table),
rsc_io, NULL, mailbox_notify, NULL);
Resource Table Content
The Zephyr-generated resource table includes the following entries.
- VirtIO device:
- Type:
RSC_VDEV - ID:
VIRTIO_ID_RPMSG(7) - Notifyid: IPI interrupt ID
- Device features: VirtIO configuration
- Type:
- VRings (two per VirtIO device):
-
- VRing0:
- Direction: APU to RPU
- Device address (DA): Points to
vdev0vring0@9860000 - Alignment: 4096 bytes
- Number of buffers: Set by
CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF
- VRing1:
- Direction: RPU to APU
- Device address (DA): Points to
vdev0vring1@9864000 - Configuration: same general configuration as VRing0
- VRing0:
-
Note: The remoteproc driver translates device addresses (DA) from
the RPU memory view to physical addresses (PA) in the system address map.