[openwrt/openwrt] arm-trusted-firmware-rockchip: add m0 gcc toolchain

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 25 13:52:52 PDT 2023


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/186976c963f0b2484be81854b97c0d8ec6c6e7a7

commit 186976c963f0b2484be81854b97c0d8ec6c6e7a7
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Sun Jun 25 23:41:35 2023 +0800

    arm-trusted-firmware-rockchip: add m0 gcc toolchain
    
    rk3399 ATF requires arm toolchain to build the m0 pmu driver.
    As OpenWrt doesn't ship this toolchain so download the prebuilt one
    just like what we did in arm-trusted-firmware-mvebu.
    
    Fixes: 5d1cb52da062 ("arm-trusted-firmware-rockchip: Update to 2.9")
    
    Reported-by: Wurzer Juergen <wurzer.juergen at gmail.com>
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
---
 .../boot/arm-trusted-firmware-rockchip/Makefile    | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/package/boot/arm-trusted-firmware-rockchip/Makefile b/package/boot/arm-trusted-firmware-rockchip/Makefile
index f5b9d6b16d..aaae4ce392 100644
--- a/package/boot/arm-trusted-firmware-rockchip/Makefile
+++ b/package/boot/arm-trusted-firmware-rockchip/Makefile
@@ -37,6 +37,33 @@ 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/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




More information about the lede-commits mailing list