From nobody Thu Jul 08 21:25:49 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 A0A8112268D6 for ; Thu, 8 Jul 2021 21:26:06 +0000 (UTC) (envelope-from jordan@jbass.io) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GLTqd4kNhz3CRV for ; Thu, 8 Jul 2021 21:26:05 +0000 (UTC) (envelope-from jordan@jbass.io) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B5C903200754; Thu, 8 Jul 2021 17:26:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 08 Jul 2021 17:26:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jbass.io; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm2; bh=w 6TIvVKN4tbLaTN1rYwj/ZfTMY+e7wJYG21GaKlagwY=; b=PXszF26agrDmhkiLa 6kgpCOJh7YHgyR9WbSXYDiKQjTsTFDkBbU4y4lFdBuoO0pBGlrbN9/dSGBZv6tsQ LN9hHcf+mrk5zR52J9BlxdEubNi0v77jptBZcPZwnnWOEWQY0RRmC60/TpNLKOOc rewWnIKMwUcX9dFk5GhKWA8ZHSvvFwRJoe3qz4f+ktFjR1BSN79aE2dycQXzaGIc gb3zeYIZjoYsBgXud39gESx+MtO7y96rjnXWq6J+PqKmwWcw5JljFNrn5tZjcbRc 9UYhYGemstYeUSq6537AzigF1hUi7xQjzZBO9WyveVazsAGyizps8E1uGLeD/C/i iKNpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=w6TIvVKN4tbLaTN1rYwj/ZfTMY+e7wJYG21GaKlag wY=; b=BlJntzEpKOTiW1zZ88YEvvwM6VbstZerCviz41Wb/DlVS2Hhp2fdLWwns 6rpwDWi6eUoXySrLxhVc+2IzVWAuI/T+2/sGGB5CnjVQdyyRPvuxE0NverDut3S5 oS79OkbCF9IXUida/58c4ypM0TNTsbYfGDNEjxKEHwWiUfAfeXtxN6emXsfai5s3 sl7O+gpTPOn7Vq+Pq7dFnblLJG2ed4+YWd6A2QPsSwcv6nYydJJBvzMblJtzrrvg EmIrxpCK2DqPxX8aHdkxpj3Vx6syLdfITJJBO4P+KYdufH5sebW6U1sHCQx/vWh0 tLOY5XJ140xUAgq1B6RxDoWvWOusw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrtdeggdduheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomheplfhorhgu rghnuceurghsshcuoehjohhruggrnhesjhgsrghsshdrihhoqeenucggtffrrghtthgvrh hnpeekvdfgleeifeffkeevhefhhedthfeuieeludeivdffhfduhfeileevleefteekheen ucffohhmrghinhepfhhrvggvsghsugdrohhrghdpughslhdqohhnlhihrdhnvghtnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhorhgurghn sehjsggrshhsrdhioh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jul 2021 17:25:51 -0400 (EDT) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: RPi4 - Booting from mSD with USB storage From: Jordan Bass In-Reply-To: Date: Thu, 8 Jul 2021 22:25:49 +0100 Cc: "freebsd-arm@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <0309ED7D-32C9-4A5A-A867-5C4CA454212B@jbass.io> To: Mark Millard , Robert Crowston X-Mailer: Apple Mail (2.3654.100.0.2.22) X-Rspamd-Queue-Id: 4GLTqd4kNhz3CRV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jbass.io header.s=fm2 header.b=PXszF26a; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=BlJntzEp; dmarc=none; spf=pass (mx1.freebsd.org: domain of jordan@jbass.io designates 64.147.123.24 as permitted sender) smtp.mailfrom=jordan@jbass.io X-Spamd-Result: default: False [-3.10 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.24]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[jbass.io:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[yahoo.com,protonmail.com]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[64.147.123.24:from]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.24:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[jbass.io:s=fm2,messagingengine.com:s=fm3]; FREEFALL_USER(0.00)[jordan]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[jbass.io]; SPAMHAUS_ZRD(0.00)[64.147.123.24:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arm] X-ThisMailContainsUnwantedMimeParts: N > On 3 Jul 2021, at 17:14, Mark Millard 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 = 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.