GNU bug report logs - #70131
[PATCH 0/5] Add bootloaders and update U-Boot.

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Mon, 1 Apr 2024 20:21:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 70131 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 01 Apr 2024 20:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Herman Rimm <herman <at> rimm.ee>:
New bug report received and forwarded. Copy sent to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org. (Mon, 01 Apr 2024 20:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: guix-patches <at> gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH 0/5] Add bootloaders and update U-Boot.
Date: Mon,  1 Apr 2024 22:20:11 +0200
Hello,

Besides the bootloader, there is a patch for my Nano Pi R4S variant. For
the new U-Boot release, kwbimage now enables openssl. Disabling kwbimage
makes the sandbox tests fail. I disabled the tests and have not
investigated further. The new release adds support for the Orange Pi
Zero 2W, for which I also added a bootloader. Along the way I upgraded
the ATF package, though I don't think it's required for the Zero 2W.

Cheers,
Herman

Herman Rimm (5):
  gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
  gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
  gnu: firmware: Update make-arm-trusted-firmware to 2.10.
  gnu: u-boot: Update to 2024.04-rc5.
  gnu: bootloader: Add orangepi-zero2w bootloader.

 gnu/bootloader/u-boot.scm                     |  24 +++-
 gnu/local.mk                                  |   4 +-
 gnu/packages/bootloaders.scm                  |  66 ++++++++--
 gnu/packages/firmware.scm                     |  11 +-
 .../u-boot-build-without-libcrypto.patch      | 123 ------------------
 .../patches/u-boot-nanopi-r4s-ddr3.patch      |  25 ++++
 6 files changed, 110 insertions(+), 143 deletions(-)
 delete mode 100644 gnu/packages/patches/u-boot-build-without-libcrypto.patch
 create mode 100644 gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch


base-commit: a17976e975001d3e95c998f1196a39bbb432de4f
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 01 Apr 2024 20:24:03 GMT) Full text and rfc822 format available.

Message #8 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH 1/5] gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
Date: Mon,  1 Apr 2024 22:22:29 +0200
* gnu/bootloader/u-boot.scm (install-nanopi-r4s-rk3399-u-boot,
u-boot-nanopi-r4s-rk3399-bootloader): Add variable.
* gnu/packages/bootloaders.scm (u-boot-nanopi-r4s-rk3399): Add variable.

Change-Id: I6d4cb098727fe4027aea33a39c59d34000dfc4db
---
 gnu/bootloader/u-boot.scm    | 18 +++++++++++++++++-
 gnu/packages/bootloaders.scm | 17 ++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index d20aabd538..4d0f7ead96 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2023 Efraim Flashner <efraim <at> flashner.co.il>
-;;; Copyright © 2023 Herman Rimm <herman_rimm <at> protonmail.com>
+;;; Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +36,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-cubietruck-bootloader
             u-boot-firefly-rk3399-bootloader
             u-boot-mx6cuboxi-bootloader
+            u-boot-nanopi-r4s-rk3399-bootloader
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
             u-boot-orangepi-r1-plus-lts-rk3328-bootloader
@@ -95,6 +96,15 @@ (define install-imx-u-boot
         (write-file-on-device u-boot (stat:size (stat u-boot))
                               image (* 69 1024)))))
 
