pftf / RPi4

Raspberry Pi 4 UEFI Firmware Images
https://rpi4-uefi.dev
Other
1.16k stars 138 forks source link

Freebsd 13.1 Image boot stuck at Mounting UFS with error 19. #219

Closed JohannesNeu closed 2 years ago

JohannesNeu commented 2 years ago

Hi, I try to boot Freebsd 13.1 with RPi4-UEFI and I get stuck with the kernel not being able to mount the root filesystem. This is the UEFI Menu with the version:

 Raspberry Pi Compute Module 4
 BCM2711 (ARM Cortex-A72)                            1.50 GHz
 UEFI Firmware v1.33                                 2048 MB RAM

   Select Language            <English>                  This is the option
                                                         one adjusts to change
 > Device Manager                                        the language for the
 > Boot Manager                                          current system
 > Boot Maintenance Manager

   Continue
   Reset

  ^v=Move Highlight       <Enter>=Select Entry

I think this may somehow be related to the system waiting for USB? At least that is what I found on the internet, but I am a little bit stuck here, because I do not know if this is acutally an UEFI or Freebsd issue, or a combination of both.

I have this bootlog, can some information be derived from that?

Consoles: EFI console
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p2:
FreeBSD/arm64 EFI loader, Revision 1.1

   Command line arguments: loader.efi
   Image base: 0x337eb000
   EFI version: 2.70
   EFI Firmware: https://github.com/pftf/RPi4 (rev 1.00)
   Console: efi (0x1000)
   Load Path: \EFI\BOOT\BOOTAA64.EFI
   Load Device: VenHw(100C2CFA-B586-4198-9B4C-1683D195B1DA)/HD(2,GPT,6B2D26C4-7D
3D-4D9B-BEC0-0E6C872589B0,0x1D800,0x1D000)
   BootCurrent: 0001
   BootOrder: 0000 0002 0003 0004 0005 0006 0001[*]
   BootInfo Path: VenHw(100C2CFA-B586-4198-9B4C-1683D195B1DA)
Ignoring Boot0001: Only one DP found
Trying ESP: VenHw(100C2CFA-B586-4198-9B4C-1683D195B1DA)/HD(2,GPT,6B2D26C4-7D3D-4
D9B-BEC0-0E6C872589B0,0x1D800,0x1D000)
Setting currdev to disk0p2:
Trying: VenHw(100C2CFA-B586-4198-9B4C-1683D195B1DA)/HD(1,GPT,F8E0080E-A6DE-4057-
BA41-4A41FCAE7953,0x800,0x1D000)
Setting currdev to disk0p1:
Trying: VenHw(100C2CFA-B586-4198-9B4C-1683D195B1DA)/HD(3,GPT,6E61A372-0603-4C77-
A5D0-1CA63395BF38,0x3A800,0xE55000)
Setting currdev to disk0p3:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
/
?c\
|  ______               ____   _____ _____
  |  ____|             |  _ \ / ____|  __ \
  | |___ _ __ ___  ___ | |_) | (___ | |  | |
  |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |
  | |   | | |  __/  __/| |_) |____) | |__| |
  | |   | | |    |    ||     |      |      |
  |_|   |_|  \___|\___||____/|_____/|_____/      ```                        `
                                                s` `.....---.......--.```   -/
 /---------- Welcome to FreeBSD -----------\    +o   .--`         /y:`      +.
 |                                         |     yo`:.            :o      `+-
 |  1. Boot Multi user [Enter]             |      y/               -/`   -o/
 |  2. Boot Single user                    |     .-                  ::/sy+:.
 |  3. Escape to loader prompt             |     /                     `--  /
 |  4. Reboot                              |    `:                          :`
 |  5. Cons: Serial                        |    `:                          :`
 |                                         |     /                          /
 |  Options:                               |     .-                        -.
 |  6. Kernel: default/kernel (1 of 1)     |      --                      -.
 |  7. Boot Options                        |       `:`                  `:`
 |                                         |         .--             `--.
 |                                         |            .---.....----.
 \-----------------------------------------/
   ______               ____   _____ _____
  |  ____|             |  _ \ / ____|  __ \
  | |___ _ __ ___  ___ | |_) | (___ | |  | |
  |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |
  | |   | | |  __/  __/| |_) |____) | |__| |
  | |   | | |    |    ||     |      |      |
  |_|   |_|  \___|\___||____/|_____/|_____/      ```                        `
                                                s` `.....---.......--.```   -/
 /---------- Welcome to FreeBSD -----------\    +o   .--`         /y:`      +.
 |                                         |     yo`:.            :o      `+-
 |  1. Back to main menu [Backspace]       |      y/               -/`   -o/
 |  2. Load System Defaults                |     .-                  ::/sy+:.
 |                                         |     /                     `--  /
 |  Boot Options:                          |    `:                          :`
 |  3. Safe Mode  :off                     |    `:                          :`
 |  4. Single user:off                     |     /                          /
 |  5. Verbose    :off                     |     .-                        -.
 |                                         |      --                      -.
 |                                         |       `:`                  `:`
 |                                         |         .--             `--.
 |                                         |            .---.....----.
 \-----------------------------------------/
   ______               ____   _____ _____
  |  ____|             |  _ \ / ____|  __ \
  | |___ _ __ ___  ___ | |_) | (___ | |  | |
  |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |
  | |   | | |  __/  __/| |_) |____) | |__| |
  | |   | | |    |    ||     |      |      |
  |_|   |_|  \___|\___||____/|_____/|_____/      ```                        `
                                                s` `.....---.......--.```   -/
 /---------- Welcome to FreeBSD -----------\    +o   .--`         /y:`      +.
 |                                         |     yo`:.            :o      `+-
 |  1. Back to main menu [Backspace]       |      y/               -/`   -o/
 |  2. Load System Defaults                |     .-                  ::/sy+:.
 |                                         |     /                     `--  /
 |  Boot Options:                          |    `:                          :`
 |  3. Safe Mode  :off                     |    `:                          :`
 |  4. Single user:off                     |     /                          /
 |  5. Verbose    :On                      |     .-                        -.
 |                                         |      --                      -.
 |                                         |       `:`                  `:`
 |                                         |         .--             `--.
 |                                         |            .---.....----.
 \-----------------------------------------/
   ______               ____   _____ _____
  |  ____|             |  _ \ / ____|  __ \
  | |___ _ __ ___  ___ | |_) | (___ | |  | |
  |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |
  | |   | | |  __/  __/| |_) |____) | |__| |
  | |   | | |    |    ||     |      |      |
  |_|   |_|  \___|\___||____/|_____/|_____/      ```                        `
                                                s` `.....---.......--.```   -/
 /---------- Welcome to FreeBSD -----------\    +o   .--`         /y:`      +.
 |                                         |     yo`:.            :o      `+-
 |  1. Back to main menu [Backspace]       |      y/               -/`   -o/
 |  2. Load System Defaults                |     .-                  ::/sy+:.
 |                                         |     /                     `--  /
 |  Boot Options:                          |    `:                          :`
 |  3. Safe Mode  :On                      |    `:                          :`
 |  4. Single user:off                     |     /                          /
 |  5. Verbose    :On                      |     .-                        -.
 |                                         |      --                      -.
 |                                         |       `:`                  `:`
 |                                         |         .--             `--.
 |                                         |            .---.....----.
 \-----------------------------------------/
   ______               ____   _____ _____
  |  ____|             |  _ \ / ____|  __ \
  | |___ _ __ ___  ___ | |_) | (___ | |  | |
  |  ___| '__/ _ \/ _ \|  _ < \___ \| |  | |
  | |   | | |  __/  __/| |_) |____) | |__| |
  | |   | | |    |    ||     |      |      |
  |_|   |_|  \___|\___||____/|_____/|_____/      ```                        `
                                                s` `.....---.......--.```   -/
 /---------- Welcome to FreeBSD -----------\    +o   .--`         /y:`      +.
 |                                         |     yo`:.            :o      `+-
 |  1. Boot Multi user [Enter]             |      y/               -/`   -o/
 |  2. Boot Single user                    |     .-                  ::/sy+:.
 |  3. Escape to loader prompt             |     /                     `--  /
 |  4. Reboot                              |    `:                          :`
 |  5. Cons: Serial                        |    `:                          :`
 |                                         |     /                          /
 |  Options:                               |     .-                        -.
 |  6. Kernel: default/kernel (1 of 1)     |      --                      -.
 |  7. Boot Options                        |       `:`                  `:`
 |                                         |         .--             `--.
 |                                         |            .---.....----.
 \-----------------------------------------/

