OP-TEE setup questions for the atf_and_optee_README.txt

hello andib,

you should also extract both atf_src.tbz2 and nvidia-jetson-optee-source.tbz2 source package,
in practical, these two should be located together, for instance, I’ll create atf_and_optee/ folder, and extract both of them into the same folder.

please note that you’ve to setup the CROSS_COMPILE Environment Variable
$ export CROSS_COMPILE_AARCH64_PATH=/home/jerry/L4T/l4t-gcc/aarch64--glibc--stable-2022.08-1
$ export CROSS_COMPILE_AARCH64=/home/jerry/L4T/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
$ export CROSS_COMPILE=/home/jerry/L4T/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
$ export UEFI_STMM_PATH=$OUT/JP_6/Linux_for_Tegra/bootloader/standalonemm_optee_t234.bin
$ export NV_TARGET_BOARD=t234

you’ve running nv_public_src_build.sh and then nv_public_src_build_tos.sh .
for building all source tarballs, including the atf_src.tbz2 , you should run the nv_public_src_build.sh script.

BTW,
if you’re seeing an error when running nv_public_src_build_tos.sh.
that’s due to the cryptography python package in your build system is too old.
re-cap as below…

".../optee/build/t234/export-ta_arm64/scripts/sign_encrypt.py", line 562, in parse
    self.subkey_key = rsa.RSAPublicNumbers(e, n).public_key()
TypeError: public_key() missing 1 required positional argument: 'backend'

you should running the following commands to resolve the build failure.
$ sudo apt remove python3-cryptography
$ pip3 install cryptography

hence,
I’m able to build the r36.3 ATF and OP-TEE sources.
for example,
$ ./nv_public_src_build_tos.sh -p t234 -u $OUT/JP-6/Linux_for_Tegra/bootloader/standalonemm_optee_t234.bin -s $OUT/JP-6/Linux_for_Tegra/nv_tegra/tos-scripts/gen_tos_part_img.py

here’s the output directory src_out has created.
for example,

/source/src_out$ tree -L 1
.
├── atf_src_build
├── img.bin
├── kernel_src_build
├── optee_src_build
└── tos-t234.img