Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp364158pxb; Thu, 21 Oct 2021 00:42:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWcbeu6S2WAlAAVOJdGYM9Cy5suTUvCwG61+h8lgBaLnD3M3J6uuT6RhyZDZ89GRvYG+iI X-Received: by 2002:a17:906:8252:: with SMTP id f18mr5568636ejx.409.1634802133771; Thu, 21 Oct 2021 00:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634802133; cv=none; d=google.com; s=arc-20160816; b=0Yp9KptmvIO8xeWSvT4ai8uvJv9V7gqS83xxYOFrc2V7DLnlfqV1UxeBCvgdnA5SVK 0kB8OYIVyle7JQe3qBcNH8uUKBMqjkT60Zm3NljtFMbnD66PGpj2Wr9oBFfpaVcuph0w CGRaAKYRIUN9ht2/j04zKICwjnYB+FVPMawfrUfSZWpiCTXlDNXuJTHLscgtJkrPyzUs ok5COL1uImY8t3eZ3UOnMpt6snIGPgRIgtcKalhrMFL6D/tbpLtCuwJ2+mfQGUD21778 sqTddgXLM7ZWGV9SGysnVjKfTQ19sno24yLCRJY4BCYxjNzqZmki4s9GuY2RBAwlH2F4 etSg== 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=RUc7e+MvXtnwyAuEbv459EKnJ6/1ZeaOqslZdxNvcUg=; b=oqbXHhmHQ3wmcHnJA50k9Bha1/R/h5R1bc8gHKgU3zbw5vDf4jViLUkGae2JsUivbp /tikMag2fRsGXBG1szLIi8r6/OSoF/kmRcVsY3Ru8kr/STDMqqE972P8MJh1UXSduwYN uSSzYwe3a3AEnHxpA1iMBdwV55S1VFOEov3P+7zwXAW1D2O3qqyijp45g1+zZR0xHe5i N8Z5TQmV9w78t6xqzCIwm1uK4r6CIq6gpQCRDywaSI+rqZ5ATLnohVnA1QVh+5UV2ARW apaGTYGdB9Y2B7Z9AA/YIIDxIsWDBsHpJdB2JP/nHEBQeeeTnXv02W5bhkxhgVobSZwF 23lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=akCAtMT0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si5729757ejo.366.2021.10.21.00.41.49; Thu, 21 Oct 2021 00:42:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=akCAtMT0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231158AbhJUHly (ORCPT + 99 others); Thu, 21 Oct 2021 03:41:54 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:3753 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbhJUHlw (ORCPT ); Thu, 21 Oct 2021 03:41:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1634801977; x=1666337977; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RUc7e+MvXtnwyAuEbv459EKnJ6/1ZeaOqslZdxNvcUg=; b=akCAtMT0AIYbmpuNkpsbgZyKtkIU+Ao53/5Xa4UodadhNXryVuN16hHq DgnboZYNwEK2aaVu4f2VfnAB1rvxGAgbQDqX6VrirOe1sPgW4+88JAKMU N3Dmi8mEbwq2c/OvknADaT8cUBWO0PoVWqvaetXzE25hp0t4mlBtkX3Ln s=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 21 Oct 2021 00:39:36 -0700 X-QCInternal: smtphost Received: from nalasex01c.na.qualcomm.com ([10.47.97.35]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2021 00:39:35 -0700 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.922.7; Thu, 21 Oct 2021 00:39:31 -0700 From: Tao Zhang To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin CC: Tao Zhang , Mike Leach , Leo Yan , Greg Kroah-Hartman , , , , Tingwei Zhang , Mao Jinlong , Yuanfang Zhang , Trilok Soni Subject: [PATCH 00/10] Add support for TPDM and TPDA Date: Thu, 21 Oct 2021 15:38:46 +0800 Message-ID: <1634801936-15080-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: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for the trace performance monitoring and diagnostics hardware (TPDM and TPDA). It is composed of two major elements. a) Changes for original coresight framework to support for TPDM and TPDA. b) Add driver code for TPDM and TPDA. Introduction of changes for original coresight framework a) Support TPDM as new coresight source. Since only STM and ETM are supported as coresight source originally. TPDM is a newly added coresight source. We need to change the original way of saving coresight path to support more types source for coresight driver. The following patch is to add support more coresight sources. coresight: add support to enable more coresight paths b) To support multi-port input and multi-port output for funnels In some cases, different TPDM hardware will be connected to the same funnel, but eventually they need to be linked to different TPDAs or funnels. This requires funnel to support multi-port input and multi-port output, and can specify which input port corresponds to which output port. Use property ?label? in the funnel?s configuration to point out from which input port to which output port. The following patch is to support multi-port input and multi-port output for funnels. coresight: funnel: add support for multiple output ports Introduction of TPDM and TPDA TPDM - The trace performance monitoring and diagnostics monitor or TPDM in short serves as data collection component for various dataset types specified in the QPMDA(Qualcomm performance monitoring and diagnostics architecture) spec. The primary use case of the TPDM is to collect data from different data sources and send it to a TPDA for packetization, timestamping and funneling. The following patch is to add driver for TPDM. Coresight: Add driver to support Coresight device TPDM Coresight: Enable BC and GPR for TPDM driver Coresight: Add interface for TPDM BC subunit Coresight: Enable and add interface for TPDM TC subunit Coresight: Enable DSB subunit for TPDM Coresight: Enable CMB subunit for TPDM TPDA - The trace performance monitoring and diagnostics aggregator or TPDA in short serves as an arbitration and packetization engine for the performance monitoring and diagnostics network as specified in the QPMDA (Qualcomm performance monitoring and diagnostics architecture) specification. The primary use case of the TPDA is to provide packetization, funneling and timestamping of Monitor data as specified in the QPMDA specification. The following patch is to add driver for TPDA. coresight: Add driver to support Coresight device TPDA The last patch of this series is a device tree modification, which add the TPDM and TPDA configuration to device tree for validating. ARM: dts: msm: Add TPDA and TPDM configuration to device Once this series patches are applied properly, the tpdm and tpda nodes should be observed at the coresight path /sys/bus/coresight/devices e.g. /sys/bus/coresight/devices # ls -l | grep tpd tpda0 -> ../../../devices/platform/soc@0/6004000.tpda/tpda0 tpdm0 -> ../../../devices/platform/soc@0/6844000.lpass.tpdm/tpdm0 We can use the commands are similar to the below to validate TPDMs. Enable coresight sink first. echo 1 > /sys/bus/coresight/devices/tpdm0/enable_source echo 1 > /sys/bus/coresight/devices/tpdm0/integration_test echo 2 > /sys/bus/coresight/devices/tpdm0/integration_test The test data will be collected in the coresight sink which is enabled. This series applies to coresight/next https://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git?h=next Tao Zhang (10): coresight: add support to enable more coresight paths coresight: funnel: add support for multiple output ports Coresight: Add driver to support Coresight device TPDM Coresight: Enable BC and GPR for TPDM driver Coresight: Add interface for TPDM BC subunit Coresight: Enable and add interface for TPDM TC subunit Coresight: Enable DSB subunit for TPDM Coresight: Enable CMB subunit for TPDM coresight: Add driver to support Coresight device TPDA ARM: dts: msm: Add TPDA and TPDM support to DTS for RB5 .../bindings/arm/coresight-tpda.yaml | 169 + .../bindings/arm/coresight-tpdm.yaml | 86 + MAINTAINERS | 6 + arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 439 ++ drivers/hwtracing/coresight/Kconfig | 18 + drivers/hwtracing/coresight/Makefile | 2 + drivers/hwtracing/coresight/coresight-core.c | 175 +- .../hwtracing/coresight/coresight-platform.c | 8 + drivers/hwtracing/coresight/coresight-tpda.c | 828 ++++ drivers/hwtracing/coresight/coresight-tpdm.c | 4253 +++++++++++++++++ include/linux/coresight.h | 2 + 11 files changed, 5928 insertions(+), 58 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/coresight-tpda.yaml create mode 100644 Documentation/devicetree/bindings/arm/coresight-tpdm.yaml create mode 100644 drivers/hwtracing/coresight/coresight-tpda.c create mode 100644 drivers/hwtracing/coresight/coresight-tpdm.c -- 2.17.1