doc: board: ti: k3: Add fTPM support documentation
PATCH 1/1 doc: board: ti: k3: Add fTPM support documentation
Add fTPM support documentation including an overview, configuration steps for RPMB provisioning, OP-TEE TA build instructions, and verification procedure.
--- doc/board/ti/k3.rst | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+)
doc/board/ti/k3.rst +83 -0
@@ -1258,3 +1258,86 @@ Currently, OpenOCD does not support tracing for K3 platforms. Tracing function could be beneficial if the bug in code occurs deep within nested function and can optionally save developers major trouble of stepping through a large quantity of code. + +Firmware TPM (fTPM) Support +--------------------------- + +K3 family of devices with **eMMC** are capable of supporting firmware TPM +(fTPM) functionality through OP-TEE, providing TPM 2.0 capabilities +without requiring discrete TPM hardware. +The fTPM Trusted Application runs in OP-TEE secure world and uses +eMMC Replay Protected Memory Block (RPMB) for secure persistent +storage. + +The fTPM implementation consists of: + +* **fTPM TA**: Microsoft's fTPM Trusted Application (TA) running in OP-TEE +* **RPMB Storage**: eMMC RPMB partition for persistent TPM NV storage +* **U-Boot Support**: TPM commands and RPMB access via OP-TEE + +fTPM can be used to enable security features such as: + +* Measured boot +* Secure key storage +* Platform attestation + +Enabling fTPM in U-Boot +^^^^^^^^^^^^^^^^^^^^^^^ + +The following are the steps to enable fTPM in uboot: + +1. Programming Keys into eMMC RPMB +"""""""""""""""""""""""""""""""""" + +Since fTPM uses RPMB for persistent storage, the eMMC RPMB must be +provisioned with an authentication key on first boot. This requires +building optee_os with the ``CFG_RPMB_WRITE_KEY=y`` flag + +.. prompt:: bash $ + + # inside optee_os source + make CROSS_COMPILE=$CC32 CROSS_COMPILE64=$CC64 CFG_ARM64_core=y \ + PLATFORM=$OPTEE_PLATFORM CFG_RPMB_WRITE_KEY=y + +.. warning:: + + Programming the RPMB key is a **one-time, irreversible operation**. + The key is derived from the Hardware Unique Key (HUK) and cannot + be changed once programmed. For further details, refer + `Secure Storage <https://optee.readthedocs.io/en/latest/architecture/secure_storage.html>`_ + +On first boot with this configuration, OP-TEE will automatically program +the RPMB authentication key. Subsequent boots should use OP-TEE built +without this flag. + +2. Generate fTPM TA binary +"""""""""""""""""""""""""" + +To generate fTPM TA binary, follow the +`Building the TA <https://github.com/OP-TEE/optee_ftpm#building-the-ta>`_ +steps mentioned in the OP-TEE fTPM Github repository + +3. Build OP-TEE with TA: +"""""""""""""""""""""""" + +With the TA generated from last step, build optee-os with RPMB and early +TA enabled: + +.. prompt:: bash $ + + # inside optee_os source + make CROSS_COMPILE=$CC32 CROSS_COMPILE64=$CC64 CFG_ARM64_core=y \ + PLATFORM=$OPTEE_PLATFORM CFG_RPMB_FS=y CFG_REE_FS=n \ + CFG_EARLY_TA=y CFG_RPMB_ANNOUNCE_PROBE_CAP=n \ + EARLY_TA_PATHS=/path/to/ftpm_ta.stripped.elf + +Expected Outcome +^^^^^^^^^^^^^^^^ + +To verify fTPM support is working, run tpm2 commands in u-boot prompt: + +.. code-block:: console + + => tpm2 info + Microsoft OP-TEE fTPM + => tpm2 init
Signature · 1 line
2.34.1
Hi Shiva,
Quoted 13 lines · Shiva Tripathi
doc: board: ti: k3: Add fTPM support documentation
Add fTPM support documentation including an overview, configuration steps for RPMB provisioning, OP-TEE TA build instructions, and verification procedure.
Signed-off-by Shiva Tripathi <[email protected]>
doc/board/ti/k3.rst| 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++1 file changed, 83 insertions(+)
doc/board/ti/k3.rst Currently, OpenOCD does not support tracing for K3 platforms. Tracing · line 1261
Quoted 4 lines
doc/board/ti/k3.rst +4
-0@@ -1258,3 +1258,86 @@ Currently, OpenOCD does not support tracing for K3 platforms. Tracing +Enabling fTPM in U-Boot +^^^^^^^^^^^^^^^^^^^^^^^ + +The following are the steps to enable fTPM in uboot:
The section is titled 'Enabling fTPM in U-Boot' but the three steps only cover building OP-TEE — nothing tells the reader which U-Boot options to enable (CONFIG_TPM_V2, CONFIG_TEE, CONFIG_OPTEE, CONFIG_TPM2_FTPM_TEE, plus the relevant tpm2 command configs) or how to wire the fTPM node into the board's device tree. Please can you add a step covering the U-Boot side. Also 'uboot' should be 'U-Boot' here and further down ('u-boot prompt').
doc/board/ti/k3.rst Currently, OpenOCD does not support tracing for K3 platforms. Tracing · line 1260
Quoted 5 lines
doc/board/ti/k3.rst +3
-0@@ -1258,3 +1258,86 @@ Currently, OpenOCD does not support tracing for K3 platforms. Tracing +Since fTPM uses RPMB for persistent storage, the eMMC RPMB must be +provisioned with an authentication key on first boot. This requires +building optee_os with the `CFG_RPMB_WRITE_KEY=y flag
Missing full stop. Same with the paragraph ending 'OP-TEE fTPM Github repository' below.
doc/board/ti/k3.rst Currently, OpenOCD does not support tracing for K3 platforms. Tracing · line 1266
Quoted 11 lines
doc/board/ti/k3.rst +9
-0@@ -1258,3 +1258,86 @@ Currently, OpenOCD does not support tracing for K3 platforms. Tracing +2. Generate fTPM TA binary +"""""""""""""""""""""""""" + +To generate fTPM TA binary, follow the +Building the TA <https://github.com/OP-TEE/optee_ftpm#building-the-ta>`_ +steps mentioned in the OP-TEE fTPM Github repository + +3. Build OP-TEE with TA: +""""""""""""""""""""""""
Please drop the trailing colon on step 3's heading for consistency with steps 1 and 2.
doc/board/ti/k3.rst Currently, OpenOCD does not support tracing for K3 platforms. Tracing · line 1267
Quoted 12 lines
doc/board/ti/k3.rst +10
-0@@ -1258,3 +1258,86 @@ Currently, OpenOCD does not support tracing for K3 platforms. Tracing +Expected Outcome +^^^^^^^^^^^^^^^^ + +To verify fTPM support is working, run tpm2 commands in u-boot prompt: + +.. code-block:: console + + => tpm2 info + Microsoft OP-TEE fTPM + => tpm2 init
'tpm2 init' needs to run before 'tpm2 info' will talk to the device, so the ordering is backwards. Also, showing 'tpm2 init' with no output tells the reader nothing about what success looks like please include the expected response (empty?), and ideally a 'tpm2 startup TPM2_SU_CLEAR' / 'tpm2 get_capability' round-trip so readers can confirm the stack is working end-to-end.
Regards,
Simon