From patchwork Mon Dec 30 16:39:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 182634 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6547858ild; Mon, 30 Dec 2019 08:40:14 -0800 (PST) X-Google-Smtp-Source: APXvYqygVxQHif1gOZOL8EsLrO/KrShwk50urSlktcVuj3y4vy7Jugr3Aq1nxsQ36EW6Ayet8kFz X-Received: by 2002:a9d:478:: with SMTP id 111mr73885385otc.359.1577724014794; Mon, 30 Dec 2019 08:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577724014; cv=none; d=google.com; s=arc-20160816; b=VPZ3TPWuippx+xX7iHoN1l8UxjDsg6hd0Oflyo+MY2cbcrfiiEg4Wdwpcj7ROwKezm rswJA6pDAn32uwIgP1C/aTsUiEy7nl/lEIHRUClYueIvBg4hkQleAuFiWWrs1gSIIpu2 QnYq2vxCImIZwUJki6MERNzcwbxGhE8Ju1/ByYjzfowzCJuCdR08IPGLW0JNXO/8+K5K 86QPwNqHsIyCn+S1SxxM2W6I+bzzrzdQih7RS0vvXszpntbsFVPClGFdd/dE4lhgDOqK dcWaxP3AdVpPgd4BdPxW003s88AFRqX7xWa5brG8q3Bal4dmNhPOH4qpAGNwcLdk6itE wcug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=8tObW2Y+8fTfmFiK9yuGB6NcH5jADMC1h14qPDKuK7g=; b=I88qvK4+q/0QftDmsA9q6EgUs+Gd9YXu1QmJBAmdqvDt1taOev9ig/Ph7hbG4wE1a1 WD4tBOX69rk5q5DOGjBpaQ2aM+chg2KV6NCCmXgvjEsClZH/CwRfBmb8030JX8jTxmrB 0v2yWBe58zL6wGG7331hLrOgdDk5DIFvbBH6qr6dDKcjlKvxOAn/JVCbuv4190FZgX91 iaOeV1huWr9U97GG57YMMHtY6hOOhuRwjeQKJHOX/9UwPwIIrIle7ZlHNuEkfpOhSJBM PhwVofHXy5ev64HfeNai+3/6nRj9U3WENyeU70XiTE7fGiM/8ims6YRVN9nMReaq6Igl e2Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIp1GZiH; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22si23696115otn.192.2019.12.30.08.40.14; Mon, 30 Dec 2019 08:40:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vIp1GZiH; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfL3QkO (ORCPT + 8 others); Mon, 30 Dec 2019 11:40:14 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54239 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726607AbfL3QkN (ORCPT ); Mon, 30 Dec 2019 11:40:13 -0500 Received: by mail-wm1-f67.google.com with SMTP id m24so14355023wmc.3 for ; Mon, 30 Dec 2019 08:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=8tObW2Y+8fTfmFiK9yuGB6NcH5jADMC1h14qPDKuK7g=; b=vIp1GZiH6LCgVBcmaNA+k0OXAJYBPhsMy3hg9p4J0BJERnzOSoYz+o3v4NSeWYuEQJ eepS+mrUfiNWOhxHScGa47xys3690RvmDCR6H4rPDWooPV10I4zvUNpGs/qrehMmPB1k wxz9VJBUrPpGBmCtiTCf18j4ZDHeI0DmpHMsJzpiPGtbdO9IBsYLbVYrvVCgt0sBmbaF vV1p629Kia1h56cYSbis/FDzlITfY9Jk5CvNZnr/YNd7J462ptHYBHO4V25Dv0mNsWRU rA8sWx2t2CBSrDCz8RZefPoxZZcVpDTRw/AKVCxEKZPna4in0Gvr6Oskadzue+n+FnSB gA2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8tObW2Y+8fTfmFiK9yuGB6NcH5jADMC1h14qPDKuK7g=; b=h7rWgDD3ga8BxBw0GuUBLYP4gtcc4VGO1knLmYPhWKsRXAT/NgKmoafkI3mesiOsNP YOu/Nf0KUa2ThWlZuO/sPYpeRIdazWuOGrQvV3bYQpE91rdLomhrd+WQEmrLtRnzZY8p YxW0Wd0XCc18ZTSzgdRezIyrA7mKCQvTyYzT+mkielKLBGXBD5digHJlV4n3C4VuQxN5 eq+nnagW3ibx9C+KDhCkd9mo5wNopM264Xej9Tcsqx48O5dKmCllklIEiQwoqnySgbRV kncS6k7PX5KvQ6oETmtB3DG4PvtbmmlPU8ego8jQX73B2ahWnbE2nC0WXBQayVz18AHo vjqA== X-Gm-Message-State: APjAAAWoOaLAz6A+BHwEfrGA3MvWsJJEZclC9DcIBTPMGZqK3NgSDfde 2tO9yllLSvDupA+3lHPw5Jh2aA== X-Received: by 2002:a1c:8055:: with SMTP id b82mr35748818wmd.127.1577724010564; Mon, 30 Dec 2019 08:40:10 -0800 (PST) Received: from linaro.org ([2a00:23c5:6815:3901:a1cf:b00b:5683:ed40]) by smtp.gmail.com with ESMTPSA id b137sm21993094wme.26.2019.12.30.08.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Dec 2019 08:40:10 -0800 (PST) From: Mike Leach To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, coresight@lists.linaro.org Cc: linux-arm-msm@vger.kernel.org, mathieu.poirier@linaro.org, suzuki.poulose@arm.com, robh+dt@kernel.org, maxime@cerno.tech, liviu.dudau@arm.com, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, agross@kernel.org, Mike Leach Subject: [PATCH v7 00/15] CoreSight CTI Driver Date: Mon, 30 Dec 2019 16:39:59 +0000 Message-Id: <20191230163959.27909-1-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org CTIs are defined in the device tree and associated with other CoreSight devices. The core CoreSight code has been modified to enable the registration of the CTI devices on the same bus as the other CoreSight components, but as these are not actually trace generation / capture devices, they are not part of the Coresight path when generating trace. However, the definition of the standard CoreSight device has been extended to include a reference to an associated CTI device, and the enable / disable trace path operations will auto enable/disable any associated CTI devices at the same time. Programming is at present via sysfs - a full API is provided to utilise the hardware capabilities. As CTI devices are unprogrammed by default, the auto enable describe above will have no effect until explicit programming takes place. A set of device tree bindings specific to the CTI topology has been defined. The driver accesses these in a platform agnostic manner, so ACPI bindings can be added later, once they have been agreed and defined for the CTI device. Documentation has been updated to describe both the CTI hardware, its use and programming in sysfs, and the new dts bindings required. Tested on DB410 board and Juno board, against the Linux 5.5-rc1. 5.5-rc4 trees. Changes since v6: NB: No functional driver changes in this set. Full set released for consistency, completeness and ease of use. 1) Updates to .yaml following comments from Maxime Ripard. Correct child node descriptions, fix validation, and ensure reg entries required in child nodes as per DeviceTree specification. 2) Update to Juno bindings to implement reg entry specification requirements. Changes since v5: 1) Fixed up device tree .yaml file. Using extra compatible string for v8 architecture CTI connections. 2) Ensure association code respects coresight mutex when setting cross referenced pointers. Add in shutdown code. 3) Multiple minor code fixes & rationalisation. Changes since v4: Multiple changes following feedback from Mathieu, Leo and Suzuki. 1) Dropped RFC tag - wider distribution 2) CTI bindings definition now presented as a .yaml file - tested with with 'dt-doc-validate' from devicetree.org/dt-schema project and in kernel build tree with 'make dtbs_check' per kernel docs. 3) Sysfs links to other CoreSight devices moved out of this set into a following set that deals with all CoreSight devices & sysfs links. 4) Documentation in .rst format and new directory following patchset in [1]. Extended example provided in docs. 5) Rationalised devicetree of_ specifics to use generic fwnode functions where possible to enable easier addition of ACPI support later. 6) Other minor changes as requested in feedback from last patchset. Changes since v3: 1) After discussion on CS mailing list, each CTI connection has a triggers sysfs directory with name and trigger signals listed for the connection. 2) Initial code for creating sysfs links between CoreSight components is introduced and implementation for CTI provided. This allows exploration of the CoreSight topology within the sysfs infrastructure. Patches for links between other CoreSight components to follow. 3) Power management - CPU hotplug and idle omitted from this set as ongoing developments may define required direction. Additional patch set to follow. 4) Multiple fixes applied as requested by reviewers esp. Matthieu, Suzuki and Leo. Changes since v2: Updates to allow for new features on coresight/next and feedback from Mathieu and Leo. 1) Rebase and restructuring to apply on top of ACPI support patch set, currently on coresight/next. of_coresight_cti has been renamed to coresight-cti-platform and device tree bindings added to this but accessed in a platform agnostic manner using fwnode for later ACPI support to be added. 2) Split the sysfs patch info a series of functional patches. 3) Revised the refcount and enabling support. 4) Adopted the generic naming protocol - CTIs are either cti_cpuN or cti_sysM 5) Various minor presentation /checkpatch issues highlighted in feedback. 6) revised CPU hotplug to cover missing cases needed by ETM. Changes since v1: 1) Significant restructuring of the source code. Adds cti-sysfs file and cti device tree file. Patches add per feature rather than per source file. 2) CPU type power event handling for hotplug moved to CoreSight core, with generic registration interface provided for all CPU bound CS devices to use. 3) CTI signal interconnection details in sysfs now generated dynamically from connection lists in driver. This to fix issue with multi-line sysfs output in previous version. 4) Full device tree bindings for DB410 and Juno provided (to the extent that CTI information is available). 5) AMBA driver update for UCI IDs are now upstream so no longer included in this set Mike Leach (15): coresight: cti: Initial CoreSight CTI Driver coresight: cti: Add sysfs coresight mgmt reg access. coresight: cti: Add sysfs access to program function regs coresight: cti: Add sysfs trigger / channel programming API dt-bindings: arm: Adds CoreSight CTI hardware definitions. coresight: cti: Add device tree support for v8 arch CTI coresight: cti: Add device tree support for custom CTI. coresight: cti: Enable CTI associated with devices. coresight: cti: Add connection information to sysfs dt-bindings: qcom: Add CTI options for qcom msm8916 dt-bindings: arm: Juno platform - add CTI entries to device tree. dt-bindings: hisilicon: Add CTI bindings for hi-6220 docs: coresight: Update documentation for CoreSight to cover CTI. docs: sysfs: coresight: Add sysfs ABI documentation for CTI Update MAINTAINERS to add reviewer for CoreSight. .../testing/sysfs-bus-coresight-devices-cti | 221 ++++ .../bindings/arm/coresight-cti.yaml | 326 +++++ .../devicetree/bindings/arm/coresight.txt | 7 + .../trace/coresight/coresight-ect.rst | 211 +++ Documentation/trace/coresight/coresight.rst | 13 + MAINTAINERS | 3 + arch/arm64/boot/dts/arm/juno-base.dtsi | 162 ++- arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi | 37 +- arch/arm64/boot/dts/arm/juno-r1.dts | 25 + arch/arm64/boot/dts/arm/juno-r2.dts | 25 + arch/arm64/boot/dts/arm/juno.dts | 25 + .../boot/dts/hisilicon/hi6220-coresight.dtsi | 130 +- arch/arm64/boot/dts/qcom/msm8916.dtsi | 85 +- drivers/hwtracing/coresight/Kconfig | 21 + drivers/hwtracing/coresight/Makefile | 3 + .../coresight/coresight-cti-platform.c | 485 +++++++ .../hwtracing/coresight/coresight-cti-sysfs.c | 1175 +++++++++++++++++ drivers/hwtracing/coresight/coresight-cti.c | 748 +++++++++++ drivers/hwtracing/coresight/coresight-cti.h | 235 ++++ .../hwtracing/coresight/coresight-platform.c | 21 + drivers/hwtracing/coresight/coresight-priv.h | 15 + drivers/hwtracing/coresight/coresight.c | 86 +- include/dt-bindings/arm/coresight-cti-dt.h | 37 + include/linux/coresight.h | 27 + 24 files changed, 4092 insertions(+), 31 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-cti create mode 100644 Documentation/devicetree/bindings/arm/coresight-cti.yaml create mode 100644 Documentation/trace/coresight/coresight-ect.rst create mode 100644 drivers/hwtracing/coresight/coresight-cti-platform.c create mode 100644 drivers/hwtracing/coresight/coresight-cti-sysfs.c create mode 100644 drivers/hwtracing/coresight/coresight-cti.c create mode 100644 drivers/hwtracing/coresight/coresight-cti.h create mode 100644 include/dt-bindings/arm/coresight-cti-dt.h -- 2.17.1