From e90fe2d9095acf517c0eeb97160a19d902a2a0d2 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 3 Sep 2024 17:25:12 +0800 Subject: [PATCH] arm-trusted-firmware-rockchip: Update to 2.10 --- .../arm-trusted-firmware-rockchip/Makefile | 71 ++++++++++++------- package/boot/uboot-rockchip/Makefile | 12 ++-- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/package/boot/arm-trusted-firmware-rockchip/Makefile b/package/boot/arm-trusted-firmware-rockchip/Makefile index 3d12cfa979a4b7..6fbcbef0a8b305 100644 --- a/package/boot/arm-trusted-firmware-rockchip/Makefile +++ b/package/boot/arm-trusted-firmware-rockchip/Makefile @@ -7,43 +7,66 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=arm-trusted-firmware-rockchip -PKG_VERSION:=2.8 +PKG_VERSION:=2.10 PKG_RELEASE:=1 -PKG_SOURCE:=atf-v$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/atf-builds/atf/releases/download/v$(PKG_VERSION)/atf-v$(PKG_VERSION).tar.gz? -PKG_HASH:=61df69619fd611da9e43abf66be28d6d59722feef559587fad0ca4cd9e499758 - -PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=license.md +PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201 PKG_MAINTAINER:=Tobias Maedel -MAKE_PATH:=$(PKG_NAME) - +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/trusted-firmware-a.mk include $(INCLUDE_DIR)/package.mk -define Package/arm-trusted-firmware-rockchip - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=ARM Trusted Firmware for Rockchip - DEPENDS:=@TARGET_rockchip_armv8 +define Trusted-Firmware-A/Default + NAME:=Rockchip $(1) SoCs + BUILD_TARGET:=rockchip endef -define Build/Prepare - $(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE) +define Trusted-Firmware-A/rk3328 + BUILD_SUBTARGET:=armv8 + PLAT=rk3328 endef -define Build/Compile +define Trusted-Firmware-A/rk3399 + BUILD_SUBTARGET:=armv8 + PLAT:=rk3399 endef -define Build/InstallDev - $(INSTALL_DIR) -p $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/rk*.elf $(STAGING_DIR_IMAGE)/ -endef +TFA_TARGETS:= \ + rk3328 \ + rk3399 + +ifeq ($(BUILD_VARIANT),rk3399) + M0_GCC_NAME:=gcc-arm + M0_GCC_RELEASE:=11.2-2022.02 + M0_GCC_VERSION:=$(HOST_ARCH)-arm-none-eabi + M0_GCC_SOURCE:=$(M0_GCC_NAME)-$(M0_GCC_RELEASE)-$(M0_GCC_VERSION).tar.xz + + define Download/m0-gcc + FILE:=$(M0_GCC_SOURCE) + URL:=https://developer.arm.com/-/media/Files/downloads/gnu/$(M0_GCC_RELEASE)/binrel + ifeq ($(HOST_ARCH),aarch64) + HASH:=ef1d82e5894e3908cb7ed49c5485b5b95deefa32872f79c2b5f6f5447cabf55f + else + HASH:=8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326 + endif + endef + + define Build/Prepare + $(eval $(call Download,m0-gcc)) + $(call Build/Prepare/Default) + + xzcat $(DL_DIR)/$(M0_GCC_SOURCE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/ $(TAR_OPTIONS) + endef + + TFA_MAKE_FLAGS+= \ + M0_CROSS_COMPILE=$(PKG_BUILD_DIR)/$(M0_GCC_NAME)-$(M0_GCC_RELEASE)-$(M0_GCC_VERSION)/bin/arm-none-eabi- +endif -define Package/arm-trusted-firmware-rockchip/install +define Package/trusted-firmware-a/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl31/bl31.elf $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)_bl31.elf endef -$(eval $(call BuildPackage,arm-trusted-firmware-rockchip)) +$(eval $(call BuildPackage/Trusted-Firmware-A)) diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index df9cdd9fc83e05..48b009e8db2a50 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -77,8 +77,8 @@ define U-Boot/guangmiao-g4c-rk3399 NAME:=GuangMiao G4C BUILD_DEVICES:= \ sharevdi_guangmiao-g4c - DEPENDS:=+PACKAGE_u-boot-guangmiao-g4c-rk3399:arm-trusted-firmware-rockchip - PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip + DEPENDS:=+PACKAGE_u-boot-guangmiao-g4c-rk3399:trusted-firmware-a-rk3399 + PKG_BUILD_DEPENDS:=trusted-firmware-a-rk3399 ATF:=rk3399_bl31.elf endef @@ -109,8 +109,8 @@ define U-Boot/rock-pi-4-rk3399 NAME:=Rock Pi 4 BUILD_DEVICES:= \ radxa_rock-pi-4 - DEPENDS:=+PACKAGE_u-boot-rock-pi-4-rk3399:arm-trusted-firmware-rockchip - PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip + DEPENDS:=+PACKAGE_u-boot-rock-pi-4-rk3399:trusted-firmware-a-rk3399 + PKG_BUILD_DEPENDS:=trusted-firmware-a-rk3399 ATF:=rk3399_bl31.elf endef @@ -119,8 +119,8 @@ define U-Boot/rockpro64-rk3399 NAME:=RockPro64 BUILD_DEVICES:= \ pine64_rockpro64 - DEPENDS:=+PACKAGE_u-boot-rockpro64-rk3399:arm-trusted-firmware-rockchip - PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip + DEPENDS:=+PACKAGE_u-boot-rockpro64-rk3399:trusted-firmware-a-rk3399 + PKG_BUILD_DEPENDS:=trusted-firmware-a-rk3399 ATF:=rk3399_bl31.elf endef