+(define install-nanopi-r4s-rk3399-u-boot
+  #~(lambda (bootloader root-index image)
+      (let ((spl (string-append bootloader "/libexec/idbloader.img"))
+            (u-boot (string-append bootloader "/libexec/u-boot.itb")))
+        (write-file-on-device spl (stat:size (stat spl))
+                              image (* 64 512))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              image (* 16384 512)))))
+
 (define install-orangepi-r1-plus-lts-rk3328-u-boot
   #~(lambda (bootloader root-index image)
       (let ((idb (string-append bootloader "/libexec/idbloader.img"))
@@ -244,6 +254,12 @@ (define u-boot-novena-bootloader
    (inherit u-boot-imx-bootloader)
    (package u-boot-novena)))
 
+(define u-boot-nanopi-r4s-rk3399-bootloader
+  (bootloader
+   (inherit u-boot-bootloader)
+   (package u-boot-nanopi-r4s-rk3399)
+   (disk-image-installer install-nanopi-r4s-rk3399-u-boot)))
+
 (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader
   (bootloader
    (inherit u-boot-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index cfe8046731..d1bf0fcd98 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -18,7 +18,7 @@
 ;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
 ;;; Copyright © 2021 Stefan <stefan-guix <at> vodafonemail.de>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
-;;; Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+;;; Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1210,6 +1210,21 @@ (define-public u-boot-novena
 version, contrary to Novena upstream, does not load u-boot.img from the first
 partition."))
 
+(define-public u-boot-nanopi-r4s-rk3399
+  (let ((base (make-u-boot-package "nanopi-r4s-rk3399" "aarch64-linux-gnu")))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (setenv "BL31" (search-input-file inputs "/bl31.elf"))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         (append arm-trusted-firmware-rk3399))))))
+
 (define-public u-boot-orangepi-r1-plus-lts-rk3328
   (let ((base (make-u-boot-package "orangepi-r1-plus-lts-rk3328" "aarch64-linux-gnu")))
     (package
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 01 Apr 2024 20:24:03 GMT) Full text and rfc822 format available.

Message #11 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH 2/5] gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
Date: Mon,  1 Apr 2024 22:22:30 +0200
* gnu/packages/bootloaders.scm (%u-boot-nanopi-r4s-ddr3-patch): Add
variable.
(u-boot)[source]: Use patch.
* gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register patch.

Change-Id: Ibbf952f2806c9cac7fc29e1264d427bf6ee67d01
---
 gnu/local.mk                                  |  3 ++-
 gnu/packages/bootloaders.scm                  |  7 +++++-
 .../patches/u-boot-nanopi-r4s-ddr3.patch      | 25 +++++++++++++++++++
 3 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f2b480bded..3c29b4a2b7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -62,7 +62,7 @@
 # Copyright © 2023 B. Wilson <elaexuotee <at> wilsonb.com>
 # Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 # Copyright © 2023 gemmaro <gemmaro.dev <at> gmail.com>
-# Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+# Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 # Copyright © 2023 Troy Figiel <troy <at> troyfigiel.com>
 # Copyright © 2024 David Elsing <david.elsing <at> posteo.net>
 #
@@ -2125,6 +2125,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/u-boot-build-without-libcrypto.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
+  %D%/packages/patches/u-boot-nanopi-r4s-ddr3.patch		\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
   %D%/packages/patches/ultrastar-deluxe-no-freesans.patch		\
   %D%/packages/patches/ungoogled-chromium-extension-search-path.patch	\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index d1bf0fcd98..9443de0a1d 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -720,6 +720,10 @@ (define %u-boot-build-without-libcrypto-patch
   ;; Upstream commit to fix Amlogic builds in u-boot 2024.01.
   (search-patch "u-boot-build-without-libcrypto.patch"))
 
+(define %u-boot-nanopi-r4s-ddr3-patch
+  ;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
+  (search-patch "u-boot-nanopi-r4s-ddr3.patch"))
+
 (define u-boot
   (package
     (name "u-boot")
@@ -728,7 +732,8 @@ (define u-boot
               (patches
                (list %u-boot-rockchip-inno-usb-patch
                      %u-boot-build-without-libcrypto-patch
-                     %u-boot-allow-disabling-openssl-patch))
+                     %u-boot-allow-disabling-openssl-patch
+                     %u-boot-nanopi-r4s-ddr3-patch))
               (method url-fetch)
               (uri (string-append
                     "https://ftp.denx.de/pub/u-boot/"
diff --git a/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
new file mode 100644
index 0000000000..3c4f5efaf4
--- /dev/null
+++ b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
@@ -0,0 +1,25 @@
+diff --git a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+index 69800cc368..a3054849f8 100644
+--- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
++++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+@@ -13,7 +13,7 @@
+  */
+ 
+ #include "rk3399-nanopi4-u-boot.dtsi"
+-#include "rk3399-sdram-lpddr4-100.dtsi"
++#include "rk3399-sdram-ddr3-1866.dtsi"
+ 
+ / {
+ 	smbios {
+diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
+index 4f4363cb0f..bfa7ee628d 100644
+--- a/configs/nanopi-r4s-rk3399_defconfig
++++ b/configs/nanopi-r4s-rk3399_defconfig
+@@ -54,7 +54,6 @@ CONFIG_PMIC_RK8XX=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_REGULATOR_RK8XX=y
+ CONFIG_PWM_ROCKCHIP=y
+-CONFIG_RAM_ROCKCHIP_LPDDR4=y
+ CONFIG_BAUDRATE=1500000
+ CONFIG_DEBUG_UART_SHIFT=2
+ CONFIG_SYS_NS16550_MEM32=y
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 01 Apr 2024 20:24:04 GMT) Full text and rfc822 format available.

Message #14 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH 3/5] gnu: firmware: Update make-arm-trusted-firmware to 2.10.
Date: Mon,  1 Apr 2024 22:22:31 +0200
* gnu/packages/firmware.scm(make-arm-trusted-firmware): Update to 2.10.
---
 gnu/packages/firmware.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 828bc7402a..baf96a8212 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1096,18 +1096,17 @@ (define* (make-arm-trusted-firmware platform
                                        (gnu-triplet->nix-system triplet))))))
     (package
       (name (string-append "arm-trusted-firmware-" platform))
-      (version "2.9")
+      (version "2.10")
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
-               ;; There are only GitHub generated release snapshots.
                (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
                (commit (string-append "v" version))))
          (file-name (git-file-name "arm-trusted-firmware" version))
          (sha256
           (base32
-           "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+           "099r2c5vnvl83c2saca615dryr1byj2nm6imzkg5ix4kajsry2q8"))
          (snippet
           #~(begin
               (use-modules (guix build utils))
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 01 Apr 2024 20:24:04 GMT) Full text and rfc822 format available.

Message #17 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH 4/5] gnu: u-boot: Update to 2024.04-rc5.
Date: Mon,  1 Apr 2024 22:22:32 +0200
* gnu/packages/bootloaders.scm (u-boot): Update to 2024.04-rc5.
[source]: Remove build-without-libcrypto patch.
(%u-boot-build-without-libcrypto-patch): Remove variable.
(u-boot-tools)[arguments]: Disable sandbox tests and kwbimage.
* gnu/packages/patches/u-boot-build-without-libcrypto.patch: Delete
file.
* gnu/local.mk (dist_patch_DATA): Remove patch.

Change-Id: I85863adb0324461fabf164d3e936d922ade3aa69
---
 gnu/local.mk                                  |   1 -
 gnu/packages/bootloaders.scm                  |  26 ++--
 .../u-boot-build-without-libcrypto.patch      | 123 ------------------
 3 files changed, 13 insertions(+), 137 deletions(-)
 delete mode 100644 gnu/packages/patches/u-boot-build-without-libcrypto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3c29b4a2b7..c6c6cf7077 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2122,7 +2122,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
   %D%/packages/patches/twinkle-bcg729.patch			\
   %D%/packages/patches/u-boot-allow-disabling-openssl.patch	\
-  %D%/packages/patches/u-boot-build-without-libcrypto.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
   %D%/packages/patches/u-boot-nanopi-r4s-ddr3.patch		\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 9443de0a1d..ae604ab5bb 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -716,10 +716,6 @@ (define %u-boot-allow-disabling-openssl-patch
   ;; https://lists.denx.de/pipermail/u-boot/2021-October/462728.html
   (search-patch "u-boot-allow-disabling-openssl.patch"))
 
-(define %u-boot-build-without-libcrypto-patch
-  ;; Upstream commit to fix Amlogic builds in u-boot 2024.01.
-  (search-patch "u-boot-build-without-libcrypto.patch"))
-
 (define %u-boot-nanopi-r4s-ddr3-patch
   ;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
   (search-patch "u-boot-nanopi-r4s-ddr3.patch"))
@@ -727,11 +723,10 @@ (define %u-boot-nanopi-r4s-ddr3-patch
 (define u-boot
   (package
     (name "u-boot")
-    (version "2024.01")
+    (version "2024.04-rc5")
     (source (origin
               (patches
                (list %u-boot-rockchip-inno-usb-patch
-                     %u-boot-build-without-libcrypto-patch
                      %u-boot-allow-disabling-openssl-patch
                      %u-boot-nanopi-r4s-ddr3-patch))
               (method url-fetch)
@@ -740,7 +735,7 @@ (define u-boot
                     "u-boot-" version ".tar.bz2"))
               (sha256
                (base32
-                "1czmpszalc6b8cj9j7q6cxcy19lnijv3916w3dag6yr3xpqi35mr"))))
+                "18bx7v7mnqs316idkbd5a7rsg4ahdyxl8mrynrac3dfwq06x0cc5"))))
     (build-system gnu-build-system)
     (native-inputs
      (list bison
@@ -837,9 +832,11 @@ (define-public u-boot-tools
                (("\\./tools/patman/patman") (which "true"))
                ;; FIXME: test fails, needs further investiation
                (("run_test \"binman\"") "# run_test \"binman\"")
-               ;; FIXME: test_spl fails, needs further investiation
-               (("test_ofplatdata or test_handoff or test_spl")
-                "test_ofplatdata or test_handoff")
+               ;; FIXME: tests fail without kwbimage, i.e. openssl.
+               (("run_test \"sandbox_noinst\"")
+                "# run_test \"sandbox_noinst\"")
+               (("run_test \"sandbox_vpl\"")
+                "# run_test \"sandbox_vpl\"")
                ;; FIXME: code coverage not working
                (("run_test \"binman code coverage\"")
                 "# run_test \"binman code coverage\"")
@@ -862,14 +859,16 @@ (define-public u-boot-tools
                            (("CONFIG_FIT_SIGNATURE=y")
                             "CONFIG_FIT_SIGNATURE=n
 CONFIG_UT_LIB_ASN1=n
-CONFIG_TOOLS_LIBCRYPTO=n")
+CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n")
                            ;; Catch instances of implied CONFIG_FIG_SIGNATURE
                            ;; with VPL targets
                            (("CONFIG_SANDBOX_VPL=y")
                             "CONFIG_SANDBOX_VPL=y
 CONFIG_FIT_SIGNATURE=n
 CONFIG_VPL_FIT_SIGNATURE=n
-CONFIG_TOOLS_LIBCRYPTO=n")
+CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n")
                            ;; This test requires a sound system, which is un-used
                            ;; in u-boot-tools.
                            (("CONFIG_SOUND=y") "CONFIG_SOUND=n")))
@@ -1071,7 +1070,8 @@ (define*-public (make-u-boot-package board triplet
                 (lambda _
                   (substitute* ".config"
                     (("CONFIG_TOOLS_LIBCRYPTO=.*$")
-                     "CONFIG_TOOLS_LIBCRYPTO=n"))))
+                     "CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n"))))
               (replace 'install
                 (lambda _
                   (let ((libexec (string-append #$output "/libexec"))
diff --git a/gnu/packages/patches/u-boot-build-without-libcrypto.patch b/gnu/packages/patches/u-boot-build-without-libcrypto.patch
deleted file mode 100644
index d56588941c..0000000000
--- a/gnu/packages/patches/u-boot-build-without-libcrypto.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 03e598263e3878b6f5d58f5525577903edadc644 Mon Sep 17 00:00:00 2001
-From: Paul-Erwan Rio <paulerwan.rio <at> gmail.com>
-Date: Thu, 21 Dec 2023 08:26:11 +0100
-Subject: [PATCH] tools: fix build without LIBCRYPTO support
-
-Commit cb9faa6f98ae ("tools: Use a single target-independent config to
-enable OpenSSL") introduced a target-independent configuration to build
-crypto features in host tools.
-
-But since commit 2c21256b27d7 ("hash: Use Kconfig to enable hashing in
-host tools and SPL") the build without OpenSSL is broken, due to FIT
-signature/encryption features. Add missing conditional compilation
-tokens to fix this.
-
-Signed-off-by: Paul-Erwan Rio <paulerwan.rio <at> gmail.com>
-Tested-by: Alexander Dahl <ada <at> thorsis.com>
-Cc: Simon Glass <sjg <at> chromium.org>
-Reviewed-by: Tom Rini <trini <at> konsulko.com>
-Reviewed-by: Simon Glass <sjg <at> chromium.org>
----
- include/image.h    | 2 +-
- tools/Kconfig      | 1 +
- tools/fit_image.c  | 2 +-
- tools/image-host.c | 4 ++++
- tools/mkimage.c    | 5 +++--
- 5 files changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/include/image.h b/include/image.h
-index 432ec927b1..21de70f0c9 100644
---- a/include/image.h
-+++ b/include/image.h
-@@ -1465,7 +1465,7 @@ int calculate_hash(const void *data, int data_len, const char *algo,
-  * device
-  */
- #if defined(USE_HOSTCC)
--# if defined(CONFIG_FIT_SIGNATURE)
-+# if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- #  define IMAGE_ENABLE_SIGN	1
- #  define FIT_IMAGE_ENABLE_VERIFY	1
- #  include <openssl/evp.h>
-diff --git a/tools/Kconfig b/tools/Kconfig
-index f8632cd59d..f01ed783e6 100644
---- a/tools/Kconfig
-+++ b/tools/Kconfig
-@@ -51,6 +51,7 @@ config TOOLS_FIT_RSASSA_PSS
- 	  Support the rsassa-pss signature scheme in the tools builds
- 
- config TOOLS_FIT_SIGNATURE
-+	depends on TOOLS_LIBCRYPTO
- 	def_bool y
- 	help
- 	  Enable signature verification of FIT uImages in the tools builds
-diff --git a/tools/fit_image.c b/tools/fit_image.c
-index 71e031c855..beef1fa86e 100644
---- a/tools/fit_image.c
-+++ b/tools/fit_image.c
-@@ -61,7 +61,7 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc,
- 		ret = fit_set_timestamp(ptr, 0, time);
- 	}
- 
--	if (!ret)
-+	if (CONFIG_IS_ENABLED(FIT_SIGNATURE) && !ret)
- 		ret = fit_pre_load_data(params->keydir, dest_blob, ptr);
- 
- 	if (!ret) {
-diff --git a/tools/image-host.c b/tools/image-host.c
-index ca4950312f..90bc9f905f 100644
---- a/tools/image-host.c
-+++ b/tools/image-host.c
-@@ -14,8 +14,10 @@
- #include <image.h>
- #include <version.h>
- 
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- #include <openssl/pem.h>
- #include <openssl/evp.h>
-+#endif
- 
- /**
-  * fit_set_hash_value - set hash value in requested has node
-@@ -1131,6 +1133,7 @@ static int fit_config_add_verification_data(const char *keydir,
- 	return 0;
- }
- 
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- /*
-  * 0) open file (open)
-  * 1) read certificate (PEM_read_X509)
-@@ -1239,6 +1242,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit)
-  out:
- 	return ret;
- }
-+#endif
- 
- int fit_cipher_data(const char *keydir, void *keydest, void *fit,
- 		    const char *comment, int require_keys,
-diff --git a/tools/mkimage.c b/tools/mkimage.c
-index 6dfe3e1d42..ac62ebbde9 100644
---- a/tools/mkimage.c
-+++ b/tools/mkimage.c
-@@ -115,7 +115,7 @@ static void usage(const char *msg)
- 		"          -B => align size in hex for FIT structure and header\n"
- 		"          -b => append the device tree binary to the FIT\n"
- 		"          -t => update the timestamp in the FIT\n");
--#ifdef CONFIG_FIT_SIGNATURE
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- 	fprintf(stderr,
- 		"Signing / verified boot options: [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]\n"
- 		"          -k => set directory containing private keys\n"
-@@ -130,8 +130,9 @@ static void usage(const char *msg)
- 		"          -o => algorithm to use for signing\n");
- #else
- 	fprintf(stderr,
--		"Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n");
-+		"Signing / verified boot not supported (CONFIG_TOOLS_FIT_SIGNATURE undefined)\n");
- #endif
-+
- 	fprintf(stderr, "       %s -V ==> print version information and exit\n",
- 		params.cmdname);
- 	fprintf(stderr, "Use '-T list' to see a list of available image types\n");
--- 
-2.41.0
-
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 01 Apr 2024 20:24:05 GMT) Full text and rfc822 format available.

Message #20 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH 5/5] gnu: bootloader: Add orangepi-zero2w bootloader.
Date: Mon,  1 Apr 2024 22:22:33 +0200
* gnu/bootloader/u-boot.scm (u-boot-orangepi-zero2w-bootloader): Add
variable.
* gnu/packages/bootloaders.scm (u-boot-orangepi-zero2w): Add variable.
* gnu/packages/firmware.scm (arm-trusted-firmware-sun50i-h616): Add
variable.

Change-Id: Idb43fdabac51b3301f3bea24fec72bfa29636489
---
 gnu/bootloader/u-boot.scm    |  6 ++++++
 gnu/packages/bootloaders.scm | 18 ++++++++++++++++++
 gnu/packages/firmware.scm    |  6 ++++++
 3 files changed, 30 insertions(+)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 4d0f7ead96..50e4563390 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -40,6 +40,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
             u-boot-orangepi-r1-plus-lts-rk3328-bootloader
+            u-boot-orangepi-zero2w-bootloader
             u-boot-pine64-plus-bootloader
             u-boot-pine64-lts-bootloader
             u-boot-pinebook-bootloader
@@ -266,6 +267,11 @@ (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader
    (package u-boot-orangepi-r1-plus-lts-rk3328)
    (disk-image-installer install-orangepi-r1-plus-lts-rk3328-u-boot)))
 
+(define u-boot-orangepi-zero2w-bootloader
+  (bootloader
+   (inherit u-boot-allwinner-bootloader)
+   (package u-boot-orangepi-zero2w)))
+
 (define u-boot-pine64-plus-bootloader
   (bootloader
    (inherit u-boot-allwinner64-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index ae604ab5bb..829c5d3a7e 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1144,6 +1144,24 @@ (define*-public (make-u-boot-sunxi64-package board triplet scp-firmware
        (modify-inputs (package-inputs base)
          (append arm-trusted-firmware-sun50i-a64))))))
 
+(define-public u-boot-orangepi-zero2w
+  (let ((base (make-u-boot-package
+               "orangepi_zero2w" "aarch64-linux-gnu")))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                  (setenv "SCP" "/dev/null")
+                  (setenv "BL31" (search-input-file inputs "bl31.bin"))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         ;; The Zero 2W uses the slightly revised Allwinner H618.
+         (append arm-trusted-firmware-sun50i-h616))))))
+
 (define-public u-boot-pine64-plus
   (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"
                                (delay crust-pine64-plus)))
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index baf96a8212..b26610267c 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1156,6 +1156,12 @@ (define-public arm-trusted-firmware-sun50i-a64
       (inherit base)
       (name "arm-trusted-firmware-sun50i-a64"))))
 
+(define-public arm-trusted-firmware-sun50i-h616
+  (let ((base (make-arm-trusted-firmware "sun50i_h616")))
+    (package
+      (inherit base)
+      (name "arm-trusted-firmware-sun50i-h616"))))
+
 (define-public arm-trusted-firmware-rk3328
   (make-arm-trusted-firmware "rk3328"))
 
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 09 May 2024 05:37:02 GMT) Full text and rfc822 format available.

Message #23 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH 0/5] Update U-boot.
Date: Thu,  9 May 2024 07:35:25 +0200
Hello,

I bumped U-boot to a proper release, that's all.

Cheers,
Herman

Herman Rimm (5):
  gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
  gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
  gnu: firmware: Update make-arm-trusted-firmware to 2.10.
  gnu: u-boot: Update to 2024.04.
  gnu: bootloader: Add orangepi-zero2w bootloader.

 gnu/bootloader/u-boot.scm                     |  24 +++-
 gnu/local.mk                                  |   4 +-
 gnu/packages/bootloaders.scm                  |  66 ++++++++--
 gnu/packages/firmware.scm                     |  11 +-
 .../u-boot-build-without-libcrypto.patch      | 123 ------------------
 .../patches/u-boot-nanopi-r4s-ddr3.patch      |  25 ++++
 6 files changed, 110 insertions(+), 143 deletions(-)
 delete mode 100644 gnu/packages/patches/u-boot-build-without-libcrypto.patch
 create mode 100644 gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch


base-commit: 014875b29e68da6357a5323e6dd1eaa74a05b753
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 09 May 2024 05:37:02 GMT) Full text and rfc822 format available.

Message #26 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH 1/5] gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
Date: Thu,  9 May 2024 07:35:26 +0200
* gnu/bootloader/u-boot.scm (install-nanopi-r4s-rk3399-u-boot,
u-boot-nanopi-r4s-rk3399-bootloader): Add variable.
* gnu/packages/bootloaders.scm (u-boot-nanopi-r4s-rk3399): Add variable.

Change-Id: I6d4cb098727fe4027aea33a39c59d34000dfc4db
---
 gnu/bootloader/u-boot.scm    | 18 +++++++++++++++++-
 gnu/packages/bootloaders.scm | 17 ++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 8e7cc05191..0b00afbe78 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2023 Efraim Flashner <efraim <at> flashner.co.il>
-;;; Copyright © 2023 Herman Rimm <herman_rimm <at> protonmail.com>
+;;; Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -37,6 +37,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-cubietruck-bootloader
             u-boot-firefly-rk3399-bootloader
             u-boot-mx6cuboxi-bootloader
+            u-boot-nanopi-r4s-rk3399-bootloader
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
             u-boot-orangepi-r1-plus-lts-rk3328-bootloader
@@ -97,6 +98,15 @@ (define install-imx-u-boot
         (write-file-on-device u-boot (stat:size (stat u-boot))
                               image (* 69 1024)))))
 
+(define install-nanopi-r4s-rk3399-u-boot
+  #~(lambda (bootloader root-index image)
+      (let ((spl (string-append bootloader "/libexec/idbloader.img"))
+            (u-boot (string-append bootloader "/libexec/u-boot.itb")))
+        (write-file-on-device spl (stat:size (stat spl))
+                              image (* 64 512))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              image (* 16384 512)))))
+
 (define install-orangepi-r1-plus-lts-rk3328-u-boot
   #~(lambda (bootloader root-index image)
       (let ((idb (string-append bootloader "/libexec/idbloader.img"))
@@ -252,6 +262,12 @@ (define u-boot-novena-bootloader
    (inherit u-boot-imx-bootloader)
    (package u-boot-novena)))
 
+(define u-boot-nanopi-r4s-rk3399-bootloader
+  (bootloader
+   (inherit u-boot-bootloader)
+   (package u-boot-nanopi-r4s-rk3399)
+   (disk-image-installer install-nanopi-r4s-rk3399-u-boot)))
+
 (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader
   (bootloader
    (inherit u-boot-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index cfe8046731..d1bf0fcd98 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -18,7 +18,7 @@
 ;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
 ;;; Copyright © 2021 Stefan <stefan-guix <at> vodafonemail.de>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
-;;; Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+;;; Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1210,6 +1210,21 @@ (define-public u-boot-novena
 version, contrary to Novena upstream, does not load u-boot.img from the first
 partition."))
 
+(define-public u-boot-nanopi-r4s-rk3399
+  (let ((base (make-u-boot-package "nanopi-r4s-rk3399" "aarch64-linux-gnu")))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (setenv "BL31" (search-input-file inputs "/bl31.elf"))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         (append arm-trusted-firmware-rk3399))))))
+
 (define-public u-boot-orangepi-r1-plus-lts-rk3328
   (let ((base (make-u-boot-package "orangepi-r1-plus-lts-rk3328" "aarch64-linux-gnu")))
     (package
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 09 May 2024 05:37:03 GMT) Full text and rfc822 format available.

Message #29 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH 2/5] gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
Date: Thu,  9 May 2024 07:35:27 +0200
* gnu/packages/bootloaders.scm (%u-boot-nanopi-r4s-ddr3-patch): Add
variable.
(u-boot)[source]: Use patch.
* gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register patch.

Change-Id: Ibbf952f2806c9cac7fc29e1264d427bf6ee67d01
---
 gnu/local.mk                                  |  3 ++-
 gnu/packages/bootloaders.scm                  |  7 +++++-
 .../patches/u-boot-nanopi-r4s-ddr3.patch      | 25 +++++++++++++++++++
 3 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index edd546f81d..9b3e80de08 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -62,7 +62,7 @@
 # Copyright © 2023 B. Wilson <elaexuotee <at> wilsonb.com>
 # Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 # Copyright © 2023 gemmaro <gemmaro.dev <at> gmail.com>
-# Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+# Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 # Copyright © 2023 Troy Figiel <troy <at> troyfigiel.com>
 # Copyright © 2024 David Elsing <david.elsing <at> posteo.net>
 #
@@ -2134,6 +2134,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/u-boot-build-without-libcrypto.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
+  %D%/packages/patches/u-boot-nanopi-r4s-ddr3.patch		\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
   %D%/packages/patches/ultrastar-deluxe-no-freesans.patch		\
   %D%/packages/patches/ungoogled-chromium-extension-search-path.patch	\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index d1bf0fcd98..9443de0a1d 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -720,6 +720,10 @@ (define %u-boot-build-without-libcrypto-patch
   ;; Upstream commit to fix Amlogic builds in u-boot 2024.01.
   (search-patch "u-boot-build-without-libcrypto.patch"))
 
+(define %u-boot-nanopi-r4s-ddr3-patch
+  ;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
+  (search-patch "u-boot-nanopi-r4s-ddr3.patch"))
+
 (define u-boot
   (package
     (name "u-boot")
@@ -728,7 +732,8 @@ (define u-boot
               (patches
                (list %u-boot-rockchip-inno-usb-patch
                      %u-boot-build-without-libcrypto-patch
-                     %u-boot-allow-disabling-openssl-patch))
+                     %u-boot-allow-disabling-openssl-patch
+                     %u-boot-nanopi-r4s-ddr3-patch))
               (method url-fetch)
               (uri (string-append
                     "https://ftp.denx.de/pub/u-boot/"
diff --git a/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
new file mode 100644
index 0000000000..3c4f5efaf4
--- /dev/null
+++ b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
@@ -0,0 +1,25 @@
+diff --git a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+index 69800cc368..a3054849f8 100644
+--- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
++++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+@@ -13,7 +13,7 @@
+  */
+ 
+ #include "rk3399-nanopi4-u-boot.dtsi"
+-#include "rk3399-sdram-lpddr4-100.dtsi"
++#include "rk3399-sdram-ddr3-1866.dtsi"
+ 
+ / {
+ 	smbios {
+diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
+index 4f4363cb0f..bfa7ee628d 100644
+--- a/configs/nanopi-r4s-rk3399_defconfig
++++ b/configs/nanopi-r4s-rk3399_defconfig
+@@ -54,7 +54,6 @@ CONFIG_PMIC_RK8XX=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_REGULATOR_RK8XX=y
+ CONFIG_PWM_ROCKCHIP=y
+-CONFIG_RAM_ROCKCHIP_LPDDR4=y
+ CONFIG_BAUDRATE=1500000
+ CONFIG_DEBUG_UART_SHIFT=2
+ CONFIG_SYS_NS16550_MEM32=y
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 09 May 2024 05:37:03 GMT) Full text and rfc822 format available.

Message #32 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH 4/5] gnu: u-boot: Update to 2024.04.
Date: Thu,  9 May 2024 07:35:29 +0200
* gnu/packages/bootloaders.scm (u-boot): Update to 2024.04.
[source]: Remove build-without-libcrypto patch.
(%u-boot-build-without-libcrypto-patch): Remove variable.
(u-boot-tools)[arguments]: Disable sandbox tests and kwbimage.
* gnu/packages/patches/u-boot-build-without-libcrypto.patch: Delete
file.
* gnu/local.mk (dist_patch_DATA): Remove patch.

Change-Id: I85863adb0324461fabf164d3e936d922ade3aa69
---
 gnu/local.mk                                  |   1 -
 gnu/packages/bootloaders.scm                  |  26 ++--
 .../u-boot-build-without-libcrypto.patch      | 123 ------------------
 3 files changed, 13 insertions(+), 137 deletions(-)
 delete mode 100644 gnu/packages/patches/u-boot-build-without-libcrypto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9b3e80de08..4b22196acb 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2131,7 +2131,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
   %D%/packages/patches/twinkle-bcg729.patch			\
   %D%/packages/patches/u-boot-allow-disabling-openssl.patch	\
-  %D%/packages/patches/u-boot-build-without-libcrypto.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
   %D%/packages/patches/u-boot-nanopi-r4s-ddr3.patch		\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 9443de0a1d..a6ba4b14da 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -716,10 +716,6 @@ (define %u-boot-allow-disabling-openssl-patch
   ;; https://lists.denx.de/pipermail/u-boot/2021-October/462728.html
   (search-patch "u-boot-allow-disabling-openssl.patch"))
 
-(define %u-boot-build-without-libcrypto-patch
-  ;; Upstream commit to fix Amlogic builds in u-boot 2024.01.
-  (search-patch "u-boot-build-without-libcrypto.patch"))
-
 (define %u-boot-nanopi-r4s-ddr3-patch
   ;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
   (search-patch "u-boot-nanopi-r4s-ddr3.patch"))
@@ -727,11 +723,10 @@ (define %u-boot-nanopi-r4s-ddr3-patch
 (define u-boot
   (package
     (name "u-boot")
-    (version "2024.01")
+    (version "2024.04")
     (source (origin
               (patches
                (list %u-boot-rockchip-inno-usb-patch
-                     %u-boot-build-without-libcrypto-patch
                      %u-boot-allow-disabling-openssl-patch
                      %u-boot-nanopi-r4s-ddr3-patch))
               (method url-fetch)
@@ -740,7 +735,7 @@ (define u-boot
                     "u-boot-" version ".tar.bz2"))
               (sha256
                (base32
-                "1czmpszalc6b8cj9j7q6cxcy19lnijv3916w3dag6yr3xpqi35mr"))))
+                "0jnx8f45101b971zmpimjyk6vvgab8kx9hhcm41svmzs77z57a0q"))))
     (build-system gnu-build-system)
     (native-inputs
      (list bison
@@ -837,9 +832,11 @@ (define-public u-boot-tools
                (("\\./tools/patman/patman") (which "true"))
                ;; FIXME: test fails, needs further investiation
                (("run_test \"binman\"") "# run_test \"binman\"")
-               ;; FIXME: test_spl fails, needs further investiation
-               (("test_ofplatdata or test_handoff or test_spl")
-                "test_ofplatdata or test_handoff")
+               ;; FIXME: tests fail without kwbimage, i.e. openssl.
+               (("run_test \"sandbox_noinst\"")
+                "# run_test \"sandbox_noinst\"")
+               (("run_test \"sandbox_vpl\"")
+                "# run_test \"sandbox_vpl\"")
                ;; FIXME: code coverage not working
                (("run_test \"binman code coverage\"")
                 "# run_test \"binman code coverage\"")
@@ -862,14 +859,16 @@ (define-public u-boot-tools
                            (("CONFIG_FIT_SIGNATURE=y")
                             "CONFIG_FIT_SIGNATURE=n
 CONFIG_UT_LIB_ASN1=n
-CONFIG_TOOLS_LIBCRYPTO=n")
+CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n")
                            ;; Catch instances of implied CONFIG_FIG_SIGNATURE
                            ;; with VPL targets
                            (("CONFIG_SANDBOX_VPL=y")
                             "CONFIG_SANDBOX_VPL=y
 CONFIG_FIT_SIGNATURE=n
 CONFIG_VPL_FIT_SIGNATURE=n
-CONFIG_TOOLS_LIBCRYPTO=n")
+CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n")
                            ;; This test requires a sound system, which is un-used
                            ;; in u-boot-tools.
                            (("CONFIG_SOUND=y") "CONFIG_SOUND=n")))
@@ -1071,7 +1070,8 @@ (define*-public (make-u-boot-package board triplet
                 (lambda _
                   (substitute* ".config"
                     (("CONFIG_TOOLS_LIBCRYPTO=.*$")
-                     "CONFIG_TOOLS_LIBCRYPTO=n"))))
+                     "CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n"))))
               (replace 'install
                 (lambda _
                   (let ((libexec (string-append #$output "/libexec"))
diff --git a/gnu/packages/patches/u-boot-build-without-libcrypto.patch b/gnu/packages/patches/u-boot-build-without-libcrypto.patch
deleted file mode 100644
index d56588941c..0000000000
--- a/gnu/packages/patches/u-boot-build-without-libcrypto.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 03e598263e3878b6f5d58f5525577903edadc644 Mon Sep 17 00:00:00 2001
-From: Paul-Erwan Rio <paulerwan.rio <at> gmail.com>
-Date: Thu, 21 Dec 2023 08:26:11 +0100
-Subject: [PATCH] tools: fix build without LIBCRYPTO support
-
-Commit cb9faa6f98ae ("tools: Use a single target-independent config to
-enable OpenSSL") introduced a target-independent configuration to build
-crypto features in host tools.
-
-But since commit 2c21256b27d7 ("hash: Use Kconfig to enable hashing in
-host tools and SPL") the build without OpenSSL is broken, due to FIT
-signature/encryption features. Add missing conditional compilation
-tokens to fix this.
-
-Signed-off-by: Paul-Erwan Rio <paulerwan.rio <at> gmail.com>
-Tested-by: Alexander Dahl <ada <at> thorsis.com>
-Cc: Simon Glass <sjg <at> chromium.org>
-Reviewed-by: Tom Rini <trini <at> konsulko.com>
-Reviewed-by: Simon Glass <sjg <at> chromium.org>
----
- include/image.h    | 2 +-
- tools/Kconfig      | 1 +
- tools/fit_image.c  | 2 +-
- tools/image-host.c | 4 ++++
- tools/mkimage.c    | 5 +++--
- 5 files changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/include/image.h b/include/image.h
-index 432ec927b1..21de70f0c9 100644
---- a/include/image.h
-+++ b/include/image.h
-@@ -1465,7 +1465,7 @@ int calculate_hash(const void *data, int data_len, const char *algo,
-  * device
-  */
- #if defined(USE_HOSTCC)
--# if defined(CONFIG_FIT_SIGNATURE)
-+# if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- #  define IMAGE_ENABLE_SIGN	1
- #  define FIT_IMAGE_ENABLE_VERIFY	1
- #  include <openssl/evp.h>
-diff --git a/tools/Kconfig b/tools/Kconfig
-index f8632cd59d..f01ed783e6 100644
---- a/tools/Kconfig
-+++ b/tools/Kconfig
-@@ -51,6 +51,7 @@ config TOOLS_FIT_RSASSA_PSS
- 	  Support the rsassa-pss signature scheme in the tools builds
- 
- config TOOLS_FIT_SIGNATURE
-+	depends on TOOLS_LIBCRYPTO
- 	def_bool y
- 	help
- 	  Enable signature verification of FIT uImages in the tools builds
-diff --git a/tools/fit_image.c b/tools/fit_image.c
-index 71e031c855..beef1fa86e 100644
---- a/tools/fit_image.c
-+++ b/tools/fit_image.c
-@@ -61,7 +61,7 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc,
- 		ret = fit_set_timestamp(ptr, 0, time);
- 	}
- 
--	if (!ret)
-+	if (CONFIG_IS_ENABLED(FIT_SIGNATURE) && !ret)
- 		ret = fit_pre_load_data(params->keydir, dest_blob, ptr);
- 
- 	if (!ret) {
-diff --git a/tools/image-host.c b/tools/image-host.c
-index ca4950312f..90bc9f905f 100644
---- a/tools/image-host.c
-+++ b/tools/image-host.c
-@@ -14,8 +14,10 @@
- #include <image.h>
- #include <version.h>
- 
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- #include <openssl/pem.h>
- #include <openssl/evp.h>
-+#endif
- 
- /**
-  * fit_set_hash_value - set hash value in requested has node
-@@ -1131,6 +1133,7 @@ static int fit_config_add_verification_data(const char *keydir,
- 	return 0;
- }
- 
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- /*
-  * 0) open file (open)
-  * 1) read certificate (PEM_read_X509)
-@@ -1239,6 +1242,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit)
-  out:
- 	return ret;
- }
-+#endif
- 
- int fit_cipher_data(const char *keydir, void *keydest, void *fit,
- 		    const char *comment, int require_keys,
-diff --git a/tools/mkimage.c b/tools/mkimage.c
-index 6dfe3e1d42..ac62ebbde9 100644
---- a/tools/mkimage.c
-+++ b/tools/mkimage.c
-@@ -115,7 +115,7 @@ static void usage(const char *msg)
- 		"          -B => align size in hex for FIT structure and header\n"
- 		"          -b => append the device tree binary to the FIT\n"
- 		"          -t => update the timestamp in the FIT\n");
--#ifdef CONFIG_FIT_SIGNATURE
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- 	fprintf(stderr,
- 		"Signing / verified boot options: [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]\n"
- 		"          -k => set directory containing private keys\n"
-@@ -130,8 +130,9 @@ static void usage(const char *msg)
- 		"          -o => algorithm to use for signing\n");
- #else
- 	fprintf(stderr,
--		"Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n");
-+		"Signing / verified boot not supported (CONFIG_TOOLS_FIT_SIGNATURE undefined)\n");
- #endif
-+
- 	fprintf(stderr, "       %s -V ==> print version information and exit\n",
- 		params.cmdname);
- 	fprintf(stderr, "Use '-T list' to see a list of available image types\n");
--- 
-2.41.0
-
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 09 May 2024 05:37:04 GMT) Full text and rfc822 format available.

Message #35 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH 5/5] gnu: bootloader: Add orangepi-zero2w bootloader.
Date: Thu,  9 May 2024 07:35:30 +0200
* gnu/bootloader/u-boot.scm (u-boot-orangepi-zero2w-bootloader): Add
variable.
* gnu/packages/bootloaders.scm (u-boot-orangepi-zero2w): Add variable.
* gnu/packages/firmware.scm (arm-trusted-firmware-sun50i-h616): Add
variable.

Change-Id: Idb43fdabac51b3301f3bea24fec72bfa29636489
---
 gnu/bootloader/u-boot.scm    |  6 ++++++
 gnu/packages/bootloaders.scm | 18 ++++++++++++++++++
 gnu/packages/firmware.scm    |  6 ++++++
 3 files changed, 30 insertions(+)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 0b00afbe78..8d62c3dad8 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -41,6 +41,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
             u-boot-orangepi-r1-plus-lts-rk3328-bootloader
+            u-boot-orangepi-zero2w-bootloader
             u-boot-pine64-plus-bootloader
             u-boot-pine64-lts-bootloader
             u-boot-pinebook-bootloader
@@ -274,6 +275,11 @@ (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader
    (package u-boot-orangepi-r1-plus-lts-rk3328)
    (disk-image-installer install-orangepi-r1-plus-lts-rk3328-u-boot)))
 
+(define u-boot-orangepi-zero2w-bootloader
+  (bootloader
+   (inherit u-boot-allwinner-bootloader)
+   (package u-boot-orangepi-zero2w)))
+
 (define u-boot-pine64-plus-bootloader
   (bootloader
    (inherit u-boot-allwinner64-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index a6ba4b14da..9bc5aa7d40 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1144,6 +1144,24 @@ (define*-public (make-u-boot-sunxi64-package board triplet scp-firmware
        (modify-inputs (package-inputs base)
          (append arm-trusted-firmware-sun50i-a64))))))
 
+(define-public u-boot-orangepi-zero2w
+  (let ((base (make-u-boot-package
+               "orangepi_zero2w" "aarch64-linux-gnu")))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                  (setenv "SCP" "/dev/null")
+                  (setenv "BL31" (search-input-file inputs "bl31.bin"))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         ;; The Zero 2W uses the slightly revised Allwinner H618.
+         (append arm-trusted-firmware-sun50i-h616))))))
+
 (define-public u-boot-pine64-plus
   (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"
                                (delay crust-pine64-plus)))
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index d155c5365c..d282b4b684 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1154,6 +1154,12 @@ (define-public arm-trusted-firmware-sun50i-a64
       (inherit base)
       (name "arm-trusted-firmware-sun50i-a64"))))
 
+(define-public arm-trusted-firmware-sun50i-h616
+  (let ((base (make-arm-trusted-firmware "sun50i_h616")))
+    (package
+      (inherit base)
+      (name "arm-trusted-firmware-sun50i-h616"))))
+
 (define-public arm-trusted-firmware-rk3328
   (make-arm-trusted-firmware "rk3328"))
 
-- 
2.41.0





Information forwarded to efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 09 May 2024 05:37:04 GMT) Full text and rfc822 format available.

Message #38 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH 3/5] gnu: firmware: Update make-arm-trusted-firmware to 2.10.
Date: Thu,  9 May 2024 07:35:28 +0200
* gnu/packages/firmware.scm(make-arm-trusted-firmware): Update to 2.10.
---
 gnu/packages/firmware.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 6f0c2da806..d155c5365c 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1094,18 +1094,17 @@ (define* (make-arm-trusted-firmware platform
                                        (gnu-triplet->nix-system triplet))))))
     (package
       (name (string-append "arm-trusted-firmware-" platform))
-      (version "2.9")
+      (version "2.10")
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
-               ;; There are only GitHub generated release snapshots.
                (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
                (commit (string-append "v" version))))
          (file-name (git-file-name "arm-trusted-firmware" version))
          (sha256
           (base32
-           "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+           "099r2c5vnvl83c2saca615dryr1byj2nm6imzkg5ix4kajsry2q8"))
          (snippet
           #~(begin
               (use-modules (guix build utils))
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Wed, 15 May 2024 18:17:02 GMT) Full text and rfc822 format available.

Message #41 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Herman Rimm <herman <at> rimm.ee>, 70131 <at> debbugs.gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#70131] [PATCH 2/5] gnu: u-boot: Use DDR3 patch for Nano Pi
 R4S.
Date: Wed, 15 May 2024 11:16:00 -0700
[Message part 1 (text/plain, inline)]
On 2024-05-09, Herman Rimm wrote:
> * gnu/packages/bootloaders.scm (%u-boot-nanopi-r4s-ddr3-patch): Add
> variable.
> (u-boot)[source]: Use patch.
> * gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch: Add file.
> * gnu/local.mk (dist_patch_DATA): Register patch.
...
> diff --git a/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
> new file mode 100644
> index 0000000000..3c4f5efaf4
> --- /dev/null
> +++ b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
> @@ -0,0 +1,25 @@
> +diff --git a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
> +index 69800cc368..a3054849f8 100644
> +--- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
> ++++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
> +@@ -13,7 +13,7 @@
> +  */
> + 
> + #include "rk3399-nanopi4-u-boot.dtsi"
> +-#include "rk3399-sdram-lpddr4-100.dtsi"
> ++#include "rk3399-sdram-ddr3-1866.dtsi"
> + 
> + / {
> + 	smbios {
> +diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
> +index 4f4363cb0f..bfa7ee628d 100644
> +--- a/configs/nanopi-r4s-rk3399_defconfig
> ++++ b/configs/nanopi-r4s-rk3399_defconfig
> +@@ -54,7 +54,6 @@ CONFIG_PMIC_RK8XX=y
> + CONFIG_REGULATOR_PWM=y
> + CONFIG_REGULATOR_RK8XX=y
> + CONFIG_PWM_ROCKCHIP=y
> +-CONFIG_RAM_ROCKCHIP_LPDDR4=y
> + CONFIG_BAUDRATE=1500000
> + CONFIG_DEBUG_UART_SHIFT=2
> + CONFIG_SYS_NS16550_MEM32=y
> -- 
> 2.41.0

Is this patch submitted upstream or present in newer versions? Are all
boards of this type using DDR3, or are there some that use LPDDR4?

This sort of information would be nice to include inside the .patch file
itself.


live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Wed, 15 May 2024 20:27:02 GMT) Full text and rfc822 format available.

Message #44 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Herman Rimm <herman <at> rimm.ee>
Cc: 70131 <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#70131] [PATCH 0/5] Update U-boot.
Date: Wed, 15 May 2024 13:26:01 -0700
[Message part 1 (text/plain, inline)]
My summary of the situation so far...

On 2024-05-09, Herman Rimm wrote:
> Herman Rimm (5):
>   gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.

Looks good, although is it useful without the follow-up patch? If not, I
would squash the two in a single commit?


>   gnu: u-boot: Use DDR3 patch for Nano Pi R4S.

Question regarding the upstream status for this patch and including
relevent descriptions about upstream status, origin, purporse, etc. in
the .patch comments.


>   gnu: firmware: Update make-arm-trusted-firmware to 2.10.

I can confirm the upstream hashes on this and it builds.

I suspect this would be fine to merge as-is even without including the
other patches in the series, though I have not verified this as yet.


>   gnu: u-boot: Update to 2024.04.

Also able to confirm the upstream hashes, although at least two packages
to fail to build, u-boot-sandbox and u-boot-rockpro64-rk3399. From the
comments on the earlier series, I am guessing you were aware of this,
but figured I'd mention which packages.

This is probably due to trying to build without openssl, due to
(potential) license incompatibilities between openssl and GPL; this is
not well suppored upstream and we have been carrying patches for quite
some time about this...


>   gnu: bootloader: Add orangepi-zero2w bootloader.

Looks good.


For the most part, there are substitutes available from bordeaux, at
least for x86_64. I will also try to do some builds on aarch64.


live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 16 May 2024 07:30:02 GMT) Full text and rfc822 format available.

Message #47 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: 70131 <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#70131] [PATCH 0/5] Update U-boot.
Date: Thu, 16 May 2024 09:28:39 +0200
Hello,

On Wed, May 15, 2024 at 01:26:01PM -0700, Vagrant Cascadian wrote:
> My summary of the situation so far...
> 
> On 2024-05-09, Herman Rimm wrote:
> > Herman Rimm (5):
> >   gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
> 
> Looks good, although is it useful without the follow-up patch? If not, I
> would squash the two in a single commit?

The bootloader with the DDR3 patch works, so it should also work without
the patch.  I believe the LPDDR4 version is more common because it has
OpenWRT support while the DDR3 version does not [1].  The LPDDR4 version
would not be useful to me, but in general it would be more useful.

> >   gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
> 
> Question regarding the upstream status for this patch and including
> relevent descriptions about upstream status, origin, purporse, etc. in
> the .patch comments.

The patch is not submitted upstream or already present upstream.  I made
the patch for the DDR3 (as opposed to LPDDR4) variant of the Nano Pi
R4S.  I will write this in the patch comments as well.

Should there be bootloaders for both Nano Pi R4S variants?

> >   gnu: u-boot: Update to 2024.04.
> 
> Also able to confirm the upstream hashes, although at least two packages
> to fail to build, u-boot-sandbox and u-boot-rockpro64-rk3399. From the
> comments on the earlier series, I am guessing you were aware of this,
> but figured I'd mention which packages.

I will try getting u-boot-rockpro64-rk3399 to build.

Cheers,
Herman

[1]: https://openwrt.org/toh/friendlyarm/nanopi_r4s_v1




Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 16 May 2024 15:58:02 GMT) Full text and rfc822 format available.

Message #50 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Herman Rimm <herman <at> rimm.ee>
Cc: 70131 <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il>
Subject: Re: [bug#70131] [PATCH 0/5] Update U-boot.
Date: Thu, 16 May 2024 08:56:27 -0700
[Message part 1 (text/plain, inline)]
On 2024-05-16, Herman Rimm wrote:
> On Wed, May 15, 2024 at 01:26:01PM -0700, Vagrant Cascadian wrote:
>> My summary of the situation so far...
>> 
>> On 2024-05-09, Herman Rimm wrote:
>> > Herman Rimm (5):
>> >   gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
>> 
>> Looks good, although is it useful without the follow-up patch? If not, I
>> would squash the two in a single commit?
>
> The bootloader with the DDR3 patch works, so it should also work without
> the patch.  I believe the LPDDR4 version is more common because it has
> OpenWRT support while the DDR3 version does not [1].  The LPDDR4 version
> would not be useful to me, but in general it would be more useful.

Got it, thanks!


>> >   gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
>> 
>> Question regarding the upstream status for this patch and including
>> relevent descriptions about upstream status, origin, purporse, etc. in
>> the .patch comments.
>
> The patch is not submitted upstream or already present upstream.  I made
> the patch for the DDR3 (as opposed to LPDDR4) variant of the Nano Pi
> R4S.  I will write this in the patch comments as well.

Great!

> Should there be bootloaders for both Nano Pi R4S variants?

Based on the fact that there are two models with different hardware,
seems like there should be two variants of the package.

Bringing this up upstream might also be a good idea, as they might
either make a second variant upstream, or suggest a clever way to have a
single build that autodetects which variant it is and "does the right
thing" out of the box.

If you do start such a thread, a link to the discussion would be great
to have in the patch comments.


>> >   gnu: u-boot: Update to 2024.04.
>> 
>> Also able to confirm the upstream hashes, although at least two packages
>> to fail to build, u-boot-sandbox and u-boot-rockpro64-rk3399. From the
>> comments on the earlier series, I am guessing you were aware of this,
>> but figured I'd mention which packages.
>
> I will try getting u-boot-rockpro64-rk3399 to build.

Thanks!

live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:02 GMT) Full text and rfc822 format available.

Message #53 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 1/8] gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
Date: Mon, 26 Aug 2024 16:45:00 +0200
* gnu/bootloader/u-boot.scm (install-nanopi-r4s-rk3399-u-boot,
u-boot-nanopi-r4s-rk3399-bootloader): Add variable.
* gnu/packages/bootloaders.scm (u-boot-nanopi-r4s-rk3399): Add variable.

Change-Id: I6d4cb098727fe4027aea33a39c59d34000dfc4db
---
 gnu/bootloader/u-boot.scm    | 18 +++++++++++++++++-
 gnu/packages/bootloaders.scm | 17 ++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index c5437a7b63..7888a4e030 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2023 Efraim Flashner <efraim <at> flashner.co.il>
-;;; Copyright © 2023 Herman Rimm <herman_rimm <at> protonmail.com>
+;;; Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -37,6 +37,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-cubietruck-bootloader
             u-boot-firefly-rk3399-bootloader
             u-boot-mx6cuboxi-bootloader
+            u-boot-nanopi-r4s-rk3399-bootloader
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
             u-boot-orangepi-r1-plus-lts-rk3328-bootloader
@@ -98,6 +99,15 @@ (define install-imx-u-boot
         (write-file-on-device u-boot (stat:size (stat u-boot))
                               image (* 69 1024)))))
 
+(define install-nanopi-r4s-rk3399-u-boot
+  #~(lambda (bootloader root-index image)
+      (let ((spl (string-append bootloader "/libexec/idbloader.img"))
+            (u-boot (string-append bootloader "/libexec/u-boot.itb")))
+        (write-file-on-device spl (stat:size (stat spl))
+                              image (* 64 512))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              image (* 16384 512)))))
+
 (define install-orangepi-r1-plus-lts-rk3328-u-boot
   #~(lambda (bootloader root-index image)
       (let ((idb (string-append bootloader "/libexec/idbloader.img"))
@@ -274,6 +284,12 @@ (define u-boot-novena-bootloader
    (inherit u-boot-imx-bootloader)
    (package u-boot-novena)))
 
+(define u-boot-nanopi-r4s-rk3399-bootloader
+  (bootloader
+   (inherit u-boot-bootloader)
+   (package u-boot-nanopi-r4s-rk3399)
+   (disk-image-installer install-nanopi-r4s-rk3399-u-boot)))
+
 (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader
   (bootloader
    (inherit u-boot-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 4072df50d7..f42d42c1c4 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -18,7 +18,7 @@
 ;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
 ;;; Copyright © 2021 Stefan <stefan-guix <at> vodafonemail.de>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
-;;; Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+;;; Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 ;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1237,6 +1237,21 @@ (define-public u-boot-novena
 version, contrary to Novena upstream, does not load u-boot.img from the first
 partition."))
 
+(define-public u-boot-nanopi-r4s-rk3399
+  (let ((base (make-u-boot-package "nanopi-r4s-rk3399" "aarch64-linux-gnu")))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (setenv "BL31" (search-input-file inputs "/bl31.elf"))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         (append arm-trusted-firmware-rk3399))))))
+
 (define-public u-boot-orangepi-r1-plus-lts-rk3328
   (let ((base (make-u-boot-package "orangepi-r1-plus-lts-rk3328" "aarch64-linux-gnu")))
     (package
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:02 GMT) Full text and rfc822 format available.

Message #56 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 3/8] gnu: firmware: Update make-arm-trusted-firmware to
 2.10.
Date: Mon, 26 Aug 2024 16:45:02 +0200
* gnu/packages/firmware.scm(make-arm-trusted-firmware): Update to 2.10.
---
 gnu/packages/firmware.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 4348612567..14fa72bf7e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1105,18 +1105,17 @@ (define* (make-arm-trusted-firmware platform
                                        (gnu-triplet->nix-system triplet))))))
     (package
       (name (string-append "arm-trusted-firmware-" platform))
-      (version "2.9")
+      (version "2.10")
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
-               ;; There are only GitHub generated release snapshots.
                (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
                (commit (string-append "v" version))))
          (file-name (git-file-name "arm-trusted-firmware" version))
          (sha256
           (base32
-           "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+           "099r2c5vnvl83c2saca615dryr1byj2nm6imzkg5ix4kajsry2q8"))
          (snippet
           #~(begin
               (use-modules (guix build utils))
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:02 GMT) Full text and rfc822 format available.

Message #59 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 2/8] gnu: u-boot: Use DDR3 patch for Nano Pi R4S.
Date: Mon, 26 Aug 2024 16:45:01 +0200
* gnu/packages/bootloaders.scm (%u-boot-nanopi-r4s-ddr3-patch): Add
variable.
(u-boot)[source]: Use patch.
* gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch: Add file.
* gnu/local.mk (dist_patch_DATA): Register patch.

Change-Id: Ibbf952f2806c9cac7fc29e1264d427bf6ee67d01
---
 gnu/local.mk                                  |  3 +-
 gnu/packages/bootloaders.scm                  |  7 +++-
 .../patches/u-boot-nanopi-r4s-ddr3.patch      | 35 +++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 11dff1c6c4..93cd03fbd7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -62,7 +62,7 @@
 # Copyright © 2023 B. Wilson <elaexuotee <at> wilsonb.com>
 # Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 # Copyright © 2023 gemmaro <gemmaro.dev <at> gmail.com>
-# Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+# Copyright © 2023-2024 Herman Rimm <herman <at> rimm.ee>
 # Copyright © 2023 Troy Figiel <troy <at> troyfigiel.com>
 # Copyright © 2024 David Elsing <david.elsing <at> posteo.net>
 # Copyright © 2024 Ashish SHUKLA <ashish.is <at> lostca.se>
@@ -2168,6 +2168,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/u-boot-build-without-libcrypto.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
+  %D%/packages/patches/u-boot-nanopi-r4s-ddr3.patch		\
   %D%/packages/patches/ucx-tcp-iface-ioctl.patch		\
   %D%/packages/patches/ultrastar-deluxe-no-freesans.patch		\
   %D%/packages/patches/ungoogled-chromium-extension-search-path.patch	\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index f42d42c1c4..1036c62de3 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -747,6 +747,10 @@ (define %u-boot-build-without-libcrypto-patch
   ;; Upstream commit to fix Amlogic builds in u-boot 2024.01.
   (search-patch "u-boot-build-without-libcrypto.patch"))
 
+(define %u-boot-nanopi-r4s-ddr3-patch
+  ;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
+  (search-patch "u-boot-nanopi-r4s-ddr3.patch"))
+
 (define u-boot
   (package
     (name "u-boot")
@@ -755,7 +759,8 @@ (define u-boot
               (patches
                (list %u-boot-rockchip-inno-usb-patch
                      %u-boot-build-without-libcrypto-patch
-                     %u-boot-allow-disabling-openssl-patch))
+                     %u-boot-allow-disabling-openssl-patch
+                     %u-boot-nanopi-r4s-ddr3-patch))
               (method url-fetch)
               (uri (string-append
                     "https://ftp.denx.de/pub/u-boot/"
diff --git a/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
new file mode 100644
index 0000000000..38825bbd1b
--- /dev/null
+++ b/gnu/packages/patches/u-boot-nanopi-r4s-ddr3.patch
@@ -0,0 +1,35 @@
+Someone created a thread on the U-Boot mailing list [1], referencing work
+done to support variants of RK3399 SoCs with different types of DRAM [2].
+This patch configures the Nano Pi R4S to use DDR3 instead of LPDDR4, but
+will be removed once [2] is included in a future U-Boot release.  This
+patch was created around April 2023 by Herman Rimm <herman <at> rimm.ee> for
+personal use and has only been submitted to GNU Guix.
+
+[1]: https://patchwork.ozlabs.org/project/uboot/patch/WwCslkoi6ts6A8RCd6KlxuRAMpItkfneEG-3BbNbG61gWVz0A2A3-0hl_Jg7W9quLr19luuiiT7naEi7djncCaEruUOnVq3pnb9dQFU_GqY=@protonmail.com/#2973664
+[2]: https://github.com/anaelorlinski/OpenWrt-NanoPi-R2S-R4S-Builds/commit/9d836044340ddef53f5d9f1946ac48c946a78284
+
+diff --git a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+index 69800cc368..a3054849f8 100644
+--- a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
++++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+@@ -13,7 +13,7 @@
+  */
+ 
+ #include "rk3399-nanopi4-u-boot.dtsi"
+-#include "rk3399-sdram-lpddr4-100.dtsi"
++#include "rk3399-sdram-ddr3-1866.dtsi"
+ 
+ / {
+ 	smbios {
+diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
+index 4f4363cb0f..bfa7ee628d 100644
+--- a/configs/nanopi-r4s-rk3399_defconfig
++++ b/configs/nanopi-r4s-rk3399_defconfig
+@@ -54,7 +54,6 @@ CONFIG_PMIC_RK8XX=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_REGULATOR_RK8XX=y
+ CONFIG_PWM_ROCKCHIP=y
+-CONFIG_RAM_ROCKCHIP_LPDDR4=y
+ CONFIG_BAUDRATE=1500000
+ CONFIG_DEBUG_UART_SHIFT=2
+ CONFIG_SYS_NS16550_MEM32=y
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:03 GMT) Full text and rfc822 format available.

Message #62 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 4/8] gnu: u-boot: Update to 2024.07.
Date: Mon, 26 Aug 2024 16:45:03 +0200
* gnu/packages/bootloaders.scm (u-boot): Update to 2024.07.
[source]: Remove build-without-libcrypto patch.
(%u-boot-build-without-libcrypto-patch): Remove variable.
(u-boot-tools)[arguments]: Disable sandbox tests and kwbimage.
* gnu/packages/patches/u-boot-build-without-libcrypto.patch: Delete
file.
* gnu/local.mk (dist_patch_DATA): Remove patch.

Change-Id: I85863adb0324461fabf164d3e936d922ade3aa69
---
 gnu/local.mk                                  |   1 -
 gnu/packages/bootloaders.scm                  |  26 ++--
 .../u-boot-build-without-libcrypto.patch      | 123 ------------------
 3 files changed, 13 insertions(+), 137 deletions(-)
 delete mode 100644 gnu/packages/patches/u-boot-build-without-libcrypto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 93cd03fbd7..5ca975fbe7 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2165,7 +2165,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
   %D%/packages/patches/twinkle-bcg729.patch			\
   %D%/packages/patches/u-boot-allow-disabling-openssl.patch	\
-  %D%/packages/patches/u-boot-build-without-libcrypto.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
   %D%/packages/patches/u-boot-rockchip-inno-usb.patch		\
   %D%/packages/patches/u-boot-nanopi-r4s-ddr3.patch		\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 1036c62de3..fa9acd0bd9 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -743,10 +743,6 @@ (define %u-boot-allow-disabling-openssl-patch
   ;; https://lists.denx.de/pipermail/u-boot/2021-October/462728.html
   (search-patch "u-boot-allow-disabling-openssl.patch"))
 
-(define %u-boot-build-without-libcrypto-patch
-  ;; Upstream commit to fix Amlogic builds in u-boot 2024.01.
-  (search-patch "u-boot-build-without-libcrypto.patch"))
-
 (define %u-boot-nanopi-r4s-ddr3-patch
   ;; Use DDR3 instead of LPDDR4 for the Nano Pi R4S U-boot.
   (search-patch "u-boot-nanopi-r4s-ddr3.patch"))
@@ -754,11 +750,10 @@ (define %u-boot-nanopi-r4s-ddr3-patch
 (define u-boot
   (package
     (name "u-boot")
-    (version "2024.01")
+    (version "2024.07")
     (source (origin
               (patches
                (list %u-boot-rockchip-inno-usb-patch
-                     %u-boot-build-without-libcrypto-patch
                      %u-boot-allow-disabling-openssl-patch
                      %u-boot-nanopi-r4s-ddr3-patch))
               (method url-fetch)
@@ -767,7 +762,7 @@ (define u-boot
                     "u-boot-" version ".tar.bz2"))
               (sha256
                (base32
-                "1czmpszalc6b8cj9j7q6cxcy19lnijv3916w3dag6yr3xpqi35mr"))))
+                "13rwv28g6z8ihrs8k0066gblw37rvw6nsxkks6rxdwqfp6ddm4gm"))))
     (build-system gnu-build-system)
     (native-inputs
      (list bison
@@ -864,9 +859,11 @@ (define-public u-boot-tools
                (("\\./tools/patman/patman") (which "true"))
                ;; FIXME: test fails, needs further investiation
                (("run_test \"binman\"") "# run_test \"binman\"")
-               ;; FIXME: test_spl fails, needs further investiation
-               (("test_ofplatdata or test_handoff or test_spl")
-                "test_ofplatdata or test_handoff")
+               ;; FIXME: tests fail without kwbimage, i.e. openssl.
+               (("run_test \"sandbox_noinst\"")
+                "# run_test \"sandbox_noinst\"")
+               (("run_test \"sandbox_vpl\"")
+                "# run_test \"sandbox_vpl\"")
                ;; FIXME: code coverage not working
                (("run_test \"binman code coverage\"")
                 "# run_test \"binman code coverage\"")
@@ -889,14 +886,16 @@ (define-public u-boot-tools
                            (("CONFIG_FIT_SIGNATURE=y")
                             "CONFIG_FIT_SIGNATURE=n
 CONFIG_UT_LIB_ASN1=n
-CONFIG_TOOLS_LIBCRYPTO=n")
+CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n")
                            ;; Catch instances of implied CONFIG_FIG_SIGNATURE
                            ;; with VPL targets
                            (("CONFIG_SANDBOX_VPL=y")
                             "CONFIG_SANDBOX_VPL=y
 CONFIG_FIT_SIGNATURE=n
 CONFIG_VPL_FIT_SIGNATURE=n
-CONFIG_TOOLS_LIBCRYPTO=n")
+CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n")
                            ;; This test requires a sound system, which is un-used
                            ;; in u-boot-tools.
                            (("CONFIG_SOUND=y") "CONFIG_SOUND=n")))
@@ -1098,7 +1097,8 @@ (define*-public (make-u-boot-package board triplet
                 (lambda _
                   (substitute* ".config"
                     (("CONFIG_TOOLS_LIBCRYPTO=.*$")
-                     "CONFIG_TOOLS_LIBCRYPTO=n"))))
+                     "CONFIG_TOOLS_LIBCRYPTO=n
+CONFIG_TOOLS_KWBIMAGE=n"))))
               (replace 'install
                 (lambda _
                   (let ((libexec (string-append #$output "/libexec"))
diff --git a/gnu/packages/patches/u-boot-build-without-libcrypto.patch b/gnu/packages/patches/u-boot-build-without-libcrypto.patch
deleted file mode 100644
index d56588941c..0000000000
--- a/gnu/packages/patches/u-boot-build-without-libcrypto.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 03e598263e3878b6f5d58f5525577903edadc644 Mon Sep 17 00:00:00 2001
-From: Paul-Erwan Rio <paulerwan.rio <at> gmail.com>
-Date: Thu, 21 Dec 2023 08:26:11 +0100
-Subject: [PATCH] tools: fix build without LIBCRYPTO support
-
-Commit cb9faa6f98ae ("tools: Use a single target-independent config to
-enable OpenSSL") introduced a target-independent configuration to build
-crypto features in host tools.
-
-But since commit 2c21256b27d7 ("hash: Use Kconfig to enable hashing in
-host tools and SPL") the build without OpenSSL is broken, due to FIT
-signature/encryption features. Add missing conditional compilation
-tokens to fix this.
-
-Signed-off-by: Paul-Erwan Rio <paulerwan.rio <at> gmail.com>
-Tested-by: Alexander Dahl <ada <at> thorsis.com>
-Cc: Simon Glass <sjg <at> chromium.org>
-Reviewed-by: Tom Rini <trini <at> konsulko.com>
-Reviewed-by: Simon Glass <sjg <at> chromium.org>
----
- include/image.h    | 2 +-
- tools/Kconfig      | 1 +
- tools/fit_image.c  | 2 +-
- tools/image-host.c | 4 ++++
- tools/mkimage.c    | 5 +++--
- 5 files changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/include/image.h b/include/image.h
-index 432ec927b1..21de70f0c9 100644
---- a/include/image.h
-+++ b/include/image.h
-@@ -1465,7 +1465,7 @@ int calculate_hash(const void *data, int data_len, const char *algo,
-  * device
-  */
- #if defined(USE_HOSTCC)
--# if defined(CONFIG_FIT_SIGNATURE)
-+# if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- #  define IMAGE_ENABLE_SIGN	1
- #  define FIT_IMAGE_ENABLE_VERIFY	1
- #  include <openssl/evp.h>
-diff --git a/tools/Kconfig b/tools/Kconfig
-index f8632cd59d..f01ed783e6 100644
---- a/tools/Kconfig
-+++ b/tools/Kconfig
-@@ -51,6 +51,7 @@ config TOOLS_FIT_RSASSA_PSS
- 	  Support the rsassa-pss signature scheme in the tools builds
- 
- config TOOLS_FIT_SIGNATURE
-+	depends on TOOLS_LIBCRYPTO
- 	def_bool y
- 	help
- 	  Enable signature verification of FIT uImages in the tools builds
-diff --git a/tools/fit_image.c b/tools/fit_image.c
-index 71e031c855..beef1fa86e 100644
---- a/tools/fit_image.c
-+++ b/tools/fit_image.c
-@@ -61,7 +61,7 @@ static int fit_add_file_data(struct image_tool_params *params, size_t size_inc,
- 		ret = fit_set_timestamp(ptr, 0, time);
- 	}
- 
--	if (!ret)
-+	if (CONFIG_IS_ENABLED(FIT_SIGNATURE) && !ret)
- 		ret = fit_pre_load_data(params->keydir, dest_blob, ptr);
- 
- 	if (!ret) {
-diff --git a/tools/image-host.c b/tools/image-host.c
-index ca4950312f..90bc9f905f 100644
---- a/tools/image-host.c
-+++ b/tools/image-host.c
-@@ -14,8 +14,10 @@
- #include <image.h>
- #include <version.h>
- 
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- #include <openssl/pem.h>
- #include <openssl/evp.h>
-+#endif
- 
- /**
-  * fit_set_hash_value - set hash value in requested has node
-@@ -1131,6 +1133,7 @@ static int fit_config_add_verification_data(const char *keydir,
- 	return 0;
- }
- 
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- /*
-  * 0) open file (open)
-  * 1) read certificate (PEM_read_X509)
-@@ -1239,6 +1242,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit)
-  out:
- 	return ret;
- }
-+#endif
- 
- int fit_cipher_data(const char *keydir, void *keydest, void *fit,
- 		    const char *comment, int require_keys,
-diff --git a/tools/mkimage.c b/tools/mkimage.c
-index 6dfe3e1d42..ac62ebbde9 100644
---- a/tools/mkimage.c
-+++ b/tools/mkimage.c
-@@ -115,7 +115,7 @@ static void usage(const char *msg)
- 		"          -B => align size in hex for FIT structure and header\n"
- 		"          -b => append the device tree binary to the FIT\n"
- 		"          -t => update the timestamp in the FIT\n");
--#ifdef CONFIG_FIT_SIGNATURE
-+#if CONFIG_IS_ENABLED(FIT_SIGNATURE)
- 	fprintf(stderr,
- 		"Signing / verified boot options: [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r] [-N engine]\n"
- 		"          -k => set directory containing private keys\n"
-@@ -130,8 +130,9 @@ static void usage(const char *msg)
- 		"          -o => algorithm to use for signing\n");
- #else
- 	fprintf(stderr,
--		"Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n");
-+		"Signing / verified boot not supported (CONFIG_TOOLS_FIT_SIGNATURE undefined)\n");
- #endif
-+
- 	fprintf(stderr, "       %s -V ==> print version information and exit\n",
- 		params.cmdname);
- 	fprintf(stderr, "Use '-T list' to see a list of available image types\n");
--- 
-2.41.0
-
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:03 GMT) Full text and rfc822 format available.

Message #65 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 5/8] gnu: python-u-boot-pylib: Fix pyproject.toml.
Date: Mon, 26 Aug 2024 16:45:04 +0200
* gnu/packages/bootloaders.scm (python-u-boot-pylib)[arguments]: Add
list-package phase.
---
 gnu/packages/bootloaders.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index fa9acd0bd9..d8d1add399 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -958,6 +958,13 @@ (define-public python-u-boot-pylib
           (add-after 'unpack 'chdir
             (lambda _
               (chdir "tools/u_boot_pylib")))
+          (add-after 'chdir 'list-package
+            (lambda _
+              (let ((port (open-file "pyproject.toml" "a")))
+                (display "[tool.setuptools.packages.find]\n" port)
+                (display "where = [\"..\"]\n" port)
+                (display "include = [\"u_boot_pylib*\"]" port)
+                (close-port port))))
           (replace 'check
             (lambda* (#:key tests? #:allow-other-keys)
               (when tests?
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:04 GMT) Full text and rfc822 format available.

Message #68 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 6/8] gnu: u-boot-rockpro64-rk3399: Unconfigure
 CONFIG_DM_SCSI.
Date: Mon, 26 Aug 2024 16:45:05 +0200
* gnu/packages/bootloaders (u-boot-rockpro64-rk3399): Remove
CONFIG_DM_SCSI in favor of CONFIG_SCSI.
---
 gnu/packages/bootloaders.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index d8d1add399..127340d4c1 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1463,7 +1463,6 @@ (define-public u-boot-rockpro64-rk3399
                                                "CONFIG_SATA_SIL=y"
                                                "CONFIG_SCSI=y"
                                                "CONFIG_SCSI_AHCI=y"
-                                               "CONFIG_DM_SCSI=y"
                                                ;; Disable SPL FIT signatures,
                                                ;; due to GPLv2 and Openssl
                                                ;; license incompatibilities
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:04 GMT) Full text and rfc822 format available.

Message #71 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 7/8] gnu: u-boot-sandbox: Unconfigure CONFIG_RSA and
 CONFIG_TOOLS_LIBCRYPTO.
Date: Mon, 26 Aug 2024 16:45:06 +0200
* gnu/packages/bootloaders.scm (u-boot-sandbox): Remove CONFIG_RSA and
CONFIG_TOOLS_LIBCRYPTO.
---
 gnu/packages/bootloaders.scm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 127340d4c1..69c0e0fcfd 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1340,9 +1340,7 @@ (define-public u-boot-sandbox
                                "# CONFIG_IMAGE_PRE_LOAD is not set"
                                "# CONFIG_IMAGE_PRE_LOAD_SIG is not set"
                                "# CONFIG_CMD_BOOTM_PRE_LOAD is not set"
-                               "CONFIG_RSA=y"
-                               "# CONFIG_EFI_SECURE_BOOT is not set"
-                               "# CONFIG_TOOLS_LIBCRYPTO is not set")
+                               "# CONFIG_EFI_SECURE_BOOT is not set")
                #:append-description
                "The sandbox configuration of U-Boot provides a
 @command{u-boot} command that runs as a normal user space application.  It can
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Mon, 26 Aug 2024 14:48:05 GMT) Full text and rfc822 format available.

Message #74 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Subject: [PATCH v2 8/8] gnu: bootloader: Add orangepi-zero2w bootloader.
Date: Mon, 26 Aug 2024 16:45:07 +0200
* gnu/bootloader/u-boot.scm (u-boot-orangepi-zero2w-bootloader): Add
variable.
* gnu/packages/bootloaders.scm (u-boot-orangepi-zero2w): Add variable.
* gnu/packages/firmware.scm (arm-trusted-firmware-sun50i-h616): Add
variable.

Change-Id: Idb43fdabac51b3301f3bea24fec72bfa29636489
---
 gnu/bootloader/u-boot.scm    |  6 ++++++
 gnu/packages/bootloaders.scm | 18 ++++++++++++++++++
 gnu/packages/firmware.scm    |  6 ++++++
 3 files changed, 30 insertions(+)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 7888a4e030..7fd7288854 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -41,6 +41,7 @@ (define-module (gnu bootloader u-boot)
             u-boot-nintendo-nes-classic-edition-bootloader
             u-boot-novena-bootloader
             u-boot-orangepi-r1-plus-lts-rk3328-bootloader
+            u-boot-orangepi-zero2w-bootloader
             u-boot-pine64-plus-bootloader
             u-boot-pine64-lts-bootloader
             u-boot-pinebook-bootloader
@@ -296,6 +297,11 @@ (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader
    (package u-boot-orangepi-r1-plus-lts-rk3328)
    (disk-image-installer install-orangepi-r1-plus-lts-rk3328-u-boot)))
 
+(define u-boot-orangepi-zero2w-bootloader
+  (bootloader
+   (inherit u-boot-allwinner-bootloader)
+   (package u-boot-orangepi-zero2w)))
+
 (define u-boot-pine64-plus-bootloader
   (bootloader
    (inherit u-boot-allwinner64-bootloader)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 69c0e0fcfd..3befa1adfd 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1178,6 +1178,24 @@ (define*-public (make-u-boot-sunxi64-package board triplet scp-firmware
        (modify-inputs (package-inputs base)
          (append arm-trusted-firmware-sun50i-a64))))))
 
+(define-public u-boot-orangepi-zero2w
+  (let ((base (make-u-boot-package
+               "orangepi_zero2w" "aarch64-linux-gnu")))
+    (package
+      (inherit base)
+      (arguments
+       (substitute-keyword-arguments (package-arguments base)
+         ((#:phases phases)
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                  (setenv "SCP" "/dev/null")
+                  (setenv "BL31" (search-input-file inputs "bl31.bin"))))))))
+      (inputs
+       (modify-inputs (package-inputs base)
+         ;; The Zero 2W uses the slightly revised Allwinner H618.
+         (append arm-trusted-firmware-sun50i-h616))))))
+
 (define-public u-boot-pine64-plus
   (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"
                                (delay crust-pine64-plus)))
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 14fa72bf7e..8af5867dfd 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1165,6 +1165,12 @@ (define-public arm-trusted-firmware-sun50i-a64
       (inherit base)
       (name "arm-trusted-firmware-sun50i-a64"))))
 
+(define-public arm-trusted-firmware-sun50i-h616
+  (let ((base (make-arm-trusted-firmware "sun50i_h616")))
+    (package
+      (inherit base)
+      (name "arm-trusted-firmware-sun50i-h616"))))
+
 (define-public arm-trusted-firmware-rk3328
   (make-arm-trusted-firmware "rk3328"))
 
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Thu, 19 Sep 2024 10:52:02 GMT) Full text and rfc822 format available.

Message #77 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 70131 <at> debbugs.gnu.org
Cc: Vagrant Cascadian <vagrant <at> debian.org>
Subject: Re: [bug#72987] [PATCH v2] gnu: u-boot: Enlarge space available for
 kernel.
Date: Thu, 19 Sep 2024 12:50:48 +0200
Hi,

On Mon, Sep 16, 2024 at 02:10:40PM -0700, Vagrant Cascadian wrote:
> u-boot is still only version 2024.01 in guix ... sorry I have lagged at
> u-boot updates.
> 
> 
> > base-commit: a493d65d04deafb763710bb1cb0425185750327d
> 
> This appears to be from some branch not present in guix....

This patch can be applied on top of the v2 revision of issue 70131, I
must not have CC'ed you that either.

Cheers,
Herman




Information forwarded to guix-patches <at> gnu.org:
bug#70131; Package guix-patches. (Fri, 20 Sep 2024 21:54:02 GMT) Full text and rfc822 format available.

Message #80 received at 70131 <at> debbugs.gnu.org (full text, mbox):

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Herman Rimm <herman <at> rimm.ee>, 70131 <at> debbugs.gnu.org
Cc: 72987 <at> debbugs.gnu.org
Subject: Re: [bug#70131] [bug#72987] [PATCH v2] gnu: u-boot: Enlarge space
 available for kernel.
Date: Fri, 20 Sep 2024 14:52:56 -0700
[Message part 1 (text/plain, inline)]
On 2024-09-19, Herman Rimm wrote:
> On Mon, Sep 16, 2024 at 02:10:40PM -0700, Vagrant Cascadian wrote:
>> u-boot is still only version 2024.01 in guix ... sorry I have lagged at
>> u-boot updates.
>> 
>> 
>> > base-commit: a493d65d04deafb763710bb1cb0425185750327d
>> 
>> This appears to be from some branch not present in guix....
>
> This patch can be applied on top of the v2 revision of issue 70131, I
> must not have CC'ed you that either.

Or the bug you were replying to, done so now, so people know what is
up. :)

live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.