Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Oct 2020 12:25:25 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Klaus Cucinauomo <maciphone2@googlemail.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: RPi4B: emmc2bus dma-range handling does not track the boot-time-FDT (u-boot based booting)
Message-ID:  <E82AE086-837C-4CEA-92D5-78A39412F964@yahoo.com>
In-Reply-To: <CCEEC0AD-B874-4753-AAA1-B3B5B302A30C@googlemail.com>
References:  <D8BDF95A-D6A8-4E95-A0CE-D53068E8355B.ref@yahoo.com> <D8BDF95A-D6A8-4E95-A0CE-D53068E8355B@yahoo.com> <ABE16EA6-49F1-461F-9B8A-6DAA7ED6A18D@googlemail.com> <98BC985D-EAAB-4AFB-AA8F-7391A45C4EBF@yahoo.com> <91324D35-B66A-4674-AE37-45F3DDB736FD@yahoo.com> <2B3F0409-88F2-4EBD-9C39-37929F973C77@yahoo.com> <B3133D77-FA24-4F42-B529-D0B56F48E790@yahoo.com> <CCEEC0AD-B874-4753-AAA1-B3B5B302A30C@googlemail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-Oct-9, at 05:50, Klaus Cucinauomo <maciphone2 at googlemail.com> =
wrote:

>> Am 09.10.2020 um 12:02 schrieb Mark Millard <marklmi@yahoo.com>:
>>=20
>>=20
>>=20
>> On 2020-Oct-8, at 23:01, Mark Millard <marklmi at yahoo.com> wrote:
>>=20
>>> On 2020-Oct-8, at 21:29, Mark Millard <marklmi at yahoo.com> wrote:
>>>=20
>>>> On 2020-Oct-8, at 20:06, Mark Millard <marklmi at yahoo.com> wrote:
>>>>=20
>>>>> On 2020-Oct-8, at 06:27, Klaus Cucinauomo <maciphone2 at =
googlemail.com> wrote:
>>>>>=20
>>>>>>> Am 08.10.2020 um 11:01 schrieb Mark Millard via freebsd-arm =
<freebsd-arm@freebsd.org>:
>>>>>>>=20
>>=20
>> Having reverted back to u-boot 2020.10 without
>> compatibility list adjustments and with xhci-pci
>> in place again, trying a 4 GiByte RPi4 without a
>> microsd card boots as far as the rainbow square
>> on the monitor but hangs there, never displaying
>> even the:
>>=20
>> U-Boot 2020.10 (Oct 09 2020 - 06:50:04 +0000)
>>=20
>>=20
>>=20
>=20
>=20
>=20
> the following `dmesg` of the 4GB is with the copied-over whole =
msdos-partition of the Original RPI-ubuntu-distribution
> /ubuntu DOESN`T use the latest fw-files from rpi-github(which also =
fail with me to the hdmi-rainbow-screen)

Linux has its own dts/dtsi/... sources instead of using the .dtb files
from the RPi folks, not directly based on any vintage of the RPi .dtb
files if I understand right. As I understand, ubuntu is based on the
linux materials for producing .dtb files and so is likely not a full
match to older rpi .dtb files either. They continue to update the
.dtb's that they distribute, without also updating the start*.elf or
fixup*.dat files.

So far as I know, FreeBSD has been targeting support of some vintage
of the RPi materials, including .dtb files. That is what
sysutils/rpi-firmware is about. So the status relative to linux .dtb
files is likely normally-unknown.

I've not set up a USB3 SSD ubuntu 2020.04.1 (yet?), just a microsd
card one. I use apt to update the ubuntu microsd card once and a while.
It's /boot/firmware/ from a recent update currently looks like:

# ls -lat /boot/firmware/
total 59854
drwxr-xr-x 4 root root     4096 Oct  8 22:46 ..
drwxr-xr-x 2 root root    35328 Oct  8 22:46 overlays
-rwxr-xr-x 1 root root    26516 Oct  8 22:46 bcm2710-rpi-2-b.dtb
-rwxr-xr-x 1 root root    28176 Oct  8 22:46 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root    27557 Oct  8 22:46 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root    26371 Oct  8 22:46 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root    46612 Oct  8 22:46 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root root    19924 Oct  8 22:46 bcm2837-rpi-3-a-plus.dtb
-rwxr-xr-x 1 root root    20793 Oct  8 22:46 bcm2837-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root    20373 Oct  8 22:46 bcm2837-rpi-3-b.dtb
-rwxr-xr-x 1 root root    19700 Oct  8 22:46 bcm2837-rpi-cm3-io3.dtb
-rwxr-xr-x 1 root root     2603 Oct  8 22:46 boot.scr
-rwxr-xr-x 1 root root 29276839 Oct  8 22:46 initrd.img
-rwxr-xr-x 1 root root     1371 Oct  8 22:46 overlay_map.dtb
-rwxr-xr-x 1 root root  8306930 Oct  8 22:46 vmlinuz
-rwxr-xr-x 1 root root      251 Sep 26 22:14 usercfg.txt
-rwxr-xr-x 1 root root     1514 Jul 31 16:48 README
-rwxr-xr-x 1 root root    52480 Jul 31 16:48 bootcode.bin
-rwxr-xr-x 1 root root      141 Jul 31 16:48 cmdline.txt
-rwxr-xr-x 1 root root     1117 Jul 31 16:48 config.txt
-rwxr-xr-x 1 root root     7276 Jul 31 16:48 fixup.dat
-rwxr-xr-x 1 root root     5405 Jul 31 16:48 fixup4.dat
-rwxr-xr-x 1 root root     3146 Jul 31 16:48 fixup4cd.dat
-rwxr-xr-x 1 root root     8417 Jul 31 16:48 fixup4db.dat
-rwxr-xr-x 1 root root     8419 Jul 31 16:48 fixup4x.dat
-rwxr-xr-x 1 root root     3146 Jul 31 16:48 fixup_cd.dat
-rwxr-xr-x 1 root root    10265 Jul 31 16:48 fixup_db.dat
-rwxr-xr-x 1 root root    10265 Jul 31 16:48 fixup_x.dat
-rwxr-xr-x 1 root root      240 Jul 31 16:48 meta-data
-rwxr-xr-x 1 root root      770 Jul 31 16:48 network-config
-rwxr-xr-x 1 root root  2997088 Jul 31 16:48 start.elf
-rwxr-xr-x 1 root root  2272992 Jul 31 16:48 start4.elf
-rwxr-xr-x 1 root root   816124 Jul 31 16:48 start4cd.elf
-rwxr-xr-x 1 root root  3774532 Jul 31 16:48 start4db.elf
-rwxr-xr-x 1 root root  3031652 Jul 31 16:48 start4x.elf
-rwxr-xr-x 1 root root   816124 Jul 31 16:48 start_cd.elf
-rwxr-xr-x 1 root root  4846308 Jul 31 16:48 start_db.elf
-rwxr-xr-x 1 root root  3755236 Jul 31 16:48 start_x.elf
-rwxr-xr-x 1 root root      327 Jul 31 16:48 syscfg.txt
-rwxr-xr-x 1 root root   493528 Jul 31 16:48 uboot_rpi_3.bin
-rwxr-xr-x 1 root root   492824 Jul 31 16:48 uboot_rpi_4.bin
-rwxr-xr-x 1 root root     2114 Jul 31 16:48 user-data
drwxr-xr-x 3 root root     4096 Jan  1  1970 .

(I try to remember to do things in a way that preserves
the original file dates. But, whatever update procedures
do, I do not override.)

One thing of note is the use of an "overlay_map.dtb".
Without that things would likely be broken.

Notably the start*.elf and fixup*.dat files all predate
2020-Aug-20 by a fair amount. ("USB MSD boot also requires
the firmware from Raspberry Pi OS 2020-08-20 or newer.")
But ubuntu need not have used a tagged release at all
so it is not obvious just what vintage the start* and
fixup* files are from.

So, for now, ubuntu likely does not claim support of the
critical release (general release) of the USB MSD ability
for the RPI4 (even given modern enough eeprom contents
are present).

So far, I've never tried to have FreeBSD use any of these
materials --or any materials from ubuntu.


> ,
> Copying over =E2=80=9Eour=E2=80=9C old bcm2711-rpi-4-b.dtb,

My FreeBSD head -r365932 "USB3 SSD only boot" context looks like
(set up for uefi/ACPI booting):

# ls -ldTt /usb_efi/*
-rwxr-xr-x  1 root  wheel      274 Oct  9 02:00:34 2020 =
/usb_efi/config.txt
-rwxr-xr-x  1 root  wheel      182 Oct  9 00:26:10 2020 =
/usb_efi/config.txt.ub
-rwxr-xr-x  1 root  wheel   571840 Oct  8 23:55:06 2020 =
/usb_efi/u-boot.bin
-rwxr-xr-x  1 root  wheel      257 Sep 26 12:08:22 2020 =
/usb_efi/config.txt.uefi_m_m
drwxr-xr-x  1 root  wheel     8192 Sep  7 22:48:50 2020 =
/usb_efi/OVERLAYS
-rwxr-xr-x  1 root  wheel    47516 Sep  1 14:04:10 2020 =
/usb_efi/bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root  wheel  2283936 Sep  1 14:04:08 2020 =
/usb_efi/start4.elf
-rwxr-xr-x  1 root  wheel  2283936 Sep  1 14:04:08 2020 =
/usb_efi/start4.elf.new
-rwxr-xr-x  1 root  wheel     5422 Sep  1 14:04:04 2020 =
/usb_efi/fixup4.dat
-rwxr-xr-x  1 root  wheel     5422 Sep  1 14:04:04 2020 =
/usb_efi/fixup4.dat.new
-rwxr-xr-x  1 root  wheel     5252 Sep  1 13:59:48 2020 =
/usb_efi/Readme.md
-rwxr-xr-x  1 root  wheel     5252 Sep  1 13:59:48 2020 =
/usb_efi/Readme.md.new
-rwxr-xr-x  1 root  wheel      206 Sep  1 13:59:48 2020 =
/usb_efi/config.txt.uefi_orig
-rwxr-xr-x  1 root  wheel  2581149 Sep  1 07:14:20 2020 =
/usb_efi/RPi4_UEFI_Firmware_v1.20.zip
-rwxr-xr-x  1 root  wheel  2031616 Sep  1 07:08:52 2020 =
/usb_efi/RPI_EFI.fd
-rwxr-xr-x  1 root  wheel  2277248 Jul 14 16:01:00 2020 =
/usb_efi/start4.elf.old
-rwxr-xr-x  1 root  wheel     5409 Jul 14 16:00:58 2020 =
/usb_efi/fixup4.dat.old
-rwxr-xr-x  1 root  wheel     4592 Jul 14 15:57:48 2020 =
/usb_efi/Readme.md.old
-rwxr-xr-x  1 root  wheel      205 May 24 14:46:42 2020 =
/usb_efi/config.txt.nobt
-rwxr-xr-x  1 root  wheel     5888 Jan 30 13:26:30 2020 =
/usb_efi/armstub8-gic.bin
-rwxr-xr-x  1 root  wheel    18693 Nov 22 09:06:44 2019 =
/usb_efi/COPYING.linux
-rwxr-xr-x  1 root  wheel     1594 Nov 22 09:06:44 2019 =
/usb_efi/LICENCE.broadcom
drwxr-xr-x  1 root  wheel     8192 Sep 27 21:05:00 2018 /usb_efi/EFI

My FreeBSD head -r365932 "microsd card first stages" context looks like
(set up for u-boot 2020.10 booting):

# ls -ldTt /microsd_efi/*
-rwxr-xr-x  1 root  wheel      258 Oct  9 02:02:00 2020 =
/microsd_efi/config.txt
-rwxr-xr-x  1 root  wheel   571840 Oct  8 23:55:06 2020 =
/microsd_efi/u-boot.bin
-rwxr-xr-x  1 root  wheel      182 Oct  4 14:18:00 2020 =
/microsd_efi/config.txt.ub
-rwxr-xr-x  1 root  wheel      257 Sep 26 12:08:22 2020 =
/microsd_efi/config.txt.uefi_m_m
-rwxr-xr-x  1 root  wheel    47516 Sep  1 14:04:10 2020 =
/microsd_efi/bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root  wheel  2283936 Sep  1 14:04:08 2020 =
/microsd_efi/start4.elf.new
-rwxr-xr-x  1 root  wheel     5422 Sep  1 14:04:04 2020 =
/microsd_efi/fixup4.dat.new
-rwxr-xr-x  1 root  wheel     5252 Sep  1 13:59:48 2020 =
/microsd_efi/Readme.md.new
-rwxr-xr-x  1 root  wheel  2581149 Sep  1 07:14:20 2020 =
/microsd_efi/RPi4_UEFI_Firmware_v1.20.zip
-rwxr-xr-x  1 root  wheel  2031616 Sep  1 07:08:52 2020 =
/microsd_efi/RPI_EFI.fd
drwxr-xr-x  1 root  wheel     1024 Jul 14 18:43:24 2020 =
/microsd_efi/OVERLAYS
-rwxr-xr-x  1 root  wheel  2277248 Jul 14 16:01:00 2020 =
/microsd_efi/start4.elf
-rwxr-xr-x  1 root  wheel  2277248 Jul 14 16:01:00 2020 =
/microsd_efi/start4.elf.old
-rwxr-xr-x  1 root  wheel     5409 Jul 14 16:00:58 2020 =
/microsd_efi/fixup4.dat
-rwxr-xr-x  1 root  wheel     5409 Jul 14 16:00:58 2020 =
/microsd_efi/fixup4.dat.old
-rwxr-xr-x  1 root  wheel     4592 Jul 14 15:57:48 2020 =
/microsd_efi/Readme.md
-rwxr-xr-x  1 root  wheel     4592 Jul 14 15:57:48 2020 =
/microsd_efi/Readme.md.old
-rwxr-xr-x  1 root  wheel      206 Jul 14 15:57:48 2020 =
/microsd_efi/config.txt.uefi_orig
-rwxr-xr-x  1 root  wheel      205 May 24 14:46:42 2020 =
/microsd_efi/config.txt.nobt
-rwxr-xr-x  1 root  wheel     5888 Jan 30 13:26:30 2020 =
/microsd_efi/armstub8-gic.bin
-rwxr-xr-x  1 root  wheel    18693 Nov 22 09:06:44 2019 =
/microsd_efi/COPYING.linux
-rwxr-xr-x  1 root  wheel     1594 Nov 22 09:06:44 2019 =
/microsd_efi/LICENCE.broadcom
drwxr-xr-x  1 root  wheel     1024 Sep 27 21:05:00 2018 /microsd_efi/EFI

# diff -rq /microsd_efi/ /usb_efi/
Only in /usb_efi/EFI/BOOT: BOOTAA64.EFI
Only in /microsd_efi/EFI/BOOT: bootaa64.efi
Files /microsd_efi/Readme.md and /usb_efi/Readme.md differ
Files /microsd_efi/config.txt and /usb_efi/config.txt differ
Files /microsd_efi/fixup4.dat and /usb_efi/fixup4.dat differ
Files /microsd_efi/start4.elf and /usb_efi/start4.elf differ

The content of BOOTAA64.EFI and bootaa64.efi are identical,
it is just a capitalization difference in the naming.

> booted a bit more (until gpio or so afaik)=E2=80=A6.it`s all about =
DeviceTree=20
> and I guess Kyle Evans & friends  unfortunately will have more =
adjustment-work  in the brcm285..dtsi=E2=80=A6 for 2020.10
> I unfortunately totally fail in my time-management but will tell more =
about the 8GB - VL805-videoCore-firmware-thing when finding time..=20
> I didn=E2=80=99t yet apply kevans-patches, will test them it later..

