From 12ca04b31fa8d09405d3dcc8d355523f4b32032c Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 20 Mar 2019 11:23:22 -0500 Subject: [PATCH] ipc: openamp: Expose config options for MASTER/SLAVE builds We can build the openamp library configured with VirtIO master support, VirtIO slave support, or both. By default both master and slave code is enabled. We can reduce code footprint by only build master or slave as needed. Expose Kconfig options for Master & Slave and set them accordingly in the sample. Here's the code reduction we see: For the total image we see as 1260 byte reduction: Memory region Used Size Region Size %age Used FLASH [Master & Slave]: 30308 B 256 KB 11.56% FLASH [Master only] : 29048 B 256 KB 11.08% On the remote side we see a 828 byte reduction: Memory region Used Size Region Size %age Used FLASH [Master & Slave]: 11564 B 64 KB 17.65% FLASH [Slave only] : 10736 B 64 KB 16.38% Signed-off-by: Kumar Gala --- modules/Kconfig.open-amp | 16 ++++++++++++++++ samples/subsys/ipc/openamp/prj.conf | 1 + samples/subsys/ipc/openamp/remote/prj.conf | 1 + west.yml | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/Kconfig.open-amp b/modules/Kconfig.open-amp index 10a2a9cfc95..12d389f03a9 100644 --- a/modules/Kconfig.open-amp +++ b/modules/Kconfig.open-amp @@ -7,9 +7,25 @@ config OPENAMP help This option enables the OpenAMP IPC library +if OPENAMP + config OPENAMP_SRC_PATH string "OpenAMP library source path" default "open-amp" depends on OPENAMP help This option specifies the path to the source for the open-amp library + +config OPENAMP_MASTER + bool "OpenAMP Master Support" + default y + help + This option enables support for OpenAMP VirtIO Master + +config OPENAMP_SLAVE + bool "OpenAMP Slave Support" + default y + help + This option enables support for OpenAMP VirtIO Slave + +endif # OPENAMP diff --git a/samples/subsys/ipc/openamp/prj.conf b/samples/subsys/ipc/openamp/prj.conf index d9b869b6033..a2a3c9f8c0d 100644 --- a/samples/subsys/ipc/openamp/prj.conf +++ b/samples/subsys/ipc/openamp/prj.conf @@ -4,3 +4,4 @@ CONFIG_TIMESLICE_SIZE=1 CONFIG_MAIN_STACK_SIZE=2048 CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_OPENAMP=y +CONFIG_OPENAMP_SLAVE=n diff --git a/samples/subsys/ipc/openamp/remote/prj.conf b/samples/subsys/ipc/openamp/remote/prj.conf index 9b8ceae532f..e0a369edab3 100644 --- a/samples/subsys/ipc/openamp/remote/prj.conf +++ b/samples/subsys/ipc/openamp/remote/prj.conf @@ -5,3 +5,4 @@ CONFIG_PLATFORM_SPECIFIC_INIT=n CONFIG_HEAP_MEM_POOL_SIZE=4096 CONFIG_OPENAMP=y CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096 +CONFIG_OPENAMP_MASTER=n diff --git a/west.yml b/west.yml index 5cb88c1aef1..ee21f111c4d 100644 --- a/west.yml +++ b/west.yml @@ -95,7 +95,7 @@ manifest: revision: 2f896f74a5fc7220546cc23b50351506cd72ea96 path: modules/hal/nxp - name: open-amp - revision: 68c18eae2e619ab161a217b1ce86e7ff37391a15 + revision: 697716812a38fc05c1689cb9c6768bd412bf7153 path: modules/lib/open-amp - name: loramac-node revision: 29e516ec585b1a909af2b5f1c60d83e7d4d563e3