got this error when enabling 'CONFIG_TEE' and 'CONFIG_OPTEE':
/home/morello/workspace/linux/drivers/tee/tee_core.c:851:20: error: incompatible function pointer types initializing 'long (*)(struct file *, unsigned int, user_uintptr_t)' (aka 'long (*)(struct file *, unsigned int, unsigned __intcap)') with an expression of type 'long (struct file *, unsigned int, unsigned long)' [-Werror,-Wincompatible-function-pointer-types] .unlocked_ioctl = tee_ioctl, ^~~~~~~~~ 1 error generated. make[4]: *** [/home/morello/workspace/linux/scripts/Makefile.build:250: drivers/tee/tee_core.o] Error 1 make[3]: *** [/home/morello/workspace/linux/scripts/Makefile.build:500: drivers/tee] Error 2 make[2]: *** [/home/morello/workspace/linux/scripts/Makefile.build:500: drivers] Error 2 make[1]: *** [/home/morello/workspace/linux/Makefile:1999: .] Error 2 make[1]: Leaving directory '/home/morello/workspace/linux-out' make: *** [Makefile:231: __sub-make] Error 2
fix it by changing type 'unsigned long' to 'user_uintptr_t'.
Signed-off-by: Menna Mahmoud eng.mennamahmoud.mm@gmail.com --- drivers/tee/tee_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 98da206cd761..780a094f16ac 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -815,7 +815,7 @@ static int tee_ioctl_supp_send(struct tee_context *ctx, return rc; }
-static long tee_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +static long tee_ioctl(struct file *filp, unsigned int cmd, user_uintptr_t arg) { struct tee_context *ctx = filp->private_data; void __user *uarg = (void __user *)arg;
On 06/07/2023 23:16, Menna Mahmoud wrote:
got this error when enabling 'CONFIG_TEE' and 'CONFIG_OPTEE':
/home/morello/workspace/linux/drivers/tee/tee_core.c:851:20: error: incompatible function pointer types initializing 'long (*)(struct file *, unsigned int, user_uintptr_t)' (aka 'long (*)(struct file *, unsigned int, unsigned __intcap)') with an expression of type 'long (struct file *, unsigned int, unsigned long)' [-Werror,-Wincompatible-function-pointer-types] .unlocked_ioctl = tee_ioctl, ^~~~~~~~~ 1 error generated. make[4]: *** [/home/morello/workspace/linux/scripts/Makefile.build:250: drivers/tee/tee_core.o] Error 1 make[3]: *** [/home/morello/workspace/linux/scripts/Makefile.build:500: drivers/tee] Error 2 make[2]: *** [/home/morello/workspace/linux/scripts/Makefile.build:500: drivers] Error 2 make[1]: *** [/home/morello/workspace/linux/Makefile:1999: .] Error 2 make[1]: Leaving directory '/home/morello/workspace/linux-out' make: *** [Makefile:231: __sub-make] Error 2
Hi Menna,
Thanks for this patch! The diff looks right to me, the native and compat ioctl handlers already handle pointers correctly so we just need to change this prototype. Just a few comments on the commit message: - Make sure to start sentences with capital letters. - There is no need to include the full error message, as it is an expected issue when building a new driver in PCuABI, see [1]. Pawel recently fixed one of those in another driver [2], his commit message can provide some inspiration.
More importantly, did you have the chance to test OP-TEE? If so, it would be nice to add the corresponding options to the Morello defconfig, in a follow-up patch, as they already are in the standard arm64 defconfig. Pawel's patch from the same series [3] is a good example of how to do this (make sure to use `make savedefconfig` to generate a minimal defconfig file).
Cheers, Kevin
[1] https://git.morello-project.org/morello/kernel/linux/-/blob/morello/master/D... [2] https://op-lists.linaro.org/archives/list/linux-morello@op-lists.linaro.org/... [3] https://op-lists.linaro.org/archives/list/linux-morello@op-lists.linaro.org/...
fix it by changing type 'unsigned long' to 'user_uintptr_t'.
Signed-off-by: Menna Mahmoud eng.mennamahmoud.mm@gmail.com
drivers/tee/tee_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 98da206cd761..780a094f16ac 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -815,7 +815,7 @@ static int tee_ioctl_supp_send(struct tee_context *ctx, return rc; } -static long tee_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +static long tee_ioctl(struct file *filp, unsigned int cmd, user_uintptr_t arg) { struct tee_context *ctx = filp->private_data; void __user *uarg = (void __user *)arg;
Hi Kevin,
On Mon, 10 Jul 2023 at 12:39, Kevin Brodsky kevin.brodsky@arm.com wrote:
On 06/07/2023 23:16, Menna Mahmoud wrote:
got this error when enabling 'CONFIG_TEE' and 'CONFIG_OPTEE':
/home/morello/workspace/linux/drivers/tee/tee_core.c:851:20: error:
incompatible function
pointer types initializing 'long (*)(struct file *, unsigned int,
user_uintptr_t)'
(aka 'long (*)(struct file *, unsigned int, unsigned __intcap)') with an
expression
of type 'long (struct file *, unsigned int, unsigned long)'
[-Werror,-Wincompatible-function-pointer-types]
.unlocked_ioctl = tee_ioctl, ^~~~~~~~~
1 error generated. make[4]: *** [/home/morello/workspace/linux/scripts/Makefile.build:250:
drivers/tee/tee_core.o] Error 1
make[3]: *** [/home/morello/workspace/linux/scripts/Makefile.build:500:
drivers/tee] Error 2
make[2]: *** [/home/morello/workspace/linux/scripts/Makefile.build:500:
drivers] Error 2
make[1]: *** [/home/morello/workspace/linux/Makefile:1999: .] Error 2 make[1]: Leaving directory '/home/morello/workspace/linux-out' make: *** [Makefile:231: __sub-make] Error 2
Hi Menna,
Thanks for this patch! The diff looks right to me, the native and compat ioctl handlers already handle pointers correctly so we just need to change this prototype. Just a few comments on the commit message:
- Make sure to start sentences with capital letters.
- There is no need to include the full error message, as it is an
expected issue when building a new driver in PCuABI, see [1]. Pawel recently fixed one of those in another driver [2], his commit message can provide some inspiration.
Thanks, Kevin for the feedback, I will work on it and resend the patch.
More importantly, did you have the chance to test OP-TEE?
No, I didn't. I just enabled it and then built the kernel. I want to test it but when trying to insert OP-TEE module, I got this error: ``` root@morello:~# lsmod Module Size Used by root@morello:~# insmod optee.ko insmod: ERROR: could not load module optee.ko: No such file or directory root@morello:~# modprobe OP-TEE modprobe: FATAL: Module OP-TEE not found in directory /lib/modules/6.1.0OPTEE-Test-g1eebcc168af4-dirty
``` I found it should be loaded by default but I don't why I couldn't find it with `lsmod`? I found that I should build OP-TEE first in the kernel [1]
But need to double-check with you, Is it correct? if yes, should I follow the steps related to FVP? and according to our discussion here [2], should I install the prerequisites [3] in the Morello-Linux container, and this step [4] will be in the workspace dir, then build it in the Morello-Linux container? if yes, should I use the `mount` command to do this or what? or everything will be in the Morello-Linux container? or are all these not needed and there is another way?
If so, it
would be nice to add the corresponding options to the Morello defconfig, in a follow-up patch, as they already are in the standard arm64 defconfig. Pawel's patch from the same series [3] is a good example of how to do this (make sure to use `make savedefconfig` to generate a minimal defconfig file).
got it, I will do this.
Cheers, Kevin
[1]
https://git.morello-project.org/morello/kernel/linux/-/blob/morello/master/D... [2]
https://op-lists.linaro.org/archives/list/linux-morello@op-lists.linaro.org/... [3]
https://op-lists.linaro.org/archives/list/linux-morello@op-lists.linaro.org/...
Thanks, Menna
[1] https://optee.readthedocs.io/en/latest/building/index.html [2] https://op-lists.linaro.org/archives/list/linux-morello@op-lists.linaro.org/... [3] https://optee.readthedocs.io/en/latest/building/prerequisites.html [4] https://optee.readthedocs.io/en/latest/building/gits/build.html#step-3-get-t...
fix it by changing type 'unsigned long' to 'user_uintptr_t'.
Signed-off-by: Menna Mahmoud eng.mennamahmoud.mm@gmail.com
drivers/tee/tee_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c index 98da206cd761..780a094f16ac 100644 --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -815,7 +815,7 @@ static int tee_ioctl_supp_send(struct tee_context
*ctx,
return rc;
}
-static long tee_ioctl(struct file *filp, unsigned int cmd, unsigned
long arg)
+static long tee_ioctl(struct file *filp, unsigned int cmd,
user_uintptr_t arg)
{ struct tee_context *ctx = filp->private_data; void __user *uarg = (void __user *)arg;
On 11/07/2023 13:14, Menna Mahmoud wrote:
More importantly, did you have the chance to test OP-TEE?
No, I didn't. I just enabled it and then built the kernel. I want to test it but when trying to insert OP-TEE module, I got this error:
root@morello:~# lsmod Module Size Used by root@morello:~# insmod optee.ko insmod: ERROR: could not load module optee.ko: No such file or directory root@morello:~# modprobe OP-TEE modprobe: FATAL: Module OP-TEE not found in directory /lib/modules/6.1.0OPTEE-Test-g1eebcc168af4-dirty
I found it should be loaded by default but I don't why I couldn't find it with `lsmod`?
Assuming you selected CONFIG_TEE=y and CONFIG_OPTEE=y, there's no module to load since they are built-in. You should see something I would recommend doing it this way rather than using =m and loading the modules separately, as that requires copying them into the root filesystem at the right location.
I found that I should build OP-TEE first in the kernel [1]
But need to double-check with you, Is it correct? if yes, should I follow the steps related to FVP? and according to our discussion here [2], should I install the prerequisites [3] in the Morello-Linux container, and this step [4] will be in the workspace dir, then build it in the Morello-Linux container? if yes, should I use the `mount` command to do this or what? or everything will be in the Morello-Linux container? or are all these not needed and there is another way?
I don't have any experience with OP-TEE so I'm afraid I can't help with the specifics. It seems to me that those instructions are about building OP-TEE and you should probably do that on the host. As to running it on FVP, there is something about that here [1], but I'm not sure directly that would apply to Morello_FVP. You might need changes to the device tree, for instance.
Kevin
[1] https://optee.readthedocs.io/en/latest/building/devices/fvp.html
On Tue, 11 Jul 2023 at 16:01, Kevin Brodsky kevin.brodsky@arm.com wrote:
On 11/07/2023 13:14, Menna Mahmoud wrote:
More importantly, did you have the chance to test OP-TEE?
No, I didn't. I just enabled it and then built the kernel. I want to test it but when trying to insert OP-TEE module, I got this error:
root@morello:~# lsmod Module Size Used by root@morello:~# insmod optee.ko insmod: ERROR: could not load module optee.ko: No such file or directory root@morello:~# modprobe OP-TEE modprobe: FATAL: Module OP-TEE not found in directory /lib/modules/6.1.0OPTEE-Test-g1eebcc168af4-dirty
I found it should be loaded by default but I don't why I couldn't find it with `lsmod`?
Assuming you selected CONFIG_TEE=y and CONFIG_OPTEE=y, there's no module to load since they are built-in. You should see something I would recommend doing it this way rather than using =m and loading the modules separately, as that requires copying them into the root filesystem at the right location.
I have already done these and also set it =m.
I found that I should build OP-TEE first in the kernel [1]
But need to double-check with you, Is it correct? if yes, should I follow the steps related to FVP? and according to our discussion here [2], should I install the prerequisites [3] in the Morello-Linux container, and this step [4] will be in the workspace dir, then build it in the Morello-Linux container? if yes, should I use the `mount` command to do this or what? or everything will be in the Morello-Linux container? or are all these not needed and there is another way?
I don't have any experience with OP-TEE so I'm afraid I can't help with the specifics. It seems to me that those instructions are about building OP-TEE and you should probably do that on the host. As to running it on FVP, there is something about that here [1], but I'm not sure directly that would apply to Morello_FVP. You might need changes to the device tree, for instance.
Thanks, Kevin, I will try to figure it out, appreciate your help.
Menna
Kevin
[1] https://optee.readthedocs.io/en/latest/building/devices/fvp.html
On 11/07/2023 15:17, Menna Mahmoud wrote:
> I found it should be loaded by default but I don't why I couldn't find > it with `lsmod`? Assuming you selected CONFIG_TEE=y and CONFIG_OPTEE=y, there's no module to load since they are built-in. You should see something I would recommend doing it this way rather than using =m and loading the modules separately, as that requires copying them into the root filesystem at the right location.
I have already done these and also set it =m.
My point was that you should set them to =y instead, so that you don't need to load modules separately.
Kevin
On Tue, 11 Jul 2023 at 17:02, Kevin Brodsky kevin.brodsky@arm.com wrote:
On 11/07/2023 15:17, Menna Mahmoud wrote:
> I found it should be loaded by default but I don't why I couldn't find > it with `lsmod`? Assuming you selected CONFIG_TEE=y and CONFIG_OPTEE=y, there's no module to load since they are built-in. You should see something I would recommend doing it this way rather than using =m and loading the modules separately, as that requires copying them into the root filesystem at the right location.
I have already done these and also set it =m.
My point was that you should set them to =y instead, so that you don't need to load modules separately.
Got your point, I set them to =y but not found OPTEE after running the kernel.
Menna
Kevin
Hi Menna,
On 11/07/2023 12:14, Menna Mahmoud wrote:
But need to double-check with you, Is it correct? if yes, should I follow the steps related to FVP? and according to our discussion here [2], should I install the prerequisites [3] in the Morello-Linux container, and this step [4] will be in the workspace dir, then build it in the Morello-Linux container? if yes, should I use the `mount` command to do this or what? or everything will be in the Morello-Linux container? or are all these not needed and there is another way?
Could you please detail your usecase a bit better? A bit of context would help to support you better, where possible.
Thanks!
On Tue, 11 Jul 2023 at 6:12 PM Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 12:14, Menna Mahmoud wrote:
But need to double-check with you, Is it correct? if yes, should I follow the steps related to FVP? and according to our discussion here [2], should I install the prerequisites [3] in the Morello-Linux container, and this step [4] will be in the workspace dir, then build it in the Morello-Linux container? if yes, should I use the `mount` command to do this or what? or everything will be in the Morello-Linux container? or are all these not needed and there is another way?
Could you please detail your usecase a bit better? A bit of context would help to support you better, where possible.
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps : https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...), but when run into the kernel after building it, I don’t how to test optee , I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any result also when set CONFIG_OPTEE=m instead of =y and tried to load optee module got no found. also use ‘xtest’ command to test optee got this command not found. Are you have any idea about how to check optee?
Thanks, Menna
Thanks!
-- Regards, Vincenzo
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps : https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...), but when run into the kernel after building it, I don’t how to test optee , I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any result also when set CONFIG_OPTEE=m instead of =y and tried to load optee module got no found. also use ‘xtest’ command to test optee got this command not found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I am missing is why you are trying to do that. Could you please explain?
Hi Vincenzo,
On Tue, 11 Jul 2023 at 6:27 PM Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps :
https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp... ),
but when run into the kernel after building it, I don’t how to test
optee ,
I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any
result
also when set CONFIG_OPTEE=m instead of =y and tried to load optee module got no found. also use ‘xtest’ command to test optee got this command not found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I am missing is why you are trying to do that. Could you please explain?
yes understood, I am Outreachy intern working on Morello kernel project, and part of my tasks is enabling optee and test it.
Best Regards, Menna
-- Regards, Vincenzo
Hi Menna,
On 11/07/2023 16:50, Menna Mahmoud wrote:
Hi Vincenzo,
On Tue, 11 Jul 2023 at 6:27 PM Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps :
https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp... ),
but when run into the kernel after building it, I don’t how to test
optee ,
I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any
result
also when set CONFIG_OPTEE=m instead of =y and tried to load optee module got no found. also use ‘xtest’ command to test optee got this command not found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I am missing is why you are trying to do that. Could you please explain?
yes understood, I am Outreachy intern working on Morello kernel project, and part of my tasks is enabling optee and test it.
We never tried OPTEE on Morello FVP hence it might not work at all, but if you want to experiment with it, I suggest to start from [1].
[1] https://optee.readthedocs.io/en/latest/building/gits/build.html#get-and-buil...
In particular:
--->8---
$ mkdir -p <optee-project> $ cd <optee-project> $ repo init -u https://github.com/OP-TEE/manifest.git -m fvp.xml $ repo sync -j4 --no-clone-bundle
$ cd <optee-project>/build $ make -j2 toolchains
$ make -j `nproc`
--->8---
Then install the morello FVP as per [2].
[2] https://linux.morello-project.org/docs/intro/
In particular:
--->8---
$ mkdir -p <optee-project>/morello $ cd <optee-project>/morello $ wget -O FVP_Morello_0.11_34.tgz https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/... $ tar -xzvf FVP_Morello_0.11_34.tgz $ ./FVP_Morello.sh --force --destination ./FVP_Morello ...
Please answer with one of: 'yes' or 'no/quit' Do you agree to the above terms and conditions? yes
--->8---
Then clone the relevant firmware for the board in <optee-project>:
--->8---
$ cd <optee-project> $ git clone https://git.morello-project.org/morello/fvp-firmware.git
--->8---
Then patch the <optee-project>/build/Makefile as follows:
--->8---
diff --git a/fvp.mk b/fvp.mk index 2f1f658caaad..78f9193903be 100644 --- a/fvp.mk +++ b/fvp.mk @@ -52,16 +52,9 @@ else EDK2_BUILD ?= RELEASE endif EDK2_BIN ?= $(EDK2_PLATFORMS_PATH)/Build/ArmVExpress-FVP-AArch64/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/FVP_$(EDK2_ARCH)_EFI.fd -FVP_USE_BASE_PLAT ?= n -ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_PATH ?= $(ROOT)/Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 -FVP_BIN ?= FVP_Base_RevC-2xAEMvA +FVP_PATH ?= $(ROOT)/morello/FVP_Morello/models/Linux64_GCC-6.4/ +FVP_BIN ?= FVP_Morello FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/fvp-base-revc.dtb -else -FVP_PATH ?= $(ROOT)/Foundation_Platformpkg/models/Linux64_GCC-9.3 -FVP_BIN ?= Foundation_Platform -FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb -endif ifeq ($(wildcard $(FVP_PATH)),) $(error $(FVP_PATH) does not exist) endif @@ -302,39 +295,27 @@ boot-img-clean: run: all $(MAKE) run-only
-ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_ARGS ?= \ - -C bp.ve_sysregs.exit_on_shutdown=1 \ - -C cache_state_modelled=0 \ - -C pctl.startup=0.0.0.0 \ - -C cluster0.NUM_CORES=4 \ - -C cluster1.NUM_CORES=4 \ - -C cluster0.cpu0.enable_crc32=1 \ - -C cluster0.cpu1.enable_crc32=1 \ - -C cluster0.cpu2.enable_crc32=1 \ - -C cluster0.cpu3.enable_crc32=1 \ - -C cluster1.cpu0.enable_crc32=1 \ - -C cluster1.cpu1.enable_crc32=1 \ - -C cluster1.cpu2.enable_crc32=1 \ - -C cluster1.cpu3.enable_crc32=1 \ - -C bp.secure_memory=1 \ - -C bp.secureflashloader.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin \ - -C bp.flashloader0.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin \ - -C bp.virtioblockdevice.image_path=$(BOOT_IMG) -ifeq ($(FVP_VIRTFS_ENABLE),y) - FVP_ARGS += -C bp.virtiop9device.root_path=$(FVP_VIRTFS_HOST_DIR) -endif -else FVP_ARGS ?= \ - --arm-v8.0 \ - --cores=4 \ - --secure-memory \ - --visualization \ - --gicv3 \ - --data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin"@0x0 \ - --data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin"@0x8000000 \ - --block-device=$(BOOT_IMG) -endif + --data Morello_Top.css.scp.armcortexm7ct=../fvp-firmware/scp_romfw.bin@0x0 \ + --data Morello_Top.css.mcp.armcortexm7ct=../fvp-firmware/mcp_romfw.bin@0x0 \ + -C Morello_Top.soc.scp_qspi_loader.fname=../fvp-firmware/scp_fw.bin \ + -C Morello_Top.soc.mcp_qspi_loader.fname=../fvp-firmware/mcp_fw.bin \ + -C css.scp.armcortexm7ct.INITVTOR=0x0 \ + -C css.mcp.armcortexm7ct.INITVTOR=0x0 \ + -C css.trustedBootROMloader.fname=../fvp-firmware/bl1.bin \ + -C board.ap_qspi_loader.fname=../fvp-firmware/fip.bin \ + -C board.virtioblockdevice.image_path=$(BOOT_IMG) \ + -C css.pl011_uart_ap.unbuffered_output=1 \ + -C displayController=1 \ + -C board.virtio_rng.enabled=1 \ + -C board.virtio_rng.seed=0 \ + -C num_clusters=2 \ + -C num_cores=2 \ + -C board.virtio_net.hostbridge.userNetworking=1 \ + -C board.virtio_net.enabled=1 \ + -C board.virtio_net.transport=legacy \ + -C board.virtio_net.hostbridge.userNetPorts=5555=5555
run-only: $(FVP_PATH)/$(FVP_BIN) $(FVP_ARGS) $(FVP_EXTRA_ARGS)
--->8---
After this step is complete you should be able to start the model and see the optee image booting issuing the command "make run-only" from <optee-project>/build.
It will fail because you do not have the correct kernel and the correct device tree.
To install the correct kernel and device tree you need to mount the "boot-fat.uefi.img" image as follows:
--->8---
$ cd <optee-project>/out $ mkdir -p mnt $ sudo mount -o loop boot-fat.uefi.img mnt/ $ cd mnt
--->8---
Copy here your OPTEE patched Image and dtb files making sure that they are named "Image" and "fvp.dtb".
Then:
--->8---
$ sync $ sudo umount mnt
--->8---
Go again in <optee-project>/build and issue "make run-only".
At this point the fun begins ^__^.
Let us know how it goes.
Best Regards, Menna
-- Regards, Vincenzo
Hi Vincenzo,
On Tue, 11 Jul 2023 at 8:16 PM Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 16:50, Menna Mahmoud wrote:
Hi Vincenzo,
On Tue, 11 Jul 2023 at 6:27 PM Vincenzo Frascino <
vincenzo.frascino@arm.com>
wrote:
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps :
https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
),
but when run into the kernel after building it, I don’t how to test
optee ,
I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any
result
also when set CONFIG_OPTEE=m instead of =y and tried to load optee
module
got no found. also use ‘xtest’ command to test optee got this command
not
found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I
am
missing is why you are trying to do that. Could you please explain?
yes understood, I am Outreachy intern working on Morello kernel project, and part of my tasks is enabling optee and test it.
We never tried OPTEE on Morello FVP hence it might not work at all, but if you want to experiment with it, I suggest to start from [1].
[1]
https://optee.readthedocs.io/en/latest/building/gits/build.html#get-and-buil...
In particular:
--->8---
$ mkdir -p <optee-project> $ cd <optee-project> $ repo init -u https://github.com/OP-TEE/manifest.git -m fvp.xml $ repo sync -j4 --no-clone-bundle
$ cd <optee-project>/build $ make -j2 toolchains
$ make -j `nproc`
--->8---
Then install the morello FVP as per [2].
[2] https://linux.morello-project.org/docs/intro/
In particular:
--->8---
$ mkdir -p <optee-project>/morello $ cd <optee-project>/morello $ wget -O FVP_Morello_0.11_34.tgz
https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/... $ tar -xzvf FVP_Morello_0.11_34.tgz $ ./FVP_Morello.sh --force --destination ./FVP_Morello ...
Please answer with one of: 'yes' or 'no/quit' Do you agree to the above terms and conditions? yes
--->8---
Then clone the relevant firmware for the board in <optee-project>:
--->8---
$ cd <optee-project> $ git clone https://git.morello-project.org/morello/fvp-firmware.git
--->8---
Then patch the <optee-project>/build/Makefile as follows:
--->8---
diff --git a/fvp.mk b/fvp.mk index 2f1f658caaad..78f9193903be 100644 --- a/fvp.mk +++ b/fvp.mk @@ -52,16 +52,9 @@ else EDK2_BUILD ?= RELEASE endif EDK2_BIN ?=
$(EDK2_PLATFORMS_PATH)/Build/ArmVExpress-FVP-AArch64/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/FVP_$(EDK2_ARCH)_EFI.fd -FVP_USE_BASE_PLAT ?= n -ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_PATH ?= $(ROOT)/Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 -FVP_BIN ?= FVP_Base_RevC-2xAEMvA +FVP_PATH ?= $(ROOT)/morello/FVP_Morello/models/Linux64_GCC-6.4/ +FVP_BIN ?= FVP_Morello FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/fvp-base-revc.dtb -else -FVP_PATH ?= $(ROOT)/Foundation_Platformpkg/models/Linux64_GCC-9.3 -FVP_BIN ?= Foundation_Platform -FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb -endif ifeq ($(wildcard $(FVP_PATH)),) $(error $(FVP_PATH) does not exist) endif @@ -302,39 +295,27 @@ boot-img-clean: run: all $(MAKE) run-only
-ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_ARGS ?= \
-C bp.ve_sysregs.exit_on_shutdown=1 \
-C cache_state_modelled=0 \
-C pctl.startup=0.0.0.0 \
-C cluster0.NUM_CORES=4 \
-C cluster1.NUM_CORES=4 \
-C cluster0.cpu0.enable_crc32=1 \
-C cluster0.cpu1.enable_crc32=1 \
-C cluster0.cpu2.enable_crc32=1 \
-C cluster0.cpu3.enable_crc32=1 \
-C cluster1.cpu0.enable_crc32=1 \
-C cluster1.cpu1.enable_crc32=1 \
-C cluster1.cpu2.enable_crc32=1 \
-C cluster1.cpu3.enable_crc32=1 \
-C bp.secure_memory=1 \
-C
bp.secureflashloader.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin \
-C
bp.flashloader0.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin \
-C bp.virtioblockdevice.image_path=$(BOOT_IMG)
-ifeq ($(FVP_VIRTFS_ENABLE),y)
FVP_ARGS += -C bp.virtiop9device.root_path=$(FVP_VIRTFS_HOST_DIR)
-endif -else FVP_ARGS ?= \
--arm-v8.0 \
--cores=4 \
--secure-memory \
--visualization \
--gicv3 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin"@0x0 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin"@0x8000000 \
--block-device=$(BOOT_IMG)
-endif
--data
Morello_Top.css.scp.armcortexm7ct=../fvp-firmware/scp_romfw.bin@0x0 \
--data
Morello_Top.css.mcp.armcortexm7ct=../fvp-firmware/mcp_romfw.bin@0x0 \
-C
Morello_Top.soc.scp_qspi_loader.fname=../fvp-firmware/scp_fw.bin \
-C
Morello_Top.soc.mcp_qspi_loader.fname=../fvp-firmware/mcp_fw.bin \
-C css.scp.armcortexm7ct.INITVTOR=0x0 \
-C css.mcp.armcortexm7ct.INITVTOR=0x0 \
-C css.trustedBootROMloader.fname=../fvp-firmware/bl1.bin \
-C board.ap_qspi_loader.fname=../fvp-firmware/fip.bin \
-C board.virtioblockdevice.image_path=$(BOOT_IMG) \
-C css.pl011_uart_ap.unbuffered_output=1 \
-C displayController=1 \
-C board.virtio_rng.enabled=1 \
-C board.virtio_rng.seed=0 \
-C num_clusters=2 \
-C num_cores=2 \
-C board.virtio_net.hostbridge.userNetworking=1 \
-C board.virtio_net.enabled=1 \
-C board.virtio_net.transport=legacy \
-C board.virtio_net.hostbridge.userNetPorts=5555=5555
run-only: $(FVP_PATH)/$(FVP_BIN) $(FVP_ARGS) $(FVP_EXTRA_ARGS)
--->8---
After this step is complete you should be able to start the model and see the optee image booting issuing the command "make run-only" from <optee-project>/build.
It will fail because you do not have the correct kernel and the correct device tree.
To install the correct kernel and device tree you need to mount the "boot-fat.uefi.img" image as follows:
--->8---
$ cd <optee-project>/out $ mkdir -p mnt $ sudo mount -o loop boot-fat.uefi.img mnt/ $ cd mnt
--->8---
Copy here your OPTEE patched Image and dtb files making sure that they are named "Image" and "fvp.dtb".
Then:
--->8---
$ sync $ sudo umount mnt
--->8---
Go again in <optee-project>/build and issue "make run-only".
At this point the fun begins ^__^.
Let us know how it goes.
Best Regards, Menna
-- Regards, Vincenzo
-- Regards, Vincenzo
I will try this, Thanks Vincenzo. really appreciate your help.
Best Regards, Menna
Hi Vincenzo,
On Tue, 11 Jul 2023 at 20:16, Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 16:50, Menna Mahmoud wrote:
Hi Vincenzo,
On Tue, 11 Jul 2023 at 6:27 PM Vincenzo Frascino <
vincenzo.frascino@arm.com>
wrote:
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps :
https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
),
but when run into the kernel after building it, I don’t how to test
optee ,
I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any
result
also when set CONFIG_OPTEE=m instead of =y and tried to load optee
module
got no found. also use ‘xtest’ command to test optee got this command
not
found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I
am
missing is why you are trying to do that. Could you please explain?
yes understood, I am Outreachy intern working on Morello kernel project, and part of my tasks is enabling optee and test it.
We never tried OPTEE on Morello FVP hence it might not work at all, but if you want to experiment with it, I suggest to start from [1].
[1]
https://optee.readthedocs.io/en/latest/building/gits/build.html#get-and-buil...
In particular:
--->8---
$ mkdir -p <optee-project> $ cd <optee-project> $ repo init -u https://github.com/OP-TEE/manifest.git -m fvp.xml $ repo sync -j4 --no-clone-bundle
$ cd <optee-project>/build $ make -j2 toolchains
$ make -j `nproc`
--->8---
Then install the morello FVP as per [2].
[2] https://linux.morello-project.org/docs/intro/
In particular:
--->8---
$ mkdir -p <optee-project>/morello $ cd <optee-project>/morello $ wget -O FVP_Morello_0.11_34.tgz
https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/... $ tar -xzvf FVP_Morello_0.11_34.tgz $ ./FVP_Morello.sh --force --destination ./FVP_Morello ...
Please answer with one of: 'yes' or 'no/quit' Do you agree to the above terms and conditions? yes
--->8---
Then clone the relevant firmware for the board in <optee-project>:
--->8---
$ cd <optee-project> $ git clone https://git.morello-project.org/morello/fvp-firmware.git
--->8---
Then patch the <optee-project>/build/Makefile as follows:
--->8---
diff --git a/fvp.mk b/fvp.mk index 2f1f658caaad..78f9193903be 100644 --- a/fvp.mk +++ b/fvp.mk @@ -52,16 +52,9 @@ else EDK2_BUILD ?= RELEASE endif EDK2_BIN ?=
$(EDK2_PLATFORMS_PATH)/Build/ArmVExpress-FVP-AArch64/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/FVP_$(EDK2_ARCH)_EFI.fd -FVP_USE_BASE_PLAT ?= n -ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_PATH ?= $(ROOT)/Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 -FVP_BIN ?= FVP_Base_RevC-2xAEMvA +FVP_PATH ?= $(ROOT)/morello/FVP_Morello/models/Linux64_GCC-6.4/ +FVP_BIN ?= FVP_Morello FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/fvp-base-revc.dtb -else -FVP_PATH ?= $(ROOT)/Foundation_Platformpkg/models/Linux64_GCC-9.3 -FVP_BIN ?= Foundation_Platform -FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb -endif ifeq ($(wildcard $(FVP_PATH)),) $(error $(FVP_PATH) does not exist) endif @@ -302,39 +295,27 @@ boot-img-clean: run: all $(MAKE) run-only
-ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_ARGS ?= \
-C bp.ve_sysregs.exit_on_shutdown=1 \
-C cache_state_modelled=0 \
-C pctl.startup=0.0.0.0 \
-C cluster0.NUM_CORES=4 \
-C cluster1.NUM_CORES=4 \
-C cluster0.cpu0.enable_crc32=1 \
-C cluster0.cpu1.enable_crc32=1 \
-C cluster0.cpu2.enable_crc32=1 \
-C cluster0.cpu3.enable_crc32=1 \
-C cluster1.cpu0.enable_crc32=1 \
-C cluster1.cpu1.enable_crc32=1 \
-C cluster1.cpu2.enable_crc32=1 \
-C cluster1.cpu3.enable_crc32=1 \
-C bp.secure_memory=1 \
-C
bp.secureflashloader.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin \
-C
bp.flashloader0.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin \
-C bp.virtioblockdevice.image_path=$(BOOT_IMG)
-ifeq ($(FVP_VIRTFS_ENABLE),y)
FVP_ARGS += -C bp.virtiop9device.root_path=$(FVP_VIRTFS_HOST_DIR)
-endif -else FVP_ARGS ?= \
--arm-v8.0 \
--cores=4 \
--secure-memory \
--visualization \
--gicv3 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin"@0x0 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin"@0x8000000 \
--block-device=$(BOOT_IMG)
-endif
--data
Morello_Top.css.scp.armcortexm7ct=../fvp-firmware/scp_romfw.bin@0x0 \
--data
Morello_Top.css.mcp.armcortexm7ct=../fvp-firmware/mcp_romfw.bin@0x0 \
-C
Morello_Top.soc.scp_qspi_loader.fname=../fvp-firmware/scp_fw.bin \
-C
Morello_Top.soc.mcp_qspi_loader.fname=../fvp-firmware/mcp_fw.bin \
-C css.scp.armcortexm7ct.INITVTOR=0x0 \
-C css.mcp.armcortexm7ct.INITVTOR=0x0 \
-C css.trustedBootROMloader.fname=../fvp-firmware/bl1.bin \
-C board.ap_qspi_loader.fname=../fvp-firmware/fip.bin \
-C board.virtioblockdevice.image_path=$(BOOT_IMG) \
-C css.pl011_uart_ap.unbuffered_output=1 \
-C displayController=1 \
-C board.virtio_rng.enabled=1 \
-C board.virtio_rng.seed=0 \
-C num_clusters=2 \
-C num_cores=2 \
-C board.virtio_net.hostbridge.userNetworking=1 \
-C board.virtio_net.enabled=1 \
-C board.virtio_net.transport=legacy \
-C board.virtio_net.hostbridge.userNetPorts=5555=5555
run-only: $(FVP_PATH)/$(FVP_BIN) $(FVP_ARGS) $(FVP_EXTRA_ARGS)
--->8---
After this step is complete you should be able to start the model and see the optee image booting issuing the command "make run-only" from <optee-project>/build.
It will fail because you do not have the correct kernel and the correct device tree.
To install the correct kernel and device tree you need to mount the "boot-fat.uefi.img" image as follows:
--->8---
$ cd <optee-project>/out $ mkdir -p mnt $ sudo mount -o loop boot-fat.uefi.img mnt/ $ cd mnt
--->8---
Copy here your OPTEE patched Image and dtb files making sure that they are named "Image" and "fvp.dtb".
Should I copy "Image" and "fvp.dtb" ? and where?
I copied them to <optee-project>/out, Is it right?
Then:
--->8---
$ sync $ sudo umount mnt
--->8---
Go again in <optee-project>/build and issue "make run-only".
after this, it ran with Morello but was stuck at the point, I couldn't copy it. Could you please check the attached screenshots?
The last thing I followed these steps: https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
and want to run morello kernel instead of fvp_firmware, Should I change anything in fvp.mk file? and then building the OPTEE with this command: `make mrproper && make morello_transitional_pcuabi_defconfig && make ` instead of this ` make -j `nproc` `?
when I try to do that I got errors, So please guide me.
Thanks in advance, Menna
At this point the fun begins ^__^.
Let us know how it goes.
Best Regards, Menna
-- Regards, Vincenzo
-- Regards, Vincenzo
Hi Vincenzo,
On Tue, 11 Jul 2023 at 20:16, Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 16:50, Menna Mahmoud wrote:
Hi Vincenzo,
On Tue, 11 Jul 2023 at 6:27 PM Vincenzo Frascino <
vincenzo.frascino@arm.com>
wrote:
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps :
https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
),
but when run into the kernel after building it, I don’t how to test
optee ,
I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any
result
also when set CONFIG_OPTEE=m instead of =y and tried to load optee
module
got no found. also use ‘xtest’ command to test optee got this command
not
found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I
am
missing is why you are trying to do that. Could you please explain?
yes understood, I am Outreachy intern working on Morello kernel project, and part of my tasks is enabling optee and test it.
We never tried OPTEE on Morello FVP hence it might not work at all, but if you want to experiment with it, I suggest to start from [1].
[1]
https://optee.readthedocs.io/en/latest/building/gits/build.html#get-and-buil...
In particular:
--->8---
$ mkdir -p <optee-project> $ cd <optee-project> $ repo init -u https://github.com/OP-TEE/manifest.git -m fvp.xml $ repo sync -j4 --no-clone-bundle
$ cd <optee-project>/build $ make -j2 toolchains
$ make -j `nproc`
--->8---
Then install the morello FVP as per [2].
[2] https://linux.morello-project.org/docs/intro/
In particular:
--->8---
$ mkdir -p <optee-project>/morello $ cd <optee-project>/morello $ wget -O FVP_Morello_0.11_34.tgz
https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/... $ tar -xzvf FVP_Morello_0.11_34.tgz $ ./FVP_Morello.sh --force --destination ./FVP_Morello ...
Please answer with one of: 'yes' or 'no/quit' Do you agree to the above terms and conditions? yes
--->8---
Then clone the relevant firmware for the board in <optee-project>:
--->8---
$ cd <optee-project> $ git clone https://git.morello-project.org/morello/fvp-firmware.git
--->8---
Then patch the <optee-project>/build/Makefile as follows:
--->8---
diff --git a/fvp.mk b/fvp.mk index 2f1f658caaad..78f9193903be 100644 --- a/fvp.mk +++ b/fvp.mk @@ -52,16 +52,9 @@ else EDK2_BUILD ?= RELEASE endif EDK2_BIN ?=
$(EDK2_PLATFORMS_PATH)/Build/ArmVExpress-FVP-AArch64/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/FVP_$(EDK2_ARCH)_EFI.fd -FVP_USE_BASE_PLAT ?= n -ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_PATH ?= $(ROOT)/Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 -FVP_BIN ?= FVP_Base_RevC-2xAEMvA +FVP_PATH ?= $(ROOT)/morello/FVP_Morello/models/Linux64_GCC-6.4/ +FVP_BIN ?= FVP_Morello FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/fvp-base-revc.dtb -else -FVP_PATH ?= $(ROOT)/Foundation_Platformpkg/models/Linux64_GCC-9.3 -FVP_BIN ?= Foundation_Platform -FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb -endif ifeq ($(wildcard $(FVP_PATH)),) $(error $(FVP_PATH) does not exist) endif @@ -302,39 +295,27 @@ boot-img-clean: run: all $(MAKE) run-only
-ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_ARGS ?= \
-C bp.ve_sysregs.exit_on_shutdown=1 \
-C cache_state_modelled=0 \
-C pctl.startup=0.0.0.0 \
-C cluster0.NUM_CORES=4 \
-C cluster1.NUM_CORES=4 \
-C cluster0.cpu0.enable_crc32=1 \
-C cluster0.cpu1.enable_crc32=1 \
-C cluster0.cpu2.enable_crc32=1 \
-C cluster0.cpu3.enable_crc32=1 \
-C cluster1.cpu0.enable_crc32=1 \
-C cluster1.cpu1.enable_crc32=1 \
-C cluster1.cpu2.enable_crc32=1 \
-C cluster1.cpu3.enable_crc32=1 \
-C bp.secure_memory=1 \
-C
bp.secureflashloader.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin \
-C
bp.flashloader0.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin \
-C bp.virtioblockdevice.image_path=$(BOOT_IMG)
-ifeq ($(FVP_VIRTFS_ENABLE),y)
FVP_ARGS += -C bp.virtiop9device.root_path=$(FVP_VIRTFS_HOST_DIR)
-endif -else FVP_ARGS ?= \
--arm-v8.0 \
--cores=4 \
--secure-memory \
--visualization \
--gicv3 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin"@0x0 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin"@0x8000000 \
--block-device=$(BOOT_IMG)
-endif
--data
Morello_Top.css.scp.armcortexm7ct=../fvp-firmware/scp_romfw.bin@0x0 \
--data
Morello_Top.css.mcp.armcortexm7ct=../fvp-firmware/mcp_romfw.bin@0x0 \
-C
Morello_Top.soc.scp_qspi_loader.fname=../fvp-firmware/scp_fw.bin \
-C
Morello_Top.soc.mcp_qspi_loader.fname=../fvp-firmware/mcp_fw.bin \
-C css.scp.armcortexm7ct.INITVTOR=0x0 \
-C css.mcp.armcortexm7ct.INITVTOR=0x0 \
-C css.trustedBootROMloader.fname=../fvp-firmware/bl1.bin \
-C board.ap_qspi_loader.fname=../fvp-firmware/fip.bin \
-C board.virtioblockdevice.image_path=$(BOOT_IMG) \
-C css.pl011_uart_ap.unbuffered_output=1 \
-C displayController=1 \
-C board.virtio_rng.enabled=1 \
-C board.virtio_rng.seed=0 \
-C num_clusters=2 \
-C num_cores=2 \
-C board.virtio_net.hostbridge.userNetworking=1 \
-C board.virtio_net.enabled=1 \
-C board.virtio_net.transport=legacy \
-C board.virtio_net.hostbridge.userNetPorts=5555=5555
run-only: $(FVP_PATH)/$(FVP_BIN) $(FVP_ARGS) $(FVP_EXTRA_ARGS)
--->8---
After this step is complete you should be able to start the model and see the optee image booting issuing the command "make run-only" from <optee-project>/build.
It will fail because you do not have the correct kernel and the correct device tree.
To install the correct kernel and device tree you need to mount the "boot-fat.uefi.img" image as follows:
--->8---
$ cd <optee-project>/out $ mkdir -p mnt $ sudo mount -o loop boot-fat.uefi.img mnt/ $ cd mnt
--->8---
Copy here your OPTEE patched Image and dtb files making sure that they are named "Image" and "fvp.dtb".
Then:
Should I copy "Image" and "fvp.dtb" ? and where? I copied them to <optee-project>/out, Is it right?
--->8---
$ sync $ sudo umount mnt
--->8---
Go again in <optee-project>/build and issue "make run-only".
after this, it ran with Morello but was stuck at the point, I couldn't copy it. Could you please check this screenshot: https://paste.pics/ORMO6
The last thing I followed these steps: https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
and want to run morello kernel instead of fvp_firmware, Should I change anything in fvp.mk file? and then building the OPTEE with this command: `make mrproper && make morello_transitional_pcuabi_defconfig && make ` instead of this ` make -j `nproc` `?
At this point the fun begins ^__^.
Let us know how it goes.
Best Regards, Menna
-- Regards, Vincenzo
-- Regards, Vincenzo
Hi Vincenzo,
please Ignore previous emails, and check this.
On Tue, 11 Jul 2023 at 20:16, Vincenzo Frascino vincenzo.frascino@arm.com wrote:
Hi Menna,
On 11/07/2023 16:50, Menna Mahmoud wrote:
Hi Vincenzo,
On Tue, 11 Jul 2023 at 6:27 PM Vincenzo Frascino <
vincenzo.frascino@arm.com>
wrote:
Hi Menna,
On 11/07/2023 16:23, Menna Mahmoud wrote:
Are you mean explain the problem in details ? if so, I enabled CONFIG_TEE and CONFIG_OPTEE in morello_transitional_pcuabi_defconfig file ( this by using morello-sdk, here you are detailed steps :
https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
),
but when run into the kernel after building it, I don’t how to test
optee ,
I used ‘dmesg’ and ‘lsmod’ to check if it loaded but didn’t get any
result
also when set CONFIG_OPTEE=m instead of =y and tried to load optee
module
got no found. also use ‘xtest’ command to test optee got this command
not
found. Are you have any idea about how to check optee?
I think I understand what you are doing and what is going wrong. What I
am
missing is why you are trying to do that. Could you please explain?
yes understood, I am Outreachy intern working on Morello kernel project, and part of my tasks is enabling optee and test it.
We never tried OPTEE on Morello FVP hence it might not work at all, but if you want to experiment with it, I suggest to start from [1].
[1]
https://optee.readthedocs.io/en/latest/building/gits/build.html#get-and-buil...
In particular:
--->8---
$ mkdir -p <optee-project> $ cd <optee-project> $ repo init -u https://github.com/OP-TEE/manifest.git -m fvp.xml $ repo sync -j4 --no-clone-bundle
$ cd <optee-project>/build $ make -j2 toolchains
$ make -j `nproc`
--->8---
Then install the morello FVP as per [2].
[2] https://linux.morello-project.org/docs/intro/
In particular:
--->8---
$ mkdir -p <optee-project>/morello $ cd <optee-project>/morello $ wget -O FVP_Morello_0.11_34.tgz
https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/... $ tar -xzvf FVP_Morello_0.11_34.tgz $ ./FVP_Morello.sh --force --destination ./FVP_Morello ...
Please answer with one of: 'yes' or 'no/quit' Do you agree to the above terms and conditions? yes
--->8---
Then clone the relevant firmware for the board in <optee-project>:
--->8---
$ cd <optee-project> $ git clone https://git.morello-project.org/morello/fvp-firmware.git
--->8---
Then patch the <optee-project>/build/Makefile as follows:
--->8---
diff --git a/fvp.mk b/fvp.mk index 2f1f658caaad..78f9193903be 100644 --- a/fvp.mk +++ b/fvp.mk @@ -52,16 +52,9 @@ else EDK2_BUILD ?= RELEASE endif EDK2_BIN ?=
$(EDK2_PLATFORMS_PATH)/Build/ArmVExpress-FVP-AArch64/$(EDK2_BUILD)_$(EDK2_TOOLCHAIN)/FV/FVP_$(EDK2_ARCH)_EFI.fd -FVP_USE_BASE_PLAT ?= n -ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_PATH ?= $(ROOT)/Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 -FVP_BIN ?= FVP_Base_RevC-2xAEMvA +FVP_PATH ?= $(ROOT)/morello/FVP_Morello/models/Linux64_GCC-6.4/ +FVP_BIN ?= FVP_Morello FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/fvp-base-revc.dtb -else -FVP_PATH ?= $(ROOT)/Foundation_Platformpkg/models/Linux64_GCC-9.3 -FVP_BIN ?= Foundation_Platform -FVP_LINUX_DTB ?= $(LINUX_PATH)/arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb -endif ifeq ($(wildcard $(FVP_PATH)),) $(error $(FVP_PATH) does not exist) endif @@ -302,39 +295,27 @@ boot-img-clean: run: all $(MAKE) run-only
-ifeq ($(FVP_USE_BASE_PLAT),y) -FVP_ARGS ?= \
-C bp.ve_sysregs.exit_on_shutdown=1 \
-C cache_state_modelled=0 \
-C pctl.startup=0.0.0.0 \
-C cluster0.NUM_CORES=4 \
-C cluster1.NUM_CORES=4 \
-C cluster0.cpu0.enable_crc32=1 \
-C cluster0.cpu1.enable_crc32=1 \
-C cluster0.cpu2.enable_crc32=1 \
-C cluster0.cpu3.enable_crc32=1 \
-C cluster1.cpu0.enable_crc32=1 \
-C cluster1.cpu1.enable_crc32=1 \
-C cluster1.cpu2.enable_crc32=1 \
-C cluster1.cpu3.enable_crc32=1 \
-C bp.secure_memory=1 \
-C
bp.secureflashloader.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin \
-C
bp.flashloader0.fname=$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin \
-C bp.virtioblockdevice.image_path=$(BOOT_IMG)
-ifeq ($(FVP_VIRTFS_ENABLE),y)
FVP_ARGS += -C bp.virtiop9device.root_path=$(FVP_VIRTFS_HOST_DIR)
-endif -else FVP_ARGS ?= \
--arm-v8.0 \
--cores=4 \
--secure-memory \
--visualization \
--gicv3 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/bl1.bin"@0x0 \
--data="$(TF_A_PATH)/build/fvp/$(TF_A_BUILD)/fip.bin"@0x8000000 \
--block-device=$(BOOT_IMG)
-endif
--data
Morello_Top.css.scp.armcortexm7ct=../fvp-firmware/scp_romfw.bin@0x0 \
--data
Morello_Top.css.mcp.armcortexm7ct=../fvp-firmware/mcp_romfw.bin@0x0 \
-C
Morello_Top.soc.scp_qspi_loader.fname=../fvp-firmware/scp_fw.bin \
-C
Morello_Top.soc.mcp_qspi_loader.fname=../fvp-firmware/mcp_fw.bin \
-C css.scp.armcortexm7ct.INITVTOR=0x0 \
-C css.mcp.armcortexm7ct.INITVTOR=0x0 \
-C css.trustedBootROMloader.fname=../fvp-firmware/bl1.bin \
-C board.ap_qspi_loader.fname=../fvp-firmware/fip.bin \
-C board.virtioblockdevice.image_path=$(BOOT_IMG) \
-C css.pl011_uart_ap.unbuffered_output=1 \
-C displayController=1 \
-C board.virtio_rng.enabled=1 \
-C board.virtio_rng.seed=0 \
-C num_clusters=2 \
-C num_cores=2 \
-C board.virtio_net.hostbridge.userNetworking=1 \
-C board.virtio_net.enabled=1 \
-C board.virtio_net.transport=legacy \
-C board.virtio_net.hostbridge.userNetPorts=5555=5555
run-only: $(FVP_PATH)/$(FVP_BIN) $(FVP_ARGS) $(FVP_EXTRA_ARGS)
--->8---
After this step is complete you should be able to start the model and see the optee image booting issuing the command "make run-only" from <optee-project>/build.
It will fail because you do not have the correct kernel and the correct device tree.
To install the correct kernel and device tree you need to mount the "boot-fat.uefi.img" image as follows:
--->8---
$ cd <optee-project>/out $ mkdir -p mnt $ sudo mount -o loop boot-fat.uefi.img mnt/ $ cd mnt
--->8---
Copy here your OPTEE patched Image and dtb files making sure that they are named "Image" and "fvp.dtb".
Should I copy "Image" and "fvp.dtb" ? and where? I copied them to <optee-project>/out, Is it right?
Then:
--->8---
$ sync $ sudo umount mnt
--->8---
Go again in <optee-project>/build and issue "make run-only".
after this, it ran with Morello but was stuck at the point, I couldn't copy it. Could you please check this screenshot: https://paste.pics/ORMO6
The last thing I followed these steps: https://github.com/engMennaMahmoud/Morello-Kernel-Project/wiki/How-to-run-sp...
and want to run morello kernel instead of fvp_firmware, Should I change anything in fvp.mk file? and then building the OPTEE with this command: `make mrproper && make morello_transitional_pcuabi_defconfig && make ` instead of this ` make -j `nproc` `?
At this point the fun begins ^__^.
Let us know how it goes.
Best Regards, Menna
-- Regards, Vincenzo
-- Regards, Vincenzo
Hi Menna,
On 7/12/23 13:39, Menna Mahmoud wrote:
To install the correct kernel and device tree you need to mount the "boot-fat.uefi.img" image as follows:
--->8---
$ cd <optee-project>/out $ mkdir -p mnt $ sudo mount -o loop boot-fat.uefi.img mnt/ $ cd mnt
--->8---
Copy here your OPTEE patched Image and dtb files making sure that they are named "Image" and "fvp.dtb".
Should I copy "Image" and "fvp.dtb" ? and where? I copied them to <optee-project>/out, Is it right?
You need to mount the "boot-fat.uefi.img" as per instructions above and copy your kernel and fvp dtb inside it.
Let us know.
linux-morello@op-lists.linaro.org