Cannot build Hikey Fw from source

Hi @vchong,

I have cloned the repos as follows:

  1. ARM Trusted Firmware:
    $ git clone
  2. edk2:
    $ git clone
  3. OpenPlatformPkg?:
    $ git clone
  4. l-loader:
    $ git clone
  5. uefi-tools: (master branch)
    $ git clone uefi-tools.git - [no description]
  6. atf-fastboot: (only for HiKey)
    $ git clone

Following instructions to compile and install the uefi bootloader from here:

Yea wrong branches.

  1. ARM Trusted Firmware:
    $ git clone
  2. edk2:
    $ git clone -b testing/hikey960_v2.5
  3. OpenPlatformPkg?:
    $ git clone -b testing/hikey960_v1.3.4
  4. l-loader:
    $ git clone -b testing/hikey960_v1.2
  5. uefi-tools: (master branch)
    $ git clone uefi-tools.git - [no description]
  6. atf-fastboot: (only for HiKey)
    $ git clone

Thanks @vchong, i was indeed on the wrong branches.
While trying to build, I faced another error, something like this:

plat/hisilicon/hikey960/ warning: ignoring old recipe for target ‘check_SCP_BL2’
Building hikey960
CC tbbr_config.c
CC fiptool.c
CC bl1/tbbr/tbbr_img_desc.c
CC drivers/io/io_block.c
fiptool.c:21:25: fatal error: openssl/sha.h: No such file or directory
compilation terminated.
Makefile:50: recipe for target ‘fiptool.o’ failed
make[1]: *** [fiptool.o] Error 1
make[1]: *** Waiting for unfinished jobs…
CC drivers/io/io_storage.c
CC drivers/synopsys/ufs/dw_ufs.c
CC drivers/io/io_fip.c
Makefile:663: recipe for target ‘tools/fiptool/fiptool’ failed
make: *** [tools/fiptool/fiptool] Error 2
make: *** Waiting for unfinished jobs…

                                     Hikey960 DEBUG	fail

pass 0
fail 1
Input Images:
bl1: bl1.bin
ns_bl1u: BL33_AP_UEFI.fd
Ouput Image: l-loader.bin

Traceback (most recent call last):
File “”, line 129, in
File “”, line 124, in main
loader.create(img_bl1, img_ns_bl1u, output_img)
File “”, line 92, in create
self.add(0, img_bl1)
File “”, line 32, in add
fsize = os.path.getsize(fname)
File “/usr/lib/python2.7/”, line 57, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: ‘bl1.bin’

I was able to solve this by doing:

$ sudo apt-get install libssl-dev


I was ale to complete step 2 in

But I am having trouble setting up telnet for console.

- Install ser2net. Use telnet as the console since UEFI will output window that fails to display in minicom.
$sudo apt-get install ser2net

- Configure ser2net.
$sudo vi /etc/ser2net.conf

Append one line for serial-over-USB in below.


2004:telnet:0:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner

Open the console.
$telnet localhost 2004

rakshith@patkar007:~/Projects/UEFI-source/l-loader$ telnet localhost 2004
telnet: Unable to connect to remote host: Connection refused

My question is: @vchong @ric96

To do telnet isn’t it necessary that ethernet is active?
And why are we using telnet?
Could you please explain step 4 in a little detail? Or point me to a source of such information?
Thanks in advance.

You’re telnet-ing to localhost, i.e. your own computer, so it’s not necessary to have an outside connection. In reality, it’s just telnet-ing to the port where the serial port/connection is so you can see the console output. Restart ser2net to ‘activate’ the new line and telnet should be ok.

$ sudo killall ser2net
$ sudo ser2net -u
$ telnet localhost 2004

@vchong, Thanks.

For doing step4, could you tell me the set up of dip switches and USB cable?

Refer to

To boot into recovery mode set switch 1 & 2 to ON state and switch 3 to OFF state
Connect USB type C cable from board to PC
Connect serial uart console cable/adapter from board to PC if available