This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PRELOADED_BL33_BASE for Custom Kernel

I am trying to run a custom kernel on the Morello FVP.
It‘s alread working on QEMU. I followed these instructions:
https://git.morello-project.org/morello/docs/-/blob/morello/mainline/common/standalone-baremetal-readme.rst.

No matter what I try though, I just cannot get it to work.
I was redirected from the official CHERI-CPU to here, so I
just post one of the messages that contains more information
about my issue here again:

———

So I am a bit stuck when trying to use PRELOADED_BL33_BASE='0xE0000000' instead of BL33="..test/helloworld when building the test binary and later running it in the FVP. I want to run a binary that I know is at address 0xE0000000 because if this works, I can just place the kernel's bootloader there and call it a day (hopefully). I am building fip with

MBEDTLS_DIR="<morello_workspace>/bsp/deps/mbedtls" \
CROSS_COMPILE="<morello_workspace>/tools/clang/bin/llvm-" \
make -C "bsp/arm-tf" \
CC="<morello_workspace>/tools/clang/bin/clang" \
LD="<morello_workspace>/tools/clang/bin/ld.lld" \
PLAT=morello ARCH=aarch64 TARGET_PLATFORM=fvp ENABLE_MORELLO_CAP=1 \
E=0 TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION="devel_rsa" \
ROT_KEY="plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem" \
PRELOADED_BL33_BASE='0xE0000000' \
OPENSSL_DIR="<morello_workspace>/output/fvp/intermediates/host_openssl/install" \
all fip

and I tried several setups in the FVP but no matter what I did and which options I chose, I could not the the helloworld binary from the example to work on the FVP. It‘s either giving me:

NOTICE: Booting Trusted Firmware
NOTICE: BL1: v2.4(debug):37a5f702b
NOTICE: BL1: Built : 14:51:05, Jan 27 2021
INFO: BL1: RAM 0x4074000 - 0x407f000
INFO: Using crypto library 'mbed TLS'
INFO: Loading image id=6 at address 0x4001010
INFO: Image id=6 loaded: 0x4001010 - 0x40014ce
INFO: Loading image id=31 at address 0x4001010
INFO: Image id=31 loaded: 0x4001010 - 0x400119c
INFO: FCONF: Config file with image ID:31 loaded at address = 0x4001010
INFO: Loading image id=24 at address 0x4001300
INFO: Image id=24 loaded: 0x4001300 - 0x40013e8
INFO: FCONF: Config file with image ID:24 loaded at address = 0x4001300
INFO: BL1: Loading BL2
INFO: Loading image id=1 at address 0x4057000
INFO: Image id=1 loaded: 0x4057000 - 0x4068961
NOTICE: BL1: Booting BL2
INFO: Entry point address = 0x4057000
INFO: SPSR = 0x3c5
NOTICE: BL2: v2.7(release):547e449
NOTICE: BL2: Built : 11:43:47, Jul 18 2023
ERROR: BL2: Failed to load image id 5 (-2)

or it just hands in other configurations. What am I doing wrong? Thank you very much for your help already :)

Parents Reply Children
  • Hi Georg,

    I tried out the PRELOAD_BL33_BASE flag in order to reproduce the error. I was not able to reproduce the exact issue as I am not getting the hang at image id 5(bl33) but instead at image id 27(nt_fw_config). I think the delta probably could be attributed to previous build not getting cleaned properly.

    The error at image id 27 is due to tf-a recursively trying to verify parent images of image id 27 when built with TRUSTED_BOARD_BOOT=1. One of which is image id 11(NON_TRUSTED_FW_KEY_CERT_ID) which when built with PRELOADED_BL33_BASE=1 flag, does not exist.

     

    In the https://git.morello-project.org/morello/docs/-/blob/morello/mainline/common/standalone-baremetal-readme.rst , you can try the following changes in steps to see if it helps

     

    In section 5

    1. rm -rf bsp/arm-tf/build
    2. In the make command set ENABLE_MORELLO_CAP=0 and TRUSTED_BOARD_BOOT=0 and build again.

    In section 6.1

    1.  Use the newly built bl1.bin along with fip.bin by changing the following part of the command.
      -C css.trustedBootROMloader.fname=<morello_workspace>/bsp/arm-tf/build/morello/release/bl1.bin

     

    Note that TRUSTED_BOARD_BOOT=0 would disable image authentication and ENABLE_MORELLO_CAP=0 would disable morello capability so capability aware kernel might not work.

  • Thanks for the insight. I was seeing these Image 27 issues too, couldn't solve them though. Your approach is not of great help though because ENABLE_MORELLO_CAP=0 is not an option for me.. thank you nevertheless.