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-specific-Morello-kernel-image-on-FVP
>> ),
>>> 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-build-the-solution
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/FVP/Morello%20Platform/FVP_Morello_0.11_34.tgz?rev=5f34837ae6c14ede8493dfc24c9af397&hash=862883120C5638E0B3C5ACA6FDDC5558021E1886
$ 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
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