diff --git a/kernel.mk b/kernel.mk index 56fcde79ef552cf7816d12b48202bbe0a1564870..d568fdaffcab7fa71a0974b740745e79b894e715 100644 --- a/kernel.mk +++ b/kernel.mk @@ -71,7 +71,11 @@ export HDF_PROJECT_ROOT=$(OHOS_BUILD_HOME)/ $(KERNEL_IMAGE_FILE): $(hide) echo "build kernel..." +ifeq ($(DEVICE_NAME), stm32mp15x) + $(hide) rm -rf $(KERNEL_SRC_TMP_PATH);mkdir -p $(KERNEL_SRC_TMP_PATH);cp -r $(KERNEL_SRC_PATH)/* $(KERNEL_SRC_TMP_PATH)/ +else $(hide) rm -rf $(KERNEL_SRC_TMP_PATH);mkdir -p $(KERNEL_SRC_TMP_PATH);cp -arfL $(KERNEL_SRC_PATH)/* $(KERNEL_SRC_TMP_PATH)/ +endif $(hide) cd $(KERNEL_SRC_TMP_PATH) && patch -p1 < $(HDF_PATCH_FILE) && patch -p1 < $(DEVICE_PATCH_FILE) ifneq ($(findstring $(BUILD_TYPE), small),) $(hide) cd $(KERNEL_SRC_TMP_PATH) && patch -p1 < $(SMALL_PATCH_FILE) @@ -80,9 +84,14 @@ endif $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) distclean $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(DEFCONFIG_FILE) ifeq ($(KERNEL_VERSION), linux-5.10) +ifeq ($(DEVICE_NAME), stm32mp15x) + $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) -j11 LOADADDR=0xC2000040 uImage modules + $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) dtbs +else + $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) -j64 uImage $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) modules_prepare endif - $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) -j64 uImage +endif endif .PHONY: build-kernel build-kernel: $(KERNEL_IMAGE_FILE) diff --git a/kernel_module_build.sh b/kernel_module_build.sh index 826bd6c3e6bd74ee18376fd4dcd6e22c45d0c72a..4f576843c46d29e5d18dcac1887d06fe3a81fcc8 100755 --- a/kernel_module_build.sh +++ b/kernel_module_build.sh @@ -30,6 +30,8 @@ if [ "$2" == "small" ];then fi if [ "$5" == "hispark_taurus" ];then export DEVICE_NAME=hi3516dv300 + elif [ "$5" == "stm32mp15x" ];then + export DEVICE_NAME=stm32mp15x fi elif [ "$2" == "standard" ];then export BUILD_TYPE=standard @@ -52,7 +54,16 @@ else exit 1 fi -if [ "$2" == "small" ];then +if [ "$5" == "stm32mp15x" ];then + rm -rf ${OUT_DIR}/bootfs + mkdir ${OUT_DIR}/bootfs + BOOTFS=${OUT_DIR}/bootfs + cp -rf ${LINUX_KERNEL_UIMAGE_FILE} ${BOOTFS} + cp -rf ${LINUX_KERNEL_OUT}/arch/arm/boot/dts/stm32mp157c-ev1.dtb ${BOOTFS} + ./../../../build/lite/make_rootfs/rootfsimg_linux.sh ${BOOTFS} ext4 +fi + +if [ "$5" == "hispark_taurus" ];then cp -rf ${LINUX_KERNEL_UIMAGE_FILE} ${OUT_DIR}/uImage_${DEVICE_NAME}_smp fi