Subject: [bug#37741] [PATCH 2/3] gnu: Add arm-trusted-firmware-rk3399.

From: [email-masked]
Date: Mon, 14 Oct 2019 02:01:36 -0400

From: Caliph Nomble <[email-masked]>

* gnu/packages/bootloaders.scm (arm-trusted-firmware-rk3399): New exported
variable.

Signed-off-by: Caliph Nomble <[email-masked]>
---
 gnu/packages/firmware.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index c473ccd920..636b1f4746 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -476,6 +476,29 @@ such as:
            (base32
             "0vqhwqqh8h9qlkpybg2v94911091c1418bc4pnzq5fd7zf0fjkf8")))))))
 
+(define-public arm-trusted-firmware-rk3399
+  (let ((base (make-arm-trusted-firmware "rk3399")))
+    (package
+      (inherit base)
+      (name "arm-trusted-firmware-rk3399")
+      (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:phases phases)
+           `(modify-phases ,phases
+              (add-after 'install 'install-elf
+                (lambda* (#:key outputs #:allow-other-keys)
+                  (let ((out (assoc-ref outputs "out"))
+                        (elf (find-files "." ".*\\.elf$")))
+                    (for-each
+                      (lambda (file)
+                        (install-file file out))
+                      elf))
+                  #t))))))
+      (native-inputs
+       `(("cross32-gcc" ,(cross-gcc "arm-none-eabi"))
+         ("cross32-binutils", (cross-binutils "arm-none-eabi"))
+         ,@(package-native-inputs base))))))
+
 (define-public rk3399-cortex-m0
   (package
     (name "rk3399-cortex-m0")
-- 
2.21.0