May 5, 2026

Allwinner H5 -- new U-boot for the H5

A note up front after using this new U-boot for a few days. The old version used to "hang the network" frequently, requiring me to plug and unplug the cable and restart U-boot multiple times. This new version never seems to have that problem. They must have fixed a bug in the PHY driver. Whatever the case, it certainly is nice to have this work reliably.

Also this new version uses a significantly different MMU page table layout. I don't know why yet, see the next page.

The one I have been using (through May 5) identifies itself as:

U-Boot 2020.04-armbian (Jun 03 2020 - 07:47:47 +0200) Allwinner Technology
CPU:   Allwinner H5 (SUN50I)
Model: Xunlong Orange Pi PC 2
DRAM:  1 GiB
MMC:   mmc@1c0f000: 0
Loading Environment from FAT...
Some time ago I discovered this site: He is keeping these updated. The latest images are 5 days old (from May 1)!! The latest boot image for the PC2 is based on U-boot v2026.04 and ATF v2.9.0.

Based on prior experience I know that I only need the "boot" image. This is only 480K and downloads almost instantaneously.

The first issue

I use gunzip to decompress the image. It becomes 33M. I use dd to put it onto an SD card. I pop it into my PC2 h5 board and it fires up. Any key interrupts and gets me to the U-boot prompt. I see all the network commands, but saveenv gives me this:
Saving Environment to FAT... Unable to use mmc 0:2...
It wants to use FAT. I have been down this road before. I pull the SD card and look at it with fdisk:
/dev/sdf1        8192   65535   57344   28M  c W95 FAT32 (LBA)
/dev/sdf2  *    65536 7419903 7354368  3.5G 83 Linux
I find this handy tip online:
With "auto" function blk_get_device_part_str() looks for the first partition that has the bootable flag set.
The linux partition does not even exist (i.e. it had no filesystem). I use the "a" command in fdisk to turn off the bootable flag on partition 2 and turn it on on partition 1.

I put the card back into the board, boot it up, and saveenv works now:

Saving Environment to FAT... OK
I never knew about that trick before.

The scheme now is to change the bootcmd variable. It comes like this "out of the box" --

bootcmd=run distro_bootcmd
This would be fine if we wanted to boot linux (and if there was a linux to boot in the linux partition), but we will make changes as follows:
setenv bootaddr 0x40000000
setenv kyu_bootcmd "echo Booting Kyu via dhcp ; dhcp ${bootaddr}; go ${bootaddr}"
setenv bootcmd "run kyu_bootcmd"
saveenv
I type "boot" and it boots Kyu!!

This "new" U-boot identifies itself as:

U-Boot 2026.04johang-dirty (May 01 2026 - 02:15:16 +0000) Allwinner Technology
CPU:   Allwinner H5 (SUN50I)
Model: Xunlong Orange Pi PC 2
DRAM:  1 GiB


Have any comments? Questions? Drop me a line!

Tom's software pages / tom@mmto.org