From ed5000431940c0c8ae2b5704faa0ceb68a299102 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 30 Jan 2021 13:58:16 +0000 Subject: uboot-mediatek: add support for Linksys E8450 Build U-Boot for the Linksys E8450 in order to have support for UBI. The loader has a default environment with scripts handling the reset button as well as fall-back to recovery firmware. If the loader comes up without a valid environment found in UBI, it will automatically make sure UBI is formatted and create a new environment and proceed to load recovery firmware (either from UBI or via TFTP if recovery is corrupted or unavailable). If the button is held down during power-on, the yellow status LED turns on and the bootloader environment is reset to factory defaults. If the button is released at this point, the recovery firmware (if existing) is loaded from UBI and booted. If the button is continously held down even beyond the point that the yellow LED turned on, the loader will try to load the recovery firmware via TFTP from server 192.168.1.254, write it to UBI and boot. Signed-off-by: Daniel Golle --- package/boot/uboot-mediatek/Makefile | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'package/boot/uboot-mediatek/Makefile') diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index c46b906cb5..b61f432644 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -3,6 +3,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_VERSION:=2020.10 PKG_HASH:=0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622 +PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -20,6 +21,16 @@ define U-Boot/mt7622 UBOOT_CONFIG:=mt7622_rfb endef +define U-Boot/mt7622_linksys_e8450 + NAME:=Linksys E8450 + BUILD_SUBTARGET:=mt7622 + UBOOT_CONFIG:=mt7622_linksys_e8450 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=snand + BL2_DDRBLOB:=1 + DEPENDS:=+trusted-firmware-a-mt7622-snand-1ddr +endef + define U-Boot/mt7623a_unielec_u7623 NAME:=UniElec U7623 (mt7623) BUILD_SUBTARGET:=mt7623 @@ -39,15 +50,33 @@ define U-Boot/mt7629 UBOOT_CONFIG:=mt7629_rfb endef -UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2 mt7623a_unielec_u7623 +UBOOT_TARGETS := mt7629 mt7622 mt7622_linksys_e8450 mt7623n_bpir2 mt7623a_unielec_u7623 -UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) +UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE:.fip=.bin) Build/Exports:=$(Host/Exports) +define Build/fip-image + $(STAGING_DIR_HOST)/bin/fiptool create \ + --soc-fw $(STAGING_DIR_IMAGE)/$(BUILD_SUBTARGET)-$(BL2_BOOTDEV)-$(BL2_DDRBLOB)ddr-bl31.bin \ + --nt-fw $(PKG_BUILD_DIR)/u-boot.bin \ + $(PKG_BUILD_DIR)/u-boot.fip +endef + +define Build/Compile + $(call Build/Compile/U-Boot) +ifeq ($(UBOOT_IMAGE),u-boot.fip)) + $(call Build/fip-image) +endif +endef + +# don't stage files to bindir, let target/linux/mediatek/image/*.mk do that +define Package/u-boot/install +endef + define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) endef $(eval $(call BuildPackage/U-Boot)) -- cgit v1.2.3