all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 70131@debbugs.gnu.org
Cc: Herman Rimm <herman@rimm.ee>,
	Efraim Flashner <efraim@flashner.co.il>,
	Vagrant Cascadian <vagrant@debian.org>
Subject: [bug#70131] [PATCH 1/5] gnu: bootloader: Add nanopi-r4s-rk3399 bootloader.
Date: Mon,  1 Apr 2024 22:22:29 +0200	[thread overview]
Message-ID: <ff1827d6b95cdea8129ad5ccaa2967312f0c6df0.1712001963.git.herman@rimm.ee> (raw)
In-Reply-To: <cover.1712001963.git.herman@rimm.ee>

* 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@gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2023 Herman Rimm <herman_rimm@protonmail.com>
+;;; Copyright © 2023-2024 Herman Rimm <herman@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@cyberdimension.org>
 ;;; Copyright © 2021 Stefan <stefan-guix@vodafonemail.de>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
-;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
+;;; Copyright © 2023-2024 Herman Rimm <herman@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





  reply	other threads:[~2024-04-01 20:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 20:20 [bug#70131] [PATCH 0/5] Add bootloaders and update U-Boot Herman Rimm via Guix-patches via
2024-04-01 20:22 ` Herman Rimm via Guix-patches via [this message]
2024-04-01 20:22 ` [bug#70131] [PATCH 2/5] gnu: u-boot: Use DDR3 patch for Nano Pi R4S Herman Rimm via Guix-patches via
2024-04-01 20:22 ` [bug#70131] [PATCH 3/5] gnu: firmware: Update make-arm-trusted-firmware to 2.10 Herman Rimm via Guix-patches via
2024-04-01 20:22 ` [bug#70131] [PATCH 4/5] gnu: u-boot: Update to 2024.04-rc5 Herman Rimm via Guix-patches via
2024-04-01 20:22 ` [bug#70131] [PATCH 5/5] gnu: bootloader: Add orangepi-zero2w bootloader Herman Rimm via Guix-patches via
2024-05-09  5:35 ` [bug#70131] [PATCH 0/5] Update U-boot Herman Rimm via Guix-patches via
2024-05-09  5:35   ` [bug#70131] [PATCH 1/5] gnu: bootloader: Add nanopi-r4s-rk3399 bootloader Herman Rimm via Guix-patches via
2024-05-09  5:35   ` [bug#70131] [PATCH 2/5] gnu: u-boot: Use DDR3 patch for Nano Pi R4S Herman Rimm via Guix-patches via
2024-05-15 18:16     ` Vagrant Cascadian
2024-05-09  5:35   ` [bug#70131] [PATCH 3/5] gnu: firmware: Update make-arm-trusted-firmware to 2.10 Herman Rimm via Guix-patches via
2024-05-09  5:35   ` [bug#70131] [PATCH 4/5] gnu: u-boot: Update to 2024.04 Herman Rimm via Guix-patches via
2024-05-09  5:35   ` [bug#70131] [PATCH 5/5] gnu: bootloader: Add orangepi-zero2w bootloader Herman Rimm via Guix-patches via
2024-05-15 20:26   ` [bug#70131] [PATCH 0/5] Update U-boot Vagrant Cascadian
2024-05-16  7:28     ` Herman Rimm via Guix-patches via
2024-05-16 15:56       ` Vagrant Cascadian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff1827d6b95cdea8129ad5ccaa2967312f0c6df0.1712001963.git.herman@rimm.ee \
    --to=guix-patches@gnu.org \
    --cc=70131@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    --cc=herman@rimm.ee \
    --cc=vagrant@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.