diff options
author | Mikael Olsson <mikael.olsson@arm.com> | 2023-05-31 19:00:48 +0200 |
---|---|---|
committer | Mikael Olsson <mikael.olsson@arm.com> | 2023-09-28 11:53:42 +0200 |
commit | 67add21188c70240b8966cdd707b03c02bd41a56 (patch) | |
tree | 77219fcd0095e060063ac90ce0afbbc18b052cb3 /applications/message_handler_openamp/main.cpp | |
parent | fdd8b41d12a8fd729619dee12080e65ec151865c (diff) | |
download | ethos-u-core-platform-67add21188c70240b8966cdd707b03c02bd41a56.tar.gz |
Add resource table entry for address translation
To avoid having to use a hardcoded memory map to translate between the
Linux physical addresses and device addresses, a new entry type has been
added to the resource table where the host can provide the memory map to
use for the translation.
Change-Id: I668bba3aeac27c358647c969c5504326e1c91d24
Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'applications/message_handler_openamp/main.cpp')
-rw-r--r-- | applications/message_handler_openamp/main.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/applications/message_handler_openamp/main.cpp b/applications/message_handler_openamp/main.cpp index 7b755b9..62bdc97 100644 --- a/applications/message_handler_openamp/main.cpp +++ b/applications/message_handler_openamp/main.cpp @@ -84,12 +84,24 @@ __attribute__((section(".resource_table"))) ResourceTable resourceTable = { }, // Offset { + offsetof(ResourceTable, mapping), #if defined(REMOTEPROC_TRACE_BUFFER) offsetof(ResourceTable, trace), #endif offsetof(ResourceTable, vdev), offsetof(ResourceTable, carveout), - }, + }, + // Mappings + { + RSC_MAPPING, + ResourceTable::NUM_RANGES, + {} + }, + // Ranges + { + { 0, 0, 0 }, + { 0, 0, 0 }, + }, // Trace buffer #if defined(REMOTEPROC_TRACE_BUFFER) { @@ -163,8 +175,7 @@ void mailboxIrqHandler() { int main() { printf("Ethos-U Message Handler OpenAMP\n"); - auto mem = std::make_shared<MetalIO>(); - auto rproc = std::make_shared<RProc>(mailbox, resourceTable.table, sizeof(resourceTable), *mem); + auto rproc = std::make_shared<RProc>(mailbox, resourceTable.table, sizeof(resourceTable)); auto messageHandler = std::make_shared<MessageHandler>(*rproc, "ethos-u-0.0"); printf("TFLM arena. pa=%" PRIx32 ", da=%" PRIx32 ", len=%" PRIx32 "\n", |