openamp/Kconfig: add CONFIG_OPENAMP_ENABLE_VIRTIO_ONLY to enable virtio only

OPENAMP_VIRTIO_DEVICE_ONLY and OPENAMP_VIRTIO_DRIVER_ONLY can be used to
comment some unused code in OpenAMP library to save code size.

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Yongrong Wang 2024-02-29 17:39:19 +08:00 committed by Xiang Xiao
parent 815c9c464a
commit f93688cbd5
3 changed files with 24 additions and 0 deletions

View File

@ -22,4 +22,12 @@ config OPENAMP_DEBUG
bool "Enable OpenAMP Debug" bool "Enable OpenAMP Debug"
default n default n
config OPENAMP_VIRTIO_DEVICE_ONLY
bool "Enable VIRTIO_DEVICE_ONLY"
default n
config OPENAMP_VIRTIO_DRIVER_ONLY
bool "Enable VIRTIO_DRIVER_ONLY"
default n
endif # OPENAMP endif # OPENAMP

View File

@ -99,6 +99,14 @@ endif()
add_compile_definitions(elf_load=remoteproc_elf_load) add_compile_definitions(elf_load=remoteproc_elf_load)
if(CONFIG_OPENAMP_VIRTIO_DEVICE_ONLY)
add_compile_definitions(VIRTIO_DEVICE_ONLY)
endif()
if(CONFIG_OPENAMP_VIRTIO_DRIVER_ONLY)
add_compile_definitions(VIRTIO_DRIVER_ONLY)
endif()
set(WITH_LIBMETAL_FIND OFF) set(WITH_LIBMETAL_FIND OFF)
if(NOT CMAKE_SYSTEM_PROCESSOR) if(NOT CMAKE_SYSTEM_PROCESSOR)

View File

@ -32,6 +32,14 @@ endif
CFLAGS += -Delf_load=remoteproc_elf_load CFLAGS += -Delf_load=remoteproc_elf_load
ifeq ($(CONFIG_OPENAMP_VIRTIO_DEVICE_ONLY),y)
CFLAGS += -DVIRTIO_DEVICE_ONLY
endif
ifeq ($(CONFIG_OPENAMP_VIRTIO_DRIVER_ONLY),y)
CFLAGS += -DVIRTIO_DRIVER_ONLY
endif
CSRCS += open-amp/lib/remoteproc/elf_loader.c CSRCS += open-amp/lib/remoteproc/elf_loader.c
CSRCS += open-amp/lib/remoteproc/remoteproc.c CSRCS += open-amp/lib/remoteproc/remoteproc.c
CSRCS += open-amp/lib/remoteproc/remoteproc_virtio.c CSRCS += open-amp/lib/remoteproc/remoteproc_virtio.c