Re: u-boot debug, was: Re: U-boot on RPI3, sees disk but won't boot it

From: Mark Millard <marklmi_at_yahoo.com>
Date: Wed, 28 Sep 2022 01:32:43 UTC
I got a sysutils/u-boot-rpi-arm64 build to work based on
standard ports-style patching (otw files are not related
but are present):

# ls -C1 /usr/ports/sysutils/u-boot-rpi-arm64/files/*
/usr/ports/sysutils/u-boot-rpi-arm64/files/patch-common_usb.c
/usr/ports/sysutils/u-boot-rpi-arm64/files/patch-common_usb__hub.c
/usr/ports/sysutils/u-boot-rpi-arm64/files/patch-common_usb__storage.c
/usr/ports/sysutils/u-boot-rpi-arm64/files/patch-include_configs_rpi.h
/usr/ports/sysutils/u-boot-rpi-arm64/files/patch-lib_efi__loader_efi__console.c
/usr/ports/sysutils/u-boot-rpi-arm64/files/rpi_arm64_fragment

The rpi_arm64_fragment is updated by adding lines for:

CONFIG_LOG=y
CONFIG_LOG_MAX_LEVEL=7
CONFIG_LOG_CONSOLE=y

The 3 patch-common_usb*.c files are patches adding the
following 2 lines just before each #include <log.h>

#define LOG_DEBUG
#define DEBUG

I've included attachments for the above 4 files.

The patch-include_configs_rpi.h is my patch for allowing
my media to work. This may well do Bob no good but is
useful for me. I've not included it.

patch-lib_efi__loader_efi__console.c is unchanged.

I do have a different vintage of RPi* firmware in use
than sysutils/rpi-firmware uses.


The U-Boot part of the boot output looks like what
follows. But I can not replicate Bob's problem so
the output is just for reference. It gives a clue
just how much output to expect.


U-Boot 2022.04 (Sep 28 2022 - 00:42:50 +0000)

DRAM:  size=30, ptr=8a0, limit=2000: 7ffe690
size=8, ptr=8a8, limit=2000: 7ffe6c0
7.9 GiB
bind node psci
   - attempt to match compatible string 'arm,psci-0.2'
No match for node 'psci'
bind node system
Device 'system' has no compatible string
bind node axi
Device 'axi' has no compatible string
bind node aliases
Device 'aliases' has no compatible string
bind node chosen
Device 'chosen' has no compatible string
bind node reserved-memory
Device 'reserved-memory' has no compatible string
bind node thermal-zones
Device 'thermal-zones' has no compatible string
bind node soc
   - attempt to match compatible string 'simple-bus'
   - found match at 'simple_bus': 'simple-bus' matches 'simple-bus'
bind node timer@7e003000
   - attempt to match compatible string 'brcm,bcm2835-system-timer'
No match for node 'timer@7e003000'
bind node cprman@7e101000
   - attempt to match compatible string 'brcm,bcm2711-cprman'
No match for node 'cprman@7e101000'
bind node mailbox@7e00b880
   - attempt to match compatible string 'brcm,bcm2835-mbox'
No match for node 'mailbox@7e00b880'
bind node gpio@7e200000
   - attempt to match compatible string 'brcm,bcm2711-gpio'
   - found match at 'bcm283x_pinctrl': 'brcm,bcm2835-gpio' matches 'brcm,bcm2711-gpio'
bind node serial@7e201000
   - attempt to match compatible string 'arm,pl011'
   - found match at 'serial_pl01x': 'arm,pl011' matches 'arm,pl011'
   - seq=0
bind node spi@7e204000
   - attempt to match compatible string 'brcm,bcm2835-spi'
No match for node 'spi@7e204000'
bind node aux@7e215000
   - attempt to match compatible string 'brcm,bcm2835-aux'
No match for node 'aux@7e215000'
bind node i2c@7e804000
   - attempt to match compatible string 'brcm,bcm2711-i2c'
   - attempt to match compatible string 'brcm,bcm2835-i2c'
No match for node 'i2c@7e804000'
bind node local_intc@40000000
   - attempt to match compatible string 'brcm,bcm2836-l1-intc'
No match for node 'local_intc@40000000'
bind node interrupt-controller@40041000
   - attempt to match compatible string 'arm,gic-400'
No match for node 'interrupt-controller@40041000'
bind node avs-monitor@7d5d2000
   - attempt to match compatible string 'brcm,bcm2711-avs-monitor'
   - attempt to match compatible string 'syscon'
   - attempt to match compatible string 'simple-mfd'
   - found match at 'simple_bus': 'simple-bus' matches 'simple-mfd'
bind node thermal
   - attempt to match compatible string 'brcm,bcm2711-thermal'
No match for node 'thermal'
bind node dma@7e007000
   - attempt to match compatible string 'brcm,bcm2835-dma'
No match for node 'dma@7e007000'
bind node watchdog@7e100000
   - attempt to match compatible string 'brcm,bcm2835-pm'
   - attempt to match compatible string 'brcm,bcm2835-pm-wdt'
No match for node 'watchdog@7e100000'
bind node rng@7e104000
   - attempt to match compatible string 'brcm,bcm2711-rng200'
   - found match at 'iproc_rng200-rng': 'brcm,bcm2711-rng200' matches 'brcm,bcm2711-rng200'
bind node firmware
   - attempt to match compatible string 'raspberrypi,bcm2835-firmware'
   - attempt to match compatible string 'simple-mfd'
   - found match at 'simple_bus': 'simple-bus' matches 'simple-mfd'
bind node clocks
   - attempt to match compatible string 'raspberrypi,firmware-clocks'
No match for node 'clocks'
bind node gpio
   - attempt to match compatible string 'raspberrypi,firmware-gpio'
No match for node 'gpio'
bind node reset
   - attempt to match compatible string 'raspberrypi,firmware-reset'
   - found match at 'raspberrypi-reset': 'raspberrypi,firmware-reset' matches 'raspberrypi,firmware-reset'
bind node power
   - attempt to match compatible string 'raspberrypi,bcm2835-power'
No match for node 'power'
bind node mailbox@7e00b840
   - attempt to match compatible string 'brcm,bcm2711-vchiq'
No match for node 'mailbox@7e00b840'
bind node mmc@7e300000
   - attempt to match compatible string 'brcm,bcm2835-mmc'
   - attempt to match compatible string 'brcm,bcm2835-sdhci'
   - found match at 'sdhci-bcm2835': 'brcm,bcm2835-sdhci' matches 'brcm,bcm2835-sdhci'
bind node gpiomem
   - attempt to match compatible string 'brcm,bcm2835-gpiomem'
No match for node 'gpiomem'
bind node fb
   - attempt to match compatible string 'brcm,bcm2708-fb'
   - found match at 'bcm2835_video': 'brcm,bcm2835-hdmi' matches 'brcm,bcm2708-fb'
bind node vcsm
   - attempt to match compatible string 'raspberrypi,bcm2835-vcsm'
No match for node 'vcsm'
bind node clocks
Device 'clocks' has no compatible string
bind node phy
   - attempt to match compatible string 'usb-nop-xceiv'
No match for node 'phy'
bind node clk-27M
   - attempt to match compatible string 'fixed-clock'
No match for node 'clk-27M'
bind node clk-108M
   - attempt to match compatible string 'fixed-clock'
No match for node 'clk-108M'
bind node emmc2bus
   - attempt to match compatible string 'simple-bus'
   - found match at 'simple_bus': 'simple-bus' matches 'simple-bus'
bind node emmc2@7e340000
   - attempt to match compatible string 'brcm,bcm2711-emmc2'
   - found match at 'sdhci-bcm2835': 'brcm,bcm2835-sdhci' matches 'brcm,bcm2711-emmc2'
   - seq=0
bind node arm-pmu
   - attempt to match compatible string 'arm,cortex-a72-pmu'
   - attempt to match compatible string 'arm,armv8-pmuv3'
No match for node 'arm-pmu'
bind node timer
   - attempt to match compatible string 'arm,armv8-timer'
No match for node 'timer'
bind node cpus
Device 'cpus' has no compatible string
bind node scb
   - attempt to match compatible string 'simple-bus'
   - found match at 'simple_bus': 'simple-bus' matches 'simple-bus'
