From nobody Sat Mar 04 00:36:27 2023 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 4PT5WK5tC0z3wWW7 for ; Sat, 4 Mar 2023 00:36:45 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-25.consmr.mail.gq1.yahoo.com (sonic312-25.consmr.mail.gq1.yahoo.com [98.137.69.206]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 4PT5WK1BKsz4SgC for ; Sat, 4 Mar 2023 00:36:45 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677890203; bh=kvoYPcCqUTn5kLN3Ho6L4fC9wEUekZlwTS23ao88VnE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=jFjbIiZ7FsHjyrDOsztRkWRWFlt+A/R5kIB2QZ4HY/KrsMI2C9nOazPeCJBjLH4dUvyehFP39mpF2h1+mm+Gc2+y7RLeXG/bSHxTqFc+7EoFNRa+JtsehIPPQ4lzwoGbJdIPmYLffu3GXErRgsNYJqOfkA8qGlqWNUaNhnSd8h1wfJLh4qumZ2ACcDEULxeRZU/DBjOr7SEizGcvnK5SkFnXA53IkoxfHPMsgqU6N8ZOfsCypFP4R3OcgkwFrlb2NTsJWgjLKZjnGuehSBqyA3GprEXxaTCao0ICALzpBidX9YDFbdw+dre9kU0gmr1z824BpKtiaIjPuLSppW0E9Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1677890203; bh=KUPX2Q92NMVSkWPVcuOl3m/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ocsWfgiBK0oq3iMm01MHHqeEnQe0XG6uuT4yzw05NZ6qA3HFPM1jZLFk1jnCHD_ ckoD.8WJhilwhp8inGu9SFx8K9SYtHZtXqzkBFou17e_nCO6kYLZYwsQUj_rj41oHzgQmXWnJDYZ hrc_zyLl.teKu2kZNvvReR9ABDd2WT4jMG8tZL0XDIs7f9hCKb6bbjzPpLhLH5TISiywp72c4n0M Wzx8V2pesmEm1iVdT1UTi02p40zYzoipynQGDO46WnxWkJ4UogZR0JNvQvX49R8oejZstErQ1Lqf gRQOliLJhOj_k.X0J1FTNEVyKBPVlBd5QMQZP6gkB_67zKxrT0KBpAmru4_go.hHo8n.iKUElHhW 4o.8bJHpLF63xB1QJVuJhzO8Tmkuc.JPB.v7TA1S0ju.CFaWOJwOsohMOvlCnQ996KfKAClPSsZI POIiV_Q5.mKbEgGWgHR_ilY4ZxwIW...tKyPo2spnnxr2HEYS.c26FPZ4Z.n57kf.qjLDXihCW_. NO7RoxlncZLH5_IjHYmSJQiZB91.pJRek9XSGe83QuC8UgCh5XAkszAIYuI8n71AxknrS2i6EzK8 eQw-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Sat, 4 Mar 2023 00:36:43 +0000 Received: by hermes--production-gq1-6cf7749bc8-q7lrl (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7e7f6f6086ac754a0f6c37a797a94a8a; Sat, 04 Mar 2023 00:36:38 +0000 (UTC) Content-Type: text/plain; charset=us-ascii 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 16.0 \(3731.400.51.1.1\)) Subject: Re: uBoot broken on RPI2 Model B? From: Mark Millard In-Reply-To: Date: Fri, 3 Mar 2023 16:36:27 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Karl Denninger X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Rspamd-Queue-Id: 4PT5WK1BKsz4SgC X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Mar 3, 2023, at 14:50, Karl Denninger wrote: > On 3/3/2023 16:12, Karl Denninger wrote: >> Just tried to build -13STABLE for the RPi2 v1.1 (so: armv7) (I'll be testing this case.) v1.2 (so: aarch64 --but could also be used via armv7) >> and ran into this (I'm using Crochet and have had to make some = changes to the board-specific files, but it appears the problem that = results in it not working is in uboot; I've made a number of changes = since it looks like the system now wants to boot off EFI as opposed to = what worked in -12, which would be ok if it can find the boot device -- = I think (may be wrong here) >> U-Boot 2023.01 (Jan 26 2023 - 04:25:18 +0000) >>=20 >> DRAM: 948 MiB >> RPI 2 Model B (0xa21041) >> Core: 70 devices, 13 uclasses, devicetree: board >> MMC: mmc@7e300000: 1 >> Loading Environment from FAT... ** Bad device specification mmc 0 ** >> In: serial >> Out: vidconsole >> Err: vidconsole >> Net: No ethernet found. >> starting USB... >> Bus usb@7e980000: USB DWC2 >> scanning bus usb@7e980000 for devices... 3 USB Device(s) found >> scanning usb for storage devices... 0 Storage Device(s) found >> Hit any key to stop autoboot: 0 >> U-Boot> >> Needless to say if I let it try to continue it fails as it can't find = the SD card and "mmc dev" shows nothing present. >> Obviously going to dig into this further myself but I recalled = something about this uBoot version being broken on older Pis... >> The layout of the disk on the boot partition is thus: >> root@NewFS:/mnt # ls -la >> total 12679 >> drwxr-xr-x 1 root wheel 16384 Dec 31 1979 . >> drwxr-xr-x 35 root wheel 42 Jan 20 10:16 .. >> drwxr-xr-x 1 root wheel 4096 Feb 13 11:09 EFI >> -rwxr-xr-x 1 root wheel 709 Feb 13 11:09 README >> -rwxr-xr-x 1 root wheel 26745 Feb 13 11:09 bcm2709-rpi-2-b.dtb So: armv7 style. >> -rwxr-xr-x 1 root wheel 52456 Feb 13 11:09 bootcode.bin >> -rwxr-xr-x 1 root wheel 141 Feb 13 11:09 config.txt >> -rwxr-xr-x 1 root wheel 7314 Feb 13 11:09 fixup.dat >> -rwxr-xr-x 1 root wheel 3187 Feb 13 11:09 fixup_cd.dat >> -rwxr-xr-x 1 root wheel 10298 Feb 13 11:09 fixup_db.dat >> -rwxr-xr-x 1 root wheel 10298 Feb 13 11:09 fixup_x.dat >> drwxr-xr-x 1 root wheel 20480 Feb 13 11:09 overlays >> -rwxr-xr-x 1 root wheel 21169 Feb 13 11:09 rpi2.dtb RPi* firmware does not include such a rpi2.dtb . It is some sort of addition to the materials. My context will not have it. >> -rwxr-xr-x 1 root wheel 2952960 Feb 13 11:09 start.elf The following sort of thing could help confirm the match to what is in the official snapshot builds at this point: For example, for what I later report on testing (an official snapshot build installation): # strings /mnt/start.elf | grep VC_BUILD_ID_=20 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) >> -rwxr-xr-x 1 root wheel 793116 Feb 13 11:09 start_cd.elf >> -rwxr-xr-x 1 root wheel 4794472 Feb 13 11:09 start_db.elf >> -rwxr-xr-x 1 root wheel 3704808 Feb 13 11:09 start_x.elf >> -rwxr-xr-x 1 root wheel 521916 Feb 13 11:09 u-boot.bin For reference: # strings /mnt/u-boot.bin | grep "U-Boot 202" U-Boot 2023.01 (Mar 02 2023 - 02:41:45 +0000) As for the bootarm.efi , as I remember there is no good string to show. So I'll show just: # ls -Tld /mnt/EFI/BOOT/bootarm.efi=20 -rwxr-xr-x 1 root wheel 1407668 Mar 1 19:55:18 2023 = /mnt/EFI/BOOT/bootarm.efi >> root@NewFS:/mnt # ls -laR EFI >> total 24 >> drwxr-xr-x 1 root wheel 4096 Feb 13 11:09 . >> drwxr-xr-x 1 root wheel 16384 Dec 31 1979 .. >> drwxr-xr-x 1 root wheel 4096 Feb 13 11:09 BOOT >>=20 >> EFI/BOOT: >> total 140 >> drwxr-xr-x 1 root wheel 4096 Feb 13 11:09 . >> drwxr-xr-x 1 root wheel 4096 Feb 13 11:09 .. >> -rwxr-xr-x 1 root wheel 133812 Feb 13 11:09 bootarm.efi >> root@NewFS:/mnt # more config.txt >> init_uart_clock=3D3000000 >> enable_uart=3D1 >> kernel=3Du-boot.bin >> kernel7=3Du-boot.bin >> dtoverlay=3Dmmc The snapshot materials do not have the following 2 lines in the config.txt but do have the above: >> audio_pwm_mode=3D2 >> dtparam=3Daudio=3Don,i2c_arm=3Don,spi=3Don >> root@NewFS:/mnt # ls -la overlays | grep mmc >> -rwxr-xr-x 1 root wheel 1221 Feb 13 11:09 mmc.dtbo >> Which I BELIEVE should work -- assuming that I can get "see" the SD = card from u-boot that is.... >> Installed rpi-related packages: >> root@NewFS:/mnt # pkg info|grep rpi >> rpi-firmware-1.20210303.g20210303 Firmware for RaspberryPi Single = Board Computer >> u-boot-rpi2-2023.01 Cross-build das u-boot for model rpi2 >> u-boot-rpi3-2023.01 Cross-build das u-boot for model rpi3 >> u-boot-rpi4-2023.01 Cross-build das u-boot for model rpi4 For reference: the gpart show output lines for the microsd card media in a reader were like: =3D> 63 249737153 da3 MBR (119G) 63 1985 - free - (993K) 2048 102400 1 fat32lba [active] (50M) 104448 10381312 2 freebsd (5.0G) 10485760 239251456 - free - (114G) =3D> 0 10381312 da3s2 BSD (5.0G) 0 128 - free - (64K) 128 10381184 1 freebsd-ufs (4.9G) (It will change if it boots in the RPi2 v1.1 .) > I found a copy of the 2022-10 uboot: > U-Boot 2022.10 (Oct 24 2022 - 02:01:47 +0000) >=20 > DRAM: 948 MiB > RPI 2 Model B (0xa21041) > Core: 70 devices, 13 uclasses, devicetree: board > MMC: mmc@7e300000: 1 > Loading Environment from FAT... ** Bad device specification mmc 0 ** > In: serial > Out: vidconsole > Err: vidconsole > Net: No ethernet found. > starting USB... > Bus usb@7e980000: USB DWC2 > scanning bus usb@7e980000 for devices... 3 USB Device(s) found > scanning usb for storage devices... 0 Storage Device(s) found > Hit any key to stop autoboot: 0 >=20 > >> FreeBSD EFI boot block > Loader path: /boot/loader.efi >=20 > Initializing modules: ZFS UFS > Load Path: /efi\boot\bootarm.efi > Load Device: = /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(0)/HD(1,MBR,0xb5048a= 37,0x3f,0x18fe7) > Probing 3 block devices...not supported > not supported > not supported > done > ZFS found no pools > UFS found no partitions > Failed to load '/boot/loader.efi' > panic: No bootable partitions found! > ## Application failed, r =3D 1 > Can't remove invalid handle 00000000 > EFI LOAD FAILED: continuing... > MMC Device 2 not found > no mmc device at slot 2 >=20 > Device 0: unknown device > Waiting for Ethernet connection... unable to connect. > missing environment variable: pxeuuid > Retrieving file: pxelinux.cfg/01-b8-27-eb-0d-05-01 > Waiting for Ethernet connection... > Hmmm... going back and looking at the 2023-01 version boot sequence = again... same thing it appears; the u-boot DOES load the EFI loader, but = dies there. Am I trying to be too cute by half and should stick = ubldr.bin in that boot partition and get rid of the EFI loader entirely? >=20 To test, I grabbed the official snapshot build: = http://ftp3.freebsd.org/pub/FreeBSD/snapshots/ISO-IMAGES/13.2/FreeBSD-13.2= -STABLE-arm-armv7-GENERICSD-20230302-3912f99ecae6-254729.img.xz Then I did an unxz in the file that resulted and then dd'd the .img file to a microsd card: dd = if=3DFreeBSD-13.2-STABLE-arm-armv7-GENERICSD-20230302-3912f99ecae6-254729.= img of=3D/dev/da3 bs=3D1m conv=3Dsync,fsync status=3Dprogress So I plugged in the microsd card to the RPi2 v1.1 and powered on. It booted just fine. # gpart show =3D> 63 249737153 mmcsd0 MBR (119G) 63 1985 - free - (993K) 2048 102400 1 fat32lba [active] (50M) 104448 249628672 2 freebsd (119G) 249733120 4096 - free - (2.0M) =3D> 0 249628672 mmcsd0s2 BSD (119G) 0 128 - free - (64K) 128 245876608 1 freebsd-ufs (117G) 245876736 3751936 2 freebsd-swap (1.8G) # uname -apKU FreeBSD generic 13.2-STABLE FreeBSD 13.2-STABLE #0 = stable/13-n254729-3912f99ecae6: Thu Mar 2 04:05:56 UTC 2023 = root@releng3.nyi.freebsd.org:/usr/obj/usr/src/arm.armv7/sys/GENERIC arm = armv7 1302503 1302503 # freebsd-version -kru 13.2-STABLE 13.2-STABLE 13.2-STABLE # find -s /boot/msdos/ -print /boot/msdos/ /boot/msdos/EFI /boot/msdos/EFI/BOOT /boot/msdos/EFI/BOOT/bootarm.efi /boot/msdos/MLO /boot/msdos/bcm2709-rpi-2-b.dtb /boot/msdos/bootcode.bin /boot/msdos/config.txt /boot/msdos/dtb . . . /boot/msdos/dtb/zybo.dtb /boot/msdos/fixup.dat /boot/msdos/fixup_cd.dat /boot/msdos/fixup_db.dat /boot/msdos/fixup_x.dat /boot/msdos/overlays /boot/msdos/overlays/mmc.dtbo /boot/msdos/start.elf /boot/msdos/start_cd.elf /boot/msdos/start_db.elf /boot/msdos/start_x.elf /boot/msdos/u-boot.bin /boot/msdos/u-boot.img # swapinfo Device 1K-blocks Used Avail Capacity /dev/label/growfs_swap 1875964 0 1875964 0% # dumpon -vl kernel dumps on priority: device 0: /dev/null (That last is probably not as intended yet.) =3D=3D=3D Mark Millard marklmi at yahoo.com