OPTEE flashing on hikey kirin 620

I try to install optee on the hikey Kirin 620 board. (following this instruction: https://github.com/OP-TEE/build/blob/master/docs/hikey.md)

Everything works like described until the last point flashing the linux update on the board.
After i reboot as described (Reboot with GUI) the board somehow stuck while booting up. I can’t see any log messages or errors just black screen and LED1 (heartbeat) lights up and LED4 (CPU) flashing.
I tried installing different versions of optee but i think the last instruction will “kill” the board ($ dpkg --force-all -i /tmp/linux-image-*arm64.deb).
do you have any tips on how i can install optee on the board or debug the error ?

Okay i change grub to disable the GUI and it seems that the board hangs while login into linaro-user AND the keyboard (all USB ports or other keyboards) is not working this is why it cannot boot. i attached a photo of the error messages when i try to connect a usb keyboard.I think optee isnt the problem here ?

Does it boot to GUI if you remove all USB connections to the board?
Can you also try a different keyboard and/or mouse?
Do you have access to the serial console? If yes, can you login and get to a command prompt from the console?

Hi vchong,
we cant boot into the GUI because we have to login into linaro user. But we cant enter the password. The keyboard isnt working here. If we boot without keyboard is plugged in and we plug in the keyboard the error “unable to enumerate USB device” appears. We tried a USB 3.0 hub and an USB 3.0 stick and it works. Is there a command or something else to enable low speed (maybe USB 2.0 devices)? I tried some commands in “/etc/initramfs-tools/modules” but it doesnt work. We would appreciate any hints or tips.

Thank you very much for your help!

I just noticed the title says kirin 620. Just want to confirm you guys are using the old hikey 4gb board from circuitco? If so, please change https://github.com/OP-TEE/build/blob/master/hikey_debian.mk#L18 to 4 instead of 8 and repeat the instructions from make all.

I’ll also try to put a note for that up on the github page.

We are using the Lemaker version. I think its http://www.lenovator.com/product/90.html or http://www.lenovator.com/product/86.html.

Ok. In that case, do NOT make that change. Try below instead:

In hikey_debian.xml, change the line that says
<project remote="linaro-swg" path="linux" name="linux" revision="optee"/>
<project remote="96boards" path="linux" name="linux" revision="96b/releases/2016.06"/>.

Run repo sync linux from $HOME/devel/optee, then cd build and repeat the instructions from make all.

Okay we changed the hikey_debian.xml and synced everything from scratch. Now the Hikey board LED4 is just flashing and the LED1 is off. After disable the GUI again we can’t even see the console just black screen and flashing LED4. We tried both booting methods (with USB connected and with no USB connected).

It’s hard to tell at this point. You might want to get back to a working state by installing one of the prebuilt debian images [1]. Getting a connection to the uart serial console will be very helpful as well, instead of having to disable and enable the GUI back and forth. With the uart, you can also monitor both the serial console output and GUI on the tv as well.

Once you get back to a working condition, if you just want to install optee on the board, i.e. without building, you can do the following. Note that you will need the serial console to do this. Without it it’s just to difficult to do any kind of development.

  1. Once hikey is booted, configure the board for internet access.

  2. At the command prompt for the board, add below 2 lines to /etc/apt/sources.list:
    deb http://repo.linaro.org/ubuntu/linaro-overlay jessie main
    deb-src http://repo.linaro.org/ubuntu/linaro-overlay jessie main

  3. sudo apt-get update

  4. sudo apt-get install optee-xtest tee-supplicant libteec1.0
    Note the files installed and location of these files.

  5. Try running ‘sudo xtest 1001’ and see if it passes. If not, reboot into fastboot mode and flash the fip.bin you had built previously using repo and make, using the instructions in [1] below.

  6. If xtest passes, you can then also replace the files in 4 with the ones you had built previously. Multiple ways to do this: scp, ftp, tftp, usb drive, etc.

  7. If you want to replace the kernel, you can install the kernel .deb file using the instructions you had used previously, but I don’t know if this will brick your board again or not.

[1] https://github.com/Linaro/documentation/blob/master/Reference-Platform/Releases/RPB_16.06/ConsumerEdition/HiKey/InstallDebianRPB.md

On further thoughts, you might be forced to replace the kernel. The one from [1] might not support optee yet. I’ll try on my board and see what happens.

We flash the board with the make recovery from op-tee/build and the xtest 1001 passed! if i try to install the kernel .deb file the board brick again yes.
But i can restart the board and USB Mouse/keyboard is working if i just install the files via sudo apt-get install … and not updating the kernel.

If i try to follow the instruction from [1] the board freeze while flashing the sudo fastboot flash system hikey-rootfs-debian-jessie-alip-20160629-120.emmc.img (i think at 99%).
We try to get a UART adapter asap to get more information what happens there.

Not sure why but flashing the rootfs from fastboot mode (pins/jumpers 1-2 and 5-6 connected) always seem to get stuck at 99%, so anytime you need to flash this, try to do it from recovery mode (pins/jumpers 1-2 and 3-4 connected).

If you’re still interested, the hikey_debian build has recently been updated. Note that this is however a non-gui build only! To enable wifi, see https://github.com/OP-TEE/build/blob/master/hikey_debian.mk#L448.

For Hikey Board (Kirin 620), I tried to enable File Based Encryption (FBE) by modifying the fstab file to include FBE.

I have observed the issue that when FBE is enabled, Android GUI does not show.

However, when the FBE is disabled, Android GUI shows up.
Has anyone else faced this issue as well?