How can we deploy latest image with UEFI on hikey960?

success_story

#21

Be honest, I also encountered this issue before but I forgot what’s the fixing; I am curious if below are helpful or not?

sudo apt-get install linux-libc-dev:i386 build-essential


#22

Now where do i get the initrd.img ramdisk image from, or do i need to build
from aosp source?


#23

you can extract one from some public image


#24

abootimg seems to be a better option


#25

Seem to be stuck at the android logo now…
logcat: http://paste.ubuntu.com/24908560/


#26

@ric96 I built the android so finally I can get one ramdisk: aosp/out/target/product/hikey960/ramdisk.img; and use it to generate boot.img.

If you don’t like to build Android, you could try one prebuilt image: http://people.linaro.org/~leo.yan/hikey960/ramdisk.img.


#27

Building aosp is not an issue, I’ve tried with both ramdisk from build and initrd from decompression of boot.img seems to get stuck in a bootloop


#28

it build fine but i also get this message:
CC fs/squashfs/inode.o
CC net/ipv6/ipcomp6.o
CC net/ipv6/xfrm6_tunnel.o
CC fs/squashfs/namei.o
CC net/mac80211/key.o
CC net/ipv4/fib_rules.o
grep: include/linux/mali/mali_utgard_uk_types.h: No such file or directory
LD drivers/gpu/arm/utgard/built-in.o
LD drivers/gpu/arm/built-in.o
CC net/ipv4/esp4.o
CC fs/squashfs/super.o
CC net/ipv6/tunnel6.o
CC net/ipv6/xfrm6_mode_transport.o
CC drivers/gpu/arm_gpu/mali_kbase_device.o
CC fs/squashfs/symlink.o


#29

It worked now, I kept forgetting to flash userdata. I usually don’t do it to keep all the bench-marking apps install but I guess after flashing the partition image while install uefi i needed to reformat userdata and that is why it was stuck at boot loop.
Anyways, Thanks for the help @leo-yan, it works well no. any eta on when this will be default on newer build of aosp?


#30

@ric96 Please see this patch, which is to fix the build error info: https://android-review.googlesource.com/#/c/420079/


#31

Let me check the schedule for migration to UEFI+ARM-TF.


#32

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?


#33

@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.


#34

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


#35

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?

#36

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


#37

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

Install UEFI on HiKey960 from Binaries [Instructions]
#38

@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>

}}}


#39

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


#40

@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…

}}}