From patchwork Thu Dec 12 21:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34842 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5DDE727BBEA; Thu, 12 Dec 2024 21:06:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0E9B027BBE2 for ; Thu, 12 Dec 2024 21:06:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLqNE-0004RY-7O; Thu, 12 Dec 2024 16:05:29 -0500 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 1tLqMs-0004Ml-NF for guix-patches@gnu.org; Thu, 12 Dec 2024 16:05:10 -0500 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 1tLqMs-0006fx-EU for guix-patches@gnu.org; Thu, 12 Dec 2024 16:05:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=+sMDLqsxe3IewEti51PKD1ULoF1TwcdbjnRstFfB/hg=; b=OA4ZlQqseluySEnT0EAnwJTp2pl/XNMTQT3C1AdA2dBiwCBBOjRqloeS4NgUi7bUTq0j5w633mBwLW0uZ/7FeW8Y/0PttQYn2N2++J6lQ/ZCgmjLtOlA/+kvlHGV/vCAcY225EOVghFVmhi9NUz7F8BsJVfsaIuivVLhI7bHQeaLAFA1a0Wg8HmIodQhgQn3NcAj4diDguZEbM3ZybKg61vz6cGE38Rr/Zxm8eTHPKETFi/PUabZwllGC2OIS7sS5Pi7M+dxL8gBP0V83yLrbEsQejkYh0Td815lJfCtjURdItKfA8Lz1pnkMRQIkDV7AYdmKXlOL70u1ZlHfMN5Xw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLqMr-0000kO-26 for guix-patches@gnu.org; Thu, 12 Dec 2024 16:05:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74842] [PATCH 1/4] gnu: bootloader: u-boot: Add u-boot-rockchip-bootloader. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 21:05:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74842@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17340374732735 (code B ref -1); Thu, 12 Dec 2024 21:05:04 +0000 Received: (at submit) by debbugs.gnu.org; 12 Dec 2024 21:04:33 +0000 Received: from localhost ([127.0.0.1]:40588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqML-0000i2-4V for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:04:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:39832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqMI-0000ht-VQ for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:04:31 -0500 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 1tLqMC-0004Dx-Gd for guix-patches@gnu.org; Thu, 12 Dec 2024 16:04:24 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117] helo=email.rimm.ee) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1tLqM4-0005kV-Dn for guix-patches@gnu.org; Thu, 12 Dec 2024 16:04:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734037448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+sMDLqsxe3IewEti51PKD1ULoF1TwcdbjnRstFfB/hg=; b=VOZjLIurRsvWILnkGdPCtlKMbHSOs9iHhL51mOjQzm3QtxUg6eD1pqwJWxYOMaYnZbeyV+ KwmW/DU4vkTENKp5JDIr8Z0NbN0eA9iMa4XPisXC8blzku0PZah7k03x3GJTdy2xLDj+Pt Upi0Xh9YEiOya17wXW45Nai7QcW15VtKT7beDChlNUyIjbRJrA5l50xbtbFP5pVoERIIeW BqGOh7kxDxpdvVXBN9AQodEeNWeG+xhMmDYxzoiAtwkCF4ZGb4yHsjnCQ0rg+SfpTUi/Vl Lr5r60dmE0hHP7Ef6cBLEfwfDk7pEfkHBajd8rRKmWUgq6vpYrtDyO+q7QQ7cA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 37d05986 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for ; Thu, 12 Dec 2024 21:04:08 +0000 (UTC) Date: Thu, 12 Dec 2024 22:03:25 +0100 Message-ID: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=81.205.150.117; envelope-from=herman@rimm.ee; helo=email.rimm.ee X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_PBL=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader/u-boot.scm (install-rockchip-u-boot): Add procedure. (install-orangepi-r1-plus-lts-rk3328-u-boot, install-firefly-rk3399-u-boot, install-rock64-rk3328-u-boot, install-rockpro64-rk3399-u-boot, install-pinebook-pro-rk3399-u-boot): Remove procedure. (u-boot-rockchip-bootloader): Add variable. (u-boot-firefly-rk3399-bootloader, u-boot-orangepi-r1-plus-lts-rk3328-bootloader, u-boot-rock64-rk3328-bootloader, u-boot-rockpro64-rk3399-bootloader, u-boot-pinebook-pro-rk3399-bootloader): Inherit u-boot-rockchip-bootloader. [disk-image-installer]: Remove. Change-Id: Icb7546ee2bb1742c12c7b47ff2779d278dd45b14 --- gnu/bootloader/u-boot.scm | 66 ++++++++++----------------------------- 1 file changed, 17 insertions(+), 49 deletions(-) base-commit: a9003b8e6b40b59c9545ae87bb441d3549630db7 diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 5e149eaea0..5ea5f418b4 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -111,15 +111,6 @@ (define install-imx-u-boot (write-file-on-device u-boot (stat:size (stat u-boot)) image (* 69 1024))))) -(define install-orangepi-r1-plus-lts-rk3328-u-boot - #~(lambda (bootloader root-index image) - (let ((idb (string-append bootloader "/libexec/idbloader.img")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device idb (stat:size (stat idb)) - image (* 64 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 16384 512))))) - (define install-puma-rk3399-u-boot #~(lambda (bootloader root-index image) (let ((spl (string-append bootloader "/libexec/idbloader.img")) @@ -129,25 +120,7 @@ (define install-puma-rk3399-u-boot (write-file-on-device u-boot (stat:size (stat u-boot)) image (* 512 512))))) -(define install-firefly-rk3399-u-boot - #~(lambda (bootloader root-index image) - (let ((idb (string-append bootloader "/libexec/idbloader.img")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device idb (stat:size (stat idb)) - image (* 64 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 16384 512))))) - -(define install-rock64-rk3328-u-boot - #~(lambda (bootloader root-index image) - (let ((idb (string-append bootloader "/libexec/idbloader.img")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device idb (stat:size (stat idb)) - image (* 64 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 16384 512))))) - -(define install-rockpro64-rk3399-u-boot +(define install-rockchip-u-boot #~(lambda (bootloader root-index image) (let ((idb (string-append bootloader "/libexec/idbloader.img")) (u-boot (string-append bootloader "/libexec/u-boot.itb"))) @@ -156,8 +129,6 @@ (define install-rockpro64-rk3399-u-boot (write-file-on-device u-boot (stat:size (stat u-boot)) image (* 16384 512))))) -(define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot) - (define install-sifive-unmatched-u-boot #~(lambda (bootloader root-index image) (let ((spl (string-append bootloader "/libexec/spl/u-boot-spl.bin")) @@ -219,6 +190,12 @@ (define u-boot-imx-bootloader (inherit u-boot-bootloader) (disk-image-installer install-imx-u-boot))) +(define u-boot-rockchip-bootloader + ;; SD and eMMC use the same format + (bootloader + (inherit u-boot-bootloader) + (disk-image-installer install-rockchip-u-boot))) + (define u-boot-nintendo-nes-classic-edition-bootloader (bootloader (inherit u-boot-allwinner-bootloader) @@ -250,11 +227,9 @@ (define u-boot-cubietruck-bootloader (package u-boot-cubietruck))) (define u-boot-firefly-rk3399-bootloader - ;; SD and eMMC use the same format (bootloader - (inherit u-boot-bootloader) - (package u-boot-firefly-rk3399) - (disk-image-installer install-firefly-rk3399-u-boot))) + (inherit u-boot-rockchip-bootloader) + (package u-boot-firefly-rk3399))) (define u-boot-mx6cuboxi-bootloader (bootloader @@ -273,9 +248,8 @@ (define u-boot-novena-bootloader (define u-boot-orangepi-r1-plus-lts-rk3328-bootloader (bootloader - (inherit u-boot-bootloader) - (package u-boot-orangepi-r1-plus-lts-rk3328) - (disk-image-installer install-orangepi-r1-plus-lts-rk3328-u-boot))) + (inherit u-boot-rockchip-bootloader) + (package u-boot-orangepi-r1-plus-lts-rk3328))) (define u-boot-pine64-plus-bootloader (bootloader @@ -299,25 +273,19 @@ (define u-boot-puma-rk3399-bootloader (disk-image-installer install-puma-rk3399-u-boot))) (define u-boot-rock64-rk3328-bootloader - ;; SD and eMMC use the same format (bootloader - (inherit u-boot-bootloader) - (package u-boot-rock64-rk3328) - (disk-image-installer install-rock64-rk3328-u-boot))) + (inherit u-boot-rockchip-bootloader) + (package u-boot-rock64-rk3328))) (define u-boot-rockpro64-rk3399-bootloader - ;; SD and eMMC use the same format (bootloader - (inherit u-boot-bootloader) - (package u-boot-rockpro64-rk3399) - (disk-image-installer install-rockpro64-rk3399-u-boot))) + (inherit u-boot-rockchip-bootloader) + (package u-boot-rockpro64-rk3399))) (define u-boot-pinebook-pro-rk3399-bootloader - ;; SD and eMMC use the same format (bootloader - (inherit u-boot-bootloader) - (package u-boot-pinebook-pro-rk3399) - (disk-image-installer install-pinebook-pro-rk3399-u-boot))) + (inherit u-boot-rockchip-bootloader) + (package u-boot-pinebook-pro-rk3399))) (define u-boot-ts7970-q-2g-1000mhz-c-bootloader ;; This bootloader doesn't really need to be installed, as it is read from From patchwork Thu Dec 12 21:07:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34845 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 227AD27BBE2; Thu, 12 Dec 2024 21:09:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8CD2827BBE9 for ; Thu, 12 Dec 2024 21:09:38 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLqQm-0005t8-3Z; Thu, 12 Dec 2024 16:09:09 -0500 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 1tLqQh-0005sV-Sh for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:05 -0500 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 1tLqQg-0007fS-MF for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:03 -0500 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=NQU/7gsM9r12YHNgXaYibpEq2xn/NSq/OiBjd4dy32I=; b=sOSDkbeVi+TA1EIcrxYxCQmH6R4WJhq3obzDmsUJXaQ2YVkgqAEs7CXn0q2qb0lPw84TvMcLwUNYrVPC6bllFGOKs6OvVNsw9ODYCjsTK/u2r/VejV9VQ09LGZ5TNw3/iLDBpZEjQInwR9sCoq2CI0lEKyyumCVDPBCECbxXqaboIJqobqungs9QrXg9HNHyY2jBKcSxiPzNFfYehYQMxNYSig6LMm3TKLB/ghuUQObCcAta9EvRhqBF9EqqnQQH4zFA/SzAmW5OjTdP03fw0qNcGAquP6GHsFPM6HxlUQV1MO0LQ8xn3hG+shwq9ojZ6HfdORLRxd6iRFBRvHRM/A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLqQg-0000wz-84 for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74842] [PATCH 2/4] gnu: bootloader: u-boot: Add write-u-boot-image procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 21:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74842@debbugs.gnu.org Received: via spool by 74842-submit@debbugs.gnu.org id=B74842.17340376913548 (code B ref 74842); Thu, 12 Dec 2024 21:09:02 +0000 Received: (at 74842) by debbugs.gnu.org; 12 Dec 2024 21:08:11 +0000 Received: from localhost ([127.0.0.1]:40603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqPq-0000v4-Au for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:08:11 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37851 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqPm-0000uH-7a for 74842@debbugs.gnu.org; Thu, 12 Dec 2024 16:08:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734037671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NQU/7gsM9r12YHNgXaYibpEq2xn/NSq/OiBjd4dy32I=; b=NsanLdv6irU7OnmIjoTJ5EXVq5PgTs5WSZiP3uye4pkOEfZIPoSy2dzpsMK/zfm0bhrcZX O3iXRCmabFL/9Kz5KbuMDmC75i5WQt7/lU27qPS/rLi7VRnu+QdpuWh8iZxD/kdiBpjm54 MRKoTKzcyFr/F5VZjbLATWJDRg4B3w0TBZPJTyhKOFCcaMAhDnJt7i5MygWE8avyhKQx4n n8dtXL9/AOjtcTnWv8roqsL/p3Rh97ZA+hQKQKZfAen77+9P+BtmuYfgYIg6OQIHshgaVA x7+w8Zag2njK8eUpbFnuLyOyTxA+Ry5KnBbX9wRQudTyMeygbC1AAJrWnAKDMQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id f8d8cfb7 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74842@debbugs.gnu.org>; Thu, 12 Dec 2024 21:07:51 +0000 (UTC) Date: Thu, 12 Dec 2024 22:07:09 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> References: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> MIME-Version: 1.0 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader/u-boot.scm (write-u-boot-image): Add procedure. (install-beaglebone-black-u-boot, install-allwinner-u-boot, install-allwinner64-u-boot, install-imx-u-boot, install-puma-rk3399-u-boot, install-rockchip-u-boot, install-sifive-unmatched-u-boot, install-starfive-visionfive2-u-boot): Use write-u-boot-image. Change-Id: Icb73534bfc5b9ab7c8874176f649c29275c388cf --- gnu/bootloader/u-boot.scm | 84 ++++++++++++++------------------------- 1 file changed, 29 insertions(+), 55 deletions(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 5ea5f418b4..5d5fc1bff2 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -66,6 +66,22 @@ (define (make-u-boot-installer file) (let ((install-dir (string-append mount-point "/boot"))) #$@file)))) +(define (write-u-boot-image files block-size) + "FILES is a list of (FILE COUNT OFFSET) tuples. Each FILE is written +to the target image at BLOCK-SIZE * OFFSET. The number of bytes written +is BLOCK-SIZE * COUNT, or FILE size if COUNT is not given." + (define (write-file-to-image file) + (match file + ((file count ... offset) + (let* ((file #~(string-append bootloader "/libexec/" #$file)) + (size (match count + (() #~(stat:size (stat #$file))) + ((count) (* count block-size))))) + #~(write-file-on-device #$file #$size image + #$(* offset block-size)))))) + #~(lambda (bootloader _ image) + #$@(map write-file-to-image files))) + (define install-u-boot #~(lambda (bootloader root-index image) (if bootloader @@ -78,75 +94,33 @@ (define install-beaglebone-black-u-boot ;; the MLO and is expected at 0x60000. Write both first stage ("MLO") and ;; second stage ("u-boot.img") images, read in BOOTLOADER directory, to the ;; specified DEVICE. - #~(lambda (bootloader root-index image) - (let ((mlo (string-append bootloader "/libexec/MLO")) - (u-boot (string-append bootloader "/libexec/u-boot.img"))) - (write-file-on-device mlo (* 256 512) - image (* 256 512)) - (write-file-on-device u-boot (* 1024 512) - image (* 768 512))))) + (write-u-boot-image '(("MLO" 256 256) ("u-boot.img" 768 1024)) 512)) (define install-allwinner-u-boot - #~(lambda (bootloader root-index image) - (let ((u-boot (string-append bootloader - "/libexec/u-boot-sunxi-with-spl.bin"))) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 8 1024))))) + (write-u-boot-image '(("u-boot-sunxi-with-spl.bin" 8)) 1024)) (define install-allwinner64-u-boot - #~(lambda (bootloader root-index image) - (let ((spl (string-append bootloader "/libexec/u-boot-sunxi-with-spl.bin")) - (u-boot (string-append bootloader "/libexec/u-boot-sunxi-with-spl.fit.itb"))) - (write-file-on-device spl (stat:size (stat spl)) - image (* 8 1024)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 40 1024))))) + (write-u-boot-image '(("u-boot-sunxi-with-spl.bin" 8) + ("u-boot-sunxi-with-spl.fit.itb" 40)) + 1024)) (define install-imx-u-boot - #~(lambda (bootloader root-index image) - (let ((spl (string-append bootloader "/libexec/SPL")) - (u-boot (string-append bootloader "/libexec/u-boot.img"))) - (write-file-on-device spl (stat:size (stat spl)) - image (* 1 1024)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 69 1024))))) + (write-u-boot-image '(("SPL" 1) ("u-boot.img" 69)) 1024)) (define install-puma-rk3399-u-boot - #~(lambda (bootloader root-index image) - (let ((spl (string-append bootloader "/libexec/idbloader.img")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device spl (stat:size (stat spl)) - image (* 64 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 512 512))))) + (write-u-boot-image '(("idbloader.img" 64) ("u-boot.itb" 512)) 512)) (define install-rockchip-u-boot - #~(lambda (bootloader root-index image) - (let ((idb (string-append bootloader "/libexec/idbloader.img")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device idb (stat:size (stat idb)) - image (* 64 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 16384 512))))) + (write-u-boot-image '(("idbloader.img" 64) ("u-boot.itb" 16384)) 512)) (define install-sifive-unmatched-u-boot - #~(lambda (bootloader root-index image) - (let ((spl (string-append bootloader "/libexec/spl/u-boot-spl.bin")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device spl (stat:size (stat spl)) - image (* 34 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 2082 512))))) + (write-u-boot-image '(("spl/u-boot-spl.bin" 34) ("u-boot.itb" 2082)) + 512)) (define install-starfive-visionfive2-u-boot - #~(lambda (bootloader root-index image) - (let ((spl (string-append - bootloader "/libexec/spl/u-boot-spl.bin.normal.out")) - (u-boot (string-append bootloader "/libexec/u-boot.itb"))) - (write-file-on-device spl (stat:size (stat spl)) - image (* 34 512)) - (write-file-on-device u-boot (stat:size (stat u-boot)) - image (* 2082 512))))) + (write-u-boot-image '(("spl/u-boot-spl.bin.normal.out" 34) + ("u-boot.itb" 2082)) + 512)) (define install-starfive-visionfive2-uEnv.txt (make-u-boot-installer From patchwork Thu Dec 12 21:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34844 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8AC3427BBEA; Thu, 12 Dec 2024 21:09:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,TVD_SPACE_RATIO,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CEF3E27BBE2 for ; Thu, 12 Dec 2024 21:09:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLqQp-0005tN-V1; Thu, 12 Dec 2024 16:09:11 -0500 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 1tLqQk-0005sz-V2 for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:06 -0500 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 1tLqQk-0007g0-I8 for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:06 -0500 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=TBwp4RFg2Lq/1Gto5w8q8qSUP1OjhTWIpWA7F8Bugsw=; b=hmLvdojs7QerkHogO/DGjaErh6ihsb6cHXcTDBHV3+GEMXtzQk06qbqvLnaQn0Jw08OVLMRIu+Ajw7+MynrAYNqQTNikDTJ/d2wb/R7dL4Yrwvy2GyNn/kVnTkrQnKnDPRHBRp5LsMmumcaA5MFtDdIrdGTG04nfF98P27Hvo2WK0OxxytdbJenrQHEHEFPNMoenUHF6khf9cK7L5iP+/D4eId5xZoA5sKEED1dnljaWjLXNn5JOpJJLsWQYbs6IXjbrlFtxGLA0/vWO0V1qYErIc9+KJ6gFodz9jrRlNpZ9RkW9kCz0Bx3qy13GIEk249irkKov+BI52GCzOsUKrA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLqQg-0000x6-QB; Thu, 12 Dec 2024 16:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74842] [PATCH 3/4] gnu: u-boot-rockpro64-rk3399: Remove obsolete substitute. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 21:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74842@debbugs.gnu.org Cc: Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 74842-submit@debbugs.gnu.org id=B74842.17340376933564 (code B ref 74842); Thu, 12 Dec 2024 21:09:02 +0000 Received: (at 74842) by debbugs.gnu.org; 12 Dec 2024 21:08:13 +0000 Received: from localhost ([127.0.0.1]:40606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqPt-0000vP-E1 for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:08:13 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37851 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqPp-0000uH-UG for 74842@debbugs.gnu.org; Thu, 12 Dec 2024 16:08:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734037672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TBwp4RFg2Lq/1Gto5w8q8qSUP1OjhTWIpWA7F8Bugsw=; b=k5PwiWP+ngA6VXOPMhfBULgzC5xVaKzZC64QEaTYI2qT0RDAh2aPLIajRv8TfJvU16gbUu Lv9URcosnmb4olWIWaWWufJu0mjqCDJXDWg/9onFTM9gP/VOoEjEgZ7cSoYyOPEENFMjiw rCn5wNnAeonDyXaj8rjgLLT9ZMh5Ps5y3C8QgFlZ2LXo6u/zPWKjAqXgiQ9yhg8p92NQDl mho9LcIf9xcq8NcCAbryHHGPfVZYaEsj+xEeKGNqdrkUnM87v5IMDBm63wzg2FskABDVRj wUgRRVzoFUELI2IZHVhFkSH4y5T57/UcI7ve4RfpEN1FJfR0PXtenVfOZD8kMQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 35d34c08 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74842@debbugs.gnu.org>; Thu, 12 Dec 2024 21:07:52 +0000 (UTC) Date: Thu, 12 Dec 2024 22:07:10 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> References: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> MIME-Version: 1.0 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/bootloaders.scm (u-boot-rockpro64-rk3399)[arguments]: Merge substitutes. Remove non-matching substitute. Change-Id: I27dbc51c0eb95de9e1474c966a4e97f7cff26009 --- gnu/packages/bootloaders.scm | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 788c7dc9ef..15cdaddd7e 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -1475,26 +1475,8 @@ (define-public u-boot-rockpro64-rk3399 (add-after 'unpack 'patch-header (lambda _ (substitute* "include/config_distro_bootcmd.h" - (("\"scsi_need_init=false") - "\"setenv scsi_need_init false") - (("#define BOOTENV_SET_SCSI_NEED_INIT \"scsi_need_init=;") - "#define BOOTENV_SET_SCSI_NEED_INIT \"setenv scsi_need_init;")) - (substitute* "include/configs/rockchip-common.h" - (("#define BOOT_TARGET_DEVICES\\(func\\)") - " -#if CONFIG_IS_ENABLED(CMD_SCSI) - #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0) -#else - #define BOOT_TARGET_SCSI(func) -#endif -#define BOOT_TARGET_DEVICES(func)") - (("BOOT_TARGET_NVME\\(func\\) \\\\") - "\ -BOOT_TARGET_NVME(func) \\ - BOOT_TARGET_SCSI(func) \\")))) - ;; Phases do not succeed on the bl31 ELF. - (delete 'strip) - (delete 'validate-runpath))))) + (("\"scsi_need_init=") + "\"setenv scsi_need_init")))))))) (inputs (modify-inputs (package-inputs base) (append arm-trusted-firmware-rk3399)))))) From patchwork Thu Dec 12 21:07:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34843 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 06DCE27BBEA; Thu, 12 Dec 2024 21:09:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 93CA427BBE2 for ; Thu, 12 Dec 2024 21:09:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLqQo-0005tC-Gi; Thu, 12 Dec 2024 16:09:10 -0500 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 1tLqQi-0005sa-QK for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:05 -0500 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 1tLqQi-0007fh-IH for guix-patches@gnu.org; Thu, 12 Dec 2024 16:09:04 -0500 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=VAGnmjtmHT+VC9H7+39P3Sv17eQJW7d3xhqqDWcE9ic=; b=APK3naKoYCnnC1nX+DF0Jyi8RRtYebFCweerUK6TBOeNGR93gNvdA2jUR78lGmy8Z5vd0KM958MctN8PBi7gzx9fXTRa7QxZptjjOtEktE38itz5IUuHhURVz5ZOSLVQVSLzFL/teFAfwUZeuk+9zgI4RjNvY21TgHuV0tRfjOFYcjxd9kyQNqioj4V/HEIp+0YfzmacPAQ+jpa+hV/oOQxn2gJA+EkbmDEbJuFSvlfj/VMuil7hhVdRl7UxGf01rrkP3O9jW7YzvsCKpekqB7TAPn32gA7zKDF/6Ie10xISGamH5HGNCMfOH7DqYfNYPZ/YbC9rM7GIyBYu8rAjDg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLqQh-0000xD-Ch; Thu, 12 Dec 2024 16:09:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74842] [PATCH 4/4] gnu: Add make-u-boot-rockchip-package procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 21:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74842@debbugs.gnu.org Cc: Efraim Flashner , Vagrant Cascadian X-Debbugs-Original-Xcc: Efraim Flashner , Vagrant Cascadian Received: via spool by 74842-submit@debbugs.gnu.org id=B74842.17340377033585 (code B ref 74842); Thu, 12 Dec 2024 21:09:03 +0000 Received: (at 74842) by debbugs.gnu.org; 12 Dec 2024 21:08:23 +0000 Received: from localhost ([127.0.0.1]:40608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqPx-0000vd-Of for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:08:23 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37851 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLqPq-0000uH-TA for 74842@debbugs.gnu.org; Thu, 12 Dec 2024 16:08:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734037672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VAGnmjtmHT+VC9H7+39P3Sv17eQJW7d3xhqqDWcE9ic=; b=GtGoWXxFD/XUpc/7zk13bbo4lUrUwAXzYBTF3Crluul+rZonIVlEqEytuYkOgbyedxmViG 5eEC3stTxd6Ze0pL2YegYGQZw8wc2B4hLAxSjc5Uc91Ca8RzEz3guWxTiJOmZ4QN55Rhcq RZqSW7KDHvsJr2zKmcm7EkbmyCG/NvbBMCejDSr6b3WIzCPG/8jUueOsFuN/U11mfG01K2 LMlozJD/qgRtGBRb2tc6k7ivNnAZf5K1prl4jtYErILd+i/bUhouHDa8BH0kKwA+rbeiCT SftMZ3awA0tg8/dQ3rqfcoylat+TDTCtqLNcQ4gxSHs1ul5ku7VxM73RVmufwA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 381b737c (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74842@debbugs.gnu.org>; Thu, 12 Dec 2024 21:07:52 +0000 (UTC) Date: Thu, 12 Dec 2024 22:07:11 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> References: <6a1609d369654f967bdcb42bec27357b5f522ebf.1734037218.git.herman@rimm.ee> MIME-Version: 1.0 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/bootloaders.scm (make-u-boot-rockchip-package): Add. (u-boot-orangepi-r1-plus-lts-rk3328, u-boot-puma-rk3399, u-boot-rock64-rk3328, u-boot-firefly-rk3399, u-boot-rockpro64-rk3399, u-boot-pinebook-pro-rk3399): Use procedure. Change-Id: I0d7632e46cfed312f8b2843c6fafc912077bc241 --- gnu/packages/bootloaders.scm | 136 +++++++++++------------------------ 1 file changed, 41 insertions(+), 95 deletions(-) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 15cdaddd7e..8d3cda760a 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -18,7 +18,7 @@ ;;; Copyright © 2022, 2023 Denis 'GNUtoo' Carikli ;;; Copyright © 2021 Stefan ;;; Copyright © 2022, 2023, 2024 Maxim Cournoyer -;;; Copyright © 2023 Herman Rimm +;;; Copyright © 2023-2024 Herman Rimm ;;; Copyright © 2023 Simon Tournier ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; @@ -1145,6 +1145,27 @@ (define*-public (make-u-boot-package board triplet (copy-file file target-file))) uboot-files))))))))))) +(define* (make-u-boot-rockchip-package board soc #:optional configs) + "Return the U-Boot package for BOARD with AAarch64 Rockchip SOC +(System on Chip)." + (let* ((board (string-append board "-" (symbol->string soc))) + (base (make-u-boot-package board "aarch64-linux-gnu" + #:configs configs)) + (atf (match soc + ('rk3399 arm-trusted-firmware-rk3399) + ('rk3328 arm-trusted-firmware-rk3328)))) + (package + (inherit base) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'unpack 'set-environment + (lambda* (#:key inputs #:allow-other-keys) + (let ((atf (assoc-ref inputs #$(package-name atf)))) + (setenv "BL31" (string-append atf "/bl31.elf"))))))))) + (inputs (modify-inputs (package-inputs base) (append atf)))))) + (define-public u-boot-am335x-boneblack (let ((base (make-u-boot-package "am335x_evm" "arm-linux-gnueabihf" @@ -1260,19 +1281,7 @@ (define-public u-boot-novena partition.")) (define-public u-boot-orangepi-r1-plus-lts-rk3328 - (let ((base (make-u-boot-package "orangepi-r1-plus-lts-rk3328" "aarch64-linux-gnu"))) - (package - (inherit base) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'set-environment - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (setenv "BL31" (search-input-file inputs "bl31.elf")))))))) - (inputs - (modify-inputs (package-inputs base) - (append arm-trusted-firmware-rk3328)))))) + (make-u-boot-rockchip-package "orangepi-r1-plus-lts" 'rk3328)) (define-public u-boot-cubieboard (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf")) @@ -1281,22 +1290,7 @@ (define-public u-boot-cubietruck (make-u-boot-package "Cubietruck" "arm-linux-gnueabihf")) (define-public u-boot-puma-rk3399 - (let ((base (make-u-boot-package "puma-rk3399" "aarch64-linux-gnu"))) - (package - (inherit base) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'set-environment - (lambda* (#:key inputs #:allow-other-keys) - (setenv "BL31" (search-input-file inputs "/bl31.elf")))) - ;; Phases do not succeed on the bl31 ELF. - (delete 'strip) - (delete 'validate-runpath))))) - (inputs - (modify-inputs (package-inputs base) - (append arm-trusted-firmware-rk3399)))))) + (make-u-boot-rockchip-package "puma" 'rk3399)) (define-public u-boot-qemu-arm (make-u-boot-package "qemu_arm" "arm-linux-gnueabihf" @@ -1417,87 +1411,39 @@ (define-public u-boot-starfive-visionfive2 (append opensbi-for-visionfive2)))))) (define-public u-boot-rock64-rk3328 - (let ((base (make-u-boot-package "rock64-rk3328" "aarch64-linux-gnu"))) - (package - (inherit base) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'set-environment - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (setenv "BL31" (search-input-file inputs "bl31.elf")))))))) - (inputs - (modify-inputs (package-inputs base) - (append arm-trusted-firmware-rk3328)))))) + (make-u-boot-rockchip-package "rock64" 'rk3328)) (define-public u-boot-firefly-rk3399 - (let ((base (make-u-boot-package "firefly-rk3399" "aarch64-linux-gnu"))) - (package - (inherit base) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'set-environment - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (setenv "BL31" (search-input-file inputs "bl31.elf")))) - ;; Phases do not succeed on the bl31 ELF. - (delete 'strip) - (delete 'validate-runpath))))) - (inputs - (modify-inputs (package-inputs base) - (append arm-trusted-firmware-rk3399)))))) + (make-u-boot-rockchip-package "firefly" 'rk3399)) (define-public u-boot-rockpro64-rk3399 - (let ((base (make-u-boot-package "rockpro64-rk3399" "aarch64-linux-gnu" - #:configs '("CONFIG_USB=y" - "CONFIG_AHCI=y" - "CONFIG_AHCI_PCI=y" - "CONFIG_SATA=y" - "CONFIG_SATA_SIL=y" - "CONFIG_SCSI=y" - "CONFIG_SCSI_AHCI=y" - "CONFIG_DM_SCSI=y" - ;; Disable SPL FIT signatures, - ;; due to GPLv2 and Openssl - ;; license incompatibilities - "# CONFIG_SPL_FIT_SIGNATURE is not set")))) + (let ((base (make-u-boot-rockchip-package + "rockpro64" 'rk3399 + '("CONFIG_USB=y" + "CONFIG_AHCI=y" + "CONFIG_AHCI_PCI=y" + "CONFIG_SATA=y" + "CONFIG_SATA_SIL=y" + "CONFIG_SCSI=y" + "CONFIG_SCSI_AHCI=y" + "CONFIG_DM_SCSI=y" + ;; Disable SPL FIT signatures, due to GPLv2 and + ;; OpenSSL license incompatibilities. + "# CONFIG_SPL_FIT_SIGNATURE is not set")))) (package (inherit base) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases) #~(modify-phases #$phases - (add-after 'unpack 'set-environment - (lambda* (#:key inputs #:allow-other-keys) - (setenv "BL31" (search-input-file inputs "/bl31.elf")))) (add-after 'unpack 'patch-header (lambda _ (substitute* "include/config_distro_bootcmd.h" (("\"scsi_need_init=") - "\"setenv scsi_need_init")))))))) - (inputs - (modify-inputs (package-inputs base) - (append arm-trusted-firmware-rk3399)))))) + "\"setenv scsi_need_init"))))))))))) (define-public u-boot-pinebook-pro-rk3399 - (let ((base (make-u-boot-package "pinebook-pro-rk3399" "aarch64-linux-gnu"))) - (package - (inherit base) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:phases phases) - #~(modify-phases #$phases - (add-after 'unpack 'set-environment - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (setenv "BL31" (search-input-file inputs "bl31.elf")))) - ;; Phases do not succeed on the bl31 ELF. - (delete 'strip) - (delete 'validate-runpath))))) - (inputs - (modify-inputs (package-inputs base) - (append arm-trusted-firmware-rk3399)))))) + (make-u-boot-rockchip-package "pinebook-pro" 'rk3399)) (define*-public (make-u-boot-bin-package u-boot-package #:key