RE: u-boot syntax question

Mark Millard <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
bob prohaska <fbsd_at_www.zefox.net> wrote on
Date: Mon, 04 Aug 2025 15:32:09 UTC :

> What's the correct device syntax for u-boot's usbboot command?
> Here's a session transcript:
> 
> U-Boot> usb storage
> Device 0: Vendor: External Rev: 0204 Prod: USB3.0 
> Type: Hard Disk
> Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512)
> U-Boot> usbboot
> ** No device specified **
> U-Boot> run usbboot
> ## Error: "usbboot" not defined
> U-Boot> usbboot 0:1
> ** No device specified **
> U-Boot> usbboot disk0:1
> ** No device specified **
> U-Boot> 
> 
> I've tried 
> starting USB...
> Bus usb@7e980000: 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 
> U-Boot> usbboot disk0p1
> ** No device specified **
> U-Boot> 
> 
> What's the correct syntax for specifying a usb boot device?
> Or, am I doing something else wrong?


Exploring using an RPi4B context . . .

U-Boot 2025.04 (Jun 07 2025 - 10:14:49 +0000)

DRAM:  947 MiB (effective 7.9 GiB)
RPI 4 Model B (0xd03114)
. . .

U-Boot> help
. . .
boot      - boot default, i.e., run 'bootcmd'
. . .
bootefi   - Boots an EFI payload from memory
. . .
bootflow  - Boot flows
. . .
eficonfig - provide menu-driven UEFI variable maintenance interface
efidebug  - Configure UEFI environment
. . .

U-Boot> printenv bootcmd
bootcmd=bootflow scan

U-Boot> help bootflow
bootflow - Boot flows

Usage:
bootflow scan - boot first available bootflow

U-Boot> help bootefi
bootefi - Boots an EFI payload from memory

Usage:
bootefi <image address>[:<image size>] [<fdt address>]
  - boot EFI payload
bootefi bootmgr [fdt address]
  - load and boot EFI payload based on BootOrder/BootXXXX variables.

    If specified, the device tree located at <fdt address> gets
    exposed as EFI configuration table.


The eficonfig command has options:

Add Boot Option
Edit Boot Option
Change Boot Option
Change Boot Order
Delete Boot Option
Quit

In my context here, Change Boot Order has options:

[*] usb 0
Save
Quit

U-Boot> printenv             
. . .
fdt_addr=4000
. . .
fdtcontroladdr=3ac2b8d0
. . .

U-Boot> bootefi bootmgr

And that boots. Interesting the boot
reports:

Using DTB provided by EFI at 0x39be5000.


I'll note that, in my context, the 2 fdt's
at 4000 and 3ac2b8d0 were in complete
agreement for the captured outputs from

U-Boot> fdt addr 4000
Working FDT set to 4000
U-Boot> fdt print /

vs.:

U-Boot> fdt addr 3ac2b8d0
Working FDT set to 3ac2b8d0
U-Boot> fdt print /

By contrast (via a reboot once the
address was known),

U-Boot> fdt addr 0x39be5000
Working FDT set to 39be5000
U-Boot> fdt print /

had the addition (in "/ {"):

        framebuffer@3e9f1000 {
                format = "a8r8g8b8";
                stride = <0x00000940>;
                height = <0x000001c0>;
                width = <0x00000250>;
                reg = <0x00000000 0x3e9f1000 0x00103000>;
                compatible = "simple-framebuffer";
                status = "okay";
        };

And, in chosen, the addition:

                u-boot,version = "2025.04";

It had rng-seed and kaslr-seed deleted in chosen.

(No other differences.)


The above is rather different than the last time
I explored in a (now old) U-Boot, long ago now.

FreeBSD is using U-Boot's EFI support as far as I
can tell, not directly usb support.


===
Mark Millard
marklmi at yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.