Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
@ 2020-04-21  9:57 CameronNemo
  2020-09-07  6:10 ` [PR PATCH] [Updated] " CameronNemo
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: CameronNemo @ 2020-04-21  9:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

There is a new pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages atf-rk3399-bl31
https://github.com/void-linux/void-packages/pull/21199

Pinebook Pro U-Boot: use newer ARM Trusted Firmware
@renatoaguiar care to give this a spin?

A patch file from https://github.com/void-linux/void-packages/pull/21199.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-atf-rk3399-bl31-21199.patch --]
[-- Type: text/x-diff, Size: 3019 bytes --]

From c417af20bbf905497e89ff4af57bae346609854c Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:39 -0700
Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.3.

---
 srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 srcpkgs/atf-rk3399-bl31/template

diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template
new file mode 100644
index 00000000000..0f0effb0cfb
--- /dev/null
+++ b/srcpkgs/atf-rk3399-bl31/template
@@ -0,0 +1,27 @@
+# Template file for 'atf-rk3399-bl31'
+pkgname=atf-rk3399-bl31
+version=2.3
+revision=1
+archs="aarch64*"
+wrksrc="trusted-firmware-a-${version}"
+build_style=gnu-makefile
+short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)"
+maintainer="Cameron Nemo <cnemo@tutanota.com>"
+license="BSD-3-Clause"
+homepage="https://developer.trustedfirmware.org/dashboard/view/6/"
+distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz"
+checksum=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21
+nostrip=yes
+
+do_build() {
+	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+	if [ "$CROSS_BUILD" ]; then
+		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
+	fi
+	make ${makejobs} PLAT=rk3399 bl31
+}
+
+do_install() {
+	vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399
+	vlicense docs/license.rst
+}

From a171c0914061be7e318a43e20087de48dc5da923 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:45 -0700
Subject: [PATCH 2/2] pinebookpro-uboot: use atf-rk3399-bl31.

---
 srcpkgs/pinebookpro-uboot/template | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index b1fdd304ed1..f010c16d442 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -2,9 +2,8 @@
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
 version=0.0.20200212
-revision=3
+revision=4
 _commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
-_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
 archs="aarch64*"
 hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc"
 depends="u-boot-tools"
@@ -23,11 +22,6 @@ do_fetch() {
 	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 		touch include/stddef.h
 	fi
-
-	cd "${wrksrc}"
-	git clone https://github.com/ARM-software/arm-trusted-firmware.git
-	cd arm-trusted-firmware
-	git reset --hard ${_commit_atf}
 }
 
 do_configure() {
@@ -44,12 +38,9 @@ do_build() {
 		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
 	fi
 
-	cd arm-trusted-firmware
-	make ${makejobs} PLAT=rk3399
-
-	cd ../pbp-uboot
+	cd pbp-uboot
 	make ${makejobs} EXTRAVERSION=-${revision} \
-	     BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
+	     BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf"
 }
 
 do_install() {

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
@ 2020-09-07  6:10 ` CameronNemo
  2020-09-11 15:55 ` [PR REVIEW] " sgn
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-09-07  6:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

There is an updated pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages atf-rk3399-bl31
https://github.com/void-linux/void-packages/pull/21199

Pinebook Pro U-Boot: use newer ARM Trusted Firmware
@renatoaguiar care to give this a spin?

A patch file from https://github.com/void-linux/void-packages/pull/21199.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-atf-rk3399-bl31-21199.patch --]
[-- Type: text/x-diff, Size: 5775 bytes --]

From 6823b80abee6ef7373fc84a667be8ad70efdffcb Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:39 -0700
Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.3.

---
 srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 srcpkgs/atf-rk3399-bl31/template

diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template
new file mode 100644
index 00000000000..58e3c24209a
--- /dev/null
+++ b/srcpkgs/atf-rk3399-bl31/template
@@ -0,0 +1,27 @@
+# Template file for 'atf-rk3399-bl31'
+pkgname=atf-rk3399-bl31
+version=2.3
+revision=1
+archs="aarch64*"
+wrksrc="trusted-firmware-a-${version}"
+hostmakedepends="cross-arm-none-eabi"
+short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)"
+maintainer="Cameron Nemo <cnemo@tutanota.com>"
+license="BSD-3-Clause"
+homepage="https://developer.trustedfirmware.org/dashboard/view/6/"
+distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz"
+checksum=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21
+nostrip=yes
+
+do_build() {
+	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+	if [ "$CROSS_BUILD" ]; then
+		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
+	fi
+	make ${makejobs} PLAT=rk3399 bl31
+}
+
+do_install() {
+	vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399
+	vlicense docs/license.rst
+}

From 0207127ebe355df2c2da089defe0a87d107c76dd Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:45 -0700
Subject: [PATCH 2/2] pinebookpro-uboot: use upstream release

Switch from forked repo to upstream repo.
Also use the atf-rk3399-bl31 package for ARM trusted firmware blob.
---
 .../patches/sdcard-boot.patch                 | 32 ++++++++++++
 srcpkgs/pinebookpro-uboot/template            | 49 +++++--------------
 2 files changed, 44 insertions(+), 37 deletions(-)
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch

diff --git a/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
new file mode 100644
index 00000000000..fb4ce822ae4
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
@@ -0,0 +1,32 @@
+diff --git configs/pinebook-pro-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig
+index 9a7487b0..59c83396 100644
+--- configs/pinebook-pro-rk3399_defconfig
++++ configs/pinebook-pro-rk3399_defconfig
+@@ -11,7 +11,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
+ CONFIG_SPL_SPI_SUPPORT=y
+ CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro"
+ CONFIG_DEBUG_UART=y
+-CONFIG_BOOTDELAY=3
++CONFIG_BOOTDELAY=1
+ CONFIG_USE_PREBOOT=y
+ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
+ CONFIG_MISC_INIT_R=y
+diff --git include/configs/pinebook-pro-rk3399.h include/configs/pinebook-pro-rk3399.h
+index d478b199..59780bfb 100644
+--- include/configs/pinebook-pro-rk3399.h
++++ include/configs/pinebook-pro-rk3399.h
+@@ -14,6 +14,14 @@
+ 
+ #include <configs/rk3399_common.h>
+ 
++/* On Pinebook Pro, mmc1 is SD and mmc0 is eMMC */
++#if CONFIG_IS_ENABLED(CMD_MMC)
++	#undef BOOT_TARGET_MMC
++	#define BOOT_TARGET_MMC(func) \
++		func(MMC, mmc, 1) \
++		func(MMC, mmc, 0)
++#endif
++
+ #define SDRAM_BANK_SIZE			(2UL << 30)
+ 
+ #define CONFIG_USB_OHCI_NEW
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 7df07bb9a71..4d472d5637d 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -1,38 +1,22 @@
 # Template file for 'pinebookpro-uboot'
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
-version=0.0.20200212
-revision=3
-_commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
-_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
+version=2020.07
+revision=1
 archs="aarch64*"
-hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc"
-depends="u-boot-tools"
+wrksrc="u-boot-${version}"
+hostmakedepends="flex bc dtc python3"
+makedepends="atf-rk3399-bl31"
 short_desc="U-Boot for Pinebook Pro"
 maintainer="Renato Aguiar <renato@renatoaguiar.net>"
 license="GPL-2.0-only, BSD-3-Clause"
-homepage="https://git.eno.space/pbp-uboot"
-
-do_fetch() {
-	mkdir -p "${wrksrc}"
-
-	cd "${wrksrc}"
-	git clone https://git.eno.space/pbp-uboot.git
-	cd pbp-uboot
-	git reset --hard ${_commit_uboot}
-
-	cd "${wrksrc}"
-	git clone https://github.com/ARM-software/arm-trusted-firmware.git
-	cd arm-trusted-firmware
-	git reset --hard ${_commit_atf}
-}
+homepage="https://www.denx.de/wiki/U-Boot/"
+distfiles="ftp://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"
+checksum=c1f5bf9ee6bb6e648edbf19ce2ca9452f614b08a9f886f1a566aa42e8cf05f6a
 
 do_configure() {
 	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
-
-	cd pbp-uboot
-	make ${makejobs} pinebook_pro-rk3399_defconfig
-	echo 'CONFIG_IDENT_STRING=" Voidlinux"' >> .config
+	make ${makejobs} pinebook-pro-rk3399_defconfig
 }
 
 do_build() {
@@ -40,22 +24,13 @@ do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
 	fi
-
-	cd arm-trusted-firmware
-	make ${makejobs} PLAT=rk3399
-
-	cd ../pbp-uboot
 	make ${makejobs} EXTRAVERSION=-${revision} \
-	     BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
+	     BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf"
 }
 
 do_install() {
-	cd pbp-uboot
-	vmkdir boot
-	vinstall idbloader.img 0644 boot
-	vinstall u-boot.itb 0644 boot
-	vinstall "${FILESDIR}/kernel.d/uboot" 750 \
-		 etc/kernel.d/post-install 60-uboot
+	vinstall idbloader.img 0644 usr/lib/pinebookpro-uboot
+	vinstall u-boot.itb 0644 usr/lib/pinebookpro-uboot
 
 	vlicense Licenses/Exceptions
 	vlicense Licenses/OFL.txt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
  2020-09-07  6:10 ` [PR PATCH] [Updated] " CameronNemo
@ 2020-09-11 15:55 ` sgn
  2020-09-11 19:36 ` CameronNemo
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2020-09-11 15:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/21199#discussion_r487137744

Comment:
Can we merge into single package and use sub-packages?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
  2020-09-07  6:10 ` [PR PATCH] [Updated] " CameronNemo
  2020-09-11 15:55 ` [PR REVIEW] " sgn
@ 2020-09-11 19:36 ` CameronNemo
  2020-09-11 19:37 ` CameronNemo
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-09-11 19:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

New review comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/21199#discussion_r487251059

Comment:
We could but it would still mean tying versions of one platform to the other platforms. It is a question of whether the distribution wants to update all of the TF-A binaries at the same time (and presumably all of the u-boot binaries as well, otherwise why bother?), or whether the builds should be kept separate and updated independently. I lean toward the latter because I do not have access to all of the hardware platforms that might be affected by a new release of TF-A. I would feel uncomfort

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (2 preceding siblings ...)
  2020-09-11 19:36 ` CameronNemo
@ 2020-09-11 19:37 ` CameronNemo
  2020-10-06  3:43 ` [PR PATCH] [Updated] " CameronNemo
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-09-11 19:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 736 bytes --]

New review comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/21199#discussion_r487251059

Comment:
We could but it would still mean tying versions of one platform to the other platforms. It is a question of whether the distribution wants to update all of the TF-A binaries at the same time (and presumably all of the u-boot binaries as well, otherwise why bother?), or whether the builds should be kept separate and updated independently.

I lean toward the latter because I do not have access to all of the hardware platforms that might be affected by a new release of TF-A. I would feel uncomfortable updating TF-A if I knew I might be breaking something and had no way to verify.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (3 preceding siblings ...)
  2020-09-11 19:37 ` CameronNemo
@ 2020-10-06  3:43 ` CameronNemo
  2020-10-06  3:58 ` [PR REVIEW] " CameronNemo
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-10-06  3:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

There is an updated pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages atf-rk3399-bl31
https://github.com/void-linux/void-packages/pull/21199

Pinebook Pro U-Boot: use newer ARM Trusted Firmware
@renatoaguiar care to give this a spin?

A patch file from https://github.com/void-linux/void-packages/pull/21199.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-atf-rk3399-bl31-21199.patch --]
[-- Type: text/x-diff, Size: 9090 bytes --]

From a0883256025e7a5ed0282b3263063b4b7dcb5755 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:39 -0700
Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.3.

---
 srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 srcpkgs/atf-rk3399-bl31/template

diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template
new file mode 100644
index 00000000000..58e3c24209a
--- /dev/null
+++ b/srcpkgs/atf-rk3399-bl31/template
@@ -0,0 +1,27 @@
+# Template file for 'atf-rk3399-bl31'
+pkgname=atf-rk3399-bl31
+version=2.3
+revision=1
+archs="aarch64*"
+wrksrc="trusted-firmware-a-${version}"
+hostmakedepends="cross-arm-none-eabi"
+short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)"
+maintainer="Cameron Nemo <cnemo@tutanota.com>"
+license="BSD-3-Clause"
+homepage="https://developer.trustedfirmware.org/dashboard/view/6/"
+distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz"
+checksum=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21
+nostrip=yes
+
+do_build() {
+	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+	if [ "$CROSS_BUILD" ]; then
+		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
+	fi
+	make ${makejobs} PLAT=rk3399 bl31
+}
+
+do_install() {
+	vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399
+	vlicense docs/license.rst
+}

From 53b3d19080bca448e1e175a34ba3a685021db4d1 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:45 -0700
Subject: [PATCH 2/2] pinebookpro-uboot: update to 2010.10.

Switch from forked repo to upstream repo.
Also use the atf-rk3399-bl31 package for ARM trusted firmware blob.
---
 .../files/fcommon-Makefile.patch              | 20 --------
 .../patches/no-delay-autoboot.patch           | 32 ++++++++++++
 .../patches/sdcard-boot.patch                 | 39 +++++++++++++++
 srcpkgs/pinebookpro-uboot/template            | 50 +++++--------------
 4 files changed, 83 insertions(+), 58 deletions(-)
 delete mode 100644 srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch

diff --git a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch b/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
deleted file mode 100644
index d303e90352a..00000000000
--- a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- pbp-uboot/Makefileg	2020-09-12 15:05:30.139856893 +0200
-+++ pbp-uboot/Makefile	2020-09-12 15:06:45.963853869 +0200
-@@ -273,7 +273,7 @@
- 
- HOSTCC       = cc
- HOSTCXX      = c++
--HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
-+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fcommon \
- 		$(if $(CONFIG_TOOLS_DEBUG),-g)
- HOSTCXXFLAGS = -O2
- 
-@@ -413,7 +413,7 @@
- KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
- 
- KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
--		   -Wno-format-security \
-+		   -Wno-format-security -fcommon \
- 		   -fno-builtin -ffreestanding $(CSTD_FLAG)
- KBUILD_CFLAGS	+= -fshort-wchar -fno-strict-aliasing
- KBUILD_AFLAGS   := -D__ASSEMBLY__
diff --git a/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
new file mode 100644
index 00000000000..8b7d262e3e6
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
@@ -0,0 +1,32 @@
+commit e061f5477ee8e8d14267c4ab98dd451d7ce137be
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 09:14:07 2020 -0700
+
+    rockchip: Pinebook Pro: do not delay autoboot
+    
+    Use a key combo for preventing autoboot rather than delaying boot speed.
+    Delaying boot speed on an end user portable device can lead to bad UX.
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git configs/pinebook-pro-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig
+index 9a7487b04f..e9605a0ffd 100644
+--- configs/pinebook-pro-rk3399_defconfig
++++ configs/pinebook-pro-rk3399_defconfig
+@@ -11,7 +11,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
+ CONFIG_SPL_SPI_SUPPORT=y
+ CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro"
+ CONFIG_DEBUG_UART=y
+-CONFIG_BOOTDELAY=3
++CONFIG_BOOTDELAY=0
+ CONFIG_USE_PREBOOT=y
+ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
+ CONFIG_MISC_INIT_R=y
+@@ -87,3 +87,7 @@ CONFIG_VIDEO_ROCKCHIP=y
+ CONFIG_DISPLAY_ROCKCHIP_EDP=y
+ CONFIG_SPL_TINY_MEMSET=y
+ CONFIG_ERRNO_STR=y
++CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds... press q or Ctrl-C to interrupt\n"
++CONFIG_AUTOBOOT_KEYED=y
++CONFIG_AUTOBOOT_STOP_STR="q"
++CONFIG_AUTOBOOT_KEYED_CTRLC=y
diff --git a/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
new file mode 100644
index 00000000000..ea4a85eb248
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
@@ -0,0 +1,39 @@
+commit 265376282a58c71f1ec9215653e98c602524b91c
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 08:37:24 2020 -0700
+
+    rockchip: Pinebook Pro: fix mmc boot ordering
+    
+    On the Pinebook Pro, and perhaps some other boards, the mmc indices are
+    opposite from what is implied by the comment in
+    include/configs/rockchip-common.h.
+    
+    This commit fixes the boot ordering to prioritize the SD card over eMMC.
+    
+    Most distributions of U-Boot that actually target rk3399 boards apply a
+    similar patch, such as Manjaro (shipped by default on PBP) and armbian.
+    
+    https://gitlab.manjaro.org/manjaro-arm/packages/core/uboot-pinebookpro/-/blob/60ed56b9bf8809309ec6252bfc45bca38c2b858a/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch
+    https://github.com/armbian/build/blob/5a2b2c360b9c26ca4bd0d309af7cd3994fd08b7d/patch/u-boot/u-boot-rockchip64-mainline/general-prioritize-sd.patch
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git include/configs/pinebook-pro-rk3399.h include/configs/pinebook-pro-rk3399.h
+index d478b19917..59780bfb0b 100644
+--- include/configs/pinebook-pro-rk3399.h
++++ include/configs/pinebook-pro-rk3399.h
+@@ -14,6 +14,14 @@
+ 
+ #include <configs/rk3399_common.h>
+ 
++/* On Pinebook Pro, mmc1 is SD and mmc0 is eMMC */
++#if CONFIG_IS_ENABLED(CMD_MMC)
++	#undef BOOT_TARGET_MMC
++	#define BOOT_TARGET_MMC(func) \
++		func(MMC, mmc, 1) \
++		func(MMC, mmc, 0)
++#endif
++
+ #define SDRAM_BANK_SIZE			(2UL << 30)
+ 
+ #define CONFIG_USB_OHCI_NEW
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 4aff7de9e65..1a55a6d5715 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -1,39 +1,22 @@
 # Template file for 'pinebookpro-uboot'
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
-version=0.0.20200212
-revision=3
-_commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
-_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
+version=2020.10
+revision=1
 archs="aarch64*"
-hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc"
-depends="u-boot-tools"
+wrksrc="u-boot-${version}"
+hostmakedepends="flex bc dtc python3"
+makedepends="atf-rk3399-bl31"
 short_desc="U-Boot for Pinebook Pro"
 maintainer="Renato Aguiar <renato@renatoaguiar.net>"
 license="GPL-2.0-only, BSD-3-Clause"
-homepage="https://git.eno.space/pbp-uboot"
-
-do_fetch() {
-	mkdir -p "${wrksrc}"
-
-	cd "${wrksrc}"
-	git clone https://git.eno.space/pbp-uboot.git
-	cd pbp-uboot
-	git reset --hard ${_commit_uboot}
-
-	cd "${wrksrc}"
-	git clone https://github.com/ARM-software/arm-trusted-firmware.git
-	cd arm-trusted-firmware
-	git reset --hard ${_commit_atf}
-}
+homepage="https://www.denx.de/wiki/U-Boot/"
+distfiles="https://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"
+checksum=0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622
 
 do_configure() {
 	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
-
-	cd pbp-uboot
-	patch -Np1 -i ${FILESDIR}/fcommon-Makefile.patch
-	make ${makejobs} pinebook_pro-rk3399_defconfig
-	echo 'CONFIG_IDENT_STRING=" Voidlinux"' >> .config
+	make ${makejobs} pinebook-pro-rk3399_defconfig
 }
 
 do_build() {
@@ -41,22 +24,13 @@ do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
 	fi
-
-	cd arm-trusted-firmware
-	make ${makejobs} PLAT=rk3399
-
-	cd ../pbp-uboot
 	make ${makejobs} EXTRAVERSION=-${revision} \
-	     BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
+	     BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf"
 }
 
 do_install() {
-	cd pbp-uboot
-	vmkdir boot
-	vinstall idbloader.img 0644 boot
-	vinstall u-boot.itb 0644 boot
-	vinstall "${FILESDIR}/kernel.d/uboot" 750 \
-		 etc/kernel.d/post-install 60-uboot
+	vinstall idbloader.img 0644 usr/lib/pinebookpro-uboot
+	vinstall u-boot.itb 0644 usr/lib/pinebookpro-uboot
 
 	vlicense Licenses/Exceptions
 	vlicense Licenses/OFL.txt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (4 preceding siblings ...)
  2020-10-06  3:43 ` [PR PATCH] [Updated] " CameronNemo
@ 2020-10-06  3:58 ` CameronNemo
  2020-10-06  4:00 ` CameronNemo
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-10-06  3:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

New review comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/21199#discussion_r499992218

Comment:
@pullmoll unfortunately this gcc10 patch did not apply cleanly to u-boot 2020.10.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Pinebook Pro U-Boot: use newer ARM Trusted Firmware
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (5 preceding siblings ...)
  2020-10-06  3:58 ` [PR REVIEW] " CameronNemo
@ 2020-10-06  4:00 ` CameronNemo
  2020-10-06 10:30 ` [PR REVIEW] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3 pullmoll
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-10-06  4:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

New review comment by CameronNemo on void-packages repository

https://github.com/void-linux/void-packages/pull/21199#discussion_r499992820

Comment:
Can I consider this thread resolved?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (6 preceding siblings ...)
  2020-10-06  4:00 ` CameronNemo
@ 2020-10-06 10:30 ` pullmoll
  2020-10-27  3:05 ` [PR PATCH] [Updated] " CameronNemo
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pullmoll @ 2020-10-06 10:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New review comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/21199#discussion_r500170473

Comment:
Just push as you like I'll take care of fixing for gcc10 again in case it is still required.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (7 preceding siblings ...)
  2020-10-06 10:30 ` [PR REVIEW] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3 pullmoll
@ 2020-10-27  3:05 ` CameronNemo
  2020-11-21 23:43 ` CameronNemo
  2020-11-22 19:42 ` CameronNemo
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-10-27  3:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

There is an updated pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages atf-rk3399-bl31
https://github.com/void-linux/void-packages/pull/21199

Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
@renatoaguiar care to give this a spin?

A patch file from https://github.com/void-linux/void-packages/pull/21199.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-atf-rk3399-bl31-21199.patch --]
[-- Type: text/x-diff, Size: 9431 bytes --]

From e39a0946322130a4bcb9408089d55eaa1c9569e4 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:39 -0700
Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.3.

---
 srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 srcpkgs/atf-rk3399-bl31/template

diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template
new file mode 100644
index 00000000000..58e3c24209a
--- /dev/null
+++ b/srcpkgs/atf-rk3399-bl31/template
@@ -0,0 +1,27 @@
+# Template file for 'atf-rk3399-bl31'
+pkgname=atf-rk3399-bl31
+version=2.3
+revision=1
+archs="aarch64*"
+wrksrc="trusted-firmware-a-${version}"
+hostmakedepends="cross-arm-none-eabi"
+short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)"
+maintainer="Cameron Nemo <cnemo@tutanota.com>"
+license="BSD-3-Clause"
+homepage="https://developer.trustedfirmware.org/dashboard/view/6/"
+distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz"
+checksum=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21
+nostrip=yes
+
+do_build() {
+	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+	if [ "$CROSS_BUILD" ]; then
+		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
+	fi
+	make ${makejobs} PLAT=rk3399 bl31
+}
+
+do_install() {
+	vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399
+	vlicense docs/license.rst
+}

From d257b29102c5acab317de4abd67c729f801385ad Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:45 -0700
Subject: [PATCH 2/2] pinebookpro-uboot: update to 2010.10.

Switch from forked repo to upstream repo.
Also use the atf-rk3399-bl31 package for ARM trusted firmware blob.
---
 .../files/fcommon-Makefile.patch              | 20 -------
 .../patches/no-delay-autoboot.patch           | 32 +++++++++++
 .../patches/sdcard-boot.patch                 | 39 ++++++++++++++
 srcpkgs/pinebookpro-uboot/template            | 54 ++++++-------------
 4 files changed, 88 insertions(+), 57 deletions(-)
 delete mode 100644 srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch

diff --git a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch b/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
deleted file mode 100644
index d303e90352a..00000000000
--- a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- pbp-uboot/Makefileg	2020-09-12 15:05:30.139856893 +0200
-+++ pbp-uboot/Makefile	2020-09-12 15:06:45.963853869 +0200
-@@ -273,7 +273,7 @@
- 
- HOSTCC       = cc
- HOSTCXX      = c++
--HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
-+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fcommon \
- 		$(if $(CONFIG_TOOLS_DEBUG),-g)
- HOSTCXXFLAGS = -O2
- 
-@@ -413,7 +413,7 @@
- KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
- 
- KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
--		   -Wno-format-security \
-+		   -Wno-format-security -fcommon \
- 		   -fno-builtin -ffreestanding $(CSTD_FLAG)
- KBUILD_CFLAGS	+= -fshort-wchar -fno-strict-aliasing
- KBUILD_AFLAGS   := -D__ASSEMBLY__
diff --git a/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
new file mode 100644
index 00000000000..8b7d262e3e6
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
@@ -0,0 +1,32 @@
+commit e061f5477ee8e8d14267c4ab98dd451d7ce137be
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 09:14:07 2020 -0700
+
+    rockchip: Pinebook Pro: do not delay autoboot
+    
+    Use a key combo for preventing autoboot rather than delaying boot speed.
+    Delaying boot speed on an end user portable device can lead to bad UX.
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git configs/pinebook-pro-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig
+index 9a7487b04f..e9605a0ffd 100644
+--- configs/pinebook-pro-rk3399_defconfig
++++ configs/pinebook-pro-rk3399_defconfig
+@@ -11,7 +11,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
+ CONFIG_SPL_SPI_SUPPORT=y
+ CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro"
+ CONFIG_DEBUG_UART=y
+-CONFIG_BOOTDELAY=3
++CONFIG_BOOTDELAY=0
+ CONFIG_USE_PREBOOT=y
+ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
+ CONFIG_MISC_INIT_R=y
+@@ -87,3 +87,7 @@ CONFIG_VIDEO_ROCKCHIP=y
+ CONFIG_DISPLAY_ROCKCHIP_EDP=y
+ CONFIG_SPL_TINY_MEMSET=y
+ CONFIG_ERRNO_STR=y
++CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds... press q or Ctrl-C to interrupt\n"
++CONFIG_AUTOBOOT_KEYED=y
++CONFIG_AUTOBOOT_STOP_STR="q"
++CONFIG_AUTOBOOT_KEYED_CTRLC=y
diff --git a/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
new file mode 100644
index 00000000000..ea4a85eb248
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
@@ -0,0 +1,39 @@
+commit 265376282a58c71f1ec9215653e98c602524b91c
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 08:37:24 2020 -0700
+
+    rockchip: Pinebook Pro: fix mmc boot ordering
+    
+    On the Pinebook Pro, and perhaps some other boards, the mmc indices are
+    opposite from what is implied by the comment in
+    include/configs/rockchip-common.h.
+    
+    This commit fixes the boot ordering to prioritize the SD card over eMMC.
+    
+    Most distributions of U-Boot that actually target rk3399 boards apply a
+    similar patch, such as Manjaro (shipped by default on PBP) and armbian.
+    
+    https://gitlab.manjaro.org/manjaro-arm/packages/core/uboot-pinebookpro/-/blob/60ed56b9bf8809309ec6252bfc45bca38c2b858a/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch
+    https://github.com/armbian/build/blob/5a2b2c360b9c26ca4bd0d309af7cd3994fd08b7d/patch/u-boot/u-boot-rockchip64-mainline/general-prioritize-sd.patch
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git include/configs/pinebook-pro-rk3399.h include/configs/pinebook-pro-rk3399.h
+index d478b19917..59780bfb0b 100644
+--- include/configs/pinebook-pro-rk3399.h
++++ include/configs/pinebook-pro-rk3399.h
+@@ -14,6 +14,14 @@
+ 
+ #include <configs/rk3399_common.h>
+ 
++/* On Pinebook Pro, mmc1 is SD and mmc0 is eMMC */
++#if CONFIG_IS_ENABLED(CMD_MMC)
++	#undef BOOT_TARGET_MMC
++	#define BOOT_TARGET_MMC(func) \
++		func(MMC, mmc, 1) \
++		func(MMC, mmc, 0)
++#endif
++
+ #define SDRAM_BANK_SIZE			(2UL << 30)
+ 
+ #define CONFIG_USB_OHCI_NEW
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 4aff7de9e65..f0cfc075006 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -1,39 +1,22 @@
 # Template file for 'pinebookpro-uboot'
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
-version=0.0.20200212
-revision=3
-_commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
-_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
+version=2020.10
+revision=1
 archs="aarch64*"
-hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc"
-depends="u-boot-tools"
+wrksrc="u-boot-${version}"
+hostmakedepends="flex bc dtc python3"
+makedepends="atf-rk3399-bl31"
 short_desc="U-Boot for Pinebook Pro"
 maintainer="Renato Aguiar <renato@renatoaguiar.net>"
 license="GPL-2.0-only, BSD-3-Clause"
-homepage="https://git.eno.space/pbp-uboot"
-
-do_fetch() {
-	mkdir -p "${wrksrc}"
-
-	cd "${wrksrc}"
-	git clone https://git.eno.space/pbp-uboot.git
-	cd pbp-uboot
-	git reset --hard ${_commit_uboot}
-
-	cd "${wrksrc}"
-	git clone https://github.com/ARM-software/arm-trusted-firmware.git
-	cd arm-trusted-firmware
-	git reset --hard ${_commit_atf}
-}
+homepage="https://www.denx.de/wiki/U-Boot/"
+distfiles="https://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"
+checksum=0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622
 
 do_configure() {
 	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
-
-	cd pbp-uboot
-	patch -Np1 -i ${FILESDIR}/fcommon-Makefile.patch
-	make ${makejobs} pinebook_pro-rk3399_defconfig
-	echo 'CONFIG_IDENT_STRING=" Voidlinux"' >> .config
+	make ${makejobs} pinebook-pro-rk3399_defconfig
 }
 
 do_build() {
@@ -41,22 +24,19 @@ do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
 	fi
-
-	cd arm-trusted-firmware
-	make ${makejobs} PLAT=rk3399
-
-	cd ../pbp-uboot
 	make ${makejobs} EXTRAVERSION=-${revision} \
-	     BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
+	     BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf"
 }
 
 do_install() {
-	cd pbp-uboot
-	vmkdir boot
-	vinstall idbloader.img 0644 boot
-	vinstall u-boot.itb 0644 boot
+	vinstall idbloader.img 0644 usr/lib/pinebookpro-uboot
+	vinstall u-boot.itb 0644 usr/lib/pinebookpro-uboot
+	# FWIW this file is not at all specific to the PBP and will overwrite any custom
+	# u-boot boot.scr files that a user installs into /boot.
+	# I would like to remove it, but it could cause breakage for existing setups.
+	# It would also require some changes to void-mklive to configure u-boot suitably.
 	vinstall "${FILESDIR}/kernel.d/uboot" 750 \
-		 etc/kernel.d/post-install 60-uboot
+		etc/kernel.d/post-install 60-uboot
 
 	vlicense Licenses/Exceptions
 	vlicense Licenses/OFL.txt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (8 preceding siblings ...)
  2020-10-27  3:05 ` [PR PATCH] [Updated] " CameronNemo
@ 2020-11-21 23:43 ` CameronNemo
  2020-11-22 19:42 ` CameronNemo
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-11-21 23:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

There is an updated pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages atf-rk3399-bl31
https://github.com/void-linux/void-packages/pull/21199

Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
@renatoaguiar care to give this a spin?

A patch file from https://github.com/void-linux/void-packages/pull/21199.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-atf-rk3399-bl31-21199.patch --]
[-- Type: text/x-diff, Size: 9431 bytes --]

From 94340233a68f475a2d89e608a666b1d0befe9008 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:39 -0700
Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.4.

---
 srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 srcpkgs/atf-rk3399-bl31/template

diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template
new file mode 100644
index 00000000000..9eb9330fbae
--- /dev/null
+++ b/srcpkgs/atf-rk3399-bl31/template
@@ -0,0 +1,27 @@
+# Template file for 'atf-rk3399-bl31'
+pkgname=atf-rk3399-bl31
+version=2.4
+revision=1
+archs="aarch64*"
+wrksrc="trusted-firmware-a-${version}"
+hostmakedepends="cross-arm-none-eabi"
+short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)"
+maintainer="Cameron Nemo <cnemo@tutanota.com>"
+license="BSD-3-Clause"
+homepage="https://developer.trustedfirmware.org/dashboard/view/6/"
+distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz"
+checksum=bf3eb3617a74cddd7fb0e0eacbfe38c3258ee07d4c8ed730deef7a175cc3d55b
+nostrip=yes
+
+do_build() {
+	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+	if [ "$CROSS_BUILD" ]; then
+		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
+	fi
+	make ${makejobs} PLAT=rk3399 bl31
+}
+
+do_install() {
+	vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399
+	vlicense docs/license.rst
+}

