-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OPTEE freezes while starting up on an imx7d with optee 3.19.0 #7139
Comments
From the log, it looks like OP-TEE freezes after the MMU has been enabled. |
Hello, yes, that sould be about right. I need more information about the booflow as I dont know how optee is proceeding. I looked into the logfiles from Jeremias Issue but I only see stack canaries beeing loaded after that from My understanding of the bootflow is, that So as far as I understood with my mx7d in boot.c the booflow is as follows:
The functions called before that are: |
The call to enable the MMU is done here: optee_os/core/arch/arm/kernel/entry_a32.S Lines 508 to 551 in afacf35
|
Hello, so i looked into I can't tell exactly though because neither is written in C, so I can't use the As |
Is it perhaps a cache issue? You could try to comment out: optee_os/core/arch/arm/kernel/entry_a32.S Lines 807 to 808 in afacf35
To rule out some WXN error you could also comment out: optee_os/core/arch/arm/kernel/entry_a32.S Line 157 in afacf35
|
Hey, Thanks for the thint. I did comment out the mentioned lines. I also had to comment out So i did some rudimentary debugging, printing out a string after each line of the optee_os/core/arch/arm/kernel/entry_a32.S Lines 786 to 795 in afacf35
I should mention that CFG_WITH_LPAE is disabled and not parsed. |
That doesn't make sense. It compiled before and suddenly it wouldn't accept |
The Error is:
I neither think that would be a problem, as we disable the I-Cache after `write_icialluf'. I we'd disable it before I'd understand that much more. In the meantime I specifically pinpointed the line in which its freezing: optee_os/core/arch/arm/kernel/entry_a32.S Line 791 in afacf35
I looked into the arm ref man and it says the M Bit is the first bit in the SCTLR Register, which enables the mmu. After that optee_os/core/arch/arm/kernel/entry_a32.S Lines 791 to 792 in afacf35
which means the processor waits until every instruction has been executed. I also tried to comment out My considerations here are, that it this is all quite low level. Is there maybe a high level option I failed to enable, related to the mmu? I also experimented with
I don't understand why though, because in the docs it is stated that L2 Tables are only used with LPAE enabled. Else L1 is used. Buf if you remember the last entry of my log I started the issue it states in the last lines that;
But I don't have LPAE enabled, so why would L2 Tables be used? Or do I have a mistunderstanding with the docs? |
Ok my bad optee_os/core/arch/arm/kernel/entry_a32.S Line 801 in afacf35
I guess that's on me. Trying again. Update Tried it out with But it still hangs at write_sctlr. |
This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
Hello,
I've got a small problem. I try to get OPTEE 3.19.0 running on an Colibri IMX7D with Yocto Linux 4.0 from Toradex which is currently not supported bei Toradex, but the imx7d from NXP is supported by optee. I am evaluating it on an Colibri Eval Board V3.
So in theory it should work and I even found an old issue here on github from somenone working at toradex who manged to get it running. But he had a different issue than me. I got in touch with him, but it has been some time and he sadly can not provide any documentation anymore.
My approach was to port OPTEE with the official Porting Guide from NXP. Sec.5.4 states how it should be done. I did everything which had to be changed. But everytime i tried to boot into the Kernel I got the error:
TEEC_InitializeContext failed with code 0xffff0008
.I found out that the tee supplicant was not running, but I did not manage to start it. The TAs are there, but the OPTEE-OS did not seem to be running. I tried booting into OPTEE (uTee) manually in U-Boot. But that did not work either. I got the following message:
OPTEE just freezes after the last line. I jumped to conclusions that (although it is not marked as an error by the logger), maybe ASLR was the problem. So I disabled it, but the problem persisted. It just freezes after the last line.
I wrote some DMESG-output into the
core_mmu_alloc_l2
before line 316, but the alloc does not fail. It succeeds. Even for the second alloc. So allocation is not the problem either.I looked into the aslr error.
-9
means bad magic number. In the binaries of the dtb there has to be the magic number0xd00dfeed
at the start of the binary. Looked into it with a hex-editor. Definitly is there.So I thought maybe the dtb is located in the wrong addres. I disabled devicetree relocation in u-boot by setting the env-variable
fdt-high
to0xFFFFFFFF
which disables this. Same outcome. The filetree should definitly be at the address I provied optee with compilation-options.I wrote a small u-boot-script to set all this manually:
Adresses are:
CFG_NS_ENTRY_ADDR
is set to the value ofkernel_addr_r
, as this sould be the NextStage I thought after uTee loaded. I thought uTee would load, manipulate the fdt, start itself and jump back into the kernel, booting it up (according to the PortingGuide by NXP).CFG_DT_ADDR
is set to the value offdt_addr_r
.Does anybody have an idea why it could be freezing? What would've come next? Is there documentation on the bootflow of uTee with function-signatures?
Thank you,
marcer1
The text was updated successfully, but these errors were encountered: