Skip to content
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

OP-TEE build does not continue after OpenSBI #25

Closed
swidi opened this issue Apr 29, 2024 · 5 comments
Closed

OP-TEE build does not continue after OpenSBI #25

swidi opened this issue Apr 29, 2024 · 5 comments

Comments

@swidi
Copy link

swidi commented Apr 29, 2024

Hello,

I am currently working on a research project that involves OP-TEE on RISC-V. Your project would serve as a great starting point, however I cannot get it to run.

I have used your docker image: sudo docker run -it nucleisoftware/linuxsdk:optee

And then followed the advice here: https://hub.docker.com/r/nucleisoftware/linuxsdk

# cd linux sdk workspace
cd nuclei-linux-sdk
# see commit log of last one
git log -1
# fetch latest commits if needs
git fetch
# pull latest changes if needs
git pull 
# do submodule updates 
git submodule update
# build project just follow https://github.com/Nuclei-Software/nuclei-linux-sdk#show-help in each branch
# run qemu for SOC=evalsoc CORE=ux900fd
make run_qemu

Unfortunately, the boot process never continues after OpenSBI:

[...]
/home/nuclei/nuclei-linux-sdk/work/demosoc/buildroot_initramfs/host/bin/riscv-nuclei-linux-gnu-objcopy /home/nuclei/nuclei-linux-sdk/work/demosoc/freeloader/freeloader.elf -O binary /home/nuclei/nuclei-linux-sdk/work/demosoc/freeloader/freeloader.bin
/home/nuclei/nuclei-linux-sdk/work/demosoc/buildroot_initramfs/host/bin/riscv-nuclei-linux-gnu-objdump -d /home/nuclei/nuclei-linux-sdk/work/demosoc/freeloader/freeloader.elf > /home/nuclei/nuclei-linux-sdk/work/demosoc/freeloader/freeloader.dasm
make[1]: Leaving directory '/home/nuclei/nuclei-linux-sdk/freeloader'
Run on qemu for simulation
qemu-system-riscv64 -M nuclei_u,download=flashxip -smp 8 -m 256M -cpu nuclei-ux600,ext= -bios /home/nuclei/nuclei-linux-sdk/work/demosoc/freeloader/freeloader.elf -nographic -drive file=/home/nuclei/nuclei-linux-sdk/work/demosoc/disk.img,if=sd,format=raw

OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : Nuclei Demo SoC
Platform Features         : timer,mfdeleg
Platform HART Count       : 8
Firmware Base             : 0xa0000000
Firmware Size             : 184 KB
Runtime SBI Version       : 0.2

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*
Domain0 Region00          : 0x00000000a0000000-0x00000000a003ffff ()
Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x00000000a0200000
Domain0 Next Arg1         : 0x00000000a8000000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsu
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count      : 0
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109
~ stop ~

Since I believe I have followed every step as indicated, could it be that the docker image is no longer compatible with the latest commits? Or any other idea that could point me in the right direction? Thanks!

@fanghuaqi
Copy link
Member

Hi @swidi , see #8 we have mentioned which branch has enabled docker support. please follow this https://github.com/Nuclei-Software/nuclei-linux-sdk/blob/feature/optee_5.10/optee/README_en.md to run it.

  • Make sure you are on the right branch: feature/optee_5.10 and have the latest commit and submodule update even you are in the docker environment
  • Make sure you are using a expected qemu 8.0 2024.02, downloaded from https://nucleisys.com/download.php
  • For run on evalsoc, you need to pass make SOC=evalsoc CORE=ux900fd run_qemu not make run_qemu

@fanghuaqi
Copy link
Member

There is also a quick guide here #13 attached with run log

@fanghuaqi
Copy link
Member

For your case, I think this is wrong

# build project just follow https://github.com/Nuclei-Software/nuclei-linux-sdk#show-help in each branch
# run qemu for SOC=evalsoc CORE=ux900fd
make run_qemu # wrong
make SOC=evalsoc CORE=ux900fd run_qemu # correct

@fanghuaqi
Copy link
Member

Other people already repeat it, see #16

@swidi
Copy link
Author

swidi commented Apr 30, 2024

Wonderful. make SOC=evalsoc CORE=ux900fd run_qemu # correct was indeed the solution. Thank you!

@swidi swidi closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants