Skip to content

Instantly share code, notes, and snippets.

@alepez
Last active May 4, 2022 13:19
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save alepez/84fd44d5fa113f6fcbc8daf40a44e6e1 to your computer and use it in GitHub Desktop.
Save alepez/84fd44d5fa113f6fcbc8daf40a44e6e1 to your computer and use it in GitHub Desktop.
u-boot boot linux from usb
env set bootcmd_usb "run findfdt; usb start; if run loadimage_usb; then run usbboot; fi"
env set loadfdt_usb "fatload usb ${usbdev}:${usbpart} ${fdt_addr} ${fdt_file}"
env set loadimage_usb "fatload usb ${usbdev}:${usbpart} ${loadaddr} ${image}"
env set usbargs "setenv bootargs console=${console},${baudrate} root=${usbroot}"
env set usbboot "echo Booting from usb ...; run usbargs; if run loadfdt_usb; then bootz ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi"
env set usbdev 0
env set usbpart 1
env set usbroot "/dev/sda2 rootwait rw"
run bootcmd_usb
@livello
Copy link

livello commented Aug 13, 2020

U-Boot 2020.07-2 (Aug 09 2020 - 02:00:40 +0000) Arch Linux ARM

DRAM: 3.9 GiB
RPI 4 Model B (0xc03111)
MMC: emmc2@7e340000: 0, mmcnr@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In: serial
Out: vidconsole
Err: vidconsole
Net: eth0: genet@7d580000
starting USB...
No working controllers found
Hit any key to stop autoboot: 1

U-Boot 2020.07-2 (Aug 09 2020 - 02:00:40 +0000) Arch Linux ARM

DRAM: 3.9 GiB
RPI 4 Model B (0xc03111)
MMC: emmc2@7e340000: 0, mmcnr@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In: serial
Out: vidconsole
Err: vidconsole
Net: eth0: genet@7d580000
starting USB...
No working controllers found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
645 bytes read in 20 ms (31.3 KiB/s)

Executing script at 02c00000

Error: "findfdt" not defined

starting USB...
No working controllers found
SCRIPT FAILED: continuing...
Card did not respond to voltage select!
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment