Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jul 2021 22:25:49 +0100
From:      Jordan Bass <jordan@jbass.io>
To:        Mark Millard <marklmi@yahoo.com>, Robert Crowston <crowston@protonmail.com>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@FreeBSD.org>
Subject:   Re: RPi4 - Booting from mSD with USB storage
Message-ID:  <F0A4E634-2B59-4785-B7E4-16E58CDB1920@jbass.io>
In-Reply-To: <D6334692-F301-41F0-99BD-816A7B63DEFF@yahoo.com>
References:  <0309ED7D-32C9-4A5A-A867-5C4CA454212B@jbass.io> <D6334692-F301-41F0-99BD-816A7B63DEFF@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 3 Jul 2021, at 17:14, Mark Millard <marklmi@yahoo.com> wrote:
>=20
> You do not report what, if any, error messages U-Boot is
> reporting.
>=20
> Just in case it is relevant, I', going to quote a list
> message from back in April:
>=20
> QUOTE
> I will note that one thing that was discovered was
> that u-boot does not well support having a USB device
> with more than one storage LUN in the device. It
> produces messages like:
>=20
> Scanning disk usb_mass_storage.lun1...
> ** Unrecognized filesystem type **
> ** Unrecognized filesystem type **
> Scanning disk usb_mass_storage.lun3...
> ERROR: failure to add disk device usb_mass_storage.lun3, r =3D 20
> Error: Cannot initialize UEFI sub-system, r =3D 20
> 2676208 bytes read in 41 ms (62.2 MiB/s)
> libfdt fdt_check_header(): FDT_ERR_BADMAGIC
> Error: Cannot initialize UEFI sub-system, r =3D 20
> EFI LOAD FAILED: continuing...
> BOOTP broadcast 1
> DHCP client bound to address 192.168.1.171 (121 ms)
> *** ERROR: `serverip' not set
>=20
> (Text is actually from a test that Fedora's configuration
> at the time was getting the same sort of problem from its
> u-boot build. The text just happened to be handy to grab.)
>=20
> It seemed that such a device needed to be plugged in after
> u-boot was no longer involved (and to be unplugged before
> u-boot would again be involved).
>=20
> I mention this because having multiple SATA drives possible
> might be an example of multiple storage LUNs for a single
> USB device. There is:
>=20
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253983
>=20
> that starts before the u-boot tie was known and progresses
> through it being discovered --and that mistakenly indicates
> "Closed FIXED" to indicate that it was not a FreeBSD
> problem. (No problem was "fixed": just isolated to not
> be FreeBSD's problem.)
> END QUOTE
>=20
> To my knowledge, you would have to adjust U-Boot's
> configuration to complete ignore USB in order to
> work around U-Boot's problem for such contexts.
> Looks like Robert Crowston provided some notes
> that go in this driection.
>=20
> There might be multi-storage-device (each single
> LUN) that also have problems, for all I know.
>=20
> =3D=3D=3D
> Mark Millard
> marklmi at yahoo.com
> ( dsl-only.net went
> away in early 2018-Mar)

I think you=E2=80=99ve hit the nail on the head. It=E2=80=99s a 2 SATA =
drive USB enclosure and I see errors just like this.

> On 3 Jul 2021, at 14:41, Robert Crowston <crowston@protonmail.com> =
wrote:
>=20
> You could create a boot script ("u-boot.scr") and place it in the root =
of your sd card alongside u-boot. U-boot will interpret it at start up. =
You can use that to modify the "boot_targets" variable such that it =
doesn=E2=80=99t scan for usb drives, or so that it tries to load from =
mmc first.
>=20
> As I recall part of the problem is there are several mmc-like devices =
on the pi4 and the one we want is the third one (mmc2). That=E2=80=99s =
quite low in the boot priority order.
>=20
> First you should become a little familiar with what u-boot is doing =
when it probes your devices. I=E2=80=99d suggest plugging in a keyboard =
(or a serial console) and interrupting the automatic boot. Once you know =
how to make it boot from mmc, you can encode that in a script.=20
>=20
> u-boot.scr is a compiled file, so you need the =E2=80=9Cmkimage=E2=80=9D=
 tool from u-boot.=20
>=20
> I=E2=80=99m not sure if this is the best way, perhaps I am =
overcomplicating it. Good luck.
>=20
>     =E2=80=94 RHC.

Thank you for the pointer, I=E2=80=99ll look into this, it sounds =
promising.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F0A4E634-2B59-4785-B7E4-16E58CDB1920>