diff --git a/Kconfig b/Kconfig index 522800bd2e11be2a7ba428734b7e985dac8c886a..a47e793f482674f1f3c2c284751fc91bdfba9fed 100644 --- a/Kconfig +++ b/Kconfig @@ -42,11 +42,11 @@ choice config COMPILER_HIMIX_32 bool "arm-linux-ohoseabi" - depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 + depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 || PLATFORM_QEMU_ARM_VIRT_CA7 config COMPILER_CLANG_LLVM bool "clang-llvm" - depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 + depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 || PLATFORM_QEMU_ARM_VIRT_CA7 endchoice endmenu @@ -274,7 +274,7 @@ config VM_OVERLAP_CHECK config NULL_ADDRESS_PROTECT bool "Enable NULL Address protect" default n - depends on (PLATFORM_HI3518EV200 || PLATFORM_HI3516CV300 || PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300) && DEBUG_VERSION + depends on (PLATFORM_HI3518EV200 || PLATFORM_HI3516CV300 || PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 || PLATFORM_QEMU_ARM_VIRT_CA7) && DEBUG_VERSION help Answer Y to set mem address 0~1M prohibit to access, read or write will trigger exception. diff --git a/Makefile b/Makefile index fa38052fe8b55fa4a287f213a109a6353f9e224a..3e02ad560ab13b9bab6d981bb2e236a6439ff22e 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,9 @@ endif ifeq ($(LOSCFG_PLATFORM_HI3516DV300), y) FSTYPE = vfat endif +ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +FSTYPE = vfat +endif ROOTFS_DIR = $(OUT)/rootfs ROOTFS_ZIP = $(OUT)/rootfs.zip VERSION = @@ -97,13 +100,20 @@ endif ##### make dynload ##### -include $(LITEOS_MK_PATH)/dynload.mk +ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y) +VENDOR_BOARD_INCLUDE := $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board +else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +VENDOR_BOARD_INCLUDE := $(LITEOSTOPDIR)/../../vendor/qemu/arm/$(LITEOS_PLATFORM)/config/board +else +$(error "No VENDOR_BOARD_INCLUDE defined") +endif #-----need move when make version-----# ##### make lib ##### $(__LIBS): $(OUT) $(CXX_INCLUDE) $(OUT): $(LITEOS_MENUCONFIG_H) $(HIDE)mkdir -p $(OUT)/lib - $(HIDE)$(CC) -I$(LITEOS_PLATFORM_BASE)/include -I$(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board \ + $(HIDE)$(CC) -I$(LITEOS_PLATFORM_BASE)/include -I$(VENDOR_BOARD_INCLUDE) \ -E $(LITEOS_PLATFORM_BASE)/board.ld.S \ -o $(LITEOS_PLATFORM_BASE)/board.ld -P diff --git a/platform/Makefile b/platform/Makefile index e7ced6bb81f54e57e9984813a9309c66922e31b7..40e4757e41b7eb5c6ca1ec6df435ccbc79f250b7 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -40,7 +40,10 @@ LOCAL_SRCS = $(wildcard $(HWI_SRC)/*.c) \ LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/compat/posix/src \ -I $(LITEOSTOPDIR)/bsd/dev/random -ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y) +MAIN_PLATFORMS := $(LOSCFG_PLATFORM_HI3518EV300) \ + $(LOSCFG_PLATFORM_HI3516DV300) \ + $(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) +ifeq ($(findstring y, $(MAIN_PLATFORMS)), y) LOCAL_SRCS += $(wildcard ../kernel/common/*.c) LOCAL_SRCS := $(filter-out ../kernel/common/los_rootfs.c, $(LOCAL_SRCS)) ifneq ($(LOSCFG_FS_VFS), y) diff --git a/platform/bsp.mk b/platform/bsp.mk index 7714dbfa9486c17e8381b87b74a4c1b568a2cb80..0223f82df93727ee31c4bc508a491ef1732edef1 100644 --- a/platform/bsp.mk +++ b/platform/bsp.mk @@ -56,6 +56,12 @@ else ifeq ($(LOSCFG_PLATFORM_HI3518EV300), y) USB_TYPE := usb3.0_hi3518ev300 LITEOS_CMACRO_TEST += -DTEST3518EV300 +########################## Qemu ARM Virt Options############################## +else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) + HWI_TYPE := arm/interrupt/gic + TIMER_TYPE := arm/timer/arm_generic + UART_TYPE := amba_pl011 + endif HWI_SRC := hw/$(HWI_TYPE) @@ -69,22 +75,26 @@ LITEOS_BASELIB += -lbsp LITEOS_PLATFORM := $(subst $\",,$(LOSCFG_PLATFORM)) -PLATFORM_BSP_HISI_BASE := $(LITEOSTOPDIR)/platform +PLATFORM_BSP_BASE := $(LITEOSTOPDIR)/platform -PLATFORM_INCLUDE := -I $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/include \ - -I $(PLATFORM_BSP_HISI_BASE)/../kernel/common \ - -I $(PLATFORM_BSP_HISI_BASE)/../../../drivers/liteos/platform/pm \ - -I $(PLATFORM_BSP_HISI_BASE)/hw/include \ - -I $(PLATFORM_BSP_HISI_BASE)/include \ - -I $(PLATFORM_BSP_HISI_BASE)/$(UART_SRC) +PLATFORM_INCLUDE := -I $(PLATFORM_BSP_BASE)/../kernel/common \ + -I $(PLATFORM_BSP_BASE)/../../../drivers/liteos/platform/pm \ + -I $(PLATFORM_BSP_BASE)/hw/include \ + -I $(PLATFORM_BSP_BASE)/include \ + -I $(PLATFORM_BSP_BASE)/$(UART_SRC) ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y) + PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/include PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/include/hisoc +else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) + PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../vendor/qemu/arm/$(LITEOS_PLATFORM)/config/board/include + # TODO: remove hisoc dependency in the code to avoid using hisoc here + PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../vendor/qemu/arm/$(LITEOS_PLATFORM)/config/board/include/hisoc endif # #-include $(LITEOSTOPDIR)/platform/bsp/board/$(LITEOS_PLATFORM)/board.mk # -LIB_SUBDIRS += $(PLATFORM_BSP_HISI_BASE) +LIB_SUBDIRS += $(PLATFORM_BSP_BASE) LITEOS_PLATFORM_INCLUDE += $(PLATFORM_INCLUDE) LITEOS_CXXINCLUDE += $(PLATFORM_INCLUDE) diff --git a/tools/build/mk/los_config.mk b/tools/build/mk/los_config.mk index ff273f2cf1b37d8506709b1c814eac726e58dee2..3d132f8ba45c310556e2fe46a41dd1b4096e3315 100644 --- a/tools/build/mk/los_config.mk +++ b/tools/build/mk/los_config.mk @@ -163,8 +163,10 @@ LITEOS_BASELIB += -lbase LIB_SUBDIRS += kernel/base LITEOS_KERNEL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/include +ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y) LITEOS_BASELIB += -lhi35xx_bsp LIB_SUBDIRS += $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/ +endif ifeq ($(LOSCFG_KERNEL_CPUP), y) LITEOS_BASELIB += -lcpup @@ -358,7 +360,11 @@ endif #################################### Net Option End#################################### LITEOS_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../drivers/liteos +ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y) LITEOS_VENDOR_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/platform +else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +LITEOS_VENDOR_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../vendor/qemu/arm/platform +endif ################################## Driver Option Begin ################################# ifeq ($(LOSCFG_DRIVERS_HDF), y) include $(LITEOSTOPDIR)/../../drivers/hdf/lite/hdf_lite.mk