From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sKfFHig8fmFbegAAgWs5BA (envelope-from ) for ; Sun, 31 Oct 2021 07:48:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SRF+Gig8fmG4cAAA1q6Kng (envelope-from ) for ; Sun, 31 Oct 2021 06:48:08 +0000 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 9D9721587B for ; Sun, 31 Oct 2021 07:48:07 +0100 (CET) Received: from localhost ([::1]:46424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mh4dR-00044n-6H for larch@yhetil.org; Sun, 31 Oct 2021 02:48:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mh4dG-00044a-O1 for help-guix@gnu.org; Sun, 31 Oct 2021 02:47:54 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:53118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mh4dE-0001a6-91 for help-guix@gnu.org; Sun, 31 Oct 2021 02:47:54 -0400 Date: Sun, 31 Oct 2021 06:47:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1635662864; bh=wr8paj6gnXWj4B8yWepuLkMeGsCz0WVfpeIaEGpfQ70=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=L76cVU3wPQeF+TM/NCFvCWRf1ecTfgWDZHpEk0ncdMs3qouK9KU7/hX2ummYDm3js HbuB7RXtm2GBYaF/uFFAfEbJdA+brGJTw18F9Wlcv+N2MtaauH1K6l8hm1xq0H893v Y2hDMPiTgxl2qSdnBwA0gWn4XCTp3eqADJV0tSRk= To: Vagrant Cascadian From: phodina Cc: help-guix Subject: Re: U-Boot for Raspberry Pi Message-ID: In-Reply-To: <87h7cygocz.fsf@yucca> References: <87h7cygocz.fsf@yucca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.133; envelope-from=phodina@protonmail.com; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: phodina Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635662887; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=wr8paj6gnXWj4B8yWepuLkMeGsCz0WVfpeIaEGpfQ70=; b=X9hBjKKM1aU8qcWkYft+Xl7Df3egohwoopp5w3Bn0/KxgG9ITF1nB/1uF8vvAQlN8V8cOe urHOHTx2QXXp9/lARc2hLrNYrnrqORg9iYosaR5z6PtD1VQZ3SEfe2TMMSey+9k7lwAa4I dFn3l+uYOIiN8q/Sq9Rg6FBJ7+UL3ODL5eKiJzbzyqmG98fNdsRbEqcxgP4uy0mMP53/F/ l7Lz75iIMSsFOboOc/hHkWQqH197LbnUH524Nq1Rl567K4/OpYUQH3E9zsl4Jkvdh56wze e7GOwCZOHP5aw68IcmcXbObwCdVki2UMxvnpO9nd+JnFweE4FDLCzec0orLy1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635662887; a=rsa-sha256; cv=none; b=b/0B8OPenCGEBVAr9QNuf3GeoZtOICXk91AETnKTkW37RE1c51ak4xt7dtfMQlsSJRo8XE 19j/nfykxcmnzDFoGmEKsVAxpa4r8ZzCukTupcrWBp4LPwf8o2GqbiALsTVd5frHU13Av2 ol2MFaPZRF7jVu9RErRAp+vJ2ztmQzFM6E2blRKviPoR82MKfLKMGMPTZtjAuEGStkwYVL xVhcmkPVH3NVpEVoz6IxCJBrfzdHraINAjfOSOzDbWTGh6MOoq2nPn7g5fKskweNe7BWUP cTS4394Xr4vTfg6reiUyqSYiOzOfUIWzZEHPhEP6yZDOOI7SAc52kiDH+ij/fw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=L76cVU3w; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail header.b=L76cVU3w; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 9D9721587B X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: kc4Ue3VQgN89 Hi vagrant, On Sunday, October 31st, 2021 at 12:05 AM, Vagrant Cascadian wrote: > On 2021-10-30, phodina via wrote: > > > I'm trying to run Guix System on Raspberry Pi. In order to do that we > > > > need a way to boot it up. > > > > There is the nonfree Broadcom bootloader, which does the job and it's > > > > used by many distributions. > > > > However, there is also an open source alternative as U-Boot supports > > > > the BCM SoCs. > > Well, you still need to load u-boot from the broadcom > > firmware/bootloader... Yes, unfortunately you are right. The VC4 GPU core is started first and req= uires the closed source binaries (bootcode.bin, start.elf and fixup.dat). Also no disrespect was meant to the Guix help mailing list. I thought the c= losed source code could be avoided. > > > If I inherit from the u-boot itself and specify the name, it's then in = the list and I can build it. > > > > But the I can't use the package for the bootloader record. > > > > There must be something trivial I had overlooked. > > > > Could you please guide me on the procedure for porting the u-boot to ne= w board as a new Guix package? > > There are install targets defined in gnu/bootloader/u-boot.scm, though > > most (all?) of those targets install to a raw device offset, whereas > > u-boot for the rpi needs u-boot.bin to be copied to your firmware > > partition and needs to be specified as a "kernel" in config.txt, if I > > recall correctly. As you correctly pointed out that you can specify in the config.txt the nex= t executable to be loaded which in this case is the u-boot. Also with U-boot it's the usually the case that you place it at specific fl= ash location. However, Raspberry Pi has BootRom which is able to access FAT file system and load files from there. Therefore the SD card has to be formatted with MBR layout, FAT boot partition and then let's say Linux root partition. > > > (define-public u-boot-raspberry-pi-4 > > > > (make-u-boot-package "rpi_4" "aarch64-linux-gnu")) > > I would also try to keep the u-boot-BOARD matching the defconfig, > > e.g. u-boot-rpi-4 instead of u-boot-raspberry-pi-4. Not for any > > technical reason, per se, just keeping the u-boot target naming > > consistent. Good idea. Though the longer version would be more readable. > > You might want to just build the u-boot package, and then manually copy > > it to your firmware partition and configure that appropriately once, and > > then just use guix to generate and update the extlinux.conf... I forget That's the point of my original question as I created this package definiti= on. It builds fine and all the files are there. But as stated above can't be pa= ssed to the bootloader record in the operating-system. (define-public u-boot-rpi-2 (let ((base (make-u-boot-package "rpi_2" "arm-linux-gnueabihf"))) (package (inherit base) (name "uboot-rpi-2")))) The contents of the package are here: tree /gnu/store/77syxs86n0c52pslnzfsn9xzv1dzmxhc-uboot-rpi-2-2021.10/libexe= c /gnu/store/77syxs86n0c52pslnzfsn9xzv1dzmxhc-uboot-rpi-2-2021.10/libexec =E2=94=9C=E2=94=80=E2=94=80 arch =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 arm =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 dts =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-a.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-a-plu= s.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-b.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-b-plu= s.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-b-rev= 2.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-cm1-i= o1.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-zero.= dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2835-rpi-zero-= w.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2836-rpi-2-b.d= tb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2837-rpi-3-a-p= lus.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2837-rpi-3-b.d= tb =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 bcm2837-rpi-3-b-p= lus.dtb =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 bcm2837-rpi-cm3-i= o3.dtb =E2=94=9C=E2=94=80=E2=94=80 doc =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 README.commands.spl =E2=94=9C=E2=94=80=E2=94=80 dts =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 dt.dtb =E2=94=9C=E2=94=80=E2=94=80 lib =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 efi_loader =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 helloworld.efi =E2=94=9C=E2=94=80=E2=94=80 scripts =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 Makefile.spl =E2=94=9C=E2=94=80=E2=94=80 tools =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 binman =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 test =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 descriptor.bin =E2=94=9C=E2=94=80=E2=94=80 u-boot =E2=94=9C=E2=94=80=E2=94=80 u-boot.bin =E2=94=94=E2=94=80=E2=94=80 u-boot-nodtb.bin > > the exact syntax to generate extlinux.conf without actually installing > > u-boot, but I've done it in the past. So do I now need to define a new bootloader target in gnu/bootloader/u-boot= .scm, where instead of writing directly to the image follow more the pattern of f= unction install-grub-efi, where based on the UEFI you also need to have EFI FAT par= tition and just copy the files over to their correct location? > > Another option would be to build the raspberry pi UEFI (not 100% sure of > > the licensing, but reasonably free) instead of u-boot, and then use > > guix's standard UEFI configuration with grub-efi and such. Then I can treat the closed source firmware to boot as UEFI and just package the u-boot, right? > > live well, > > vagrant