efraim pushed a commit to branch wip-riscv
in repository guix.
commit c94fde755c092968ee61720a5e02edee4b82136e
Author: Efraim Flashner <[email protected]>
AuthorDate: Sat Sep 4 21:38:57 2021 +0300
gnu: Add u-boot-sifive-unmatched-bootloader.
* gnu/bootloader/u-boot.scm (u-boot-sifive-unmatched-bootloader): New
variable.
---
gnu/bootloader/u-boot.scm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 6cad33b..ad0003e 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2017, 2019 Mathieu Othacehe <[email protected]>
;;; Copyright © 2020 Julien Lepiller <[email protected]>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <[email protected]>
+;;; Copyright © 2021 Efraim Flashner <[email protected]>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,7 +43,8 @@
u-boot-puma-rk3399-bootloader
u-boot-rock64-rk3328-bootloader
u-boot-rockpro64-rk3399-bootloader
- u-boot-wandboard-bootloader))
+ u-boot-wandboard-bootloader
+ u-boot-sifive-unmatched-bootloader))
(define install-u-boot
#~(lambda (bootloader root-index image)
@@ -127,6 +129,16 @@
(define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot)
+(define install-sifive-unmatched-u-boot
+ #~(lambda (bootloader root-index image)
+ (let ((spl (string-append bootloader "/libexec/spl/u-boot-spl.bin"))
+ (u-boot (string-append bootloader "/libexec/u-boot.itb")))
+ ;;
https://source.denx.de/u-boot/u-boot/-/blob/master/doc/board/sifive/unmatched.rst
+ (write-file-on-device spl (stat:size (stat spl))
+ image (* 34 512))
+ (write-file-on-device u-boot (stat:size (stat u-boot))
+ image (* 2082 512)))))
+
;;;
@@ -255,3 +267,9 @@
(inherit u-boot-bootloader)
(package u-boot-pinebook-pro-rk3399)
(disk-image-installer install-pinebook-pro-rk3399-u-boot)))
+
+(define u-boot-sifive-unmatched-bootloader
+ (bootloader
+ (inherit u-boot-bootloader)
+ (package u-boot-sifive-unmatched)
+ (disk-image-installer install-sifive-unmatched-u-boot)))