From 5ac5bdee42763d8e87c833e8cff860b4e56d7edf Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:45 -0700
Subject: [PATCH 2/2] pinebookpro-uboot: update to 2010.10.

Switch from forked repo to upstream repo.
Also use the atf-rk3399-bl31 package for ARM trusted firmware blob.
---
 .../files/fcommon-Makefile.patch              | 20 -------
 .../patches/no-delay-autoboot.patch           | 32 +++++++++++
 .../patches/sdcard-boot.patch                 | 39 ++++++++++++++
 srcpkgs/pinebookpro-uboot/template            | 54 ++++++-------------
 4 files changed, 88 insertions(+), 57 deletions(-)
 delete mode 100644 srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch

diff --git a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch b/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
deleted file mode 100644
index d303e90352a..00000000000
--- a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- pbp-uboot/Makefileg	2020-09-12 15:05:30.139856893 +0200
-+++ pbp-uboot/Makefile	2020-09-12 15:06:45.963853869 +0200
-@@ -273,7 +273,7 @@
- 
- HOSTCC       = cc
- HOSTCXX      = c++
--HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
-+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fcommon \
- 		$(if $(CONFIG_TOOLS_DEBUG),-g)
- HOSTCXXFLAGS = -O2
- 
-@@ -413,7 +413,7 @@
- KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
- 
- KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
--		   -Wno-format-security \
-+		   -Wno-format-security -fcommon \
- 		   -fno-builtin -ffreestanding $(CSTD_FLAG)
- KBUILD_CFLAGS	+= -fshort-wchar -fno-strict-aliasing
- KBUILD_AFLAGS   := -D__ASSEMBLY__
diff --git a/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
new file mode 100644
index 00000000000..8b7d262e3e6
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
@@ -0,0 +1,32 @@
+commit e061f5477ee8e8d14267c4ab98dd451d7ce137be
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 09:14:07 2020 -0700
+
+    rockchip: Pinebook Pro: do not delay autoboot
+    
+    Use a key combo for preventing autoboot rather than delaying boot speed.
+    Delaying boot speed on an end user portable device can lead to bad UX.
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git configs/pinebook-pro-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig
+index 9a7487b04f..e9605a0ffd 100644
+--- configs/pinebook-pro-rk3399_defconfig
++++ configs/pinebook-pro-rk3399_defconfig
+@@ -11,7 +11,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
+ CONFIG_SPL_SPI_SUPPORT=y
+ CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro"
+ CONFIG_DEBUG_UART=y
+-CONFIG_BOOTDELAY=3
++CONFIG_BOOTDELAY=0
+ CONFIG_USE_PREBOOT=y
+ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
+ CONFIG_MISC_INIT_R=y
+@@ -87,3 +87,7 @@ CONFIG_VIDEO_ROCKCHIP=y
+ CONFIG_DISPLAY_ROCKCHIP_EDP=y
+ CONFIG_SPL_TINY_MEMSET=y
+ CONFIG_ERRNO_STR=y
++CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds... press q or Ctrl-C to interrupt\n"
++CONFIG_AUTOBOOT_KEYED=y
++CONFIG_AUTOBOOT_STOP_STR="q"
++CONFIG_AUTOBOOT_KEYED_CTRLC=y
diff --git a/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
new file mode 100644
index 00000000000..ea4a85eb248
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
@@ -0,0 +1,39 @@
+commit 265376282a58c71f1ec9215653e98c602524b91c
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 08:37:24 2020 -0700
+
+    rockchip: Pinebook Pro: fix mmc boot ordering
+    
+    On the Pinebook Pro, and perhaps some other boards, the mmc indices are
+    opposite from what is implied by the comment in
+    include/configs/rockchip-common.h.
+    
+    This commit fixes the boot ordering to prioritize the SD card over eMMC.
+    
+    Most distributions of U-Boot that actually target rk3399 boards apply a
+    similar patch, such as Manjaro (shipped by default on PBP) and armbian.
+    
+    https://gitlab.manjaro.org/manjaro-arm/packages/core/uboot-pinebookpro/-/blob/60ed56b9bf8809309ec6252bfc45bca38c2b858a/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch
+    https://github.com/armbian/build/blob/5a2b2c360b9c26ca4bd0d309af7cd3994fd08b7d/patch/u-boot/u-boot-rockchip64-mainline/general-prioritize-sd.patch
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git include/configs/pinebook-pro-rk3399.h include/configs/pinebook-pro-rk3399.h
+index d478b19917..59780bfb0b 100644
+--- include/configs/pinebook-pro-rk3399.h
++++ include/configs/pinebook-pro-rk3399.h
+@@ -14,6 +14,14 @@
+ 
+ #include <configs/rk3399_common.h>
+ 
++/* On Pinebook Pro, mmc1 is SD and mmc0 is eMMC */
++#if CONFIG_IS_ENABLED(CMD_MMC)
++	#undef BOOT_TARGET_MMC
++	#define BOOT_TARGET_MMC(func) \
++		func(MMC, mmc, 1) \
++		func(MMC, mmc, 0)
++#endif
++
+ #define SDRAM_BANK_SIZE			(2UL << 30)
+ 
+ #define CONFIG_USB_OHCI_NEW
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 4aff7de9e65..f0cfc075006 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -1,39 +1,22 @@
 # Template file for 'pinebookpro-uboot'
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
-version=0.0.20200212
-revision=3
-_commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
-_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
+version=2020.10
+revision=1
 archs="aarch64*"
-hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc"
-depends="u-boot-tools"
+wrksrc="u-boot-${version}"
+hostmakedepends="flex bc dtc python3"
+makedepends="atf-rk3399-bl31"
 short_desc="U-Boot for Pinebook Pro"
 maintainer="Renato Aguiar <renato@renatoaguiar.net>"
 license="GPL-2.0-only, BSD-3-Clause"
-homepage="https://git.eno.space/pbp-uboot"
-
-do_fetch() {
-	mkdir -p "${wrksrc}"
-
-	cd "${wrksrc}"
-	git clone https://git.eno.space/pbp-uboot.git
-	cd pbp-uboot
-	git reset --hard ${_commit_uboot}
-
-	cd "${wrksrc}"
-	git clone https://github.com/ARM-software/arm-trusted-firmware.git
-	cd arm-trusted-firmware
-	git reset --hard ${_commit_atf}
-}
+homepage="https://www.denx.de/wiki/U-Boot/"
+distfiles="https://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"
+checksum=0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622
 
 do_configure() {
 	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
-
-	cd pbp-uboot
-	patch -Np1 -i ${FILESDIR}/fcommon-Makefile.patch
-	make ${makejobs} pinebook_pro-rk3399_defconfig
-	echo 'CONFIG_IDENT_STRING=" Voidlinux"' >> .config
+	make ${makejobs} pinebook-pro-rk3399_defconfig
 }
 
 do_build() {
@@ -41,22 +24,19 @@ do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
 	fi
-
-	cd arm-trusted-firmware
-	make ${makejobs} PLAT=rk3399
-
-	cd ../pbp-uboot
 	make ${makejobs} EXTRAVERSION=-${revision} \
-	     BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
+	     BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf"
 }
 
 do_install() {
-	cd pbp-uboot
-	vmkdir boot
-	vinstall idbloader.img 0644 boot
-	vinstall u-boot.itb 0644 boot
+	vinstall idbloader.img 0644 usr/lib/pinebookpro-uboot
+	vinstall u-boot.itb 0644 usr/lib/pinebookpro-uboot
+	# FWIW this file is not at all specific to the PBP and will overwrite any custom
+	# u-boot boot.scr files that a user installs into /boot.
+	# I would like to remove it, but it could cause breakage for existing setups.
+	# It would also require some changes to void-mklive to configure u-boot suitably.
 	vinstall "${FILESDIR}/kernel.d/uboot" 750 \
-		 etc/kernel.d/post-install 60-uboot
+		etc/kernel.d/post-install 60-uboot
 
 	vlicense Licenses/Exceptions
 	vlicense Licenses/OFL.txt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
  2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
                   ` (9 preceding siblings ...)
  2020-11-21 23:43 ` CameronNemo
@ 2020-11-22 19:42 ` CameronNemo
  10 siblings, 0 replies; 12+ messages in thread
From: CameronNemo @ 2020-11-22 19:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

There is an updated pull request by CameronNemo against master on the void-packages repository

https://github.com/CameronNemo/void-packages atf-rk3399-bl31
https://github.com/void-linux/void-packages/pull/21199

Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3
@renatoaguiar care to give this a spin?

A patch file from https://github.com/void-linux/void-packages/pull/21199.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-atf-rk3399-bl31-21199.patch --]
[-- Type: text/x-diff, Size: 9431 bytes --]

From 94340233a68f475a2d89e608a666b1d0befe9008 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:39 -0700
Subject: [PATCH 1/2] New Package: atf-rk3399-bl31-2.4.

---
 srcpkgs/atf-rk3399-bl31/template | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 srcpkgs/atf-rk3399-bl31/template

diff --git a/srcpkgs/atf-rk3399-bl31/template b/srcpkgs/atf-rk3399-bl31/template
new file mode 100644
index 00000000000..9eb9330fbae
--- /dev/null
+++ b/srcpkgs/atf-rk3399-bl31/template
@@ -0,0 +1,27 @@
+# Template file for 'atf-rk3399-bl31'
+pkgname=atf-rk3399-bl31
+version=2.4
+revision=1
+archs="aarch64*"
+wrksrc="trusted-firmware-a-${version}"
+hostmakedepends="cross-arm-none-eabi"
+short_desc="ARM Trusted Firmware for Rockchip rk3399 boards (ARMv8, bl31 option)"
+maintainer="Cameron Nemo <cnemo@tutanota.com>"
+license="BSD-3-Clause"
+homepage="https://developer.trustedfirmware.org/dashboard/view/6/"
+distfiles="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/trusted-firmware-a-${version}.tar.gz"
+checksum=bf3eb3617a74cddd7fb0e0eacbfe38c3258ee07d4c8ed730deef7a175cc3d55b
+nostrip=yes
+
+do_build() {
+	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+	if [ "$CROSS_BUILD" ]; then
+		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
+	fi
+	make ${makejobs} PLAT=rk3399 bl31
+}
+
+do_install() {
+	vinstall build/rk3399/release/bl31/bl31.elf 0755 usr/lib/trusted-firmware-a/rk3399
+	vlicense docs/license.rst
+}

From 6d2cd4b2ad066acde9f2c5bca8a405c566413758 Mon Sep 17 00:00:00 2001
From: Cameron Nemo <cnemo@tutanota.com>
Date: Tue, 21 Apr 2020 02:55:45 -0700
Subject: [PATCH 2/2] pinebookpro-uboot: update to 2010.10.

Switch from forked repo to upstream repo.
Also use the atf-rk3399-bl31 package for ARM trusted firmware blob.
---
 .../files/fcommon-Makefile.patch              | 20 -------
 .../patches/no-delay-autoboot.patch           | 32 +++++++++++
 .../patches/sdcard-boot.patch                 | 39 ++++++++++++++
 srcpkgs/pinebookpro-uboot/template            | 53 ++++++-------------
 4 files changed, 88 insertions(+), 56 deletions(-)
 delete mode 100644 srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
 create mode 100644 srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch

diff --git a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch b/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
deleted file mode 100644
index d303e90352a..00000000000
--- a/srcpkgs/pinebookpro-uboot/files/fcommon-Makefile.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- pbp-uboot/Makefileg	2020-09-12 15:05:30.139856893 +0200
-+++ pbp-uboot/Makefile	2020-09-12 15:06:45.963853869 +0200
-@@ -273,7 +273,7 @@
- 
- HOSTCC       = cc
- HOSTCXX      = c++
--HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
-+HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fcommon \
- 		$(if $(CONFIG_TOOLS_DEBUG),-g)
- HOSTCXXFLAGS = -O2
- 
-@@ -413,7 +413,7 @@
- KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
- 
- KBUILD_CFLAGS   := -Wall -Wstrict-prototypes \
--		   -Wno-format-security \
-+		   -Wno-format-security -fcommon \
- 		   -fno-builtin -ffreestanding $(CSTD_FLAG)
- KBUILD_CFLAGS	+= -fshort-wchar -fno-strict-aliasing
- KBUILD_AFLAGS   := -D__ASSEMBLY__
diff --git a/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
new file mode 100644
index 00000000000..8b7d262e3e6
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/no-delay-autoboot.patch
@@ -0,0 +1,32 @@
+commit e061f5477ee8e8d14267c4ab98dd451d7ce137be
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 09:14:07 2020 -0700
+
+    rockchip: Pinebook Pro: do not delay autoboot
+    
+    Use a key combo for preventing autoboot rather than delaying boot speed.
+    Delaying boot speed on an end user portable device can lead to bad UX.
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git configs/pinebook-pro-rk3399_defconfig configs/pinebook-pro-rk3399_defconfig
+index 9a7487b04f..e9605a0ffd 100644
+--- configs/pinebook-pro-rk3399_defconfig
++++ configs/pinebook-pro-rk3399_defconfig
+@@ -11,7 +11,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
+ CONFIG_SPL_SPI_SUPPORT=y
+ CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro"
+ CONFIG_DEBUG_UART=y
+-CONFIG_BOOTDELAY=3
++CONFIG_BOOTDELAY=0
+ CONFIG_USE_PREBOOT=y
+ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"
+ CONFIG_MISC_INIT_R=y
+@@ -87,3 +87,7 @@ CONFIG_VIDEO_ROCKCHIP=y
+ CONFIG_DISPLAY_ROCKCHIP_EDP=y
+ CONFIG_SPL_TINY_MEMSET=y
+ CONFIG_ERRNO_STR=y
++CONFIG_AUTOBOOT_PROMPT="Autobooting in %d seconds... press q or Ctrl-C to interrupt\n"
++CONFIG_AUTOBOOT_KEYED=y
++CONFIG_AUTOBOOT_STOP_STR="q"
++CONFIG_AUTOBOOT_KEYED_CTRLC=y
diff --git a/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
new file mode 100644
index 00000000000..ea4a85eb248
--- /dev/null
+++ b/srcpkgs/pinebookpro-uboot/patches/sdcard-boot.patch
@@ -0,0 +1,39 @@
+commit 265376282a58c71f1ec9215653e98c602524b91c
+Author: Cameron Nemo <cnemo@tutanota.com>
+Date:   Mon Sep 7 08:37:24 2020 -0700
+
+    rockchip: Pinebook Pro: fix mmc boot ordering
+    
+    On the Pinebook Pro, and perhaps some other boards, the mmc indices are
+    opposite from what is implied by the comment in
+    include/configs/rockchip-common.h.
+    
+    This commit fixes the boot ordering to prioritize the SD card over eMMC.
+    
+    Most distributions of U-Boot that actually target rk3399 boards apply a
+    similar patch, such as Manjaro (shipped by default on PBP) and armbian.
+    
+    https://gitlab.manjaro.org/manjaro-arm/packages/core/uboot-pinebookpro/-/blob/60ed56b9bf8809309ec6252bfc45bca38c2b858a/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch
+    https://github.com/armbian/build/blob/5a2b2c360b9c26ca4bd0d309af7cd3994fd08b7d/patch/u-boot/u-boot-rockchip64-mainline/general-prioritize-sd.patch
+    
+    Signed-off-by: Cameron Nemo <cnemo@tutanota.com>
+
+diff --git include/configs/pinebook-pro-rk3399.h include/configs/pinebook-pro-rk3399.h
+index d478b19917..59780bfb0b 100644
+--- include/configs/pinebook-pro-rk3399.h
++++ include/configs/pinebook-pro-rk3399.h
+@@ -14,6 +14,14 @@
+ 
+ #include <configs/rk3399_common.h>
+ 
++/* On Pinebook Pro, mmc1 is SD and mmc0 is eMMC */
++#if CONFIG_IS_ENABLED(CMD_MMC)
++	#undef BOOT_TARGET_MMC
++	#define BOOT_TARGET_MMC(func) \
++		func(MMC, mmc, 1) \
++		func(MMC, mmc, 0)
++#endif
++
+ #define SDRAM_BANK_SIZE			(2UL << 30)
+ 
+ #define CONFIG_USB_OHCI_NEW
diff --git a/srcpkgs/pinebookpro-uboot/template b/srcpkgs/pinebookpro-uboot/template
index 4aff7de9e65..db629c4a8e5 100644
--- a/srcpkgs/pinebookpro-uboot/template
+++ b/srcpkgs/pinebookpro-uboot/template
@@ -1,39 +1,23 @@
 # Template file for 'pinebookpro-uboot'
 pkgname=pinebookpro-uboot
 reverts="20200212_1 20200212_2"
-version=0.0.20200212
-revision=3
-_commit_uboot=365495a329c8e92ca4c134562d091df71b75845e
-_commit_atf=22d12c4148c373932a7a81e5d1c59a767e143ac2
+version=2020.10
+revision=1
 archs="aarch64*"
-hostmakedepends="git flex cross-arm-none-eabi dtc python3 bc"
+wrksrc="u-boot-${version}"
+hostmakedepends="flex bc dtc python3"
+makedepends="atf-rk3399-bl31"
 depends="u-boot-tools"
 short_desc="U-Boot for Pinebook Pro"
 maintainer="Renato Aguiar <renato@renatoaguiar.net>"
 license="GPL-2.0-only, BSD-3-Clause"
-homepage="https://git.eno.space/pbp-uboot"
-
-do_fetch() {
-	mkdir -p "${wrksrc}"
-
-	cd "${wrksrc}"
-	git clone https://git.eno.space/pbp-uboot.git
-	cd pbp-uboot
-	git reset --hard ${_commit_uboot}
-
-	cd "${wrksrc}"
-	git clone https://github.com/ARM-software/arm-trusted-firmware.git
-	cd arm-trusted-firmware
-	git reset --hard ${_commit_atf}
-}
+homepage="https://www.denx.de/wiki/U-Boot/"
+distfiles="https://ftp.denx.de/pub/u-boot/u-boot-${version}.tar.bz2"
+checksum=0d481bbdc05c0ee74908ec2f56a6daa53166cc6a78a0e4fac2ac5d025770a622
 
 do_configure() {
 	unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
-
-	cd pbp-uboot
-	patch -Np1 -i ${FILESDIR}/fcommon-Makefile.patch
-	make ${makejobs} pinebook_pro-rk3399_defconfig
-	echo 'CONFIG_IDENT_STRING=" Voidlinux"' >> .config
+	make ${makejobs} pinebook-pro-rk3399_defconfig
 }
 
 do_build() {
@@ -41,22 +25,19 @@ do_build() {
 	if [ "$CROSS_BUILD" ]; then
 		export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
 	fi
-
-	cd arm-trusted-firmware
-	make ${makejobs} PLAT=rk3399
-
-	cd ../pbp-uboot
 	make ${makejobs} EXTRAVERSION=-${revision} \
-	     BL31=../arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
+	     BL31="${XBPS_CROSS_BASE}/usr/lib/trusted-firmware-a/rk3399/bl31.elf"
 }
 
 do_install() {
-	cd pbp-uboot
-	vmkdir boot
-	vinstall idbloader.img 0644 boot
-	vinstall u-boot.itb 0644 boot
+	vinstall idbloader.img 0644 usr/lib/pinebookpro-uboot
+	vinstall u-boot.itb 0644 usr/lib/pinebookpro-uboot
+	# FWIW this file is not at all specific to the PBP and will overwrite any custom
+	# u-boot boot.scr files that a user installs into /boot.
+	# I would like to remove it, but it could cause breakage for existing setups.
+	# It would also require some changes to void-mklive to configure u-boot suitably.
 	vinstall "${FILESDIR}/kernel.d/uboot" 750 \
-		 etc/kernel.d/post-install 60-uboot
+		etc/kernel.d/post-install 60-uboot
 
 	vlicense Licenses/Exceptions
 	vlicense Licenses/OFL.txt

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-11-22 19:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21  9:57 [PR PATCH] Pinebook Pro U-Boot: use newer ARM Trusted Firmware CameronNemo
2020-09-07  6:10 ` [PR PATCH] [Updated] " CameronNemo
2020-09-11 15:55 ` [PR REVIEW] " sgn
2020-09-11 19:36 ` CameronNemo
2020-09-11 19:37 ` CameronNemo
2020-10-06  3:43 ` [PR PATCH] [Updated] " CameronNemo
2020-10-06  3:58 ` [PR REVIEW] " CameronNemo
2020-10-06  4:00 ` CameronNemo
2020-10-06 10:30 ` [PR REVIEW] Pinebook Pro U-Boot: update to 2020.10, TF-A 2.3 pullmoll
2020-10-27  3:05 ` [PR PATCH] [Updated] " CameronNemo
2020-11-21 23:43 ` CameronNemo
2020-11-22 19:42 ` CameronNemo

Github messages for voidlinux

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/voidlinux-github

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 voidlinux-github voidlinux-github/ http://inbox.vuxu.org/voidlinux-github \
		voidlinux-github@inbox.vuxu.org
	public-inbox-index voidlinux-github

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.voidlinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git