From patchwork Wed Nov 4 10:36:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 318286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9EE5C4741F for ; Wed, 4 Nov 2020 10:37:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 686B72245A for ; Wed, 4 Nov 2020 10:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="lyL1nUWR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729526AbgKDKhj (ORCPT ); Wed, 4 Nov 2020 05:37:39 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47683 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729481AbgKDKhi (ORCPT ); Wed, 4 Nov 2020 05:37:38 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103724euoutp02fa43e18a1181248e9e7a2a228663d0d6~ER70Yobec2966229662euoutp02Y for ; Wed, 4 Nov 2020 10:37:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201104103724euoutp02fa43e18a1181248e9e7a2a228663d0d6~ER70Yobec2966229662euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486244; bh=4jDdkOF9KeaEav3yECAHUsBxo9tM3wtiBUfvzdDFRkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lyL1nUWR6947aKNv8qUlW5DBXHxQZQu95Cd+l26ywZIWYsGBH7LSBgmCExUa5UjxQ Khjqv1Loiprl2p/QioOqfnnqhQho0/jB+GiKFiZN/7s64QgQlW7D8jsJ4ZDP8QIPKS /vOhZqr6SXpKm3wIaOcz1b9mGFNbeknewZrJL0Dw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201104103719eucas1p2198ed14bf3f225a0c2098e5aa63a9e96~ER7vSYIQ41146911469eucas1p2i; Wed, 4 Nov 2020 10:37:19 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id D3.0A.06318.F5482AF5; Wed, 4 Nov 2020 10:37:19 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201104103718eucas1p1c103f1a96499b03c72e5457ac2542c3d~ER7vAzdL91562315623eucas1p1I; Wed, 4 Nov 2020 10:37:18 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103718eusmtrp187d459d3c57732985efa60614a7bcab6~ER7vAHWqL0575105751eusmtrp1J; Wed, 4 Nov 2020 10:37:18 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-7d-5fa2845f005e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3A.75.06314.E5482AF5; Wed, 4 Nov 2020 10:37:18 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103718eusmtip25006f9bb88eff50476c174c7a16ba0f7~ER7uR07EW1402114021eusmtip2F; Wed, 4 Nov 2020 10:37:18 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 1/7] dt-bindings: devfreq: Add documentation for the interconnect properties Date: Wed, 4 Nov 2020 11:36:51 +0100 Message-Id: <20201104103657.18007-2-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0iTYRTHefZeN5q9m5IHu+HoQkVesA9PaVlisE8h9CGyy3rTF610k71e i0hbZnnDlJqXULMr66bzgl3UmssVkjMVE1xpaJRWSE0JKzLna+W3/znn93/+58DDEup+yo89 ok8WjHo+QUMryKaO6a6NujM1uqCnjV54qDIb4brS+xR+PfmBwlX2Lgr3TU3Q2NxipXHxUBGJ nc5aBltH+inc+/Ayjd0FdoRLna0yfNf+hsGDWbdonN1iZ3D75xwKl5aM0dtVWqvlPK119T+m tUN5Dpm2/topbWGDBWnd1hVRdLQiLFZIOJIqGAO3HVLEl1W8pZKcq9I7Gkx0JnItz0VyFrhN UND/nc5FClbN3ULQVvFgvphEUHW1kpEKN4Lv9c3kX8sFp2ueuom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+zQMyXl1i94QAziM0pYCNx8XMzO8Qua4nFz89B1QtK nJz5hAXkNGYBdYn184QgVslLNG+dzTyBUXAWkqpZCFWzkFQtYGRexSiSWlqcm55bbKhXnJhb XJqXrpecn7uJERip24793LyD8dLG4EOMAhyMSjy8B7YtjBdiTSwrrsw9xCjBwawkwut09nSc EG9KYmVValF+fFFpTmrxIUZToNcmMkuJJucDk0heSbyhqaG5haWhubG5sZmFkjhvh8DBGCGB 9MSS1OzU1ILUIpg+Jg5OqQbGyJwjvcysdZWHF0/ZI/lv11nnek+H45NFM2dt25LC1nstYYuw hNbNkmmi535eqrt7OOSvaJLocwajGce3JKZcODtb48LpvDnfFUUlFzx4flnif+ZEkfwZ7w8s 9q9/Nj9wj4vJ1Em/11ybxiZ8eXaSSb935pKGuWtXLvbetTAs9nGdY5z9pXXFT5RYijMSDbWY i4oTAfJNaOnqAgAA X-CMS-MailID: 20201104103718eucas1p1c103f1a96499b03c72e5457ac2542c3d X-Msg-Generator: CA X-RootMTR: 20201104103718eucas1p1c103f1a96499b03c72e5457ac2542c3d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103718eucas1p1c103f1a96499b03c72e5457ac2542c3d References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add documentation for new optional properties in the exynos bus nodes: interconnects, #interconnect-cells, samsung,data-clock-ratio. These properties allow to specify the SoC interconnect structure which then allows the interconnect consumer devices to request specific bandwidth requirements. Signed-off-by: Artur Świgoń Signed-off-by: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski Acked-by: Rob Herring --- Changes for v8: - updated description of the interconnects property, - fixed typo in samsung,data-clk-ratio property description. Changes for v7: - bus-width property replaced with samsung,data-clock-ratio, - the interconnect consumer bindings used instead of vendor specific properties Changes for v6: - added dts example of bus hierarchy definition and the interconnect consumer, - added new bus-width property. Changes for v5: - exynos,interconnect-parent-node renamed to samsung,interconnect-parent --- .../devicetree/bindings/devfreq/exynos-bus.txt | 71 +++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt index e71f752..bcaa2c0 100644 --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -51,6 +51,19 @@ Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. +Optional properties for the interconnect functionality (QoS frequency +constraints): +- #interconnect-cells: should be 0. +- interconnects: as documented in ../interconnect.txt, describes a path at the + higher level interconnects used by this interconnect provider. + If this interconnect provider is directly linked to a top level interconnect + provider the property contains only one phandle. The provider extends + the interconnect graph by linking its node to a node registered by provider + pointed to by first phandle in the 'interconnects' property. + +- samsung,data-clock-ratio: ratio of the data throughput in B/s to minimum data + clock frequency in Hz, default value is 8 when this property is missing. + Detailed correlation between sub-blocks and power line according to Exynos SoC: - In case of Exynos3250, there are two power line as following: VDD_MIF |--- DMC @@ -135,7 +148,7 @@ Detailed correlation between sub-blocks and power line according to Exynos SoC: |--- PERIC (Fixed clock rate) |--- FSYS (Fixed clock rate) -Example1: +Example 1: Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to power line (regulator). The MIF (Memory Interface) AXI bus is used to transfer data between DRAM and CPU and uses the VDD_MIF regulator. @@ -184,7 +197,7 @@ Example1: |L5 |200000 |200000 |400000 |300000 | ||1000000 | ---------------------------------------------------------- -Example2 : +Example 2: The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi is listed below: @@ -419,3 +432,57 @@ Example2 : devfreq = <&bus_leftbus>; status = "okay"; }; + +Example 3: + An interconnect path "bus_display -- bus_leftbus -- bus_dmc" on + Exynos4412 SoC with video mixer as an interconnect consumer device. + + soc { + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + samsung,data-clock-ratio = <4>; + #interconnect-cells = <0>; + }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + #interconnect-cells = <0>; + interconnects = <&bus_dmc>; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + #interconnect-cells = <0>; + interconnects = <&bus_leftbus &bus_dmc>; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + /* ... */ + } + + bus_leftbus_opp_table: opp_table3 { + compatible = "operating-points-v2"; + /* ... */ + }; + + bus_display_opp_table: opp_table4 { + compatible = "operating-points-v2"; + /* .. */ + }; + + &mixer { + compatible = "samsung,exynos4212-mixer"; + interconnects = <&bus_display &bus_dmc>; + /* ... */ + }; + }; From patchwork Wed Nov 4 10:36:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 318287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1E20C55178 for ; Wed, 4 Nov 2020 10:37:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7ECC921734 for ; Wed, 4 Nov 2020 10:37:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="slnqbfiJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729482AbgKDKhe (ORCPT ); Wed, 4 Nov 2020 05:37:34 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47598 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729473AbgKDKhd (ORCPT ); Wed, 4 Nov 2020 05:37:33 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103721euoutp01fd21b216be313f30be4624da7ea81492~ER7xeDe9o0672206722euoutp01t for ; Wed, 4 Nov 2020 10:37:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201104103721euoutp01fd21b216be313f30be4624da7ea81492~ER7xeDe9o0672206722euoutp01t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486241; bh=GkqmnWRueLbCNn+fnyxHBWnGznUabFDMe8Pbo74DYlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slnqbfiJL0D5OtjrMBTIBWQaHvmSX6rTO/Q3vMSjQDZvs0tpPqKwK/DPvndfO+MLt WjfK0WZzriFSxcgpy9lXBW+Vz5NyQdeFATb+zXyhCLRjEB4PUf/rupR4DSdiwvFh4k DoTj0kvoT5hLp1ggDqhQh+JaH0CF42G29rsPwldI= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201104103721eucas1p1a6e6799b72cea8b605b9994040cc43fe~ER7xJBzml3079730797eucas1p1t; Wed, 4 Nov 2020 10:37:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E9.8F.05997.16482AF5; Wed, 4 Nov 2020 10:37:21 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201104103720eucas1p1014217e751a681796ed508af22c6bb12~ER7wsMqqw1564115641eucas1p1s; Wed, 4 Nov 2020 10:37:20 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103720eusmtrp1386e554c3c709f85f943fc973465fe86~ER7wrfWxM0575105751eusmtrp1Q; Wed, 4 Nov 2020 10:37:20 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-76-5fa28461b829 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1C.75.06314.06482AF5; Wed, 4 Nov 2020 10:37:20 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103720eusmtip21023e65e4a625a929256fb7f525f18cf~ER7wAajNI1401714017eusmtip2G; Wed, 4 Nov 2020 10:37:20 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 2/7] interconnect: Add generic interconnect driver for Exynos SoCs Date: Wed, 4 Nov 2020 11:36:52 +0100 Message-Id: <20201104103657.18007-3-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0iTYRjl3XfZp7n6XIYPswsNJYzSrKiXtJtIrFIyfxRFpZ/5pZZabZrZ jzLULupCLNjyngTaIlyrplia6Mx05LJiFioSabXKxDZH6+72Lerfec5zDuc8Ly9DSK2UjEnP yuaVWVyGnPYljY9cluVcYX3iir4Xfni0pgjh29omCg863lG41tRP4RfTkzTWtBloXD5aRmKL RS/GhjdWCj9vraKxXW1CWGtpF+FbphExHjrbSOOiNpMYd306T2HtZRu9yV9h0F2kFcPWB7Ri tKRHpLhz/Yzi0l0dUtgNC+Ppvb5RKXxG+gleGb4hyTdtonCcPPZ650mj00rko+GYYuTDALsa bNOFdDHyZaRsI4LPWptIGBwIbrQ99A52BHbrpOivpfdKFSEsGhCYS97/s7x9+MijotkIUHdf Qm4cwMbAufEa0i0i2AsEGFvKCfdiLrsb9I6BmXSGIdkQuGef46YlbCR8sTxGQtoiuKnv8Mh9 2CgYsBeIBY0/9F4dI92YmNEU3Kv0NALWJQZ95TgpmGOgsaufEvBc+NBzVyzg+WC+XEoKhgIE pfeHxMJQhmC0p84bHQnD/d887Qg2FJpawwV6M3x/9ZRw08DOhpcT/kKJ2VBu1HhpCVw4JxXU wfBdp/G+nAxKxn57qylgTKcVlaHFFf+dU/HfORX/cusQoUOBfI4qM5VXrczic8NUXKYqJys1 7ODRTAOa+W3mXz2OFtT6I7kTsQyS+0k6jNcSpRR3QpWX2YmAIeQBkugn5gNSSQqXd4pXHk1U 5mTwqk4UxJDyQMmqett+KZvKZfNHeP4Yr/y7FTE+snyUULEvtJoI2vMsQj3lbO6KdZb6h8Ws 27U76fRaZ37slo1xLYPqj7MOGX5z6u3q9o8uWUgQtXdK09cSP39Nqf117TJpfbLLcabaluDi 47pdSx5Pf27f+jPA/ANta5gXLdKErcltOlzZn7EgWDai/Rp8pzmhOOp4+o6U6CHqysj6I0Vy UpXGRSwllCruD1EGprppAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsVy+t/xe7oJLYviDQ6e1LG4P6+V0WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFm07j3CbnH4TTurxYzJL9kcBD02repk87hzbQ+bx/3u40wem5fUe/RtWcXo 8XmTXABblJ5NUX5pSapCRn5xia1StKGFkZ6hpYWekYmlnqGxeayVkamSvp1NSmpOZllqkb5d gl7G25anLAUPAyu2fbvG3MB4x6WLkZNDQsBE4uSUOcxdjFwcQgJLGSW+n9vM1MXIAZSQkpjf ogRRIyzx51oXG4gtJPCJUeLeLk8Qm03AUKL3aB8jiC0i4CFxqnUtK4jNLDCDWeL0LFMQW1gg VOLGqsVsICNZBFQltn7mBwnzClhLfDp/ghFivLzE6g0HmEFsTgEbiYufm9khVllLLH5+jgmi XlDi5MwnLCBjmAXUJdbPE4LYJC/RvHU28wRGwVlIqmYhVM1CUrWAkXkVo0hqaXFuem6xoV5x Ym5xaV66XnJ+7iZGYJxuO/Zz8w7GSxuDDzEKcDAq8fAe2LYwXog1say4MvcQowQHs5IIr9PZ 03FCvCmJlVWpRfnxRaU5qcWHGE2BPpvILCWanA9MIXkl8YamhuYWlobmxubGZhZK4rwdAgdj hATSE0tSs1NTC1KLYPqYODilGhizNpVXzBfTcaj5fSb6imm5vwN3cZz5W9YHH4L5Jmkv5DLI ulJ4jscv2HOb1KQOEd9J/X83eLaEz99xsd16acUtnvgA48ipsx6viFfNjtpsvSfP98Ob9Ej+ 7yefmNzZ/IJ1yvwpEd/O5u2qnD4lco09x4e0T823Tj791xvYa35rxYrlU3KvFtorsRRnJBpq MRcVJwIAb4JxA+kCAAA= X-CMS-MailID: 20201104103720eucas1p1014217e751a681796ed508af22c6bb12 X-Msg-Generator: CA X-RootMTR: 20201104103720eucas1p1014217e751a681796ed508af22c6bb12 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103720eucas1p1014217e751a681796ed508af22c6bb12 References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch adds a generic interconnect driver for Exynos SoCs in order to provide interconnect functionality for each "samsung,exynos-bus" compatible device. The SoC topology is a graph (or more specifically, a tree) and its edges are described by specifying in the 'interconnects' property the interconnect consumer path for each interconnect provider DT node. Each bus is now an interconnect provider and an interconnect node as well (cf. Documentation/interconnect/interconnect.rst), i.e. every bus registers itself as a node. Node IDs are not hard coded but rather assigned dynamically at runtime. This approach allows for using this driver with various Exynos SoCs. Frequencies requested via the interconnect API for a given node are propagated to devfreq using dev_pm_qos_update_request(). Please note that it is not an error when CONFIG_INTERCONNECT is 'n', in which case all interconnect API functions are no-op. The samsung,data-clk-ratio DT property is used to specify the ratio of the interconect bandwidth to the minimum data clock frequency for each bus. Due to unspecified relative probing order, -EPROBE_DEFER may be propagated to ensure that the parent is probed before its children. Signed-off-by: Artur Świgoń Signed-off-by: Sylwester Nawrocki --- Changes for v8: - renamed drivers/interconnect/exynos to drivers/interconnect/samsung, - added missing driver sync_state callback assignment. Changes for v7: - adjusted to the DT property changes: "interconnects" instead of "samsung,interconnect-parent", "samsung,data-clk-ratio" instead of "bus-width", - adaptation to of_icc_get_from_provider() function changes in v5.10-rc1. Changes for v6: - corrected of_node dereferencing in exynos_icc_get_parent() function, - corrected initialization of icc_node->name so as to avoid direct of_node->name dereferencing, - added parsing of bus-width DT property. Changes for v5: - adjust to renamed exynos,interconnect-parent-node property, - use automatically generated platform device id as the interconect node id instead of a now unavailable devfreq->id field, - add icc_ prefix to some variables to make the code more self-commenting, - use icc_nodes_remove() instead of icc_node_del() + icc_node_destroy(), - adjust to exynos,interconnect-parent-node property rename to samsung,interconnect-parent, - converted to a separate platform driver in drivers/interconnect. --- drivers/interconnect/Kconfig | 1 + drivers/interconnect/Makefile | 1 + drivers/interconnect/samsung/Kconfig | 13 +++ drivers/interconnect/samsung/Makefile | 4 + drivers/interconnect/samsung/exynos.c | 199 ++++++++++++++++++++++++++++++++++ 5 files changed, 218 insertions(+) create mode 100644 drivers/interconnect/samsung/Kconfig create mode 100644 drivers/interconnect/samsung/Makefile create mode 100644 drivers/interconnect/samsung/exynos.c diff --git a/drivers/interconnect/Kconfig b/drivers/interconnect/Kconfig index 5b7204e..d637a89 100644 --- a/drivers/interconnect/Kconfig +++ b/drivers/interconnect/Kconfig @@ -13,5 +13,6 @@ if INTERCONNECT source "drivers/interconnect/imx/Kconfig" source "drivers/interconnect/qcom/Kconfig" +source "drivers/interconnect/samsung/Kconfig" endif diff --git a/drivers/interconnect/Makefile b/drivers/interconnect/Makefile index d203520..c2f9e9d 100644 --- a/drivers/interconnect/Makefile +++ b/drivers/interconnect/Makefile @@ -6,3 +6,4 @@ icc-core-objs := core.o bulk.o obj-$(CONFIG_INTERCONNECT) += icc-core.o obj-$(CONFIG_INTERCONNECT_IMX) += imx/ obj-$(CONFIG_INTERCONNECT_QCOM) += qcom/ +obj-$(CONFIG_INTERCONNECT_SAMSUNG) += samsung/ \ No newline at end of file diff --git a/drivers/interconnect/samsung/Kconfig b/drivers/interconnect/samsung/Kconfig new file mode 100644 index 0000000..508ed64 --- /dev/null +++ b/drivers/interconnect/samsung/Kconfig @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-only +config INTERCONNECT_SAMSUNG + bool "Samsung interconnect drivers" + depends on ARCH_EXYNOS || COMPILE_TEST + help + Interconnect drivers for Samsung SoCs. + + +config INTERCONNECT_EXYNOS + tristate "Exynos generic interconnect driver" + depends on INTERCONNECT_SAMSUNG + help + Generic interconnect driver for Exynos SoCs. diff --git a/drivers/interconnect/samsung/Makefile b/drivers/interconnect/samsung/Makefile new file mode 100644 index 0000000..e19d1df --- /dev/null +++ b/drivers/interconnect/samsung/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 +exynos-interconnect-objs := exynos.o + +obj-$(CONFIG_INTERCONNECT_EXYNOS) += exynos-interconnect.o diff --git a/drivers/interconnect/samsung/exynos.c b/drivers/interconnect/samsung/exynos.c new file mode 100644 index 0000000..6559d8c --- /dev/null +++ b/drivers/interconnect/samsung/exynos.c @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Exynos generic interconnect provider driver + * + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Authors: Artur Świgoń + * Sylwester Nawrocki + */ +#include +#include +#include +#include +#include +#include +#include + +#define EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO 8 + +struct exynos_icc_priv { + struct device *dev; + + /* One interconnect node per provider */ + struct icc_provider provider; + struct icc_node *node; + + struct dev_pm_qos_request qos_req; + u32 bus_clk_ratio; +}; + +static struct icc_node *exynos_icc_get_parent(struct device_node *np) +{ + struct of_phandle_args args; + struct icc_node_data *icc_node_data; + struct icc_node *icc_node; + int num, ret; + + num = of_count_phandle_with_args(np, "interconnects", + "#interconnect-cells"); + if (num < 1) + return NULL; /* parent nodes are optional */ + + /* Get the interconnect target node */ + ret = of_parse_phandle_with_args(np, "interconnects", + "#interconnect-cells", 0, &args); + if (ret < 0) + return ERR_PTR(ret); + + icc_node_data = of_icc_get_from_provider(&args); + of_node_put(args.np); + + if (IS_ERR(icc_node_data)) + return ERR_CAST(icc_node_data); + + icc_node = icc_node_data->node; + kfree(icc_node_data); + + return icc_node; +} + +static int exynos_generic_icc_set(struct icc_node *src, struct icc_node *dst) +{ + struct exynos_icc_priv *src_priv = src->data, *dst_priv = dst->data; + s32 src_freq = max(src->avg_bw, src->peak_bw) / src_priv->bus_clk_ratio; + s32 dst_freq = max(dst->avg_bw, dst->peak_bw) / dst_priv->bus_clk_ratio; + int ret; + + ret = dev_pm_qos_update_request(&src_priv->qos_req, src_freq); + if (ret < 0) { + dev_err(src_priv->dev, "failed to update PM QoS of %s (src)\n", + src->name); + return ret; + } + + ret = dev_pm_qos_update_request(&dst_priv->qos_req, dst_freq); + if (ret < 0) { + dev_err(dst_priv->dev, "failed to update PM QoS of %s (dst)\n", + dst->name); + return ret; + } + + return 0; +} + +static struct icc_node *exynos_generic_icc_xlate(struct of_phandle_args *spec, + void *data) +{ + struct exynos_icc_priv *priv = data; + + if (spec->np != priv->dev->parent->of_node) + return ERR_PTR(-EINVAL); + + return priv->node; +} + +static int exynos_generic_icc_remove(struct platform_device *pdev) +{ + struct exynos_icc_priv *priv = platform_get_drvdata(pdev); + struct icc_node *parent_node, *node = priv->node; + + parent_node = exynos_icc_get_parent(priv->dev->parent->of_node); + if (parent_node && !IS_ERR(parent_node)) + icc_link_destroy(node, parent_node); + + icc_nodes_remove(&priv->provider); + icc_provider_del(&priv->provider); + + return 0; +} + +static int exynos_generic_icc_probe(struct platform_device *pdev) +{ + struct device *bus_dev = pdev->dev.parent; + struct exynos_icc_priv *priv; + struct icc_provider *provider; + struct icc_node *icc_node, *icc_parent_node; + int ret; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->dev = &pdev->dev; + platform_set_drvdata(pdev, priv); + + provider = &priv->provider; + + provider->set = exynos_generic_icc_set; + provider->aggregate = icc_std_aggregate; + provider->xlate = exynos_generic_icc_xlate; + provider->dev = bus_dev; + provider->inter_set = true; + provider->data = priv; + + ret = icc_provider_add(provider); + if (ret < 0) + return ret; + + icc_node = icc_node_create(pdev->id); + if (IS_ERR(icc_node)) { + ret = PTR_ERR(icc_node); + goto err_prov_del; + } + + priv->node = icc_node; + icc_node->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOFn", + bus_dev->of_node); + if (of_property_read_u32(bus_dev->of_node, "samsung,data-clock-ratio", + &priv->bus_clk_ratio)) + priv->bus_clk_ratio = EXYNOS_ICC_DEFAULT_BUS_CLK_RATIO; + + /* + * Register a PM QoS request for the parent (devfreq) device. + */ + ret = dev_pm_qos_add_request(bus_dev, &priv->qos_req, + DEV_PM_QOS_MIN_FREQUENCY, 0); + if (ret < 0) + goto err_node_del; + + icc_node->data = priv; + icc_node_add(icc_node, provider); + + icc_parent_node = exynos_icc_get_parent(bus_dev->of_node); + if (IS_ERR(icc_parent_node)) { + ret = PTR_ERR(icc_parent_node); + goto err_pmqos_del; + } + if (icc_parent_node) { + ret = icc_link_create(icc_node, icc_parent_node->id); + if (ret < 0) + goto err_pmqos_del; + } + + return 0; + +err_pmqos_del: + dev_pm_qos_remove_request(&priv->qos_req); +err_node_del: + icc_nodes_remove(provider); +err_prov_del: + icc_provider_del(provider); + return ret; +} + +static struct platform_driver exynos_generic_icc_driver = { + .driver = { + .name = "exynos-generic-icc", + .sync_state = icc_sync_state, + }, + .probe = exynos_generic_icc_probe, + .remove = exynos_generic_icc_remove, +}; +module_platform_driver(exynos_generic_icc_driver); + +MODULE_DESCRIPTION("Exynos generic interconnect driver"); +MODULE_AUTHOR("Artur Świgoń "); +MODULE_AUTHOR("Sylwester Nawrocki "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:exynos-generic-icc"); From patchwork Wed Nov 4 10:36:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 315214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F406C2D0A3 for ; Wed, 4 Nov 2020 10:37:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C848D20786 for ; Wed, 4 Nov 2020 10:37:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="jbvoaNOR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729471AbgKDKhg (ORCPT ); Wed, 4 Nov 2020 05:37:36 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47649 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729460AbgKDKhf (ORCPT ); Wed, 4 Nov 2020 05:37:35 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103723euoutp02015c6c36afae80d17c82e52e76adc9fc~ER7zIc1eV2967329673euoutp02T for ; Wed, 4 Nov 2020 10:37:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201104103723euoutp02015c6c36afae80d17c82e52e76adc9fc~ER7zIc1eV2967329673euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486243; bh=JVDzwKYDWs8UfRwIGBYBtNMVEUPNKijXopbFsSAO7ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jbvoaNOR1qfCiIIsDqrYgq5IRGtqNAtssqgABlAH9rD387MSsrlD51UGFAzZPspBt 26h6SEZ5z+k3sQpVwt8kuUMfHHQ87HXls9+FhamsR0oZOdeuEXLp00YB6lCgKOQWER r4qmsMB4/Mr+TYTzv6BMekguxiokoup442nUop/E= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201104103722eucas1p19f219189819cdd57aa91ceb9a3e65b85~ER7yqrybB1564115641eucas1p1v; Wed, 4 Nov 2020 10:37:22 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BB.8F.05997.26482AF5; Wed, 4 Nov 2020 10:37:22 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201104103722eucas1p1db939995e60d0bf2cd581070c14379f5~ER7ybbYM92474024740eucas1p1Q; Wed, 4 Nov 2020 10:37:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103722eusmtrp157280ff025fb2b2439ad5375e1ea529c~ER7yanSCp0613806138eusmtrp1U; Wed, 4 Nov 2020 10:37:22 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-7d-5fa284627140 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C2.64.06017.26482AF5; Wed, 4 Nov 2020 10:37:22 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103721eusmtip26ce723cdd0acee79fb5b9f40f4703844~ER7xszX011402114021eusmtip2H; Wed, 4 Nov 2020 10:37:21 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 3/7] MAINTAINERS: Add entry for Samsung interconnect drivers Date: Wed, 4 Nov 2020 11:36:53 +0100 Message-Id: <20201104103657.18007-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUhTYRTHe3ZfXU2uy+qkUTQyKt+yTJ7SLEPofpICIRDKZl40nFa7alZC mu9Th+gHTctUCm1i2rIVmiU2nSW5orAia5SGGoXaFEojc7uT/PY/5/x/nP95eFhC+YbyYk+n pAraFLVGRctJU99vq39cbkPszi+1e7CtNg/hu1WtFH47M0bhG+ZBCr+ZnaRxZZeRxuW2MhJb rW0MNo4MUfh1xzUa20vNCFdZH8twi/kjgz9kN9E4r8vM4KffCyhcVTFBH/TgjYYimh8eekTz tmKLjL938zKvbzcg3m7ceISOkYfFC5rT6YI2MPykPLFEx5/9SWeM28yyLPSd0iE3FrhgWOib JnVIziq5JgTvR17SUjGDoL83H0mFHcHw5Bi5hFhaql1II4L6zwbCMXAis81JDk1zQVDaq0cO 7clFQv7XWidAcIUEmB6WO4HV3FEw9d1zBiE5H5gruMI4tIILBd18oyvgJmhu63b63bgweGXP cXk84NnVUWciYtGTc7+GcCwAbpaB56ZGRoIj4f3EXZdeDd8s7S69AQYqSkgJyEFQ0vmBkYoy BDZLHZJcoTA8OLf4HOziiu3Q2hEotSPgevdt0tEGzh3e/fCQQrhDuamSkNoKKMxXSu4tMG+o lEnaC4pHF1wkD4W1mjK0uXrZNdXLrqn+v7YOEQa0TkgTkxMEcVeKcD5AVCeLaSkJAafOJBvR 4l8b+GuZeYg6/sT1II5FqlWKblN9rJJSp4sXknsQsITKU3HoxcAJpSJefeGioD0Tq03TCGIP 8mZJ1TrF7oaJ40ouQZ0qJAnCWUG7NJWxbl5ZKLAtM7rmVlTI0PBhPeRuPWb/RH5dU+j/JKQg qtU7iNnvk9G+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86Ei9/TYmlOCPRUIu5 qDgRACyFl5fqAgAA X-CMS-MailID: 20201104103722eucas1p1db939995e60d0bf2cd581070c14379f5 X-Msg-Generator: CA X-RootMTR: 20201104103722eucas1p1db939995e60d0bf2cd581070c14379f5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103722eucas1p1db939995e60d0bf2cd581070c14379f5 References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add maintainers entry for the Samsung interconnect drivers, this currently includes Exynos SoC generic interconnect driver. Signed-off-by: Sylwester Nawrocki Reviewed-by: Chanwoo Choi --- Changes since v7: - new patch. --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e73636b..4bbafef 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9156,6 +9156,13 @@ F: include/dt-bindings/interconnect/ F: include/linux/interconnect-provider.h F: include/linux/interconnect.h +SAMSUNG INTERCONNECT DRIVERS +M: Sylwester Nawrocki +M: Artur Swigoń +L: linux-pm@vger.kernel.org +S: Supported +F: drivers/interconnect/samsung + INVENSENSE ICM-426xx IMU DRIVER M: Jean-Baptiste Maneyrol L: linux-iio@vger.kernel.org From patchwork Wed Nov 4 10:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 318284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6A68C388F7 for ; Wed, 4 Nov 2020 10:38:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58CC8223AB for ; Wed, 4 Nov 2020 10:38:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XSVTnpXv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729589AbgKDKiL (ORCPT ); Wed, 4 Nov 2020 05:38:11 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47744 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729593AbgKDKhq (ORCPT ); Wed, 4 Nov 2020 05:37:46 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103727euoutp02b8ad885a9649d5dfac21ef52b0ed053e~ER72iwR1X2851928519euoutp02V for ; Wed, 4 Nov 2020 10:37:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201104103727euoutp02b8ad885a9649d5dfac21ef52b0ed053e~ER72iwR1X2851928519euoutp02V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486247; bh=2a12Ishl6dROfsBuQFSa17sVXwF7PkvSSX4ixHc5NZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSVTnpXvVIMSvFgZmeqCF/B8VONTwLh4V0JaoQ83jNaWuoWkgKLGvmKLjIZNw+zaP LpNEe12z6OrBMc/olBConvkASSu8cfnBU2abKajKZ3ehTA4k5DKPC3nNoWj2TFbaF2 pRyitlNeI03e1ec1U+/quXbGGJiDbfdJ4AESRv8Y= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201104103726eucas1p2cd33ec5d3a164cc9c09a166fb136006b~ER72MDlCo1144911449eucas1p2q; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A7.8F.06456.66482AF5; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d~ER71udMfb1145811458eucas1p2n; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103726eusmtrp1e530e1fe73ff14deca6c32d24728480c~ER71tjWgu0613806138eusmtrp1Z; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-15-5fa28466ef04 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0F.75.06314.46482AF5; Wed, 4 Nov 2020 10:37:24 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103724eusmtip2a27f0801494ca72c6885d4086cb9b9bc~ER7z97sjL1005710057eusmtip28; Wed, 4 Nov 2020 10:37:24 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 4/7] PM / devfreq: exynos-bus: Add registration of interconnect child device Date: Wed, 4 Nov 2020 11:36:54 +0100 Message-Id: <20201104103657.18007-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSfSzUcRzH973fw/2Ys59j8x2irtTUkB7mO25NTXV/NLX1RxuiKz8P447d D8XaKM+PJ1ouM+dpo7PCxWXEjMu1CUOoKMpzpZpjU1rl56f67/39fF7vz+e9z74UJm4kHKgo ZTyjUspjJKQlbuj7PuQenl4denglcz+arsgAqFnTSKCJtUUCaY2DBHq5/pVEpZ16EhVPF+Fo aKhJiPSz4wQabS8nkbnACJBmqEuAHhrfCtHkrXoSZXQahaj3cxaBNCXLpJ+NTK/LIWVT409J 2XSeSSB7XJsiK2zRAZlZ73yBDLSUhjExUYmMyvPEFcvItPefiLh2mxsb6gksFdRa5wILCtLH YM3SnCAXWFJiuh7AhZlVkn+sAXg/XQM4SkybAdTNXcwF1LZjuOksz9QBuKw2Yv8MrTXfSM5A 0l6w4FnhttmO9oeZ8xU4B2F0NgYNbcUY17Cl5TBtbAXnNE67wq43r4XcBhHtC1tzbvLxXGBD U/c2bkFL4bA5TcjNgXSPEPZO9uJ8In9Y3kfyvC38aGoR8toJ9pfk4zyfBmB+x+SOuQjAaVMl 4ClfODX4g+QGYbQbbGz35MsnYcvoXYyfbw1frdhwZWxLFhtKd8oimJ0p5ul9cFNXKuC1A8yb +72TTAZ/Nvvw51ED+KRBTRQBl7L/uyoB0AF7JoFVRDCsl5K57sHKFWyCMsLjWqxCD7a+Uf8v 02obWB+52gNoCkisRN2GqlAxIU9kkxQ9AFKYxE50aqA/RCwKkyclM6rYUFVCDMP2AEcKl9iL jlYvXxb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p60q3wu6WHcpsRRnJBpqMRcVJwIAyEniaKMCAAA= X-CMS-MailID: 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d X-Msg-Generator: CA X-RootMTR: 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch adds registration of a child platform device for the exynos interconnect driver. It is assumed that the interconnect provider will only be needed when #interconnect-cells property is present in the bus DT node, hence the child device will be created only when such a property is present. Acked-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki --- Changes for v8, v7, v6: - none. Changes for v5: - new patch. --- drivers/devfreq/exynos-bus.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 1e684a4..ee300ee 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -24,6 +24,7 @@ struct exynos_bus { struct device *dev; + struct platform_device *icc_pdev; struct devfreq *devfreq; struct devfreq_event_dev **edev; @@ -156,6 +157,8 @@ static void exynos_bus_exit(struct device *dev) if (ret < 0) dev_warn(dev, "failed to disable the devfreq-event devices\n"); + platform_device_unregister(bus->icc_pdev); + dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); if (bus->opp_table) { @@ -168,6 +171,8 @@ static void exynos_bus_passive_exit(struct device *dev) { struct exynos_bus *bus = dev_get_drvdata(dev); + platform_device_unregister(bus->icc_pdev); + dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); } @@ -432,6 +437,18 @@ static int exynos_bus_probe(struct platform_device *pdev) if (ret < 0) goto err; + /* Create child platform device for the interconnect provider */ + if (of_get_property(dev->of_node, "#interconnect-cells", NULL)) { + bus->icc_pdev = platform_device_register_data( + dev, "exynos-generic-icc", + PLATFORM_DEVID_AUTO, NULL, 0); + + if (IS_ERR(bus->icc_pdev)) { + ret = PTR_ERR(bus->icc_pdev); + goto err; + } + } + max_state = bus->devfreq->profile->max_state; min_freq = (bus->devfreq->profile->freq_table[0] / 1000); max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000); From patchwork Wed Nov 4 10:36:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 315212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D893C2D0A3 for ; Wed, 4 Nov 2020 10:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 085312242A for ; Wed, 4 Nov 2020 10:38:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="phylOyLT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729621AbgKDKiL (ORCPT ); Wed, 4 Nov 2020 05:38:11 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47674 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729589AbgKDKhq (ORCPT ); Wed, 4 Nov 2020 05:37:46 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103732euoutp01fb74a52ed487bfb34404602914dc06ca~ER77s8l7w0749307493euoutp01V for ; Wed, 4 Nov 2020 10:37:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201104103732euoutp01fb74a52ed487bfb34404602914dc06ca~ER77s8l7w0749307493euoutp01V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486252; bh=/FRHhipH0++LZ7DwDFHNxX1ifPoUb6bj7wyOz1N82q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phylOyLTVRGfOX96jMkRmRoUfQ6BUntV3IrHJfrgjx77DnUXaL9lCtBNG+sxqve0k M29fE+AHBbzZRRiCmFLcNsx+zqoovfpR0rVmxlGfJ4dwqwaxmqDQQWQ2lY4WyNZhQ5 JSgQLQb2Jl9zf3gTnaslrIHI9JBqUOPjBELXokJU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201104103727eucas1p1419756f7d67f72df4b1596005e515ba6~ER72xAL3m2673626736eucas1p11; Wed, 4 Nov 2020 10:37:27 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 4A.8F.06456.76482AF5; Wed, 4 Nov 2020 10:37:27 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201104103726eucas1p248b51b25f5ee42898bf03e9cb2229c5d~ER72YMUwJ1141511415eucas1p2m; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103726eusmtrp15b3c784d0eb581c0cc5c77f1693c7036~ER72XcegN0620706207eusmtrp1C; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-1c-5fa28467056e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 67.64.06017.66482AF5; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103726eusmtip2cbd0e037625fc6dd810c4dccea497dee~ER71orAeJ1010110101eusmtip2k; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 5/7] ARM: dts: exynos: Add interconnect properties to Exynos4412 bus nodes Date: Wed, 4 Nov 2020 11:36:55 +0100 Message-Id: <20201104103657.18007-6-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0hTYRjmO7cdpSPHdXuxSBoFJZVKBR8k5Q0ZUhj96EdWa9VhWZvGjmYa ZLE00xTRUDM1KytbpDbXkJUybF7KG1prmdWE7F5aeQEzZs6j5b/nfZ/n+d7ngY8l5Q7aj42L TxT08WqtgvGmLC0TXes1566rgmqzOOwqT0f4fnENjZ2jH2l81d5F4+djwwwuajAxON+VR+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5pSapCRn5xia1StKGFkZ6hpYWekYmlnqGxeayVkamSvp1NSmpOZllqkb5d gl7G2avrWAu2CFRMvtrH2MA4n7eLkZNDQsBE4veHlexdjFwcQgJLGSV2nX0K5HAAJaQk5rco QdQIS/y51sUGUfOJUeLH2YdsIAk2AUOJ3qN9jCC2iICHxKnWtawgNrPADGaJ07NMQeYIC8RK 7NzGBxJmEVCVWL5lNytImFfAWmJOcxbEeHmJ1RsOMIPYnAI2Ehc/N7OD2EJAJYufn2MCsXkF BCVOznzCAtLKLKAusX6eEMQieYnmrbOZJzAKzkJSNQuhahaSqgWMzKsYRVJLi3PTc4uN9IoT c4tL89L1kvNzNzEC43TbsZ9bdjB2vQs+xCjAwajEw3tg28J4IdbEsuLK3EOMEhzMSiK8TmdP xwnxpiRWVqUW5ccXleakFh9iNAX6bCKzlGhyPjCF5JXEG5oamltYGpobmxubWSiJ83YIHIwR EkhPLEnNTk0tSC2C6WPi4JRqYFzukXgt4eepbzcY9A75r+7WMqzYsjvwgKJK7x7NF7/M78o9 MWtZ5PrHKNN+lqlT/sTdgW0Rd4oyz6p+//g2oMtQYQKn7NrI0g1K1bPn7lvVxVO4W2gG/xUH jodvfLp/1y3cqX5T4l1HfuqK5knHuvwiv1zkq3q+72ZK6OJFngvm/ecRqfbQUFNiKc5INNRi LipOBADta0Q06QIAAA== X-CMS-MailID: 20201104103726eucas1p248b51b25f5ee42898bf03e9cb2229c5d X-Msg-Generator: CA X-RootMTR: 20201104103726eucas1p248b51b25f5ee42898bf03e9cb2229c5d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103726eucas1p248b51b25f5ee42898bf03e9cb2229c5d References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch adds the following properties for Exynos4412 interconnect bus nodes: - interconnects: to declare connections between nodes in order to guarantee PM QoS requirements between nodes, - #interconnect-cells: required by the interconnect framework, - samsung,data-clk-ratio: which allows to specify minimum data clock frequency corresponding to requested bandwidth for each bus. Note that #interconnect-cells is always zero and node IDs are not hardcoded anywhere. Signed-off-by: Artur Świgoń Signed-off-by: Sylwester Nawrocki --- Changes for v8: - none. Changes for v7: - adjusted to the DT property changes: "interconnects" instead of "samsung,interconnect-parent", "samsung,data-clk-ratio" instead of "bus-width". Changes for v6: - added bus-width property in bus_dmc node. Changes for v5: - adjust to renamed exynos,interconnect-parent-node property, - add properties in common exynos4412.dtsi file rather than in Odroid specific odroid4412-odroid-common.dtsi. --- arch/arm/boot/dts/exynos4412.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index e76881d..4999e68 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -383,6 +383,8 @@ clocks = <&clock CLK_DIV_DMC>; clock-names = "bus"; operating-points-v2 = <&bus_dmc_opp_table>; + samsung,data-clock-ratio = <4>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -452,6 +454,8 @@ clocks = <&clock CLK_DIV_GDL>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; + interconnects = <&bus_dmc>; + #interconnect-cells = <0>; status = "disabled"; }; @@ -468,6 +472,8 @@ clocks = <&clock CLK_ACLK160>; clock-names = "bus"; operating-points-v2 = <&bus_display_opp_table>; + interconnects = <&bus_leftbus &bus_dmc>; + #interconnect-cells = <0>; status = "disabled"; }; From patchwork Wed Nov 4 10:36:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 318285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3199BC55179 for ; Wed, 4 Nov 2020 10:38:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF74A21734 for ; Wed, 4 Nov 2020 10:38:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="g9wfqEt6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729697AbgKDKiF (ORCPT ); Wed, 4 Nov 2020 05:38:05 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:47749 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729621AbgKDKhu (ORCPT ); Wed, 4 Nov 2020 05:37:50 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103737euoutp020e89d5abaa19caba0aa1bf8331699bfd~ER8AHzZXe2966229662euoutp02h for ; Wed, 4 Nov 2020 10:37:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201104103737euoutp020e89d5abaa19caba0aa1bf8331699bfd~ER8AHzZXe2966229662euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486257; bh=aZmZ/FoJqHoTLO4+zTXCxyBDyba175tSw0+4Qh3yg/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g9wfqEt6qAT+pKKEhnoQaVC+qaDumQUydWRotqO5H+f8wqF24AOjBqU/NQV1pRJ4h l2/0ADfWLoV3FFc2z+FHWnbBXRqsAwSqWxKDpDDK/PQnCAO4QRUWeWY0aE83DmaeI8 eU69BeMwhZll5vsXKUiOdFu5HCtYfDwpu9zie+d8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201104103728eucas1p12484f8ca9c1e09fafe1fa34a67a648ec~ER74QFEaW3078630786eucas1p1w; Wed, 4 Nov 2020 10:37:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6D.8F.06456.86482AF5; Wed, 4 Nov 2020 10:37:28 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201104103728eucas1p2f671f29ed9eb06d4c6c991b073be092e~ER731CdZL1145311453eucas1p2u; Wed, 4 Nov 2020 10:37:28 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103728eusmtrp1354338b1fa5706d47c202e785aaad583~ER73z6Xdg0620706207eusmtrp1E; Wed, 4 Nov 2020 10:37:28 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-24-5fa284683a0e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B2.85.06314.86482AF5; Wed, 4 Nov 2020 10:37:28 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103727eusmtip2586e9f806ee1ec4683732c23bd18e85b~ER73BceSb0884408844eusmtip2P; Wed, 4 Nov 2020 10:37:27 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 6/7] ARM: dts: exynos: Add interconnects to Exynos4412 mixer Date: Wed, 4 Nov 2020 11:36:56 +0100 Message-Id: <20201104103657.18007-7-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SWUwTURSGvZ3pdCAWh4LhgkZigw+YsCmaGzYRiam8iAlPGIQKEyCypcMi PCCERSxLEAwgGEA0EaoEaKFBFsPSWkiBBkGQgBYDxKAgaCFsAaQdVN7+c+53/3P+m0tigo9c OzI6LpGWxIljhIQ5rny/pXOKyq4LdZ0bdUX66hyAWiqauGhy7RsX1ahGuGh8fYVA5d1yApXo i3Gk0zXzkHxugovGOp4RyFCoAqhC946DGlWfeWg6s55AOd0qHupfeshFFaWLhK+lSC57RIhm JroIkT5fwxEpXj4QFbXKgMggPxNIBJt7RdAx0cm0xMUnzDzq8bKSSBgi79fsbBEZoIonBWYk pNxhe4MMSIE5KaDqARzWKzhssQageiofZwsDgNrcEkwKSNOVUYM3238FoGFogPh3o6FFihl9 CcoNFqqLgFFbU/4wd6Ha5IRReRhUtpeYICvqFqxtmcKNGqfOwco3YybNpzzh9Owyzi5oD183 95h4M8rrYHIWj2Us4eDTeRODHTBZbVWYcQCkfvHg29lmHruqP1SPnGR9rOB3Teth6NNQW1qA s3wWgAWd0zy2KAZQr6kFLOUJZ0a2CaMRRjnCpg4Xtn0Vdg9WHz6FBfy0bMnuYAFLlOWHbT7M yxWwtAPckZVzWG0H8+f3D2OJoK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Dc2NzY3NLJTEeTsEDsYICaQn lqRmp6YWpBbB9DFxcEo1MEpcEXBSeKP9YMniaPVeu5Wvzjx96Lw6xPHpeWst/5t+qm5fpHyv rXrDLXq4a5fKorQ5rS7vPrVluRubd7AUlc87cTfSS2qe8e6aOMYtKbJBDepb+Zv7llSnZcpw RXWsjdyfdk9JderGdzu9H6/0iL3vrna1NEaKzWtBMn/wAtPYON8Srj9TlViKMxINtZiLihMB UkZdHOkCAAA= X-CMS-MailID: 20201104103728eucas1p2f671f29ed9eb06d4c6c991b073be092e X-Msg-Generator: CA X-RootMTR: 20201104103728eucas1p2f671f29ed9eb06d4c6c991b073be092e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103728eucas1p2f671f29ed9eb06d4c6c991b073be092e References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Artur Świgoń This patch adds an 'interconnects' property to Exynos4412 DTS in order to declare the interconnect path used by the mixer. Please note that the 'interconnect-names' property is not needed when there is only one path in 'interconnects', in which case calling of_icc_get() with a NULL name simply returns the right path. Reviewed-by: Chanwoo Choi Signed-off-by: Artur Świgoń Signed-off-by: Sylwester Nawrocki --- Changes for v8...v5: - none. --- arch/arm/boot/dts/exynos4412.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index 4999e68..d07739e 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -779,6 +779,7 @@ clock-names = "mixer", "hdmi", "sclk_hdmi", "vp"; clocks = <&clock CLK_MIXER>, <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>, <&clock CLK_VP>; + interconnects = <&bus_display &bus_dmc>; }; &pmu { From patchwork Wed Nov 4 10:36:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\\(PLT\\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 315213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CD80C5517A for ; Wed, 4 Nov 2020 10:38:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD68B223BD for ; Wed, 4 Nov 2020 10:38:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="FnOlOz5w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729632AbgKDKhw (ORCPT ); Wed, 4 Nov 2020 05:37:52 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47698 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729608AbgKDKhs (ORCPT ); Wed, 4 Nov 2020 05:37:48 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103735euoutp019972b58ac1521c0fe7081ec77531498e~ER7_rIJuc0672206722euoutp011 for ; Wed, 4 Nov 2020 10:37:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201104103735euoutp019972b58ac1521c0fe7081ec77531498e~ER7_rIJuc0672206722euoutp011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486255; bh=L+nUe8U5E5ks5/FEagAgoRj80kpW/jqICao80QN6k0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FnOlOz5wvAIh5Kq29XqFesaT/v7WBYqPWnON4PRrnDwUgEsP/y1oiOxx+PWw3dNs8 jWkiIa+toM4LYYkhJPUx5ibT+4osaHYmPwSujaEBHMeLa8xgCQgyV4h++LjsJzb0T2 JuIiz1gVfRQvB6uMLY4oBS4EE8Rx0mPcGl5aY/rQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201104103730eucas1p1d04a432aab4d69de891146cde7c5e324~ER75uwSz91564115641eucas1p16; Wed, 4 Nov 2020 10:37:30 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id BA.0A.06318.A6482AF5; Wed, 4 Nov 2020 10:37:30 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201104103730eucas1p2964e5910a1319fc1c931db8f02a447de~ER75aGe1E1144911449eucas1p2v; Wed, 4 Nov 2020 10:37:30 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103730eusmtrp146cc5014ba082336862476c9514104a2~ER75ZTVyE0613806138eusmtrp1m; Wed, 4 Nov 2020 10:37:30 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-a4-5fa2846adf0d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 35.85.06314.A6482AF5; Wed, 4 Nov 2020 10:37:30 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103729eusmtip2cae8ed3d402fdf6b98a5eafd8e0f4d28~ER74sPJoW1361713617eusmtip2Z; Wed, 4 Nov 2020 10:37:29 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@samsung.com, inki.dae@samsung.com, sw0312.kim@samsung.com, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com Subject: [PATCH v8 7/7] drm: exynos: mixer: Add interconnect support Date: Wed, 4 Nov 2020 11:36:57 +0100 Message-Id: <20201104103657.18007-8-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCKsWRmVeSWpSXmKPExsWy7djPc7pZLYviDXYdlba4P6+V0WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFm07j3CbnH4TTurxYzJL9kcBD02repk87hzbQ+bx/3u40wem5fUe/RtWcXo 8XmTXABbFJdNSmpOZllqkb5dAlfGtJ6ZTAVN7hWPZrWwNDAetOxi5OCQEDCRmHwquYuRi0NI YAWjxJZZB9m6GDmBnC+MEtvXSkIkPjNKtO//yQSSAGl48LedDSKxnFHi3bmjzBAOUMe2x2/Y QarYBAwleo/2MYLYIgIuEm1P57GAFDELdDBLbNsxiRkkIQyU6J95HWwfi4CqxMKGC6wgNq+A tcSJmY/YIdbJS6zecACsnlPARuLi52Z2iBpBiZMzn7CA2MxANc1bZ4NdISHwk12i8/VfqFtd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YBSchaRqFkLVLCRVCxiZVzGKpJYW56bnFhvqFSfm Fpfmpesl5+duYgRG6rZjPzfvYLy0MfgQowAHoxIP74FtC+OFWBPLiitzDzFKcDArifA6nT0d J8SbklhZlVqUH19UmpNafIjRFOi1icxSosn5wCSSVxJvaGpobmFpaG5sbmxmoSTO2yFwMEZI ID2xJDU7NbUgtQimj4mDU6qBkV/vcGDugUWCcTJ7xS/EP3mjGe+wft3xI48Lv+w14nsu/fL/ 0+TfD7Z+2vN9wgElHZYVvftSb1+R49BP+qLaKDDjx+TJxT39ah8eRUhuuLw8Qb7355mqh9Pl Oebu+v1OqY3XrS5N6u9SoU3MhufX31N4k115dZHV6g0VJq6/db7qnj6Zv7nqVbMSS3FGoqEW c1FxIgCxxSkg6gIAAA== X-CMS-MailID: 20201104103730eucas1p2964e5910a1319fc1c931db8f02a447de X-Msg-Generator: CA X-RootMTR: 20201104103730eucas1p2964e5910a1319fc1c931db8f02a447de X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103730eucas1p2964e5910a1319fc1c931db8f02a447de References: <20201104103657.18007-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch adds interconnect support to exynos-mixer. The mixer works the same as before when CONFIG_INTERCONNECT is 'n'. For proper operation of the video mixer block we need to ensure the interconnect busses like DMC or LEFTBUS provide enough bandwidth so as to avoid DMA buffer underruns in the mixer block. I.e we need to prevent those busses from operating in low perfomance OPPs when the mixer is running. In this patch the bus bandwidth request is done through the interconnect API, the bandwidth value is calculated from selected DRM mode, i.e. video plane width, height, refresh rate and pixel format. The bandwidth setting is synchronized with VSYNC when we are switching to lower bandwidth. This is required to ensure enough bandwidth for the device since new settings are normally being applied in the hardware synchronously with VSYNC. Acked-by: Krzysztof Kozlowski Co-developed-by: Artur Świgoń Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki Reviewed-by: Chanwoo Choi --- Changes for v8: - updated comment in mixer_probe() Changes for v7: - fixed incorrect setting of the ICC bandwidth when the mixer is disabled, now the bandwidth is set explicitly to 0 in such case. Changes for v6: - the icc_set_bw() call is now only done when calculated value for a crtc changes, this avoids unnecessary calls per each video frame - added synchronization of the interconnect bandwidth setting with the mixer VSYNC in order to avoid buffer underflow when we lower the interconnect bandwidth when the hardware still operates with previous mode settings that require higher bandwidth. This fixed IOMMU faults observed e.g. during switching from two planes to a single plane operation. Changes for v5: - renamed soc_path variable to icc_path --- drivers/gpu/drm/exynos/exynos_mixer.c | 146 ++++++++++++++++++++++++++++++++-- 1 file changed, 138 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index af192e5..8c1509e 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,7 @@ enum mixer_flag_bits { MXR_BIT_INTERLACE, MXR_BIT_VP_ENABLED, MXR_BIT_HAS_SCLK, + MXR_BIT_REQUEST_BW, }; static const uint32_t mixer_formats[] = { @@ -99,6 +101,13 @@ struct mixer_context { struct exynos_drm_plane planes[MIXER_WIN_NR]; unsigned long flags; + struct icc_path *icc_path; + /* memory bandwidth on the interconnect bus in B/s */ + unsigned long icc_bandwidth; + /* mutex protecting @icc_bandwidth */ + struct mutex icc_lock; + struct work_struct work; + int irq; void __iomem *mixer_regs; void __iomem *vp_regs; @@ -754,6 +763,9 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) val |= MXR_INT_CLEAR_VSYNC; val &= ~MXR_INT_STATUS_VSYNC; + if (test_and_clear_bit(MXR_BIT_REQUEST_BW, &ctx->flags)) + schedule_work(&ctx->work); + /* interlace scan need to check shadow register */ if (test_bit(MXR_BIT_INTERLACE, &ctx->flags) && !mixer_is_synced(ctx)) @@ -934,6 +946,76 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc) mixer_reg_writemask(mixer_ctx, MXR_INT_EN, 0, MXR_INT_EN_VSYNC); } +/** + * mixer_get_memory_bandwidth - calculate memory bandwidth for current crtc mode + * @crtc: a crtc with DRM mode to calculate the bandwidth for + * + * Return: memory bandwidth in B/s + * + * This function returns memory bandwidth calculated as a sum of amount of data + * per second for each plane. The calculation is based on maximum possible pixel + * resolution for a plane so as to avoid different bandwidth request per each + * video frame. The formula used for calculation for each plane is: + * + * bw = width * height * frame_rate / interlace / (hor_subs * vert_subs) + * + * where: + * - width, height - (DRM mode) video frame width and height in pixels, + * - frame_rate - DRM mode frame refresh rate, + * - interlace: 1 - in case of progressive and 2 in case of interlaced video, + * - hor_subs, vert_subs - accordingly horizontal and vertical pixel + * subsampling for a plane. + */ +static unsigned int mixer_get_memory_bandwidth(struct exynos_drm_crtc *crtc) +{ + struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; + struct mixer_context *ctx = crtc->ctx; + unsigned long bw, bandwidth = 0; + int i, j, sub; + + for (i = 0; i < MIXER_WIN_NR; i++) { + struct drm_plane *plane = &ctx->planes[i].base; + const struct drm_format_info *format; + + if (plane->state && plane->state->crtc && plane->state->fb) { + format = plane->state->fb->format; + bw = mode->hdisplay * mode->vdisplay * + drm_mode_vrefresh(mode); + if (mode->flags & DRM_MODE_FLAG_INTERLACE) + bw /= 2; + for (j = 0; j < format->num_planes; j++) { + sub = j ? (format->vsub * format->hsub) : 1; + bandwidth += format->cpp[j] * bw / sub; + } + } + } + + return bandwidth; +} + +static void mixer_set_icc_bandwidth(struct mixer_context *ctx, + unsigned long bandwidth) +{ + u32 avg_bw, peak_bw; + + /* add 20% safety margin */ + bandwidth = bandwidth / 4 * 5; + + avg_bw = peak_bw = Bps_to_icc(bandwidth); + icc_set_bw(ctx->icc_path, avg_bw, peak_bw); + + dev_dbg(ctx->dev, "safe bandwidth %lu Bps\n", bandwidth); +} + +static void mixer_icc_request_fn(struct work_struct *work) +{ + struct mixer_context *ctx = container_of(work, struct mixer_context, + work); + mutex_lock(&ctx->icc_lock); + mixer_set_icc_bandwidth(ctx, ctx->icc_bandwidth); + mutex_unlock(&ctx->icc_lock); +} + static void mixer_atomic_begin(struct exynos_drm_crtc *crtc) { struct mixer_context *ctx = crtc->ctx; @@ -980,12 +1062,35 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) { - struct mixer_context *mixer_ctx = crtc->ctx; + struct mixer_context *ctx = crtc->ctx; + int bw, prev_bw; - if (!test_bit(MXR_BIT_POWERED, &mixer_ctx->flags)) + if (!test_bit(MXR_BIT_POWERED, &ctx->flags)) return; - mixer_enable_sync(mixer_ctx); + /* + * Request necessary bandwidth on the interconnects. If new + * bandwidth is greater than current value set the new value + * immediately. Otherwise request lower bandwidth only after + * VSYNC, after the HW has actually switched to new video + * frame settings. + */ + if (ctx->icc_path) { + bw = mixer_get_memory_bandwidth(crtc); + + mutex_lock(&ctx->icc_lock); + prev_bw = ctx->icc_bandwidth; + ctx->icc_bandwidth = bw; + + if (bw > prev_bw) + mixer_set_icc_bandwidth(ctx, bw); + else if (bw < prev_bw) + set_bit(MXR_BIT_REQUEST_BW, &ctx->flags); + + mutex_unlock(&ctx->icc_lock); + } + + mixer_enable_sync(ctx); exynos_crtc_handle_event(crtc); } @@ -1036,6 +1141,8 @@ static void mixer_atomic_disable(struct exynos_drm_crtc *crtc) pm_runtime_put(ctx->dev); + mixer_set_icc_bandwidth(ctx, 0); + clear_bit(MXR_BIT_POWERED, &ctx->flags); } @@ -1223,19 +1330,33 @@ static int mixer_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; const struct mixer_drv_data *drv; struct mixer_context *ctx; + struct icc_path *path; int ret; + /* + * Returns NULL if CONFIG_INTERCONNECT is disabled or if "interconnects" + * property does not exist. May return ERR_PTR(-EPROBE_DEFER). + */ + path = of_icc_get(dev, NULL); + if (IS_ERR(path)) + return PTR_ERR(path); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_DEV_ERROR(dev, "failed to alloc mixer context.\n"); - return -ENOMEM; + ret = -ENOMEM; + goto err; } drv = of_device_get_match_data(dev); + INIT_WORK(&ctx->work, mixer_icc_request_fn); + mutex_init(&ctx->icc_lock); + ctx->pdev = pdev; ctx->dev = dev; ctx->mxr_ver = drv->version; + ctx->icc_path = path; if (drv->is_vp_enabled) __set_bit(MXR_BIT_VP_ENABLED, &ctx->flags); @@ -1247,17 +1368,26 @@ static int mixer_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = component_add(&pdev->dev, &mixer_component_ops); - if (ret) + if (ret) { pm_runtime_disable(dev); - + goto err; + } + return 0; +err: + icc_put(path); return ret; } static int mixer_remove(struct platform_device *pdev) { - pm_runtime_disable(&pdev->dev); + struct device *dev = &pdev->dev; + struct mixer_context *ctx = dev_get_drvdata(dev); + + pm_runtime_disable(dev); + + component_del(dev, &mixer_component_ops); - component_del(&pdev->dev, &mixer_component_ops); + icc_put(ctx->icc_path); return 0; }