Upstream ATF Support

I am trying to use upstream atf on the p3518 devkit. But it just causes boot hangs. The same atf build works on p2972, the agx xavier devkit. I have a short reproduction sequence.

  1. Set up a L4T r32.6.1 t194 bsp.
  2. Flash the qspi using ./ jetson-xavier-nx-devkit-qspi mmcblk0p1. See it completes properly.
  3. Build atf, tag v2.6 was used for this experiment, but master has the same results.
  4. Package it into a tos image using python2 nv_tegra/tos-scripts/ --monitor=/path/to/bl31.bin bootloader/tos-mon-only_t194-upstream.img
  5. Change tos symlink using ln -sf tos-mon-only_t194-upstream.img bootloader/tos_t194.img
  6. Re-run flash using ./ jetson-xavier-nx-devkit-qspi mmcblk0p1. Note that this hangs.

The host log gets to:

[   6.3018 ] Sending bootloader and pre-requisite binaries
[   6.3031 ] tegrarcm_v2 --download blob blob.bin
[   6.3033 ] Applet version 01.00.0000
[   7.3496 ] Sending blob
[   7.3497 ] [................................................] 100%
[   8.1037 ]
[   8.1053 ] tegrarcm_v2 --boot recovery
[   8.1056 ] Applet version 01.00.0000
[   9.1095 ]
[  10.1122 ] tegrarcm_v2 --isapplet

The device log contains:

��ASSERT: plat/nvidia/tegra/soc/t194/plat_ras.c:160:read_erxctlr_el1() == err_ctrl

The same build of atf works on the agx xavier devkits. I can also build upstream atf for t210 and t186 and those work on all consumer jetson devkits, including p3509+p3636. It would be good to fix upstream to also support p3518. I tried to look at the nvidia source release of atf, but with no git commit history, it is nigh impossible to compare back to upstream 1.3 and apply to upstream 2.6 or master.

hello Steel01,

just want to figure out your complete steps,
did you download the public release sources, (i.e. L4T Driver Package (BSP) Sources) to build the ATF source code, and using the bl31.bin ATF image for generating the tos.img ?
or, may I know where did you download (or, commands for syncing to upstream) the resources.

this flash options, jetson-xavier-nx-devkit-qspi, it’s only updating the QSPI.
the actual flash commands for Xavier NX DevKit is, jetson-xavier-nx-devkit.

Upstream atf can be synced from the github mirror by:
git clone
The tag most recent official tag/release can then be checked out in the working directory by:
git checkout v2.6
And I’m building with the command (using the toolchain provided by my distro):
CROSS_COMPILE=aarch64-linux-gnu- make -j33 PLAT=tegra TARGET_SOC=t194 bl31

Tegra support in upstream atf is handled by Varun Wadekar, or at least he’s the one with an email that pushes the commits and communicates on the gerrit instance.

And yes, I understand the qspi target only updates the qspi. I’m just trying to give the shortest reproduction steps I can.

hello Steel01,

could you please update the build commands to create the image file for testing again,
please refer below for an example,

                "${MAKE_BIN}" -C "${source_dir}" \
                        BUILD_BASE="./${NV_TARGET_BOARD}-${target_soc}" \
                        CROSS_COMPILE="${CROSS_COMPILE_AARCH64}"  \
                        TARGET_SOC="${target_soc}" \
                        DEBUG=0 LOG_LEVEL=20 PLAT=tegra SPD=trusty V=0 \
                        -j"${NPROC}" --output-sync=target


The only operable difference in that build command is the secure dispatcher type, everything else is the default setting or build time cosmetics. I need to be able to run without trusty. But I ran a build using:

make DEBUG=0 LOG_LEVEL=20 V=0 CROSS_COMPILE=aarch64-linux-gnu- -j33 PLAT=tegra TARGET_SOC=t194 SPD=trusty --output-sync=target

Then packaged a self-built trusty bin into a tos image, dropped it into the l4t 32.6.1 bsp, and changed the symlink as appropriate. The xavier nx devkit still fails as above, assert on read_erxctlr_el1. And the agx xavier devkit still works as intended.

Was this tested internally? Does an upstream atf build work on p3518 there?

hello Steel01,

we were arrange resources to check this,
however, we’ve reproduce the issue on both AGX Xavier and Xavier NX.

FYI, there’s fix check-in to remove the asset the flash and boot to kernel goes through fine.
the upstreamed ATF should correct the failure. thanks

I do not understand the English in that post. But I did look at the upstream gerrit and do see a pending commit to fix the issue. Thank you. I will cherry-pick that into my project.

I have cherry-picked the commit and verified that it does allow flashing and boot to kernel on the Xavier NX.

thanks for confirmation, we may close this thread.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.