Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2283360rda; Tue, 24 Oct 2023 19:54:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM5PSZ1+3pevNKYSlta7IrtOn5WRs6hvYYoucMlBYMGLmuXxFobLT7pluihlPb+D5Hwc0W X-Received: by 2002:a05:6902:1083:b0:d0a:8973:b1c with SMTP id v3-20020a056902108300b00d0a89730b1cmr15087703ybu.12.1698202472012; Tue, 24 Oct 2023 19:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698202471; cv=none; d=google.com; s=arc-20160816; b=Mbu+qtwKXWzrWRq8d69rPXjVPJFkl2xOK4gwHcfZb4RSzuD1tK78IKLgVnhKlgo/V8 f3ElVvrHBBbTTWdGi2N5NDOO32NKNkaSroM0qpv1VTqtaer8c7MENmXwfreyf1Ike4Za 2uL0AUZeYKVxlcYBYqWFeGYf8y5li3w5P0QbZK4XI5C6mQHI+qMsZiwblRa9gn7/Subg x3xZP11iZk8ocG85IM5BnyAPfKzAUvUpwBX6aYlaNDNX17lAwq8aMDCYj37SizB8FCJ6 BEXD5NXmjF9ShQSEXUN5eIE7YBRRKS6LJzve/UYJRedsg1tGPeNB1v1rPW3MOXJOiTr9 fcUQ== 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=tnlKQZgXt2c5mVSXm8iJt5DvC/LjpuRZMNMKHoa5P54=; fh=eSQnxfYZD66NgboVDB7L9mVH46SSiFzLE3y556oFJtg=; b=RgX/aQspS0SAqSkOSdTkPFrIlMuJSepIQcOQahI25+dxVGhXVc/XUyptu5WNTgpTIU qMPCLR6xfXYPlZSASjN14Zt5jkcjKvGK0UiexkMnHLgu9U3A0tpRMbwk8yRntq8Ibs6s M2vqaHA9jM/g5e6h29zGPxdWo4jc1GxInNNKNXnqgnXLRiXfT7Ul5bOQqXMA3yilk/RB 0bSmG3LYXQqR0Z1oRD3MF49rjhrcXvD9zsxAVLGTcr8UDZ5mRD6ByKk0KLTtypBJG+RW 0qkDEHMgmDYVGV4DYOSUdQ6Mq3Ni3QlAi952ZecBehutTGiFOG+mV0wXAtbF9dsrJhSy wxtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=F0mKWhbw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id o197-20020a2573ce000000b00d3338dda705si10111647ybc.50.2023.10.24.19.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 19:54:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=F0mKWhbw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 3FA02804C6C0; Tue, 24 Oct 2023 19:54:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbjJYCyN (ORCPT + 99 others); Tue, 24 Oct 2023 22:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbjJYCyM (ORCPT ); Tue, 24 Oct 2023 22:54:12 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6C9F11D; Tue, 24 Oct 2023 19:54:08 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39P2HUHP010539; Wed, 25 Oct 2023 02:53: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-type : content-transfer-encoding; s=qcppdkim1; bh=tnlKQZgXt2c5mVSXm8iJt5DvC/LjpuRZMNMKHoa5P54=; b=F0mKWhbwt7o0uYLT0g7M17lCV4wt1eyY0HVh3ge48t8xRxEVl67UjFhfQj6l2DsQWD4k ECrjFFdZmlPkJdiW6ZP5eKzqPpDkwY2TYLonAD1yEF+2SR08O+J4Tll+UejfRe7ExDPl etGydW/Wj5joqmmCyAShGxxJXQSekeTTjCKXris2N7k/0pbVudsC7Spfec8jZnfIxfKW yvKksU1AVJFRPeKFuVJVwbvM2q8Hs2AKjT46ngT0kqp9TK8zu9W5PalanZPNlRn1X6SR L+92ozH1DzlcFaWW7hQwDI4GhXVCzIyOSgtAqH5kGpNDOJVlxmOmfD5xEOc9TIqQ8rQR AQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3txpj5gc63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 02:53:52 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39P2rp4g031609 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 02:53:51 GMT Received: from taozha-gv.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Tue, 24 Oct 2023 19:53:46 -0700 From: Tao Zhang To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Konrad Dybcio , Mike Leach , Rob Herring , Krzysztof Kozlowski CC: Tao Zhang , Jinlong Mao , Leo Yan , Greg Kroah-Hartman , , , , , Tingwei Zhang , Yuanfang Zhang , Trilok Soni , Song Chai , , Subject: [PATCH v2 0/8] Add support to configure TPDM CMB subunit Date: Wed, 25 Oct 2023 10:53:20 +0800 Message-ID: <1698202408-14608-1-git-send-email-quic_taozha@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: eXz_g_nmnZ-QwM0W35WSrkazbwbpVOoz X-Proofpoint-GUID: eXz_g_nmnZ-QwM0W35WSrkazbwbpVOoz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-25_01,2023-10-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310250022 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Tue, 24 Oct 2023 19:54:28 -0700 (PDT) Introduction of TPDM CMB(Continuous Multi Bit) subunit CMB subunit is responsible for creating a dataset element, and is also optionally responsible for packing it to fit multiple elements on a single ATB transfer if possible in the configuration. The TPDM Core Datapath requests timestamps be stored by the TPDA and then delivering ATB sized data (depending on ATB width and element size, this could be smaller or larger than a dataset element) to the ATB Mast FSM. The CMB makes trace elements in two modes. In ?continuous? mode, every valid data cycle creates an element. In ?trace on change? mode, when valid data changes on the bus, a trace element is created. In continuous mode, all cycles where this condition is true create trace elements. In trace on change mode, a data element is only when the previously sampled input is different from the current sampled input. The CMB subunit must be configured prior to enablement. This series adds support for TPDM to configure the configure CMB subunit. Once this series patches are applied properly, the new tpdm nodes for should be observed at the tpdm path /sys/bus/coresight/devices/tpdm* which supports CMB subunit. e.g. root@qemuarm64:/sys/devices/platform/soc@0/684c000.tpdm/tpdm0# ls -l -rw-r--r-- 1 root root 4096 Jan 1 00:00 cmb_mode drwxr-xr-x 2 root root 0 Jan 1 00:00 cmb_msr drwxr-xr-x 2 root root 0 Jan 1 00:00 cmb_patt drwxr-xr-x 2 root root 0 Jan 1 00:00 cmb_trig_patt -rw-r--r-- 1 root root 4096 Jan 1 00:00 cmb_trig_ts -rw-r--r-- 1 root root 4096 Jan 1 00:00 cmb_ts_all drwxr-xr-x 2 root root 0 Jan 1 00:00 connections drwxr-xr-x 2 root root 0 Jan 1 00:00 dsb_edge drwxr-xr-x 2 root root 0 Jan 1 00:00 dsb_msr drwxr-xr-x 2 root root 0 Jan 1 00:00 dsb_patt drwxr-xr-x 2 root root 0 Jan 1 00:00 dsb_trig_patt -rw-r--r-- 1 root root 4096 Jan 1 00:00 enable_source --w------- 1 root root 4096 Jan 1 00:00 integration_test drwxr-xr-x 2 root root 0 Ja? 1 00:00 power --w------- 1 root root 4096 Jan 1 00:00 reset_dataset lrwxrwxrwx 1 root root 0 Apr 5 2021 subsystem -> ../../../../../bus/coresight -rw-r--r-- 1 root root 4096 Apr 5 2021 uevent -r--r--r-- 1 root root 4096 Jan 1 00:00 waiting_for_supplier We can use the commands are similar to the below to configure the TPDMs which support CMB subunit. Enable coresight sink first. echo 1 > /sys/bus/coresight/devices/tmc_etf0/enable_sink echo 1 > /sys/bus/coresight/devices/tpdm0/reset_dataset echo 1 > /sys/bus/coresight/devices/tpdm0/cmb_mode echo 1 > /sys/bus/coresight/devices/tpdm0/cmb_patt/enable_ts echo 0xFFFFFFFF > /sys/bus/coresight/devices/tpdm0/cmb_patt/tpmr0 echo 0 > /sys/bus/coresight/devices/tpdm0/cmb_trig_ts echo 0xFFFFFFFF > /sys/bus/coresight/devices/tpdm0/cmb_trig_patt/xpr1 echo 1 > /sys/bus/coresight/devices/tpdm0/enable_source This patch series depends on patch "[v1] coresight-tpdm: Correct the property name of MSR number" https://patchwork.kernel.org/project/linux-arm-kernel/patch/1698128353-31157-1-git-send-email-quic_taozha@quicinc.com/ codelinaro link: https://git.codelinaro.org/clo/linux-kernel/coresight/-/commits/tpdm-cmb-v2 Changes in V2: 1. Optimizate and modify this patch series based on the patch series "Add support to configure TPDM CMB subunit". 2. Modify the functions that read the element size of DSB/CMB in TPDA driver. Tao Zhang (8): dt-bindings: arm: Add support for CMB element size coresight-tpda: Add support to configure CMB element coresight-tpdm: Add CMB dataset support coresight-tpdm: Add support to configure CMB coresight-tpdm: Add pattern registers support for CMB coresight-tpdm: Add timestamp control register support for the CMB dt-bindings: arm: Add support for TPDM CMB MSR register coresight-tpdm: Add msr register support for CMB .../ABI/testing/sysfs-bus-coresight-devices-tpdm | 83 +++++ .../bindings/arm/qcom,coresight-tpdm.yaml | 37 ++ drivers/hwtracing/coresight/coresight-tpda.c | 108 +++--- drivers/hwtracing/coresight/coresight-tpda.h | 6 + drivers/hwtracing/coresight/coresight-tpdm.c | 390 ++++++++++++++++++++- drivers/hwtracing/coresight/coresight-tpdm.h | 87 +++++ 6 files changed, 663 insertions(+), 48 deletions(-) -- 2.7.4