This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] TDA4VM: PSDK QNX : Modifying ARM SCR_EL3 EA Bit

Guru* 94161 points
Part Number: TDA4VM

How can SPL / SBL boot images used with TI SDK QNX releases be modified to control the SCR_EL3 EA bit?

  • Overview:

    For SBL boot flow, the TI Processor QNX SDK (as of SDK 7.3) has set the ARM SCR_EL3 EA Bit to a value of 0.   The ARM SCR_EL3 EA bit can be modified for SBL boot flow as described in TI SDK QNX release documentation.

    The SPL boot flow will by default have the ARM SCR_EL3, EA bit set high.   When SPL boot flow is being used on QNX,  for debugging purposes or for drivers which require generation of a SIGBUS on QNX, the ARM SCRL_EL3 EA Bit can be set low.

    To control SCR_EL3 EA bit for SBL Bootflow

    Reference SDK release documentation for steps on modifying the ARM SCR_EL3 EA bit.  Below link is for SDK 7.3.

    8.3. How To Handle Exceptions At Current Exception Level — Processor SDK QNX J721E

    To control SCR_EL3 EA bit for SPL Bootflow (uboot)

    Release documentation will be updated to include similar content as below.

    For the SPL boot flow, the Uboot tispl.bin binary needs to be rebuilt with an update Arm Trusted Firmware (ATF).  The steps to build the Uboot + ATF binary are below:

    1) Download and install the Linux SDK for which uboot binary is desired. For example, the link to SDK 7.3  release is (PROCESSOR-SDK-LINUX-J721E_07.03.00.05 | TI.com)

     

    2) Set environment variables in the build window, which will be required for building in the following steps:

    • export PSDKLA_PATH=<PATH to PSDK Linux Installation>
    • export CROSS_COMPILE=${PSDKLA_PATH}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-none-linux-gnu-

    3)  Modify the arm-trusted-firmware to be built with SCR_EL3, EA bit set to 0

    Edit this file as below: ${PSDKLA_PATH}/board-support/trusted-firmware-a-2.4/plat/ti/k3/common/plat_common.mk

    • Modify: HANDLE_EA_EL3_FIRST := 1
    • To: HANDLE_EA_EL3_FIRST :0

     4) Rebuild the Arm Trusted Firmware with these new settings, to generate an updated bl31.bin

    • export CROSS_COMPILE=${PSDKRA_PATH}/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu//bin/aarch64-none-linux-gnu-
      export GCC_LINUX_ARM_ROOT=${PSDKRA_PATH}/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/
    • cd ${PSDKLA_PATH}/board-support/trusted-firmware-a-2.4
    • make -s -j32 PLAT=k3 TARGET_BOARD=generic SPD=opteed

     5) Backup the old bl31.bin and overwrite with the newly generated image.

    • cd ${PSDKLA_PATH},
    • cp ./board-support/prebuilt-images/bl31.bin ./board-support/prebuilt-images/bl31.bin.prebuilt
    • cp ./board-support/trusted-firmware-a-2.4/build/k3/generic/release/bl31.bin ./board-support/prebuilt-images/bl31.bin

     6) Rebuild uboot as below, which will pull in the updated bl31.bin, and generate a tispl.bin

    • cd ${PSDKLA_PATH}
    • make u-boot_clean; make u-boot

     7) Copy the ${PSDKLA_PATH}/ board-support/u-boot_build/a72/tispl.bin, to the boot media. If using SD boot, this would be the root directory of the SD card.

     

    Example Test:  Read an address for a module that is not enabled, for example 0x28000000

    With tispl.bin with EA bit set 0:

    With tispl.bin with EA bit set to 1: