[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/boot/common/scripts/Makefile b/boot/common/scripts/Makefile
new file mode 100755
index 0000000..ffa5724
--- /dev/null
+++ b/boot/common/scripts/Makefile
@@ -0,0 +1,214 @@
+::------------------------------------------------------------------------------------------
+:: makefile for project
+::------------------------------------------------------------------------------------------
+BOOTLOADER_PATH=..
+BOOTLOADER_PRJ_PATH=../../prj
+
+ECHO=@
+
+TIMER_START = $(shell date)
+SRCROOT = $(word $(words $(subst /, ,$(subst /common/scripts,,$(shell pwd)))),$(subst /, ,$(subst /common/scripts,,$(shell pwd))))
+
+
+ifeq ($(CHIP_TYPE),ZX297520V3)
+chip=zx297520v3
+endif
+
+
+ifeq ($(BOARD_TYPE),EVB)
+board=evb
+endif
+
+ifeq ($(BOARD_TYPE),MIFI)
+board=mifi
+endif
+
+ifeq ($(BOARD_TYPE),MIFI_MINI)
+board=mifi_mini
+endif
+
+ifeq ($(BOARD_TYPE),MIFI_MINI_XR819)
+board=mifi_mini_xr819
+endif
+
+ifeq ($(BOARD_TYPE),MIFI_MINI_64)
+board=mifi_mini_64
+endif
+
+ifeq ($(BOARD_TYPE),UFI_MINI)
+board=ufi_mini
+endif
+
+ifeq ($(BOARD_TYPE),CPE)
+board=cpe
+endif
+
+ifeq ($(BOARD_TYPE),CPE_SWITCH)
+board=cpe_switch
+endif
+
+ifeq ($(BOARD_TYPE),PHONE)
+board=phone
+endif
+
+ifeq ($(BOARD_TYPE),FWP)
+board=fwp
+endif
+
+ifeq ($(BOARD_TYPE),MDL)
+board=mdl
+endif
+
+ifeq ($(BOARD_TYPE),MDL_AB)
+board=mdl_ab
+endif
+
+ifeq ($(BOARD_TYPE),VEHICLE_DC)
+board=vehicle_dc
+endif
+
+ifeq ($(BOARD_TYPE),MDL_MINI)
+board=mdl_mini
+endif
+
+ifeq ($(BOARD_TYPE),MDL_MINI_64)
+board=mdl_mini_64
+endif
+
+ifeq ($(BOARD_TYPE),WATCH)
+board=watch
+endif
+
+ifeq ($(BOARD_TYPE),WATCH_CAP)
+board=watch_cap
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),))
+ ram_text=0x23EF0000
+ V3T_RAM_TEXT_64M_UBOOT=y
+else
+ ram_text=0x21EF0000
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),mdl_ab))
+ key_path=$(subst _ab,,$(board))
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),vehicle_dc))
+ key_path=mdl
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),mdl_mini mifi_mini ufi_mini))
+ key_path=$(subst _mini,,$(board))
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),mifi_mini_xr819))
+ key_path=$(subst _mini_xr819,,$(board))
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),mdl_mini_64 mifi_mini_64))
+ key_path=$(subst _mini_64,,$(board))
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),watch_cap))
+ key_path=$(subst _cap,,$(board))
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),cpe_switch))
+ key_path=$(subst _switch,,$(board))
+endif
+
+ifeq ($(strip $(board)),$(filter $(board),cpe evb fwp mdl mifi phone watch))
+ key_path=$(board)
+endif
+
+export chip board key_path ram_text V3T_RAM_TEXT_64M_UBOOT
+
+default: help
+
+help:
+ @echo "================== Make help ==================="
+ @echo "make [help] help"
+ @echo "make all[clean] compile all && link"
+ @echo "make zloader[clean] build zloader"
+ @echo "make tloader[clean] build tloader"
+ @echo "make uboot[clean] build uboot"
+
+tloader:
+ chmod -R 777 ../../../$(SRCROOT)
+ cp -rf $(BOOTLOADER_PRJ_PATH)/../../tools/SignImage/test_key/$(key_path)/key.h $(BOOTLOADER_PATH)/src/loader/include
+ cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_tloader.sh
+ @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/z-load
+ @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/z-load.map
+ @echo "$(TIMER_START)"
+ @date
+
+zloader:
+ chmod -R 777 ../../../$(SRCROOT)
+ cp -rf $(BOOTLOADER_PRJ_PATH)/../../tools/SignImage/test_key/$(key_path)/key.h $(BOOTLOADER_PATH)/src/loader/include
+ cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_zloader_dlon.sh
+ @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/z-load
+ @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/z-load.map
+
+ cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_zloader_dloff.sh
+ @cp $(BOOTLOADER_PATH)/src/loader/z-load $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/z-load
+ @cp $(BOOTLOADER_PATH)/src/loader/z-load.map $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/z-load.map
+ @echo "$(TIMER_START)"
+ @date
+
+::------------------------------------------------------------------------------------------
+:: º¯Êý¶¨Ò壬עÒ⺯Êý¶¨Òå»»ÐкóÊǿոñ£¬²»ÊÇtab
+::------------------------------------------------------------------------------------------
+make-uboot = \
+ chmod -R 777 ../../../$(SRCROOT); \
+ cp -rf $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/config/uboot/* $(BOOTLOADER_PATH)/src/uboot; \
+ cd $(BOOTLOADER_PATH)/scripts/build && sh ./$(1); \
+ echo "$(TIMER_START)"; \
+ date;
+
+uboot:
+ $(call make-uboot,build_uboot.sh)
+
+::------------------------------------------------------------------------------------------
+:: clean
+::------------------------------------------------------------------------------------------
+zloaderclean:
+ rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_off/*load*
+ rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/dl_on/*load*
+tloaderclean:
+ rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*load*
+loadersrcclean:
+ cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_loader_clean.sh
+
+ubootclean:
+ifeq ($(strip $(board)),$(filter $(board),fwp phone))
+ rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/$(lcd)/*boot*
+else
+ rm -fr $(BOOTLOADER_PRJ_PATH)/$(chip)/$(board)/bin/*boot*
+endif
+
+ubootsrcclean:
+ cd $(BOOTLOADER_PATH)/scripts/build && sh ./build_uboot_clean.sh
+
+::------------------------------------------------------------------------------------------
+:: all
+::------------------------------------------------------------------------------------------
+all: zloader tloader uboot
+allclean: zloaderclean tloaderclean ubootclean
+bootclean: loadersrcclean ubootsrcclean
+
+klocwork:
+ bash $(KLOCWORK_SCRIPT_PATH)/0_flush.sh $(KLOCWORK_WEBUI_PRJ_NAME) allclean all
+
+covall:
+ bash $(COVERITY_SCRIPT_PATH)/flush.sh allclean all
+ make cov_upload
+
+coverity:
+ bash $(COVERITY_SCRIPT_PATH)/flush.sh $(COV_TARGET)
+
+cov_upload:
+ bash $(COVERITY_SCRIPT_PATH)/upload.sh $(COVERITY_PRJ_STREAM_NAME)
+
+cov_report:
+ bash $(COVERITY_SCRIPT_PATH)/report2.sh