diff --git a/extmod/extmod.mk b/extmod/extmod.mk index c35f086a433c..19668103d1a8 100644 --- a/extmod/extmod.mk +++ b/extmod/extmod.mk @@ -527,6 +527,7 @@ ifeq ($(MICROPY_PY_OPENAMP),1) OPENAMP_DIR = lib/open-amp LIBMETAL_DIR = lib/libmetal GIT_SUBMODULES += $(LIBMETAL_DIR) $(OPENAMP_DIR) +MICROPY_PY_OPENAMP_MODE ?= 0 include $(TOP)/extmod/libmetal/libmetal.mk INC += -I$(TOP)/$(OPENAMP_DIR) @@ -536,12 +537,14 @@ ifeq ($(MICROPY_PY_OPENAMP_REMOTEPROC),1) CFLAGS += -DMICROPY_PY_OPENAMP_REMOTEPROC=1 endif -ifeq ($(MICROPY_PY_OPENAMP_DEVICE),1) +ifeq ($(MICROPY_PY_OPENAMP_MODE),0) +CFLAGS += -DMICROPY_PY_OPENAMP_HOST=1 +CFLAGS_THIRDPARTY += -DVIRTIO_DRIVER_ONLY +else ifeq ($(MICROPY_PY_OPENAMP_MODE),1) CFLAGS += -DMICROPY_PY_OPENAMP_DEVICE=1 CFLAGS_THIRDPARTY += -DVIRTIO_DEVICE_ONLY else -CFLAGS += -DMICROPY_PY_OPENAMP_HOST=1 -CFLAGS_THIRDPARTY += -DVIRTIO_DRIVER_ONLY +$(error Invalid Open-AMP mode specified: $(MICROPY_PY_OPENAMP_MODE)) endif CFLAGS_THIRDPARTY += \