Subject: [PATCH v2 1/2] main/arm-trusted-firmware: build for sun50i_h6 and upgrade to 2.5

From: Maxim Karasev <[email-masked]>
Date: Tue, 8 Jun 2021 03:14:38 +0300

This will allow to add support for H6 devices to alpine's u-boot package
and make this process simplier for other SoCs.
---
 main/arm-trusted-firmware/APKBUILD | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/main/arm-trusted-firmware/APKBUILD b/main/arm-trusted-firmware/APKBUILD
index 472a1f3421..5e196aa1e0 100644
--- a/main/arm-trusted-firmware/APKBUILD
+++ b/main/arm-trusted-firmware/APKBUILD
@@ -1,33 +1,34 @@
 # Contributor: Milan P. Stanić <[email-masked]>
+# Contributor: Maxim Karasev <[email-masked]>
 # Maintainer: Bart Ribbers <[email-masked]>
 pkgname=arm-trusted-firmware
-pkgver=2.3
+pkgver=2.5
 pkgrel=0
 pkgdesc="ARM Trusted Firmware-A (TF-A)"
 url="https://github.com/ARM-software/arm-trusted-firmware"
 arch="aarch64"
 license="BSD-3-Clause"
 makedepends="dtc openssl-dev"
-subpackages="$pkgname-sun50i"
 source="https://github.com/ARM-software/arm-trusted-firmware/archive/v$pkgver/arm-trusted-firmware-v$pkgver.tar.gz
-	rk3399-baudrate.patch
-	"
+	rk3399-baudrate.patch"
 options="!check" # No tests
 
+_plats="sun50i_a64 sun50i_h6"
+
 build() {
 	unset LDFLAGS
-	make PLAT=sun50i_a64 bl31
+	for plat in $_plats; do
+		make PLAT=$plat bl31
+	done
 }
 
 package() {
-	mkdir -p "$pkgdir"/usr/share/$pkgname
-}
-sun50i() {
-	pkgdesc="ARM Trusted Firmware-A for sun50i"
-
-	mkdir -p "$subpkgdir"/usr/share/$subpkgname
-	install "$builddir"/build/sun50i_a64/release/bl31.bin "$subpkgdir"/usr/share/$subpkgname/
+	for plat in $_plats; do
+		install -D "$builddir"/build/$plat/release/bl31.bin "$pkgdir"/usr/share/$pkgname/$plat/bl31.bin
+	done
 }
 
-sha512sums="c7d65e3d7cb9ee4502beac1a9e2e4e1c9f8d439412c457ee6a24e391ddba0b9becda8f1ed2c1356d92a5c0615b943b59f4e15686e6a4648d944d6bf2c060a957  arm-trusted-firmware-v2.3.tar.gz
-86d8c60157145ab05e9b870aad11d2acaf2137ba00bf71419f8a54a4fd2b1906c19bc8bfeccc735344d1dcf11ba81bd9396bfd8854cdb972a72503b632d1e900  rk3399-baudrate.patch"
+sha512sums="
+3c99f1d849c3c536e8e2e4838ee48a1a431f0bef35eaf27eb14f9caebde71a577589b10efbbd7db49bed3b9763bed46583d0b26e72f61fcd0d34cc46ff684846  arm-trusted-firmware-v2.5.tar.gz
+86d8c60157145ab05e9b870aad11d2acaf2137ba00bf71419f8a54a4fd2b1906c19bc8bfeccc735344d1dcf11ba81bd9396bfd8854cdb972a72503b632d1e900  rk3399-baudrate.patch
+"
-- 
2.32.0

---

From: Maxim Karasev <[email-masked]>
Date: Tue, 8 Jun 2021 03:14:40 +0300

---
 main/u-boot/APKBUILD | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/main/u-boot/APKBUILD b/main/u-boot/APKBUILD
index b6f5ab4dfa..bcf5a1ba45 100644
--- a/main/u-boot/APKBUILD
+++ b/main/u-boot/APKBUILD
@@ -1,9 +1,10 @@
 # Contributor: He Yangxuan <[email-masked]>
 # Contributor: Timo Teras <[email-masked]>
+# Contributor: Maxim Karasev <[email-masked]>
 # Maintainer: Milan P. Stanić <[email-masked]>
 pkgname=u-boot
 pkgver=2021.04
-pkgrel=0
+pkgrel=1
 pkgdesc="u-boot bootloader common files"
 url="https://www.denx.de/wiki/U-Boot/"
 arch="all !s390x !ppc64le"
@@ -12,7 +13,7 @@ license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs
 makedepends="$depends_dev bc dtc python3-dev swig bison flex openssl-dev
 	py3-setuptools linux-headers"
 if [ "$CARCH" = "aarch64" ]; then
-	makedepends="$makedepends arm-trusted-firmware-sun50i"
+	makedepends="$makedepends arm-trusted-firmware"
 fi
 source="https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
 	README.txt
@@ -44,6 +45,7 @@ aarch64) board_configs="
 	qemu:qemu_arm64
 	pine64:pine64-lts
 	pinebook:pinebook
+	orangepi:orangepi_3
 	";;
 esac
 
@@ -71,7 +73,10 @@ build() {
 
 			case "$board" in
 				"pine64-lts"|"pinebook")
-					export BL31="/usr/share/arm-trusted-firmware-sun50i/bl31.bin"
+					export BL31="/usr/share/arm-trusted-firmware/sun50i_a64/bl31.bin"
+					;;
+				"orangepi_3")
+					export BL31="/usr/share/arm-trusted-firmware/sun50i_h6/bl31.bin"
 					;;
 			esac
 
-- 
2.32.0