Skip to content

Commit

Permalink
update e907 rtos source
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzukiTsuru committed Jul 24, 2023
1 parent 7a0166c commit 5d686b0
Show file tree
Hide file tree
Showing 1,190 changed files with 19,046 additions and 169,258 deletions.
36 changes: 36 additions & 0 deletions Software/BSP/e907_rtos/rtos/source/Kconfig.melis
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ config DISABLE_ALL_DEBUGLOG
help
Reduce all the log.

config PRINT_TIMESTAMP
bool "printk prints timestamps"
default n
help
printk prints timestamps.

config DYNAMIC_LOG_LEVEL_SUPPORT
bool "dynamic log level support"
help
Expand Down Expand Up @@ -155,6 +161,20 @@ config FRAME_WARN
Setting it to 0 disables the warning.
Requires gcc 4.4

choice
prompt "Io Lock"
default UART_CLI_USE_NONE

config UART_CLI_USE_NONE
bool "Lock None"

config UART_CLI_USE_MUTEX
bool "Use Mutex"

config UART_CLI_USE_SPINLOCK
bool "Use SpinLock"

endchoice

choice
prompt "Compiler optimization level"
Expand Down Expand Up @@ -197,12 +217,28 @@ config OS_MELIS
bool "Melis OS"
default y

config KALLSYMS
bool "keep Melis kernel symbols"
default n

if KALLSYMS
config KALLSYMS_ALL
bool "keep Melis kernel all symbols"
default n
endif

config SDK_THUMB_MODE
bool "Enable Thumb mode sdk compile flags"
depends on BOOTUP_TURBO
help
compile whole sdk with -mthumb flags.

config MELIS_GENERATE_HEAD
bool "Generate melis head"
default y
help
general epos_hdr head.

menu "Toolchain Setup"

config TOOLCHAIN_MACH_FLAGS
Expand Down
7 changes: 7 additions & 0 deletions Software/BSP/e907_rtos/rtos/source/Kconfig.platform
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ config COHERENT_START_ADDR
help
Set Start address of NoCache Dram Zone for DMA etc

config KERNEL_USE_SBI
bool "define whether using sbi (RV)"
depends on SOC_SUN20IW1
default y
help
if use sbi, the syscall number defined in kapi.h need to change for being different with function number in SBI module.

config LOAD_DATA_TO_MEM_FROM_STORAGE
bool "load data to memory from storage"
default y
Expand Down
21 changes: 16 additions & 5 deletions Software/BSP/e907_rtos/rtos/source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,10 @@ MELISINCLUDE := \
-Iinclude/melis/of \
-Iinclude/melis/sys \
-Iinclude/melis/video \
-Iekernel/subsys/finsh_cli \
-Iekernel/components/thirdparty/finsh_cli \
-Iekernel/core/rt-thread/include \
-Iekernel/subsys/thirdparty/dfs/include \
-Iekernel/drivers/hal/source \
-Iekernel/components/thirdparty/dfs/include \
-Iekernel/drivers/rtos-hal/hal/source \
-Iekernel/drivers/include/osal \
$(USERINCLUDE)
ifeq (${CONFIG_RISCV}, y)
Expand Down Expand Up @@ -1033,6 +1033,17 @@ ifdef CONFIG_BUILD_DOCSRC
endif
ifdef CONFIG_GDB_SCRIPTS
$(Q)ln -fsn `cd $(srctree) && /bin/pwd`/scripts/gdb/melis-gdb.py
endif
ifeq ($(CONFIG_KERNEL_COMPRESS), y)
ifeq ($(CONFIG_RV32), y)
$(Q)$(MAKE) $(build)=ekernel/arch/riscv/compressed Image
endif
else
@cp ekernel/melis30.elf ekernel/arch/boot/Image
@cp ekernel/arch/boot/Image ekernel/arch/boot/zImage
$(Q)$(STRIP) ekernel/arch/boot/zImage
$(Q)$(OBJCOPY) -O binary ekernel/arch/boot/zImage \
ekernel/arch/boot/zImage.bin
endif
+$(call if_changed,link-melis)

