Hikey960 4GB RAM board AOSP + OPTEE booting issue

hikey960 master(3.6.1) logs

hikey960 3.4.2 logs
3.4.1 is mistype. these are 3.4.2 logs

I’ve tried 3.4.2 branch following this link but occurred another booting issue

Remove exec_start wait_for_keymaster_optee from device/linaro/hikey/init.common.rc and rebuild. Or try the master branch.

What’s the booting issue with the 3.4.2 branch? Can’t really tell from the logs.

Thanks for comment. I’ll try it tomorrow.
I’ve tried in master branch exactly.

In 3.4.2 branch build, logs bottom 16 lines below repeated and I was stuck in here.

=====================================================================

[ 14.355105] logd: logdr: UID=1000 GID=1003 PID=2890 n tail=50 logMask=8 pid=2836 start=0ns timeout=0ns
[ 14.366389] logd: logdr: UID=1000 GID=1003 PID=2890 n tail=50 logMask=1 pid=2836 start=0ns timeout=0ns
[ 14.398389] logd: logdr: UID=1000 GID=1003 PID=2890 n tail=0 logMask=8 pid=2836 start=0ns timeout=0ns
[ 14.408426] logd: logdr: UID=1000 GID=1003 PID=2890 n tail=0 logMask=1 pid=2836 start=0ns timeout=0ns
[ 14.471423] binder: release 2836:2836 transaction 1052 in, still active
[ 14.480471] binder: release 2836:2836 transaction 1049 out, still active
[ 14.487537] binder: send failed reply for transaction 1052 to 2838:2838
[ 14.487716] healthd: battery none chg=
[ 14.498210] binder: 2838:2838 transaction failed 29189/0, size 4-0 line 2944
[ 14.505323] binder: send failed reply for transaction 1049, target dead
[ 14.515990] binder: undelivered TRANSACTION_COMPLETE
[ 14.522025] binder: undelivered transaction 1237, process died.
[ 14.555597] logd: logdr: UID=1000 GID=1003 PID=2920 n tail=50 logMask=8 pid=2838 start=0ns timeout=0ns
[ 14.566330] logd: logdr: UID=1000 GID=1003 PID=2920 n tail=50 logMask=1 pid=2838 start=0ns timeout=0ns
[ 14.584015] logd: logdr: UID=1000 GID=1003 PID=2920 n tail=0 logMask=8 pid=2838 start=0ns timeout=0ns
[ 14.594402] logd: logdr: UID=1000 GID=1003 PID=2920 n tail=0 logMask=1 pid=2838 start=0ns timeout=0ns

=====================================================================

(Edited) I noticed PID changes now, so I’ll check it tomorrow if logs repeat unchanged or not.
They repeated similarly but I can’t remember exactly now.

Thanks.

I reflashed AOSP OPTEE 3.4.2 as same way as I did yesterday. And finally I could open adb shell today…

VMware recognized “Google adb Gadget”.

xtest result seems fine also.

==============================

23284 subtests of which 0 failed
93 test cases of which 0 failed
0 test cases were skipped
TEE test application done!

==============================

One problem is that I can’t see hdmi display though hikey960 is connected to 1920x1080 resolution display monitor.

I’m searching the way to solve this problem.

dmesg hdmi grep log is:

============================================================================

hikey960:/ # dmesg | grep -i hdmi
[ 2.851184] [drm] wait for external HDMI bridge driver.
[ 6.811944] [drm] client change to HDMI
[ 7.074231] hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: no source widget found for Playback
[ 7.084798] hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: Failed to add route Playback → direct → TX
[ 7.176018] #0: hikey-hdmi

============================================================================

dmesg log file

logcat log file

Sync error occured in 3.6.1 branch (not master) so I couldn’t build again
I’m giving priority to enable hdmi in 3.4.2 branch now.

I changed host machine since VMware sync and build took so much time.

  • Linux 4.15.0-91-generic-Ubuntu with x86_64 CPU

Still, connects adb shell in VMware Ubuntu.

==================================================

build/make/: discarding 1 commits
frameworks/base/: discarding 2 commits
prebuilts/clang/host/linux-x86/: discarding 1 commits
system/bt/: discarding 1 commits
error: system/core/: prior sync failed; rebase still in progress
error: Cannot checkout platform/system/core

error: Unable to fully sync the tree.
error: Checking out local projects failed.
Failing repos:
system/core
Try re-running with “-j1 --fail-fast” to exit at the first error.