I've not tried them either.

> Directly from SSD(no SD-card inserted):
> =E2=80=94-config.txt : =E2=80=94
> arm_control=3D0x200
> dtparam=3Daudio=3Don,i2c_arm=3Don,spi=3Don
> enable_uart=3D1
> uart_2ndstage=3D1
> dtoverlay=3Dminiuart-bt
> dtoverlay=3Dmmc
> dtoverlay=3Dpwm
> device_tree_address=3D0x4000
> kernel=3Du-boot.bin
> =E2=80=94--------------------------------------------------
>=20
> recover4.elf not found (6)
> recovery.elf not found (6)
> HUB [03:01] 2.00 000003:01 init port 1 speed 3
> DEV [05:03] 2.00 000013:01 class 9 VID 045b PID 0209
> HUB init [05:03] 2.00 000013:01
> Read start4.elf bytes  2272992 hnd 0x000002e7 hash '319662b44a4c80d5'
> Read fixup4.dat bytes     5405 hnd 0x000001bf hash '0c1a6c6f96114a3f'
> 0x00c03111 0x00000000 0x0000001f
> MEM GPU: 76 ARM: 947 TOTAL: 1023
> Starting start4.elf @ 0xfeb00200 partition 0
>=20
>=20
> U-Boot 2020.10-rc5 (Oct 05 2020 - 03:08:23 +0000)
>=20
> . . .
> FreeBSD 13.0-CURRENT #39 a1d832e8c08-c271678(master): Fri Jul 17 =
04:56:52 UTC 2020

This identifies head -r365919 from 2020-Sep-20. I'm using head -r365932 =
.

> . . .
> gpioled0: <GPIO LEDs> on ofwbus0
> sdhci_bcm1: <Broadcom 2708 SDHCI controller> mem 0x7e340000-0x7e3400ff =
irq 80 on simplebus3
> mmc1: <MMC/SD bus> on sdhci_bcm1
> =E2=80=94- hanging here=E2=80=94
>=20
> just GUESSING ;-) (absolutely NO proof:-):
> It comes to boot problems short before xhci will be initialized from =
the DeviceTree
>=20

I've not yet tried a combination that uses a u-boot from the USB3
SSD (no microsd card) and gets anywhere near that far along on any
RPi4B (4 GiByte or 8 GiByte).

I've only gotten u-boot to boot RPi4B FreeBSD completely when
u-boot and the FreeBSD kernel were both from the microsd card.
(With the FreeBSD kernel in place, I can then have the later
stages use the USB3 SSD instead --and that is what I normally
do.) But for this to work I've had to use older start* and
fixup* files.

=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?E82AE086-837C-4CEA-92D5-78A39412F964>