diff mbox series

[bug#48371] Add crust firmware for sunxi devices

Message ID 87o8ctf1ot.fsf@yucca
State New
Headers show
Series [bug#48371] Add crust firmware for sunxi devices | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Vagrant Cascadian May 30, 2021, 1:30 a.m. UTC
On 2021-05-29, Vagrant Cascadian wrote:
> On 2021-05-13, Maxime Devos wrote:
>> Vagrant Cascadian schreef op di 11-05-2021 om 15:15 [-0700]:
>>> +       #:make-flags (list
>>> +                     "CROSS_COMPILE=or1k-elf-"
>>> +                     "DEBUG=1"
>>> +                     "HOSTCC=gcc"
>>> +                     "HOSTAR=ar"
>>> +                     "HOST_COMPILE=aarch64-linux-gnu-"
>>> +                     "LEX=flex")
>>
>> IIUC, CROSS_COMPILE is the system Crust will run on, and HOST_COMPILE
>> is the system where Crust is compiled. So shouldn't HOST_COMPILE be
>>
>>   (string-append (nix-system->gnu-triplet (%current-system)) "-")
>>
>> such that Crust can be cross-compiled from non-aarch64 or non-linux systems?
>
> Good point!
...
> Setting HOST_COMPILE to an empty value appears to work and it just uses
> the defined HOSTCC and HOSTAR, so this is probably better anyways!

Or dropping it entirely; it was only used to define HOSTCC and HOSTAR,
which we set explicitly.

> There's a new crust version available, so I'll give that a quick test
> before sending updated patches.

Updated patches attached.


live well,
  vagrant

Comments

Maxim Cournoyer July 7, 2023, 8:07 p.m. UTC | #1
Hi Vagrant,

[...]

> live well,
>   vagrant
>
> From 75dff89f75481cea087890d28568017996e88da5 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <vagrant@debian.org>
> Date: Tue, 11 May 2021 20:57:50 +0000
> Subject: [PATCH 1/2] gnu: Add crust-pinebook and crust-pine64-plus.
>
> * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Add or1k-elf.
>   gnu/packages/firmware.scm (make-crust-package, crust-pinebook,
>   crust-pine64-plus): New variables.

I've updated the package description for 2023 and standardized the
installation prefixes to use /libexec for the main payload as well as
/bin for the tools (load), and made sure the 'load' binary could be
correctly cross-compiled.  See 4f32e8d7cc35fa76933a5fc69e584dbc7033e9fc.
diff mbox series

Patch

From 719fc2874daa5fd5772c2c0d146e8d6fb9f1377b Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Tue, 11 May 2021 21:15:15 +0000
Subject: [PATCH 2/2] gnu: u-boot: Add crust firmware to pinebook, pine64_plus
 and pine64-lts.

* gnu/packages/bootloaders.scm (make-u-boot-sunxi64-package): Take argument
  for System Control Processor (SCP) firmware.
  [native-inputs]: Add SCP firmware.
  (u-boot-pine64-plus, u-boot-pine64-lts, u-boot-pinebook): Pass appropriate
  crust firmware as the SCP firmware.
---
 gnu/packages/bootloaders.scm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 56bef57cb7..6f1bb5b8c9 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -737,7 +737,7 @@  it fits within common partitioning schemes.")
 (define-public u-boot-am335x-evm
   (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf"))
 
-(define-public (make-u-boot-sunxi64-package board triplet)
+(define-public (make-u-boot-sunxi64-package board triplet scpfirmware)
   (let ((base (make-u-boot-package board triplet)))
     (package
       (inherit base)
@@ -752,6 +752,9 @@  it fits within common partitioning schemes.")
                           (assoc-ref (or native-inputs inputs) "firmware")
                           "/bl31.bin")))
                     (setenv "BL31" bl31)
+                    (setenv "SCP" (string-append
+                                   (assoc-ref inputs "scpfirmware")
+                                   "/scp.bin"))
                     ;; This is necessary when we're using the bundled dtc.
                     ;(setenv "PATH" (string-append (getenv "PATH") ":"
                     ;                              "scripts/dtc"))
@@ -759,16 +762,20 @@  it fits within common partitioning schemes.")
                   #t))))))
       (native-inputs
        `(("firmware" ,arm-trusted-firmware-sun50i-a64)
+         ("scpfirmware" ,scpfirmware)
          ,@(package-native-inputs base))))))
 
 (define-public u-boot-pine64-plus
-  (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"))
+  (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"
+                               crust-pine64-plus))
 
 (define-public u-boot-pine64-lts
-  (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu"))
+  (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu"
+                               crust-pine64-plus))
 
 (define-public u-boot-pinebook
-  (let ((base (make-u-boot-sunxi64-package "pinebook" "aarch64-linux-gnu")))
+  (let ((base (make-u-boot-sunxi64-package "pinebook" "aarch64-linux-gnu"
+                                           crust-pinebook)))
     (package
       (inherit base)
       (arguments
-- 
2.30.2