diff options
Diffstat (limited to 'applications/message_handler_openamp/remoteproc.hpp')
-rw-r--r-- | applications/message_handler_openamp/remoteproc.hpp | 69 |
1 files changed, 12 insertions, 57 deletions
diff --git a/applications/message_handler_openamp/remoteproc.hpp b/applications/message_handler_openamp/remoteproc.hpp index 2f16e24..eec7b44 100644 --- a/applications/message_handler_openamp/remoteproc.hpp +++ b/applications/message_handler_openamp/remoteproc.hpp @@ -37,70 +37,25 @@ *****************************************************************************/ struct ResourceTable { - static constexpr uint32_t VERSION = 1; + static constexpr uint32_t VERSION = 1; +#if defined(REMOTEPROC_TRACE_BUFFER) + static constexpr uint32_t NUM_RESOURCES = 3; +#else static constexpr uint32_t NUM_RESOURCES = 2; - static constexpr uint32_t NUM_VRINGS = 2; - static constexpr uint32_t VRING_ALIGN = 0x100; - // static constexpr uint32_t VRING_SIZE = 0x10; - static constexpr uint32_t RESERVED = 0; +#endif + static constexpr uint32_t NUM_VRINGS = 2; + static constexpr uint32_t VRING_ALIGN = 0x100; + static constexpr uint32_t VRING_SIZE = 0x08; + static constexpr uint32_t RESERVED = 0; resource_table table; uint32_t offset[NUM_RESOURCES]; +#if defined(REMOTEPROC_TRACE_BUFFER) + fw_rsc_trace trace; +#endif fw_rsc_vdev vdev; fw_rsc_vdev_vring vring[NUM_VRINGS]; fw_rsc_carveout carveout; - - // clang-format off - constexpr ResourceTable(const uint32_t vringSize = 0x100, const uint32_t carveoutSize = 0) : - table { - VERSION, - NUM_RESOURCES, - { RESERVED, RESERVED }, - {} - }, - offset { - offsetof(ResourceTable, vdev), - offsetof(ResourceTable, carveout), - }, - vdev { - RSC_VDEV, - VIRTIO_ID_RPMSG, - 2, // Notify ID - 1 << VIRTIO_RPMSG_F_NS, - 0, - 0, - 0, - NUM_VRINGS, - { 0, RESERVED }, - {} - }, - vring { - { - FW_RSC_U32_ADDR_ANY, - VRING_ALIGN, - vringSize, - 1, - RESERVED - }, - { - FW_RSC_U32_ADDR_ANY, - VRING_ALIGN, - vringSize, - 2, - RESERVED - } - }, - carveout { - RSC_CARVEOUT, - FW_RSC_U32_ADDR_ANY, - FW_RSC_U32_ADDR_ANY, - carveoutSize, - 0, - RESERVED, - "TFLM arena" - } - {} - // clang-format off } __attribute__((packed)); /***************************************************************************** |