bind node pcie@7d500000
   - attempt to match compatible string 'brcm,bcm2711-pcie'
   - found match at 'pcie_brcm': 'brcm,bcm2711-pcie' matches 'brcm,bcm2711-pcie'
   - seq=0
bind node pci@1,0
Device 'pci@1,0' has no compatible string
bind node ethernet@7d580000
   - attempt to match compatible string 'brcm,bcm2711-genet-v5'
   - found match at 'eth_bcmgenet': 'brcm,genet-v5' matches 'brcm,bcm2711-genet-v5'
   - seq=0
bind node dma@7e007b00
   - attempt to match compatible string 'brcm,bcm2711-dma'
No match for node 'dma@7e007b00'
bind node hevc-decoder@7eb00000
   - attempt to match compatible string 'raspberrypi,rpivid-hevc-decoder'
No match for node 'hevc-decoder@7eb00000'
bind node rpivid-local-intc@7eb10000
   - attempt to match compatible string 'raspberrypi,rpivid-local-intc'
No match for node 'rpivid-local-intc@7eb10000'
bind node h264-decoder@7eb20000
   - attempt to match compatible string 'raspberrypi,rpivid-h264-decoder'
No match for node 'h264-decoder@7eb20000'
bind node vp9-decoder@7eb30000
   - attempt to match compatible string 'raspberrypi,rpivid-vp9-decoder'
No match for node 'vp9-decoder@7eb30000'
bind node leds
   - attempt to match compatible string 'gpio-leds'
No match for node 'leds'
bind node memory@0
Device 'memory@0' has no compatible string
bind node sd_io_1v8_reg
   - attempt to match compatible string 'regulator-gpio'
No match for node 'sd_io_1v8_reg'
bind node sd_vcc_reg
   - attempt to match compatible string 'regulator-fixed'
No match for node 'sd_vcc_reg'
bind node __overrides__
Device '__overrides__' has no compatible string
bind node fixedregulator_3v3
   - attempt to match compatible string 'regulator-fixed'
No match for node 'fixedregulator_3v3'
bind node fixedregulator_5v0
   - attempt to match compatible string 'regulator-fixed'
No match for node 'fixedregulator_5v0'
bind node v3dbus
   - attempt to match compatible string 'simple-bus'
   - found match at 'simple_bus': 'simple-bus' matches 'simple-bus'
bind node __symbols__
Device '__symbols__' has no compatible string
bind node bootloader
Device 'bootloader' has no compatible string
bind node clk-osc
   - attempt to match compatible string 'fixed-clock'
No match for node 'clk-osc'
bind node clk-usb
   - attempt to match compatible string 'fixed-clock'
No match for node 'clk-usb'
RPI 4 Model B (0xd03114)
0
   - 0 'serial@7e201000'
   - found
0
   - 0 'gpio@7e200000'
   - found
0
   - 0 'gpio@7e200000'
   - found
bcm283x_pinctrl gpio@7e200000: set_state_simple op missing
simple_bus soc: set_state_simple op missing
0
   - 0 'gpio@7e200000'
   - found
pinconfig uart0_pins: set_state_simple op missing
serial_pl01x serial@7e201000: pinctrl_select_state_full: pinctrl_config_one: err=-22
Core:  198 devices, 13 uclasses, devicetree: board
MMC:   0
   - 3 'mmc@7e300000'
   - 0 'emmc2@7e340000'
   - found
0
   - 0 'gpio@7e200000'
   - found
simple_bus emmc2bus: set_state_simple op missing
0
   - 0 'gpio@7e200000'
   - found
sdhci-bcm2835 emmc2@7e340000: set_state_simple op missing
1
   - 3 'mmc@7e300000'
   - 0 'emmc2@7e340000'
   - not found
0
   - 0 'gpio@7e200000'
   - found
pinconfig mmc_pins: set_state_simple op missing
mmc@7e300000: 3, emmc2@7e340000: 0
Loading Environment from FAT... 0
   - 0 'fb'
   - found
0
   - 0 'gpio@7e200000'
   - found
bcm2835_video fb: set_state_simple op missing
In:    serial
Out:   vidconsole
Err:   vidconsole
0
   - 0 'ethernet@7d580000'
   - found
