This page describes the procedure for USB booting on Hikey board using UEFI.

Tool Chain to be used

The build has been done using toolchain Linaro GCC 4.9-2015.02.

UEFI building and flashing

The detailed procedure is given in link to build and flash UEFI for Hikey board.

DHCP and TFTP server

Configure DHCP and TFTP servers as per the your host machine operating system.

TFTP booting

1. As there is no on-board ethernet controller on Hikey board, we have to use USB to Ethernet adapter. We prefer to use Apple Ethernet Adapter for this.

2. Disconnect Fastboot USB cable, as there is a hardware limitation on hikey that both OTG and Host don't work together.

3. Connect the adapter to any of the USB Host connector.

3. Power on the Hikey board.

4. Stop at the UEFI prompt, it should show something like below on Hikey board

[1] fastboot
        - VenHw(B549F005-4BD4-4020-A0CB-06F42BDA68C3)/HD(6,GPT,5C0F213C-17E1-4149-88C8-8B50FB4EC70E,0x7000,0x20000)/\EFI\BOOT\FASTBOOT.EFI
[2] boot from eMMC
        - VenHw(B549F005-4BD4-4020-A0CB-06F42BDA68C3)/HD(6,GPT,5C0F213C-17E1-4149-88C8-8B50FB4EC70E,0x7000,0x20000)/\EFI\BOOT\GRUBAA64.EFI
[3] boot from SD card
        - VenHw(594BFE73-5E18-4F12-8119-19DB8C5FC849)/HD(1,MBR,0x00000000,0x3F,0x21FC0)/Image
        - Arguments: dtb=hi6220-hikey.dtb console=ttyAMA3,115200 earlycon=pl011,0xf7113000 root=/dev/mmcblk1p2 rw rootwait initrd=initrd.img efi=noruntime
[4] Shell
[5] Boot Manager

5. Choose option "Shell".

6. Get the IP address

Shell> ifconfig -s eth0 dhcp
Create an IP and start to get the default address
Please wait, your console may stop responding for a while ...
      Default: 192.168.0.162

7. Get the images from TFTP server and keep them in "boot" directory (in Hikey UEFI it FS0:)

Shell> fs0:
FS0:\> ls
Directory of: FS0:\
01/01/2015  00:04 <DIR>           512  EFI
          0 File(s)           0 bytes
          1 Dir(s)
FS0:\> tftp 192.168.0.1 Image
Downloading the file 'Image'
[=======================================>]   11854 Kb
FS0:\> ls
Directory of: FS0:\
01/01/2015  00:04 <DIR>           512  EFI
01/01/1980  00:02          12,139,056  Image
          1 File(s)  12,139,056 bytes
          1 Dir(s)
FS0:\> tftp 192.168.0.1 hi6220-hikey.dtb
Downloading the file 'hi6220-hikey.dtb'
[=======================================>]      44 Kb
FS0:\> ls
Directory of: FS0:\
01/01/2015  00:04 <DIR>           512  EFI
01/01/1980  00:02          12,139,056  Image
01/01/1980  00:03              45,620  hi6220-hikey.dtb
          2 File(s)  12,184,676 bytes
          1 Dir(s)
FS0:\> tftp 192.168.0.1 initrd.img
Downloading the file 'initrd.img'
[=======================================>]    3400 Kb
FS0:\> ls
Directory of: FS0:\
01/01/2015  00:04 <DIR>           512  EFI
01/01/1980  00:02          12,139,056  Image
01/01/1980  00:03              45,620  hi6220-hikey.dtb
01/01/1980  00:03           3,482,115  initrd.img
          3 File(s)  15,666,791 bytes
          1 Dir(s)

8. Then "exit" from Shell prompt and choose Option 2, to boot grub from EMMC.

9. Add below menu in grub

menuentry 'Custom Kernel' {
    search.fs_label rootfs root
    search.fs_label boot esp
    linux ($esp)/Image console=tty0 console=ttyAMA3,115200 root=/dev/disk/by-parr
tlabel/system rootwait rw efi=noruntime
    initrd ($esp)/initrd.img
    devicetree ($esp)/hi6220-hikey.dtb
}

10. Boot from the "Custom Kernel" menu in grub

Ping Test

1. Follow the steps 1-4 as in "TFTP booting"

2. Choose option "Shell"

3. Execute following commands for getting IP address and ping Note: You can refer UEFI shell command documents for more information.

Shell> ifconfig -s eth0 dhcp
Create an IP and start to get the default address
Please wait, your console may stop responding for a while ...
      Default: 192.168.0.11
Shell> ifconfig -l eth0
eth0
  MAC        : AC-29-3A-DB-6C-B4
  Media State: Media present
  Source     : DHCP
  Permanent  : FALSE
   IP address: 192.168.0.11
         Mask: 255.255.255.0
      Gateway: 192.168.0.254
  Routes (2 entries):
    Entry[0]
       Subnet: 192.168.0.0
      Netmask: 255.255.255.0
      Gateway: 0.0.0.0
    Entry[1]
       Subnet: 0.0.0.0
      Netmask: 0.0.0.0
      Gateway: 192.168.0.254
Shell> ping -n 20 192.168.0.1
Ping 192.168.0.1 16 data bytes
16 bytes from 192.168.0.1 : icmp_seq=1 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=2 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=3 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=4 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=5 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=6 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=7 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=8 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=9 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=10 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=11 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=12 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=13 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=14 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=15 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=16 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=17 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=18 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=19 ttl=0 time<0ms
16 bytes from 192.168.0.1 : icmp_seq=20 ttl=0 time<0ms

20 packets transmitted, 20 received, 0% packet loss, time 0ms

Rtt(round trip time) min=0ms max=0ms avg=0ms

Boards/Hikey/Setup/TFTPBoot (last modified 2015-12-07 10:28:41)