[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regarding implementing sof-firmware in GUIX.

From: Tobias Geerinckx-Rice
Subject: Re: Regarding implementing sof-firmware in GUIX.
Date: Fri, 10 Dec 2021 23:38:30 +0100


[PSA: It's just ‘[GNU] Guix’, never ‘GUIX’ :-) I'm not sure why the ‘GUIX’ meme appears to be picking up steam again as of late…]

Ry Pemberton via 写道:
I have an X1 Carbon (2021) that requires sof-firmware. It is libre software, and I believe is included in the linux-libre kernel since 5.2. Is there a way to get this firmware working on this laptop with

I tried to start a basic SOF package (attached), but quickly ran into ‘The GNU C library is currently unavailable for this platform.’ Without a cross-libc the build fails, looking for <stdint.h>, which AFAICT is provided (only) by libc.

I've never cross-compiled firmware before so I don't know any next steps.

Of course, this being ostensibly libre software, we could package prebuilt binaries[0] as I'm sure 99% of users actually use. It's not a good option, and hardly Guixy, but not unprecedented.

Kind regards,



From c85f4dbdaaf2081b078f02a32ede52de7162e3bf Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <>
Date: Fri, 10 Dec 2021 23:40:02 +0100
Subject: [PATCH] [WIP] gnu: Add sof.

* gnu/packages/firmware.scm (sof): New public variable.
 gnu/packages/firmware.scm | 57 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 56 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index aefc0a8b69..2f264b534e 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -29,6 +29,7 @@ (define-module (gnu packages firmware)
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
@@ -41,7 +42,8 @@ (define-module (gnu packages firmware)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages python))
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages tls))
 (define-public ath9k-htc-firmware
@@ -552,3 +554,56 @@ (define-public arm-trusted-firmware-rk3399
        `(("cross32-gcc" ,(cross-gcc "arm-none-eabi"))
          ("cross32-binutils", (cross-binutils "arm-none-eabi"))
          ,@(package-native-inputs base))))))
+(define-public sof
+  (package
+    (name "sof")
+    (version "1.9.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "";)
+             (commit (string-append "v" version))
+             ;; XXX Includes an ‘rimage’ submodule, whatever that is.
+             (recursive? #t)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0amia754j2qawpxk19yi18d3vhlj3yraqc41il4ndf5v04p5qhc4"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:parallel-build? #f
+       #:configure-flags
+       (list "-DINIT_CONFIG=skylake_defconfig" ; XXX?
+             "-DTOOLCHAIN=extensa-elf")))
+    (native-inputs
+     (let* ((target "xtensa-elf")
+            (xbinutils (cross-binutils target binutils-2.33))
+            (xgcc (cross-gcc target #:xbinutils xbinutils))
+            (xheaders (cross-kernel-headers target linux-libre-headers
+                                            xgcc xbinutils))
+            (xlibc (cross-libc target glibc xgcc xbinutils xheaders)))
+       `(("binutils-cross-xtensa-elf" ,xbinutils)
+         ("gcc-cross-sans-libc-xtensa-elf" ,xgcc)
+         ("glibc-cross-xtensa-elf" ,xlibc)
+         ("openssl" ,openssl)
+         ("python-wrapper" ,python-wrapper))))
+    (home-page "";)
+    (synopsis "Sound Open Firmware")
+    (description
+     "@acronym{SOF, Sound Open Firmware} is an audio @acronym{DSP, digital
+signal processing} firmware infrastructure and @acronym{SDK, software
+development kit}.  It provides a framework where developers interested in audio
+or signal processing on modern DSPs can create, test, and tune:
+[XXX Rewrite this for humanoids.]
+@item audio processing pipelines and topologies
+@item audio processing components
+@item DSP infrastructure and drivers
+@item host operating system infrastructure and drivers.
+@end enumerate\n")
+    (license (list license:bsd-3
+                   license:expat
+                   license:isc))))

base-commit: 3d54f2415672aed64661bed84a043a7f0cee13dd
prerequisite-patch-id: d67a63c338648539cfa7a08c90007d2e7abbb507

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]