Loading kernel...
/boot/kernel/kernel text=0x2a8 text=0x8bcbf0 text=0x1f97ac data=0x1a6ac0 data=0x
0+0x381000 syms=[0x8+0x11f6a0+0x8+0x1439ea]
Loading configured modules...
can't find '/etc/hostid'
can't find '/boot/entropy'
No valid device tree blob found!
WARNING! Trying to fire up the kernel, but no device tree blob found!
EFI framebuffer information:
addr, size     0x0, 0x0
dimensions     0 x 0
stride         0
masks          0x00000000, 0x00000000, 0x00000000, 0x00000000
---<<BOOT>>---
                   Type     Physical      Virtual   #Pages Attr
               Reserved 000000000000            0 000001d0 WC WT WB
    RuntimeServicesData 0000001d0000       1d0000 00000020 WC WT WB RUNTIME
               Reserved 0000001f0000            0 00000010 WC WT WB
     ConventionalMemory 000000200000            0 0002b5eb WC WT WB
             LoaderData 00002b7eb000            0 00008000 WC WT WB
             LoaderCode 0000337eb000            0 00000135 WC WT WB
    RuntimeServicesData 000033920000     33920000 00000070 WC WT WB RUNTIME
     ConventionalMemory 000033990000            0 0000000e WC WT WB
             LoaderData 00003399e000            0 00000001 WC WT WB
             LoaderCode 00003399f000            0 00000022 WC WT WB
               Reserved 0000339c1000            0 0000005f WC WT WB
    RuntimeServicesCode 000033a20000     33a20000 00000100 WC WT WB RUNTIME
      ACPIReclaimMemory 000033b20000            0 00000010 WC WT WB
     ConventionalMemory 000033b30000            0 0000149d WC WT WB
       BootServicesData 000034fcd000            0 00001a57 WC WT WB
     ConventionalMemory 000036a24000            0 00000198 WC WT WB
       BootServicesCode 000036bbc000            0 00000444 WC WT WB
    RuntimeServicesCode 000037000000     37000000 00000190 WC WT WB RUNTIME
    RuntimeServicesData 000037190000     37190000 00000250 WC WT WB RUNTIME
     ConventionalMemory 0000373e0000            0 0000001f WC WT WB
       BootServicesData 0000373ff000            0 00000001 WC WT WB
     ConventionalMemory 000037400000            0 00002ff3 WC WT WB
       BootServicesCode 00003a3f3000            0 00000038 WC WT WB
       BootServicesData 00003a42b000            0 00000fd5 WC WT WB
     ConventionalMemory 000040000000            0 00040000 WC WT WB
Physical memory chunk(s):
  0x001d0000 - 0x001effff,     0 MB (     32 pages)
  0x00200000 - 0x339c0fff,   823 MB ( 210881 pages)
  0x33b30000 - 0x36ffffff,    52 MB (  13520 pages)
  0x37190000 - 0x3b3fffff,    66 MB (  17008 pages)
  0x40000000 - 0x7fffffff,  1024 MB ( 262144 pages)
