Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multimedia project examples #1

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*/build
.vscode
.idea
cmake-build-debug
*/out
199 changes: 199 additions & 0 deletions 3rd_party/musl_riscv64/cvi_mpi/Makefile.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
SHELL = /bin/bash

include $(BUILD_PATH)/.config

## setup path ##
ROOT_DIR:=$(shell dirname $(realpath $(PARAM_FILE)))
export MW_PATH:= $(ROOT_DIR)
export MW_INC := $(MW_PATH)/include
export MW_LIB := $(MW_PATH)/lib
export MW_3RD_LIB := $(MW_PATH)/lib/3rd

ifeq ($(KERNEL_DIR), )
KERNEL_PATH ?= $(ROOT_DIR)/../../$(KERNEL_SRC)
ifeq ($(PROJECT_FULLNAME), )
$(error PROJECT_FULLNAME not defined! Please check!)
else
KERNEL_DIR = $(KERNEL_PATH)/build/$(PROJECT_FULLNAME)
endif
endif

ifeq ($(SDK_VER), 32bit)
export CROSS_COMPILE = $(CROSS_COMPILE_32)
SYSROOT := $(ROOT_DIR)/../../ramdisk/sysroot/sysroot-glibc-linaro-2.23-2017.05-arm-linux-gnueabihf/
KERNEL_INC := $(KERNEL_DIR)/arm/usr/include
OPT_LEVEL := -O3
else ifeq ($(SDK_VER), 64bit)
export CROSS_COMPILE = $(CROSS_COMPILE_64)
SYSROOT := $(ROOT_DIR)/../../ramdisk/sysroot/sysroot-glibc-linaro-2.23-2017.05-aarch64-linux-gnu/
KERNEL_INC := $(KERNEL_DIR)/arm64/usr/include
OPT_LEVEL := -O3
else ifeq ($(SDK_VER), uclibc)
export CROSS_COMPILE = $(CROSS_COMPILE_UCLIBC)
SYSROOT := $(ROOT_DIR)/../../ramdisk/sysroot/sysroot-uclibc/
KERNEL_INC := $(KERNEL_DIR)/arm/usr/include
OPT_LEVEL := -Os
else ifeq ($(SDK_VER), glibc_riscv64)
export CROSS_COMPILE = $(CROSS_COMPILE_GLIBC_RISCV64)
SYSROOT := $(ROOT_DIR)/../../host-tools/gcc/riscv64-linux-x86_64/sysroot
KERNEL_INC := $(KERNEL_DIR)/riscv/usr/include
OPT_LEVEL := -Os
OPT_LEVEL += -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d
else ifeq ($(SDK_VER), musl_riscv64)
export CROSS_COMPILE = $(CROSS_COMPILE_MUSL_RISCV64)
SYSROOT := $(ROOT_DIR)/../../host-tools/gcc/riscv64-linux-musl-x86_64/sysroot
KERNEL_INC := $(KERNEL_DIR)/riscv/usr/include
OPT_LEVEL := -Os
OPT_LEVEL += -mcpu=c906fdv -march=rv64imafdcv0p7xthead -mcmodel=medany -mabi=lp64d
endif

## INCLUDE PATH ##
COMMON_INC = $(MW_PATH)/sample/common/include
SYS_INC = $(MW_PATH)/modules/sys/include
VPU_INC = $(MW_PATH)/modules/vpu/include
AUD_INC = $(MW_PATH)/modules/audio/include
OSDC_INC = $(MW_PATH)/modules/osdc/include
BIN_INC = $(MW_PATH)/modules/bin/include

MODULES_DIR = $(shell if [ -d $(MW_PATH)/modules ]; then echo "exist"; else echo "noexist"; fi)

ifeq ("$(MODULES_DIR)" , "noexist")
ISP_INC = $(MW_INC)/isp/$(shell echo $(CHIP_ARCH) | tr A-Z a-z)
else
ISP_INC = $(MW_PATH)/modules/isp/include/$(shell echo $(CHIP_ARCH) | tr A-Z a-z)
endif

## LIBRARY ##
ISP_LIB := -lisp -lawb -lae -laf
ISP_OBJ := $(MW_LIB)/libisp.a $(MW_LIB)/libae.a $(MW_LIB)/libawb.a $(MW_LIB)/libaf.a

