Hey, I have a Yocto project build as following:
with OP-TEE enabled. I can successfully build my custom image for my custom hardware.
When i flash the image using uuu utility and boot the system with the following order boot
ROM -> u-boot -> OP-TEE -> Linux Kernel
OP-TEE starts with no (E/TC) debug message and loads my kernel and i can login and manipulate the system correctly.
The issue is as soon as i do a restart or a shutdown (no matter how , even a physical power off), and when i try to reboot my system, OP-TEE starts again and loads my kernel, but the Kernel panics and no longer able to mount the rootfs from mmcblk2p2.
Even from u-boot I no longer able to 'ls mmc 2' or 'ext4ls' the rootfs partition as if it was somehow corrupted.
Remember this only occurs after a first successful boot.
Somehow there is something corrupting my rootfs or changing mmc parts and causing linux to panic.
Also after a successful boot, when i issue the command 'xtest' I get an error as follows:
Also note that we use a custom memory layout and we reserve A7 Core 0 for linux and A7 Core 1 for a custom application, the following device tree snippet should illustrate the layout.
/ {
memory {
//linux,usable-memory = <0x80000000 0x1ff00000>,
// <0xa0000000 0x1ff00000>;
reg = <0x80200000 0x3fd00000>;
linux,usable-memory = <0x80200000 0x3fd00000>;
};
m4_tcm: tcml@7f8000 {
compatible = "fsl, m4_tcml";
reg = <0x7f8000 0x8000>;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
m4_0: m4_app@80000000 {
reg = <0x80000000 0x00100000>;
};
rpmsg_mem: rpmsg_mem_reg@bfff0000 {
no-map;
reg = <0xbfff0000 0x00010000>;
};
a7_1: a7_1_app@90000000 {
reg = <0x90000000 0x10000000>;
};
a7_1_2: a7_1_2_app@A0000000 {
reg = <0xA0000000 0x10000000>;
};
};
memory@80000000 { device_type = "memory"; reg = <0x80000000 0x80000000>; };
Hello ,
I managed to get the xtest working by disabling the dynamic shared memory configuration,
my optee-os bbappend is as follows:
EXTRA_OEMAKE += " \
CFG_CORE_DYN_SHM=n \
CFG_RPMB_FS=y \
CFG_RPMB_FS_DEV_ID=2 \
CFG_RPMB_WRITE_KEY=y \
CFG_CORE_DEBUG_CHECK_STACKS=y \
CFG_TEE_CORE_DEBUG=y \
CFG_TEE_CORE_MALLOC_DEBUG=y \
CFG_TEE_CORE_LOG_LEVEL=4 \
CFG_TEE_TA_LOG_LEVEL=4 \
DEBUG=y \
"
load address = 0x80800000
fdt address = 0x83000000
uTee address = 0x84000000
custom_A7_1 App = 0x89000000
boot sequence is as follows:
OPTEE Disabled:
Boot ROM -> u-Boot [Load FDT, Load A7 App, Load CM4 FW, bootz] -> Linux Kernel
OPTEE Enabled:
Boot ROM -> u-Boot -> [Load FDT, Load A7 App, Load CM4 FW, bootz] -> OPTEE -> Linux Kernel
Now the issues are :
Hey @Sanket_Parekh , I hope you are doing well too, and Thanks for your reply !
Well, after rechecking my kernel patches & device trees (I am porting from 4.19 Warrior to 5.4 Zeus) I have missed patching a DT node and that was the cause of the hang at Starting Kernel.
After that everything works correctly and according to the Porting Guide on Chapter 5.5.1
OCRAM_S will be used by OP-TEE to save PM data, that's why I left CM4 linked against OCRAM_EPDC 0x920000 and above.
Now issues remains with OP-TEE, I still have failed Tests (check the attachment logs).
I had to disable RPMB because it was causing most of the tests to fail.
CFG_DDR_SIZE is defined correctly, please find attached the conf.mk file.
If you see any bad/wrong configuration statement within the conf.mk please correct me.