From nobody Tue Oct 7 08:38:14 2025 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 21B0127B4F2; Fri, 11 Jul 2025 09:40:59 +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=1752226862; cv=none; b=hUz0l5SrY7B60/sBbdADWhBa4wsOQTGi0FriUP9rUA0wul4XdSCxZY8MT3VJHHVnY9G90m0DJqIpyg44vm1SXawyh3rDj2q2aSzsT2FKHyTd5KoiY5bNnQ41SDgaSh2+JNTlI0ynKM0s6q/A8rwCwudxwzjY9IVSCSBBN20CV+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752226862; c=relaxed/simple; bh=ETO7lievG1x9ZBr7VIlvumBOeDyEWmpjU5kaaIr0klI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YiJAJJz2tKhRG+34geDFzmFTOUUE/rp4qaCHpFo4L3i5oW6ou8mzLE4R63ZSRxFiS2kXDqcng38ZLm1Zx0s97chio/MWADFPNe2d6JGeD0oa4A9oE0KhdxtfRp5wntEFCVMRgTyWjfXFkkx2tKP3K+SODSDi7syqXDaKA+qaVaE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=jRv41im0; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jRv41im0" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56B1X5Lk001258; Fri, 11 Jul 2025 09:40:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= r/qWxdxxHpThKGwDFM8CASPxln5OqgHWkEroR6zYclE=; b=jRv41im0TERMz6K6 cKwypJYw1ma6gUi9HKnEtxktRCVpj+a+zmRYYkRcudQSjl7kRq/MLbKEwXpsW3Am +Knx/prnEKKR0+eTP3Q4XXQTa/HkQ0r5lM3JLjZ+EA6lrMpuhdvw2s22W8Pghv0r TjUiJTJEuvw6Fej4IKn4q3tuhUAaHUW5T1IWwHqYtglNNnIrc39RjyO4ZFNlPtz1 msw81ORyu3xFJxGeBHREYR0gQrmFMrCQBQyK8Z8fLntByXf4snAlGymsMnLXuGVC Q30cCw7sa1RJBXTskdtp7RaYLlkQwW56v1wc2t8LE3bTIzSroKj+HsqHz80CoCwG McUEYA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47pucnbhem-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:47 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 56B9ekkl024445 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:46 GMT Received: from hu-jinlmao-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 11 Jul 2025 02:40:46 -0700 From: Mao Jinlong To: Suzuki K Poulose , Mike Leach , James Clark , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mao Jinlong , "Alexander Shishkin" , Bjorn Andersson , Konrad Dybcio CC: , , , , Subject: [PATCH v6 1/5] dt-bindings: arm: Add CoreSight QMI component description Date: Fri, 11 Jul 2025 02:40:27 -0700 Message-ID: <20250711094031.4171091-2-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> References: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> 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-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=GdQXnRXL c=1 sm=1 tr=0 ts=6870dc1f cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=3H110R4YSZwA:10 a=Wb1JkmetP80A:10 a=gEfo2CItAAAA:8 a=COk6AnOGAAAA:8 a=VdmNJPKJaTtzAbcruW8A:9 a=sptkURWiP4Gy88Gu7hUp:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: wBzAz10I7jozGN_ABxDLbZrQ45FW6OgP X-Proofpoint-ORIG-GUID: wBzAz10I7jozGN_ABxDLbZrQ45FW6OgP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzExMDA2NyBTYWx0ZWRfX/5aZ0rX3hiMm Ygico7mIjMw5qJYSMA+rbCmnojDxNnlbTHRMTsdGVzipZ82/H3Fr5f2us5ikRlpdhTj5o5t2xVE lJ2/d+hlP432htrG6nm9OxfLddBmPTo5fLqdyVnXEHberH9xFq8fWE071NqAlrmqhUNtoUS0r0K LbP+cYJ57TZA+XymCf+bXwfpfZJj8pL4NuOVWuPZklNSQMlGm6MqWHrGC9PZQorF8ZQonX40vSC j+y2rRgS04gvcP03RpiIB22CsVXrERX79qW5pZ4ewtklEi5IBc/kod/XbAs4/4r8dhYdn4FL/oe sVqv3JKT3OWrHXGeMThsud2FD34tjQ2QOeJGmcTAixSZ1LBjEVKk9HmAtOxA3PnZA1fuepSSiBz scQZHNEfYHHpJ6j/IXar/jiLkaCxo5cw4DrU7OW9iZSLzkJMF4VwQUF+ulK8AqgnnauDiKxq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-11_03,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 malwarescore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507110067 Content-Type: text/plain; charset="utf-8" Add new coresight-qmi.yaml file describing the bindings required to define qmi node in the device trees. Signed-off-by: Mao Jinlong --- .../bindings/arm/qcom,coresight-qmi.yaml | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/qcom,coresight-qm= i.yaml diff --git a/Documentation/devicetree/bindings/arm/qcom,coresight-qmi.yaml = b/Documentation/devicetree/bindings/arm/qcom,coresight-qmi.yaml new file mode 100644 index 000000000000..601c865fe4d7 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/qcom,coresight-qmi.yaml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/qcom,coresight-qmi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm coresight QMI(Qualcomm Messaging Interface) component + +description: | + Qualcomm Messaging Interface (QMI) is an interface that clients can + use to send, and receive, messages from a remote entity. The coresight + QMI component is to configure QMI instance ids and service ids for diffe= rent + remote subsystem connections. Coresight QMI driver uses the ids to init + the qmi connections. Other coresight drivers call the send qmi request + function when connection is established. + +maintainers: + - Mao Jinlong + +properties: + compatible: + enum: + - qcom,coresight-qmi + +patternProperties: + '^conns(-[0-9]+)?$': + type: object + description: + QMI instance id and service id for different remote subsystem connec= tions. + + properties: + qmi-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Instance id for the remote subsystem connection. + + service-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Service id for the remote subsystem connection. + + additionalProperties: false + + required: + - qmi-id + - service-id + +required: + - compatible + +additionalProperties: false + +examples: + # Minimum coresight qmi definition. + - | + coresight-qmi { + compatible =3D "qcom,coresight-qmi"; + + conns-0 { + qmi-id =3D <0xd>; + service-id =3D <0x33>; + }; + }; + +... --=20 2.25.1 From nobody Tue Oct 7 08:38:14 2025 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 ADF2427AC25; Fri, 11 Jul 2025 09:40:59 +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=1752226861; cv=none; b=m73uiR9T0+b9oVL857Uvww5ZG21VkXrcgY+RQPNGuLRzMH0FYGhYbK/J8feFMMDwaOtCtUH515qkRasLqfUPdz+6RHMztEsjfukTqwD/wNZtU52xQwOaUB06ZY6Y6GNWacUiILZqyUkdjdZZoSjQrBE6KkvwuxJ4Sdr1l7CmcZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752226861; c=relaxed/simple; bh=Z/0NROSEmCgpyxPdJj+HIgTBy1ElFF0DaR/WLun5Mg8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EL6Lm++r6Jhldi4HAdfGdFGECgmjMqzPqeZ4t/KkmoGevgFhSsMvcAl2xQ9Xxfaak2wqban+j4SjXpNvo2StBkuBrRv622l3Rgj1H16KikXTubGVOix5k2I6SNOwv30hAlP7napAWAFl4KEOE3PnZCRskXv1eE5dsu8dJgO5wso= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=JvIIlncd; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="JvIIlncd" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56B3GfhE016850; Fri, 11 Jul 2025 09:40:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= gspBJ2Ipj40QOHZq6OOqXQdiYxcFnrOqjoKD88xQcrA=; b=JvIIlncdBn8T1Bqn /p378SNKg1OTb4VkBmQpk7TkotA9Vk1Rr04xmGWHOm9Q8L/auTbJQouDtMnxd86Q kUoP+cRTsFe4BONG+gcIYTOszueOBS+rqZNvz5adypr7S+hnvcrUGJZJhh0SOMkm A8+wErE2dx9izPV+/cz/1AlB+JpRoOBfFJaQYOzQLM1YzBg9thK4/x3mkYNi+B5t CvVtf+kK67Efet0F9M6t4kAmw9+KKNkOcP2ktt1goBd0VuXSkxGOE3WqnP6Lz9sV 1B2OYfRVKepqwsVhtDLK7Mvy2RGVHgBoOiBgtcBiS8Seujth6I3naAmIdsfJr+E9 2N3sPA== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47ttj9rxg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:48 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 56B9elJU032077 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:47 GMT Received: from hu-jinlmao-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 11 Jul 2025 02:40:46 -0700 From: Mao Jinlong To: Suzuki K Poulose , Mike Leach , James Clark , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mao Jinlong , "Alexander Shishkin" , Bjorn Andersson , Konrad Dybcio CC: , , , , Subject: [PATCH v6 2/5] coresight: Add coresight QMI driver Date: Fri, 11 Jul 2025 02:40:28 -0700 Message-ID: <20250711094031.4171091-3-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> References: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> 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-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzExMDA2OCBTYWx0ZWRfXxKbMX6L5NUMz 0wY+TkuEO0ksEEAkkR5VfKmYNsHvsHaba+BK175fYfsrIBsIRDu1eKkGlZ3FErYHVFFGK9N38/h 3V/GzkXw4SEaQNqXFaodPPpEcHiBc+yM2cqFIjJwI8Ybu1VkY5YzrPio/kBrVJwEWieqHHNpxnQ FkyRM1ImPjs/0J40XmN9TRcdqD7cXdqCMLvVsNmhm46l4ZGncHtmcyJFLNDkzgjlcF6b8o+liYV vLg3cGb/4GstJA4Tmx8GkL5PkXDFSJpKSuu1kQ0ZQXfWHn6RvZ7erlWS1nay0NYZTwYCzLlDg9B xHuR1UkEhBSgehSiaATdPduVfMfsuUTYhXoFzUYRd4FQ0oaoM08FpogY9lIn+aTxOybJH3ZjVM9 GElveJzWcYouMRHHzLvTvuvlqCCh0cVaYnCtWPgoRku/iq9S2u5tFyUL1+hpMCEgJLIV7/ro X-Proofpoint-ORIG-GUID: 4U959h0qroy3Z7WW6ht-8O-oqUZQodIi X-Authority-Analysis: v=2.4 cv=Gu1C+l1C c=1 sm=1 tr=0 ts=6870dc20 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=3H110R4YSZwA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=L9yW8--91L8JoJtvOOUA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: 4U959h0qroy3Z7WW6ht-8O-oqUZQodIi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-11_03,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 impostorscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507110068 Content-Type: text/plain; charset="utf-8" Coresight QMI driver uses QMI(Qualcomm Messaging Interface) interfaces to communicate with remote subsystems. Driver gets the instance id and service id from device tree node and init the QMI connections to remote subsystems. Send request function is for other coresight drivers to communicate with remote subsystems. Signed-off-by: Mao Jinlong --- drivers/hwtracing/coresight/Kconfig | 11 ++ drivers/hwtracing/coresight/Makefile | 1 + drivers/hwtracing/coresight/coresight-qmi.c | 198 ++++++++++++++++++++ drivers/hwtracing/coresight/coresight-qmi.h | 101 ++++++++++ 4 files changed, 311 insertions(+) create mode 100644 drivers/hwtracing/coresight/coresight-qmi.c create mode 100644 drivers/hwtracing/coresight/coresight-qmi.h diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresi= ght/Kconfig index f064e3d172b3..a55b7d875e0a 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -268,4 +268,15 @@ config CORESIGHT_KUNIT_TESTS Enable Coresight unit tests. Only useful for development and not intended for production. =20 +config CORESIGHT_QMI + tristate "CORESIGHT QMI support" + depends on QCOM_QMI_HELPERS + help + Enables support for sending command to subsystem via QMI. This is + primarily used for sending QMI message to subsystems for remote trace + sources. + + To compile this driver as a module, choose M here: the module will be + called coresight-qmi. + endif diff --git a/drivers/hwtracing/coresight/Makefile b/drivers/hwtracing/cores= ight/Makefile index 4e7cc3c5bf99..d4b1c74d183f 100644 --- a/drivers/hwtracing/coresight/Makefile +++ b/drivers/hwtracing/coresight/Makefile @@ -52,6 +52,7 @@ obj-$(CONFIG_CORESIGHT_TPDA) +=3D coresight-tpda.o coresight-cti-y :=3D coresight-cti-core.o coresight-cti-platform.o \ coresight-cti-sysfs.o obj-$(CONFIG_ULTRASOC_SMB) +=3D ultrasoc-smb.o +obj-$(CONFIG_CORESIGHT_QMI) +=3D coresight-qmi.o obj-$(CONFIG_CORESIGHT_DUMMY) +=3D coresight-dummy.o obj-$(CONFIG_CORESIGHT_CTCU) +=3D coresight-ctcu.o coresight-ctcu-y :=3D coresight-ctcu-core.o diff --git a/drivers/hwtracing/coresight/coresight-qmi.c b/drivers/hwtracin= g/coresight/coresight-qmi.c new file mode 100644 index 000000000000..d487280d516b --- /dev/null +++ b/drivers/hwtracing/coresight/coresight-qmi.c @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ +#include +#include +#include +#include +#include +#include + +#include "coresight-qmi.h" +static LIST_HEAD(qmi_data); + +static int service_coresight_qmi_new_server(struct qmi_handle *qmi, + struct qmi_service *svc) +{ + struct qmi_data *data =3D container_of(qmi, + struct qmi_data, handle); + + data->s_addr.sq_family =3D AF_QIPCRTR; + data->s_addr.sq_node =3D svc->node; + data->s_addr.sq_port =3D svc->port; + data->service_connected =3D true; + pr_debug("Connection established between QMI handle and %d service\n", + data->qmi_id); + + return 0; +} + +static void service_coresight_qmi_del_server(struct qmi_handle *qmi, + struct qmi_service *svc) +{ + struct qmi_data *data =3D container_of(qmi, + struct qmi_data, handle); + data->service_connected =3D false; + pr_debug("Connection disconnected between QMI handle and %d service\n", + data->qmi_id); +} + +static struct qmi_ops server_ops =3D { + .new_server =3D service_coresight_qmi_new_server, + .del_server =3D service_coresight_qmi_del_server, +}; + +static int coresight_qmi_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct device_node *node =3D pdev->dev.of_node; + struct device_node *child_node; + int ret; + + /* + * Create QMI handle and register new lookup for each + * QMI connectioni based on qmi-id and service-id. + */ + for_each_available_child_of_node(node, child_node) { + struct qmi_data *data; + + data =3D devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + ret =3D of_property_read_u32(child_node, "qmi-id", &data->qmi_id); + if (ret) + return ret; + + ret =3D of_property_read_u32(child_node, "service-id", &data->service_id= ); + if (ret) + return ret; + + ret =3D qmi_handle_init(&data->handle, + CORESIGHT_QMI_MAX_MSG_LEN, + &server_ops, NULL); + if (ret < 0) { + dev_err(dev, "qmi client init failed ret:%d\n", ret); + return ret; + } + + qmi_add_lookup(&data->handle, + data->service_id, + CORESIGHT_QMI_VERSION, + data->qmi_id); + + list_add(&data->node, &qmi_data); + } + + return 0; +} + +/** + * coresight_get_qmi_data() - Get the qmi data struct from qmi_data + * @id: instance id to get the qmi data + * + * Return: qmi data struct on success, NULL on failure. + */ +static struct qmi_data *coresight_get_qmi_data(int id) +{ + struct qmi_data *data; + + list_for_each_entry(data, &qmi_data, node) { + if (data->qmi_id =3D=3D id) + return data; + } + + return NULL; +} + +/** + * coresight_send_qmi_request() - Send a QMI message to remote subsystem + * @instance_id: QMI Instance id of the remote subsystem + * @msg_id: message id of the request + * @resp_ei: description of how to decode a matching response + * @req_ei: description of how to encode a matching request + * @resp: pointer to the object to decode the response info + * @req: pointer to the object to encode the request info + * @len: max length of the QMI message + * + * Return: 0 on success, negative errno on failure. + */ +int coresight_send_qmi_request(int instance_id, int msg_id, struct qmi_ele= m_info *resp_ei, + struct qmi_elem_info *req_ei, void *resp, void *req, int len) +{ + struct qmi_txn txn; + int ret; + struct qmi_data *data; + + data =3D coresight_get_qmi_data(instance_id); + if (!data) { + pr_err("No QMI data for QMI service!\n"); + ret =3D -EINVAL; + return ret; + } + + if (!data->service_connected) { + pr_err("QMI service not connected!\n"); + ret =3D -EINVAL; + return ret; + } + + ret =3D qmi_txn_init(&data->handle, &txn, + resp_ei, + resp); + + if (ret < 0) { + pr_err("QMI tx init failed , ret:%d\n", ret); + return ret; + } + + ret =3D qmi_send_request(&data->handle, &data->s_addr, + &txn, msg_id, + len, + req_ei, + req); + + if (ret < 0) { + pr_err("QMI send ACK failed, ret:%d\n", ret); + qmi_txn_cancel(&txn); + return ret; + } + + ret =3D qmi_txn_wait(&txn, msecs_to_jiffies(TIMEOUT_MS)); + if (ret < 0) { + pr_err("QMI qmi txn wait failed, ret:%d\n", ret); + return ret; + } + + return 0; +} +EXPORT_SYMBOL(coresight_send_qmi_request); + +static void coresight_qmi_remove(struct platform_device *pdev) +{ + struct qmi_data *data; + + list_for_each_entry(data, &qmi_data, node) { + qmi_handle_release(&data->handle); + } +} + +static const struct of_device_id coresight_qmi_match[] =3D { + { .compatible =3D "qcom,coresight-qmi" }, + {} +}; + +static struct platform_driver coresight_qmi_driver =3D { + .probe =3D coresight_qmi_probe, + .remove =3D coresight_qmi_remove, + .driver =3D { + .name =3D "coresight-qmi", + .of_match_table =3D coresight_qmi_match, + }, +}; + +module_platform_driver(coresight_qmi_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("CoreSight QMI driver"); diff --git a/drivers/hwtracing/coresight/coresight-qmi.h b/drivers/hwtracin= g/coresight/coresight-qmi.h new file mode 100644 index 000000000000..dce10d899a53 --- /dev/null +++ b/drivers/hwtracing/coresight/coresight-qmi.h @@ -0,0 +1,101 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ +#ifndef _CORESIGHT_QMI_H +#define _CORESIGHT_QMI_H + +#include + +#define CORESIGHT_QMI_VERSION 1 + +#define CORESIGHT_QMI_SET_ETM_REQ_V01 0x002C +#define CORESIGHT_QMI_SET_ETM_RESP_V01 0x002C + +#define CORESIGHT_QMI_MAX_MSG_LEN 50 + +#define TIMEOUT_MS 10000 + +/* Qmi data for the QMI connection */ +struct qmi_data { + u32 qmi_id; + u32 service_id; + struct list_head node; + struct qmi_handle handle; + bool service_connected; + struct sockaddr_qrtr s_addr; +}; + +/* Enum of QMI service IDs */ +enum coresight_qmi_service_id { + CORESIGHT_QMI_QDSSC_SVC_ID =3D 0x33, + CORESIGHT_QMI_QDCP_SVC_ID =3D 0xff, +}; + +/* Enum of QMI instance ids */ +enum coresight_qmi_instance_id { + CORESIGHT_QMI_INSTANCE_MODEM_V01 =3D 2, + CORESIGHT_QMI_INSTANCE_WLAN_V01 =3D 3, + CORESIGHT_QMI_INSTANCE_AOP_V01 =3D 4, + CORESIGHT_QMI_INSTANCE_ADSP_V01 =3D 5, + CORESIGHT_QMI_INSTANCE_VENUS_V01 =3D 6, + CORESIGHT_QMI_INSTANCE_GNSS_V01 =3D 7, + CORESIGHT_QMI_INSTANCE_SENSOR_V01 =3D 8, + CORESIGHT_QMI_INSTANCE_AUDIO_V01 =3D 9, + CORESIGHT_QMI_INSTANCE_VPU_V01 =3D 10, + CORESIGHT_QMI_INSTANCE_MODEM2_V01 =3D 11, + CORESIGHT_QMI_INSTANCE_SENSOR2_V01 =3D 12, + CORESIGHT_QMI_INSTANCE_CDSP_V01 =3D 13, + CORESIGHT_QMI_INSTANCE_NPU_V01 =3D 14, + CORESIGHT_QMI_INSTANCE_CDSP_USER_V01 =3D 15, + CORESIGHT_QMI_INSTANCE_CDSP1_V01 =3D 16, + CORESIGHT_QMI_INSTANCE_GPDSP0_V01 =3D 17, + CORESIGHT_QMI_INSTANCE_GPDSP1_V01 =3D 18, + CORESIGHT_QMI_INSTANCE_TBD_V01 =3D 19, + CORESIGHT_QMI_INSTANCE_GPDSP0_AUDI0_V01 =3D 20, + CORESIGHT_QMI_INSTANCE_GPDSP1_AUDI0_V01 =3D 21, + CORESIGHT_QMI_INSTANCE_MODEM_OEM_V01 =3D 22, + CORESIGHT_QMI_INSTANCE_ADSP1_V01 =3D 23, + CORESIGHT_QMI_INSTANCE_ADSP1_AUDIO_V01 =3D 24, + CORESIGHT_QMI_INSTANCE_ADSP2_V01 =3D 25, + CORESIGHT_QMI_INSTANCE_ADSP2_AUDIO_V01 =3D 26, + CORESIGHT_QMI_INSTANCE_CDSP2_V01 =3D 27, + CORESIGHT_QMI_INSTANCE_CDSP3_V01 =3D 28, +}; + +enum coresight_etm_state_enum_type_v01 { + /* To force a 32 bit signed enum. Do not change or use */ + CORESIGHT_ETM_STATE_ENUM_TYPE_MIN_ENUM_VAL_V01 =3D INT_MIN, + CORESIGHT_ETM_STATE_DISABLED_V01 =3D 0, + CORESIGHT_ETM_STATE_ENABLED_V01 =3D 1, + CORESIGHT_ETM_STATE_ENUM_TYPE_MAX_ENUM_VAL_01 =3D INT_MAX, +}; + +/** + * Set remote etm request message + * + * @state enable/disable state + */ +struct coresight_set_etm_req_msg_v01 { + enum coresight_etm_state_enum_type_v01 state; +}; + +/** + * Set remote etm response message + */ +struct coresight_set_etm_resp_msg_v01 { + struct qmi_response_type_v01 resp; +}; + +#if IS_ENABLED(CONFIG_CORESIGHT_QMI) +extern int coresight_send_qmi_request(int instance_id, int msg_id, + struct qmi_elem_info *resp_ei, + struct qmi_elem_info *req_ei, void *resp, void *req, int len); +#else + +static inline int coresight_send_qmi_request(int instance_id, int msg_id, + struct qmi_elem_info *resp_ei, + struct qmi_elem_info *req_ei, void *resp, void *req, int len) {return NU= LL; } +#endif + +#endif --=20 2.25.1 From nobody Tue Oct 7 08:38:14 2025 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 0E99825B2FE; Fri, 11 Jul 2025 09:40:58 +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=1752226860; cv=none; b=MXRFGN9GZuibaBSmemK5DbpWIsz/lZuGrO/UfuB3pPGSdaniEg7F8jXsNMMgsW4jdC88eU0Z9mRz5KE8fKEkOEaQodnPgrgLPLGDAYL2YlXQPFPdBTNDGzNrPTSKWFTFWX1ywhLUjDjf1jxRJVPrzNvubxWatwTs+Z1ZvmUh9dU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752226860; c=relaxed/simple; bh=wktBULxCA4JEPVYcG/0+jZKSyLl57+4v24bsaZ+zEKc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TWBCCIeogFq0k+GDtQd28oXfCAN6MRWEInpLKODq2UCwP9238mY8qoSu8qWwe0csuKSKmSUDCMWnEjVC8u4NusbY1Uwk77DtXqiC6CzvvUSO+2Dy2KkbpqwYiX6LZCaaWObu/H+ZjLF/vudqi5QiBnRKVLk/NZAyGFwHqnqVYaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=l6h9MXJu; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="l6h9MXJu" 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 56B1Ye45014796; Fri, 11 Jul 2025 09:40:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= yGGgU4DJ2NcfrN8hvw/GoGHQliVmVsDsJd2kjhH8RkU=; b=l6h9MXJuvpx/Ib5v pRtKK9VDLiZZ2iNXX1ZzXJeqFGMQVYX9s1sAqYroI3Z+Uh3DYmlA654kPKDy+SJX AcW8k0bAg0vDMccj+9Vj6U8bXJy7tDYbVQKuDmNPOQjPvBMuJXw9nFb+cVo72h0T KVfG8IRs7lQuigdQFy6Xpy2vk5sRTPTdVER992JPeCgwAsAWrg45BR6UWU6DuUNs aTxJI1kCBl3JTcq3zXYPv1aYhOpzzGFt2qzRSKP0mdbSynlQp0esf23zD0sh25+K /Ro/QLfEP6XVjXFVDZpv51C/PNyNfPFzMuSwvyIebP9uswDwEjY9aP8tZYkN986t 8oZWrw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smafqxgt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:48 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 56B9elbG024466 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:47 GMT Received: from hu-jinlmao-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 11 Jul 2025 02:40:46 -0700 From: Mao Jinlong To: Suzuki K Poulose , Mike Leach , James Clark , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mao Jinlong , "Alexander Shishkin" , Bjorn Andersson , Konrad Dybcio CC: , , , , Subject: [PATCH v6 3/5] dt-bindings: arm: Add qcom,qmi-id for remote etm Date: Fri, 11 Jul 2025 02:40:29 -0700 Message-ID: <20250711094031.4171091-4-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> References: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> 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-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=ZJ/XmW7b c=1 sm=1 tr=0 ts=6870dc20 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=3H110R4YSZwA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=o8tvhj6R3GUb89b70GIA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: lsgi5TDntMQAGnRQJ_YkxE568-sfiP3V X-Proofpoint-GUID: lsgi5TDntMQAGnRQJ_YkxE568-sfiP3V X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzExMDA2OCBTYWx0ZWRfX/n87Tzr+je19 jog1E8s2NDGvY7SXtr5YTnEAOIXHZk9zaRXtqhpXhnxBFqpMMicaEunovbY0mF4MG3rwgDSS8Sg 0sBiUeMIP9dLwCmVIg+p/sfqqpPtkZAEvxIrM86tOAQLCNPmrO/PRNqRjDZwAUaoraNVmDW56p0 meupjxrY7uEQJKOMHkc34l4xUiWljbxnomqscZU9fQ0n7yD0D6zd4j1TerMkvV7vfuHiFFLTWBR 7B9nOhf615XD9Rz4veWixsS15AY+TkITAAzyyz7UypUL7ssOeRsz1dZzHNddiN/wgYFQ0FaOiMI J+twRPBwaEDtuxWje0KD+bToXJD9vcFv8gk/LRitKhvx5s+IsVhdI0LyVRNvO0VyuLwiv+jzvNj s/h7oeiCdqSCmQEnfEyLlJxMjstz88A0cq3M2SSRw1YJswI0aHgfUZQoT9pMY/iG1U/hLc4S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-11_03,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507110068 Content-Type: text/plain; charset="utf-8" Remote etm binding change was merged to fix the dt warning. Driver changes were not merged at that time. qcom,qmi-instance-id is required for remote etm driver to find the remote subsystem connection. It is the instance id used by qmi to communicate with remote processor. Signed-off-by: Mao Jinlong --- .../bindings/arm/qcom,coresight-remote-etm.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/qcom,coresight-remote-et= m.yaml b/Documentation/devicetree/bindings/arm/qcom,coresight-remote-etm.ya= ml index 4fd5752978cd..bd78f6bc2fdf 100644 --- a/Documentation/devicetree/bindings/arm/qcom,coresight-remote-etm.yaml +++ b/Documentation/devicetree/bindings/arm/qcom,coresight-remote-etm.yaml @@ -20,6 +20,12 @@ properties: compatible: const: qcom,coresight-remote-etm =20 + qcom,qmi-instance-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Each remote processor has a unique instance id to establish the + QMI connection. + out-ports: $ref: /schemas/graph.yaml#/properties/ports additionalProperties: false @@ -32,6 +38,7 @@ properties: required: - compatible - out-ports + - qcom,qmi-instance-id =20 additionalProperties: false =20 @@ -40,6 +47,8 @@ examples: etm { compatible =3D "qcom,coresight-remote-etm"; =20 + qcom,qmi-instance-id =3D <2>; + out-ports { port { modem_etm0_out_funnel_modem: endpoint { --=20 2.25.1 From nobody Tue Oct 7 08:38:14 2025 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 2F2E327E070; Fri, 11 Jul 2025 09:41:01 +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=1752226864; cv=none; b=YLnjjMVe/pdf3UIPUqTeqQYXCl2yG4rGk0jCazATz3349bWzDkQ4Xus/LtQt67S6x1ELVxWNhV0HdcbVyb0XJBrMe+1OM9ZeFb6UCPPAbkhV4arymy44wL/KW6sGKbZMSe7Qf+rHhVcKGfo3CVaXfsJlSjybI7d3OwxUB/0/ZMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752226864; c=relaxed/simple; bh=JGZ5Glrse9GYkW28mhgSUB2iig1LlcZUFWQNftqEqoY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CRMAQtjvVupVWEMF0KhDIka3Xvqhu7lkKgZRv7ozCxxRlJSNRIbpirzTrMZVTN4ynf67NfEqCtbxTkdhldMnxhg6wC1BroBj+nbdHkRWh76awxcRfEqtF8qv7c3w645ikTMIhi2xJyKOweJUiTUHqVQNcLq+XTCmF+iBfoX67+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=gjnTcck3; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="gjnTcck3" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56B1X5RK001257; Fri, 11 Jul 2025 09:40:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 9To5ycp2taIEsca0JwMAClHW/FGVpyZHoKmyHKPJoVg=; b=gjnTcck3KixUWJp+ EPuEtqreC9Z+IQlsIlr6UwPtit85oB9Uu1hXnMgqtnD0fSapfR/QqclCNPL9ir8s jIAMpqJr22q/GxAsDHxVGFBUubbJnB5Eq5toknVPI6j+O2ud77rutpqCdpsCn1E7 9JjIx5ruNJ9CRPN7HUxcSEWUQEe8VCkRNXxilF74alg3y5zWlIzghK5WclbkofkT VVIsSC3Ve73GtMQFDUgxoWMjgCfBaF/YXsqo0Dy9VR9pxI8F/EZw5D0nwJHnHDOV cLyD/IJEc1A4ogMGbZ3w2y1XuYYZr6M6wtblhNSUg0M2t7JoAG/rwMJpOx8EjuTN MY39fw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47pucnbhet-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:49 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 56B9emp7024471 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:48 GMT Received: from hu-jinlmao-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 11 Jul 2025 02:40:47 -0700 From: Mao Jinlong To: Suzuki K Poulose , Mike Leach , James Clark , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mao Jinlong , "Alexander Shishkin" , Bjorn Andersson , Konrad Dybcio CC: , , , , Subject: [PATCH v6 4/5] coresight: Add remote etm support Date: Fri, 11 Jul 2025 02:40:30 -0700 Message-ID: <20250711094031.4171091-5-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> References: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> 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-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=GdQXnRXL c=1 sm=1 tr=0 ts=6870dc21 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=3H110R4YSZwA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=K0pT7PK9Rrvve967010A:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: ts3IcflmLGo56f3ivtt3u1BHktb0FzMr X-Proofpoint-ORIG-GUID: ts3IcflmLGo56f3ivtt3u1BHktb0FzMr X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzExMDA2NyBTYWx0ZWRfX42zzOa/rHup8 1CqElJ7QfbySeLpZ+AWvDy0E/8f5V7zi6bdENRsurIhUKuSgPn6BYRgWK4nKb9Xy9lelN3E0/GK yeDFAuMK70DB9o1y2IHEd/fMUPF4RZPSVZ0a32udupqHe6dVHo9m1yrmVHNmSkna0XXY0CrUbL1 Ojy5Ee4Ty+IFQgK+EmM6rSHXcnxEP/H1rs/0TcxFrhlZZjYs8dzzd8tegVUweAq3h1C/PmyjtWc L+QdX74OuxLI6XltvVSKy55mKLik4LEBE63ovVW6iJtVF201bJtEFHyltJq/K4Mcmke8jNMzAsD o3BGV6K24GPcWoE0spudUpI2kOvoTKDIqNzZC71VIP589G3Oe/76nkATX9F6sXyYQa2/LLDaan7 NX+NjBgLUJPKR6gmXhVQOQWMBzMXqpRPgNHDQm8y76hTSR4wOs8FAJvjdOAxb/gtkKcUPrtX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-11_03,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 clxscore=1015 spamscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 malwarescore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507110067 Content-Type: text/plain; charset="utf-8" The system on chip (SoC) consists of main APSS(Applications processor subsytem) and additional processors like modem, lpass. Coresight remote etm(Embedded Trace Macrocell) driver is for enabling and disabling the etm trace of remote processors. It uses QMI interface to communicate with remote processors' software and uses coresight framework to configure the connection from remote etm source to TMC sinks. +-----------------+ | Remote ETM | +-----------------+ | | +-----------------+ | Coresight Funnel| +-----------------+ | | +-----------------+ | TMC ETF | +-----------------+ Signed-off-by: Mao Jinlong --- drivers/hwtracing/coresight/Kconfig | 12 + drivers/hwtracing/coresight/Makefile | 1 + .../coresight/coresight-remote-etm.c | 262 ++++++++++++++++++ 3 files changed, 275 insertions(+) create mode 100644 drivers/hwtracing/coresight/coresight-remote-etm.c diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresi= ght/Kconfig index a55b7d875e0a..0a5ab1c0a397 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -279,4 +279,16 @@ config CORESIGHT_QMI To compile this driver as a module, choose M here: the module will be called coresight-qmi. =20 +config CORESIGHT_REMOTE_ETM + tristate "Remote processor ETM trace support" + depends on QCOM_QMI_HELPERS + help + Enables support for ETM trace collection on remote processor using + CoreSight framework. Enabling this will allow turning on ETM + tracing on remote processor via sysfs by configuring the required + CoreSight components. + + To compile this driver as a module, choose M here: the module will be + called coresight-remote-etm. + endif diff --git a/drivers/hwtracing/coresight/Makefile b/drivers/hwtracing/cores= ight/Makefile index d4b1c74d183f..60bfe6ff0ecb 100644 --- a/drivers/hwtracing/coresight/Makefile +++ b/drivers/hwtracing/coresight/Makefile @@ -53,6 +53,7 @@ coresight-cti-y :=3D coresight-cti-core.o coresight-cti-p= latform.o \ coresight-cti-sysfs.o obj-$(CONFIG_ULTRASOC_SMB) +=3D ultrasoc-smb.o obj-$(CONFIG_CORESIGHT_QMI) +=3D coresight-qmi.o +obj-$(CONFIG_CORESIGHT_REMOTE_ETM) +=3D coresight-remote-etm.o obj-$(CONFIG_CORESIGHT_DUMMY) +=3D coresight-dummy.o obj-$(CONFIG_CORESIGHT_CTCU) +=3D coresight-ctcu.o coresight-ctcu-y :=3D coresight-ctcu-core.o diff --git a/drivers/hwtracing/coresight/coresight-remote-etm.c b/drivers/h= wtracing/coresight/coresight-remote-etm.c new file mode 100644 index 000000000000..facc1e4d057f --- /dev/null +++ b/drivers/hwtracing/coresight/coresight-remote-etm.c @@ -0,0 +1,262 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "coresight-qmi.h" +#include "coresight-trace-id.h" + +#define CORESIGHT_QMI_SET_ETM_REQ_MAX_LEN 7 + +DEFINE_CORESIGHT_DEVLIST(remote_etm_devs, "remote-etm"); + +/** + * struct remote_etm_drvdata - specifics associated to remote etm device + * @dev: the device entity associated to this component + * @csdev: component vitals needed by the framework + * @mutex: lock for seting etm + * @inst_id: the instance id of the remote connection + * @traceid: value of the current trace ID for this component. + */ +struct remote_etm_drvdata { + struct device *dev; + struct coresight_device *csdev; + struct mutex mutex; + u32 inst_id; + u8 traceid; +}; + +/* + * Element info to descrbe the coresight_set_etm_req_msg_v01 struct + * which is used to encode the request. + */ +static struct qmi_elem_info coresight_set_etm_req_msg_v01_ei[] =3D { + { + .data_type =3D QMI_UNSIGNED_4_BYTE, + .elem_len =3D 1, + .elem_size =3D sizeof(enum coresight_etm_state_enum_type_v01), + .array_type =3D NO_ARRAY, + .tlv_type =3D 0x01, + .offset =3D offsetof(struct coresight_set_etm_req_msg_v01, + state), + .ei_array =3D NULL, + }, + { + .data_type =3D QMI_EOTI, + .elem_len =3D 0, + .elem_size =3D 0, + .array_type =3D NO_ARRAY, + .tlv_type =3D 0, + .offset =3D 0, + .ei_array =3D NULL, + }, +}; + +/* + * Element info to describe the coresight_set_etm_resp_msg_v01 struct + * which is used to decode the response. + */ +static struct qmi_elem_info coresight_set_etm_resp_msg_v01_ei[] =3D { + { + .data_type =3D QMI_STRUCT, + .elem_len =3D 1, + .elem_size =3D sizeof(struct qmi_response_type_v01), + .array_type =3D NO_ARRAY, + .tlv_type =3D 0x02, + .offset =3D offsetof(struct coresight_set_etm_resp_msg_v01, + resp), + .ei_array =3D qmi_response_type_v01_ei, + }, + { + .data_type =3D QMI_EOTI, + .elem_len =3D 0, + .elem_size =3D 0, + .array_type =3D NO_ARRAY, + .tlv_type =3D 0, + .offset =3D 0, + .ei_array =3D NULL, + }, +}; + +static int remote_etm_enable(struct coresight_device *csdev, struct perf_e= vent *event, + enum cs_mode mode, + __maybe_unused struct coresight_path *path) +{ + struct remote_etm_drvdata *drvdata =3D + dev_get_drvdata(csdev->dev.parent); + struct coresight_set_etm_req_msg_v01 req; + struct coresight_set_etm_resp_msg_v01 resp =3D { { 0, 0 } }; + int ret =3D 0; + + mutex_lock(&drvdata->mutex); + + if (mode !=3D CS_MODE_SYSFS) { + ret =3D -EINVAL; + goto err; + } + + if (!coresight_take_mode(csdev, mode)) { + ret =3D -EBUSY; + goto err; + } + + req.state =3D CORESIGHT_ETM_STATE_ENABLED_V01; + + ret =3D coresight_send_qmi_request(drvdata->inst_id, CORESIGHT_QMI_SET_ET= M_REQ_V01, + coresight_set_etm_resp_msg_v01_ei, + coresight_set_etm_req_msg_v01_ei, + &resp, &req, CORESIGHT_QMI_SET_ETM_REQ_MAX_LEN); + + if (ret) + goto err; + + if (resp.resp.result !=3D QMI_RESULT_SUCCESS_V01) { + dev_err(drvdata->dev, "QMI request failed 0x%x\n", resp.resp.error); + ret =3D -EINVAL; + goto err; + } + + mutex_unlock(&drvdata->mutex); + return 0; +err: + coresight_set_mode(csdev, CS_MODE_DISABLED); + mutex_unlock(&drvdata->mutex); + return ret; + +} + +static void remote_etm_disable(struct coresight_device *csdev, + struct perf_event *event) +{ + struct remote_etm_drvdata *drvdata =3D + dev_get_drvdata(csdev->dev.parent); + struct coresight_set_etm_req_msg_v01 req; + struct coresight_set_etm_resp_msg_v01 resp =3D { { 0, 0 } }; + int ret =3D 0; + + mutex_lock(&drvdata->mutex); + + req.state =3D CORESIGHT_ETM_STATE_DISABLED_V01; + + ret =3D coresight_send_qmi_request(drvdata->inst_id, CORESIGHT_QMI_SET_ET= M_REQ_V01, + coresight_set_etm_resp_msg_v01_ei, + coresight_set_etm_req_msg_v01_ei, + &resp, &req, CORESIGHT_QMI_SET_ETM_REQ_MAX_LEN); + if (ret) + dev_err(drvdata->dev, "Send qmi request failed %d\n", ret); + + if (resp.resp.result !=3D QMI_RESULT_SUCCESS_V01) + dev_err(drvdata->dev, "QMI request failed %d\n", resp.resp.error); + + coresight_trace_id_put_system_id(drvdata->traceid); + coresight_set_mode(csdev, CS_MODE_DISABLED); + mutex_unlock(&drvdata->mutex); +} + +static int remote_etm_trace_id(struct coresight_device *csdev, + __maybe_unused enum cs_mode mode, + __maybe_unused struct coresight_device *sink) +{ + int trace_id; + struct remote_etm_drvdata *drvdata; + + drvdata =3D dev_get_drvdata(csdev->dev.parent); + + trace_id =3D coresight_trace_id_get_system_id(); + drvdata->traceid =3D (u8)trace_id; + + return drvdata->traceid; +} + +static const struct coresight_ops_source remote_etm_source_ops =3D { + .enable =3D remote_etm_enable, + .disable =3D remote_etm_disable, +}; + +static const struct coresight_ops remote_cs_ops =3D { + .source_ops =3D &remote_etm_source_ops, + .trace_id =3D remote_etm_trace_id, +}; + +static int remote_etm_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct coresight_platform_data *pdata; + struct remote_etm_drvdata *drvdata; + struct coresight_desc desc =3D {0 }; + int ret; + + desc.name =3D coresight_alloc_device_name(&remote_etm_devs, dev); + if (!desc.name) + return -ENOMEM; + pdata =3D coresight_get_platform_data(dev); + if (IS_ERR(pdata)) + return PTR_ERR(pdata); + pdev->dev.platform_data =3D pdata; + + drvdata =3D devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); + if (!drvdata) + return -ENOMEM; + + drvdata->dev =3D dev; + platform_set_drvdata(pdev, drvdata); + + ret =3D of_property_read_u32(dev->of_node, "qcom,qmi-instance-id", + &drvdata->inst_id); + if (ret) + return ret; + + mutex_init(&drvdata->mutex); + + desc.type =3D CORESIGHT_DEV_TYPE_SOURCE; + desc.subtype.source_subtype =3D CORESIGHT_DEV_SUBTYPE_SOURCE_OTHERS; + desc.ops =3D &remote_cs_ops; + desc.pdata =3D pdev->dev.platform_data; + desc.dev =3D &pdev->dev; + drvdata->csdev =3D coresight_register(&desc); + if (IS_ERR(drvdata->csdev)) { + ret =3D PTR_ERR(drvdata->csdev); + goto err; + } + + dev_dbg(dev, "Remote ETM initialized\n"); + + return 0; + +err: + return ret; +} + +static void remote_etm_remove(struct platform_device *pdev) +{ + struct remote_etm_drvdata *drvdata =3D platform_get_drvdata(pdev); + + coresight_unregister(drvdata->csdev); +} + +static const struct of_device_id remote_etm_match[] =3D { + {.compatible =3D "qcom,coresight-remote-etm"}, + {} +}; + +static struct platform_driver remote_etm_driver =3D { + .probe =3D remote_etm_probe, + .remove =3D remote_etm_remove, + .driver =3D { + .name =3D "coresight-remote-etm", + .of_match_table =3D remote_etm_match, + }, +}; + +module_platform_driver(remote_etm_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("CoreSight Remote ETM driver"); --=20 2.25.1 From nobody Tue Oct 7 08:38:14 2025 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 05F5327C879; Fri, 11 Jul 2025 09:41:00 +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=1752226862; cv=none; b=r5DQskeu4bjmDznH1u2Og+2EYZ8mi8AZTVlyo6ZD97OfiT0GlqNekKF+3wAlsIf46WbkhwYe/7B4NI+h2GCFTXNtcLm3s2BdNqJk9l1QR0RmjAOUiRjY6xJoLZFsjI2I1QfombwKwGupHJltj8cYt5cW+7gZutaHwPe16qcHvaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752226862; c=relaxed/simple; bh=8HLNUJ+ODJOFkjp3T8ePMB3YHb45vLPbDzd28lgjf28=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kBgyfN6u9Xzh5eqmHITtT8/mQBjiBLD5sFJJcnhEnQmIPcbg8tJpL3Pa+iVBZ8zXVS1vsaELGpZ5h+zACrlC1qEN6XfkLnpkPf8E+pNy+BvdzDLxn0pBHcpUPNisy6H3f0742nO7Kt5Y9o2ZDebrBgonf8BC8UP13woJ6n6tB5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=TmKS7jS3; 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=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="TmKS7jS3" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 56B1XBeU016803; Fri, 11 Jul 2025 09:40:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= gjYjOpQG6wXtXCJvIxEpwaFMEpUUZrOepO0zheiglxU=; b=TmKS7jS3ffiRu3CT h7xpKc4teaRpZPBqCITcysWiwphbFdbRx6xASaQub1K8AMP6cgcF/TCWi7dvZbG7 hZrPy8SVfxLjigo77Wya9JYi0bXQg35SkbEcXOE0TeEtNjQLSMj/UQ+zqw1hAI1a OAIfc5tz3GOIah8BtjZNVnYdTGWZFJXnOzMaZvPa5IKGrx8uwAsh894qgtn4BsLc djhHfg4wKbdW4ohUtwYuoLihAkmhXECSLAMvUrQfwarADNjx4jgAf6PZyaM1s6NT wo92Bavy70I4Q4U3j13fq+D4o7fA3wMKNy29vE+xgolSVBDRCxCVQGrl577P5pmb spwQ0A== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47smap82xh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:49 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 56B9emvw032125 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jul 2025 09:40:48 GMT Received: from hu-jinlmao-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Fri, 11 Jul 2025 02:40:47 -0700 From: Mao Jinlong To: Suzuki K Poulose , Mike Leach , James Clark , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mao Jinlong , "Alexander Shishkin" , Bjorn Andersson , Konrad Dybcio CC: , , , , Subject: [PATCH v6 5/5] arm64: dts: qcom: msm8996: Add coresight qmi node Date: Fri, 11 Jul 2025 02:40:31 -0700 Message-ID: <20250711094031.4171091-6-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> References: <20250711094031.4171091-1-quic_jinlmao@quicinc.com> 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-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=Ar7u3P9P c=1 sm=1 tr=0 ts=6870dc21 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=3H110R4YSZwA:10 a=Wb1JkmetP80A:10 a=COk6AnOGAAAA:8 a=_vcsFIMFqyRQzRopD1IA:9 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: FCtgReMf5prrPSWRqhkXqtcyb93TWRBf X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzExMDA2OCBTYWx0ZWRfX1OxN1i0sK0v8 CtwqUnNdknqS/7Bu+Dtyyb4ZPEwZ+Jgywdcemf1pAk31QC9MGtyWHaWzzCdQHYP4M/FQHXpNl+m 1UIyLEtDyDPSDIT0xq2HNsPkHApol7wwACn7oS7gcbTN4TxN0jNL9uMrxswTTF55cxrCm0Pbqiy NfHMoKry91uaOjAVR+VcETJeEAca3k2BB6QJis8gxL950/qbX7I1ikJMVTsf1qlDTJ+5EK+eeEV OztKLWhqqAbvABw06tyjU5zRJ4sFiyYbdxHjTOH1VwdtAnSN8kV0RU725CJx/aqRAnOjWS03VLY yTJMeH3PPVjsUvlGLnxZNNLeUu/fv9AXUDKBMJoWjIEaqyjS6Ej4Tg9bl/HHJwT2yfYhXIsupni j1NmeUpvPDLOJjH+Lj3Rl5OfuQ1ySLSg4D2Lc/4Hh6plH99y9U+p2A4NtMETXpcth0Fs5Le+ X-Proofpoint-GUID: FCtgReMf5prrPSWRqhkXqtcyb93TWRBf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-11_03,2025-07-09_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 adultscore=0 phishscore=0 priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2507110068 Content-Type: text/plain; charset="utf-8" coresight qmi nodes is to init the qmi connection to remote subsystem. qcom,qmi-id is used by remote etm driver to get the remote subsystem connection and send the request. Signed-off-by: Mao Jinlong --- arch/arm64/boot/dts/qcom/msm8996.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qc= om/msm8996.dtsi index ede851fbf628..0032817825f2 100644 --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi @@ -40,6 +40,15 @@ sleep_clk: sleep-clk { }; }; =20 + coresight-qmi { + compatible =3D "qcom,coresight-qmi"; + + conns-0 { + qmi-id =3D <0x2>; + service-id =3D <0x33>; + }; + }; + cpus { #address-cells =3D <2>; #size-cells =3D <0>; @@ -448,6 +457,8 @@ memory@80000000 { etm { compatible =3D "qcom,coresight-remote-etm"; =20 + qcom,qmi-instance-id =3D <0x2>; + out-ports { port { modem_etm_out_funnel_in2: endpoint { --=20 2.25.1