From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sDeiIDvmr2aCBgEAqHPOHw:P1 (envelope-from ) for ; Sun, 04 Aug 2024 20:36:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id sDeiIDvmr2aCBgEAqHPOHw (envelope-from ) for ; Sun, 04 Aug 2024 22:36:11 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=lqE0ff4k; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=bGxm2XGw; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=KBhLWLHR; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1722803771; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NhJH3+BcvMS5+Hk1K1LFnbEAjTt5TPp6+OUPz0Sk0Ow=; b=mYtCsNwrP6Obx2Ct3f5deCl26Di+bUps2U98neUm4cuxVYQWN+hynooQHobaU49zUJ2s18 KKhzL1FUp5/jzEhslFdvrG/OT99nzzsY2V5qEL3qN3oXyVk2RcsSBfo+h076jLDXQtykJK 5CraJfQeW+szRkvtUIaDSZM630weB/EXf65SUT1H21UtvRhhOwm0IUjZ1V8ZjdoMZy4Lkh 46HvtNtxk6gw3l8JoqjGaUh4rMeLXipk5D9FDDchPZgVgx/8a2fywHSNF/xTO2NlKfuygA ZN6OB8U0LSt7o14fC3se39rC9i8ltYs6Y04iXLETyEfHErbxaCao9k2bm9BsGg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722803771; a=rsa-sha256; cv=none; b=lsFYmJTMKQ3wUcXiI/XTGj6y6EwrwMkw1q4teUoYlE37M5ZAKnPyWU0usI5DOKViP/AXYB /n9n7THsKhzC6rd9CfdjdayGn6GgqWvz4g33EJHfq9JAPzQVxDMEz9Ccva3eDIjuNE7GQr rf8AgEKwogrZO8PkDjnkcAcUJyZcdnhkffEuqkN6kjOm2DBO3GSKuouJtcFTzaY0VdqLQH eDOAqirn+5Qvh2nJQz3/kt3dcUyYzWN3wKlH+1UT4+7qSgnGX5WrNbW2ZOcf70GJy6ZS/F /3xbB8K8CbVj1piYouiwxYE+Da9my2g6xRDImUry2vy3+VXLlVmtGxsL/QCALg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=lqE0ff4k; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=bGxm2XGw; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=KBhLWLHR; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 50F191097D for ; Sun, 4 Aug 2024 22:36:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sahwH-0002KU-UC; Sun, 04 Aug 2024 16:34:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sahwE-0002HG-2g for guix-patches@gnu.org; Sun, 04 Aug 2024 16:34:46 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sahwD-0008Kw-Pg for guix-patches@gnu.org; Sun, 04 Aug 2024 16:34:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=NhJH3+BcvMS5+Hk1K1LFnbEAjTt5TPp6+OUPz0Sk0Ow=; b=lqE0ff4kF2IeZ/gFcYuEoLf1ABXhbxCRh//+ntGE9kqLTox2HfAkV7b3lsmwiNeIPV+XhnlcxdWg8GHXP2hQLqWHxYp3pmcxWGKTMG/bnjZxx64ODG7FEnQ0ublqioAV1j62bJImiS4mGnTHcBxF4ujx7r7xaEtWLwlOA6qQBVotWmhIhsThaHquTRLmmSCebnpFxE05yf3GBgihQFI8cGjERLm3iC1dORj+Va8Oy658om2XnV1tnOdRrY+AA242NIqBE5DvNNMG+pRMOZgxd4w1o2D15PcC25uSCRohe+tAFdFLKlnRLWwfNAHbQtpBua+yv/rptxvMPeuRTuWUuQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sahwW-0006Ob-SW; Sun, 04 Aug 2024 16:35:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72457] [PATCH v3 06/15] gnu: bootloader: Add raspberry pi bootloader. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, lilah@lunabee.space, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Sun, 04 Aug 2024 20:35:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72457@debbugs.gnu.org Cc: Lilah Tascheter , Sergey Trofimov , Efraim Flashner , Lilah Tascheter , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Lilah Tascheter , Vagrant Cascadian Received: via spool by 72457-submit@debbugs.gnu.org id=B72457.172280365924250 (code B ref 72457); Sun, 04 Aug 2024 20:35:04 +0000 Received: (at 72457) by debbugs.gnu.org; 4 Aug 2024 20:34:19 +0000 Received: from localhost ([127.0.0.1]:57345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sahvm-0006Iw-S8 for submit@debbugs.gnu.org; Sun, 04 Aug 2024 16:34:19 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:56742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sahvk-0006I1-SU for 72457@debbugs.gnu.org; Sun, 04 Aug 2024 16:34:17 -0400 DKIM-Signature: a=rsa-sha256; b=bGxm2XGwy7xa4+UfWBJMWFpqFn3K0CK2dtnKvCE/LnkqVNqRGKdKO9a3Oo9W6MksH0tSzGzk1dfvOMwN031LWCmpSBsEuNhK9KjqkBzYah8uavJqsj9w/rgv2VPuvYqCkuVG7d1rjpUP/OuXbwzVU/hrtrr/qs9x6rAsYb/KKvgvFhnh+z77zBM8y++UsRViH6+1ns7uo2YzAYJJWURyN7bnWWYIy5u/ZJkIHRQZowduGmCcBC7z7yOdLn9PT9YxSSfIW0W8b3vIHkn3lLkDUC27SOMj0xuwOaSnzNEFOn23A8Mx3TGeuEJtAoRo5ndmWljS+lwPpTNqj9wOtl0vRQ==; s=purelymail2; d=lunabee.space; v=1; bh=52aOFgmPe/yDbBKRzVYI6BUfPxYfqos1GrgbdM6g11Y=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=KBhLWLHRA2Hp3ARObrD5OZ0fqBzR2UX5x61E8/0JLVAA0Ip6/t+LV6ROxqFiUdkGCbu3XmUywPvMvoHDwvV5NdKvaJJS3aBOJW2cyHuxoc03oKLS+sUnzb1E7yNzjCKHRCpgICHRLMWHOTwX6URgqE6ky6OTFPTYoE3NyfpB8+yl7NwZpy8H2q3uSNWg6tISLRqbQJt9+yALohAzYYg8C0KvIBzqFOhhh6Kf51610vUi5NYimvp6FLN0OGvAjiTo2b1JKgCVZlJUe9ciiViJtMC7vH3lxPdVjnntiB6Odm9pOMJnFfjnW4UTCDSsy9P6lurdn7jrlBAGwukPoi7u6Q==; s=purelymail2; d=purelymail.com; v=1; bh=52aOFgmPe/yDbBKRzVYI6BUfPxYfqos1GrgbdM6g11Y=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: 72457@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1317130453; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 04 Aug 2024 20:33:39 +0000 (UTC) Date: Sun, 4 Aug 2024 15:31:52 -0500 Message-ID: <3111d1dbe934db826d03ff218d30784e3191488b.1722803521.git.lilah@lunabee.space> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail Content-Type: text/plain; charset=UTF-8 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lilah Tascheter via Guix-patches Reply-To: Lilah Tascheter Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 50F191097D X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.94 X-Spam-Score: -6.94 X-TUID: 6caSF6aW+9tP Less adding and more making it an actual bootloader rather than some weirdly specified packages. * gnu/bootloader/u-boot.scm (rpi-config, install-rpi): New procedures. (define-u-bootloader-rpi): New macro. (u-boot-rpi-2-bootloader, u-boot-rpi-3-bootloader, u-boot-rpi-4-bootloader, u-boot-rpi-bootloader): New variables. * gnu/packages/bootloaders.scm (make-u-boot-bin-package): Delete procedure. (%u-boot-rpi-efi-description, %u-boot-rpi-efi-description-32-bit, u-boot-rpi-2-efi, u-boot-rpi-3-32b-efi, u-boot-rpi-4-32b-efi, u-boot-rpi-arm64-efi, u-boot-rpi-2-bin, u-boot-rpi-3_32b-bin, u-boot-rpi-4_32b-bin, u-boot-rpi-arm64-bin, u-boot-rpi-2-efi-bin, u-boot-rpi-3-32b-efi-bin, u-boot-rpi-4-32b-efi-bin, u-boot-rpi-arm64-efi-bin): Delete variables. Change-Id: I5139a0b00ec89189e8e7c84e06a7a3b7240259cd --- gnu/bootloader/u-boot.scm | 66 ++++++++++++++++++++++++- gnu/packages/bootloaders.scm | 94 +++--------------------------------- 2 files changed, 71 insertions(+), 89 deletions(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 7d3e202f8c..e8dfe9b3a2 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -28,7 +28,10 @@ (define-module (gnu bootloader u-boot) #:use-module (gnu bootloader) #:use-module (gnu bootloader extlinux) #:use-module (gnu packages bootloaders) + #:use-module (gnu packages raspberry-pi) + #:use-module (gnu system boot) #:use-module (guix gexp) + #:use-module (guix utils) #:export (u-boot-a20-olinuxino-lime-bootloader u-boot-a20-olinuxino-lime2-bootloader u-boot-a20-olinuxino-micro-bootloader @@ -51,7 +54,11 @@ (define-module (gnu bootloader u-boot) u-boot-qemu-riscv64-bootloader u-boot-starfive-visionfive2-bootloader u-boot-ts7970-q-2g-1000mhz-c-bootloader - u-boot-wandboard-bootloader)) + u-boot-wandboard-bootloader + u-boot-rpi-2-bootloader + u-boot-rpi-3-bootloader + u-boot-rpi-4-bootloader + u-boot-rpi-bootloader)) =20 (define (make-install-u-boot firmware installers) (lambda* (#:key bootloader-config #:allow-other-keys . args) @@ -222,3 +229,60 @@ (define-u-bootloader-copy u-boot-ts7970-q-2g-1000mhz-c= -bootloader =20 (define-u-bootloader-copy u-boot-qemu-riscv64-bootloader u-boot-qemu-riscv64 "u-boot.bin") + +=0C +;;; +;;; RasPi bootloader definitions. +;;; + +(define (rpi-config 32?) + ;; allows a user-specified custom.txt + (plain-file "config.txt" + (format #f + "arm_64bit=3D~a~%enable_uart=3D1~%kernel=3Du-boot.bin~%include custo= m.txt~%" + (if (or 32? (not (target-64bit?))) "0" "1")))) + +(define (install-rpi u-boot-32 u-boot-64) + (lambda* (#:key bootloader-config #:allow-other-keys . args) + (with-targets (bootloader-configuration-targets bootloader-config) + ('install (apply install-extlinux-config args)) + (('firmware =3D> (firmware :path)) + (let* ((32? (bootloader-configuration-32bit? bootloader-config)) + (use-32? (or 32? (not (target-64bit?)) (not u-boot-64)))) + #~(begin + (atomic-copy #$(file-append (if use-32? u-boot-32 u-boot-64) + "/libexec/u-boot.bin") + (string-append #$firmware "/u-boot.bin")) + (atomic-copy #$(rpi-config use-32?) + (string-append #$firmware "/config.txt")))))))) + +(define-syntax-rule (define-u-bootloader-rpi def-name u-boot-32 u-boot-64) + (define def-name + (bootloader (name 'u-boot) + (default-targets + (list (bootloader-target (type 'install) + (offset 'firmware) + (path "extlinux")) + (bootloader-target (type 'firmware) + (offset 'root) + (path "boot")))) + (installer (install-rpi u-boot-32 u-boot-64))))) + + +;; These neither install firmware nor device-tree files for the Raspberry = Pi. +;; They just assume them to be existing in 'install in the same way that s= ome +;; UEFI firmware with ACPI data is usually assumed to be existing on PCs. +;; They can be used with either extlinux or as UEFI firmware (alongside, e= g, +;; GRUB). +(define-u-bootloader-rpi u-boot-rpi-2-bootloader + u-boot-rpi-2 #f) + +(define-u-bootloader-rpi u-boot-rpi-3-bootloader + u-boot-rpi-3-32b u-boot-rpi-arm64) + +(define-u-bootloader-rpi u-boot-rpi-4-bootloader + u-boot-rpi-4-32b u-boot-rpi-arm64) + +;; Usable for any 64-bit raspberry pi. +(define-u-bootloader-rpi u-boot-rpi-bootloader + #f u-boot-rpi-arm64) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 12f918a123..e78602379d 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -1409,40 +1409,8 @@ (define-public u-boot-pinebook-pro-rk3399 (modify-inputs (package-inputs base) (append arm-trusted-firmware-rk3399)))))) =20 -(define*-public (make-u-boot-bin-package u-boot-package - #:key - (u-boot-bin "u-boot.bin")) - "Return a package with a single U-BOOT-BIN file from the U-BOOT-PACKAGE. -The package name will be that of the U-BOOT package suffixed with \"-bin\"= ." - (package - (name (string-append (package-name u-boot-package) "-bin")) - (version (package-version u-boot-package)) - (source #f) - (build-system trivial-build-system) - (arguments - (list - #:builder - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils)) - (mkdir #$output) - (symlink (search-input-file %build-inputs - (string-append "libexec/" #$u-boot= -bin)) - (string-append #$output "/" #$u-boot-bin)))))) - (inputs (list u-boot-package)) - (home-page (package-home-page u-boot-package)) - (synopsis (package-synopsis u-boot-package)) - (description (string-append - (package-description u-boot-package) - "\n\n" - (format #f - "This package only contains the file ~a." - u-boot-bin))) - (license (package-license u-boot-package)))) - -(define-public %u-boot-rpi-efi-configs - '("CONFIG_OF_EMBED" - "CONFIG_OF_BOARD=3Dy")) +;; get dtbs from firmware to support dtoverlays +(define-public %u-boot-rpi-configs '("CONFIG_OF_EMBED" "CONFIG_OF_BOARD=3D= y")) =20 (define %u-boot-rpi-description-32-bit "This is a 32-bit build of U-Boot.") @@ -1451,76 +1419,26 @@ (define %u-boot-rpi-description-64-bit "This is a common 64-bit build of U-Boot for all 64-bit capable Raspberr= y Pi variants.") =20 -(define %u-boot-rpi-efi-description - "It allows network booting and uses the device-tree from the firmware, -allowing the usage of overlays. It can act as an EFI firmware for the -grub-efi-netboot-removable-bootloader.") - -(define %u-boot-rpi-efi-description-32-bit - (string-append %u-boot-rpi-efi-description " " - %u-boot-rpi-description-32-bit)) - (define-public u-boot-rpi-2 (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-32-bit= )) =20 (define-public u-boot-rpi-3-32b (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-32-bit= )) =20 (define-public u-boot-rpi-4-32b (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-32-bit= )) =20 (define-public u-boot-rpi-arm64 (make-u-boot-package "rpi_arm64" "aarch64-linux-gnu" + #:configs %u-boot-rpi-configs #:append-description %u-boot-rpi-description-64-bit= )) =20 -(define-public u-boot-rpi-2-efi - (make-u-boot-package "rpi_2" "arm-linux-gnueabihf" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description %u-boot-rpi-efi-description-32= -bit)) - -(define-public u-boot-rpi-3-32b-efi - (make-u-boot-package "rpi_3_32b" "arm-linux-gnueabihf" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description %u-boot-rpi-efi-description-32= -bit)) - -(define-public u-boot-rpi-4-32b-efi - (make-u-boot-package "rpi_4_32b" "arm-linux-gnueabihf" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description %u-boot-rpi-efi-description-32= -bit)) - -(define-public u-boot-rpi-arm64-efi - (make-u-boot-package "rpi_arm64""aarch64-linux-gnu" - #:name-suffix "-efi" - #:configs %u-boot-rpi-efi-configs - #:append-description (string-append - %u-boot-rpi-efi-description "= " - %u-boot-rpi-description-64-bi= t))) - -(define-public u-boot-rpi-2-bin (make-u-boot-bin-package u-boot-rpi-2)) - -(define-public u-boot-rpi-3_32b-bin (make-u-boot-bin-package u-boot-rpi-3-= 32b)) - -(define-public u-boot-rpi-4_32b-bin (make-u-boot-bin-package u-boot-rpi-4-= 32b)) - -(define-public u-boot-rpi-arm64-bin (make-u-boot-bin-package u-boot-rpi-ar= m64)) - -(define-public u-boot-rpi-2-efi-bin (make-u-boot-bin-package u-boot-rpi-2-= efi)) - -(define-public u-boot-rpi-3-32b-efi-bin - (make-u-boot-bin-package u-boot-rpi-3-32b-efi)) - -(define-public u-boot-rpi-4-32b-efi-bin - (make-u-boot-bin-package u-boot-rpi-4-32b-efi)) - -(define-public u-boot-rpi-arm64-efi-bin - (make-u-boot-bin-package u-boot-rpi-arm64-efi)) - (define u-boot-ts-mx6 ;; There is no release; use the latest commit of the ;; 'imx_v2015.04_3.14.52_1.1.0_ga' branch. --=20 2.45.2