unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Tobias Geerinckx-Rice <me@tobias.gr>
To: Ry Pemberton <rpem66@pm.me>
Cc: help-guix@gnu.org
Subject: Re: Regarding implementing sof-firmware in GUIX.
Date: Fri, 10 Dec 2021 23:38:30 +0100	[thread overview]
Message-ID: <87a6h83wlz.fsf@nckx> (raw)
In-Reply-To: <GRuVg0GhLFfMtp29KXTnhTvVzXp0MYT4W493f6VtFx81Z5yvYtWC9xf-eYQO4oJ3PqS6BdjAE7iRejlt42ammAjBkWItj2DwVs1F1RBF4Os=@pm.me>


[-- Attachment #1.1: Type: text/plain, Size: 1030 bytes --]

Ry,

[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
> GNU GUIX?

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,

T G-R

[0]: https://github.com/thesofproject/sof-bin/


[-- Attachment #1.2: 0001-WIP-gnu-Add-sof.patch --]
[-- Type: text/x-patch, Size: 3713 bytes --]

From c85f4dbdaaf2081b078f02a32ede52de7162e3bf Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
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
   (package
@@ -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 "https://github.com/thesofproject/sof")
+             (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 "https://thesofproject.github.io")
+    (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.]
+
+@enumerate
+@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
-- 
2.34.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  reply	other threads:[~2021-12-10 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 20:13 Regarding implementing sof-firmware in GUIX Ry Pemberton via
2021-12-10 22:38 ` Tobias Geerinckx-Rice [this message]
2021-12-10 23:58   ` Ry Pemberton via
2021-12-11  8:40   ` Mathieu Othacehe
2021-12-11 17:37     ` Tobias Geerinckx-Rice
2021-12-12  4:20       ` Tobias Geerinckx-Rice

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6h83wlz.fsf@nckx \
    --to=me@tobias.gr \
    --cc=help-guix@gnu.org \
    --cc=rpem66@pm.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).