From owner-freebsd-arm@freebsd.org Wed Mar 18 18:02:49 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CBB4268091 for ; Wed, 18 Mar 2020 18:02:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-9.consmr.mail.ne1.yahoo.com (sonic313-9.consmr.mail.ne1.yahoo.com [66.163.185.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48jHvD2yxWz4ShV for ; Wed, 18 Mar 2020 18:02:48 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: W6SnTisVM1lZDPdyAIbpf5_Mj.GQJNdAArR3mFV4z2sBTXJ9QjqAp_BPGMo3qqR 9tb1jzfgy9w.qMjoBzzBy4gUMsa5L40Ci3LwHE23JwO0BO0__xVk63OUqOeL9z5IO9cMNoG7TByN HhdyZW4.kPkyaCLAma9cjlIKSg.Cu_1_PF4bk3Nq2FtOCIhmo6lg5UT87r9rOwQmE7q8x1cndQsY w28TevMwo38k3XLOksUGfP7IqidwMvg1I7ZYw5LZhb8MSttoLWpGIXIFh4svlhb69S4bgUtEeVcG GAPM3_xY3_damE3PmjKMzeQthBul0V3zldRzjL3cphsCBEKpG.rG2juRYdtbuFCtEuinw5hpqeGJ bcV8Jv_b0mWkZr631RODWdp3YhHWVMs4xfLXFiW.mx2Um64OU1.swUFxSTMR9p0sCJYI2b8bigrk _8qSF1t2TZs7qBcXHfLc10tHyw0Nh3vaJTIQ23KGlkTC5CzXqrpuC0CPyD7OkWnnAISydpj0d7Qw b0yD5Oqd5VXrLiqXBE08UCP0UZ7q2e.h.21rU5kCyU7R2P9mK1_7uCZT9Dn2fHjRBbiwhBpEp9Z1 tCjYuulwAHbWleflyRXaqHKQ_jAT6ZwWqRFTJKToADzQbaw8kAjYdyiJcb05HuBS4u.bpvfmCk7P w68JijqNj.yR.EwDRvzV28MHl_.amQyW3vk473DH33tnlUybey5Z71oavvhiqZiWd4ZXACOLodsY RYneFUUHIawAfPnUaP4lfb2sz7TQpFBkLQKlSYhxAcOnvpKu5eGMjqqi0pR05Sq6YhbTtyfXybGj VYpRmfp.tR7Ax93FFr0S7DboFAoakDnCHg6_EkJq7wZ9z3k5Xwm3hhmnfj3dIEdyi9i4fQD7fLs1 2OnUqu39YSiY3FNIBEdbdoE0TaqYpcqqNebfXLCPsdLdrX0ugOJ_TI6w4YF4vBBxCeOJ4gcphrku 5GZYXzKr2_W3ajuaHPblOF4BAdvMjR6GqHED4OwJ9v56Hn6zv0rtUbNH.Ywf5qNPF6ZEFg06oPFs ax_H4oY6CnjKHTT5DAuPfrvZKlC03gXNQRfzRVOVS1kNKA87gLeEPUFYLvXLp0H9N6SqnS.rhmXq FB1QO7qmfLBfo.Pseu1JAwp4AQyf6XARnIAOMHUqytIkkbOeTVy.1htp78bEANv.k8ikhbiQLj2K 9Keg1po2onwH8Xck1wgwwm7vqDPTflUaL7fr0yLT9DQQTUo8d8eIIUlDeTDxAbhNLETPu27.C1AR VlAeslZx1d30AgI2qww5KIY2Uq7MB71loo7WJmNTFaqXxJ_Vt7fSldo75xXhB73XIhPim9cT97GF xbLpUiPLy1vNPWZDQ1gx.gEzXwqByxm2EQ4BRTNsmHT_hFh56VK.iXyWyUw3EAcje4m9KhL2Wec9 jGVPRgHs9YgJkVaJ4FMVJXX8- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Wed, 18 Mar 2020 18:02:47 +0000 Received: by smtp416.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5aac51792ac7942d11b56f07d4fc065a; Wed, 18 Mar 2020 18:02:45 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Upgrading u-boot on an rpi3 From: Mark Millard In-Reply-To: <20200318172339.GB67865@www.zefox.net> Date: Wed, 18 Mar 2020 11:02:43 -0700 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <456B1ED8-B335-405B-AB7B-B65968631323@yahoo.com> References: <20200318054243.GA67865@www.zefox.net> <4B4CF1DF-F3C0-4ED3-AAC0-4FC0A8182787@yahoo.com> <20200318172339.GB67865@www.zefox.net> To: bob prohaska X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Rspamd-Queue-Id: 48jHvD2yxWz4ShV X-Spamd-Bar: + X-Spamd-Result: default: False [1.46 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_SPAM_MEDIUM(0.99)[0.990,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[32.185.163.66.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_LONG(0.97)[0.974,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[ip: (2.29), ipnet: 66.163.184.0/21(1.18), asn: 36646(0.94), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 18:02:49 -0000 On 2020-Mar-18, at 10:23, bob prohaska wrote: > On Tue, Mar 17, 2020 at 11:42:09PM -0700, Mark Millard wrote: >>=20 >>=20 >> On 2020-Mar-17, at 22:42, bob prohaska wrote: >>=20 >>> Upgrading u-boot on an rpi3 running -current is turning out to be >>> more involved than expected. Updating /boot/msdos/u-boot.bin didn't >>> do the trick, getting stuck at the u-boot> prompt. >>>=20 >>> Backing out the change by putting the old u-boot.bin in place >>> restored the normal boot behavior, so I don't think the mischief >>> is owed to anything else I might have screwed up. >>>=20 >>> I noticed there was a metadata file in = /usr/local/share/u-boot/u-boot-rpi3, >>> but copying that along with the new u-boot.bin to /boot/msdos >>> reproduced the previous failure. >>=20 >> The metadata file is involved in doing the build. Some >> look like: >>=20 >> METHOD=3Duboot-raw >> FILES=3D"u-boot-sunxi-with-spl.bin" >> OFFSET=3D8 >> BS=3D1k >>=20 >> (dd command information) and others like: >=20 > The reference to dd is rather confusing in this context. Has it=20 > something to do with cross compiling on to new bootable media? > If dd is required in self-hosting then I'm doing things very wrong. Arm boards other than RPi*'s tend to involve putting materials outside any file system on the media that is involved. Example /usr/local/share/u-boot/u-boot-orangepi-plus-2e/metadata was used above. Note the dd command below and the bs=3D and seek=3D and the file name. # more /usr/local/share/u-boot/u-boot-orangepi-plus-2e/README U-Boot loader for OrangePi Plus2E. To install this bootloader on an sdcard just do : dd = if=3D$LOCALBASE/share/u-boot/u-boot-orangepi-plus-2e/u-boot-sunxi-with-spl= .bin of=3D/path/to/sdcarddevice bs=3D1k seek=3D8 conv=3Dsync This version is patched so that: * API features are enabled. * A boot.scr (U-Boot script) that loads ubldr.bin and execute it is = included For information about running FreeBSD on Allwinner boards, see https://wiki.freebsd.org/FreeBSD/arm/Allwinner WWW: http://www.denx.de/wiki/U-Boot Such is not involved for the RPi*'s: all the material goes in a file system, no dd involved. >> METHOD=3Duboot-file >> FILES=3D"u-boot.bin" The above was an example from an RPi* . Note the "uboot-raw" earlier vs. "uboot-file" here. That indicates the outside file system vs. inside file system status. >> (copy file to msdosfs information). They are not >> for the ARM board to use during boot. >>=20 >>> This is a self-hosting machine, with ports at 528581, >>> kernel and world are at 351836. Sources are at 358976=20 >>>=20 >>> Could the self-hosting be the source of the trouble? >>> The "no mmc device at slot 0" looks rather odd, given >>> that the boot device is mmcsd0. >>=20 >> u-boot's identification of devices is not the same as >> FreeBSD's. "MMC Device 0" need not be "mmcsd0" at all. >> Slots do not have to be populated an mmc device. >>=20 >>> Here's an excerpt from the console: >>>=20 >>> Hit any key to stop autoboot: 0=20 >>> MMC Device 0 not found >>> no mmc device at slot 0 >>> switch to partitions #0, OK >>> mmc1 is current device >>> Scanning mmc 1:1... >>> Found EFI removable media binary efi/boot/bootaa64.efi >>=20 >> Those last 2 lines above indicate that it found >> your microsd card media and its bootaa64.efi just >> fine. >>=20 >> How old is this file?=20 >=20 > Rather ancient: >=20 > -rwxr-xr-x 1 root wheel 637000 Oct 10 2018 = /boot/msdos/EFI/BOOT/bootaa64.efi >=20 > I have a newer version on a 12.x snapshot: > -rwxr-xr-x 1 root wheel 609960 Nov 1 02:29 = /mnt/EFI/BOOT/bootaa64.efi > Is it prudent to simply substitute the newer version for the older? You may want to extract a more modern one from a snapshot if that does not work. >> Have you been updating >> it via copying /boot/loader.efi to it as > /boot/loader.efi is = updated?=20 > Not following here. Loader.efi appears to be a file and seems to = update=20 > during normal build/install cycles. It's unclear where bootaa64.efi = comes=20 > from; there's only one copy in the filesystem after repeated OS update = cycles.=20 For the ARM boards involved, efi/boot/bootaa64.efi is a copy of /boot/loader.efi . The loader copy used in booting is placed on the msdosfs, not on ufs/zfs. Example from the RPi4 context: # file /boot/loader.efi /boot/loader.efi: MS-DOS executable PE32+ executable (EFI application) = Aarch64, for MS Windows # file /boot/efi/EFI/BOOT/bootaa64.efi=20 /boot/efi/EFI/BOOT/bootaa64.efi: MS-DOS executable PE32+ executable (EFI = application) Aarch64, for MS Windows > . . . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)