ifeq ($(CHIP_ARCH), CV183X)
else ifeq ($(CHIP_ARCH), $(filter $(CHIP_ARCH), CV182X MARS PHOBOS CV181X CV180X))
ISP_LIB += -lisp_algo
ISP_OBJ += $(MW_LIB)/libisp_algo.a
else
ifeq ($(SUBTYPE), fpga)
ISP_LIB += -lisp_algo
ISP_OBJ += $(MW_LIB)/libisp_algo.a
else
$(error UNKNOWN chip architecture - $(CHIP_ARCH))
endif
endif

## DEFINES ##
export PROJ_CFLAGS = -DF10

ifeq ($(SUBTYPE), fpga)
export FPGA_PORTING := true
else
export FPGA_PORTING := false
endif

MW_GLIBC_DEPENDENT := $(SYSROOT)/lib

## GCC COMPILER ##
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
AR = $(CROSS_COMPILE)ar
LD = $(CROSS_COMPILE)ld
NM = $(CROSS_COMPILE)nm
RANLIB = $(CROSS_COMPILE)ranlib
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy

### COMMON COMPILER FLAGS ###
#
# export TARGET_PACKAGES_INCLUDE and TARGET_PACKAGES_LIBDIR from build/Makefile
#
WARNING_LEVEL=-Wall -Wextra -Werror

#Generate object files by CC
CFLAGS = $(OPT_LEVEL) -std=gnu11 -g $(WARNING_LEVEL) -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections $(CVI_TARGET_PACKAGES_INCLUDE)
#Generate object files by CXX
CXXFLAGS = $(OPT_LEVEL) -std=gnu++11 -g $(WARNING_LEVEL) -fPIC -ffunction-sections -fdata-sections -Wl,--gc-sections $(CVI_TARGET_PACKAGES_INCLUDE)
#Generate dependencies files by CC and CXX
DEPFLAGS = -MMD

### COMMON AR and LD FLAGS ###
#Generate archive file by AR
ARFLAGS = rcs
#Generate shared library by LD
LDFLAGS = -shared -fPIC --gc-sections -export-dynamic -L$(MW_LIB) -L$(MW_3RD_LIB) --sysroot $(SYSROOT) $(CVI_TARGET_PACKAGES_LIBDIR)

### COMMON ELF FLAGS ###
#Generate ELF files by CC and CXX
ELFFLAGS = $(OPT_LEVEL) -Wl,--gc-sections -rdynamic -L$(MW_LIB) -L$(MW_3RD_LIB) $(CVI_TARGET_PACKAGES_LIBDIR)

ifeq ($(SDK_VER), glibc_riscv64)
CFLAGS += -mno-ldd
CXXFLAGS += -mno-ldd
else ifeq ($(SDK_VER), musl_riscv64)
CFLAGS += -mno-ldd
CXXFLAGS += -mno-ldd
endif

ifeq ($(CONFIG_DEBUG_INFO), y)
ifeq ($(CONFIG_DEBUG_INFO_SPLIT), y)
CFLAGS += -gsplit-dwarf
CXXFLAGS += -gsplit-dwarf
else ifeq ($(CONFIG_DEBUG_INFO_DWARF4), y)
CFLAGS += -gdwarf-4
CXXFLAGS += -gdwarf-4
else ifeq ($(CONFIG_DEBUG_INFO_REDUCED), y)
CFLAGS += -femit-struct-debug-baseonly -fno-var-tracking
CXXFLAGS += -femit-struct-debug-baseonly -fno-var-tracking
else
CFLAGS += -Og
CXXFLAGS += -Og
endif
endif

ifeq ($(MTRACE), y)
ifneq ($(SDK_VER),uclibc)
CFLAGS += -DMTRACE
endif
endif

ifeq ($(FPGA_PORTING), true)
CFLAGS += -DFPGA_PORTING
endif

ifeq ($(CONFIG_DDR_64MB_SIZE), y)
CFLAGS += -DDDR_64MB_SIZE
endif

SAMPLE_STATIC ?= 1
SELF_TEST_STATIC ?= 1
SAMPLE_TPU_ENABLE ?= 0
ENABLE_ISP_C906L = 0

ifeq ($(CONFIG_ENABLE_SDK_ASAN), y)
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
ELFFLAGS += -fsanitize=address -fno-omit-frame-pointer -g
LDFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-common -g
SAMPLE_STATIC = 0
SELF_TEST_STATIC = 0
endif

