aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/firmware.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-03-29 17:34:41 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-03-29 17:34:41 +0200
commit5576cfabf3485e0cf794cc3de085a3578151ee64 (patch)
tree8ca4093d05fda6b0064d0fca429353327ec491f9 /gnu/packages/firmware.scm
parent12cb6c31df4b90d58658e88a256e36b6808e1064 (diff)
parente086d2f68b90a39bae07ae46572e5cc6b0fc4308 (diff)
downloadguix-5576cfabf3485e0cf794cc3de085a3578151ee64.tar
guix-5576cfabf3485e0cf794cc3de085a3578151ee64.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/firmware.scm')
-rw-r--r--gnu/packages/firmware.scm97
1 files changed, 96 insertions, 1 deletions
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 714af3df72..9e91ceca4e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2017 David Craven <david@craven.ch>
-;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
@@ -24,6 +24,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
@@ -33,6 +34,7 @@
#:use-module (gnu packages cmake)
#:use-module (gnu packages cross-base)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages linux)
#:use-module (gnu packages perl)
#:use-module (gnu packages python))
@@ -309,3 +311,96 @@ coreboot.")
Virtual Machines. OVMF contains a sample UEFI firmware for QEMU and KVM.")
(license (list license:expat
license:bsd-2 license:bsd-3 license:bsd-4))))
+
+(define* (make-arm-trusted-firmware platform #:optional (arch "aarch64"))
+ (package
+ (name (string-append "arm-trusted-firmware-" platform))
+ (version "1.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ ;; There are only GitHub generated release snapshots.
+ (url "https://github.com/ARM-software/arm-trusted-firmware.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "arm-trusted-firmware" version))
+ (sha256
+ (base32
+ "1gm0bn2llzfzz9bfsz11fhwxj5lxvyrq7bc13fjj033nljzxn7k8"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (bin (find-files "." ".*\\.bin$")))
+ (for-each
+ (lambda (file)
+ (install-file file out))
+ bin))
+ #t)))
+ #:make-flags (list (string-append "PLAT=" ,platform)
+ ,@(if (and (not (string-prefix? "aarch64"
+ (%current-system)))
+ (string-prefix? "aarch64" arch))
+ `("CROSS_COMPILE=aarch64-linux-gnu-")
+ '())
+ ,@(if (and (not (string-prefix? "armhf"
+ (%current-system)))
+ (string-prefix? "armhf" arch))
+ `("CROSS_COMPILE=arm-linux-gnueabihf-")
+ '())
+ "DEBUG=1")
+ #:tests? #f)) ; no tests
+ (native-inputs
+ `(,@(if (and (not (string-prefix? "aarch64" (%current-system)))
+ (string-prefix? "aarch64" arch))
+ ;; gcc-7 since it is used for u-boot, which needs gcc-7.
+ `(("cross-gcc" ,(cross-gcc "aarch64-linux-gnu" #:xgcc gcc-7))
+ ("cross-binutils" ,(cross-binutils "aarch64-linux-gnu")))
+ '())
+ ,@(if (and (not (string-prefix? "armhf" (%current-system)))
+ (string-prefix? "armhf" arch))
+ ;; gcc-7 since it is used for u-boot, which needs gcc-7.
+ `(("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf" #:xgcc gcc-7))
+ ("cross-binutils" ,(cross-binutils "arm-linux-gnueabihf")))
+ '())
+ ))
+ (home-page "https://github.com/ARM-software/arm-trusted-firmware")
+ (synopsis "Implementation of \"secure world software\"")
+ (description
+ "ARM Trusted Firmware provides a reference implementation of secure world
+software for ARMv7A and ARMv8-A, including a Secure Monitor executing at
+@dfn{Exception Level 3} (EL3). It implements various ARM interface standards,
+such as:
+@enumerate
+@item The Power State Coordination Interface (PSCI)
+@item Trusted Board Boot Requirements (TBBR, ARM DEN0006C-1)
+@item SMC Calling Convention
+@item System Control and Management Interface
+@item Software Delegated Exception Interface (SDEI)
+@end enumerate\n")
+ (license (list license:bsd-3
+ license:bsd-2)))) ; libfdt
+
+(define-public arm-trusted-firmware-pine64-plus
+ (let ((base (make-arm-trusted-firmware "sun50iw1p1"))
+ ;; Vendor's arm trusted firmware branch hasn't been upstreamed yet.
+ (commit "ae78724247a01560164d607ed66db111c74d8df0")
+ (revision "1"))
+ (package
+ (inherit base)
+ (name "arm-trusted-firmware-pine64-plus")
+ (version (string-append "1.2-" revision "." (string-take commit 7)))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/apritzel/arm-trusted-firmware.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0r4xnlq7v9khjfcg6gqp7nmrmnw4z1r8bipwdr07png1dcbb8214")))))))