Update u-boot @ SD-card (Debian Buster)

Started by JimT, April 27, 2020, 10:05:10 am

Previous topic - Next topic


Some weeks ago, I finally made it to install Debian Buster on SD-card using a modified u-boot on a A20-lime2 Revision K.

How can I update my u-boot to the latest release?

Has anyone done this bevore and can it explain it in short words or maybe there's a tutorial available somewhere.
Thanks a lot in advance!
Greetz Jim


I spent some time on that, searching "the whole" internet:

Firstly get the newest u-boot.bin by compiling it, e.g.
Then get in u-boot prompt by serial console.

1. set usb-drive to current one: "usb dev 0" (or whatever usb device)
2. "mw.b 0x48000000 0x00 0x100000"
3. "ext2load usb 0 0x48000000 u-boot-sunxi-with-spl.bin"
3. "mmc erase 0x10 0x400"
4. "mmc write 0x48000000 0x10 0x400"

BUT, after a reboot Debian is not booting:

Boot message:
U-Boot SPL 2020.07 (Jul 10 2020 - 11:00:01 +0200)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1

and constantly repeating...

Has anybody ever upgraded u-boot and can me pleas explain how to do it or post some links to a tutorial on that?


It looks like not Debian is not booting but your u-boot does not get past one of its early stages.

I recommend the following approach:

- get a fresh sdcard or zero out the first sectors of the existing one (e. g. with dd)
- compile your u-boot using the right config (not sure if you selected the right one since it does not print the board correctly).
- flash u-boot as follows (replace `sdX` by your actual device:

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8 conv=notrunc
Can you please post how you actually compiled your u-boot? Maybe something in these steps was not correct. Or you just flashed the wrong file from the binaries u-boot produces.


thanks @kuleszdl, I am now one step ahead:

What I did to update u-boot at lime2-board (Rev. K) running debian:

1. check partitions:

Disk /dev/sdc: 29,7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: SD  Transcend   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdc1  *        2048   499711   497664  243M 83 Linux
/dev/sdc2         499712 28598271 28098560 13,4G 83 Linux
/dev/sdc3       28600318 30595071  1994754  974M  5 Extended
/dev/sdc5       28600320 30595071  1994752  974M 82 Linux swap / Solaris

2. zero out first sectors:
sudo dd if=/dev/zero of=/dev/sdc bs=1k count=1023 seek=1

3. write u-boot-sunxi-with-spl.bin to sd-card:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8 conv=notrunc

u-boot for A20 (Rev. K) was modified:
"CONFIG_GMAC_TX_DELAY=3" was added to configs/A20-OLinuXino-Lime2_defconfig

--> boot up:

U-Boot 2020.10 (Oct 23 2020 - 12:33:00 +0200) Allwinner Technology

CPU:   Allwinner A20 (SUN7I)
Model: Olimex A20-OLinuXino-LIME2
I2C:   ready
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0
Loading Environment from FAT... Unable to use mmc 0:1... In:    serial
Out:   serial
Err:   serial
Allwinner mUSB OTG (Peripheral)
Net:   eth0: ethernet@1c50000, eth1: usb_ether
starting USB...
Bus usb@1c14000: USB EHCI 1.00
Bus usb@1c14400: USB OHCI 1.0
Bus usb@1c1c000: USB EHCI 1.00
Bus usb@1c1c400: USB OHCI 1.0
scanning bus usb@1c14000 for devices...
      USB device not accepting new address (error=22)
1 USB Device(s) found
scanning bus usb@1c14400 for devices... 1 USB Device(s) found
scanning bus usb@1c1c000 for devices... 1 USB Device(s) found
scanning bus usb@1c1c400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) 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
2628 bytes read in 2 ms (1.3 MiB/s)
## Executing script at 43100000
Mainline u-boot / new-style environment detected.
4403712 bytes read in 263 ms (16 MiB/s)
27118 bytes read in 6 ms (4.3 MiB/s)
20590546 bytes read in 1183 ms (16.6 MiB/s)
Booting Debian 4.19.0-12-armmp-lpae from mmc 0:1...
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
EHCI failed to shut down host controller.
   Loading Ramdisk to 48c5d000, end 49ffffd2 ... OK
   Loading Device Tree to 48c53000, end 48c5c9ed ... OK

Starting kernel ...

[    0.005903] /cpus/cpu@0 missing clock-frequency property
[    0.005938] /cpus/cpu@1 missing clock-frequency property
[    9.064731] usb 1-1: device descriptor read/64, error -71
[   11.024699] usb 1-1: device descriptor read/64, error -71
[   11.612692] usb 1-1: device descriptor read/64, error -71
[   27.240699] usb 1-1: device descriptor read/64, error -110
[   38.584702] usb 1-1: device not accepting address 4, error -110
[   39.140696] usb 1-1: device not accepting address 5, error -71
[   39.146608] usb usb1-port1: unable to enumerate USB device
/dev/mmcblk0p2: clean, 50364/879552 files, 477191/3512320 blocks
[   55.204713] usb 2-1: device descriptor read/64, error -110
[   70.820711] usb 2-1: device descriptor read/64, error -110
[**    ] A start job is running for /dev/dis...a83f-f8cd2d2119ca (44s / 1min 30s)

then option to start emergency mode ...  :'(


You can update u-boot to the latest release:
1. check partitions
2. zero out first sectors
3. write u-boot-sunxi-with-spl.bin to sd-card