From patchwork Sat Apr 6 11:21:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 161903 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1524664jan; Sat, 6 Apr 2019 04:22:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyagJQhzQS/RIVJ1lAzu0/2x/a5fCkUX0VKKdTjcnuDMEtZfR4USIDSUJOT8THNSsstsudr X-Received: by 2002:a17:902:bb8f:: with SMTP id m15mr18481921pls.247.1554549749514; Sat, 06 Apr 2019 04:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554549749; cv=none; d=google.com; s=arc-20160816; b=epVFYWHMhpjFEAql2uck9b83soSDX1BlE7JHOWTjva4aefq4BRCT8SvJp4k7Tl4xPi 009WmUyN9/Gj/xzLcSsTwG3OP2N+bpirYWnpFqr55RKz4z0nHy68i6idp1An/Ly0qp8h LuLR6NnMcqwCUwwFTmCGtJvuZdxHvtqxLR0YuRxfL8VTgii4vakMiWsEEFZKBEZlb9lk 0Ac+wBUEVJxQzgrWLIsUkW590nbeTX4wtaCNFQdbicnbo0x8674sGhoVyIisNGGAJE7j S7lbmZAWO1fSKRKLMORxfAUjgZOQQXuOoqqXyR34WumNf+HPPImqeMP8cN3n0+PtmmRs s4lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=gLR19HUc+gmFjS967MFA8MMpurGf3MGUCdDqqoTyKSg=; b=y7ta3CU06+644UXL3Nxa0v8tSIS2w3qrS6n2ddln2HxKQCtJzuGqa6WaNtbFp6XXfj LqwwYsOW8hrJ1LvO6Hh4T6TqgPXNfhXqaeKXyxEWaDJUY43tSAmEf7O06DzCnibya1Av G+y4WoG6cLiR/BWn9NoO6nNobdk4Bu3Sd+OJrcDHhISZg+gI0tdvUDH8idNSdl387nMk uQ/D5bzkvowQULeiGQ8Uu0Hg5u9iORuER343lod+Rw2xb10w9jEtdAgYzOUKCwBIC1uZ pQOjGGx+y2z68wfpGYCH38SUyHm+nJ2qkZeiGtfPFMHSO9cX958D6EoYJ+rsHi3bIHMG aIRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=coGSFv8K; 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 z186si19639082pgd.155.2019.04.06.04.22.29; Sat, 06 Apr 2019 04:22:29 -0700 (PDT) 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=coGSFv8K; 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 S1726539AbfDFLW2 (ORCPT + 7 others); Sat, 6 Apr 2019 07:22:28 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:35001 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfDFLW2 (ORCPT ); Sat, 6 Apr 2019 07:22:28 -0400 Received: by mail-yb1-f194.google.com with SMTP id e12so3405538ybq.2 for ; Sat, 06 Apr 2019 04:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gLR19HUc+gmFjS967MFA8MMpurGf3MGUCdDqqoTyKSg=; b=coGSFv8K1L/KQk7yOFkkw+BoZ0QXgZirUaQOqnqT4WFiK6AKev8A8EPZC/iZyVSxJY 6H8ZBBzuJa75AwcskBk+kv0slv1O4R9yOcfbmxgafT+xtHf+PKXMTufk5TX5CtGkJsmJ bpb9NasXW1OJ2FFAJNDU17PI6T9vkGLO9++s72KTiZcl/sbpLBQ1z0uUH96tkpfJTOPD BpQzHOtGErPnSYLVzvFtNFK4jzrib5YVi/JXvATqj8/4lTn3JHLSRRx8qrNhaYDh6zFG /sU/42o41b64q3vSuXyS62FC/8K2X99daZLHdPmJegW8qQ4U0Iw7fjRZD6UGZbgQtMfr MDRw== 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:in-reply-to :references; bh=gLR19HUc+gmFjS967MFA8MMpurGf3MGUCdDqqoTyKSg=; b=jxwbWzYuYm0X2QoOWqAmqgklflhEzcGApK1wNtDD+yoeR9z9nWe67ByAmH8L2dCWxr PbrEOVW9Kg4LesDPAEqAGT3JDtm3aD5nP1ptnWf1iPRf6lzzDq27wzHeHjvIALQl2oRO FqmZobPIJvuhWXyxd0F3TsOeDBbHugJYC+zV4h/AvUw/oXRtkR32Nfa0LvF368RiG4zG x66ltmr9mEULjD/7DuZ6oE6QQPzQZxPb4fMf7Sk3ZH1dQSv+e6liVPuwbwvrsYOZtTwp M+Dv2Dzo+bW2M4TmFB7GXZd2/SoQcbSKy6XX1ZqxbH73sa6HOPGDPgOXyHe+riD9r1kR MLEQ== X-Gm-Message-State: APjAAAWw955t0rf2XkfePGmNArnQ8cWBfVZ3sBrqtOF9TAZToT0MleFp aGMJ6Oes57e1GDAVE3+kxOFw9Q== X-Received: by 2002:a25:cc86:: with SMTP id l128mr4507046ybf.266.1554549747464; Sat, 06 Apr 2019 04:22:27 -0700 (PDT) Received: from localhost.localdomain (li931-65.members.linode.com. [45.56.113.65]) by smtp.gmail.com with ESMTPSA id w22sm12729360yww.58.2019.04.06.04.22.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Apr 2019 04:22:26 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , Suzuki K Poulose , Rob Herring , Mark Rutland , Alexander Shishkin , Wanglai Shi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 2/4] coresight: replicator: Add new device id for static replicator Date: Sat, 6 Apr 2019 19:21:43 +0800 Message-Id: <20190406112145.15184-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190406112145.15184-1-leo.yan@linaro.org> References: <20190406112145.15184-1-leo.yan@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds a device id for the new static replicator compatible string; it changes the driver name from "coresight-replicator" to "coresight-static-replicator" as well. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-replicator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index 4e0da85efd2d..e6a03642bbdb 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -285,13 +285,14 @@ static const struct dev_pm_ops replicator_dev_pm_ops = { static const struct of_device_id static_replicator_match[] = { {.compatible = "arm,coresight-replicator"}, + {.compatible = "arm,coresight-static-replicator"}, {} }; static struct platform_driver static_replicator_driver = { .probe = static_replicator_probe, .driver = { - .name = "coresight-replicator", + .name = "coresight-static-replicator", .of_match_table = static_replicator_match, .pm = &replicator_dev_pm_ops, .suppress_bind_attrs = true, From patchwork Sat Apr 6 11:21:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 161904 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1524727jan; Sat, 6 Apr 2019 04:22:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/1TNbbk9XsNhw8dRYivszrx1iSl5D6k2K1EXAk5la0JxB2oZJP/ciqQELaed/y0WijOrS X-Received: by 2002:a17:902:e382:: with SMTP id ch2mr18057580plb.94.1554549754264; Sat, 06 Apr 2019 04:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554549754; cv=none; d=google.com; s=arc-20160816; b=hbnP4t2mTdtkAlI/QSfoFWWLaqZpRq9G50Gt+k7o4uQlCAonLi67+krDZQqYL7Bk9G xigqQG/hCNGXX6ASSZhfUST3XSGLpd+PCcfDSPiWvscsdigkmB59bLtRumSXkE6Qupuk tm5+eQ+9enAyn/RrpDkpXBonGsCLorGw+as5bNIPDnQ+Rh652Na4zaSXZqUNa5+2WSSA AV5HADilkmYgFRVBx2U4b0HQW4kPNB3leb3pDPAE5MYLJndMDYOZ3D+gukjryPDGdo1c IRAzPhkxE8mGq6txtG3waNyjnzuPUTKsh+zqJqbDczkiPQnyGbS2nXQg6gDZbxU+MUlr aRKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MF+LyKhdoU3hTyItL4k9rMey7QhjKplrEVwhrLx8K+k=; b=d48S2yuvxLBtawCAewXGZH8uoCJFGd32sEOKokhxaF4rEaaTReXShwKBnqsqjo2Dbv PjxLSvcsx437rdaSubDqjsFzwuH5mZqpaHbAJwQ5bcph5xrK8c395+96vWX7P/4iBD5a OJQC1fsoRKUq5FSy8TJqxf3159M8071sz8Sn/jw1/Yzw23YYwz+vSvuXUogWaTLORxLG AjVYVkLIBm7r3TuVwLyRHDwL9uxcSX2cwb3q7TBB48ze0qq+weEkRB85Bn6ryWc24YlP 7GBwQ8YwefN3ByiBuTWeR038UC2lx/O6gFhfr/RFJmzbLDihrgLzj+BrlBC1EuW2wHAP q0zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GKaTd1XN; 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 3si21536271plz.116.2019.04.06.04.22.34; Sat, 06 Apr 2019 04:22:34 -0700 (PDT) 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=GKaTd1XN; 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 S1726573AbfDFLWd (ORCPT + 7 others); Sat, 6 Apr 2019 07:22:33 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:45977 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbfDFLWd (ORCPT ); Sat, 6 Apr 2019 07:22:33 -0400 Received: by mail-yw1-f65.google.com with SMTP id j128so3252769ywg.12 for ; Sat, 06 Apr 2019 04:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MF+LyKhdoU3hTyItL4k9rMey7QhjKplrEVwhrLx8K+k=; b=GKaTd1XNwC+NCs4UdvfIhT9EeA1ihEtU8RMheZ4131dQvjG9XcTr94HaBLw1kKAWIR 8DrOBuT2lBXjMbhbqL4GT8MuwdecJ96PsJfyT11XdBptVnPpkheKYFFF1oojvVLQGj6Z QA6O+6ZabG2zkzMX0BI8h7nY3F+QHGAScnQqXvYSnVQLs/5P50Jqz9Je0653ARtQt8TY eW1T0mdvjWxv1u5s0qQMyIKMhMkEa2n4AHuZY6KJSeduX6K2H5XzXlNM2PTeISttqqt9 oGGJKEsodWjb2+eMsEeszLS/EB06mj8fG8s7ykRNnkZ02iuN+nPjulPd6njjFDnS6p8e 3MCg== 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:in-reply-to :references; bh=MF+LyKhdoU3hTyItL4k9rMey7QhjKplrEVwhrLx8K+k=; b=dJdoXm1z0OW4XZNthDHBZf1w3q14mxMvc9CIDJdOM1Y9PaUgqWxuVU16gDpVEK9bKJ +Z6LVACyK8pePlagJp5DmsWV036+xztNH3gHTWmno7KNtFYDrOL3eJmQBVF4m+pKTG10 zrUf3TZtB4+SvRWCRgkl7ooLftKtvimnYC+B7ExAJHxc3nFyD3I5VvRNikU/XMnsm1hw y7QUualLeprhezkDU84ilY51vX1WjhTe/E1TWnJ42jcO1LQkmQZp1rcczZnAmQOibt37 TTWSRj9wTFEeg1Go90UD+U0DmnupT1U+fxNca9tb+wN/zEoDrZaZnKmUsbQJoydG/2Dr xyTQ== X-Gm-Message-State: APjAAAWcklr9fgazuZfRNrTj6gTfnqLgDPJ1Ku/V7Fx8LzdMQp03dBqa 5YzFArU9Qv/I3Ho+HHjXlGeEOg== X-Received: by 2002:a81:9982:: with SMTP id q124mr14774369ywg.390.1554549751987; Sat, 06 Apr 2019 04:22:31 -0700 (PDT) Received: from localhost.localdomain (li931-65.members.linode.com. [45.56.113.65]) by smtp.gmail.com with ESMTPSA id w22sm12729360yww.58.2019.04.06.04.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Apr 2019 04:22:31 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , Suzuki K Poulose , Rob Herring , Mark Rutland , Alexander Shishkin , Wanglai Shi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 3/4] dt-bindings: arm: coresight: Unify funnel DT binding Date: Sat, 6 Apr 2019 19:21:44 +0800 Message-Id: <20190406112145.15184-4-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190406112145.15184-1-leo.yan@linaro.org> References: <20190406112145.15184-1-leo.yan@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Following the same fashion with replicator DT binding, this patch is to unify the DT binding for funnel to support static and dynamic modes; finally we get the funnel DT binding as below: Before patch: Static funnel, aka. non-configurable funnel: Not supported; Dynamic funnel, aka. configurable funnel: "arm,coresight-funnel", "arm,primecell"; After patch: Static funnel: "arm,coresight-static-funnel"; Dynamic funnel: "arm,coresight-funnel", "arm,primecell"; (obsolete) "arm,coresight-dynamic-funnel", "arm,primecell"; At the end of this patch, it gives an example for static funnel DT binding, and updates the dynamic funnel example. Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Wanglai Shi Signed-off-by: Leo Yan --- .../devicetree/bindings/arm/coresight.txt | 52 +++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/arm/coresight.txt b/Documentation/devicetree/bindings/arm/coresight.txt index f8f794869af2..f8ad11a17cd5 100644 --- a/Documentation/devicetree/bindings/arm/coresight.txt +++ b/Documentation/devicetree/bindings/arm/coresight.txt @@ -8,7 +8,8 @@ through the intermediate links connecting the source to the currently selected sink. Each CoreSight component device should use these properties to describe its hardware characteristcs. -* Required properties for all components *except* non-configurable replicators: +* Required properties for all components *except* non-configurable replicators + and non-configurable funnels: * compatible: These have to be supplemented with "arm,primecell" as drivers are using the AMBA bus interface. Possible values include: @@ -24,8 +25,11 @@ its hardware characteristcs. discovered at boot time when the device is probed. "arm,coresight-tmc", "arm,primecell"; - - Trace Funnel: + - Trace Programmable Funnel, the compatible string + "arm,coresight-funnel" is obsolete, keep it to support + the old DT bindings: "arm,coresight-funnel", "arm,primecell"; + "arm,coresight-dynamic-funnel", "arm,primecell"; - Embedded Trace Macrocell (version 3.x) and Program Flow Trace Macrocell: @@ -65,7 +69,7 @@ its hardware characteristcs. "stm-stimulus-base", each corresponding to the areas defined in "reg". * Required properties for devices that don't show up on the AMBA bus, such as - non-configurable replicators: + non-configurable replicators and non-configurable funnels: * compatible: Currently supported value is (note the absence of the AMBA markee): @@ -75,6 +79,9 @@ its hardware characteristcs. "arm,coresight-replicator"; "arm,coresight-static-replicator"; + - Coresight Non-configurable Funnel: + "arm,coresight-static-funnel"; + * port or ports: see "Graph bindings for Coresight" below. * Optional properties for ETM/PTMs: @@ -204,8 +211,45 @@ Example: }; }; + funnel { + /* + * non-configurable funnel don't show up on the AMBA + * bus. As such no need to add "arm,primecell". + */ + compatible = "arm,coresight-static-funnel"; + clocks = <&crg_ctrl HI3660_PCLK>; + clock-names = "apb_pclk"; + + out-ports { + port { + combo_funnel_out: endpoint { + remote-endpoint = <&top_funnel_in>; + }; + }; + }; + + in-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + combo_funnel_in0: endpoint { + remote-endpoint = <&cluster0_etf_out>; + }; + }; + + port@1 { + reg = <1>; + combo_funnel_in1: endpoint { + remote-endpoint = <&cluster1_etf_out>; + }; + }; + }; + }; + funnel@20040000 { - compatible = "arm,coresight-funnel", "arm,primecell"; + compatible = "arm,coresight-dynamic-funnel", "arm,primecell"; reg = <0 0x20040000 0 0x1000>; clocks = <&oscclk6a>; From patchwork Sat Apr 6 11:21:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 161905 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1524821jan; Sat, 6 Apr 2019 04:22:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+fqlZsK7yQy03GI4zRN6t2VctXmEPbW5tqzOKtnl3OAx4SwbzChwHXHsRCmCLjwDbWgke X-Received: by 2002:a63:1247:: with SMTP id 7mr17161496pgs.352.1554549760389; Sat, 06 Apr 2019 04:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554549760; cv=none; d=google.com; s=arc-20160816; b=LTdrdE6SnFx2ITPCUWjWN2HrcsnBnsZ1GkOM0mS3bvfQ+GqUVwcmp9qexFlcwvGMtv 7wk/MSxWBzaQpEFK82l04/mjzYT3tRqQaOyPJBIzRL4v9gjqHxJf7Km+DnGWoQGNh+A8 3QDtK7vmKoYK/+ejidz/MJSlEd6ZLk1H94yyWzj6KdU4ah2ExkGm+NJB1lNasZJ5lhI0 CJHASEcDXScP/IQOEx8U6Qnivwv+1ZUi66bka7Yoq+pZVFBSbOJvPrCMalUOrM/FCjQQ crRSJlr1kniacGhcftuHNOapwmj/vz0U7WdQFV8IrcTLnOfmUcUJNtJbd68qWzWApvr6 Cjrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=4LpYRL6amcq1y1zo/McGCepepBd+6zq1F9/XI0pWbWY=; b=KfUUDmbII3G5FTS7DaoheXGw0/wP/BCMORe1axa4tUr47IHZebxzVNqAg1yMOj+EfV Rc7nJP45sGunW7Uwq9eFdWapwrG5zXFXIwmbNDf7tSFXx2zRkmUGCiOMze04gl8NaF+J xUqMw/9/pxxzBk5qfqRR4S327e2cCJk1c0pdhl4PyafIof65wittpSIGkjiJHD/97yrp C419c6l1P0drV9TMe+LQucaAvrtV0ws9rjtueGaHXeYvSrKOpAL9GLeyQngMFV37kOya ArmlHZBnSrDNbFLekE26LvxvNscNvpMIJC6ghqHn5t+75svoZtYArsPpHqIUGfeVBuQH EYRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wWxaRb40; 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 p6si22463488pgp.459.2019.04.06.04.22.40; Sat, 06 Apr 2019 04:22:40 -0700 (PDT) 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=wWxaRb40; 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 S1726607AbfDFLWj (ORCPT + 7 others); Sat, 6 Apr 2019 07:22:39 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:37215 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfDFLWj (ORCPT ); Sat, 6 Apr 2019 07:22:39 -0400 Received: by mail-yw1-f65.google.com with SMTP id w66so3274262ywd.4 for ; Sat, 06 Apr 2019 04:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4LpYRL6amcq1y1zo/McGCepepBd+6zq1F9/XI0pWbWY=; b=wWxaRb40D0nkGfztICIU4j026UzE7ocN8AtAYEA8pCkUGYLCR4QoxCHjBG9GB0VvTA DBBHq87i/otSdRUyHHVwSwirB3/P9d1J5QH+/Gv043QjbnFBUPK+mhBcCZRZ2efv2TSg yP8Qb6clB2ZVZhz2ibessyTH7Jr7reva7D064QN4FO/ODDHkko7Ifd2+6T316j+e41ip k/lf/MrIsivgH7lxyFjNc9W3WzVRubCqdxUCb/Nt68jjzVqn9QsgiAjCg4vJhtJdB126 7nqIf4Ovo6P9tbo23lqPggyafdKxkSUqtdUvwnTImIFKl8A6euWGpmoXisYo6cpYqL8/ 6rlg== 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:in-reply-to :references; bh=4LpYRL6amcq1y1zo/McGCepepBd+6zq1F9/XI0pWbWY=; b=qylP25332DJT73y5xfhp0r+lWqGJe/1oEi+nb7JQoejBqAUrRGyBUhJBZO4MmYBTU6 c1lJbD51Ap6tGUHTVM/5jPoPWY0mYcgar9lNbVwlqbXYAL6/MzGbGvy871gBaLqWM26u 9RRsIOAhlUxnhi2caqZAKwSvPBb0uSoqPNwTDDPBjXIH0SaoBAlMyhBSUV07NVp9uaHY NvM6qaV1HPTlMOoKYJIfLERnOquW1vcE6gnQFFoooFhyPqRNffWANHiGW3S4QhZ1AhX6 By/wV6o3RmYkYIZPQQFgsFjU/eKrOOKzjTdKkExvQhJ/2pMDw/0pvLTprlm7tiamPbOe XjcQ== X-Gm-Message-State: APjAAAXSuE+oMtrldkidIU+HXAkZP/ZDF3d3O1VprVpPQqN9UgFfNPcs hOY+TWyQIlgYCN6iyfdxuv9CrA== X-Received: by 2002:a81:a00e:: with SMTP id x14mr12492599ywg.281.1554549757934; Sat, 06 Apr 2019 04:22:37 -0700 (PDT) Received: from localhost.localdomain (li931-65.members.linode.com. [45.56.113.65]) by smtp.gmail.com with ESMTPSA id w22sm12729360yww.58.2019.04.06.04.22.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Apr 2019 04:22:37 -0700 (PDT) From: Leo Yan To: Mathieu Poirier , Suzuki K Poulose , Rob Herring , Mark Rutland , Alexander Shishkin , Wanglai Shi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v4 4/4] coresight: funnel: Support static funnel Date: Sat, 6 Apr 2019 19:21:45 +0800 Message-Id: <20190406112145.15184-5-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190406112145.15184-1-leo.yan@linaro.org> References: <20190406112145.15184-1-leo.yan@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Since CoreSight hardware topology can use a 'hidden' funnel in the trace data path, this kind funnel doesn't have register for accessing and is used by default from hardware design perspective. Below is an example for related hardware topology: +------+ +------+ | cpu0 |->| ETM |-\ +------+ +------+ \-> +--------+ +-----+ ...... | Funnel |->| ETF |-\ Hidden funnel +------+ +------+ /-> +--------+ +-----+ \ | | cpu3 |->| ETM |-/ \ V +------+ +------+ \-> +--------+ | Funnel |-> ... +------+ +------+ /-> +--------+ | cpu4 |->| ETM |-\ / +------+ +------+ \-> +--------+ +-----+ / ...... | Funnel |->| ETF |-/ +------+ +------+ /-> +--------+ +-----+ | cpu7 |->| ETM |-/ +------+ +------+ The CoreSight funnel driver only supports dynamic funnel with registration register resource, thus it cannot support for the static funnel case and it's impossible to create trace data path for this case. This patch is to extend CoreSight funnel driver to support both for static funnel and dynamic funnel. For the dynamic funnel it reuses the code existed in the driver, for static funnel the driver will support device probe if without providing register resource and the driver skips registers accessing when detect the register base is NULL. Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Wanglai Shi Suggested-by: Suzuki K Poulose Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose --- .../hwtracing/coresight/coresight-funnel.c | 112 +++++++++++++----- 1 file changed, 85 insertions(+), 27 deletions(-) -- 2.17.1 diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 927925151509..2030d2596d90 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,7 @@ struct funnel_drvdata { unsigned long priority; }; -static int funnel_enable_hw(struct funnel_drvdata *drvdata, int port) +static int dynamic_funnel_enable_hw(struct funnel_drvdata *drvdata, int port) { u32 functl; int rc = 0; @@ -71,17 +72,19 @@ static int funnel_enable_hw(struct funnel_drvdata *drvdata, int port) static int funnel_enable(struct coresight_device *csdev, int inport, int outport) { - int rc; + int rc = 0; struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - rc = funnel_enable_hw(drvdata, inport); + if (drvdata->base) + rc = dynamic_funnel_enable_hw(drvdata, inport); if (!rc) dev_dbg(drvdata->dev, "FUNNEL inport %d enabled\n", inport); return rc; } -static void funnel_disable_hw(struct funnel_drvdata *drvdata, int inport) +static void dynamic_funnel_disable_hw(struct funnel_drvdata *drvdata, + int inport) { u32 functl; @@ -103,7 +106,8 @@ static void funnel_disable(struct coresight_device *csdev, int inport, { struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); - funnel_disable_hw(drvdata, inport); + if (drvdata->base) + dynamic_funnel_disable_hw(drvdata, inport); dev_dbg(drvdata->dev, "FUNNEL inport %d disabled\n", inport); } @@ -177,54 +181,67 @@ static struct attribute *coresight_funnel_attrs[] = { }; ATTRIBUTE_GROUPS(coresight_funnel); -static int funnel_probe(struct amba_device *adev, const struct amba_id *id) +static int funnel_probe(struct device *dev, struct resource *res) { int ret; void __iomem *base; - struct device *dev = &adev->dev; struct coresight_platform_data *pdata = NULL; struct funnel_drvdata *drvdata; - struct resource *res = &adev->res; struct coresight_desc desc = { 0 }; - struct device_node *np = adev->dev.of_node; + struct device_node *np = dev->of_node; if (np) { pdata = of_get_coresight_platform_data(dev, np); if (IS_ERR(pdata)) return PTR_ERR(pdata); - adev->dev.platform_data = pdata; + dev->platform_data = pdata; } drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); if (!drvdata) return -ENOMEM; - drvdata->dev = &adev->dev; - drvdata->atclk = devm_clk_get(&adev->dev, "atclk"); /* optional */ + drvdata->dev = dev; + drvdata->atclk = devm_clk_get(dev, "atclk"); /* optional */ if (!IS_ERR(drvdata->atclk)) { ret = clk_prepare_enable(drvdata->atclk); if (ret) return ret; } - dev_set_drvdata(dev, drvdata); - /* Validity for the resource is already checked by the AMBA core */ - base = devm_ioremap_resource(dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); + /* + * Map the device base for dynamic-funnel, which has been + * validated by AMBA core. + */ + if (res) { + base = devm_ioremap_resource(dev, res); + if (IS_ERR(base)) { + ret = PTR_ERR(base); + goto out_disable_clk; + } + drvdata->base = base; + desc.groups = coresight_funnel_groups; + } - drvdata->base = base; - pm_runtime_put(&adev->dev); + dev_set_drvdata(dev, drvdata); desc.type = CORESIGHT_DEV_TYPE_LINK; desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_MERG; desc.ops = &funnel_cs_ops; desc.pdata = pdata; desc.dev = dev; - desc.groups = coresight_funnel_groups; drvdata->csdev = coresight_register(&desc); + if (IS_ERR(drvdata->csdev)) { + ret = PTR_ERR(drvdata->csdev); + goto out_disable_clk; + } + + pm_runtime_put(dev); - return PTR_ERR_OR_ZERO(drvdata->csdev); +out_disable_clk: + if (ret && !IS_ERR_OR_NULL(drvdata->atclk)) + clk_disable_unprepare(drvdata->atclk); + return ret; } #ifdef CONFIG_PM @@ -253,7 +270,48 @@ static const struct dev_pm_ops funnel_dev_pm_ops = { SET_RUNTIME_PM_OPS(funnel_runtime_suspend, funnel_runtime_resume, NULL) }; -static const struct amba_id funnel_ids[] = { +static int static_funnel_probe(struct platform_device *pdev) +{ + int ret; + + pm_runtime_get_noresume(&pdev->dev); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + + /* Static funnel do not have programming base */ + ret = funnel_probe(&pdev->dev, NULL); + + if (ret) { + pm_runtime_put_noidle(&pdev->dev); + pm_runtime_disable(&pdev->dev); + } + + return ret; +} + +static const struct of_device_id static_funnel_match[] = { + {.compatible = "arm,coresight-static-funnel"}, + {} +}; + +static struct platform_driver static_funnel_driver = { + .probe = static_funnel_probe, + .driver = { + .name = "coresight-static-funnel", + .of_match_table = static_funnel_match, + .pm = &funnel_dev_pm_ops, + .suppress_bind_attrs = true, + }, +}; +builtin_platform_driver(static_funnel_driver); + +static int dynamic_funnel_probe(struct amba_device *adev, + const struct amba_id *id) +{ + return funnel_probe(&adev->dev, &adev->res); +} + +static const struct amba_id dynamic_funnel_ids[] = { { .id = 0x000bb908, .mask = 0x000fffff, @@ -266,14 +324,14 @@ static const struct amba_id funnel_ids[] = { { 0, 0}, }; -static struct amba_driver funnel_driver = { +static struct amba_driver dynamic_funnel_driver = { .drv = { - .name = "coresight-funnel", + .name = "coresight-dynamic-funnel", .owner = THIS_MODULE, .pm = &funnel_dev_pm_ops, .suppress_bind_attrs = true, }, - .probe = funnel_probe, - .id_table = funnel_ids, + .probe = dynamic_funnel_probe, + .id_table = dynamic_funnel_ids, }; -builtin_amba_driver(funnel_driver); +builtin_amba_driver(dynamic_funnel_driver);