From nobody Fri Aug 20 07:42:57 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8CFBE176F9FB for ; Fri, 20 Aug 2021 07:42:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GrYX31kMvz4vdT for ; Fri, 20 Aug 2021 07:42:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1629445377; h=from:from: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; bh=Jf5kLurGuSznuQsPds4hvu3T5tpl6A8qAQTNQpXLEJM=; b=hacjsUAI+cRJiQ+88S+LEHvHIKmVuBV0ijHEyr0W82RvmBuaPLpVmZWCWOZuV0AQXJqj1V DHKz0BIap7oI+8Ad+RsxmC8BJHiQAngy6kRFuso9RLiGKtmL359ZC/c8vgWq2LK7AKJQsE BBCvAXCqKpEntJKlSH5OZWr52CUioSY= Received: from amy (lfbn-idf2-1-644-4.w86-247.abo.wanadoo.fr [86.247.100.4]) by mx.blih.net (OpenSMTPD) with ESMTPSA id ce6993ba (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 20 Aug 2021 07:42:57 +0000 (UTC) Date: Fri, 20 Aug 2021 09:42:57 +0200 From: Emmanuel Vadot To: Karl Denninger Cc: freebsd-arm@freebsd.org Subject: Re: git: 1dec3639fd0c - main - sysutils/u-boot: Update to 2021.07 Message-Id: <20210820094257.503ef8ad4ff07399f24916bd@bidouilliste.com> In-Reply-To: <7b2159e3-d21e-5518-4f5b-9e293c4c1f30@denninger.net> References: <202107071618.167GIvXd048504@gitrepo.freebsd.org> <874kd3390q.wl-herbert@gojira.at> <87o8b8n1rf.wl-herbert@gojira.at> <87mtqsn0we.wl-herbert@gojira.at> <20210712115010.a405a8f5e313ec75142fa544@bidouilliste.com> <87k0lnybp4.wl-herbert@gojira.at> <20210819212311.e880b3e4f0667da3afab5f93@bidouilliste.com> <7b2159e3-d21e-5518-4f5b-9e293c4c1f30@denninger.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4GrYX31kMvz4vdT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 19 Aug 2021 18:39:37 -0400 Karl Denninger wrote: > Ok, something else funny is going on now..... and I'm not at all sure=20 > what, or how to diagnose further. >=20 > I grabbed the last u-Boot, which 2021.04 (April 13th) and put that on=20 > the disk, and restored the config.txt. >=20 > Now I get this: >=20 > U-Boot 2021.04 (Apr 13 2021 - 03:57:26 +0000) >=20 > DRAM:=A0 948 MiB > RPI 3 Model B (0xa22082) > MMC:=A0=A0 mmc@7e300000: 0 > Loading Environment from FAT... In:=A0=A0=A0 serial > Out:=A0=A0 vidconsole > Err:=A0=A0 vidconsole > Net:=A0=A0 No ethernet found. > starting USB... > Bus usb@7e980000: USB DWC2 > scanning bus usb@7e980000 for devices... 3 USB Device(s) found > =A0=A0=A0=A0=A0=A0 scanning usb for storage devices... 0 Storage Device(= s) found > Hit any key to stop autoboot:=A0 0 > switch to partitions #0, OK > mmc0 is current device > Scanning mmc 0:1... > libfdt fdt_check_header(): FDT_ERR_BADMAGIC > Scanning disk mmc@7e300000.blk... > ** Unrecognized filesystem type **=A0 <<<<----- Huh? > Found 3 disks > No EFI system partition > BootOrder not defined > EFI boot manager: Cannot load any image > Found EFI removable media binary efi/boot/bootaa64.efi > 97448 bytes read in 35 ms (2.7 MiB/s) > libfdt fdt_check_header(): FDT_ERR_BADMAGIC > Booting /efi\boot\bootaa64.efi >=20 > Except that starts, and then.. >=20 > >> FreeBSD EFI boot block > =A0=A0 Loader path: /boot/loader.efi >=20 > =A0=A0 Initializing modules: ZFS UFS > =A0=A0 Load Path: /efi\boot\bootaa64.efi > =A0=A0 Load Device:=20 > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(2)/SD(0)/HD(1,MBR,0x76440= bf1,0x3f,0x18fe7) > =A0=A0 Probing 3 block devices...not supported > not supported > not supported > =A0done > =A0=A0=A0 ZFS found no pools > =A0=A0=A0 UFS found no partitions > Failed to load '/boot/loader.efi' > panic: No bootable partitions found! > ## Application failed, r =3D 1 > EFI LOAD FAILED: continuing... > MMC Device 1 not found > no mmc device at slot 1 >=20 > Which implies I got the bootaa64.efi code loaded and then the EFI code=20 > blew up looking for a bootable filesystem. It looks like you're using boot1.efi as /esp/efi/boot/bootaa64.efi, do not do that, use loader.efi directly. > The filesystem on the disk built by Crochet is: >=20 > root@NewFS:/work/Crochet-work-ARM64 # mdconfig *.img > md0 > root@NewFS:/work/Crochet-work-ARM64 # gpart show md0 > =3D>=A0=A0=A0=A0 63=A0 5761655=A0 md0=A0 MBR=A0 (2.7G) > =A0=A0=A0=A0=A0=A0 63=A0=A0 102375=A0=A0=A0 1=A0 fat32lba=A0 [active]=A0= (50M) > =A0=A0 102438=A0 5659280=A0=A0=A0 2=A0 freebsd=A0 (2.7G) >=20 > root@NewFS:/work/Crochet-work-ARM64 # gpart show md0s2 > =3D>=A0=A0=A0=A0=A0 0=A0 5659280=A0 md0s2=A0 BSD=A0 (2.7G) > =A0=A0=A0=A0=A0=A0=A0 0=A0 5120000=A0=A0=A0=A0=A0 1=A0 freebsd-ufs=A0 (2= .4G) > =A0 5120000=A0=A0=A0 65536=A0=A0=A0=A0=A0 4=A0 freebsd-ufs=A0 (32M) > =A0 5185536=A0=A0 473744=A0=A0=A0=A0=A0 5=A0 freebsd-ufs=A0 (231M) >=20 > That ought to be good and on /dev/md0s2a I indeed have /boot/loader.efi >=20 > root@NewFS:/mnt # file boot/loader.efi > boot/loader.efi: MS-DOS executable PE32+ executable (EFI application)=20 > Aarch64, for MS Windows >=20 >=20 > On 8/19/2021 15:29, Karl Denninger wrote: > > On 8/19/2021 15:23, Emmanuel Vadot wrote: > >> On Sun, 18 Jul 2021 15:48:55 +0200 > >> "Herbert J. Skuhra" wrote: > >> > >>> On Mon, 12 Jul 2021 13:44:43 +0200, "Herbert J. Skuhra" wrote: > >>> > >>>> This happens even with the official builds! > >>>> > >>>> FreeBSD-13.0-STABLE-arm64-aarch64-RPI-20210701-6aee7855180-246143.im= g.xz=20 > >>>> > >>>> =3D=3D> OK (U-Boot 2021.04) > >>>> FreeBSD-13.0-STABLE-arm64-aarch64-RPI-20210708-f6d448caf69-246212.im= g.xz=20 > >>>> > >>>> =3D=3D> Not OK. (U-Boot 2021.07) > >>>> > >>>> I am using U-Boot 2021.04 again because I still don't know how to bo= ot > >>>> from mmc device 2 automatically. > >>> With the below patch my RPI 3 Model B (0xa02082) boots again: > >>> > >>> --- include/configs/rpi.h.orig=A0 2021-07-18 15:37:55.743031000 +0200 > >>> +++ include/configs/rpi.h=A0=A0=A0=A0=A0=A0 2021-07-18 15:38:51.15928= 6000 +0200 > >>> @@ -173,7 +173,8 @@ > >>> =A0 #if CONFIG_IS_ENABLED(CMD_MMC) > >>> =A0=A0=A0=A0=A0=A0=A0=A0 #define BOOT_TARGET_MMC(func) \ > >>> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 func(MMC, mmc, 0) \ > >>> -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 func(MMC, mmc, 1) > >>> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 func(MMC, mmc, 1) \ > >>> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 func(MMC, mmc, 2) > >>> =A0 #else > >>> > >>> > >>> (sysutils/u-boot-rpi3 / U-Boot 2021.07) > >>> > >> =A0 Can you submit that upstream ? > >> =A0 We've tried over the past years to have no local patches for u-boo= t. > >> =A0 Also can you try removing the overlays loaded by the firmware (in > >> config.txt), I think that the mmc overlays might renumber the mmc > >> device and upstream u-boot might not be happy about this. > >> > >> =A0 Thanks, > > > > Ok, so removing the overlay is easy -- I commented out the MMC overlay= =20 > > line and now u-boot starts but.... > > > > U-Boot 2021.07 (Jul 10 2021 - 02:42:14 +0000) > > > > DRAM:=A0 948 MiB > > RPI 3 Model B (0xa22082) > > MMC:=A0=A0 mmc@7e202000: 0, mmcnr@7e300000: 1 > > Loading Environment from FAT... Card did not respond to voltage=20 > > select! : -110 > > In:=A0=A0=A0 serial > > Out:=A0=A0 vidconsole > > Err:=A0=A0 vidconsole > > Net:=A0=A0 No ethernet found. > > starting USB... > > Bus usb@7e980000: usb dr_mode not found > > USB DWC2 > > scanning bus usb@7e980000 for devices... 3 USB Device(s) found > > =A0=A0=A0=A0=A0=A0 scanning usb for storage devices... 0 Storage Device= (s) found > > Hit any key to stop autoboot:=A0 0 > > switch to partitions #0, OK > > mmc0 is current device > > Scanning mmc 0:1... > > libfdt fdt_check_header(): FDT_ERR_BADMAGIC > > Scanning disk mmc@7e202000.blk... > > ** Unrecognized filesystem type ** > > Card did not respond to voltage select! : -110 > > Scanning disk mmcnr@7e300000.blk... > > Disk mmcnr@7e300000.blk not ready > > Found 3 disks > > No EFI system partition > > BootOrder not defined > > EFI boot manager: Cannot load any image > > Found EFI removable media binary efi/boot/bootaa64.efi > > 97448 bytes read in 8 ms (11.6 MiB/s) > > libfdt fdt_check_header(): FDT_ERR_BADMAGIC > > Booting /efi\boot\bootaa64.efi > > > > > > and then. > > > > >> FreeBSD EFI boot block > > =A0=A0 Loader path: /boot/loader.efi > > > > =A0=A0 Initializing modules: ZFS UFS > > =A0=A0 Load Path: /efi\boot\bootaa64.efi > > =A0=A0 Load Device:=20 > > /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(0)/HD(1,MBR,0x764= 40bf1,0x3f,0x18fe7) > > =A0=A0 Probing 3 block devices...not supported > > not supported > > not supported > > =A0done > > =A0=A0=A0 ZFS found no pools > > =A0=A0=A0 UFS found no partitions > > Failed to load '/boot/loader.efi' > > panic: No bootable partitions found! > > ## Application failed, r =3D 1 > > EFI LOAD FAILED: continuing... > > Card did not respond to voltage select! : -110 > > > > Device 0: unknown device > > Waiting for Ethernet connection... unable to connect. > > missing environment variable: pxeuuid > > missing environment variable: bootfile > > Retrieving file: pxelinux.cfg/01-b8-27-eb-17-6d-54 > > Waiting for Ethernet connection... unable to connect. > > missing environment variable: bootfile > > Retrieving file: pxelinux.cfg/00000000 > > Waiting for Ethernet connection... unable to connect. > > missing environment variable: bootfile > > Retrieving file: pxelinux.cfg/0000000 > > > > So it looks like removing the overlay changes it in that I now get the= =20 > > loader, but then it fails AFTER THAT. > > > > Current config.txt: > > > > arm_64bit=3D1 > > dtparam=3Daudio=3Don,i2c_arm=3Don,spi=3Don > > # dtoverlay=3Dmmc > > dtoverlay=3Dpwm > > dtoverlay=3Ddisable-bt > > device_tree_address=3D0x4000 > > kernel=3Du-boot.bin > > > > > --=20 > Karl Denninger > karl@denninger.net > /The Market Ticker/ > /[S/MIME encrypted email preferred]/ --=20 Emmanuel Vadot