2020-04-12 11:51:49 +00:00
|
|
|
#
|
2024-08-28 22:46:30 +00:00
|
|
|
# Copyright (C) 2020 Sarah Maedel <openwrt@tbspace.de>
|
2020-04-12 11:51:49 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
2024-01-10 09:10:13 +00:00
|
|
|
PKG_VERSION:=2.10
|
2020-04-12 11:51:49 +00:00
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
2024-01-10 09:10:13 +00:00
|
|
|
PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201
|
2020-04-12 11:51:49 +00:00
|
|
|
|
2024-08-28 22:46:30 +00:00
|
|
|
PKG_MAINTAINER:=Sarah Maedel <openwrt@tbspace.de>
|
2020-04-12 11:51:49 +00:00
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
include $(INCLUDE_DIR)/trusted-firmware-a.mk
|
2020-04-12 11:51:49 +00:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
define Trusted-Firmware-A/Default
|
|
|
|
NAME:=Rockchip $(1) SoCs
|
|
|
|
BUILD_TARGET:=rockchip
|
2020-04-12 11:51:49 +00:00
|
|
|
endef
|
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
define Trusted-Firmware-A/rk3328
|
|
|
|
BUILD_SUBTARGET:=armv8
|
|
|
|
PLAT=rk3328
|
2020-04-12 11:51:49 +00:00
|
|
|
endef
|
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
define Trusted-Firmware-A/rk3399
|
|
|
|
BUILD_SUBTARGET:=armv8
|
|
|
|
PLAT:=rk3399
|
2020-04-12 11:51:49 +00:00
|
|
|
endef
|
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
TFA_TARGETS:= \
|
|
|
|
rk3328 \
|
|
|
|
rk3399
|
2020-04-12 11:51:49 +00:00
|
|
|
|
2024-11-29 10:36:46 +00:00
|
|
|
TFA_MAKE_FLAGS+= \
|
|
|
|
$(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments")
|
|
|
|
|
2023-06-25 15:41:35 +00:00
|
|
|
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
|
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
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
|
2020-04-12 11:51:49 +00:00
|
|
|
endef
|
|
|
|
|
2023-06-20 06:29:57 +00:00
|
|
|
$(eval $(call BuildPackage/Trusted-Firmware-A))
|