==================================================

Possible known limitations with regards to hikey960 HDMI output. The clock frequencies generated by kirin 960 are not HDMI compliant, so if your monitor is particularly sensitive, it just won’t work. Unless you have seen that monitor previously activate on a hikey960 with a different OS build, I would suggest trying several different monitors.

1 Like

@ric96 @vchong @doitright
Anyway, booting issue is solved. Thanks a lot.
I’ll post another new topic about hdmi problem if I can’t solve.

@dvyurij Hi, I just find I ran into the same HDMI issue with my Hikey960 board.
I flashed my hikey960 with AOSP OPTEE 3.4.2 and I can use adb shell.
I even have the same hdmi dmesg log like yours.

=========================================
hikey960:/ # dmesg | grep -i hdmi
[ 2.851184] [drm] wait for external HDMI bridge driver.
[ 6.811944] [drm] client change to HDMI
[ 7.074231] hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: no source widget found for Playback
[ 7.084798] hdmi-audio-codec hdmi-audio-codec.1.auto: ASoC: Failed to add route Playback → direct → TX
[ 7.176018] #0: hikey-hdmi

But one observation I have is that before I reflash the board with this 3.4.2 image, the board has a factory setting image of Android O(I guess) and it works well with my Monitor, which means hikey960 hardware has no problem support my monitor.

Do you have any new findings about this hdmi issue?

Thanks!
Ethan

@quincysquarrel
I’ve solved my problem. It may need specific type of monitor.
I hope this way could help you.

1 Like

It works, thank you very much!

After removing this from init.common.rc, I am getting the following error.

android.hardware.keymaster@3.0-service.optee: Loading…
OpteeKeymaster_ipc: TEEC_Opensession failed with code 0xf0100003 origin 0x4
OpteeKeymaster_cpp: Failed to connect to optee keymaster -267386877
android.hardware.keymaster@3.0-service.optee: Could not create keymaster instance
android.hardware.gatekeeper@1.0-service.optee: Checking gk connection to optee_os
OpteeGatekeeper: TEEC_Opensession failed with code 0xf0100003 origin 0x4
OpteeGateKeeper: Fail to load Gatekeeper TA
OpteeGateKeeper: getConnected 47 connected_ = android.hardware.gatekeeper@1.0-service.optee: gatekeeper failed to connect to optee_os

Where 0xf0100003 refers to TEEC_ERROR_STORAGE_NOT_AVAILABLE. Please help with issue if you know.

Depending on what the kernel source is that you are using, there may be more or less display configurations enabled and/or working.

@Anjali Can you please try the 3.4.2 build for now, with the above mentioned fix for the monitor? The current code base doesn’t seem very stable so we’re planning to upgrade to Q, but it might take some time.

Thanks for the response, but I am still getting the same error with 3.4.2 tag also.
Is there any issue related to SElinux?
getenforce is giving SElinux:disabled.

Is there any possibility of getting TEEC_ERROR_STORAGE_NOT_AVAILABLE error from thread_rpc?

That shouldn’t happen. Are you sure you flashed the images properly? You can check the initial boot log for the OP-TEE version. Something like:
I/TC: OP-TEE version: 3.x.x #1 Day Mon Date HH:MM:SS UTC YYYY arch

Is there any possibility of getting TEEC_ERROR_STORAGE_NOT_AVAILABLE error from thread_rpc?

So it seems like your error is different than the OP although the error code is the same. The error is due to failure accessing secure storage at /data/vendor/tee/. Did you make any changes of your own to the build?

I don’t think that AOSP is expected to be able to boot with selinux DISABLED. Permissive, yes, but not disabled.

Keymaster and gatekeeper services are starting properly with OP-TEE version 3.4.2.
Thank you so much for the help!

Setting selinux to permissive helped, or what?

No sync was not done properly… it was still in 3.6.2 tag.
3.4.2 is working both in permissive and enforcing mode.
But is this tag is supported for hikey960?

But lunch command doesn’t include hikey960 option in 3.4.2!

But your working 3.4.2 build is for the hikey960? And you can still do lunch hikey960-userdebug manually? It should be there per vendorsetup.sh - linaro/hikey.git - [no description].

Yes. There’s a manifest for the hikey960. Haven’t you already built this tag for the 960 and it’s working? Or were you actually building for the 620 instead?