Closed janhieber closed 4 years ago
I have dealt with this problem before. If I remember correctly, it was caused by the Linux kernel trying to turn on SMP. The Linux Kernel from the OPTEE team only supports one core on IMX6. And default SMP code on IMX6 tries to write to some HW which it does not have permission to access. You need to modify the Linux kernel to talk to OPTEE OS to turn on the other cores.
Sorry I cannot remember all the details about what to change anymore.
@janhieber Did you disable CAAM in kernel dts? Could you enable earlyprintk and see where it crashes in kernel side?
Yes I did disable CAAM, I'm not sure but I also compiled the kernel without CAAM I think. I'll disable SMP and check if that works, thanks!
I shall also have a look at how the kernel is compiled when building with OP_TEE/build...
Thanks!
It maybe that you do not have the psci code for secondary cores. I use psci, but that code have not open source. I’ll finalize and public that later.
For me it is working. I use optee_os, optee_client and optee_test 3.0.0. U-Boot 2017.11 and Linux Kernel 4.14.14. Also SMP with 4 cores but my board has only 1 gb ram.
All tests are passed without errors
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 saying that you would like to have the label removed otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.
@MrVan @janhieber Are the following kernel configs for CAAM
and SMP
not needed ? And how to enable earlyprintk
and see where it crashes in kernel side inside qemu
emulation session ?
Besides, what about outer-cache ?
I do not understand why need to disable CAAM
which is Cryptographic Accelerator and Assurance Module
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build/kconfigs$ cat qemu.conf | grep CAAM
CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y
CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build/kconfigs$ cat qemu.conf | grep SMP
CONFIG_X86_64_SMP=y
CONFIG_SMP=y
CONFIG_X86_VSMP=y
CONFIG_XEN_PV_SMP=y
CONFIG_XEN_PVHVM_SMP=y
CONFIG_MAXSMP=y
CONFIG_PM_SLEEP_SMP=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_BT_SELFTEST_SMP=y
CONFIG_SCSI_SAS_HOST_SMP=y
CONFIG_VIDEO_VP27SMPX=y
CONFIG_QCOM_SMP2P=y
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build/kconfigs$
As for enabling earlyprintk
for qemu
inside extlinux.conf
or conf.mk
, which of the following files should I modify ?
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build$ locate extlinux
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/amarula/a64-relic/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/amarula/vyasa/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/asus/tinker/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/embest/riotboard/rootfs_overlay/boot/extlinux
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/embest/riotboard/rootfs_overlay/boot/extlinux/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/orangepi/orangepi-lite2/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/orangepi/orangepi-one-plus/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/pine64/rock64/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/solidrun/clearfog/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/board/solidrun/macchiatobin/extlinux.conf
/home/rog/Downloads/optee_os/optee-qemu/buildroot/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch
/home/rog/optee_os/build/br-ext/board/stmicroelectronics/stm32mp1-tz/overlay-STM32MP157A-DK1/boot/extlinux
/home/rog/optee_os/build/br-ext/board/stmicroelectronics/stm32mp1-tz/overlay-STM32MP157A-DK1/boot/extlinux/extlinux.conf
/home/rog/optee_os/build/br-ext/board/stmicroelectronics/stm32mp1-tz/overlay-STM32MP157C-DK2/boot/extlinux
/home/rog/optee_os/build/br-ext/board/stmicroelectronics/stm32mp1-tz/overlay-STM32MP157C-DK2/boot/extlinux/extlinux.conf
/home/rog/optee_os/build/br-ext/board/stmicroelectronics/stm32mp1-tz/overlay-STM32MP157C-EV1/boot/extlinux
/home/rog/optee_os/build/br-ext/board/stmicroelectronics/stm32mp1-tz/overlay-STM32MP157C-EV1/boot/extlinux/extlinux.conf
/home/rog/optee_os/buildroot/board/amarula/a64-relic/extlinux.conf
/home/rog/optee_os/buildroot/board/amarula/vyasa/extlinux.conf
/home/rog/optee_os/buildroot/board/asus/tinker/extlinux.conf
/home/rog/optee_os/buildroot/board/embest/riotboard/rootfs_overlay/boot/extlinux
/home/rog/optee_os/buildroot/board/embest/riotboard/rootfs_overlay/boot/extlinux/extlinux.conf
/home/rog/optee_os/buildroot/board/orangepi/orangepi-lite2/extlinux.conf
/home/rog/optee_os/buildroot/board/orangepi/orangepi-one-plus/extlinux.conf
/home/rog/optee_os/buildroot/board/pine64/rock64/extlinux.conf
/home/rog/optee_os/buildroot/board/solidrun/clearfog/extlinux.conf
/home/rog/optee_os/buildroot/board/solidrun/macchiatobin/extlinux.conf
/home/rog/optee_os/buildroot/boot/syslinux/0011-extlinux-Use-the-host-toolchain-to-build.patch
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build$
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build$ locate "conf.mk"
/home/rog/Downloads/optee_os/core/arch/arm/plat-amlogic/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-bcm/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-d02/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-hikey/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-hisilicon/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-imx/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-imx/crypto_conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-k3/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-ls/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-ls/crypto_conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-marvell/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-mediatek/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-poplar/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-rcar/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-rockchip/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-rpi3/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-sam/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-sprd/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-stm/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-sunxi/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-synquacer/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-ti/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-uniphier/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-vexpress/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-zynq7k/conf.mk
/home/rog/Downloads/optee_os/core/arch/arm/plat-zynqmp/conf.mk
/home/rog/Downloads/optee_os/mk/checkconf.mk
/home/rog/Downloads/optee_os/optee-qemu/buildroot/package/autoconf/autoconf.mk
/home/rog/Downloads/optee_os/optee-qemu/buildroot/package/gconf/gconf.mk
/home/rog/Downloads/optee_os/optee-qemu/buildroot/package/pkgconf/pkgconf.mk
/home/rog/Downloads/optee_os/optee-qemu/buildroot/package/python-zeroconf/python-zeroconf.mk
/home/rog/Downloads/optee_os/optee-qemu/buildroot/package/rs485conf/rs485conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-amlogic/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-bcm/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-d02/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-hikey/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-hisilicon/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-imx/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-imx/crypto_conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-k3/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-ls/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-ls/crypto_conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-marvell/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-mediatek/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-poplar/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-rcar/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-rockchip/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-rpi3/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-sam/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-sprd/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-stm/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-sunxi/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-synquacer/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-ti/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-uniphier/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-vexpress/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-zynq7k/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/core/arch/arm/plat-zynqmp/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/mk/checkconf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/out/arm/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/out/arm/export-ta_arm32/host_include/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/out/arm/export-ta_arm32/mk/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/out/arm/export-ta_arm64/host_include/conf.mk
/home/rog/Downloads/optee_os/optee-qemu/optee_os/out/arm/export-ta_arm64/mk/conf.mk
/home/rog/optee_os/buildroot/package/autoconf/autoconf.mk
/home/rog/optee_os/buildroot/package/gconf/gconf.mk
/home/rog/optee_os/buildroot/package/pkgconf/pkgconf.mk
/home/rog/optee_os/buildroot/package/python-zeroconf/python-zeroconf.mk
/home/rog/optee_os/buildroot/package/rs485conf/rs485conf.mk
/home/rog/optee_os/core/arch/arm/plat-amlogic/conf.mk
/home/rog/optee_os/core/arch/arm/plat-bcm/conf.mk
/home/rog/optee_os/core/arch/arm/plat-d02/conf.mk
/home/rog/optee_os/core/arch/arm/plat-hikey/conf.mk
/home/rog/optee_os/core/arch/arm/plat-hisilicon/conf.mk
/home/rog/optee_os/core/arch/arm/plat-imx/conf.mk
/home/rog/optee_os/core/arch/arm/plat-imx/crypto_conf.mk
/home/rog/optee_os/core/arch/arm/plat-k3/conf.mk
/home/rog/optee_os/core/arch/arm/plat-ls/conf.mk
/home/rog/optee_os/core/arch/arm/plat-ls/crypto_conf.mk
/home/rog/optee_os/core/arch/arm/plat-marvell/conf.mk
/home/rog/optee_os/core/arch/arm/plat-mediatek/conf.mk
/home/rog/optee_os/core/arch/arm/plat-poplar/conf.mk
/home/rog/optee_os/core/arch/arm/plat-rcar/conf.mk
/home/rog/optee_os/core/arch/arm/plat-rockchip/conf.mk
/home/rog/optee_os/core/arch/arm/plat-rpi3/conf.mk
/home/rog/optee_os/core/arch/arm/plat-sam/conf.mk
/home/rog/optee_os/core/arch/arm/plat-sprd/conf.mk
/home/rog/optee_os/core/arch/arm/plat-stm/conf.mk
/home/rog/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/home/rog/optee_os/core/arch/arm/plat-sunxi/conf.mk
/home/rog/optee_os/core/arch/arm/plat-synquacer/conf.mk
/home/rog/optee_os/core/arch/arm/plat-ti/conf.mk
/home/rog/optee_os/core/arch/arm/plat-uniphier/conf.mk
/home/rog/optee_os/core/arch/arm/plat-vexpress/conf.mk
/home/rog/optee_os/core/arch/arm/plat-zynq7k/conf.mk
/home/rog/optee_os/core/arch/arm/plat-zynqmp/conf.mk
/home/rog/optee_os/mk/checkconf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-amlogic/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-bcm/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-d02/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-hikey/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-hisilicon/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-imx/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-imx/crypto_conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-k3/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-ls/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-ls/crypto_conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-marvell/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-mediatek/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-poplar/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-rcar/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-rockchip/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-rpi3/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-sam/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-sprd/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-stm/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-stm32mp1/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-sunxi/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-synquacer/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-ti/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-uniphier/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-vexpress/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-zynq7k/conf.mk
/home/rog/optee_os/optee_os/core/arch/arm/plat-zynqmp/conf.mk
/home/rog/optee_os/optee_os/mk/checkconf.mk
/home/rog/optee_os/optee_os/out/arm/conf.mk
/home/rog/optee_os/optee_os/out/arm/export-ta_arm32/host_include/conf.mk
/home/rog/optee_os/optee_os/out/arm/export-ta_arm32/mk/conf.mk
/home/rog/optee_os/optee_os/out/arm/export-ta_arm64/host_include/conf.mk
/home/rog/optee_os/optee_os/out/arm/export-ta_arm64/mk/conf.mk
/home/rog/optee_os/out/arm-plat-vexpress/conf.mk
/home/rog/optee_os/trusted-firmware-a/lib/fconf/fconf.mk
/usr/share/cdbs/1/rules/autoreconf.mk
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build$ locate bios_qemu_tz_arm
rog@rog-GL502VMK:~/Downloads/optee_os/optee-qemu/build$
Hi! I try to get OP-TEE working on a Wandboard Quad rev D1 (latest). I'm using OP-TEE 2.5.0, Linux 4.13.16, U-Boot v2017.11.
I did the following adaptions: In U-Boot In
.config
In
board/wandboard/wandboard.c:dram_init()
Linux Enabled TEE stuff
OP-TEE OS Everything in
core/arch/arm/plat-imx/platform_config.h
seems to be for 1 GiB RAM, do I need changes here? CompilationBooting
Now I get this and than OP-TEE hangs:
What also wonders me is the misaligned cache addr warning. The addresses seem to be OK, Why is that?
Is the problem that I have 2 GiB RAM and the addresses are in the middle of it?