2021-02-02 18:04:33 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2017 Hauke Mehrtens
|
2021-02-10 02:47:53 +00:00
|
|
|
# Copyright (C) 2021 Daniel Golle
|
2021-02-02 18:04:33 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=arm-trusted-firmware-mediatek
|
|
|
|
PKG_RELEASE:=$(AUTORELEASE)
|
|
|
|
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
|
|
PKG_SOURCE_URL=https://github.com/mtk-openwrt/arm-trusted-firmware.git
|
2021-03-11 16:01:32 +00:00
|
|
|
PKG_SOURCE_DATE:=2021-03-10
|
|
|
|
PKG_SOURCE_VERSION:=8b635f61091f2e5bce88269468c53fc30bb4cd64
|
|
|
|
PKG_MIRROR_HASH:=ffe233a19b51504f605a90a88c7a1bb74303e4a7173a59b24a4dfa572ce99139
|
2021-02-02 18:04:33 +00:00
|
|
|
|
|
|
|
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
|
|
|
|
2021-02-03 14:48:45 +00:00
|
|
|
include $(INCLUDE_DIR)/trusted-firmware-a.mk
|
2021-02-02 18:04:33 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Trusted-Firmware-A/Default
|
|
|
|
BUILD_TARGET:=mediatek
|
|
|
|
BUILD_SUBTARGET:=mt7622
|
|
|
|
PLAT:=mt7622
|
|
|
|
TFA_IMAGE:=bl2.img bl31.bin
|
|
|
|
BOOT_DEVICE:=
|
2021-03-05 23:53:51 +00:00
|
|
|
DDR3_FLYBY:=
|
2021-02-10 02:47:53 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Trusted-Firmware-A/mt7622-nor-1ddr
|
|
|
|
NAME:=MediaTek MT7622 (SPI-NOR, 1x DDR3)
|
|
|
|
BOOT_DEVICE:=nor
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Trusted-Firmware-A/mt7622-nor-2ddr
|
|
|
|
NAME:=MediaTek MT7622 (SPI-NOR, 2x DDR3)
|
|
|
|
BOOT_DEVICE:=nor
|
2021-03-05 23:53:51 +00:00
|
|
|
DDR3_FLYBY:=1
|
2021-02-02 18:04:33 +00:00
|
|
|
endef
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Trusted-Firmware-A/mt7622-snand-1ddr
|
|
|
|
NAME:=MediaTek MT7622 (SPI-NAND, 1x DDR3)
|
|
|
|
BOOT_DEVICE:=snand
|
2021-02-02 18:04:33 +00:00
|
|
|
endef
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Trusted-Firmware-A/mt7622-snand-2ddr
|
2021-03-08 21:27:07 +00:00
|
|
|
NAME:=MediaTek MT7622 (SPI-NAND, 2x DDR3)
|
2021-02-10 02:47:53 +00:00
|
|
|
BOOT_DEVICE:=snand
|
2021-03-05 23:53:51 +00:00
|
|
|
DDR3_FLYBY:=1
|
2021-02-02 18:04:33 +00:00
|
|
|
endef
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Trusted-Firmware-A/mt7622-emmc-1ddr
|
|
|
|
NAME:=MediaTek MT7622 (eMMC, 1x DDR3)
|
|
|
|
BOOT_DEVICE:=emmc
|
2021-02-02 18:04:33 +00:00
|
|
|
endef
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Trusted-Firmware-A/mt7622-emmc-2ddr
|
|
|
|
NAME:=MediaTek MT7622 (eMMC, 2x DDR3)
|
|
|
|
BOOT_DEVICE:=emmc
|
2021-03-05 23:53:51 +00:00
|
|
|
DDR3_FLYBY:=1
|
2021-02-02 18:04:33 +00:00
|
|
|
endef
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Trusted-Firmware-A/mt7622-sdmmc-1ddr
|
|
|
|
NAME:=MediaTek MT7622 (SDcard, 1x DDR3)
|
|
|
|
BOOT_DEVICE:=sdmmc
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Trusted-Firmware-A/mt7622-sdmmc-2ddr
|
|
|
|
NAME:=MediaTek MT7622 (SDcard, 2x DDR3)
|
|
|
|
BOOT_DEVICE:=sdmmc
|
2021-03-05 23:53:51 +00:00
|
|
|
DDR3_FLYBY:=1
|
2021-02-10 02:47:53 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
TFA_TARGETS:= \
|
2021-03-05 17:14:02 +00:00
|
|
|
mt7622-nor-1ddr \
|
|
|
|
mt7622-nor-2ddr \
|
|
|
|
mt7622-snand-1ddr \
|
|
|
|
mt7622-snand-2ddr \
|
|
|
|
mt7622-emmc-1ddr \
|
|
|
|
mt7622-emmc-2ddr \
|
|
|
|
mt7622-sdmmc-1ddr \
|
|
|
|
mt7622-sdmmc-2ddr
|
|
|
|
|
2021-03-11 16:01:32 +00:00
|
|
|
TFA_MAKE_FLAGS += \
|
|
|
|
BOOT_DEVICE=$(BOOT_DEVICE) \
|
|
|
|
USE_MKIMAGE=1 MKIMAGE=$(STAGING_DIR_HOST)/bin/mkimage \
|
|
|
|
$(if $(DDR3_FLYBY),DDR3_FLYBY=1) \
|
|
|
|
all
|
2021-02-02 18:04:33 +00:00
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
define Build/Configure
|
|
|
|
$(call Build/Configure/Default)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/trusted-firmware-a/install
|
2021-02-02 18:04:33 +00:00
|
|
|
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
2021-02-10 02:47:53 +00:00
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl2.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.img
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/mt7622/release/bl31.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl31.bin
|
2021-02-02 18:04:33 +00:00
|
|
|
endef
|
|
|
|
|
2021-02-10 02:47:53 +00:00
|
|
|
$(eval $(call BuildPackage/Trusted-Firmware-A))
|