Expand Down Expand Up @@ -1347,7 +1358,7 @@ distclean: mrproper
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '*%' -o -name 'core' \) \
-type f -print | xargs rm -f
@find ./ekernel/drivers/hal/ $(RCS_FIND_IGNORE) \
@find ./ekernel/drivers/rtos-hal/hal/ $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '*%' -o -name 'core' \) \
Expand Down Expand Up @@ -1571,7 +1582,7 @@ clean: $(clean-dirs)
-o -name modules.builtin -o -name '.tmp_*.o.*' \
-o -name '*.gcno' -o -name '*.elf' \
-o -name '*.map' -o -name '*.dis' \) -type f -print | xargs rm -f
@find ./ekernel/drivers/hal/ $(RCS_FIND_IGNORE) \
@find ./ekernel/drivers/rtos-hal/hal/ $(RCS_FIND_IGNORE) \
\( -name '*.[o]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '*.ko.*' \
-o -name '*.dwo' \
Expand Down
10 changes: 9 additions & 1 deletion Software/BSP/e907_rtos/rtos/source/ekernel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source "ekernel/core/Kconfig"
source "ekernel/drivers/drv/Kconfig"
source "ekernel/drivers/osal/Kconfig"
source "ekernel/drivers/test/Kconfig"
source "ekernel/subsys/Kconfig"
source "ekernel/components/Kconfig"

config ARMCPU_HIGH_VECTOR_ADDRESS
bool "USE HIGH Exception Vector Address"
Expand Down Expand Up @@ -81,4 +81,12 @@ config DOUBLE_FREE_CHECK
bool "Doule Free Check"
default n

config CMSIS
bool "ARM CMSIS interface support"
default n
help
CMSIS enables consistent device support and simple software interfaces to the processor and its peripherals, simplifying software reuse, reducing the learning curve for microcontroller developers,
and reducing the time to market for new devices.


endmenu
88 changes: 63 additions & 25 deletions Software/BSP/e907_rtos/rtos/source/ekernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ subdir-ccflags-y += -I$(srctree)/ekernel/arch \
-I$(srctree)/ekernel/drivers/include/drv \
-I$(srctree)/ekernel/drivers/include/hal \
-I$(srctree)/ekernel/drivers/include/osal \
-I$(srctree)/ekernel/drivers/hal/source/ccmu/sunxi \
-I$(srctree)/ekernel/subsys/finsh_cli \
-I$(srctree)/ekernel/subsys/thirdparty/dfs/include \
-I$(srctree)/ekernel/drivers/rtos-hal/hal/source/ccmu/sunxi \
-I$(srctree)/ekernel/components/finsh_cli \
-I$(srctree)/ekernel/components/thirdparty/dfs/include \
-I$(srctree)/ekernel/drivers/drv/source/sound \
-D__LINUX_ERRNO_EXTENSIONS__

Expand All @@ -27,12 +27,12 @@ MOD_NAME := melis30
$(MOD_NAME)-objs += built-in.o
obj-m += $(MOD_NAME).o

obj-y := arch/ core/ drivers/ subsys/
obj-y := arch/ core/ drivers/ components/
obj-y += ../projects/$(TARGET_BOARD)/src/

usrlibs-y += -L$(srctree)/${elibrary-libs}

usrlibs-$(CONFIG_DRIVERS_VIN) += -L$(srctree)/ekernel/drivers/hal/source/vin/vin_isp/isp_server/out \
usrlibs-$(CONFIG_DRIVERS_VIN) += -L$(srctree)/ekernel/drivers/rtos-hal/hal/source/vin/vin_isp/isp_server/out \
--start-group \
-lisp_algo \
--end-group
Expand All @@ -47,33 +47,33 @@ usrlibs-${VIDEO_SUNXI_VIN} += --require-defined=vin_init
usrlibs-${CONFIG_COMPONENT_ADBD}+= --require-defined=adbd_init

ifneq ($(filter y, $(CONFIG_mpp_venc) $(CONFIG_mpp_vdec)),)
usrlibs-y += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/base \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/library/${LIB_DIR} \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/memory \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vdecoder \
usrlibs-y += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/base \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/library/${LIB_DIR} \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/memory \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vdecoder \
--start-group \
-lcdc_base \
-lVE \
-lMemAdapter \
--end-group
endif

usrlibs-$(CONFIG_mpp_venc) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/base \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/library/${LIB_DIR} \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/memory \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vdecoder \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vencoder \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vencoder/base \
usrlibs-$(CONFIG_mpp_venc) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/base \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/library/${LIB_DIR} \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/memory \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vdecoder \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vencoder \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vencoder/base \
--start-group \
-lvencoder \
-lvenc_base \
-lvenc_codec \
--end-group

usrlibs-$(CONFIG_mpp_vdec) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/base \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/library/${LIB_DIR} \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/memory \
-L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vdecoder \
usrlibs-$(CONFIG_mpp_vdec) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/base \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/library/${LIB_DIR} \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/memory \
-L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libcedarc/vdecoder \
--start-group \
-lawh264 \
-lawh265 \
Expand All @@ -82,7 +82,7 @@ usrlibs-$(CONFIG_mpp_vdec) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp
-lvdecoder \
--end-group

usrlibs-$(CONFIG_mpp_vi) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libisp/out \
usrlibs-$(CONFIG_mpp_vi) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/libisp/out \
--start-group \
-liniparser \
-lisp_algo \
Expand All @@ -91,20 +91,20 @@ usrlibs-$(CONFIG_mpp_vi) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/m
-lisp_math \
--end-group

usrlibs-$(CONFIG_mpp_aenc) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/AudioLib/lib \
usrlibs-$(CONFIG_mpp_aenc) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/AudioLib/lib \
--start-group \
-laacenc \
-lmp3enc \
--end-group

usrlibs-$(CONFIG_mpp_adec) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/AudioLib/lib \
usrlibs-$(CONFIG_mpp_adec) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/AudioLib/lib \
--start-group \
-laac \
-lmp3 \
-lwav \
--end-group

usrlibs-$(CONFIG_mpp_aec) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/aec_lib \
usrlibs-$(CONFIG_mpp_aec) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/aec_lib \
--start-group \
-lAec \
--end-group
Expand All @@ -114,7 +114,7 @@ usrlibs-$(CONFIG_SUNXI_AEC_TEST) += -L$(srctree)/elibrary/media/libaec \
-laec \
--end-group

usrlibs-$(CONFIG_mpp_softdrc) += -L$(srctree)/ekernel/subsys/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/drc_lib \
usrlibs-$(CONFIG_mpp_softdrc) += -L$(srctree)/ekernel/components/avframework/eyesee-mpp/middleware/sun8iw19p1/media/LIBRARY/drc_lib \
--start-group \
-lDrc \
--end-group
Expand All @@ -124,7 +124,7 @@ usrlibs-$(CONFIG_XR829) += -L$(srctree)/ekernel/drivers/drv/source/net/xradio \
-lxr829_40M \
--end-group

usrlibs-$(CONFIG_DRIVERS_NAND_FLASH) += -L$(srctree)/ekernel/drivers/hal/source/nand_flash/ \
usrlibs-$(CONFIG_DRIVERS_NAND_FLASH) += -L$(srctree)/ekernel/drivers/rtos-hal/hal/source/nand_flash/ \
--start-group \
-lmelis-nand-sun20iw1 \
--end-group
Expand All @@ -135,7 +135,45 @@ lnkflags-y += --omagic --gc-sections -cref --entry=_start \
-X ${linkscript} \
-Map=$(obj)/linker.map --build-id=sha1

ifeq ($(CONFIG_KALLSYMS), y)
# Usage:
# $(call link_module, input1.o, input2.o, output.o)
define link_module
$(Q)$(LD) $(ld_flags) -o $3 $1 \
$(lnkflags-y) \
--start-group \
$(usrlibs-y) \
$(deplibs-y) \
--end-group \
$2
endef
# Usage:
# $(call gen_kall_o, input.o, output.o)
define gen_kall_o
nm $1 | scripts/kallsyms $(if $(CONFIG_KALLSYMS_ALL), --all-symbols,) > sym.S; \
$(CC) -c -o $2 sym.S \
${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
${NOSTDINC_FLAGS} ${LINUXINCLUDE} \
${KBUILD_CPPFLAGS}; \
rm sym.S;
endef
endif

$(obj)/$(MOD_NAME).bin :%.bin :%.o FORCE
ifeq ($(CONFIG_KALLSYMS), y)
@# step 1 Link mm1.o it has all symbols buf kallsyms is empty
$(Q)$(call link_module, ekernel/$($(MOD_NAME)-objs), , .tmp_melis1.o)
$(Q)$(call gen_kall_o, .tmp_melis1.o, .tmp_kallsyms1.o)
@# step 2 Libk mm2 to geve kallsyms with right size
$(Q)$(call link_module, ekernel/$($(MOD_NAME)-objs), .tmp_kallsyms1.o, .tmp_melis2.o)
$(Q)$(call gen_kall_o, .tmp_melis2.o, .tmp_kallsyms2.o)
@# step 3 The correct kallsyms is linked to finale obj file
$(Q)$(call link_module, ekernel/$($(MOD_NAME)-objs), .tmp_kallsyms2.o, ekernel/$(MOD_NAME).o)
$(Q)rm .tmp_melis1.o
$(Q)rm .tmp_melis2.o
$(Q)rm .tmp_kallsyms1.o
$(Q)rm .tmp_kallsyms2.o
endif
$(call if_changed,objcopy)
$(call if_changed,renameelf)
$(Q)cp -f $@ $(prjtree)/$(TARGET_BOARD)/epos.img
Expand Down
Binary file not shown.
13 changes: 13 additions & 0 deletions Software/BSP/e907_rtos/rtos/source/ekernel/arch/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ dtbs: prepare scripts

fexs: prepare scripts
$(Q)$(MAKE) $(build)=$(boot)/fex

ifeq ($(CONFIG_KERNEL_COMPRESS), y)
Image: prepare scripts
ifeq ($(CONFIG_RV32), y)
$(Q)$(MAKE) $(build)=$(boot)/../riscv/compressed $@
endif
else
Image: prepare scripts
@cp $(boot)/../../melis30.elf $(boot)/Image
@cp $(boot)/Image $(boot)/zImage
$(Q)$(STRIP) $(boot)/zImage
$(Q)$(OBJCOPY) -O binary $(boot)/zImage $(boot)/zImage.bin
endif
Binary file not shown.
Loading

0 comments on commit 5d686b0

Please sign in to comment.