Recent UEFI builds don't seem to work on my HiKey LeMaker

Hi!

I’ve got a HiKey LeMaker 2GB RAM/8GB eMMC board and it works fine if I follow these
instructions and flash all the old bits on it from: https://releases.linaro.org/96boards//hikey/linaro/binaries/latest/

However, this gives me an UEFI that is 3 years old. I’ve tried newer UEFI builds but all of them seem to fail to boot. For example, flashing the latest fip.bin from hikey/linaro/uefi-openplatformpkg/latest/
produces the following result on boot:

NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.1(release):e9b4909
NOTICE: BL1: Built : 10:50:16, Nov 28 2015
NOTICE: syspll frequency:1190494208Hz
NOTICE: succeed to init lpddr3 rank0 dram phy
INFO: lpddr3_freq_init, set ddrc 533mhz
INFO: init ddr3 rank0
INFO: ddr3 rank1 init pass
INFO: lpddr3_freq_init, set ddrc 800mhz
INFO: init ddr3 rank0
INFO: ddr3 rank1 init pass
INFO: Samsung DDR
NOTICE: BL1: Booting BL2
NOTICE: syspll frequency:1190461440Hz
NOTICE: succeed to init lpddr3 rank0 dram phy

and then the board just hangs.

Has anyone had any luck upgrading similar HiKey LeMaker boards with modern UEFI builds and if so, could you please share step-by-step instructions.

Thanks,
Roman.

P.S. I’m fairly certain that my flashing tools work as expected since I always seem to be able to go back to old UEFI by just re-flashing it.

Hi @rvs,

Have you tried flashing UEFI binaries from below link?

http://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey/debug/

Thanks,
Mani

Hi @Mani

Just to be sure here’s what I did just now:

root@newton-desktop:~/hikey/debug-uefi# python hisi-idt.py -d /dev/ttyUSB0 --img1 recovery.bin
±---------------------+
(’ Serial: ‘, ‘/dev/ttyUSB0’)
(’ Image1: ‘, ‘recovery.bin’)
(’ Image2: ', ‘’)
±---------------------+

(‘Sending’, ‘recovery.bin’, ‘…’)
Done

root@newton-desktop:~/hikey/debug-uefi# fastboot flash ptable ptable-linux-8g.img
target reported max download size of 268435456 bytes
sending ‘ptable’ (17 KB)…
OKAY [ 0.003s]
writing ‘ptable’…
OKAY [ 0.010s]
finished. total time: 0.013s
root@newton-desktop:~/hikey/debug-uefi# fastboot flash fastboot fip.bin
target reported max download size of 268435456 bytes
sending ‘fastboot’ (1405 KB)…
OKAY [ 0.046s]
writing ‘fastboot’…
OKAY [ 0.069s]
finished. total time: 0.115s
root@newton-desktop:~/hikey/debug-uefi# fastboot flash nvme nvme.img
target reported max download size of 268435456 bytes
sending ‘nvme’ (128 KB)…
OKAY [ 0.007s]
writing ‘nvme’…
OKAY [ 0.011s]
finished. total time: 0.018s

And the board still fails:

NOTICE: Booting Trusted Firmware
NOTICE: BL1: v1.1(release):e9b4909
NOTICE: BL1: Built : 10:50:16, Nov 28 2015
NOTICE: syspll frequency:1190494208Hz
NOTICE: succeed to init lpddr3 rank0 dram phy
INFO: lpddr3_freq_init, set ddrc 533mhz
INFO: init ddr3 rank0
INFO: ddr3 rank1 init pass
INFO: lpddr3_freq_init, set ddrc 800mhz
INFO: init ddr3 rank0
INFO: ddr3 rank1 init pass
INFO: Samsung DDR
ERROR: Failed to load BL2 firmware.
PANIC at PC : 0x00000000f9807234

Hi @rvs,

This looks like the eMMC issue we fixed (HACK) in ATF with a delay after eMMC initialization. But our platform maintainer reverted that commit in favour of the polling operation for eMMC status: https://github.com/ARM-software/arm-trusted-firmware/commit/b79de2dca87b8b414570d3e68f493670eac4c731#diff-2efe63bdc95cfec1153cdd8ea7a8c103

So, this is again causing failures in some boards as yours. Till we fix that issue, I would recommend you to follow either one of the below steps:

  1. Use old UEFI and Debian images
  2. Manually revert the above mentioned commit in ATF and build the UEFI binaries according to the instructions here: https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/hikey.rst#how-to-build

Sorry for the inconvenience! Will update this thread when we confirm this behavior internally.

Thanks,
Mani

Hi @rvs, @Mani,

Mani reminded me for this issue, but at my side I cannot reproduce this issue:

NOTICE:  BL1: v2.0(release):v2.0-431-gc8765826
NOTICE:  BL1: Built : 05:02:00, Dec 20 2018
NOTICE:  BL1-FWU: *******FWU Process Started*******
INFO:    BL1: 0xf9838000 - 0xf9840000 [size = 32768]
NOTICE:  Booting Trusted Firmware
NOTICE:  BL1: v1.1(debug):d75cfac
NOTICE:  BL1: Built : 05:02:03, Dec 20 2018
INFO:    BL1: RAM 0xf9838000 - 0xf9840000
NOTICE:  syspll frequency:1190494208Hz
NOTICE:  succeed to init lpddr3 rank0 dram phy
INFO:    lpddr3_freq_init, set ddrc 533mhz
INFO:    init ddr3 rank0
INFO:    ddr3 rank1 init pass
INFO:    lpddr3_freq_init, set ddrc 800mhz
INFO:    init ddr3 rank0
INFO:    ddr3 rank1 init pass
INFO:    Elpida DDR
INFO:    ddr test value:0xa5a55a5a
NOTICE:  Enter fastboot mode...
INFO:    enter usb_config
INFO:    USB: DMA mode.
INFO:    USB ULPI PHY
INFO:    enter reset_endpoints.
INFO:    Enter downloading mode. Please run fastboot command on Host.
INFO:    enter reset_endpoints.
INFO:    enter reset_endpoints.
INFO:    enter reset_endpoints.
INFO:    enter reset_endpoints.
INFO:    usb: online (highspeed)
INFO:    cmd :getvar:partition-type:loader
INFO:    cmd :getvar:max-download-size
INFO:    cmd :download:00009e00
INFO:    cmd :flash:loader
INFO:    recog updatefile
INFO:    cmd :getvar:partition-type:fastboot
INFO:    cmd :getvar:max-download-size
INFO:    cmd :download:0015f600
INFO:    cmd :flash:fastboot
INFO:    recog updatefile
INFO:    cmd :getvar:partition-type:nvme
INFO:    cmd :getvar:max-download-size
INFO:    cmd :download:00020000
INFO:    cmd :flash:nvme
INFO:    recog updatefile
NOTICE:  BL2: v2.0(release):v2.0-431-gc8765826
NOTICE:  BL2: Built : 05:02:00, Dec 20 2018
NOTICE:  acpu_dvfs_set_freq: set acpu freq success!NOTICE:  BL2: Booting BL31
NOTICE:  BL31: v2.0(release):v2.0-431-gc8765826
NOTICE:  BL31: Built : 05:02:00,I/TC:  

From the log shared by Roman, it seems the DDR part is different between us; I can see I am using Elpida DDR and Roman’s board is using Samsung DDR. Let’s check this with @hzhuang1.

I am pretty sure you didn’t flash the latest firmware for BL1 :slight_smile: , you are missing to flash binary “l-loader.bin” [1]: sudo fastboot flash loader l-loader.bin

[1] https://snapshots.linaro.org/96boards/reference-platform/components/uefi-staging/latest/hikey/release/l-loader.bin

2 Likes

Hi @leo-yan

that was it! It was indeed an issue with l-loader.bin – thank you so much for catching this!

I can now proceed with running latest bits on my HiKey.

Thanks,
Roman.

@rvs, Can you please mark @leo-yan’s answer as solved?