CFLAGS += -DARCH_$(CHIP_ARCH)

ifeq ("$(CVIARCH)", "CV181X")
CFLAGS += -D__CV181X__
endif
ifeq ("$(CVIARCH)", "CV180X")
CFLAGS += -D__CV180X__
endif

## COLOR ##
BLACK = "\e[30;1m"
RED = "\e[31;1m"
GREEN = "\e[32;1m"
YELLOW = "\e[33;1m"
BLUE = "\e[34;1m"
PURPLE = "\e[35;1m"
CYAN = "\e[36;1m"
WHITE = "\e[37;1m"

END= "\e[0m"

16 changes: 16 additions & 0 deletions 3rd_party/musl_riscv64/cvi_mpi/component/isp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SHELL = /bin/bash

include $(BUILD_PATH)/.config
include sensor.mk

chip_arch = $(shell echo $(CVIARCH) | tr A-Z a-z)

all:
pushd sensor/$(chip_arch) && \
$(MAKE) all && \
popd;

clean:
pushd sensor/$(chip_arch) && \
$(MAKE) clean && \
popd;
122 changes: 122 additions & 0 deletions 3rd_party/musl_riscv64/cvi_mpi/component/isp/sensor.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
ifeq ($(CHIP_ARCH),CV183X)
sensor-$(CONFIG_SENSOR_GCORE_GC2053) += gcore_gc2053
sensor-$(CONFIG_SENSOR_GCORE_GC2053_SLAVE) += gcore_gc2053_slave
sensor-$(CONFIG_SENSOR_GCORE_GC2053_1L) += gcore_gc2053_1L
sensor-$(CONFIG_SENSOR_GCORE_GC2083) += gcore_gc2083
sensor-$(CONFIG_SENSOR_GCORE_GC2093) += gcore_gc2093
sensor-$(CONFIG_SENSOR_GCORE_GC2093_SLAVE) += gcore_gc2093_slave
sensor-$(CONFIG_SENSOR_GCORE_GC4653) += gcore_gc4653
sensor-$(CONFIG_SENSOR_GCORE_GC4653_SLAVE) += gcore_gc4653_slave
sensor-$(CONFIG_SENSOR_IMGDS_MIS2008) += imgds_mis2008
sensor-$(CONFIG_SENSOR_NEXTCHIP_N5) += nextchip_n5
sensor-$(CONFIG_SENSOR_OV_OS02D10) += ov_os02d10
sensor-$(CONFIG_SENSOR_OV_OS02D10_SLAVE) += ov_os02d10_slave
sensor-$(CONFIG_SENSOR_OV_OS02K10_SLAVE) += ov_os02k10_slave
sensor-$(CONFIG_SENSOR_OV_OS04C10) += ov_os04c10
sensor-$(CONFIG_SENSOR_OV_OS04C10_SLAVE) += ov_os04c10_slave
sensor-$(CONFIG_SENSOR_OV_OS08A20) += ov_os08a20
sensor-$(CONFIG_SENSOR_OV_OS08A20_SLAVE) += ov_os08a20_slave
sensor-$(CONFIG_SENSOR_PICO_384) += pico_384
sensor-$(CONFIG_SENSOR_PICO_640) += pico_640
sensor-$(CONFIG_SENSOR_PIXELPLUS_PR2020) += pixelplus_pr2020
sensor-$(CONFIG_SENSOR_PIXELPLUS_PR2100) += pixelplus_pr2100
sensor-$(CONFIG_SENSOR_SMS_SC035HGS) += sms_sc035hgs
sensor-$(CONFIG_SENSOR_SMS_SC200AI) += sms_sc200ai
sensor-$(CONFIG_SENSOR_SMS_SC401AI) += sms_sc401ai
sensor-$(CONFIG_SENSOR_SMS_SC850SL) += sms_sc850sl
sensor-$(CONFIG_SENSOR_SMS_SC3335) += sms_sc3335
sensor-$(CONFIG_SENSOR_SMS_SC3335_SLAVE) += sms_sc3335_slave
sensor-$(CONFIG_SENSOR_SMS_SC3336) += sms_sc3336
sensor-$(CONFIG_SENSOR_SMS_SC4210) += sms_sc4210
sensor-$(CONFIG_SENSOR_SMS_SC8238) += sms_sc8238
sensor-$(CONFIG_SENSOR_SOI_F23) += soi_f23
sensor-$(CONFIG_SENSOR_SOI_F35) += soi_f35
sensor-$(CONFIG_SENSOR_SOI_F35_SLAVE) += soi_f35_slave
sensor-$(CONFIG_SENSOR_SOI_H65) += soi_h65
sensor-$(CONFIG_SENSOR_SONY_IMX290_2L) += sony_imx290_2L
sensor-$(CONFIG_SENSOR_SONY_IMX307) += sony_imx307
sensor-$(CONFIG_SENSOR_SONY_IMX307_SLAVE) += sony_imx307_slave
sensor-$(CONFIG_SENSOR_SONY_IMX307_2L) += sony_imx307_2L
sensor-$(CONFIG_SENSOR_SONY_IMX307_SUBLVDS) += sony_imx307_sublvds
sensor-$(CONFIG_SENSOR_SONY_IMX327) += sony_imx327
sensor-$(CONFIG_SENSOR_SONY_IMX327_SLAVE) += sony_imx327_slave
sensor-$(CONFIG_SENSOR_SONY_IMX327_2L) += sony_imx327_2L
sensor-$(CONFIG_SENSOR_SONY_IMX327_SUBLVDS) += sony_imx327_sublvds
sensor-$(CONFIG_SENSOR_SONY_IMX334) += sony_imx334
sensor-$(CONFIG_SENSOR_SONY_IMX335) += sony_imx335
sensor-$(CONFIG_SENSOR_SONY_IMX347) += sony_imx347
sensor-$(CONFIG_SENSOR_SONY_IMX385) += sony_imx385
sensor-$(CONFIG_SENSOR_TECHPOINT_TP2850) += techpoint_tp2850
sensor-$(CONFIG_SENSOR_TECHPOINT_TP2863) += techpoint_tp2863
sensor-$(CONFIG_SENSOR_VIVO_MCS369) += vivo_mcs369
sensor-$(CONFIG_SENSOR_VIVO_MCS369Q) += vivo_mcs369q
sensor-$(CONFIG_SENSOR_VIVO_MM308M2) += vivo_mm308m2
sensor-$(CONFIG_SENSOR_TECHPOINT_TP2825) += techpoint_tp2825
else ifeq ($(CHIP_ARCH), $(filter $(CHIP_ARCH), CV180X CV181X CV182X))
sensor-$(CONFIG_SENSOR_BRIGATES_BG0808) += brigates_bg0808
sensor-$(CONFIG_SENSOR_GCORE_GC02M1) += gcore_gc02m1
sensor-$(CONFIG_SENSOR_GCORE_GC0312) += gcore_gc0312
sensor-$(CONFIG_SENSOR_GCORE_GC0329) += gcore_gc0329
sensor-$(CONFIG_SENSOR_GCORE_GC1054) += gcore_gc1054
sensor-$(CONFIG_SENSOR_GCORE_GC2053) += gcore_gc2053
sensor-$(CONFIG_SENSOR_GCORE_GC2053_SLAVE) += gcore_gc2053_slave
sensor-$(CONFIG_SENSOR_GCORE_GC2053_1L) += gcore_gc2053_1L
sensor-$(CONFIG_SENSOR_GCORE_GC2083) += gcore_gc2083
sensor-$(CONFIG_SENSOR_GCORE_GC2093) += gcore_gc2093
sensor-$(CONFIG_SENSOR_GCORE_GC2145) += gcore_gc2145
sensor-$(CONFIG_SENSOR_GCORE_GC4023) += gcore_gc4023
sensor-$(CONFIG_SENSOR_GCORE_GC4653) += gcore_gc4653
sensor-$(CONFIG_SENSOR_IMGDS_MIS2008) += imgds_mis2008
sensor-$(CONFIG_SENSOR_NEXTCHIP_N5) += nextchip_n5
sensor-$(CONFIG_SENSOR_NEXTCHIP_N6) += nextchip_n6
sensor-$(CONFIG_SENSOR_OV_OS04A10) += ov_os04a10
sensor-$(CONFIG_SENSOR_OV_OS04C10) += ov_os04c10
sensor-$(CONFIG_SENSOR_OV_OS08A20) += ov_os08a20
sensor-$(CONFIG_SENSOR_OV_OV4689) += ov_ov4689
sensor-$(CONFIG_SENSOR_OV_OV5647) += ov_ov5647
sensor-$(CONFIG_SENSOR_OV_OV6211) += ov_ov6211
sensor-$(CONFIG_SENSOR_OV_OV7251) += ov_ov7251
sensor-$(CONFIG_SENSOR_PIXELPLUS_PR2020) += pixelplus_pr2020
sensor-$(CONFIG_SENSOR_PIXELPLUS_PR2100) += pixelplus_pr2100
sensor-$(CONFIG_SENSOR_SMS_SC035GS) += sms_sc035gs
sensor-$(CONFIG_SENSOR_SMS_SC035GS_1L) += sms_sc035gs_1L
sensor-$(CONFIG_SENSOR_SMS_SC035HGS) += sms_sc035hgs
sensor-$(CONFIG_SENSOR_SMS_SC1346_1L) += sms_sc1346_1L
sensor-$(CONFIG_SENSOR_SMS_SC1346_1L_SLAVE) += sms_sc1346_1L_slave
sensor-$(CONFIG_SENSOR_SMS_SC200AI) += sms_sc200ai
sensor-$(CONFIG_SENSOR_SMS_SC301IOT) += sms_sc301iot
sensor-$(CONFIG_SENSOR_SMS_SC401AI) += sms_sc401ai
sensor-$(CONFIG_SENSOR_SMS_SC500AI) += sms_sc500ai
sensor-$(CONFIG_SENSOR_SMS_SC501AI_2L) += sms_sc501ai_2L
sensor-$(CONFIG_SENSOR_SMS_SC531AI_2L) += sms_sc531ai_2L
sensor-$(CONFIG_SENSOR_SMS_SC3332) += sms_sc3332
sensor-$(CONFIG_SENSOR_SMS_SC3335) += sms_sc3335
sensor-$(CONFIG_SENSOR_SMS_SC3336) += sms_sc3336
sensor-$(CONFIG_SENSOR_SMS_SC2331_1L) += sms_sc2331_1L
sensor-$(CONFIG_SENSOR_SMS_SC2335) += sms_sc2335
sensor-$(CONFIG_SENSOR_SMS_SC2336) += sms_sc2336
sensor-$(CONFIG_SENSOR_SMS_SC2336P) += sms_sc2336p
sensor-$(CONFIG_SENSOR_SMS_SC4336) += sms_sc4336
sensor-$(CONFIG_SENSOR_SMS_SC4336P) += sms_sc4336p
sensor-$(CONFIG_SENSOR_SMS_SC5336_2L) += sms_sc5336_2L
sensor-$(CONFIG_SENSOR_SOI_F23) += soi_f23
sensor-$(CONFIG_SENSOR_SOI_F35) += soi_f35
sensor-$(CONFIG_SENSOR_SOI_F37P) += soi_f37p
sensor-$(CONFIG_SENSOR_SOI_K06) += soi_k06
sensor-$(CONFIG_SENSOR_SOI_Q03) += soi_q03
sensor-$(CONFIG_SENSOR_SOI_Q03P) += soi_q03p
sensor-$(CONFIG_SENSOR_SONY_IMX307) += sony_imx307
sensor-$(CONFIG_SENSOR_SONY_IMX307_SLAVE) += sony_imx307_slave
sensor-$(CONFIG_SENSOR_SONY_IMX307_2L) += sony_imx307_2L
sensor-$(CONFIG_SENSOR_SONY_IMX327) += sony_imx327
sensor-$(CONFIG_SENSOR_SONY_IMX327_SLAVE) += sony_imx327_slave
sensor-$(CONFIG_SENSOR_SONY_IMX327_2L) += sony_imx327_2L
sensor-$(CONFIG_SENSOR_SONY_IMX327_FPGA) += sony_imx327_fpga
sensor-$(CONFIG_SENSOR_SONY_IMX327_SUBLVDS) += sony_imx327_sublvds
sensor-$(CONFIG_SENSOR_SONY_IMX335) += sony_imx335
sensor-$(CONFIG_SENSOR_TECHPOINT_TP2825) += techpoint_tp2825
sensor-$(CONFIG_SENSOR_TECHPOINT_TP2863) += techpoint_tp2863
sensor-$(CONFIG_SENSOR_LONTIUM_LT6911) += lontium_lt6911
else
$(error not supported chip arch cv180x/cv181x/cv182x/cv183x)
endif
Loading