Skip to content

Commit 72fbc6a

Browse files
committed
fix(build): AM62LX OP-TEE and U-Boot build steps
Building U-Boot with current SDK documentation steps results in missing tee-os blob errors on AM62LX. Include OP-TEE support in U-Boot build steps to resolve this. AM62LX SDK does not include 32-bit ARM toolchain (k3r5-devkit), unlike other K3 platforms. Remove CROSS_COMPILE_32 requirement from OP-TEE build commands and add CFG_USER_TA_TARGETS=ta_arm64 to restrict OP-TEE to build only 64-bit TAs. This resolves "cannot find libgcc.a" errors during OP-TEE build and "missing external blobs" errors during U-Boot build. Also fix indentation for existing code as per guidelines. Signed-off-by: Shiva Tripathi <[email protected]>
1 parent d8d545d commit 72fbc6a

File tree

2 files changed

+40
-14
lines changed

2 files changed

+40
-14
lines changed

source/linux/Foundational_Components/U-Boot/BG-Build-K3.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ Go :ref:`here <download-and-install-sdk>` to download and install the SDK.
447447
$ export UBOOT_DIR=<path-to-ti-u-boot>
448448
$ export TI_LINUX_FW_DIR=<path-to-ti-linux-firmware>
449449
$ export TFA_DIR=<path-to-arm-trusted-firmware>
450+
$ export OPTEE_DIR=<path-to-ti-optee-os>
450451
451452
.. note::
452453

@@ -465,7 +466,8 @@ Go :ref:`here <download-and-install-sdk>` to download and install the SDK.
465466
$ make CROSS_COMPILE="$CROSS_COMPILE_64" \
466467
BL1=$TFA_DIR/build/k3/am62l/release/bl1.bin \
467468
BL31=$TFA_DIR/build/k3/am62l/release/bl31.bin \
468-
BINMAN_INDIRS=$TI_LINUX_FW_DIR
469+
BINMAN_INDIRS=$TI_LINUX_FW_DIR \
470+
TEE=$OPTEE_DIR/out/arm-plat-k3/core/tee-pager_v2.bin
469471
470472
.. ifconfig:: CONFIG_part_variant not in ('AM64X', 'AM62X', 'AM62AX', 'AM62LX')
471473

source/linux/Foundational_Components_OPTEE.rst

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ If it is not possible to use pre-build binary, use the following:
2424

2525
.. code-block:: console
2626
27-
$ git clone https://github.com/OP-TEE/optee_os.git
28-
$ git checkout <hash>
27+
$ git clone https://github.com/OP-TEE/optee_os.git
28+
$ git checkout <hash>
2929
3030
Where <hash> is the OPTEE commit shown in :ref:`release-specific-build-information`.
3131

@@ -43,23 +43,39 @@ Building OP-TEE OS
4343

4444
.. ifconfig:: CONFIG_part_variant in ('J721S2', 'J784S4','J742S2')
4545

46-
.. code-block:: console
46+
.. code-block:: console
4747
48-
$ export CFG_CONSOLE_UART=0x8
48+
$ export CFG_CONSOLE_UART=0x8
4949
5050
Building the OP-TEE image
5151
*************************
5252

53-
.. parsed-literal::
53+
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
54+
55+
.. parsed-literal::
56+
57+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y
58+
59+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
5460

55-
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y
61+
.. parsed-literal::
62+
63+
$ make CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_USER_TA_TARGETS=ta_arm64
5664
5765
Building the OP-TEE image with debug parameters
5866
***********************************************
5967

60-
.. parsed-literal::
68+
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
69+
70+
.. parsed-literal::
71+
72+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_TEE_CORE_LOG_LEVEL=2 CFG_TEE_CORE_DEBUG=y
6173
62-
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_TEE_CORE_LOG_LEVEL=2 CFG_TEE_CORE_DEBUG=y
74+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
75+
76+
.. parsed-literal::
77+
78+
$ make CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_TEE_CORE_LOG_LEVEL=2 CFG_TEE_CORE_DEBUG=y CFG_USER_TA_TARGETS=ta_arm64
6379
6480
.. _building-optee-with-prng:
6581

@@ -71,9 +87,17 @@ detrimental effect to the overall system latency. Using the
7187
``CFG_WITH_SOFTWARE_PRNG`` flag to use OP-TEE's Pseudo RNG drivers as a source
7288
of entropy can work around these issues.
7389

74-
.. parsed-literal::
90+
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
91+
92+
.. parsed-literal::
93+
94+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=y
95+
96+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
97+
98+
.. parsed-literal::
7599
76-
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=y
100+
$ make CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=y CFG_USER_TA_TARGETS=ta_arm64
77101
78102
.. _secure-storage-with-rpmb:
79103

@@ -151,7 +175,7 @@ To get optee_client source code, do:
151175

152176
.. code-block:: console
153177
154-
$ git clone https://github.com/OP-TEE/optee_client
178+
$ git clone https://github.com/OP-TEE/optee_client
155179
156180
.. rubric:: Building OP-TEE Client with RPMB support
157181

@@ -162,7 +186,7 @@ instead of the emulated one.
162186

163187
.. code-block:: console
164188
165-
$ make CROSS_COMPILE="$CROSS_COMPILE_64" PLATFORM=k3 CFG_TEE_SUPP_LOG_LEVEL=2 RPMB_EMU=0 CFG_ARM64_core=y
189+
$ make CROSS_COMPILE="$CROSS_COMPILE_64" PLATFORM=k3 CFG_TEE_SUPP_LOG_LEVEL=2 RPMB_EMU=0 CFG_ARM64_core=y
166190
167191
Now update optee-client binary and libraries on your SD card with the generated ones
168192
in `out/export/usr` folder
@@ -188,7 +212,7 @@ Integrate binary output into U-boot
188212

189213
.. note::
190214

191-
tee-pager_v2.bin may be called bl32.bin in other documentation.
215+
tee-pager_v2.bin may be called bl32.bin in other documentation.
192216

193217
|
194218

0 commit comments

Comments
 (0)