From: Daniel Golle Date: Fri, 5 Mar 2021 17:14:02 +0000 (+0000) Subject: arm-trusted-firmware-mediatek: update to ATF 2.4 (2021-02-25) X-Git-Tag: v22.03.0-rc1~3194 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=dc416983bb45f040700612891a9c46ca92e027ff;p=openwrt%2Fopenwrt.git arm-trusted-firmware-mediatek: update to ATF 2.4 (2021-02-25) All necessary blobs are now contained in the upstream repository, no more wild replacing of blobs needed. This new version also contains new storage drivers for (SPI-)NAND which already comes with support for FM35Q1GA, so that patch can be dropped as well. Tested on: * Bananapi BPi-R64 - sdmmc-2ddr - emmc-2ddr * Linksys E8450 - snand-1ddr All works fine (booting Bananapi BPi-R64 from SD Card does NOT require a signed image, so patch arm-trusted-firmware-mediatek to allow doing that). Signed-off-by: Daniel Golle --- diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index fed9c095b9..d631c0093d 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/mtk-openwrt/arm-trusted-firmware.git -PKG_SOURCE_DATE:=2020-11-09 -PKG_SOURCE_VERSION:=03017334ccd8c0fac12e7db36749b95b9a7d745f -PKG_MIRROR_HASH:=b211b2f9143d4debc7ad8dc959cb606888af20af790855dd66c87e451b6a1bc7 +PKG_SOURCE_DATE:=2021-02-25 +PKG_SOURCE_VERSION:=1220acb044a9db9a201aba3be0bb4ce0c9ed3702 +PKG_MIRROR_HASH:=f2ca44b9b8acfbd3a6be30aba316c765f73bad6231a821f524c9f21a845e50a3 PKG_MAINTAINER:=Daniel Golle @@ -29,13 +29,6 @@ include $(INCLUDE_DIR)/package.mk PKG_LICENSE+=proprietary -define Download/tfa-files - URL:=@OPENWRT - URL_FILE:=$(BLOBS_TARBALL) - FILE:=$(BLOBS_TARBALL) - HASH:=689b097e4531d3eeca0c477675ab3dc3cace6ba4ed8a339116a9ede6537839d7 -endef - define Trusted-Firmware-A/Default BUILD_TARGET:=mediatek BUILD_SUBTARGET:=mt7622 @@ -94,36 +87,19 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr endef TFA_TARGETS:= \ - mt7622-nor-1ddr \ - mt7622-nor-2ddr \ - mt7622-snand-1ddr \ - mt7622-snand-2ddr \ - mt7622-emmc-1ddr \ - mt7622-emmc-2ddr \ - mt7622-sdmmc-1ddr \ - mt7622-sdmmc-2ddr - -TFA_MAKE_FLAGS += BOOT_DEVICE=$(BOOT_DEVICE) all - -define Build/Prepare - $(call Build/Prepare/Default) - $(eval $(call Download,tfa-files)) -# replace 'bromimage' tool by static version - $(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \ - -O "*/$(BROMIMAGE_EXEC)" > $(PKG_BUILD_DIR)/tools/mediatek/bromimage/bromimage - $(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \ - -C $(PKG_BUILD_DIR) \ - --strip-components=1 */LICENCE.mediatek -endef + mt7622-nor-1ddr \ + mt7622-nor-2ddr \ + mt7622-snand-1ddr \ + mt7622-snand-2ddr \ + mt7622-emmc-1ddr \ + mt7622-emmc-2ddr \ + mt7622-sdmmc-1ddr \ + mt7622-sdmmc-2ddr + +TFA_MAKE_FLAGS += BOOT_DEVICE=$(BOOT_DEVICE) $(if eq($(DDR_BLOB),2),DDR3_FLYBY=1) all define Build/Configure $(call Build/Configure/Default) -# replace DRAM calib blobs if needed (variant '2' is shipped upstream) -ifeq ($(DDR_BLOB),1) - $(TAR) -vxzf $(DL_DIR)/$(BLOBS_TARBALL) --wildcards \ - -C $(PKG_BUILD_DIR)/plat/mediatek/mt7622/drivers/dram/release \ - --strip-components=1 */*.o -endif endef define Package/trusted-firmware-a/install diff --git a/package/boot/arm-trusted-firmware-mediatek/patches/001-make-brom-sign-key-optional-again.patch b/package/boot/arm-trusted-firmware-mediatek/patches/001-make-brom-sign-key-optional-again.patch new file mode 100644 index 0000000000..60b221ad5f --- /dev/null +++ b/package/boot/arm-trusted-firmware-mediatek/patches/001-make-brom-sign-key-optional-again.patch @@ -0,0 +1,17 @@ +Index: arm-trusted-firmware-mediatek-2021-02-25-1220acb0/plat/mediatek/mt7622/platform.mk +=================================================================== +--- arm-trusted-firmware-mediatek-2021-02-25-1220acb0.orig/plat/mediatek/mt7622/platform.mk ++++ arm-trusted-firmware-mediatek-2021-02-25-1220acb0/plat/mediatek/mt7622/platform.mk +@@ -99,9 +99,9 @@ BL2_SOURCES += drivers/mmc/mmc.c \ + BROM_HEADER_TYPE := sdmmc + CPPFLAGS += -DMSDC_INDEX=1 + DEVICE_HEADER_OFFSET ?= 0x80000 +-ifeq ($(BROM_SIGN_KEY),) +-$(error BootROM signing key is required for SD booting. Please specify BROM_SIGN_KEY) +-endif ++#ifeq ($(BROM_SIGN_KEY),) ++#$(error BootROM signing key is required for SD booting. Please specify BROM_SIGN_KEY) ++#endif + endif + ifeq ($(BOOT_DEVICE),snand) + include ${MTK_PLAT}/common/drivers/snfi/mtk-snand.mk diff --git a/package/boot/arm-trusted-firmware-mediatek/patches/010-nandx-add-fidelix-spi-nand.patch b/package/boot/arm-trusted-firmware-mediatek/patches/010-nandx-add-fidelix-spi-nand.patch deleted file mode 100644 index d0a8f7616a..0000000000 --- a/package/boot/arm-trusted-firmware-mediatek/patches/010-nandx-add-fidelix-spi-nand.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/plat/mediatek/common/drivers/nandx/core/nand/device_spi.c -+++ b/plat/mediatek/common/drivers/nandx/core/nand/device_spi.c -@@ -150,6 +150,21 @@ static struct device_spi spi_nand[] = { - &spi_extend_cmds, 0xff, 0xff - }, - { -+ NAND_DEVICE("FM35X1GA", -+ NAND_PACK_ID(0xe5, 0x71, 0, 0, 0, 0, 0, 0), -+ 2, 0, 3, 3, -+ 1, 1, 1, 1024, KB(128), KB(2), 64, 1, -+ &spi_cmds, &spi_addressing, &spi_status[0], -+ &spi_endurance, &spi_array_timing), -+ { -+ NAND_SPI_PROTECT(0xa0, 1, 2, 6), -+ NAND_SPI_CONFIG(0xb0, 4, 6, 1), -+ NAND_SPI_STATUS(0xc0, 4, 5), -+ NAND_SPI_CHARACTER(0xff, 0xff, 0xff, 0xff) -+ }, -+ &spi_extend_cmds, 0xff, 0xff -+ }, -+ { - NAND_DEVICE("NO-DEVICE", - NAND_PACK_ID(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1,