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

From: bob prohaska <fbsd_at_www.zefox.net>
Date: Tue, 27 Sep 2022 23:29:30 UTC
On Tue, Sep 27, 2022 at 03:27:10PM -0700, Mark Millard wrote:
> 
> Until the following are changed to have appropriate
> values at the overall configuration level, it does
> not appear that LOG_DEBUG and/or DEBUG will do
> anything:
> 
> QUOTE
> The following options are used to enable logging
> at compile time:
> 
> 	CONFIG_LOG - Enables the logging system
> 	CONFIG_LOG_MAX_LEVEL - Max log level to
> 		build (anything higher is compiled out)
> 	CONFIG_LOG_CONSOLE - Enable writing log
> 		records to the console
> END QUOTE
> 
> I expect that means having them set appropriately
> in rpi_arm64_defconfig for the experiments.
> 
At long last I did it correctly and got a u-boot.bin
that's just under 600kB. After issuing shutdown -r now
part of the output includes

Uptime: 1h38m7s
Resetting system ... 

U-Boot 2022.04 (Sep 27 2022 - 15:47:57 -0700)

DRAM:  948 MiB
RPI 3 Model B (0xa02082)
serial_pl01x serial@7e201000: pinctrl_select_state_full: pinctrl_config_one: err=-22
Core:  69 devices, 10 uclasses, devicetree: board
MMC:   mmc@7e300000: 2
Loading Environment from FAT... In:    serial [there is no uboot.env]
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
Bus usb@7e980000: dwc2_usb usb@7e980000: Can't get reset: -2
USB DWC2
scanning bus usb@7e980000 for devices... 6 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0 
MMC Device 0 not found
no mmc device at slot 0
MMC Device 1 not found
no mmc device at slot 1
Card did not respond to voltage select! : -110

Device 0: unknown device
Waiting for Ethernet connection... done.
BOOTP broadcast 1
BOOTP broadcast 2
[snipped]
*** ERROR: `serverip' not set
Config file not found
U-Boot> <INTERRUPT>
U-Boot> <INTERRUPT>
U-Boot> usb reset
resetting USB...
Bus usb@7e980000: dwc2_usb usb@7e980000: Can't get reset: -2
USB DWC2
scanning bus usb@7e980000 for devices... 6 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
U-Boot> usb reset
resetting USB...
Bus usb@7e980000: dwc2_usb usb@7e980000: Can't get reset: -2
USB DWC2
scanning bus usb@7e980000 for devices... 6 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
U-Boot> usb reset
resetting USB...
Bus usb@7e980000: dwc2_usb usb@7e980000: Can't get reset: -2
USB DWC2
scanning bus usb@7e980000 for devices... 6 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
U-Boot> 

Issuing
U-Boot> run bootcmd_usb0

Device 0: 

[tens of seconds pause, looks like u-boot started over]

U-Boot 2022.04 (Sep 27 2022 - 15:47:57 -0700)

DRAM:  948 MiB
RPI 3 Model B (0xa02082)
serial_pl01x serial@7e201000: pinctrl_select_state_full: pinctrl_config_one: err=-22
Core:  69 devices, 10 uclasses, devicetree: board
MMC:   mmc@7e300000: 2
Loading Environment from FAT... In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
Bus usb@7e980000: dwc2_usb usb@7e980000: Can't get reset: -2
USB DWC2
scanning bus usb@7e980000 for devices... 6 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0 
MMC Device 0 not found
no mmc device at slot 0
MMC Device 1 not found
no mmc device at slot 1
Card did not respond to voltage select! : -110

Device 0: Vendor: SABRENT  Rev: 1214 Prod: 
            Type: Hard Disk
            Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
... is now current device
Scanning usb 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
Missing RNG device for EFI_RNG_PROTOCOL
No EFI system partition
Found EFI removable media binary efi/boot/bootaa64.efi
1262604 bytes read in 31 ms (38.8 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC


[lots of whitespace]
[boot messages]
Eventually loader takes over and the system reached multi-user.

The only extra output seems to be the line
Can't get reset: -2
But, the disk was discovered successfully.
The maximum logging level was 4 out of 7, fearing bloat.

I've subscribed to the freebsd-uboot@freebsd.org mailing list
in case it's a better place for these questions.

Having modified sources deleted by make clean is a nuisance.
Can the behavior be avoided somehow?

Thanks for all your help!

bob prohaska