summaryrefslogtreecommitdiff
path: root/gnu/bootloader
diff options
context:
space:
mode:
authorZheng Junjie <zhengjunjie@iscas.ac.cn>2024-05-11 13:32:57 +0800
committerZheng Junjie <zhengjunjie@iscas.ac.cn>2024-05-22 11:15:30 +0800
commitc7aec90a916a99067fd9915337caf098ee8e5083 (patch)
tree4893c77f66705bc42505015e9eea63248de76bca /gnu/bootloader
parent08474ff6ecf9472b58d188ce2a03a1c4f3f1a146 (diff)
bootloader: Add u-boot-starfive-visionfive2-bootloader.
* gnu/bootloader/u-boot.scm (u-boot-starfive-visionfive2-bootloader): New variable. Change-Id: I4b73906fe18d481644102c271f5e0883167b3a50
Diffstat (limited to 'gnu/bootloader')
-rw-r--r--gnu/bootloader/u-boot.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 8e7cc05191d..c5437a7b63b 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -49,6 +49,7 @@
49 u-boot-rockpro64-rk3399-bootloader 49 u-boot-rockpro64-rk3399-bootloader
50 u-boot-sifive-unmatched-bootloader 50 u-boot-sifive-unmatched-bootloader
51 u-boot-qemu-riscv64-bootloader 51 u-boot-qemu-riscv64-bootloader
52 u-boot-starfive-visionfive2-bootloader
52 u-boot-ts7970-q-2g-1000mhz-c-bootloader 53 u-boot-ts7970-q-2g-1000mhz-c-bootloader
53 u-boot-wandboard-bootloader)) 54 u-boot-wandboard-bootloader))
54 55
@@ -159,6 +160,27 @@
159 (write-file-on-device u-boot (stat:size (stat u-boot)) 160 (write-file-on-device u-boot (stat:size (stat u-boot))
160 image (* 2082 512))))) 161 image (* 2082 512)))))
161 162
163(define install-starfive-visionfive2-u-boot
164 #~(lambda (bootloader root-index image)
165 (let ((spl (string-append
166 bootloader "/libexec/spl/u-boot-spl.bin.normal.out"))
167 (u-boot (string-append bootloader "/libexec/u-boot.itb")))
168 (write-file-on-device spl (stat:size (stat spl))
169 image (* 34 512))
170 (write-file-on-device u-boot (stat:size (stat u-boot))
171 image (* 2082 512)))))
172
173(define install-starfive-visionfive2-uEnv.txt
174 #~(lambda (bootloader device mount-point)
175 (mkdir-p (string-append mount-point "/boot"))
176 (call-with-output-file (string-append mount-point "/boot/uEnv.txt")
177 (lambda (port)
178 (format port
179 ;; if board SPI use vender's u-boot, will find
180 ;; ""starfive/starfive_visionfive2.dtb"", We cannot guarantee
181 ;; that users will update this u-boot, so set it.
182 "fdtfile=starfive/jh7110-starfive-visionfive-2-v1.3b.dtb~%")))))
183
162(define install-qemu-riscv64-u-boot 184(define install-qemu-riscv64-u-boot
163 #~(lambda (bootloader device mount-point) 185 #~(lambda (bootloader device mount-point)
164 (let ((u-boot.bin (string-append bootloader "/libexec/u-boot.bin")) 186 (let ((u-boot.bin (string-append bootloader "/libexec/u-boot.bin"))
@@ -316,6 +338,13 @@
316 (package u-boot-sifive-unmatched) 338 (package u-boot-sifive-unmatched)
317 (disk-image-installer install-sifive-unmatched-u-boot))) 339 (disk-image-installer install-sifive-unmatched-u-boot)))
318 340
341(define u-boot-starfive-visionfive2-bootloader
342 (bootloader
343 (inherit u-boot-bootloader)
344 (package u-boot-starfive-visionfive2)
345 (installer install-starfive-visionfive2-uEnv.txt)
346 (disk-image-installer install-starfive-visionfive2-u-boot)))
347
319(define u-boot-qemu-riscv64-bootloader 348(define u-boot-qemu-riscv64-bootloader
320 (bootloader 349 (bootloader
321 (inherit u-boot-bootloader) 350 (inherit u-boot-bootloader)