Received: by 2002:a05:7412:4e10:b0:e2:908c:2ebd with SMTP id gb16csp19801rdb; Mon, 6 Nov 2023 22:10:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHej3eRBdShCX8TM+edmjdqpNSbrl2xUbMTW0sKzJcesPbY9MJoGOwc/3OAKkS/oVKXWMjb X-Received: by 2002:a1f:a0c5:0:b0:4ac:9a8:2f29 with SMTP id j188-20020a1fa0c5000000b004ac09a82f29mr7947488vke.12.1699337438688; Mon, 06 Nov 2023 22:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699337438; cv=none; d=google.com; s=arc-20160816; b=wxO2JaF2ZLNVUP9K7tfArzbwgnsJclG+QXOZ1QoD49wVXZ+rs/bPvpGMqnozMtMzwX 6kI8xoCFg8cW9dXJHy7zyHd4mNKDr5JLRm/xn4LTrvd+cR/smTcs8l6j3smVuCYLMdi7 4P8UpvYHm30JQbxT6Rj6NZ6SGhfJaNEqtUv6BRBd1vLAD1PNZsGtLsScKEn1tvNAqsae K/oe3ydfktlJ5p3HMwG17xMayUIpv1l+Sb3N2tgNzJIugjaOrYmedlo2+9UiP3FWmN3c En+z4Oi9eGhcLa2zBzK6bY/xgPHXwugcHRCDuA59F7vTz/nOJc0ckPGmwJVYdSfhd9MJ +05A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TJ6K7QS0tX20YF3a9J4LB3meI6Sg6zcVszwc0Lz3C3k=; fh=EAMKooV1XaZP1lHZnXND1HPIgQQL3X6c20KkMk7S4cA=; b=dLpN8ZA/TfFf/w+N5kGlnBxCWcw31JSQUUs2a1kssjAgUMfcbhphgtECWt3LUqoOLs kuJhEwY8xTd9wWv7HS2o6uBboizT3aUU7MTe7Bm84OAs9BQ+rEpYo7tttBWajWtiDZWr Rx4+z/NqUvzHsYjQRXhyjeG5A/QkDotKy107xhqocZgY5YUbn/BJOceS65SLypYRlfM9 V1aZ0I2SczYoLhrKZyTuNSF5L6YC0TQDq4I1QFls03tOFM9QtSBXfrqO4Ap31lmuIM6i aKe8Pws7JKGdfuB4SV9wrwZpebdVdKh5syn5nDDLXVmCv3W51xQ/W3YEYMkPd+zONRUF MuBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=TfQsnYm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t27-20020a056a00139b00b006c0fe935fa1si10362980pfg.181.2023.11.06.22.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 22:10:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=TfQsnYm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 90114802B3DF; Mon, 6 Nov 2023 22:10:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbjKGGKL (ORCPT + 99 others); Tue, 7 Nov 2023 01:10:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjKGGKK (ORCPT ); Tue, 7 Nov 2023 01:10:10 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ECCD10F; Mon, 6 Nov 2023 22:10:06 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A75QHOg009740; Tue, 7 Nov 2023 06:09:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=TJ6K7QS0tX20YF3a9J4LB3meI6Sg6zcVszwc0Lz3C3k=; b=TfQsnYm6xQIOf683WMo98Rc6eYJaiXQQ72dULwCT3jMaa/OZeYIXPemTm1F4OkXXVcpc qck4aGt1gNUSC2DbZI3QyvYfIMll+J89TSLahSq9SaiBSWUtpF1QTZ8ePG6UQ4lodXcf Zm26Zwc1Xn+JVZc2MyS9M+BtQe/fkQZjvKydUgpWm6YzduAVwRVH9W81eC2vu1N7VjS2 snrEqqlo8CRWgfxikxvDLpwBIBocaeXREQFfwdmuCTNabJuBnMm1zcSoxB15LooXjKTW ZWGO2jXsTgr5cW9OMpzgHTQYiOvag1K8a0T44AAlHdYN09C8tXtPTV/Q4keZPOvZuhSL kg== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3u72avssu5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Nov 2023 06:09:53 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3A769p6J019474 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 7 Nov 2023 06:09:51 GMT Received: from hu-jinlmao-lv.qualcomm.com (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Mon, 6 Nov 2023 22:09:51 -0800 From: Mao Jinlong To: Suzuki K Poulose , Mike Leach , James Clark , "Alexander Shishkin" , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley CC: Mao Jinlong , , , , , , Yuanfang Zhang , Tao Zhang Subject: [PATCH v1 0/2] coresight: Add remote etm support Date: Mon, 6 Nov 2023 22:09:33 -0800 Message-ID: <20231107060939.13449-1-quic_jinlmao@quicinc.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: llF_Nw759j3z7MjuQrLA2kX7XyWzG2UG X-Proofpoint-GUID: llF_Nw759j3z7MjuQrLA2kX7XyWzG2UG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-06_15,2023-11-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 mlxlogscore=690 impostorscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1015 spamscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2311070048 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 22:10:30 -0800 (PST) The system on chip (SoC) consists of main APSS(Applications processor subsytem) and additional processors like modem, lpass. There is coresight-etm driver for etm trace of APSS. Coresight remote etm 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. Example to capture the remote etm trace: Enable source: echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink echo 1 > /sys/bus/coresight/devices/remote_etm0/enable_source Capture the trace: cat /dev/tmc_etf0 > /data/remote_etm.bin Disable source: echo 0 > /sys/bus/coresight/devices/remote_etm0/enable_source Mao Jinlong (2): coresight: Add remote etm support dt-bindings: arm: Add remote etm driver .../arm/qcom,coresight-remote-etm.yaml | 59 ++++ drivers/hwtracing/coresight/Kconfig | 9 + drivers/hwtracing/coresight/Makefile | 1 + drivers/hwtracing/coresight/coresight-core.c | 3 + drivers/hwtracing/coresight/coresight-qmi.h | 109 ++++++ .../coresight/coresight-remote-etm.c | 325 ++++++++++++++++++ include/linux/coresight.h | 1 + 7 files changed, 507 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/qcom,coresight-remote-etm.yaml create mode 100644 drivers/hwtracing/coresight/coresight-qmi.h create mode 100644 drivers/hwtracing/coresight/coresight-remote-etm.c -- 2.41.0