From unknown Wed Jun 18 23:09:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#48371 <48371@debbugs.gnu.org> To: bug#48371 <48371@debbugs.gnu.org> Subject: Status: Add crust firmware for sunxi devices Reply-To: bug#48371 <48371@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:09:57 +0000 retitle 48371 Add crust firmware for sunxi devices reassign 48371 guix-patches submitter 48371 Vagrant Cascadian severity 48371 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 11 18:16:22 2021 Received: (at submit) by debbugs.gnu.org; 11 May 2021 22:16:22 +0000 Received: from localhost ([127.0.0.1]:37735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgaft-0001iJ-Pi for submit@debbugs.gnu.org; Tue, 11 May 2021 18:16:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:47388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgafs-0001iA-41 for submit@debbugs.gnu.org; Tue, 11 May 2021 18:16:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgafk-00051g-JV for guix-patches@gnu.org; Tue, 11 May 2021 18:16:15 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:37720) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgafd-0003Pa-J9 for guix-patches@gnu.org; Tue, 11 May 2021 18:16:08 -0400 Received: from localhost (97-120-1-76.ptld.qwest.net [97.120.1.76]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 5EA101ACAA for ; Tue, 11 May 2021 15:15:58 -0700 (PDT) From: Vagrant Cascadian To: guix-patches@gnu.org Subject: Add crust firmware for sunxi devices Date: Tue, 11 May 2021 15:15:31 -0700 Message-ID: <87o8dgrk70.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=173.255.214.101; envelope-from=vagrant@debian.org; helo=cascadia.aikidev.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain The attached patches add crust System Control Processor firmware for pinebook, pine64+ and pine64-lts. Crust manages various power management aspects for these platforms, notably suspend states. live well, vagrant --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-Add-crust-pinebook-and-crust-pine64-plus.patch Content-Transfer-Encoding: quoted-printable From=20f79a6bec79bd00ab3ecb0f874494df597bfa1990 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian 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. =2D-- gnu/packages/bootstrap.scm | 1 + gnu/packages/firmware.scm | 71 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index c598cedc0a..b23ac04586 100644 =2D-- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -315,6 +315,7 @@ or false to signal an error." ((string=3D? system "i686-mingw") "no-ld.so") ((string=3D? system "x86_64-mingw") "no-ld.so") ((string=3D? system "vc4-elf") "no-ld.so") + ((string=3D? system "or1k-elf") "no-ld.so") =20 (else (error "dynamic linker name not known for this system" system)))) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index c9a68f5a93..a057cbe516 100644 =2D-- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -559,3 +559,74 @@ such as: `(("cross32-gcc" ,(cross-gcc "arm-none-eabi")) ("cross32-binutils", (cross-binutils "arm-none-eabi")) ,@(package-native-inputs base)))))) + +(define (make-crust-package platform) + (package + (name (string-append "crust-" + (string-replace-substring (string-downcase platfo= rm) + "_" "-"))) + (version "0.3") + (source + (origin + (method git-fetch) + (uri (git-reference + ;; There are only GitHub generated release snapshots. + (url "https://github.com/crust-firmware/crust") + (commit (string-append "v" version)))) + (file-name (git-file-name "crust" version)) + (sha256 + (base32 + "1ncn2ncmkj1cjk68zrgr5yk7b9x1xxcrcmk9jf188svjgk0cq2m5")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'defconfig + (lambda* (#:key outputs make-flags #:allow-other-keys) + (let ((config-name (string-append ,platform "_defconfig"))) + (apply invoke "make" `(,@make-flags ,config-name))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (bin (find-files "." "(scp.bin|\\.config)"))) + (for-each + (lambda (file) + (install-file file out)) + bin)) + #t))) + #:make-flags (list + "CROSS_COMPILE=3Dor1k-elf-" + "DEBUG=3D1" + "HOSTCC=3Dgcc" + "HOSTAR=3Dar" + "HOST_COMPILE=3Daarch64-linux-gnu-" + "LEX=3Dflex") + #:tests? #f)) ; no tests + ;; The firmware is cross-compiled using a "bare bones" compiler (no li= bc.) + ;; Use our own tool chain for that. + (native-inputs `(("cross-gcc" ,(cross-gcc "or1k-elf" #:xgcc gcc-9)) + ("cross-binutils" ,(cross-binutils "or1k-elf" binutil= s)) + ("bison" ,bison) + ("flex" ,flex))) + (home-page "https://github.com/crust-firmware/crust") + (synopsis "System control processor firmware for Allwinner sunxi board= s") + (description + "Crust improves battery life and thermal performance by implementing a +deep sleep state. During deep sleep, the CPU cores, the DRAM controller, = and +most onboard peripherals are powered down, reducing power consumption by 8= 0% +or more compared to an idle device. On boards without a PMIC, Crust is al= so +responsible for orderly power-off and power-on of the device. + +For this to work, Crust runs outside the main CPU and DRAM, on a dedicated +always-on microprocessor called a System Control Processor (SCP). Crust is +designed to run on a specific SCP implementation, Allwinner's AR100.") + ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only. + (license (list license:bsd-3 + license:gpl2)))) + +(define-public crust-pinebook + (make-crust-package "pinebook")) + +(define-public crust-pine64-plus + (make-crust-package "pine64_plus")) =2D-=20 2.30.2 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-gnu-u-boot-Add-crust-firmware-to-pinebook-pine64_plu.patch Content-Transfer-Encoding: quoted-printable From=206939b8555f4d2ed57b4993c501686d5ccdf47703 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Tue, 11 May 2021 21:15:15 +0000 Subject: [PATCH 2/2] gnu: u-boot: Add crust firmware to pinebook, pine64_pl= us 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. =2D-- 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 =2D-- 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")) =20 =2D(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)))))) =20 (define-public u-boot-pine64-plus =2D (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu")) + (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu" + crust-pine64-plus)) =20 (define-public u-boot-pine64-lts =2D (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu")) + (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu" + crust-pine64-plus)) =20 (define-public u-boot-pinebook =2D (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 =2D-=20 2.30.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYJsCBAAKCRDcUY/If5cW qv9kAP9O9fSAmJQYxI/tfkmJSLsVVWvUGADX8zI9LLXOXYn6sQD9GHGLGjhvIaNu SYYDnEwSOa1Kg8ns0yCAEiK0zszEUwY= =yU9z -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 13 09:00:53 2021 Received: (at 48371) by debbugs.gnu.org; 13 May 2021 13:00:53 +0000 Received: from localhost ([127.0.0.1]:41623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhAxR-0008HA-8f for submit@debbugs.gnu.org; Thu, 13 May 2021 09:00:53 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:40554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhAxP-0008H2-FW for 48371@debbugs.gnu.org; Thu, 13 May 2021 09:00:52 -0400 Received: from [172.20.10.4] ([5.23.207.202]) by laurent.telenet-ops.be with bizsmtp id 4D0o2500W4NYeBH01D0p76; Thu, 13 May 2021 15:00:50 +0200 Message-ID: <334cfe187104a05a822dadd12436bc37dd1fcbb1.camel@telenet.be> Subject: Re: [bug#48371] Add crust firmware for sunxi devices From: Maxime Devos To: Vagrant Cascadian , 48371@debbugs.gnu.org Date: Thu, 13 May 2021 15:00:08 +0200 In-Reply-To: <87o8dgrk70.fsf@yucca> References: <87o8dgrk70.fsf@yucca> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-KPbnGFGFLz442xezFB4/" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1620910850; bh=kNRZO/u09ctR4aqP+5R2TnOBZDJoXU43DSh0Mfz8+f4=; h=Subject:From:To:Date:In-Reply-To:References; b=V5R1EOxBL3At5G7AJcCaji+NrXaPuwCtM83I5CHmnWp55MckOfRIuJ86k7wkSIKY6 vlbsg34Zj/dWAd9Eg/mXd9IHNbJONpcY+FJmIG+ZPB7Y5dMiGxe3Jz+hJxyPzJv39D 8bEnDvL5htwyXQcVKOBgoY3Vioz4xZFzXbIMyZUTNZU5+rUn+htrWtu3HovBmhe9/5 dqR3ZtvbARBZ9y8g6Lul6xEOAPVcFR78MGp11NKkWHnK44dY1pPWLUWg4vTS8t9oiv zzi/nEGZJZHWaoee5IH+zJDfkDCECyYXMrBm9dlD3myzQfVZqKbWKDcsrelMdx8hxo bRJYKOoEaPmyQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 48371 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-KPbnGFGFLz442xezFB4/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Vagrant Cascadian schreef op di 11-05-2021 om 15:15 [-0700]: > + #:make-flags (list > + "CROSS_COMPILE=3Dor1k-elf-" > + "DEBUG=3D1" > + "HOSTCC=3Dgcc" > + "HOSTAR=3Dar" > + "HOST_COMPILE=3Daarch64-linux-gnu-" > + "LEX=3Dflex") 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= ? Greetings, Maxime. --=-KPbnGFGFLz442xezFB4/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYJ0i2BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7uHkAQCxkJIbBBe5+R6XKlMf5UQlbcj9 xPXnI16gugW+z1fyZwD/Ww0pPdXhWpkNs85/lruext5+TMQm69X7/oywAevS8QU= =wims -----END PGP SIGNATURE----- --=-KPbnGFGFLz442xezFB4/-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 20:55:21 2021 Received: (at 48371) by debbugs.gnu.org; 30 May 2021 00:55:21 +0000 Received: from localhost ([127.0.0.1]:57983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln9jd-0002i7-H5 for submit@debbugs.gnu.org; Sat, 29 May 2021 20:55:21 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:40616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ln9jY-0002hm-DH for 48371@debbugs.gnu.org; Sat, 29 May 2021 20:55:19 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 241701A904; Sat, 29 May 2021 17:55:08 -0700 (PDT) From: Vagrant Cascadian To: Maxime Devos , 48371@debbugs.gnu.org Subject: Re: [bug#48371] Add crust firmware for sunxi devices In-Reply-To: <334cfe187104a05a822dadd12436bc37dd1fcbb1.camel@telenet.be> References: <87o8dgrk70.fsf@yucca> <334cfe187104a05a822dadd12436bc37dd1fcbb1.camel@telenet.be> Date: Sat, 29 May 2021 17:55:04 -0700 Message-ID: <87r1hpf3br.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48371 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain 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! Although I couldn't get it to work, always ending in: ERROR: In procedure %resolve-variable: Unbound variable: nix-system->gnu-triplet firmware.scm includes: #:use-module (guix utils) Which is where I think that is defined, but... 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! There's a new crust version available, so I'll give that a quick test before sending updated patches. live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYLLiaAAKCRDcUY/If5cW qlUBAQDjHbxhpsaXwgZTc/wWsfjhzvU1dbM2+rUeqBGgel3p9wEAxIkmmbqm9IYw chNp+gmmSQGBz5KI0E3WEDyllNuyaQE= =WNat -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 29 21:30:42 2021 Received: (at 48371) by debbugs.gnu.org; 30 May 2021 01:30:42 +0000 Received: from localhost ([127.0.0.1]:57989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnAHq-0003gu-C6 for submit@debbugs.gnu.org; Sat, 29 May 2021 21:30:42 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:40672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnAHo-0003gh-JM for 48371@debbugs.gnu.org; Sat, 29 May 2021 21:30:41 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 2A8041A904; Sat, 29 May 2021 18:30:31 -0700 (PDT) From: Vagrant Cascadian To: Maxime Devos , 48371@debbugs.gnu.org Subject: Re: [bug#48371] Add crust firmware for sunxi devices In-Reply-To: <87r1hpf3br.fsf@yucca> References: <87o8dgrk70.fsf@yucca> <334cfe187104a05a822dadd12436bc37dd1fcbb1.camel@telenet.be> <87r1hpf3br.fsf@yucca> Date: Sat, 29 May 2021 18:30:26 -0700 Message-ID: <87o8ctf1ot.fsf@yucca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48371 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-Add-crust-pinebook-and-crust-pine64-plus.patch Content-Transfer-Encoding: quoted-printable From=2075dff89f75481cea087890d28568017996e88da5 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian 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. =2D-- gnu/packages/bootstrap.scm | 1 + gnu/packages/firmware.scm | 70 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index c598cedc0a..b23ac04586 100644 =2D-- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -315,6 +315,7 @@ or false to signal an error." ((string=3D? system "i686-mingw") "no-ld.so") ((string=3D? system "x86_64-mingw") "no-ld.so") ((string=3D? system "vc4-elf") "no-ld.so") + ((string=3D? system "or1k-elf") "no-ld.so") =20 (else (error "dynamic linker name not known for this system" system)))) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index c9a68f5a93..4b6dbdb733 100644 =2D-- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -559,3 +559,73 @@ such as: `(("cross32-gcc" ,(cross-gcc "arm-none-eabi")) ("cross32-binutils", (cross-binutils "arm-none-eabi")) ,@(package-native-inputs base)))))) + +(define (make-crust-package platform) + (package + (name (string-append "crust-" + (string-replace-substring (string-downcase platfo= rm) + "_" "-"))) + (version "0.4") + (source + (origin + (method git-fetch) + (uri (git-reference + ;; There are only GitHub generated release snapshots. + (url "https://github.com/crust-firmware/crust") + (commit (string-append "v" version)))) + (file-name (git-file-name "crust" version)) + (sha256 + (base32 + "19xxp43b6dhdfssahspyl7y15dbby0kfbfqnmhc42vz1hkp7b4q6")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'defconfig + (lambda* (#:key outputs make-flags #:allow-other-keys) + (let ((config-name (string-append ,platform "_defconfig"))) + (apply invoke "make" `(,@make-flags ,config-name))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (bin (find-files "." "(scp.bin|\\.config)"))) + (for-each + (lambda (file) + (install-file file out)) + bin)) + #t))) + #:make-flags (list + "CROSS_COMPILE=3Dor1k-elf-" + "DEBUG=3D1" + "HOSTCC=3Dgcc" + "HOSTAR=3Dar" + "LEX=3Dflex") + #:tests? #f)) ; no tests + ;; The firmware is cross-compiled using a "bare bones" compiler (no li= bc.) + ;; Use our own tool chain for that. + (native-inputs `(("cross-gcc" ,(cross-gcc "or1k-elf" #:xgcc gcc-9)) + ("cross-binutils" ,(cross-binutils "or1k-elf" binutil= s)) + ("bison" ,bison) + ("flex" ,flex))) + (home-page "https://github.com/crust-firmware/crust") + (synopsis "System control processor firmware for Allwinner sunxi board= s") + (description + "Crust improves battery life and thermal performance by implementing a +deep sleep state. During deep sleep, the CPU cores, the DRAM controller, = and +most onboard peripherals are powered down, reducing power consumption by 8= 0% +or more compared to an idle device. On boards without a PMIC, Crust is al= so +responsible for orderly power-off and power-on of the device. + +For this to work, Crust runs outside the main CPU and DRAM, on a dedicated +always-on microprocessor called a System Control Processor (SCP). Crust is +designed to run on a specific SCP implementation, Allwinner's AR100.") + ;; Most files are dual-licensed "BSD-3 OR GPL2", a few are GPL2 only. + (license (list license:bsd-3 + license:gpl2)))) + +(define-public crust-pinebook + (make-crust-package "pinebook")) + +(define-public crust-pine64-plus + (make-crust-package "pine64_plus")) =2D-=20 2.30.2 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-gnu-u-boot-Add-crust-firmware-to-pinebook-pine64_plu.patch Content-Transfer-Encoding: quoted-printable From=20719fc2874daa5fd5772c2c0d146e8d6fb9f1377b Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Tue, 11 May 2021 21:15:15 +0000 Subject: [PATCH 2/2] gnu: u-boot: Add crust firmware to pinebook, pine64_pl= us 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. =2D-- 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 =2D-- 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")) =20 =2D(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)))))) =20 (define-public u-boot-pine64-plus =2D (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu")) + (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu" + crust-pine64-plus)) =20 (define-public u-boot-pine64-lts =2D (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu")) + (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu" + crust-pine64-plus)) =20 (define-public u-boot-pinebook =2D (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 =2D-=20 2.30.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYLLqswAKCRDcUY/If5cW qjLFAQCKUtPihvbN7kkwzLn6tNfY9Jyzutg/2Qys87HBDC0C0QD+JtwgmgTodfoQ 5gHbPLx3PLrZelSoozwPt3XdNKJjdQs= =KBTG -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 07 16:07:40 2023 Received: (at 48371-done) by debbugs.gnu.org; 7 Jul 2023 20:07:40 +0000 Received: from localhost ([127.0.0.1]:43844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHrjv-0002tB-VJ for submit@debbugs.gnu.org; Fri, 07 Jul 2023 16:07:40 -0400 Received: from mail-vk1-f173.google.com ([209.85.221.173]:57642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHrjt-0002sx-Cw for 48371-done@debbugs.gnu.org; Fri, 07 Jul 2023 16:07:38 -0400 Received: by mail-vk1-f173.google.com with SMTP id 71dfb90a1353d-47e2df3c418so916228e0c.3 for <48371-done@debbugs.gnu.org>; Fri, 07 Jul 2023 13:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688760451; x=1691352451; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0ags6cFF9n0DiwGoXlkG4yQFpsOF7yBQcqBwqJ49ypY=; b=Qa5JxYsrxGKYISsmx7E8d2FYLuQjQXOlYhGRnYixMyThemjWVVSB6ld++Ey75TdqiT ZZRgYom+PKI2dX9KvKlX+vt4FBTDxf2eR8uMiYv7u3CPZ7CkESlJPFrSQk+HjxPEZ4nL 5iZf+YR+wEwORrqfu8g/NLVoYPkcRMzCezavmwx7m369reJfgkWkyJuoDl6aMFaFIBci +rc5EoVxfX9cmzd2QkEZj+ktlLDJDbmlchOzvgt3zQkJwLgm9LAFHQP8P58qycDAU1o7 hCrgWyOBVHX0R9XHfjU7e8eCs+79QcVMwIDtFOFNY6aAzMHYrEifihZ+bJ6G+yUNkmi0 /d5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688760451; x=1691352451; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0ags6cFF9n0DiwGoXlkG4yQFpsOF7yBQcqBwqJ49ypY=; b=idefCxS3OTDdc9fQrhqLwh7DFNW+3k8acN48TZzqAOdyoz1kjs/O1Ye+TKAzEpkPOd 53NhIdcRj0a3dYgUQ2IJUv1wPPKoH90m5X2G1qYejURzVTwfcVZj4Fcr0RhTQ4JScUzJ DQpc+dqryGnDPjjp8MmckEf00l/zAmBfZRSmQr09tchugjsazmdViB6X4cem8CooDCN9 lERX8JCoNkeh+oJ77V85Ri3Oe35SvWK2Ywj0IFrmq3V4BEpUUxCB7XCgqJI53I+WHjT/ 9/6r5XXLilGjZGkPqOC2OhB8FKnSS+bZPj0jCa1P07KCOmVG0VI8hrNIzQ4VcyWBA6w+ IBeg== X-Gm-Message-State: ABy/qLbOT2J2DeoJL5muXH6lv0cLMn8OpEmCqFnHO00YC1gahGOhtXki ErKbf1Lbd9gZPOzeA/iope3RS3gu6ss= X-Google-Smtp-Source: APBJJlFoQl/mUwhu10f4Oj2ipD9e5G+avISxlYQQ2ftHPiWeaY5NX1N22eI1JlMJ55P235oxYyHmIg== X-Received: by 2002:a1f:d486:0:b0:453:b080:632d with SMTP id l128-20020a1fd486000000b00453b080632dmr5255780vkg.0.1688760451628; Fri, 07 Jul 2023 13:07:31 -0700 (PDT) Received: from hurd (dsl-205-236-230-179.b2b2c.ca. [205.236.230.179]) by smtp.gmail.com with ESMTPSA id a6-20020a0cca86000000b0062df126ca11sm2406703qvk.21.2023.07.07.13.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 13:07:31 -0700 (PDT) From: Maxim Cournoyer To: Vagrant Cascadian Subject: Re: bug#48371: Add crust firmware for sunxi devices References: <87o8dgrk70.fsf@yucca> <334cfe187104a05a822dadd12436bc37dd1fcbb1.camel@telenet.be> <87r1hpf3br.fsf@yucca> <87o8ctf1ot.fsf@yucca> Date: Fri, 07 Jul 2023 16:07:29 -0400 In-Reply-To: <87o8ctf1ot.fsf@yucca> (Vagrant Cascadian's message of "Sat, 29 May 2021 18:30:26 -0700") Message-ID: <874jmfzdry.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 48371-done Cc: 48371-done@debbugs.gnu.org, Maxime Devos X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Vagrant, [...] > live well, > vagrant > > From 75dff89f75481cea087890d28568017996e88da5 Mon Sep 17 00:00:00 2001 > From: Vagrant Cascadian > 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. -- Thanks, Maxim From unknown Wed Jun 18 23:09:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 05 Aug 2023 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator