|
| 1 | +############### |
| 2 | +HSM M4F Loading |
| 3 | +############### |
| 4 | + |
| 5 | +Some K3 SoCs like J721S2 and J784S4 have a High Security Module (HSM) M4F |
| 6 | +core in the Wakeup Voltage Domain. The HSM M4 core is loaded at R5 SPL stage. |
| 7 | +Boot flow for HSM M4 core is different than the general purpose M4F cores, |
| 8 | +and is described as below: |
| 9 | + |
| 10 | + - Request control of HSM M4F remote processor. |
| 11 | + - Assert Reset on the HSM M4F remote processor. |
| 12 | + - Load firmware into HSM M4F core's SRAM memory region. |
| 13 | + - For HS devices, request TIFS to authenticate and load the firmware. |
| 14 | + - For GP devices, load the firmware manually into HSM SRAM. |
| 15 | + - Deassert Reset on the HSM M4F remote processor. |
| 16 | + - Release control of HSM M4F remote processor. |
| 17 | + |
| 18 | +This User Guide documents how to enable HSM core loading. |
| 19 | + |
| 20 | +***************************** |
| 21 | +How to enable HSM M4F Loading |
| 22 | +***************************** |
| 23 | + |
| 24 | +By default, only the HSM demo firmware for HS-SE device type is packed in |
| 25 | +tispl.bin FIT image. See :ref:`how-to-build-u-boot-with-custom-hsm-fw` |
| 26 | +section to change the default firmware for other device types. |
| 27 | + |
| 28 | +R5 SPL supports loading of HSM M4 core for all device types, i.e., HS-SE, |
| 29 | +HS-FS, GP. However, This feature is disabled by default in SDK. To enable |
| 30 | +HSM loading, set the :code:`CONFIG_K3_HSM_FW` config in both |
| 31 | +<soc>_evm_r5_defconfig and <soc>_evm_a72_defconfig files. |
| 32 | + |
| 33 | +For example, to enable HSM loading on J721S2 device, make the following |
| 34 | +changes: |
| 35 | + |
| 36 | +.. code-block:: diff |
| 37 | +
|
| 38 | + diff --git a/configs/j721s2_evm_r5_defconfig b/configs/j721s2_evm_r5_defconfig |
| 39 | + index 806c97792f6..ebe100c2278 100644 |
| 40 | + --- a/configs/j721s2_evm_r5_defconfig |
| 41 | + +++ b/configs/j721s2_evm_r5_defconfig |
| 42 | + @@ -187,3 +187,4 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384 |
| 43 | + CONFIG_PANIC_HANG=y |
| 44 | + CONFIG_LIB_RATIONAL=y |
| 45 | + CONFIG_SPL_LIB_RATIONAL=y |
| 46 | + +CONFIG_K3_HSM_FW=y |
| 47 | + diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig |
| 48 | + index 6db41cb457e..a07e6d63270 100644 |
| 49 | + --- a/configs/j721s2_evm_a72_defconfig |
| 50 | + +++ b/configs/j721s2_evm_a72_defconfig |
| 51 | + @@ -198,3 +198,4 @@ CONFIG_UFS=y |
| 52 | + CONFIG_CADENCE_UFS=y |
| 53 | + CONFIG_TI_J721E_UFS=y |
| 54 | + CONFIG_TI_COMMON_CMD_OPTIONS=y |
| 55 | + +CONFIG_K3_HSM_FW=y |
| 56 | +
|
| 57 | +Proceed to build U-Boot (tiboot3.bin and tispl.bin). One can verify if the |
| 58 | +HSM binary is packed inside tispl.bin FIT image by using following command: |
| 59 | + |
| 60 | +.. code-block:: console |
| 61 | +
|
| 62 | + mkimage -l <output directory>/a72/tispl.bin |
| 63 | + <...> |
| 64 | + Image 2 (hsm) |
| 65 | + Description: HSM binary |
| 66 | + Created: Thu Mar 20 13:26:16 2025 |
| 67 | + Type: Standalone Program |
| 68 | + Compression: uncompressed |
| 69 | + Data Size: 132694 Bytes = 129.58 KiB = 0.13 MiB |
| 70 | + Architecture: Unknown Architecture |
| 71 | + Load Address: 0x82000000 |
| 72 | + Entry point: 0x82000000 |
| 73 | + <...> |
| 74 | +
|
| 75 | +The HSM core loading can be verified by checking for the following log |
| 76 | +at R5 SPL stage: `'Successfully booted HSM core'`. |
| 77 | + |
| 78 | +.. code-block:: console |
| 79 | +
|
| 80 | + U-Boot SPL 2025.01-00391-ga7a25e886202-dirty (Mar 20 2025 - 11:04:05 +0530) |
| 81 | + SYSFW ABI: 4.0 (firmware rev 0x000b '11.0.9--v11.00.09+ (Fancy Rat)') |
| 82 | + Initialized 4 DRAM controllers |
| 83 | + SPL initial stack usage: 13456 bytes |
| 84 | + Trying to boot from MMC2 |
| 85 | + Authentication passed |
| 86 | + Authentication passed |
| 87 | + Authentication passed |
| 88 | + Loading Environment from nowhere... OK |
| 89 | + Successfully booted HSM core |
| 90 | + Authentication passed |
| 91 | + Authentication passed |
| 92 | + Starting ATF on ARM64 core... |
| 93 | +
|
| 94 | +.. _how-to-build-u-boot-with-custom-hsm-fw: |
| 95 | + |
| 96 | +******************************************** |
| 97 | +How to build U-Boot with custom HSM firmware |
| 98 | +******************************************** |
| 99 | + |
| 100 | +To pack the firmware for any other device type, one can update the path in |
| 101 | +the SoC binman template to point to the custom binary and re-build U-Boot |
| 102 | +images (tispl.bin). |
| 103 | + |
| 104 | +:code:`arch/arm/dts/k3-<soc>-binman.dtsi` |
| 105 | + |
| 106 | +.. code-block:: dts |
| 107 | +
|
| 108 | + hsm { |
| 109 | + hsm: blob-ext { |
| 110 | + filename = <path_to_custom_binary>; |
| 111 | + }; |
| 112 | + }; |
| 113 | +
|
| 114 | +For example, To pack the HSM demo firmware for J784S4 HS-FS device type, make |
| 115 | +following changes to :code:`arch/arm/dts/k3-j784s4-binman.dtsi` |
| 116 | + |
| 117 | +.. code-block:: dts |
| 118 | +
|
| 119 | + hsm { |
| 120 | + hsm: blob-ext { |
| 121 | + filename = "ti-hsm/hsm-demo-firmware-j784s4-hs-fs.bin"; |
| 122 | + }; |
| 123 | + }; |
| 124 | +
|
| 125 | +A list of all HSM demo firmwares can be found in `ti-linux-firmware repository |
| 126 | +<https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/tree/ti-hsm?h=ti-linux-firmware>`__. |
0 commit comments