How can we deploy latest image with UEFI on hikey960?

Any update on this thread yet?

I am trying to build kernel from mainline where hikey960 seems to be supported.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?h=v4.12-rc2&qt=grep&q=hi3660

Any idea?

@rakshithpatkar I don’t think using mainline kernel is good idea, so far it still misses many patches. If you want to use mainline kernel, I suggest you use Hisilicon landing team kernel v4.12 branch: https://github.com/96boards-hikey/linux/tree/hikey960-upstream-rebase

BTW, we are working on integration UEFI+ARM-TF into AOSP and Debian distro, but I cannot give your exactly schedule. We need insure the parity quality with using legacy booting images, so far I saw there still have 2 bugs (one is LED, another is seldom USB booting panic) and after this we need approvement for AOSP integration. So I think we still need more time for this, alternatively could you refer this doc as temporarily solution and welcome to bring up question on forum for it: https://github.com/96boards-hikey/tools-images-hikey960/blob/master/build-from-source/README-ATF-UEFI-build-from-source.md.

@leo-yan Thank you for the response. Watching this thread for further updates. Look forward to it.

Are there pre-built files available or is it necessary to go all the way through the build instructions to boot UEFI images?

The build instructions are not clear . e.g.

  1. which arm-trusted-firmware branch do I have to use? master or integration ? The branches are currently hidden behind the links, explicit git clone commands would be much easier to follow.
  2. where is prm_ptable.img coming from? Looks like generate_ptable.sh is generating this file?
  3. You are creating symbolic links to l-loader.bin , but not to prm_ptable.img , why not?
  4. Which linux boot image and rootfs is compatible after the firmware upgrade?

Hi @ric96, How did you get kernel 4.9 booted through UEFI? Any instructions I can follow?

after getting uefi setup, boot into fastboot and on your host system download two files from https://builds.96boards.org/snapshots/reference-platform/openembedded/morty/hikey960/rpb/latest/

  1. boot-0.0+AUTOINC+*uefi.img
  2. rpb-console-image-hikey960-*.rootfs.img.gz then extract it
    

and flash the using fastboot

fastboot flash boot boot-0.0+AUTOINC+*uefi.img
fastboot flash system rpb-console-image-hikey960-*.rootfs.img

@ric96, Thanks. Now when I power on the target, the grub menu doesn’t show any entries even after flashing

  1. boot-0.0+AUTOINC+*uefi.img
  2. rpb-console-image-hikey960-*.rootfs.img.gz

{{{
rakshith@patkar007:~/Projects/UEFI-source/tools-images-hikey960$ telnet localhost 2004
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.

ser2net port 2004 device /dev/ttyUSB0 [115200 N81] (Debian GNU/Linux)

…[Bds]Booting Android Fastboot
add-symbol-file /home/buildslave/workspace/96boards-reference-uefi-staging/13/edk2/Build/HiKey960/DEBUG_GCC49/AARCH64/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp/DEBUG/AndroidFastbootApp.dll 0xBA1C3000
Loading driver at 0x000BA1C2000 EntryPoint=0x000BA1C3000 AndroidFastbootApp.efi
Android Fastboot mode - version 0.6.
Press RETURN or SPACE key to quit.
Fastboot platform: check for partition-type:boot
Downloading 67108864 bytes
67108864 / 67108864 bytes downloaded (100%)
Flashing partition boot
Done.
Fastboot platform: check for partition-type:system
Erasing partition system
Downloading 104607770 bytes
104607770 / 104607770 bytes downloaded (100%)
Flashing partition system
Done.
}}}


On target boot and hotkey [esc], I can see the following menu:

  Select Language            <Standard English>         This is the option     
                                                     one adjusts to change  

Device Manager the language for the
Boot Manager current system
Boot Maintenance Manager

Continue
Reset

^v=Move Highlight =Select Entry


  • When i select boot manager > Grub, it shows something like this:

{{{

[Bds]Booting Grub
Loading driver at 0x000B9A9B000 EntryPoint=0x000B9A9B400
Loading driver at 0x000B9A9B000 EntryPoint=0x000B9A9B400
Welcome to GRUB!

error: no such device: rootfs.

                      GNU GRUB  version 2.02~beta3

Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions.

grub>

}}}

my mistake you do need to extract the .img.gz file and flash the .img file…
i’ll edit it in the upper post as well

@ric96 Did the above modification.

Now:

boot manager > grub > *CE Reference Platform (HiKey960 rpb)

{{{
error: file /boot/Image' not found. error: file /boot/hi3660-hikey960.dtb’ not found.

Press any key to continue…

}}}

upon highlighting *CE Reference Platform (HiKey960 rpb) press e, what output is there?

This is the output:

/----------------------------------------------------------------------------
|setparams ‘CE Reference Platform (HiKey960 rpb)’ |
| |
| linux /boot/Image console=tty0 console=ttyAMA6,115200n8 root=/dev/sdd10|
| rootwait rw quiet efi=noruntime |
| devicetree /boot/hi3660-hikey960.dtb

that seems fine to me, can you re flash both the boot.img and rpb.img again.
if the issue persists I’ll try it on my hk960 later today

@ric96
Same error again after reflashing.

Thanks for all the help till now, and if you could check on your end and confirm, that would be great.
Thanks again.
Waiting for your update.

yup, i’m getting the same error on build 79

error: file `/boot/Image' not found.
error: file `/boot/hi3660-hikey960.dtb' not found.

Press any key to continue...

However Build 76 seems to be working fine
https://builds.96boards.org/snapshots/reference-platform/openembedded/morty/hikey960/rpb/76/
some issue with build 79

1 Like

@ric96 Thank you for the quick update and solution. Works fine for me now.

@ric96 On a related note, can i find the source repo on which these builds are running?
https://builds.96boards.org/snapshots/reference-platform/openembedded/morty/hikey960/rpb/76/
Like a git repo from where I can download the source?

you can go through this

I fixed that issue by creating a symbolic link in include/uapi to asm-generic:

ln -rs include/uapi/asm-generic include/uapi/asm

Ric96,

Thanks for all your posts. I was able to follow your instructions and installed UEFI on hikey960. Specifically I used the release version and build 25, http://builds.96boards.org/snapshots/reference-platform/components/uefi-staging/25/hikey960/release/

Then I followed your instructions here to flash boot and console image from build 76. However I got the following output on console screen and it seems stuck there forever. Do you have any ideas?

EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Exiting boot services and installing virtual address map...

I also tried build 78 and 79 which gives “not found” errors.

Would appreciate any pointers!

Please try more recent builds from
http://snapshots.linaro.org/reference-platform/embedded/morty/hikey960/