Net:   0
   - 0 'gpio@7e200000'
   - found
simple_bus scb: set_state_simple op missing
0
   - 0 'gpio@7e200000'
   - found
eth_bcmgenet ethernet@7d580000: set_state_simple op missing
eth0: ethernet@7d580000
0
   - 0 'gpio@7e200000'
   - found
pcie_brcm pcie@7d500000: set_state_simple op missing
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
bind node usb@1,0
Device 'usb@1,0' has no compatible string
0
   - 0 'gpio@7e200000'
   - found
pci_bridge_drv pci_0:0.0: set_state_simple op missing
starting USB...
Bus xhci_pci: 0
   - 0 'gpio@7e200000'
   - found
xhci_pci xhci_pci: set_state_simple op missing
Looking for reset
Looking for reset
   - result for reset: reset (ret=0)
   - result for reset: reset (ret=0)
0
   - 0 'gpio@7e200000'
   - found
simple_bus firmware: set_state_simple op missing
0
   - 0 'gpio@7e200000'
   - found
raspberrypi-reset reset: set_state_simple op missing
Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 0
   - 0 'gpio@7e200000'
   - found
usb_hub usb_hub: set_state_simple op missing
4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  2 1 0 
Card did not respond to voltage select! : -110
MMC Device 1 not found
no mmc device at slot 1
MMC Device 2 not found
no mmc device at slot 2

Device 0: Vendor: Samsung  Rev: 0    Prod: PSSD T7 Touch   
            Type: Hard Disk
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)
... is now current device
Scanning usb 0:1...
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
8Scanning disk mmc@7e300000.blk...
Disk mmc@7e300000.blk not ready
Card did not respond to voltage select! : -110
Scanning disk emmc2@7e340000.blk...
Disk emmc2@7e340000.blk not ready
Scanning disk usb_mass_storage.lun0...
unhandled device class: xhci_pci (usb)
unhandled device class: pci_0:0.0 (pci)
unhandled device class: pcie@7d500000 (pci)
 <2, 0, 1024>
Unrecognized filesystem type
 <2, 0, 1024>
Unrecognized filesystem type
 <2, 0, 1024>
Unrecognized filesystem type
 <2, 0, 1024>
Unrecognized filesystem type
 <2, 0, 1024>
Unrecognized filesystem type
Found 7 disks
0
   - 0 'gpio@7e200000'
   - found
iproc_rng200-rng rng@7e104000: set_state_simple op missing
FAT read(sect=131), clust_size=32, read_size=32
** Unable to read file ubootefi.var **
Failed to load EFI variables
Initializing EFI driver framework
Adding EFI driver 'EFI block driver'
0
   - 0 'ethernet@7d580000'
   - found
smbios_version = 0000000039c2403f: '2022.04'
BootOrder not defined
EFI boot manager: Cannot load any image
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=163), clust_size=32, read_size=32
FAT read(sect=4963), clust_size=32, read_size=32
Found EFI removable media binary efi/boot/bootaa64.efi
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=163), clust_size=32, read_size=32
FAT read(sect=4963), clust_size=32, read_size=32
FAT read(sect=131), clust_size=32, read_size=32
FAT read(sect=163), clust_size=32, read_size=32
FAT read(sect=4963), clust_size=32, read_size=32
dev=usb, devnr=0:1, path=efi/boot/bootaa64.efi, buffer=0000000000080000, size=d18dc
unhandled device class: xhci_pci (usb)
unhandled device class: pci_0:0.0 (pci)
unhandled device class: pcie@7d500000 (pci)
unhandled device class: xhci_pci (usb)
unhandled device class: pci_0:0.0 (pci)
unhandled device class: pcie@7d500000 (pci)
- recorded device /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/UsbClass(0x0,0x0,0x9,0x0,0x3)/UsbClass(0x4e8,0x4001,0x0,0x0,0x0)/HD(1,GPT,9cdadf2a-de3c-11ec-8f37-a0cec8d68fdc,0x800,0x82000)
- and image /efi\boot\bootaa64.efi
858332 bytes read in 31 ms (26.4 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Loaded from disk
Booting /efi\boot\bootaa64.efi



===
Mark Millard
marklmi at yahoo.com