diff options
| author | Manorit Chawdhry <m-chawdhry@ti.com> | 2026-02-26 13:11:39 +0530 |
|---|---|---|
| committer | Ryan Eatmon <reatmon@ti.com> | 2026-02-26 19:15:14 -0600 |
| commit | 15f5c84ecd64bdf47e549e59b81316b5c195c4ab (patch) | |
| tree | 2abf247884c121f7b1223c7adf4ec590d3c7ef6e /meta-ti-bsp | |
| parent | e24a53768327d77447eb72bad8e4049d1ac9df23 (diff) | |
| download | meta-ti-15f5c84ecd64bdf47e549e59b81316b5c195c4ab.tar.gz | |
trusted-firmware-a: Update to 2.14+
Updates trusted-firmware-a to a commit with the LPM patches and removes
them from yocto.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp')
4 files changed, 2 insertions, 390 deletions
diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc index f1a6eec1..f830e181 100644 --- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc +++ b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | FILESEXTRAPATHS:prepend := "${THISDIR}/trusted-firmware-a:" | 3 | FILESEXTRAPATHS:prepend := "${THISDIR}/trusted-firmware-a:" |
| 4 | 4 | ||
| 5 | PV = "2.13+git" | 5 | PV = "2.14+git" |
| 6 | 6 | ||
| 7 | LIC_FILES_CHKSUM = "file://docs/license.rst;md5=6ed7bace7b0bc63021c6eba7b524039e" | 7 | LIC_FILES_CHKSUM = "file://docs/license.rst;md5=6ed7bace7b0bc63021c6eba7b524039e" |
| 8 | SRCREV_tfa = "e0c4d3903b382bf34f552af53e6d955fae5283ab" | 8 | SRCREV_tfa = "76500ceaeefcda967d8a1f4e30bb04f9fe0425a2" |
| 9 | SRC_URI_TRUSTED_FIRMWARE_A = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https" | 9 | SRC_URI_TRUSTED_FIRMWARE_A = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https" |
| 10 | SRCBRANCH = "master" | 10 | SRCBRANCH = "master" |
| 11 | 11 | ||
| @@ -30,14 +30,3 @@ EXTRA_OEMAKE += "${@ 'BL32_BASE=' + d.getVar('TFA_K3_BL32_BASE') if d.getVar('TF | |||
| 30 | EXTRA_OEMAKE += "${@ 'PRELOADED_BL33_BASE=' + d.getVar('TFA_K3_PRELOADED_BL33') if d.getVar('TFA_K3_PRELOADED_BL33') else ''}" | 30 | EXTRA_OEMAKE += "${@ 'PRELOADED_BL33_BASE=' + d.getVar('TFA_K3_PRELOADED_BL33') if d.getVar('TFA_K3_PRELOADED_BL33') else ''}" |
| 31 | EXTRA_OEMAKE += "${@ 'K3_PM_SYSTEM_SUSPEND=' + d.getVar('TFA_K3_SYSTEM_SUSPEND') if d.getVar('TFA_K3_SYSTEM_SUSPEND') else ''}" | 31 | EXTRA_OEMAKE += "${@ 'K3_PM_SYSTEM_SUSPEND=' + d.getVar('TFA_K3_SYSTEM_SUSPEND') if d.getVar('TFA_K3_SYSTEM_SUSPEND') else ''}" |
| 32 | EXTRA_OEMAKE:append:ti-falcon = " PRELOADED_BL33_BASE=0x82000000 K3_HW_CONFIG_BASE=0x88000000" | 32 | EXTRA_OEMAKE:append:ti-falcon = " PRELOADED_BL33_BASE=0x82000000 K3_HW_CONFIG_BASE=0x88000000" |
| 33 | |||
| 34 | # LPM support patches for Jacinto platforms (J7200, J742S2, J784S4) | ||
| 35 | TFA_JACINTO_LPM_PATCHES = " \ | ||
| 36 | file://0001-feat-k3-choose-cluster_start_id-depending-on-the-soc.patch \ | ||
| 37 | file://0002-feat-ti-add-message-to-encrypt-tfa-during-suspend.patch \ | ||
| 38 | file://0003-feat-k3-handle-suspend-in-case-of-LPM_BOARDCFG_MANAG.patch \ | ||
| 39 | " | ||
| 40 | |||
| 41 | SRC_URI:append:j7200 = " ${TFA_JACINTO_LPM_PATCHES}" | ||
| 42 | SRC_URI:append:j742s2 = " ${TFA_JACINTO_LPM_PATCHES}" | ||
| 43 | SRC_URI:append:j784s4 = " ${TFA_JACINTO_LPM_PATCHES}" | ||
diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0001-feat-k3-choose-cluster_start_id-depending-on-the-soc.patch b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0001-feat-k3-choose-cluster_start_id-depending-on-the-soc.patch deleted file mode 100644 index ad3b8fbf..00000000 --- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0001-feat-k3-choose-cluster_start_id-depending-on-the-soc.patch +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | From 3de4f871d9bfe29c3862860e494bfa70ba72af3e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Abhash Kumar Jha <a-kumar2@ti.com> | ||
| 3 | Date: Mon, 20 Oct 2025 11:26:17 +0530 | ||
| 4 | Subject: [PATCH 1/3] feat(k3): choose cluster_start_id depending on the soc | ||
| 5 | |||
| 6 | The CLUSTER_DEVICE_START_ID denotes the device id of the A-core cluster. | ||
| 7 | It is utilized when powering off the entire cluster. | ||
| 8 | |||
| 9 | J7200, J721E and J721S2 have a different cluster_start_id than their | ||
| 10 | "generic" counterparts. | ||
| 11 | |||
| 12 | Query the JTAG_ID register to get the part id and choose the | ||
| 13 | cluster_start_id depending on that. | ||
| 14 | |||
| 15 | Upstream-Status: Pending | ||
| 16 | |||
| 17 | Change-Id: I44d3ac0ec646c39019e4c0167d34f410015a147a | ||
| 18 | Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> | ||
| 19 | --- | ||
| 20 | plat/ti/k3/common/k3_bl31_setup.c | 1 + | ||
| 21 | plat/ti/k3/common/k3_psci.c | 25 ++++++++++++++++++++++++- | ||
| 22 | plat/ti/k3/include/platform_def.h | 16 ++++++++++++++++ | ||
| 23 | 3 files changed, 41 insertions(+), 1 deletion(-) | ||
| 24 | |||
| 25 | diff --git a/plat/ti/k3/common/k3_bl31_setup.c b/plat/ti/k3/common/k3_bl31_setup.c | ||
| 26 | index 1b93dc860..79a9c924c 100644 | ||
| 27 | --- a/plat/ti/k3/common/k3_bl31_setup.c | ||
| 28 | +++ b/plat/ti/k3/common/k3_bl31_setup.c | ||
| 29 | @@ -20,6 +20,7 @@ const mmap_region_t plat_k3_mmap[] = { | ||
| 30 | K3_MAP_REGION_FLAT(SEC_PROXY_RT_BASE, SEC_PROXY_RT_SIZE, MT_DEVICE | MT_RW | MT_SECURE), | ||
| 31 | K3_MAP_REGION_FLAT(SEC_PROXY_SCFG_BASE, SEC_PROXY_SCFG_SIZE, MT_DEVICE | MT_RW | MT_SECURE), | ||
| 32 | K3_MAP_REGION_FLAT(SEC_PROXY_DATA_BASE, SEC_PROXY_DATA_SIZE, MT_DEVICE | MT_RW | MT_SECURE), | ||
| 33 | + K3_MAP_REGION_FLAT(WKUP_CTRL_MMR0_BASE, WKUP_CTRL_MMR0_SIZE, MT_DEVICE | MT_RW | MT_SECURE), | ||
| 34 | { /* sentinel */ } | ||
| 35 | }; | ||
| 36 | |||
| 37 | diff --git a/plat/ti/k3/common/k3_psci.c b/plat/ti/k3/common/k3_psci.c | ||
| 38 | index ec37d9f4c..a443dd851 100644 | ||
| 39 | --- a/plat/ti/k3/common/k3_psci.c | ||
| 40 | +++ b/plat/ti/k3/common/k3_psci.c | ||
| 41 | @@ -11,6 +11,8 @@ | ||
| 42 | #include <common/debug.h> | ||
| 43 | #include <lib/el3_runtime/cpu_data.h> | ||
| 44 | #include <lib/psci/psci.h> | ||
| 45 | +#include <lib/mmio.h> | ||
| 46 | +#include <lib/utils_def.h> | ||
| 47 | #include <plat/common/platform.h> | ||
| 48 | |||
| 49 | #include <ti_sci_protocol.h> | ||
| 50 | @@ -83,6 +85,27 @@ static int k3_pwr_domain_on(u_register_t mpidr) | ||
| 51 | return PSCI_E_SUCCESS; | ||
| 52 | } | ||
| 53 | |||
| 54 | +uint32_t get_plat_cluster_start_id() | ||
| 55 | +{ | ||
| 56 | + static uint32_t cluster_id; | ||
| 57 | + uint32_t part_id, jtag_id_reg; | ||
| 58 | + | ||
| 59 | + if (cluster_id) { | ||
| 60 | + return cluster_id; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + jtag_id_reg = mmio_read_32(WKUP_CTRL_MMR0_BASE + JTAG_ID); | ||
| 64 | + part_id = EXTRACT(JTAG_PART_ID, jtag_id_reg); | ||
| 65 | + | ||
| 66 | + if ((part_id == J7200_PART_ID) || (part_id == J721E_PART_ID) || (part_id == J721S2_PART_ID)) { | ||
| 67 | + cluster_id = J7_PLAT_CLUSTER_DEVICE_START_ID; | ||
| 68 | + } else { | ||
| 69 | + cluster_id = PLAT_CLUSTER_DEVICE_START_ID; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + return cluster_id; | ||
| 73 | +} | ||
| 74 | + | ||
| 75 | void k3_pwr_domain_off(const psci_power_state_t *target_state) | ||
| 76 | { | ||
| 77 | int core, cluster, proc_id, device_id, cluster_id, ret; | ||
| 78 | @@ -97,7 +120,7 @@ void k3_pwr_domain_off(const psci_power_state_t *target_state) | ||
| 79 | cluster = MPIDR_AFFLVL1_VAL(read_mpidr_el1()); | ||
| 80 | proc_id = PLAT_PROC_START_ID + core; | ||
| 81 | device_id = PLAT_PROC_DEVICE_START_ID + core; | ||
| 82 | - cluster_id = PLAT_CLUSTER_DEVICE_START_ID + (cluster * 2); | ||
| 83 | + cluster_id = get_plat_cluster_start_id() + (cluster * 2); | ||
| 84 | |||
| 85 | /* | ||
| 86 | * If we are the last core in the cluster then we take a reference to | ||
| 87 | diff --git a/plat/ti/k3/include/platform_def.h b/plat/ti/k3/include/platform_def.h | ||
| 88 | index db5e31d95..d191781a6 100644 | ||
| 89 | --- a/plat/ti/k3/include/platform_def.h | ||
| 90 | +++ b/plat/ti/k3/include/platform_def.h | ||
| 91 | @@ -25,6 +25,22 @@ | ||
| 92 | #define SEC_PROXY_RT_SIZE 0x80000 | ||
| 93 | #endif /* K3_SEC_PROXY_LITE */ | ||
| 94 | |||
| 95 | +#define WKUP_CTRL_MMR0_BASE UL(0x43000000) | ||
| 96 | +#define WKUP_CTRL_MMR0_SIZE UL(0x20000) | ||
| 97 | +#define JTAG_ID U(0x14) | ||
| 98 | +#define JTAG_PART_ID_MASK GENMASK(27, 12) | ||
| 99 | + | ||
| 100 | +#define J721E_PART_ID U(0xBB64) | ||
| 101 | +#define J7200_PART_ID U(0xBB6D) | ||
| 102 | +#define J721S2_PART_ID U(0xBB75) | ||
| 103 | +#define J784S4_J742S2_PART_ID U(0xBB80) | ||
| 104 | + | ||
| 105 | +#define JTAG_PART_ID_WIDTH U(0x10) | ||
| 106 | +#define JTAG_PART_ID_SHIFT U(0xC) | ||
| 107 | + | ||
| 108 | +/* A-core Cluster Device ID for j721e, j7200 and j721s2 */ | ||
| 109 | +#define J7_PLAT_CLUSTER_DEVICE_START_ID U(0x4) | ||
| 110 | + | ||
| 111 | #define SEC_PROXY_TIMEOUT_US 1000000 | ||
| 112 | #define SEC_PROXY_MAX_MESSAGE_SIZE 56 | ||
| 113 | |||
| 114 | -- | ||
| 115 | 2.34.1 | ||
diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0002-feat-ti-add-message-to-encrypt-tfa-during-suspend.patch b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0002-feat-ti-add-message-to-encrypt-tfa-during-suspend.patch deleted file mode 100644 index 09e69999..00000000 --- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0002-feat-ti-add-message-to-encrypt-tfa-during-suspend.patch +++ /dev/null | |||
| @@ -1,194 +0,0 @@ | |||
| 1 | From c79ff3679a4360bb848b01d4036c365533fcf791 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Richard Genoud <richard.genoud@bootlin.com> | ||
| 3 | Date: Tue, 11 Feb 2025 18:20:17 +0100 | ||
| 4 | Subject: [PATCH 2/3] feat(ti): add message to encrypt tfa during suspend | ||
| 5 | |||
| 6 | At suspend, BL31 with its context will be encrypted by TIFS in DDR. | ||
| 7 | Encryption is needed for security matters, so that the BL31 is not | ||
| 8 | modified before entering suspend or early at resume. | ||
| 9 | |||
| 10 | We only need the encryption function here because the decryption message | ||
| 11 | will be send by the R5 SPL at resume. | ||
| 12 | |||
| 13 | Also introduce the LPM_ENCRYPT_IMAGE cap signals that FW has the support | ||
| 14 | to encrypt the image using the TISCI_MSG_LPM_ENCRYPT tisci message. | ||
| 15 | |||
| 16 | This is useful in suspend to ram cases where we would like to | ||
| 17 | store the encrypted image of a secure fw instead of the original image | ||
| 18 | itself in the DDR. | ||
| 19 | |||
| 20 | Check for LPM_ENCRYPT_IMAGE flag in the FW capabilities, and only then | ||
| 21 | call encrypt. | ||
| 22 | |||
| 23 | Upstream-Status: Pending | ||
| 24 | |||
| 25 | Change-Id: I266472da87dd0821493019b2d9853f8886f33811 | ||
| 26 | Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> | ||
| 27 | Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> | ||
| 28 | --- | ||
| 29 | drivers/ti/ti_sci/ti_sci.c | 36 +++++++++++++++++++++++++++++ | ||
| 30 | drivers/ti/ti_sci/ti_sci.h | 7 ++++++ | ||
| 31 | drivers/ti/ti_sci/ti_sci_protocol.h | 32 +++++++++++++++++++++++++ | ||
| 32 | plat/ti/k3/common/k3_psci.c | 10 ++++++++ | ||
| 33 | 4 files changed, 85 insertions(+) | ||
| 34 | |||
| 35 | diff --git a/drivers/ti/ti_sci/ti_sci.c b/drivers/ti/ti_sci/ti_sci.c | ||
| 36 | index f0813e5b0..ee5f7166f 100644 | ||
| 37 | --- a/drivers/ti/ti_sci/ti_sci.c | ||
| 38 | +++ b/drivers/ti/ti_sci/ti_sci.c | ||
| 39 | @@ -1784,3 +1784,39 @@ int ti_sci_lpm_get_next_sys_mode(uint8_t *next_mode) | ||
| 40 | |||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | +/* | ||
| 44 | + * ti_sci_encrypt_tfa - Ask TIFS to encrypt TFA at a specific address | ||
| 45 | + * | ||
| 46 | + * @src_tfa_addr: Address where the TFA lies unencrypted | ||
| 47 | + * @src_tfa_len: Size of the TFA unencrypted | ||
| 48 | + * | ||
| 49 | + * Return: 0 if all goes well, else appropriate error message | ||
| 50 | + */ | ||
| 51 | +int ti_sci_encrypt_tfa(uint64_t src_tfa_addr, | ||
| 52 | + uint32_t src_tfa_len) | ||
| 53 | +{ | ||
| 54 | + struct ti_sci_msg_req_encrypt_tfa req = { 0 }; | ||
| 55 | + struct ti_sci_msg_resp_encrypt_tfa resp = { 0 }; | ||
| 56 | + struct ti_sci_xfer xfer; | ||
| 57 | + int ret; | ||
| 58 | + | ||
| 59 | + ret = ti_sci_setup_one_xfer(TISCI_MSG_LPM_ENCRYPT_TFA, 0, | ||
| 60 | + &req, sizeof(req), | ||
| 61 | + &resp, sizeof(resp), | ||
| 62 | + &xfer); | ||
| 63 | + if (ret != 0U) { | ||
| 64 | + ERROR("Message alloc failed (%d)\n", ret); | ||
| 65 | + return ret; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + req.src_tfa_addr = src_tfa_addr; | ||
| 69 | + req.src_tfa_len = src_tfa_len; | ||
| 70 | + | ||
| 71 | + ret = ti_sci_do_xfer(&xfer); | ||
| 72 | + if (ret != 0U) { | ||
| 73 | + ERROR("Transfer send failed (%d)\n", ret); | ||
| 74 | + return ret; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + return 0; | ||
| 78 | +} | ||
| 79 | diff --git a/drivers/ti/ti_sci/ti_sci.h b/drivers/ti/ti_sci/ti_sci.h | ||
| 80 | index 1f1963274..2afa11317 100644 | ||
| 81 | --- a/drivers/ti/ti_sci/ti_sci.h | ||
| 82 | +++ b/drivers/ti/ti_sci/ti_sci.h | ||
| 83 | @@ -258,6 +258,11 @@ int ti_sci_proc_wait_boot_status_no_wait(uint8_t proc_id, | ||
| 84 | * | ||
| 85 | * Return: 0 if all goes well, else appropriate error message | ||
| 86 | * | ||
| 87 | + * - ti_sci_encrypt_tfa - Ask TIFS to encrypt TFA at a specific address | ||
| 88 | + * | ||
| 89 | + * @src_tfa_addr: Address where the TFA lies unencrypted | ||
| 90 | + * @src_tfa_len: Size of the TFA unencrypted | ||
| 91 | + * | ||
| 92 | * NOTE: for all these functions, the following are generic in nature: | ||
| 93 | * Returns 0 for successful request, else returns corresponding error message. | ||
| 94 | */ | ||
| 95 | @@ -265,5 +270,7 @@ int ti_sci_enter_sleep(uint8_t proc_id, | ||
| 96 | uint8_t mode, | ||
| 97 | uint64_t core_resume_addr); | ||
| 98 | int ti_sci_lpm_get_next_sys_mode(uint8_t *next_mode); | ||
| 99 | +int ti_sci_encrypt_tfa(uint64_t src_tfa_addr, | ||
| 100 | + uint32_t src_tfa_len); | ||
| 101 | |||
| 102 | #endif /* TI_SCI_H */ | ||
| 103 | diff --git a/drivers/ti/ti_sci/ti_sci_protocol.h b/drivers/ti/ti_sci/ti_sci_protocol.h | ||
| 104 | index bdd24622a..a165cda99 100644 | ||
| 105 | --- a/drivers/ti/ti_sci/ti_sci_protocol.h | ||
| 106 | +++ b/drivers/ti/ti_sci/ti_sci_protocol.h | ||
| 107 | @@ -53,6 +53,9 @@ | ||
| 108 | #define TISCI_MSG_GET_PROC_BOOT_STATUS 0xc400 | ||
| 109 | #define TISCI_MSG_WAIT_PROC_BOOT_STATUS 0xc401 | ||
| 110 | |||
| 111 | +/* TFA encrypt/decrypt messages */ | ||
| 112 | +#define TISCI_MSG_LPM_ENCRYPT_TFA 0x030F | ||
| 113 | + | ||
| 114 | /** | ||
| 115 | * struct ti_sci_secure_msg_hdr - Header that prefixes all TISCI messages sent | ||
| 116 | * via secure transport. | ||
| 117 | @@ -160,6 +163,7 @@ struct ti_sci_msg_resp_query_fw_caps { | ||
| 118 | #define MSG_FLAG_CAPS_LPM_STANDBY TI_SCI_MSG_FLAG(3) | ||
| 119 | #define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4) | ||
| 120 | #define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5) | ||
| 121 | +#define MSG_FLAG_CAPS_LPM_ENCRYPT_IMAGE TI_SCI_MSG_FLAG(11) | ||
| 122 | uint64_t fw_caps; | ||
| 123 | } __packed; | ||
| 124 | |||
| 125 | @@ -810,4 +814,32 @@ struct ti_sci_msg_resp_lpm_get_next_sys_mode { | ||
| 126 | uint8_t mode; | ||
| 127 | } __packed; | ||
| 128 | |||
| 129 | +/* | ||
| 130 | + * struct ti_sci_msg_req_encrypt_tfa - Request for TISCI_MSG_LPM_ENCRYPT_TFA. | ||
| 131 | + * | ||
| 132 | + * @hdr Generic Header | ||
| 133 | + * @src_tfa_addr: Address where the TFA lies unencrypted | ||
| 134 | + * @src_tfa_len: Size of the TFA unencrypted | ||
| 135 | + * | ||
| 136 | + * This message is to be sent when the system is going in suspend, just before | ||
| 137 | + * TI_SCI_MSG_ENTER_SLEEP. | ||
| 138 | + * The TIFS will then encrypt the TFA and store it in RAM, along with a private | ||
| 139 | + * header. | ||
| 140 | + * Upon resume, the SPL will ask TIFS to decrypt it back. | ||
| 141 | + */ | ||
| 142 | +struct ti_sci_msg_req_encrypt_tfa { | ||
| 143 | + struct ti_sci_msg_hdr hdr; | ||
| 144 | + uint64_t src_tfa_addr; | ||
| 145 | + uint32_t src_tfa_len; | ||
| 146 | +} __packed; | ||
| 147 | + | ||
| 148 | +/* | ||
| 149 | + * struct ti_sci_msg_req_encrypt_tfa - Request for TISCI_MSG_LPM_ENCRYPT_TFA. | ||
| 150 | + * | ||
| 151 | + * @hdr Generic Header | ||
| 152 | + */ | ||
| 153 | +struct ti_sci_msg_resp_encrypt_tfa { | ||
| 154 | + struct ti_sci_msg_hdr hdr; | ||
| 155 | +} __packed; | ||
| 156 | + | ||
| 157 | #endif /* TI_SCI_PROTOCOL_H */ | ||
| 158 | diff --git a/plat/ti/k3/common/k3_psci.c b/plat/ti/k3/common/k3_psci.c | ||
| 159 | index a443dd851..c2017666b 100644 | ||
| 160 | --- a/plat/ti/k3/common/k3_psci.c | ||
| 161 | +++ b/plat/ti/k3/common/k3_psci.c | ||
| 162 | @@ -24,6 +24,7 @@ | ||
| 163 | #define SYSTEM_PWR_STATE(state) ((state)->pwr_domain_state[PLAT_MAX_PWR_LVL]) | ||
| 164 | |||
| 165 | uintptr_t k3_sec_entrypoint; | ||
| 166 | +bool encrypt_image; | ||
| 167 | |||
| 168 | static void k3_cpu_standby(plat_local_state_t cpu_state) | ||
| 169 | { | ||
| 170 | @@ -282,6 +283,11 @@ static void k3_pwr_domain_suspend_to_mode(const psci_power_state_t *target_state | ||
| 171 | k3_gic_cpuif_disable(); | ||
| 172 | k3_gic_save_context(); | ||
| 173 | |||
| 174 | + if (encrypt_image) | ||
| 175 | + { | ||
| 176 | + ti_sci_encrypt_tfa((uint64_t)__TEXT_START__, BL31_SIZE); | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | k3_pwr_domain_off(target_state); | ||
| 180 | |||
| 181 | ti_sci_enter_sleep(proc_id, mode, k3_sec_entrypoint); | ||
| 182 | @@ -347,6 +353,10 @@ int plat_setup_psci_ops(uintptr_t sec_entrypoint, | ||
| 183 | ERROR("Unable to query firmware capabilities (%d)\n", ret); | ||
| 184 | } | ||
| 185 | |||
| 186 | + if (fw_caps & MSG_FLAG_CAPS_LPM_ENCRYPT_IMAGE) { | ||
| 187 | + encrypt_image = true; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | /* If firmware does not support any known suspend mode */ | ||
| 191 | if (!(fw_caps & (MSG_FLAG_CAPS_LPM_DEEP_SLEEP | | ||
| 192 | MSG_FLAG_CAPS_LPM_MCU_ONLY | | ||
| 193 | -- | ||
| 194 | 2.34.1 | ||
diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0003-feat-k3-handle-suspend-in-case-of-LPM_BOARDCFG_MANAG.patch b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0003-feat-k3-handle-suspend-in-case-of-LPM_BOARDCFG_MANAG.patch deleted file mode 100644 index a1209fe1..00000000 --- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a/0003-feat-k3-handle-suspend-in-case-of-LPM_BOARDCFG_MANAG.patch +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | From 470cf022d03e350beab36605d4250944d2c92ffe Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Abhash Kumar Jha <a-kumar2@ti.com> | ||
| 3 | Date: Tue, 28 Oct 2025 23:24:22 +0530 | ||
| 4 | Subject: [PATCH 3/3] feat(k3): handle suspend in case of LPM_BOARDCFG_MANAGED | ||
| 5 | |||
| 6 | The J7 platforms support LPM_BOARDCFG_MANAGED capability where the | ||
| 7 | low power mode configuration is done statically for the DM via the | ||
| 8 | pm-boardcfg. | ||
| 9 | |||
| 10 | This is entirely opposite to the case of DM_MANAGED, where the DM fw | ||
| 11 | decides the low power mode to enter into. | ||
| 12 | |||
| 13 | Introduce LPM_BOARDCFG_MANAGED cap to handle suspend for those | ||
| 14 | platforms as well. | ||
| 15 | |||
| 16 | Upstream-Status: Pending | ||
| 17 | |||
| 18 | Change-Id: Iaa0ab478cbe0db6652f61e9d733c0fddb4bab234 | ||
| 19 | Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com> | ||
| 20 | --- | ||
| 21 | drivers/ti/ti_sci/ti_sci_protocol.h | 1 + | ||
| 22 | plat/ti/k3/common/k3_psci.c | 13 ++++++++----- | ||
| 23 | 2 files changed, 9 insertions(+), 5 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/drivers/ti/ti_sci/ti_sci_protocol.h b/drivers/ti/ti_sci/ti_sci_protocol.h | ||
| 26 | index a165cda99..b83174b0d 100644 | ||
| 27 | --- a/drivers/ti/ti_sci/ti_sci_protocol.h | ||
| 28 | +++ b/drivers/ti/ti_sci/ti_sci_protocol.h | ||
| 29 | @@ -164,6 +164,7 @@ struct ti_sci_msg_resp_query_fw_caps { | ||
| 30 | #define MSG_FLAG_CAPS_LPM_PARTIAL_IO TI_SCI_MSG_FLAG(4) | ||
| 31 | #define MSG_FLAG_CAPS_LPM_DM_MANAGED TI_SCI_MSG_FLAG(5) | ||
| 32 | #define MSG_FLAG_CAPS_LPM_ENCRYPT_IMAGE TI_SCI_MSG_FLAG(11) | ||
| 33 | +#define MSG_FLAG_CAPS_LPM_BOARDCFG_MANAGED TI_SCI_MSG_FLAG(12) | ||
| 34 | uint64_t fw_caps; | ||
| 35 | } __packed; | ||
| 36 | |||
| 37 | diff --git a/plat/ti/k3/common/k3_psci.c b/plat/ti/k3/common/k3_psci.c | ||
| 38 | index c2017666b..9cf41b4cb 100644 | ||
| 39 | --- a/plat/ti/k3/common/k3_psci.c | ||
| 40 | +++ b/plat/ti/k3/common/k3_psci.c | ||
| 41 | @@ -357,17 +357,20 @@ int plat_setup_psci_ops(uintptr_t sec_entrypoint, | ||
| 42 | encrypt_image = true; | ||
| 43 | } | ||
| 44 | |||
| 45 | - /* If firmware does not support any known suspend mode */ | ||
| 46 | - if (!(fw_caps & (MSG_FLAG_CAPS_LPM_DEEP_SLEEP | | ||
| 47 | + /* If firmware is capabale of low power modes */ | ||
| 48 | + if (fw_caps & (MSG_FLAG_CAPS_LPM_DM_MANAGED | | ||
| 49 | + MSG_FLAG_CAPS_LPM_BOARDCFG_MANAGED)) { | ||
| 50 | + k3_plat_psci_ops.pwr_domain_suspend = k3_pwr_domain_suspend_dm_managed; | ||
| 51 | + } else if (!(fw_caps & (MSG_FLAG_CAPS_LPM_DEEP_SLEEP | | ||
| 52 | MSG_FLAG_CAPS_LPM_MCU_ONLY | | ||
| 53 | MSG_FLAG_CAPS_LPM_STANDBY | | ||
| 54 | MSG_FLAG_CAPS_LPM_PARTIAL_IO))) { | ||
| 55 | - /* Disable PSCI suspend support */ | ||
| 56 | + /* If firmware does not support any known suspend mode | ||
| 57 | + * disable PSCI suspend support | ||
| 58 | + */ | ||
| 59 | k3_plat_psci_ops.pwr_domain_suspend = NULL; | ||
| 60 | k3_plat_psci_ops.pwr_domain_suspend_finish = NULL; | ||
| 61 | k3_plat_psci_ops.get_sys_suspend_power_state = NULL; | ||
| 62 | - } else if (fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) { | ||
| 63 | - k3_plat_psci_ops.pwr_domain_suspend = k3_pwr_domain_suspend_dm_managed; | ||
| 64 | } | ||
| 65 | |||
| 66 | *psci_ops = &k3_plat_psci_ops; | ||
| 67 | -- | ||
| 68 | 2.34.1 | ||