Excluded memory regions:
  0x00000000 - 0x001fffff,     2 MB (    512 pages) NoAlloc
  0x2b800000 - 0x2ccc2fff,    20 MB (   5315 pages) NoAlloc
  0x33920000 - 0x3398ffff,     0 MB (    112 pages) NoAlloc
  0x339c1000 - 0x33b2ffff,     1 MB (    367 pages) NoAlloc
  0x37000000 - 0x373dffff,     3 MB (    992 pages) NoAlloc
Found 4 CPUs in the ACPI tables
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC arm64
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
VT: init without driver.
Preloaded elf kernel "/boot/kernel/kernel" at 0xffff000001296000.
Preloaded boot_entropy_platform "efi_rng_seed" at 0xffff00000129f2c0.
Preloaded TSLOG data "TSLOG" at 0xffff00000129f318.
module firmware already present!
real memory  = 2062684160 (1967 MB)
Physical memory chunk(s):
0x00000000200000 - 0x0000002b7fffff, 727711744 bytes (177664 pages)
0x0000002ccc3000 - 0x0000003391ffff, 113627136 bytes (27741 pages)
0x00000033990000 - 0x000000339c0fff, 200704 bytes (49 pages)
0x00000033b30000 - 0x00000036ffffff, 55377920 bytes (13520 pages)
0x000000373e0000 - 0x0000003b3fffff, 67239936 bytes (16416 pages)
0x00000040000000 - 0x0000007cfa8fff, 1023053824 bytes (249769 pages)
avail memory = 1986158592 (1894 MB)
random: no preloaded entropy cache
random: read 2048 bytes from platform bootloader
random: unblocking device.
VIMAGE (virtualized network stack) enabled
hostuuid: using 00000000-0000-0000-0000-000000000000
ULE: setup cpu 0
random: entropy device external interface
firmware: 'tegra210_xusb_fw' version 0: 132608 bytes loaded at 0xffff0000009baa48
snd_unit_init() u=0x00ff8000 [512] d=0x00007c00 [32] c=0x000003ff [1024]
feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=2 feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25
MAP 1d0000 mode 2 pages 32
MAP 33920000 mode 2 pages 112
MAP 33a20000 mode 2 pages 256
MAP 37000000 mode 2 pages 400
MAP 37190000 mode 2 pages 592
null: <full device, null device, zero device>
crypto: <crypto core>
openfirm: <Open Firmware control device>
kbd0 at kbdmux0
mem: <memory>
ACPI: RSDP 0x0000000033B20018 000024 (v02 RPIFDN)
ACPI: XSDT 0x0000000033B2FE98 000064 (v01 RPIFDN RPI4     00000200      01000013)
ACPI: FACP 0x0000000033B2E998 000114 (v06 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: DSDT 0x0000000033B27518 0022D9 (v02 RPIFDN RPI      00000002 INTL 20190509)
ACPI: CSRT 0x0000000033B2FA98 000169 (v00 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: DBG2 0x0000000033B2FD18 000061 (v00 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: GTDT 0x0000000033B2F998 000068 (v03 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: APIC 0x0000000033B2F598 000184 (v05 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: PPTT 0x0000000033B2EB18 000184 (v02 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: SPCR 0x0000000033B2FE18 000050 (v02 RPIFDN RPI4     00000200 EDK2 00000300)
ACPI: SSDT 0x0000000033B2ED98 000294 (v05 RPIFDN RPI4PCIE 00000002 INTL 20190509)
acpi0: <RPIFDN RPI4>
ACPI: 2 ACPI AML tables successfully acquired and loaded
acpi0: Power Button (fixed)
acpi0: Could not update all GPEs: AE_NOT_CONFIGURED
psci0: <ARM Power State Co-ordination Interface Driver> on acpi0
psci0: PSCI version 0.2 compatible
gic0: <ARM Generic Interrupt Controller> iomem 0xff841000-0xff841fff,0xff842000-0xff842fff on acpi0
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 256
generic_timer0: <ARM Generic Timer> irq 19,20,21 on acpi0
Timecounter "ARM MPCore Timecounter" frequency 54000000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 54000000 Hz quality 1000
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
cpu0: <ACPI CPU> on acpi0
cpu0: switching to generic Cx mode
acpi_syscontainer0: <System Container> on acpi0
pcib0: <Generic PCI host controller> on acpi0
pcib0: Bus is not cache-coherent
pcib0: could not map memory.
device_attach: pcib0 attach returned 6
dwcotg0: <DWC OTG 2.0 integrated USB controller> iomem 0xfe980000-0xfe98ffff irq 0 on acpi0
usbus0 on dwcotg0
dwcotg0: usbpf: Attached
uart0: <PrimeCell UART (PL011)> iomem 0xfe201000-0xfe201fff irq 14 on acpi0
uart0: console (115200,n,8,1)
uart0: fast interrupt
uart0: PPS capture mode: DCD
acpi_tz0: <Thermal Zone> on acpi0
crypto: assign cryptosoft0 driver id 0, flags 0x6000000
armv8crypto0: CPU lacks AES instructions
AcpiOsExecute: task queue not started
Device configuration finished.
Found SMCCC version 1.2
procfs registered
Timecounters tick every 1.000 msec
vlan: initialized, using hash tables with chaining
lo0: bpf attached
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 16384
IPsec: Initialized Security Association Processing.
AcpiOsExecute: enqueue 1 pending tasks
usbus0: 480Mbps High Speed USB v2.0
CPU  0: ARM Cortex-A72 r0p3 affinity:  0
                   Cache Type = <64 byte D-cacheline,64 byte I-cacheline,PIPT ICache,64 byte ERG,64 byte CWG>
 Instruction Set Attributes 0 = <CRC32>
 Instruction Set Attributes 1 = <>
         Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,EL1 32,EL0 32>
         Processor Features 1 = <>
      Memory Model Features 0 = <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,16TB PA>
      Memory Model Features 1 = <8bit VMID>
      Memory Model Features 2 = <32bit CCIDX,48bit VA>
             Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8>
             Debug Features 1 = <>
         Auxiliary Features 0 = <>
         Auxiliary Features 1 = <>
AArch32 Instruction Set Attributes 5 = <CRC32,SEVL>
AArch32 Media and VFP Features 0 = <FPRound,FPSqrt,FPDivide,DP VFPv3+v4,SP VFPv3+v4,AdvSIMD>
AArch32 Media and VFP Features 1 = <SIMDFMAC,FPHP DP Conv,SIMDHP SP Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
regulator: shutting down unused regulators
ugen0.1: <DWCOTG OTG Root HUB> at usbus0
uhub0 on usbus0
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
Trying to mount root from ufs:/dev/ufs/FreeBSD_Install [ro,noatime]...
uhub0: 1 port with 1 removable, self powered
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
mountroot: waiting for device /dev/ufs/FreeBSD_Install...
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
Mounting from ufs:/dev/ufs/FreeBSD_Install failed with error 19.

Loader variables:
  vfs.root.mountfrom=ufs:/dev/ufs/FreeBSD_Install
  vfs.root.mountfrom.options=ro,noatime

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:zroot/ROOT/default
        cd9660:/dev/cd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
usb_alloc_device: setting up USB template failed - usb_template(4) not loaded?
ugen0.2: <Unknown > at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
?

List of GEOM managed disk devices:

mountroot>
JohannesNeu commented 2 years ago

Booting the Freebsd 13.1 RPI image on the same board works. edit: Booting the Freebsd 13.1 memdisk + RPI4-UEFI image does not work on both raspberry pi 4 and raspberry pi 4 compute module (no difference as far as I could see), I tested USB thumb drive, sdcard and onboard emmc

JohannesNeu commented 2 years ago

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264574 I referenced this problem over here at FreeBSD as well.

JohannesNeu commented 2 years ago

The bcm2835_sdhci driver in FreeBSD does not seem to support ACPI attachments and therefore does not work. I do not think this is an issue of RPi4-UEFI