diff --git a/package/boot/th1520-boot-firmware/Makefile b/package/boot/th1520-boot-firmware/Makefile new file mode 100644 index 0000000000000..192fc7af8129d --- /dev/null +++ b/package/boot/th1520-boot-firmware/Makefile @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2023 OpenWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=th1520-boot-firmware +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/revyos/th1520-boot-firmware.git +PKG_SOURCE_VERSION:=c5ab8185a292907cdea7b7197458c79e1863d826 +PKG_MIRROR_HASH:=8e01d1a8f4c991c52d87c3484543caccb7deb4a7e269278cbd5f5be7ad67eac3 + +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=RevySR + +include $(INCLUDE_DIR)/package.mk + +define Package/th1520-boot-firmware + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@(TARGET_xuantie) + TITLE:=Xuantie SoCs Boot Firmware + AON:=addons/boot/light_aon_fpga.bin + AUDIO:=addons/boot/light_c906_audio.bin + STR:=addons/boot/str.bin + SBI:=opensbi/fw_dynamic.bin.mainline +endef + +define Build/Compile +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + + $(CP) $(PKG_BUILD_DIR)/$(AON) $(STAGING_DIR_IMAGE)/th1520-light_aon_fpga.bin + $(CP) $(PKG_BUILD_DIR)/$(AUDIO) $(STAGING_DIR_IMAGE)/th1520-light_c906_audio.bin + $(CP) $(PKG_BUILD_DIR)/$(STR) $(STAGING_DIR_IMAGE)/th1520-str.bin + $(CP) $(PKG_BUILD_DIR)/$(SBI) $(STAGING_DIR_IMAGE)/th1520-fw_dynamic.bin +endef + +$(eval $(call BuildPackage,th1520-boot-firmware)) diff --git a/target/linux/xuantie/image/Makefile b/target/linux/xuantie/image/Makefile index 3d55d6efc7e6e..2cbc6b4755d34 100644 --- a/target/linux/xuantie/image/Makefile +++ b/target/linux/xuantie/image/Makefile @@ -13,10 +13,11 @@ define Image/BuildKernel mkdir -p $@.boot/extlinux $(CP) extlinux.conf $@.boot/extlinux/extlinux.conf - $(CP) fw_dynamic.bin $@.boot/fw_dynamic.bin - $(CP) light_aon_fpga.bin $@.boot/light_aon_fpga.bin - $(CP) light_c906_audio.bin $@.boot/light_c906_audio.bin - $(CP) str.bin $@.boot/str.bin + + $(CP) $(STAGING_DIR_IMAGE)/th1520-fw_dynamic.bin $@.boot/fw_dynamic.bin + $(CP) $(STAGING_DIR_IMAGE)/th1520-light_aon_fpga.bin $@.boot/light_aon_fpga.bin + $(CP) $(STAGING_DIR_IMAGE)/th1520-light_c906_audio.bin $@.boot/light_c906_audio.bin + $(CP) $(STAGING_DIR_IMAGE)/th1520-str.bin $@.boot/str.bin rm -f $(KDIR)/boot.ext4 mkfs.ext4 -d $@.boot -L "boot" $(KDIR)/boot.ext4 "57M" diff --git a/target/linux/xuantie/image/fw_dynamic.bin b/target/linux/xuantie/image/fw_dynamic.bin deleted file mode 100644 index 8d30d3cb12548..0000000000000 Binary files a/target/linux/xuantie/image/fw_dynamic.bin and /dev/null differ diff --git a/target/linux/xuantie/image/light_aon_fpga.bin b/target/linux/xuantie/image/light_aon_fpga.bin deleted file mode 100755 index 350abb814831a..0000000000000 Binary files a/target/linux/xuantie/image/light_aon_fpga.bin and /dev/null differ diff --git a/target/linux/xuantie/image/light_c906_audio.bin b/target/linux/xuantie/image/light_c906_audio.bin deleted file mode 100755 index bda033f40d882..0000000000000 Binary files a/target/linux/xuantie/image/light_c906_audio.bin and /dev/null differ diff --git a/target/linux/xuantie/image/str.bin b/target/linux/xuantie/image/str.bin deleted file mode 100755 index 654aff75bb179..0000000000000 Binary files a/target/linux/xuantie/image/str.bin and /dev/null differ