Skip to content

Commit 55ed774

Browse files
ronakj89michalsimek
authored andcommitted
firmware: xilinx: fix feature check logic for TF-A specific APIs
Currently, Linux is passing only API ID for feature of TF-A specific APIs but for feature check of TF-A specific APIs, TF-A is checking for Module ID + API ID as a result incorrect version is received for all TF-A specific APIs. So, fix feature check logic to pass valid arguments to get correct version. Signed-off-by: Ronak Jain <[email protected]> Signed-off-by: Jay Buddhabhatti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
1 parent 92fb713 commit 55ed774

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/firmware/xilinx/zynqmp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,14 @@ static int __do_feature_check_call(const u32 api_id, u32 *ret_payload)
225225
* Feature check of TF-A APIs is done in the TF-A layer and it expects for
226226
* MODULE_ID_MASK bits of SMC's arg[0] to be the same as PM_MODULE_ID.
227227
*/
228-
if (module_id == TF_A_MODULE_ID)
228+
if (module_id == TF_A_MODULE_ID) {
229229
module_id = PM_MODULE_ID;
230+
smc_arg[1] = api_id;
231+
} else {
232+
smc_arg[1] = (api_id & API_ID_MASK);
233+
}
230234

231235
smc_arg[0] = PM_SIP_SVC | FIELD_PREP(MODULE_ID_MASK, module_id) | feature_check_api_id;
232-
smc_arg[1] = (api_id & API_ID_MASK);
233236

234237
ret = do_fw_call(ret_payload, 2, smc_arg[0], smc_arg[1]);
235238
if (ret)

0 commit comments

Comments
 (0)