From nobody Mon Nov 25 09:46:19 2024 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C58F2AE8C; Mon, 28 Oct 2024 13:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730122357; cv=none; b=W1ERa3yaciFUn0QdwbDZntNGSa06LPyQXX+i6yamxCmkocF6lzIbd1ZhNtFAw2DGYEGkRx7EesNyK37NveG/52GkbepZHRpmRTtMM5kiaRnX94wLFsnCwEpWpGoRe8TGKXHWorKW9l7Zg/EP2L5KYVxTJdckF/0VfJkKYheV8II= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730122357; c=relaxed/simple; bh=mAVtPpFrOmntFy105e+C6qV9SzAVVvKPyvnFgnACSWo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HP6I/e9jVjMKL99sPWX+A5cLk+zcGofUo9+cje99eXuv/lreq0szBMsydzc4fYLaGhPbknAcxJA9FDBRbekZJQL3tyXvcrG2ggMeeUBIU3JNC7qqVbxoz/mkc3Agpw1jAS97kjcXatVjkXiZRE3kLjcCO2lw258/Yj78huVHZFU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=V+rAA768; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="V+rAA768" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49SBBSUA011999; Mon, 28 Oct 2024 13:32:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=zqHPxMXHqfi7NVSYF4HguTwkrEuZ+fhq5q7 oUKBkW2Q=; b=V+rAA768WUpGYq2wt6gzKONP3+lj3VVWyvmF1TCM3B9pivBK8O1 UKUT8q/YmEkrekCcgne4vGXDF/7e7JrC2QC91RqH6ET6J8vMQPHrepziUUKS3bFF 0Yi9aHPvzT+pW1FRkwv5pBOqEMc14hdectJtyDq4PRsrKAFMFxj1+wGVzTCozsBr caBInd8qkj3vgd+kIQOP98DQXZxxDEFeuia5WscunRcrDKzVj6tejHZYG4kRpt0m g6sEIDpCAe16ZI9BGx/Br1R+V/7RLcBBztCC6VNrNjVrJt0NzfnPApKzn9RmWszg ged/XjjnRmnbPD21T5OvZ+S2vp97hpX6wzQ== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gr0x53u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2024 13:32:27 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTP id 49SDWMRS001726; Mon, 28 Oct 2024 13:32:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 42gsgknrpx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2024 13:32:22 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 49SDU5KD031754; Mon, 28 Oct 2024 13:32:21 GMT Received: from hu-devc-hyd-u22-c.qualcomm.com (hu-wasimn-hyd.qualcomm.com [10.147.246.180]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 49SDWLIV001718 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Oct 2024 13:32:21 +0000 Received: by hu-devc-hyd-u22-c.qualcomm.com (Postfix, from userid 3944840) id 6AF74593; Mon, 28 Oct 2024 19:02:20 +0530 (+0530) From: Wasim Nazir To: Bjorn Andersson , Mathieu Poirier Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Wasim Nazir Subject: [RFC] remoteproc: Clean rproc-driver-data for each instance Date: Mon, 28 Oct 2024 19:02:16 +0530 Message-ID: <20241028133216.3711914-1-quic_wasimn@quicinc.com> X-Mailer: git-send-email 2.46.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: nl1GK8yeN5dG0oCs4N7mMDTO87nB92sV X-Proofpoint-GUID: nl1GK8yeN5dG0oCs4N7mMDTO87nB92sV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 clxscore=1015 bulkscore=0 adultscore=0 impostorscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410280109 Content-Type: text/plain; charset="utf-8" Currently, all Qualcomm remoteproc client drivers have data structures with many common fields. Clean these data structures to categorize the common fields and create macros to fill rproc-driver-data instances. This will help reduce duplicates and make it easier for developers to fill data using the macros. Currently, changes have been added for the PAS driver only. Signed-off-by: Wasim Nazir --- drivers/remoteproc/qcom_q6v5_pas.c | 737 +++++------------------------ 1 file changed, 129 insertions(+), 608 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q= 6v5_pas.c index ef82835e98a4..58311c9ad609 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -819,613 +819,134 @@ static void adsp_remove(struct platform_device *pde= v) device_init_wakeup(adsp->dev, false); } -static const struct adsp_data adsp_resource_init =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data sa8775p_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mbn", - .pas_id =3D 1, - .minidump_id =3D 5, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data sdm845_adsp_resource_init =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data sm6350_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data sm6375_mpss_resource =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .pas_id =3D 4, - .minidump_id =3D 3, - .auto_boot =3D false, - .proxy_pd_names =3D (char*[]){ - "cx", - NULL - }, - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x12, -}; - -static const struct adsp_data sm8150_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data sm8250_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data sm8350_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data msm8996_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .pas_id =3D 1, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - NULL - }, - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data cdsp_resource_init =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sa8775p_cdsp0_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp0.mbn", - .pas_id =3D 18, - .minidump_id =3D 7, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - "nsp", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sa8775p_cdsp1_resource =3D { - .crash_reason_smem =3D 633, - .firmware_name =3D "cdsp1.mbn", - .pas_id =3D 30, - .minidump_id =3D 20, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - "nsp", - NULL - }, - .load_state =3D "nsp", - .ssr_name =3D "cdsp1", - .sysmon_name =3D "cdsp1", - .ssctl_id =3D 0x20, -}; - -static const struct adsp_data sdm845_cdsp_resource_init =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sm6350_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mx", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sm8150_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sm8250_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sc8280xp_nsp0_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "nsp", - NULL - }, - .ssr_name =3D "cdsp0", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sc8280xp_nsp1_resource =3D { - .crash_reason_smem =3D 633, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 30, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "nsp", - NULL - }, - .ssr_name =3D "cdsp1", - .sysmon_name =3D "cdsp1", - .ssctl_id =3D 0x20, -}; - -static const struct adsp_data x1e80100_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .dtb_firmware_name =3D "adsp_dtb.mdt", - .pas_id =3D 1, - .dtb_pas_id =3D 0x24, - .lite_pas_id =3D 0x1f, - .minidump_id =3D 5, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, -}; - -static const struct adsp_data x1e80100_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .dtb_firmware_name =3D "cdsp_dtb.mdt", - .pas_id =3D 18, - .dtb_pas_id =3D 0x25, - .minidump_id =3D 7, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - "nsp", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sm8350_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .pas_id =3D 18, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, -}; - -static const struct adsp_data sa8775p_gpdsp0_resource =3D { - .crash_reason_smem =3D 640, - .firmware_name =3D "gpdsp0.mbn", - .pas_id =3D 39, - .minidump_id =3D 21, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - NULL - }, - .load_state =3D "gpdsp0", - .ssr_name =3D "gpdsp0", - .sysmon_name =3D "gpdsp0", - .ssctl_id =3D 0x21, -}; - -static const struct adsp_data sa8775p_gpdsp1_resource =3D { - .crash_reason_smem =3D 641, - .firmware_name =3D "gpdsp1.mbn", - .pas_id =3D 40, - .minidump_id =3D 22, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - NULL - }, - .load_state =3D "gpdsp1", - .ssr_name =3D "gpdsp1", - .sysmon_name =3D "gpdsp1", - .ssctl_id =3D 0x22, -}; - -static const struct adsp_data mpss_resource_init =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .pas_id =3D 4, - .minidump_id =3D 3, - .auto_boot =3D false, - .proxy_pd_names =3D (char*[]){ - "cx", - "mss", - NULL - }, - .load_state =3D "modem", - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x12, -}; - -static const struct adsp_data sc8180x_mpss_resource =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .pas_id =3D 4, - .auto_boot =3D false, - .proxy_pd_names =3D (char*[]){ - "cx", - NULL - }, - .load_state =3D "modem", - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x12, -}; - -static const struct adsp_data msm8996_slpi_resource_init =3D { - .crash_reason_smem =3D 424, - .firmware_name =3D "slpi.mdt", - .pas_id =3D 12, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "ssc_cx", - NULL - }, - .ssr_name =3D "dsps", - .sysmon_name =3D "slpi", - .ssctl_id =3D 0x16, -}; - -static const struct adsp_data sdm845_slpi_resource_init =3D { - .crash_reason_smem =3D 424, - .firmware_name =3D "slpi.mdt", - .pas_id =3D 12, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "slpi", - .ssr_name =3D "dsps", - .sysmon_name =3D "slpi", - .ssctl_id =3D 0x16, -}; - -static const struct adsp_data wcss_resource_init =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "wcnss.mdt", - .pas_id =3D 6, - .auto_boot =3D true, - .ssr_name =3D "mpss", - .sysmon_name =3D "wcnss", - .ssctl_id =3D 0x12, -}; - -static const struct adsp_data sdx55_mpss_resource =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .pas_id =3D 4, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mss", - NULL - }, - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x22, -}; - -static const struct adsp_data sm8450_mpss_resource =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .pas_id =3D 4, - .minidump_id =3D 3, - .auto_boot =3D false, - .decrypt_shutdown =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mss", - NULL - }, - .load_state =3D "modem", - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x12, -}; - -static const struct adsp_data sm8550_adsp_resource =3D { - .crash_reason_smem =3D 423, - .firmware_name =3D "adsp.mdt", - .dtb_firmware_name =3D "adsp_dtb.mdt", - .pas_id =3D 1, - .dtb_pas_id =3D 0x24, - .minidump_id =3D 5, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "lcx", - "lmx", - NULL - }, - .load_state =3D "adsp", - .ssr_name =3D "lpass", - .sysmon_name =3D "adsp", - .ssctl_id =3D 0x14, - .smem_host_id =3D 2, -}; - -static const struct adsp_data sm8550_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .dtb_firmware_name =3D "cdsp_dtb.mdt", - .pas_id =3D 18, - .dtb_pas_id =3D 0x25, - .minidump_id =3D 7, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - "nsp", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, - .smem_host_id =3D 5, -}; - -static const struct adsp_data sm8550_mpss_resource =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .dtb_firmware_name =3D "modem_dtb.mdt", - .pas_id =3D 4, - .dtb_pas_id =3D 0x26, - .minidump_id =3D 3, - .auto_boot =3D false, - .decrypt_shutdown =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mss", - NULL - }, - .load_state =3D "modem", - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x12, - .smem_host_id =3D 1, - .region_assign_idx =3D 2, - .region_assign_count =3D 1, - .region_assign_vmid =3D QCOM_SCM_VMID_MSS_MSA, -}; - -static const struct adsp_data sc7280_wpss_resource =3D { - .crash_reason_smem =3D 626, - .firmware_name =3D "wpss.mdt", - .pas_id =3D 6, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mx", - NULL - }, - .load_state =3D "wpss", - .ssr_name =3D "wpss", - .sysmon_name =3D "wpss", - .ssctl_id =3D 0x19, -}; - -static const struct adsp_data sm8650_cdsp_resource =3D { - .crash_reason_smem =3D 601, - .firmware_name =3D "cdsp.mdt", - .dtb_firmware_name =3D "cdsp_dtb.mdt", - .pas_id =3D 18, - .dtb_pas_id =3D 0x25, - .minidump_id =3D 7, - .auto_boot =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mxc", - "nsp", - NULL - }, - .load_state =3D "cdsp", - .ssr_name =3D "cdsp", - .sysmon_name =3D "cdsp", - .ssctl_id =3D 0x17, - .smem_host_id =3D 5, - .region_assign_idx =3D 2, - .region_assign_count =3D 1, - .region_assign_shared =3D true, - .region_assign_vmid =3D QCOM_SCM_VMID_CDSP, -}; +#define RPROC_DATA_COMMON_adsp = \ + .crash_reason_smem =3D 423, .pas_id =3D 1, .firmware_name =3D "adsp.mdt",= \ + .ssr_name =3D "lpass", .sysmon_name =3D "adsp", .ssctl_id =3D 0x14 +#define RPROC_DATA_COMMON_adsp_mbn = \ + .crash_reason_smem =3D 423, .pas_id =3D 1, .firmware_name =3D "adsp.mbn",= \ + .ssr_name =3D "lpass", .sysmon_name =3D "adsp", .ssctl_id =3D 0x14 + +#define RPROC_DATA_COMMON_mpss = \ + .crash_reason_smem =3D 421, .pas_id =3D 4, .firmware_name =3D "modem.mdt"= , \ + .ssr_name =3D "mpss", .sysmon_name =3D "modem", .ssctl_id =3D 0x12 +#define RPROC_DATA_COMMON_mpss1 = \ + .crash_reason_smem =3D 421, .pas_id =3D 4, .firmware_name =3D "modem.mdt"= , \ + .ssr_name =3D "mpss", .sysmon_name =3D "modem", .ssctl_id =3D 0x22 + +#define RPROC_DATA_COMMON_cdsp = \ + .crash_reason_smem =3D 601, .pas_id =3D 18, .firmware_name =3D "cdsp.mdt"= , \ + .ssr_name =3D "cdsp", .sysmon_name =3D "cdsp", .ssctl_id =3D 0x17 +#define RPROC_DATA_COMMON_nsp0 = \ + .crash_reason_smem =3D 601, .pas_id =3D 18, .firmware_name =3D "cdsp.mdt"= , \ + .ssr_name =3D "cdsp0", .sysmon_name =3D "cdsp", .ssctl_id =3D 0x17 +#define RPROC_DATA_COMMON_cdsp0 = \ + .crash_reason_smem =3D 601, .pas_id =3D 18, .firmware_name =3D "cdsp0.mbn= ", \ + .ssr_name =3D "cdsp", .sysmon_name =3D "cdsp", .ssctl_id =3D 0x17 + +#define RPROC_DATA_COMMON_nsp1 = \ + .crash_reason_smem =3D 633, .pas_id =3D 30, .firmware_name =3D "cdsp.mdt"= , \ + .ssr_name =3D "cdsp1", .sysmon_name =3D "cdsp1", .ssctl_id =3D 0x20 +#define RPROC_DATA_COMMON_cdsp1 = \ + .crash_reason_smem =3D 633, .pas_id =3D 30, .firmware_name =3D "cdsp1.mbn= ", \ + .ssr_name =3D "cdsp1", .sysmon_name =3D "cdsp1", .ssctl_id =3D 0x20 + +#define RPROC_DATA_COMMON_slpi = \ + .crash_reason_smem =3D 424, .pas_id =3D 12, .firmware_name =3D "slpi.mdt"= , \ + .ssr_name =3D "dsps", .sysmon_name =3D "slpi", .ssctl_id =3D 0x16 +#define RPROC_DATA_COMMON_wcnss = \ + .crash_reason_smem =3D 421, .pas_id =3D 6, .firmware_name =3D "wcnss.mdt"= , \ + .ssr_name =3D "mpss", .sysmon_name =3D "wcnss", .ssctl_id =3D 0x12 +#define RPROC_DATA_COMMON_wpss = \ + .crash_reason_smem =3D 626, .pas_id =3D 6, .firmware_name =3D "wpss.mdt",= \ + .ssr_name =3D "wpss", .sysmon_name =3D "wpss", .ssctl_id =3D 0x19 + +#define RPROC_DATA_COMMON_gpdsp0 = \ + .crash_reason_smem =3D 640, .pas_id =3D 39, .firmware_name =3D "gpdsp0.mb= n", \ + .ssr_name =3D "gpdsp0", .sysmon_name =3D "gpdsp0", .ssctl_id =3D 0x21 +#define RPROC_DATA_COMMON_gpdsp1 = \ + .crash_reason_smem =3D 641, .pas_id =3D 40, .firmware_name =3D "gpdsp1.mb= n", \ + .ssr_name =3D "gpdsp1", .sysmon_name =3D "gpdsp1", .ssctl_id =3D 0x22 + +#define RPROC_DATA_COMMON_FOR_SS(ss) RPROC_DATA_COMMON_##ss + +#define RPROC_DATA_FILLER(target, ss, dtpid, dtfname, lid, mid, sid, autob= , \ + decshut, loadstate, regidx, regcnt, regshd, regvmid, \ + ...) \ + static const struct adsp_data target##_##ss##_resource =3D { \ + RPROC_DATA_COMMON_FOR_SS(ss), \ + .dtb_pas_id =3D dtpid, \ + .dtb_firmware_name =3D dtfname, \ + .lite_pas_id =3D lid, \ + .minidump_id =3D mid, \ + .smem_host_id =3D sid, \ + .auto_boot =3D autob, \ + .decrypt_shutdown =3D decshut, \ + .proxy_pd_names =3D (char *[]){ __VA_ARGS__ }, \ + .load_state =3D loadstate, \ + .region_assign_idx =3D regidx, \ + .region_assign_count =3D regcnt, \ + .region_assign_shared =3D regshd, \ + .region_assign_vmid =3D regvmid, \ + } -static const struct adsp_data sm8650_mpss_resource =3D { - .crash_reason_smem =3D 421, - .firmware_name =3D "modem.mdt", - .dtb_firmware_name =3D "modem_dtb.mdt", - .pas_id =3D 4, - .dtb_pas_id =3D 0x26, - .minidump_id =3D 3, - .auto_boot =3D false, - .decrypt_shutdown =3D true, - .proxy_pd_names =3D (char*[]){ - "cx", - "mss", - NULL - }, - .load_state =3D "modem", - .ssr_name =3D "mpss", - .sysmon_name =3D "modem", - .ssctl_id =3D 0x12, - .smem_host_id =3D 1, - .region_assign_idx =3D 2, - .region_assign_count =3D 3, - .region_assign_vmid =3D QCOM_SCM_VMID_MSS_MSA, -}; +RPROC_DATA_FILLER(common, adsp, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, NULL); +RPROC_DATA_FILLER(sa8775p, adsp_mbn, 0, NULL, 0, = 5, 0, true, false, "adsp", 0, 0, false, 0, "lcx", "lmx", NUL= L); +RPROC_DATA_FILLER(sdm845, adsp, 0, NULL, 0, 0, 0= , true, false, "adsp", 0, 0, false, 0, NULL); +RPROC_DATA_FILLER(sm6350, adsp, 0, NULL, 0, 0, 0= , true, false, "adsp", 0, 0, false, 0, "lcx", = "lmx", NULL); +RPROC_DATA_FILLER(sm6375, mpss, 0, NULL, 0, 3, 0= , false, false, NULL, 0, 0, false, 0, "cx", = NULL); +RPROC_DATA_FILLER(sm8150, adsp, 0, NULL, 0, 0, 0= , true, false, "adsp", 0, 0, false, 0, "cx", = NULL); +RPROC_DATA_FILLER(sm8250, adsp, 0, NULL, 0, 0, 0= , true, false, "adsp", 0, 0, false, 0, "lcx", = "lmx", NULL); +RPROC_DATA_FILLER(sm8350, adsp, 0, NULL, 0, 0, 0= , true, false, "adsp", 0, 0, false, 0, "lcx", = "lmx", NULL); +RPROC_DATA_FILLER(msm8996, adsp, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, "cx", = NULL); +RPROC_DATA_FILLER(common, cdsp, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, NULL); +RPROC_DATA_FILLER(sa8775p, cdsp0, 0, NULL, 0, 7, = 0, true, false, NULL, 0, 0, false, 0, "cx", "mxc", "nsp", NULL); +RPROC_DATA_FILLER(sa8775p, cdsp1, 0, NULL, 0, 20,= 0, true, false, NULL, 0, 0, false, 0, "cx", "mxc", "nsp", NULL); +RPROC_DATA_FILLER(sdm845, cdsp, 0, NULL, 0, 0, 0= , true, false, "cdsp", 0, 0, false, 0, NULL); +RPROC_DATA_FILLER(sm6350, cdsp, 0, NULL, 0, 0, 0= , true, false, "cdsp", 0, 0, false, 0, "cx", = "mx", NULL); +RPROC_DATA_FILLER(sm8150, cdsp, 0, NULL, 0, 0, 0= , true, false, "cdsp", 0, 0, false, 0, "cx", = NULL); +RPROC_DATA_FILLER(sm8250, cdsp, 0, NULL, 0, 0, 0= , true, false, "cdsp", 0, 0, false, 0, "cx", = NULL); +RPROC_DATA_FILLER(sc8280xp, nsp0, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, "nsp", = NULL); +RPROC_DATA_FILLER(sc8280xp, nsp1, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, "nsp", = NULL); +RPROC_DATA_FILLER(x1e80100, adsp, 0x24, "adsp_dtb.mdt", 0x1f, 5, 0= , true, false, "adsp", 0, 0, false, 0, "lcx", = "lmx", NULL); +RPROC_DATA_FILLER(x1e80100, cdsp, 0x25, "cdsp_dtb.mdt", 0, 7, 0= , true, false, "cdsp", 0, 0, false, 0, "cx", = "mxc", "nsp", NULL); +RPROC_DATA_FILLER(sm8350, cdsp, 0, NULL, 0, 0, 0= , true, false, "cdsp", 0, 0, false, 0, "cx", = "mxc", NULL); +RPROC_DATA_FILLER(sa8775p, gpdsp0, 0, NULL, 0, 21= , 0, true, false, NULL, 0, 0, false, 0, "cx", "mxc", NULL); +RPROC_DATA_FILLER(sa8775p, gpdsp1, 0, NULL, 0, 22= , 0, true, false, NULL, 0, 0, false, 0, "cx", "mxc", NULL); +RPROC_DATA_FILLER(common, mpss, 0, NULL, 0, 3, 0= , false, false, "modem", 0, 0, false, 0, "cx", = "mss", NULL); +RPROC_DATA_FILLER(sc8180x, mpss, 0, NULL, 0, 0, 0= , false, false, "modem", 0, 0, false, 0, "cx", = NULL); +RPROC_DATA_FILLER(msm8996, slpi, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, "ssc_cx= ", NULL); +RPROC_DATA_FILLER(sdm845, slpi, 0, NULL, 0, 0, 0= , true, false, "slpi", 0, 0, false, 0, "lcx", = "lmx", NULL); +RPROC_DATA_FILLER(qcs404, wcnss, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, NULL); +RPROC_DATA_FILLER(sdx55, mpss1, 0, NULL, 0, 0, 0= , true, false, NULL, 0, 0, false, 0, "cx", = "mss", NULL); +RPROC_DATA_FILLER(sm8450, mpss, 0, NULL, 0, 3, 0= , false, true, "modem", 0, 0, false, 0, "cx", = "mss", NULL); +RPROC_DATA_FILLER(sm8550, adsp, 0x24, "adsp_dtb.mdt", 0, 5, 2= , true, false, "adsp", 0, 0, false, 0, "lcx", = "lmx", NULL); +RPROC_DATA_FILLER(sm8550, cdsp, 0x25, "cdsp_dtb.mdt", 0, 7, 5= , true, false, "cdsp", 0, 0, false, 0, "cx", = "mxc", "nsp", NULL); +RPROC_DATA_FILLER(sm8550, mpss, 0x26, "modem_dtb.mdt", 0, 3, 1= , false, true, "modem", 2, 1, false, QCOM_SCM_VMID_MSS_MSA, "cx", = "mss", NULL); +RPROC_DATA_FILLER(sc7280, wpss, 0, NULL, 0, 0, 0= , true, false, "wpss", 0, 0, false, 0, "cx", = "mx", NULL); +RPROC_DATA_FILLER(sm8650, cdsp, 0x25, "cdsp_dtb.mdt", 0, 7, 5= , true, false, "cdsp", 2, 1, true, QCOM_SCM_VMID_CDSP, "cx", = "mxc", "nsp", NULL); +RPROC_DATA_FILLER(sm8650, mpss, 0x26, "modem_dtb.mdt", 0, 3, 1= , false, true, "modem", 2, 3, false, QCOM_SCM_VMID_MSS_MSA, "cx", = "mss", NULL); static const struct of_device_id adsp_of_match[] =3D { - { .compatible =3D "qcom,msm8226-adsp-pil", .data =3D &adsp_resource_init}, + { .compatible =3D "qcom,msm8226-adsp-pil", .data =3D &common_adsp_resourc= e}, { .compatible =3D "qcom,msm8953-adsp-pil", .data =3D &msm8996_adsp_resour= ce}, - { .compatible =3D "qcom,msm8974-adsp-pil", .data =3D &adsp_resource_init}, + { .compatible =3D "qcom,msm8974-adsp-pil", .data =3D &common_adsp_resourc= e}, { .compatible =3D "qcom,msm8996-adsp-pil", .data =3D &msm8996_adsp_resour= ce}, - { .compatible =3D "qcom,msm8996-slpi-pil", .data =3D &msm8996_slpi_resour= ce_init}, + { .compatible =3D "qcom,msm8996-slpi-pil", .data =3D &msm8996_slpi_resour= ce}, { .compatible =3D "qcom,msm8998-adsp-pas", .data =3D &msm8996_adsp_resour= ce}, - { .compatible =3D "qcom,msm8998-slpi-pas", .data =3D &msm8996_slpi_resour= ce_init}, - { .compatible =3D "qcom,qcs404-adsp-pas", .data =3D &adsp_resource_init }, - { .compatible =3D "qcom,qcs404-cdsp-pas", .data =3D &cdsp_resource_init }, - { .compatible =3D "qcom,qcs404-wcss-pas", .data =3D &wcss_resource_init }, - { .compatible =3D "qcom,sa8775p-adsp-pas", .data =3D &sa8775p_adsp_resour= ce}, + { .compatible =3D "qcom,msm8998-slpi-pas", .data =3D &msm8996_slpi_resour= ce}, + { .compatible =3D "qcom,qcs404-adsp-pas", .data =3D &common_adsp_resource= }, + { .compatible =3D "qcom,qcs404-cdsp-pas", .data =3D &common_cdsp_resource= }, + { .compatible =3D "qcom,qcs404-wcss-pas", .data =3D &qcs404_wcnss_resourc= e }, + { .compatible =3D "qcom,sa8775p-adsp-pas", .data =3D &sa8775p_adsp_mbn_re= source}, { .compatible =3D "qcom,sa8775p-cdsp0-pas", .data =3D &sa8775p_cdsp0_reso= urce}, { .compatible =3D "qcom,sa8775p-cdsp1-pas", .data =3D &sa8775p_cdsp1_reso= urce}, { .compatible =3D "qcom,sa8775p-gpdsp0-pas", .data =3D &sa8775p_gpdsp0_re= source}, { .compatible =3D "qcom,sa8775p-gpdsp1-pas", .data =3D &sa8775p_gpdsp1_re= source}, { .compatible =3D "qcom,sc7180-adsp-pas", .data =3D &sm8250_adsp_resource= }, - { .compatible =3D "qcom,sc7180-mpss-pas", .data =3D &mpss_resource_init}, + { .compatible =3D "qcom,sc7180-mpss-pas", .data =3D &common_mpss_resource= }, { .compatible =3D "qcom,sc7280-adsp-pas", .data =3D &sm8350_adsp_resource= }, { .compatible =3D "qcom,sc7280-cdsp-pas", .data =3D &sm6350_cdsp_resource= }, - { .compatible =3D "qcom,sc7280-mpss-pas", .data =3D &mpss_resource_init}, + { .compatible =3D "qcom,sc7280-mpss-pas", .data =3D &common_mpss_resource= }, { .compatible =3D "qcom,sc7280-wpss-pas", .data =3D &sc7280_wpss_resource= }, { .compatible =3D "qcom,sc8180x-adsp-pas", .data =3D &sm8150_adsp_resourc= e}, { .compatible =3D "qcom,sc8180x-cdsp-pas", .data =3D &sm8150_cdsp_resourc= e}, @@ -1433,35 +954,35 @@ static const struct of_device_id adsp_of_match[] =3D= { { .compatible =3D "qcom,sc8280xp-adsp-pas", .data =3D &sm8250_adsp_resour= ce}, { .compatible =3D "qcom,sc8280xp-nsp0-pas", .data =3D &sc8280xp_nsp0_reso= urce}, { .compatible =3D "qcom,sc8280xp-nsp1-pas", .data =3D &sc8280xp_nsp1_reso= urce}, - { .compatible =3D "qcom,sdm660-adsp-pas", .data =3D &adsp_resource_init}, - { .compatible =3D "qcom,sdm845-adsp-pas", .data =3D &sdm845_adsp_resource= _init}, - { .compatible =3D "qcom,sdm845-cdsp-pas", .data =3D &sdm845_cdsp_resource= _init}, - { .compatible =3D "qcom,sdm845-slpi-pas", .data =3D &sdm845_slpi_resource= _init}, - { .compatible =3D "qcom,sdx55-mpss-pas", .data =3D &sdx55_mpss_resource}, + { .compatible =3D "qcom,sdm660-adsp-pas", .data =3D &common_adsp_resource= }, + { .compatible =3D "qcom,sdm845-adsp-pas", .data =3D &sdm845_adsp_resource= }, + { .compatible =3D "qcom,sdm845-cdsp-pas", .data =3D &sdm845_cdsp_resource= }, + { .compatible =3D "qcom,sdm845-slpi-pas", .data =3D &sdm845_slpi_resource= }, + { .compatible =3D "qcom,sdx55-mpss-pas", .data =3D &sdx55_mpss1_resource}, { .compatible =3D "qcom,sdx75-mpss-pas", .data =3D &sm8650_mpss_resource}, - { .compatible =3D "qcom,sm6115-adsp-pas", .data =3D &adsp_resource_init}, - { .compatible =3D "qcom,sm6115-cdsp-pas", .data =3D &cdsp_resource_init}, + { .compatible =3D "qcom,sm6115-adsp-pas", .data =3D &common_adsp_resource= }, + { .compatible =3D "qcom,sm6115-cdsp-pas", .data =3D &common_cdsp_resource= }, { .compatible =3D "qcom,sm6115-mpss-pas", .data =3D &sc8180x_mpss_resourc= e}, { .compatible =3D "qcom,sm6350-adsp-pas", .data =3D &sm6350_adsp_resource= }, { .compatible =3D "qcom,sm6350-cdsp-pas", .data =3D &sm6350_cdsp_resource= }, - { .compatible =3D "qcom,sm6350-mpss-pas", .data =3D &mpss_resource_init}, + { .compatible =3D "qcom,sm6350-mpss-pas", .data =3D &common_mpss_resource= }, { .compatible =3D "qcom,sm6375-adsp-pas", .data =3D &sm6350_adsp_resource= }, { .compatible =3D "qcom,sm6375-cdsp-pas", .data =3D &sm8150_cdsp_resource= }, { .compatible =3D "qcom,sm6375-mpss-pas", .data =3D &sm6375_mpss_resource= }, { .compatible =3D "qcom,sm8150-adsp-pas", .data =3D &sm8150_adsp_resource= }, { .compatible =3D "qcom,sm8150-cdsp-pas", .data =3D &sm8150_cdsp_resource= }, - { .compatible =3D "qcom,sm8150-mpss-pas", .data =3D &mpss_resource_init}, - { .compatible =3D "qcom,sm8150-slpi-pas", .data =3D &sdm845_slpi_resource= _init}, + { .compatible =3D "qcom,sm8150-mpss-pas", .data =3D &common_mpss_resource= }, + { .compatible =3D "qcom,sm8150-slpi-pas", .data =3D &sdm845_slpi_resource= }, { .compatible =3D "qcom,sm8250-adsp-pas", .data =3D &sm8250_adsp_resource= }, { .compatible =3D "qcom,sm8250-cdsp-pas", .data =3D &sm8250_cdsp_resource= }, - { .compatible =3D "qcom,sm8250-slpi-pas", .data =3D &sdm845_slpi_resource= _init}, + { .compatible =3D "qcom,sm8250-slpi-pas", .data =3D &sdm845_slpi_resource= }, { .compatible =3D "qcom,sm8350-adsp-pas", .data =3D &sm8350_adsp_resource= }, { .compatible =3D "qcom,sm8350-cdsp-pas", .data =3D &sm8350_cdsp_resource= }, - { .compatible =3D "qcom,sm8350-slpi-pas", .data =3D &sdm845_slpi_resource= _init}, - { .compatible =3D "qcom,sm8350-mpss-pas", .data =3D &mpss_resource_init}, + { .compatible =3D "qcom,sm8350-slpi-pas", .data =3D &sdm845_slpi_resource= }, + { .compatible =3D "qcom,sm8350-mpss-pas", .data =3D &common_mpss_resource= }, { .compatible =3D "qcom,sm8450-adsp-pas", .data =3D &sm8350_adsp_resource= }, { .compatible =3D "qcom,sm8450-cdsp-pas", .data =3D &sm8350_cdsp_resource= }, - { .compatible =3D "qcom,sm8450-slpi-pas", .data =3D &sdm845_slpi_resource= _init}, + { .compatible =3D "qcom,sm8450-slpi-pas", .data =3D &sdm845_slpi_resource= }, { .compatible =3D "qcom,sm8450-mpss-pas", .data =3D &sm8450_mpss_resource= }, { .compatible =3D "qcom,sm8550-adsp-pas", .data =3D &sm8550_adsp_resource= }, { .compatible =3D "qcom,sm8550-cdsp-pas", .data =3D &sm8550_cdsp_resource= }, -- 2.46.1