From nobody Fri Oct 29 18:24:30 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 62873181DD67; Fri, 29 Oct 2021 18:24:32 +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 4HgrS00KkZz3DxQ; Fri, 29 Oct 2021 18:24:31 +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 19TIOUjG022503 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 29 Oct 2021 11:24:31 -0700 (PDT) (envelope-from fbsd@www.zefox.net) Received: (from fbsd@localhost) by www.zefox.net (8.16.1/8.15.2/Submit) id 19TIOU57022502; Fri, 29 Oct 2021 11:24:30 -0700 (PDT) (envelope-from fbsd) Date: Fri, 29 Oct 2021 11:24:30 -0700 From: bob prohaska To: Mark Millard Cc: Free BSD , freebsd-ports@freebsd.org Subject: Re: Troubles booting Pi2 from USB using bootcode.bin method Message-ID: <20211029182430.GA22414@www.zefox.net> References: <20211025034332.GA8398@www.zefox.net> <20211027162852.GA16010@www.zefox.net> <41C0A656-D898-4381-BB81-034D54CA04A0@yahoo.com> <02806205-6685-41FD-B2D1-415C82FBCF92@yahoo.com> <20211028191635.GA19540@www.zefox.net> <7AC0733A-3FC9-4FA6-A6D7-0689A8ACB4CA@yahoo.com> 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: 4HgrS00KkZz3DxQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N I should have stated earlier that the FreeBSD system on the USB3 disk orginated from FreeBSD-13.0-RELEASE-arm-armv7-GENERICSD.img using dd and then repartitioning to add a swap and separate /usr partition. On Thu, Oct 28, 2021 at 04:53:29PM -0700, Mark Millard wrote: > On 2021-Oct-28, at 15:21, Mark Millard wrote: > > > On 2021-Oct-28, at 12:16, bob prohaska wrote: > > > >> To make a clean start on this thread I've turned on the UART > >> for bootcode.bin per Mark's instructions and done a few boot > >> attempts with the USB2 and USB3 mechanical disks, singly and > >> in unison. > >> > >> The bootlogs are in > >> http://www.zefox.net/~fbsd/rpi2/bootproblems/ > >> > >> An immediate curiosity is that on the first try, booting > >> with the USB3 device alone worked. I didn't record that > >> output, unfortunately. > > > > Hmm. Too bad. > > Indeed! I thought maybe the failure was fixed by turning on the UART... > >> The second attempt failed, as expected, > >> and is recorded in bootlog-fail. The third attempt booted both > >> USB2 and USB3 disks together, recorded in bootlog.success. > > > > The two logs do not have the same set of dtdebug messages > > for loading bcm2709-rpi-2-b.dtb . This is long before > > u-boot.bin is loaded and so is during the RPi* firmware > > time frame not u_Boot or FreeBSD;s loader or FreeBSD's kernel > > or FreeBSD's world. > > > > From this I infer that there are two different msdosfs's > > wtith differing content on the 2 drives and when both > > drives are in place . > > That's correct. Actually there are three, counting the microSD. > > You have not reported on the following for either drive's > > msdosfs : > > > > # strings ???/start.elf | grep "VC_BUILD_" > > The are different. On the USB3 disk, which I want to boot, I get bob@www:/boot/msdos % strings start.elf | grep "VC_BUILD_" VC_BUILD_ID_USER: dom VC_BUILD_ID_TIME: 12:12:09 VC_BUILD_ID_VARIANT: start VC_BUILD_ID_TIME: Feb 25 2021 VC_BUILD_ID_BRANCH: bcm2711_2 VC_BUILD_ID_HOSTNAME: buildbot VC_BUILD_ID_PLATFORM: raspberrypi_linux VC_BUILD_ID_VERSION: 564e5f9b852b23a330b1764bcf0b2d022a20afd0 (clean) On the USB2 disk, which seems to be needed for booting, I get oot@www:/mnt # strings start.elf | grep "VC_BUILD_" VC_BUILD_ID_USER: dom VC_BUILD_ID_TIME: 16:43:13 VC_BUILD_ID_BRANCH: master VC_BUILD_ID_VARIANT: start VC_BUILD_ID_TIME: Nov 19 2019 VC_BUILD_ID_HOSTNAME: buildbot VC_BUILD_ID_PLATFORM: raspberrypi_linux VC_BUILD_ID_VERSION: 2354eac70a98807e06bed2149bc0c5613e751c15 (clean) > > Another thing of interest would be something like (both > > msdosfs mounts): > > > > # diff -rq ... ... > > > > in order to see what files have distinctions on the > > two media. A diff of the two config.txt files would be > > relevant (no -q involvement). > > > > On the USB3 disk config.txt contains bob@www:/boot/msdos % more config.txt init_uart_clock=3000000 enable_uart=1 kernel=u-boot.bin kernel7=u-boot.bin dtoverlay=mmc enable_uart=1 uart_2ndstage=1 dtdebug=1 On the USB2 disk config.txt contains root@www:/mnt # more config.txt init_uart_clock=3000000 enable_uart=1 kernel=u-boot.bin kernel7=u-boot.bin dtoverlay=mmc > >> I'm trying to build u-boot-rpi2 and will try to update the USB3 > >> disk with it once complete. Still working on that part 8-) > >> > >> The actual boot sequence using bootcode.bin is still a bit hazy: > >> Is it microSD/dos -> USB/dos ->USB/freebsd ? > >> > > > > Based on the log file for success the ordering is > > > > bootcode.bin from the microsd card So bootcode.bin runs from the microSD, but config.txt and all else is picked up from whichever USB disk is recognized first? > > config.txt (also re-read multiple times later, not listed) > > start.elf > > fixup.dat > > bcm2709-rpi-2-b.dtb > > overlays/mmc.dtbo > > cmdline.txt (if it exists) > > u-boot.bin > > efi/boot/bootarm.efi > > efi/freebsd/loader.env > > /boot/defaults/loader.conf > > /boot/device.hints > > /boot/loader.conf > > /boot/loader.conf.local > > /boot/boot/kernel > > /boot/kernel/fi.lemon.ko > > /boot/kernel/umodem.ko > > FreeBSD world > > > > > > However the failing one has the following involved > > (I omit various lines): > > > > . . . > > Loading 'bcm2709-rpi-2-b.dtb' to 0x100 size 0x6879 > > Unknown dtparam 'pwr_led_gpio' - ignored > > dterror: no symbols found > > dtdebug: /__overrides__ node not found > > Unknown dtparam 'uart0_clkrate' - ignored > > dtdebug: Opened overlay file 'overlays/mmc.dtbo' > > brfs: File read: /mfs/sd/overlays/mmc.dtbo > > dterror: not a valid FDT - err -9 > > . . . > > > > That seqeunce makes no mention of: "using platform 'bcm2835'" > > and the like. An example is: "found override pwr_led_gpio". > > > > Again, all this looks like tehre are two msdosfs involved and > > the two are not the same by content. > > > > Another possibility is that you have more in the microsd card's > msdosfs than just bootcode.bin so that that microsd card might > be the source of alternative files. (That makes up to 3 media > that might be sources of files.) That's correct. The microSD's msdos partition contains -rwxr-xr-x 1 root wheel 52456 Oct 28 02:12 bootcode.bin -rwxr-xr-x 1 root wheel 52456 Oct 22 16:00 bootcode.bin-e -rwxr-xr-x 1 root wheel 52304 Nov 22 2019 bootcode.old -rwxr-xr-x 1 root wheel 0 Jan 16 2021 timeout drwxr-xr-x 1 root wheel 4096 Jan 16 2021 unused I'm expecting that only bootcode.bin and timeout are involved. Thanks for looking! bob prohaska