From 586a2fadadb160295a93e5d5d32db1a2558a4d3f Mon Sep 17 00:00:00 2001 From: Gaurav Kohli Date: Sun, 9 Aug 2026 17:59:00 +0530 Subject: [PATCH] remoteproc: qcom_q6v5_pas: enable QMI TMD cooling support Enable Thermal Mitigation Device (TMD) support for PAS-managed CDSP and modem remote processors on platforms that expose the QMI TMD service. This adds per-platform TMD configuration in qcom_q6v5_pas for: - Hamoa (X1E80100) CDSP - Kodiak CDSP and modem - Lemans (SA8775P) CDSP - Talos CDSP - Monaco CDSP For each remoteproc, the configured TMD QMI instance ID is used to bind to the TMD service running on that subsystem (e.g. CDSP: 0x43, modem: 0x0). The driver then uses the corresponding TMD endpoint names ("cdsp_sw", "pa", "modem") for cooling-device registration. QMI TMD identifies mitigation endpoints by name, while DT thermal bindings reference cooling devices by id. This change provides the mapping between DT cooling indices and QMI TMD names, allowing remoteproc nodes with #cooling-cells to act as cooling devices in the thermal framework. With this in place, thermal policies can request mitigation from CDSP and modem subsystems via QMI under thermal pressure. Reviewed-by: Daniel Lezcano Signed-off-by: Gaurav Kohli Link: https://lore.kernel.org/r/20260809-b4-qmi-tmd-v8-4-b15d47adc379@oss.qualcomm.com Signed-off-by: Bjorn Andersson --- drivers/remoteproc/qcom_q6v5_pas.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index d2f21053aed6..abc59c0c29f0 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -1084,6 +1084,15 @@ static void qcom_pas_remove(struct platform_device *pdev) device_init_wakeup(pas->dev, false); } +static const struct tmd_name cdsp_tmd_name[] = { + { .name = "cdsp_sw", .id = QCOM_TMD_CDSP_SW }, +}; + +static const struct tmd_name modem_tmd_name[] = { + { .name = "pa", .id = QCOM_TMD_PA }, + { .name = "modem", .id = QCOM_TMD_MODEM }, +}; + static const struct qcom_pas_data adsp_resource_init = { .crash_reason_smem = 423, .firmware_name = "adsp.mdt", @@ -1241,6 +1250,9 @@ static const struct qcom_pas_data sa8775p_cdsp0_resource = { .ssr_name = "cdsp", .sysmon_name = "cdsp", .ssctl_id = 0x17, + .tmd_instance_id = 0x43, + .tmd_name = cdsp_tmd_name, + .num_tmd = ARRAY_SIZE(cdsp_tmd_name), }; static const struct qcom_pas_data sa8775p_cdsp1_resource = { @@ -1259,6 +1271,9 @@ static const struct qcom_pas_data sa8775p_cdsp1_resource = { .ssr_name = "cdsp1", .sysmon_name = "cdsp1", .ssctl_id = 0x20, + .tmd_instance_id = 0x44, + .tmd_name = cdsp_tmd_name, + .num_tmd = ARRAY_SIZE(cdsp_tmd_name), }; static const struct qcom_pas_data sdm845_cdsp_resource_init = { @@ -1286,6 +1301,9 @@ static const struct qcom_pas_data sm6350_cdsp_resource = { .ssr_name = "cdsp", .sysmon_name = "cdsp", .ssctl_id = 0x17, + .tmd_instance_id = 0x43, + .tmd_name = cdsp_tmd_name, + .num_tmd = ARRAY_SIZE(cdsp_tmd_name), }; static const struct qcom_pas_data sm8150_cdsp_resource = { @@ -1301,6 +1319,9 @@ static const struct qcom_pas_data sm8150_cdsp_resource = { .ssr_name = "cdsp", .sysmon_name = "cdsp", .ssctl_id = 0x17, + .tmd_instance_id = 0x43, + .tmd_name = cdsp_tmd_name, + .num_tmd = ARRAY_SIZE(cdsp_tmd_name), }; static const struct qcom_pas_data sm8250_cdsp_resource = { @@ -1385,6 +1406,9 @@ static const struct qcom_pas_data x1e80100_cdsp_resource = { .ssr_name = "cdsp", .sysmon_name = "cdsp", .ssctl_id = 0x17, + .tmd_instance_id = 0x43, + .tmd_name = cdsp_tmd_name, + .num_tmd = ARRAY_SIZE(cdsp_tmd_name), }; static const struct qcom_pas_data sm8350_cdsp_resource = { @@ -1453,6 +1477,9 @@ static const struct qcom_pas_data mpss_resource_init = { .ssr_name = "mpss", .sysmon_name = "modem", .ssctl_id = 0x12, + .tmd_instance_id = 0x0, + .tmd_name = modem_tmd_name, + .num_tmd = ARRAY_SIZE(modem_tmd_name), }; static const struct qcom_pas_data sc8180x_mpss_resource = {