unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: nomble@palism.com
To: 37741@debbugs.gnu.org
Cc: Vagrant Cascadian <vagrant@debian.org>,
	Danny Milosavljevic <dannym@scratchpost.org>,
	Caliph Nomble <nomble@palism.com>
Subject: [bug#37741] [PATCH 3/3] gnu: Add u-boot-rockpro64-rk3399
Date: Mon, 14 Oct 2019 02:01:53 -0400	[thread overview]
Message-ID: <20191014060153.31198-1-nomble@palism.com> (raw)
In-Reply-To: <20191014001407.28367-1-nomble@palism.com>

From: Caliph Nomble <nomble@palism.com>

* gnu/packages/bootloaders.scm (u-boot-rockpro64-rk3399): New exported
variable.
* gnu/bootloader/u-boot.scm (u-boot-rockpro64-rk3399-bootloader): New exported
variable.
(install-rockpro64-rk3399-u-boot): New variable.
* gnu/system/install.scm (rockpro64-installation-os): New exported variable.

Signed-off-by: Caliph Nomble <nomble@palism.com>
---
 gnu/bootloader/u-boot.scm    | 17 +++++++++++++++++
 gnu/packages/bootloaders.scm | 20 ++++++++++++++++++++
 gnu/system/install.scm       |  6 ++++++
 3 files changed, 43 insertions(+)

diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 54abfe1c69..4f98be2483 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -34,6 +34,7 @@
             u-boot-pine64-plus-bootloader
             u-boot-pinebook-bootloader
             u-boot-puma-rk3399-bootloader
+            u-boot-rockpro64-rk3399-bootloader
             u-boot-wandboard-bootloader))
 
 (define install-u-boot
@@ -90,6 +91,15 @@
         (write-file-on-device u-boot (stat:size (stat u-boot))
                               device (* 512 512)))))
 
+(define install-rockpro64-rk3399-u-boot
+  #~(lambda (bootloader device mount-point)
+      (let ((idb (string-append bootloader "/libexec/idbloader.img"))
+            (u-boot (string-append bootloader "/libexec/u-boot.itb")))
+        (write-file-on-device idb (stat:size (stat idb))
+                              device (* 64 512))
+        (write-file-on-device u-boot (stat:size (stat u-boot))
+                              device (* 16384 512)))))
+
 \f
 
 ;;;
@@ -179,3 +189,10 @@
    (inherit u-boot-bootloader)
    (package u-boot-puma-rk3399)
    (installer install-puma-rk3399-u-boot)))
+
+(define u-boot-rockpro64-rk3399-bootloader
+  ;; SD and eMMC use the same format
+  (bootloader
+   (inherit u-boot-bootloader)
+   (package u-boot-rockpro64-rk3399)
+   (installer install-rockpro64-rk3399-u-boot)))
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 91f27d2e38..16cb72b46c 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -743,6 +743,26 @@ to Novena upstream, does not load u-boot.img from the first partition.")
          ("firmware-m0" ,rk3399-cortex-m0)
          ,@(package-native-inputs base))))))
 
+(define-public u-boot-rockpro64-rk3399
+  (let ((base (make-u-boot-package "rockpro64-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" (string-append (assoc-ref inputs "firmware")
+                                                "/bl31.elf"))
+                  #t))
+              ;; Phases do not succeed on the bl31 ELF.
+              (delete 'strip)
+              (delete 'validate-runpath)))))
+      (native-inputs
+       `(("firmware" ,arm-trusted-firmware-rk3399)
+         ,@(package-native-inputs base))))))
+
 (define-public vboot-utils
   (package
     (name "vboot-utils")
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 912096027f..eab3649269 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -62,6 +62,7 @@
             novena-installation-os
             pine64-plus-installation-os
             pinebook-installation-os
+            rockpro64-installation-os
             rk3399-puma-installation-os
             wandboard-installation-os
             os-with-u-boot))
@@ -583,6 +584,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-TARGET."
                             "/dev/mmcblk0" ; SD card storage
                             "ttyS0"))
 
+(define rockpro64-installation-os
+  (embedded-installation-os u-boot-rockpro64-rk3399-bootloader
+                            "/dev/mmcblk0" ; SD card/eMMC (SD priority) storage
+                            "ttyS2")) ; UART2 connected on the Pi2 bus
+
 (define rk3399-puma-installation-os
   (embedded-installation-os u-boot-puma-rk3399-bootloader
                             "/dev/mmcblk0" ; SD card storage
-- 
2.21.0

  parent reply	other threads:[~2019-10-14  6:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  0:14 [bug#37741] [PATCH 0/3] Update u-boot to 2019.10 and add u-boot-rockpro64-rk3399 nomble
2019-10-14  6:01 ` [bug#37741] [PATCH 1/3] gnu: u-boot: Update to 2019.10 nomble
2019-10-15  4:07   ` Vagrant Cascadian
2019-10-14  6:01 ` [bug#37741] [PATCH 2/3] gnu: Add arm-trusted-firmware-rk3399 nomble
2019-10-15  4:02   ` Vagrant Cascadian
2019-10-15  6:38     ` Kever Yang
2019-10-17  5:46       ` Vagrant Cascadian
2019-10-17  6:43         ` Kever Yang
2019-10-18 19:22           ` Vagrant Cascadian
2019-10-14  6:01 ` nomble [this message]
2019-10-18 20:44 ` bug#37741: [PATCH 0/3] Update u-boot to 2019.10 and add u-boot-rockpro64-rk3399 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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20191014060153.31198-1-nomble@palism.com \
    --to=nomble@palism.com \
    --cc=37741@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).