Skip to content

Commit

Permalink
extmod/modopenamp: Add support for building Open-AMP on device side.
Browse files Browse the repository at this point in the history
Tested with two VMs each running on a different core.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
  • Loading branch information
iabdalkader committed Aug 14, 2024
1 parent a771e1f commit f158a46
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions extmod/extmod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 += \
Expand Down

0 comments on commit f158a46

Please sign in to comment.