Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Jul 2021 09:14:24 -0700
From:      Mark Millard via freebsd-arm <freebsd-arm@FreeBSD.org>
To:        Jordan Bass <jordan@jbass.io>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@FreeBSD.org>
Subject:   Re: RPi4 - Booting from mSD with USB storage
Message-ID:  <D6334692-F301-41F0-99BD-816A7B63DEFF@yahoo.com>
In-Reply-To: <0309ED7D-32C9-4A5A-A867-5C4CA454212B@jbass.io>
References:  <0309ED7D-32C9-4A5A-A867-5C4CA454212B@jbass.io>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2021-Jul-3, at 03:11, Jordan Bass <jordan at jbass.io> wrote:

> I've installed 13.0-RELEASE on a micro SD card to use on a 8GB =
Raspberry Pi 4. The Raspberry Pi 4 launches u-boot from the mSD card =
successfully. Without any USB devices attached, u-boot will boot FreeBSD =
from the mSD card successfully. When I attach an externally powered USB =
SDD enclosure containing 2 drives and try to boot, u-boot will fail to =
boot FreeBSD from the micro SD card. It will then try to boot from USB =
and fail because they are just ZFS storage. Finally, u-boot will =
endlessly try to boot over the network.
>=20
> To work around the problem, I can detach the USB drives, power on the =
Pi, wait a few seconds, and then attach the USB drives.
>=20
> I've tried the 2021-04 build of u-boot, and that will boot from mSD =
with the USB drives attached, but only because it fails to detect the =
USB devices, and the ZFS pools will not be imported on boot.
>=20
> Does anyone have any suggestions for configuring u-boot to behave in =
the way I expect? I want to boot from mSD, even when USB drives are =
attached.
>=20

You do not report what, if any, error messages U-Boot is
reporting.

Just in case it is relevant, I', going to quote a list
message from back in April:

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:

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

(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.)

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).

I mention this because having multiple SATA drives possible
might be an example of multiple storage LUNs for a single
USB device. There is:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253983

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

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.

There might be multi-storage-device (each single
LUN) that also have problems, for all I know.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D6334692-F301-41F0-99BD-816A7B63DEFF>