aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/firmware.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-02-03 15:45:44 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-02-03 15:45:44 +0100
commit52665d2b6bd709ba46c1e364a6d6164f5f4824ff (patch)
tree55fd79b3939c08f6f6e9fe383f0df5e4caa82b57 /gnu/packages/firmware.scm
parent584d08c5c98cb1893e4f44bd1c4191f405b13f01 (diff)
parent0a83339bb1429332ee889e9a976aa214ae2ac0db (diff)
downloadpatches-52665d2b6bd709ba46c1e364a6d6164f5f4824ff.tar
patches-52665d2b6bd709ba46c1e364a6d6164f5f4824ff.tar.gz
Merge branch 'staging' into core-updates
Diffstat (limited to 'gnu/packages/firmware.scm')
-rw-r--r--gnu/packages/firmware.scm63
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index ab03bc32fd..bec582d982 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -184,6 +184,69 @@ Broadcom/AirForce chipset BCM43xx with Wireless-Core Revision 5. It is used
by the b43-open driver of Linux-libre.")
(license license:gpl2)))
+(define* (make-opensbi-package platform variant #:optional (arch "riscv64"))
+ (package
+ (name (string-replace-substring
+ (string-append "opensbi-" platform "-" variant)
+ "_" "-"))
+ (version "0.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/riscv/opensbi.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0qc73xbiy79qqkwxmp4mg15q8n8k26njkyqb6n0jw5dyibd6hb85"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(,@(if (and (not (string-prefix? "riscv64" (%current-system)))
+ (string-prefix? "riscv64" arch))
+ `(("cross-gcc" ,(cross-gcc "riscv64-linux-gnu" #:xgcc gcc-7))
+ ("cross-binutils" ,(cross-binutils "riscv64-linux-gnu")))
+ '())))
+ (arguments
+ `(#:tests? #f ; no check target
+ #:make-flags (list (string-append "PLATFORM=" ,platform "/" ,variant)
+ ,@(if (and (not (string-prefix? "riscv64"
+ (%current-system)))
+ (string-prefix? "riscv64" arch))
+ `("CROSS_COMPILE=riscv64-linux-gnu-")
+ '())
+ "FW_PAYLOAD=n"
+ "V=1")
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (bin (find-files "." ".*fw_.*.elf$")))
+ (for-each
+ (lambda (file)
+ (install-file file out))
+ bin))
+ #t)))))
+ (home-page "https://github.com/riscv/opensbi")
+ (synopsis "RISC-V Open Source Supervisor Binary Interface")
+ (description "A reference implementation of the RISC-V SBI specifications
+for platform-specific firmwares executing in M-mode.")
+ (license (list license:bsd-2
+ ;; lib/utils/libfdt/* is dual licensed under bsd-2 and gpl2+.
+ license:gpl2+
+ ;; platform/ariane-fpga/* is gpl2.
+ license:gpl2))))
+
+(define-public opensbi-qemu-virt
+ (make-opensbi-package "qemu" "virt"))
+
+(define-public opensbi-qemu-sifive-u
+ (make-opensbi-package "qemu" "sifive_u"))
+
+(define-public opensbi-sifive-fu540
+ (make-opensbi-package "sifive" "fu540"))
+
(define-public seabios
(package
(name "seabios")