Skip to content

Commit

Permalink
add th1520-boot-firmware package
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsx authored and RevySR committed Jul 10, 2024
1 parent d1a6c7d commit e4042ff
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 4 deletions.
43 changes: 43 additions & 0 deletions package/boot/th1520-boot-firmware/Makefile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>

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))
9 changes: 5 additions & 4 deletions target/linux/xuantie/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Binary file removed target/linux/xuantie/image/fw_dynamic.bin
Binary file not shown.
Binary file removed target/linux/xuantie/image/light_aon_fpga.bin
Binary file not shown.
Binary file removed target/linux/xuantie/image/light_c906_audio.bin
Binary file not shown.
Binary file removed target/linux/xuantie/image/str.bin
Binary file not shown.

0 comments on commit e4042ff

Please sign in to comment.