Copile Android+OP-TEE manifest and start error


#1

I follow https://github.com/linaro-swg/optee_android_manifest to compile android aosp with optee
compile is ok, and then I flash the image to board
and board cannot start
USRT show errors, looks like CPU init error?

[ 30.303665] init: Parsing file /system/etc/init/vold.rc…
[ 30.310083] init: Parsing file /vendor/etc/init…
[ 30.314997] init: Parsing file /odm/etc/init…
[ 30.319675] init[1]: unhandled level 1 translation fault (11) at 0x3030373000, esr 0x92000005
[ 30.328309] pgd = ffffffc07470d000
[ 30.331744] [3030373000] *pgd=0000000000000000, *pud=0000000000000000
[ 30.338278]
[ 30.339785] CPU: 0 PID: 1 Comm: init Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 30.347181] Hardware name: HiKey Development Board (DT)
[ 30.352477] task: ffffffc005f0ed80 ti: ffffffc005f2c000 task.ti: ffffffc005f2c000
[ 30.360050] PC is at 0x4b82ec
[ 30.363045] LR is at 0x4b9c90
[ 30.366054] pc : [<00000000004b82ec>] lr : [<00000000004b9c90>] pstate: 60000000
[ 30.373543] sp : 0000007fe3c1b7f0
[ 30.376899] x29: 0000007fe3c1b800 x28: 00000000ffffffff
[ 30.382285] x27: 0000000000000001 x26: 0000000000000073
[ 30.387669] x25: 0000007fe3c1ba20 x24: 000000000ccccccc
[ 30.393068] x23: 0000007fe3c1bf80 x22: 0000000000507531
[ 30.398455] x21: 0000000000000000 x20: 000000008000002f
[ 30.403856] x19: ffffffffffffffff x18: 000000000042105c
[ 30.409247] x17: 000000000000000a
[ 30.412525] x16: 0000000000000000
[ 30.416155] x15: 0000000000000000 x14: 000000000051fca0
[ 30.421543] x13: 0000007fe3c1c670 x12: 000000000051f944
[ 30.426933] x11: 0101010101010101 x10: 0000000000000001
[ 30.432337] x9 : 0000000000510bc7 x8 : 0000003030373008
[ 30.437723] x7 : fffffffffffffff8 x6 : 0000000080000000
[ 30.443115] x5 : 0000007fe3c1c160 x4 : 000000000050752d
[ 30.448514] x3 : 0000007fe3c1b9b8 x2 : 0000000000000004
[ 30.453905] x1 : 0000003030373000 x0 : 0000003030373008
[ 30.459297]
[ 30.462593] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 30.462593]
[ 30.471832] CPU: 0 PID: 1 Comm: init Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 30.479216] Hardware name: HiKey Development Board (DT)
[ 30.484492] Call trace:
[ 30.486970] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 30.492425] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 30.497531] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 30.502635] [<ffffffc00019a1ec>] panic+0xf4/0x240
[ 30.507389] [<ffffffc0000c2b14>] do_exit+0x9f4/0x9fc
[ 30.512404] [<ffffffc0000c2bb8>] do_group_exit+0x4c/0xb0
[ 30.517771] [<ffffffc0000ceb2c>] get_signal+0x3cc/0x5a4
[ 30.523049] [<ffffffc000089cc8>] do_signal+0x1b4/0x5a8
[ 30.528239] [<ffffffc00008a328>] do_notify_resume+0x70/0x84
[ 30.533869] [<ffffffc000085ba8>] work_pending+0x1c/0x20
[ 30.539289] CPU1: stopping
[ 30.542024] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 30.549846] Hardware name: HiKey Development Board (DT)
[ 30.555122] Call trace:
[ 30.557592] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 30.563045] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 30.568149] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 30.573254] [<ffffffc00009056c>] handle_IPI+0x2e4/0x2f0
[ 30.578533] [<ffffffc00008256c>] gic_handle_irq+0x94/0xac
[ 30.583987] Exception stack(0xffffffc075003d70 to 0xffffffc075003e90)
[ 30.590494] 3d60: 0000000714e6c53b ffffffc074b5d200
[ 30.598407] 3d80: ffffffc075003ec0 ffffffc000823f88 0000000080000145 ffffffc0000a4300
[ 30.606319] 3da0: 0000000000000000 0000000000000001 0000000000000000 ffffffc000853130
[ 30.614231] 3dc0: 00000000004ea4a9 0000000000000020 000a3140bf664a00 0000000000000019
[ 30.622143] 3de0: 00000032b5193519 ffffffc000084800 0000000000001000 0000000000000000
[ 30.630055] 3e00: 0000000034d5d91d 0000000000000000 0000000000000000 0000000000000000
[ 30.637967] 3e20: 0000000000000000 0000000000000000 0000000000000000 0000000714e6c53b
[ 30.645879] 3e40: ffffffc074b5d200 0000000000000002 0000000000000001 ffffffc0011487f0
[ 30.653792] 3e60: 0000000000000001 000000070ba9c908 ffffffc001053288 ffffffc075003f70
[ 30.661703] 3e80: ffffffc001074000 ffffffc075003ec0
[ 30.666630] [<ffffffc0000855ac>] el1_irq+0x6c/0xe0
[ 30.671473] [<ffffffc000824228>] cpuidle_enter+0x34/0x44
[ 30.676841] [<ffffffc0000ff464>] call_cpuidle+0x48/0x78
[ 30.682119] [<ffffffc0000ff718>] cpu_startup_entry+0x284/0x364
[ 30.688012] [<ffffffc00008feb4>] secondary_start_kernel+0x13c/0x160
[ 30.694342] [<000000000008285c>] 0x8285c
[ 30.698302] CPU2: stopping
[ 30.701035] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 30.708858] Hardware name: HiKey Development Board (DT)
[ 30.714133] Call trace:
[ 30.716603] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 30.722057] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 30.727159] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 30.732262] [<ffffffc00009056c>] handle_IPI+0x2e4/0x2f0
[ 30.737539] [<ffffffc00008256c>] gic_handle_irq+0x94/0xac
[ 30.742990] Exception stack(0xffffffc07500bd70 to 0xffffffc07500be90)
[ 30.749497] bd60: 0000000714e800fc ffffffc074b5d000
[ 30.757410] bd80: ffffffc07500bec0 ffffffc000823f88 0000000080000045 ffffffc0000a4300
[ 30.765323] bda0: 0000000000000000 0000000000000001 0000000000000000 ffffffc000853130
[ 30.773235] bdc0: 00000000004ea4a9 0000000000000020 000a4fc53f663d80 0000000000000019
[ 30.781147] bde0: 00000032b5193519 ffffffc000084800 0000000000001000 0000000000000000
[ 30.789059] be00: 0000000034d5d91d 0000000000000000 0000000000000000 0000000000000000
[ 30.796971] be20: 0000000000000000 0000000000000000 0000000000000000 0000000714e800fc
[ 30.804883] be40: ffffffc074b5d000 0000000000000002 0000000000000001 ffffffc0011487f0
[ 30.812796] be60: 0000000000000002 0000000714788010 ffffffc001053288 ffffffc07500bf70
[ 30.820707] be80: ffffffc001074000 ffffffc07500bec0
[ 30.825634] [<ffffffc0000855ac>] el1_irq+0x6c/0xe0
[ 30.830473] [<ffffffc000824228>] cpuidle_enter+0x34/0x44
[ 30.835839] [<ffffffc0000ff464>] call_cpuidle+0x48/0x78
[ 30.841116] [<ffffffc0000ff718>] cpu_startup_entry+0x284/0x364
[ 30.847009] [<ffffffc00008feb4>] secondary_start_kernel+0x13c/0x160
[ 30.853339] [<000000000008285c>] 0x8285c
[ 30.857298] CPU3: stopping
[ 30.860032] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 30.867854] Hardware name: HiKey Development Board (DT)
[ 30.873130] Call trace:
[ 30.875599] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 30.881054] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 30.886156] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 30.891259] [<ffffffc00009056c>] handle_IPI+0x2e4/0x2f0
[ 30.896537] [<ffffffc00008256c>] gic_handle_irq+0x94/0xac
[ 30.901989] Exception stack(0xffffffc07500fd70 to 0xffffffc07500fe90)
[ 30.908496] fd60: 0000000714e8c78e ffffffc0745dee00
[ 30.916409] fd80: ffffffc07500fec0 ffffffc000823f88 0000000080000145 ffffffc0000a4300
[ 30.924321] fda0: 0000000000000000 0000000000000001 0000000000000000 ffffffc000853130
[ 30.932233] fdc0: 00000000004ea4a9 0000000000000020 000a4fc53f663d80 0000000000000019
[ 30.940145] fde0: 00000032b5193519 ffffffc000084800 0000000000001000 0000000000000000
[ 30.948057] fe00: 0000000034d5d91d 0000000000000000 0000000000000000 0000000000000000
[ 30.955970] fe20: 0000000000000000 0000000000000000 0000000000000000 0000000714e8c78e
[ 30.963882] fe40: ffffffc0745dee00 0000000000000002 0000000000000001 ffffffc0011487f0
[ 30.971795] fe60: 0000000000000003 000000070ab13838 ffffffc001053288 ffffffc07500ff70
[ 30.979706] fe80: ffffffc001074000 ffffffc07500fec0
[ 30.984632] [<ffffffc0000855ac>] el1_irq+0x6c/0xe0
[ 30.989472] [<ffffffc000824228>] cpuidle_enter+0x34/0x44
[ 30.994837] [<ffffffc0000ff464>] call_cpuidle+0x48/0x78
[ 31.000115] [<ffffffc0000ff718>] cpu_startup_entry+0x284/0x364
[ 31.006007] [<ffffffc00008feb4>] secondary_start_kernel+0x13c/0x160
[ 31.012338] [<000000000008285c>] 0x8285c
[ 31.016300] CPU4: stopping
[ 31.019042] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 31.026865] Hardware name: HiKey Development Board (DT)
[ 31.032141] Call trace:
[ 31.034612] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 31.040066] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 31.045169] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 31.050272] [<ffffffc00009056c>] handle_IPI+0x2e4/0x2f0
[ 31.055550] [<ffffffc00008256c>] gic_handle_irq+0x94/0xac
[ 31.061002] Exception stack(0xffffffc075017d70 to 0xffffffc075017e90)
[ 31.067509] 7d60: 0000000714eaa953 ffffffc0745dec00
[ 31.075422] 7d80: ffffffc075017ec0 ffffffc000823f88 0000000080000145 ffffffc0000a4300
[ 31.083334] 7da0: 0000000000000000 0000000000000001 0000000000000000 ffffffc000853130
[ 31.091246] 7dc0: 00000000004ea4a9 0000000000000020 000a4fc53f663d80 0000000000000019
[ 31.099158] 7de0: 00000032b5193519 ffffffc000084800 0000000000001000 0000000000000000
[ 31.107070] 7e00: 0000000034d5d91d 0000000000000000 0000000000000000 0000000000000000
[ 31.114982] 7e20: 0000000000000000 0000000000000000 0000000000000000 0000000714eaa953
[ 31.122894] 7e40: ffffffc0745dec00 0000000000000002 0000000000000001 ffffffc0011487f0
[ 31.130807] 7e60: 0000000000000004 00000007102e5d04 ffffffc001053288 ffffffc075017f70
[ 31.138718] 7e80: ffffffc001074000 ffffffc075017ec0
[ 31.143644] [<ffffffc0000855ac>] el1_irq+0x6c/0xe0
[ 31.148484] [<ffffffc000824228>] cpuidle_enter+0x34/0x44
[ 31.153850] [<ffffffc0000ff464>] call_cpuidle+0x48/0x78
[ 31.159128] [<ffffffc0000ff718>] cpu_startup_entry+0x284/0x364
[ 31.165021] [<ffffffc00008feb4>] secondary_start_kernel+0x13c/0x160
[ 31.171351] [<000000000008285c>] 0x8285c
[ 31.175311] CPU5: stopping
[ 31.178044] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 31.185867] Hardware name: HiKey Development Board (DT)
[ 31.191142] Call trace:
[ 31.193612] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 31.199067] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 31.204170] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 31.209272] [<ffffffc00009056c>] handle_IPI+0x2e4/0x2f0
[ 31.214549] [<ffffffc00008256c>] gic_handle_irq+0x94/0xac
[ 31.220001] Exception stack(0xffffffc07501bd70 to 0xffffffc07501be90)
[ 31.226508] bd60: 0000000714eb4252 ffffffc0745dea00
[ 31.234420] bd80: ffffffc07501bec0 ffffffc000823f88 0000000080000145 ffffffc0000a4300
[ 31.242333] bda0: 0000000000000000 0000000000000001 0000000000000000 ffffffc000853130
[ 31.250245] bdc0: 00000000004ea4a9 0000000000000020 000a4fc53f663d80 0000000000000019
[ 31.258157] bde0: 00000032b5193519 ffffffc000084800 0000000000001000 0000000000000000
[ 31.266069] be00: 0000000034d5d91d 0000000000000000 0000000000000000 0000000000000000
[ 31.273981] be20: 0000000000000000 0000000000000000 0000000000000000 0000000714eb4252
[ 31.281893] be40: ffffffc0745dea00 0000000000000002 0000000000000001 ffffffc0011487f0
[ 31.289806] be60: 0000000000000005 000000070f38b8e7 ffffffc001053288 ffffffc07501bf70
[ 31.297717] be80: ffffffc001074000 ffffffc07501bec0
[ 31.302643] [<ffffffc0000855ac>] el1_irq+0x6c/0xe0
[ 31.307483] [<ffffffc000824228>] cpuidle_enter+0x34/0x44
[ 31.312849] [<ffffffc0000ff464>] call_cpuidle+0x48/0x78
[ 31.318126] [<ffffffc0000ff718>] cpu_startup_entry+0x284/0x364
[ 31.324019] [<ffffffc00008feb4>] secondary_start_kernel+0x13c/0x160
[ 31.330350] [<000000000008285c>] 0x8285c
[ 31.334309] CPU6: stopping
[ 31.337043] CPU: 6 PID: 0 Comm: swapper/6 Not tainted 4.4.13-02766-g63834e8-dirty #1
[ 31.344865] Hardware name: HiKey Development Board (DT)
[ 31.350141] Call trace:
[ 31.352610] [<ffffffc00008a898>] dump_backtrace+0x0/0x13c
[ 31.358064] [<ffffffc00008a9f8>] show_stack+0x24/0x30
[ 31.363167] [<ffffffc0004b0178>] dump_stack+0xb0/0xe8
[ 31.368270] [<ffffffc00009056c>] handle_IPI+0x2e4/0x2f0
[ 31.372480] SMP: failed to stop secondary CPUs
[ 31.379317] [<ffffffc00008 seconds…_handle_irq+0x94/0xac
[[ 31.388372] 3d60: 0000000714ebf89c f[ 31.388372] 3d60: 0
[ 31.402686] 3d80: ffffffc075023ec0 ffffffc000823f88 0000000080000145 ffffffc0000a4300
[ 31.410598] 3da0: 0000000000000000 0000000000000001 0000000000000000 ffffffc000853130
[ 31.418511] 3dc0: 00000000004ea4a9 0000000000000020 000a4fc53f663d80 0000000000000019
[ 31.426423] 3de0: 00000032b5193519 ffffffc000084800 0000000000001000 0000000000000000


#2

@fogeater https://github.com/linaro-swg/optee_android_manifest is NOT being updated at the moment. Please try https://wiki.linaro.org/LMG/Engineering/IntegrateOptee instead and let us know if it works for you. HTH


#3

Also, please make sure you’re using the latest version firmware (fip.bin). You can get them from http://builds.96boards.org/snapshots/reference-platform/components/uefi/latest/debug/hikey/.


#4

OK
I am downloading the code.
thank you very much .


#5

I tried https://wiki.linaro.org/LMG/Engineering/IntegrateOptee with no patch. Android system works, but no tee.
I tried to patch, but all patch failed. errors follows:

error: sepolicy/file.te: No such file or directory
error: patch failed: sepolicy/file_contexts:4
error: sepolicy/file_contexts: patch does not apply

error: patch failed: init.hikey.rc:91
error: init.hikey.rc: patch does not apply


#6

Latest work:
optee works fine now.
I build android follow https://github.com/linaro-swg/optee_android_manifest
and use the latest fip.bin http://builds.96boards.org/snapshots/reference-platform/components/uefi/latest/debug/hikey/

and now android with optee works fine.

thank you very much.