From nobody Sun Sep 25 19:34:15 2022 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 4MbGKf6l4Mz4clxd; Sun, 25 Sep 2022 19:34:14 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (www.zefox.net [50.1.20.27]) (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 "www.zefox.com", Issuer "www.zefox.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MbGKd6MPwz3Qjr; Sun, 25 Sep 2022 19:34:13 +0000 (UTC) (envelope-from fbsd@www.zefox.net) Received: from www.zefox.net (localhost [127.0.0.1]) by www.zefox.net (8.16.1/8.15.2) with ESMTPS id 28PJYGu1063876 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 25 Sep 2022 12:34:16 -0700 (PDT) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.16.1/8.15.2/Submit) id 28PJYGYj063875; Sun, 25 Sep 2022 12:34:16 -0700 (PDT) (envelope-from fbsd) Date: Sun, 25 Sep 2022 12:34:15 -0700 From: bob prohaska To: Mark Millard Cc: FreeBSD Mailing List , freebsd-arm Subject: Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it Message-ID: <20220925193415.GA63733@www.zefox.net> References: <20220919221553.GA33878@www.zefox.net> <9A2A4E83-22F2-4441-82BF-0B8E6718ED34@yahoo.com> <20220921154240.GA37735@www.zefox.net> <8CC2A42B-21AC-44C6-BD02-44D320CADF63@yahoo.com> <20220921175026.GA45144@www.zefox.net> <5DB9C93B-B9E1-418D-ABA3-8A0CFCE85C0F@yahoo.com> <3781CF46-C4F7-4579-8655-B7558B724C0A@yahoo.com> <20220922014500.GA46697@www.zefox.net> <20220925160531.GA63213@www.zefox.net> 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=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4MbGKd6MPwz3Qjr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of fbsd@www.zefox.net has no SPF policy when checking 50.1.20.27) smtp.mailfrom=fbsd@www.zefox.net X-Spamd-Result: default: False [-1.09 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-1.00)[-0.996]; MID_RHS_WWW(0.50)[]; WWW_DOT_DOMAIN(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org,freebsd-arm@freebsd.org]; R_DKIM_NA(0.00)[]; FREEMAIL_TO(0.00)[yahoo.com]; ASN(0.00)[asn:7065, ipnet:50.1.16.0/20, country:US]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_NA(0.00)[no SPF record]; DMARC_NA(0.00)[zefox.net]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sun, Sep 25, 2022 at 10:39:23AM -0700, Mark Millard wrote: > On 2022-Sep-25, at 09:05, bob prohaska wrote: > > > On Wed, Sep 21, 2022 at 06:45:00PM -0700, bob prohaska wrote: > >> > >> After setting initial_turbo=60 in config.txt the first reboot > >> found the disk, the second did not. Running usb reset then > >> found the disk, but run bootcmd_usb0 seemingly caused a reset > >> that _then_ found the disk. > > > > It looks as if u-boot is somehow restarting itself unexpectedly. > > This is an RPi3B running stable-13, system and ports up to date > > as of yesterday. > > > > Here's an example session following a failed boot attempt: > > > > U-Boot> usb reset > > resetting USB... > > Bus usb@7e980000: USB DWC2 > > scanning bus usb@7e980000 for devices... 6 USB Device(s) found > > scanning usb for storage devices... 1 Storage Device(s) found > > For: > > > U-Boot> usb part > > > > [I think some information about the disk should have been displayed] > > > > U-Boot 2022.04 (Sep 23 2022 - 17:28:32 -0700) > > > > DRAM: 948 MiB > > > > [...usual startup output] > > This could suggest power problems. Was this with powered-hub? > Without? Powered enclosure? Without? USB 3 powered hub driving USB 3 powered enclosure. I've checked voltages on the Pi and found no evidence of power trouble. There's no ready access to the hub and disk power leads. > > Was this a full RPi* reboot, going back through the RPi* > firmware stages before U-Boot started again? Or did the > RPi3B avoid starting the firmware sequence again? > I think the sequence was a full shutdown -r, u-boot didn't find the disk but usb reset did find the disk. Then the usb part command seemed to restart u-boot. Repeating the experiment just now the sequence was shutdown -r now, no disk found, usb reset, disk found, usb part, u-boot restarted and successfully booted to multi-user. > > Are there any debug switches for u-boot? I've looked a bit and > > what I find is either stale or not implemented. There's a reference > > to a "log" command, but it does not seem to be recognized. > > > > It does seem clear that the presence of a timeout file makes no > > meaningful difference. Boot succeeds rate is less than 50% > > > > This is using an unmodified u-boot-rpi-arm64 built locally. The > > system has no microSD installed, u-boot is started from the USB > > disk (which is found by firmware without trouble). > > > > If setting up a microSD to start u-boot alone would simplify > > matters that seems worth a try. Hints much appreciated! > > > > Once the machine boots into freebsd it seems to work just fine. > > The problem appears to be with u-boot only. > > If I understand right this is the same JMICRON context we had > an exchange about back in late 2022-Jan (and before). Back then > there were two RPi*'s to potentially involve in testing. > > QUOTE > The enclosure is simply marked SABRENT EC_UASP, > The usb-sata bridge is marked JMS576 > 2026 QH8A3A A > E76H20013 > END QUOTE > > Back then I warned that: > > https://jamesachambers.com/fixing-storage-adapters-for-raspberry-pi-via-firmware-updates/ > > reported (and still does): > > QUOTE > Sabrent and Orico both have the worst track records for working storage > adapters for the Pi. I don???t recommend them at all but they can sometimes > be fixed. > > The following Sabrent JMicron adapters can be updated with their official > tool: > > ??? EC-SSHD* > ??? EC-UASP* > ??? EC-UK30* > ??? EC-UM3W* > ??? EC-DFLT* > ??? EC-NVME* > ??? EC-TFNE* > ??? EC-TFNB* > Important Note: After the update the Sabrent adapters often work but > usually only with quirks mode enabled (see bottom Quirks section of > article). > > For Sabrent???s version of the JMicron firmware update tool: Sabrent > JMicron Update Tool > END QUOTE > > As I remember, there was some discussion of possibly getting and > trying alternate equipment not based on the EC-UASP, for example. > Possibly a powered enclosure, avoiding a need for a powered hub. > > Back then I had requested various device swapping tests to see > what the problem followed vs. what it did not. The types of > tests could be (all are worded in comparison to your existing > configuration, not relative to each other): > > A) Swap just the bridges between the RPi*'s: does the problem > follow the bridge? The RPi*/disk combination ? > Far as I recall the trouble followed the bridge. > B) Swap just the RPi* 's leaving the disks and bridges paired as they are: > does the problem follow the RPi* ? The bridge/disk combination? > > C) Swap just the disks, leaving the bridges and RPi* 's paired as they are: > does the problem follow the disk? The RPi*/bridge combination? > > (Other context held constant, such as the powered hub status > of the disk drive.) > > With 3 devices involved, it takes multiple tests to try to see if, > overall, just 1 device is always involved across the failing > configurations or if it is always a combination of, say, 2 specific > devices. > > As I remember, no results of such tests were reported. I did a few experiments but didn't find a way to clearly record/report the various combinations and behavior. Very roughly, the Sabrent enclosures work fine on Rpi4's, both RasPiOS-32bit and FreeBSD-current. On RPi3 the Sabrent enclosure isn't reliably discovered but works once found. My setup makes swapping hardware around somewhat awkward, as the Pi's are daisy-chained via serial console. The Sabrent equipped Pi3 is the terminal server for the Startech-equipped -current Pi3 that has been my reference. There are only two Pi3's available for experimentation, plus one Pi4. I'll have to think carefully before making much in the way of wiring changes, lest the confusion grow worse. IIRC I did try replacing the Sabrent enclosure with the Startech enclosure, which worked and seemed to implicate the Sabrent as the culprit. Thus my interest in u-boot debug information. Thanks for writing! bob prohaska