From 3bc174031d3cbcf176b22fc2869b486011fa194c Mon Sep 17 00:00:00 2001 From: Moteen Shah Date: Mon, 9 Jun 2025 13:44:29 +0530 Subject: ti_sci_*: Add utility to access tisci firmware and SOC capability Introduce response and request structs for receiving information regarding FW/SOC capability from DM. The received capability can further be used to call certain API's based on the feature supoorted by the DM firmware. Signed-off-by: Moteen Shah Reviewed-by: Neha Malcom Francis Reviewed-by: Dhruva Gole --- include/linux/soc/ti/ti_sci_protocol.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/linux') diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h index aa4d105ee98..f967077b756 100644 --- a/include/linux/soc/ti/ti_sci_protocol.h +++ b/include/linux/soc/ti/ti_sci_protocol.h @@ -261,6 +261,18 @@ struct ti_sci_core_ops { u64 *msmc_start, u64 *msmc_end); }; +/** + * struct ti_sci_firmware_ops - DM firmware operations + * @query_dm_cap: Query the DM capabilities + * Return 0 for successful query else appropriate error value. + */ +struct ti_sci_firmware_ops { + int (*query_dm_cap)(struct ti_sci_handle *handle, + u64 *dm_cap); +}; + +#define TI_SCI_MSG_FLAG_FW_CAP_DM 0x100 + /** * struct ti_sci_proc_ops - Processor specific operations. * @@ -609,6 +621,7 @@ struct ti_sci_ops { struct ti_sci_dev_ops dev_ops; struct ti_sci_clk_ops clk_ops; struct ti_sci_core_ops core_ops; + struct ti_sci_firmware_ops fw_ops; struct ti_sci_proc_ops proc_ops; struct ti_sci_rm_core_ops rm_core_ops; struct ti_sci_rm_ringacc_ops rm_ring_ops; -- cgit v1.2.3 From 33fc7751b9adce0bc76989f399107078b2c21fd8 Mon Sep 17 00:00:00 2001 From: Moteen Shah Date: Mon, 9 Jun 2025 13:44:30 +0530 Subject: ti_sci_* : Add capability to access DM firmware's metadata Introduce response and request structs to receive and request information regarding DM version, etc from TI SCI. Signed-off-by: Moteen Shah Reviewed-by: Neha Malcom Francis Reviewed-by: Dhruva Gole --- include/linux/soc/ti/ti_sci_protocol.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'include/linux') diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h index f967077b756..52696763ecf 100644 --- a/include/linux/soc/ti/ti_sci_protocol.h +++ b/include/linux/soc/ti/ti_sci_protocol.h @@ -30,6 +30,28 @@ struct ti_sci_version_info { char firmware_description[32]; }; +/** + * struct ti_sci_dm_version_info - version information structure + * @abi_major: Major ABI version. Change here implies risk of backward + * compatibility break. + * @abi_minor: Minor ABI version. Change here implies new feature addition, + * or compatible change in ABI. + * @patch_ver: Patch version of the firmware. + * @sub_ver: Sub-version of the firmware. + * @dm_ver: DM version. + * @sci_server_version: Version string of the SCI server. + * @rm_pm_hal_version: Version string of the RM PM HAL. + */ +struct ti_sci_dm_version_info { + u8 abi_major; + u8 abi_minor; + u8 patch_ver; + u8 sub_ver; + u16 dm_ver; + char rm_pm_hal_version[12]; + char sci_server_version[26]; +}; + struct ti_sci_handle; /** @@ -265,10 +287,14 @@ struct ti_sci_core_ops { * struct ti_sci_firmware_ops - DM firmware operations * @query_dm_cap: Query the DM capabilities * Return 0 for successful query else appropriate error value. + * @get_dm_version: Get the DM version. + * Return 0 for successful request else appropriate error value. */ struct ti_sci_firmware_ops { int (*query_dm_cap)(struct ti_sci_handle *handle, u64 *dm_cap); + int (*get_dm_version)(struct ti_sci_handle *handle, + struct ti_sci_dm_version_info *get_dm_version); }; #define TI_SCI_MSG_FLAG_FW_CAP_DM 0x100 -- cgit v1.2.3