From patchwork Thu Nov 12 14:09:27 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: 11900319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA1B61391 for ; Thu, 12 Nov 2020 14:11:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFEB72224A for ; Thu, 12 Nov 2020 14:11:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="sXwappiZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727035AbgKLOLG (ORCPT ); Thu, 12 Nov 2020 09:11:06 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:54877 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728359AbgKLOLF (ORCPT ); Thu, 12 Nov 2020 09:11:05 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201112141054euoutp01ea47f1b3d1a3a2cc122eddc753b2bd1b~GyAgrDeu71525215252euoutp01N for ; Thu, 12 Nov 2020 14:10:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201112141054euoutp01ea47f1b3d1a3a2cc122eddc753b2bd1b~GyAgrDeu71525215252euoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605190254; bh=QORsv+NFm7ed8zna1XYeYDqutWdFBZ6zuTzS36JM28I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sXwappiZIdObB+0tJw7GycyCYj2nrexEyXWTWBOaaTlUBSQvvJj+NbXmFalmhXQNA RQvkjynfae/MKpdXwR99jQbJ/07GTbrnTvkLhHgsbdkLoS6QsOOJR4A1JH5C5xEcjP o85XtofwlnMGxSdud+8RBqRVJi0Olkx5IqnXLyUU= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201112141048eucas1p19ada42b97eee736e84fae8e08b56d4b4~GyAatp3Er1700317003eucas1p1i; Thu, 12 Nov 2020 14:10:48 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 07.B9.44805.8624DAF5; Thu, 12 Nov 2020 14:10:48 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201112141047eucas1p1f4294148c61b778bbb321863b8ef0092~GyAaSyM0f1700417004eucas1p1q; Thu, 12 Nov 2020 14:10:47 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201112141047eusmtrp13cc13660f9f3050649c3f0194f0ba211~GyAaR8rHV1178311783eusmtrp1y; Thu, 12 Nov 2020 14:10:47 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-56-5fad42684c45 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F5.11.21957.7624DAF5; Thu, 12 Nov 2020 14:10:47 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201112141046eusmtip24a2a8b36b6e1942d6e6c539ff5c5a9e8~GyAZcLzK-3179531795eusmtip2N; Thu, 12 Nov 2020 14:10:46 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com Cc: krzk@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@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 v9 1/5] dt-bindings: devfreq: Add documentation for the interconnect properties Date: Thu, 12 Nov 2020 15:09:27 +0100 Message-Id: <20201112140931.31139-2-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201112140931.31139-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBKsWRmVeSWpSXmKPExsWy7djPc7oZTmvjDW78Z7O4P6+V0WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFm07j3CbnH4TTurxYzJL9kcBD02repk87hzbQ+bx/3u40wem5fUe/RtWcXo 8XmTXABbFJdNSmpOZllqkb5dAlfG5D3nGQs2qFVsuXqQqYFxrnwXIyeHhICJxL7T+xi7GLk4 hARWMEr8br4I5XxhlDg+cTsLSJWQwGdGiYb/UjAdR65tZYcoWs4o0bW/nxmu4+y9w4wgVWwC hhK9R/uAbA4OEQFPiZMN+iA1zALNzBINzZvAaoQFEiWWrtvODGKzCKhKzH79BWwbr4C1xIQP 39khtslLrN5wAKyGU8BGYu7TVjaIGkGJkzOfgNUzA9U0b50NdoSEwHxOia7VH1kgml0krl7/ yQhhC0u8Or4FaqiMxOnJPSwQDc2MEj27b7NDOBMYJe4fXwDVYS1x59wvNpAXmAU0Jdbv0ocI O0p8efqaFSQsIcAnceOtIMQRfBKTtk1nhgjzSnS0CUFUq0j8XjWdCcKWkuh+8h/qNA+JbUff sE1gVJyF5J1ZSN6ZhbB3ASPzKk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sJFWzEKpmIalawMi8ilEktbQ4Nz232FCv ODG3uDQvXS85P3cTIzBatx37uXkH47xXH/UOMTJxMB5ilOBgVhLhVXZYEy/Em5JYWZValB9f VJqTWnyI0RTom4nMUqLJ+cB0kVcSb2hmYGpoYmZpYGppZqwkzrt1LlCTQHpiSWp2ampBahFM HxMHp1QDk0ZI9tSH3/S1qzfyalmdZ2Xda1vFN9fNq4yb+5zGnn3+N9WtOU+tEfnOKrLHZk/L 3MwPvAyNn2etup64bvHHjWyH+aem+Pa2bd66clZEyKR9/S7Ogs7s6qcfWi76bdRiobTmw4xE Z4cjszj+hD4XiL9ovnBC82annE1/ZO44z19pkiB+RUTpQ7CAq/i19EML7zCf9XXe5G3SsSXk 9F2jGZ55LZ6BDputW09f9bofP8lzygyHztzu+j9GazdZbQ28tO2PefWvqm6jujXfHs0tZ880 T5HjzNu09HvP5cOl3l2s60rlXObLVstmmzB92pix6sOFGf41uukObxeY3zmzv8FwUTynw4+5 MltOangEKLEUZyQaajEXFScCADTJNVZfAwAA X-CMS-MailID: 20201112141047eucas1p1f4294148c61b778bbb321863b8ef0092 X-Msg-Generator: CA X-RootMTR: 20201112141047eucas1p1f4294148c61b778bbb321863b8ef0092 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201112141047eucas1p1f4294148c61b778bbb321863b8ef0092 References: <20201112140931.31139-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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. Acked-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Tested-by: Chanwoo Choi Acked-by: Rob Herring Signed-off-by: Artur Świgoń Signed-off-by: Sylwester Nawrocki --- Changes for v9: - added Ack tags 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 Thu Nov 12 14:09:28 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: 11900325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9878B1391 for ; Thu, 12 Nov 2020 14:11:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DA9D2224B for ; Thu, 12 Nov 2020 14:11:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="kR+AKuBR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728448AbgKLOLU (ORCPT ); Thu, 12 Nov 2020 09:11:20 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60590 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728462AbgKLOLS (ORCPT ); Thu, 12 Nov 2020 09:11:18 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201112141104euoutp022939e76a8ec09956f6c96d86951555b5~GyApzJoN41503315033euoutp02D for ; Thu, 12 Nov 2020 14:11:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201112141104euoutp022939e76a8ec09956f6c96d86951555b5~GyApzJoN41503315033euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605190264; bh=8FAfU6BCkgvgjJdMmzUzX4KRpyPprgS4czs4hFuFKFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kR+AKuBRvjAA2OjtddsqMbOQ6XNWQwAYPjsrvJEO4tbZzw/bsOPFnliRG7puh8Bxs li5DTh2LHb8UfcacXzUuyse5XF2rtp6+JoVATaH5ay5vyqhh/qArDCod6fGYmtpnZp 3X4pMIFJYdQeGSZNGn5ZmJX21EWNYG9UZnvpHZu8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201112141050eucas1p1d1e59396140fd85dd242a396a05c7601~GyAdJRPjk2413224132eucas1p1s; Thu, 12 Nov 2020 14:10:50 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id AA.B9.44805.A624DAF5; Thu, 12 Nov 2020 14:10:50 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201112141050eucas1p250f62d09adf38b97c521ef67b4b540f0~GyAcf3gsG0207802078eucas1p2u; Thu, 12 Nov 2020 14:10:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201112141050eusmtrp2d0b31be7d84f9c38df7f625982557052~GyAceJ01R1054310543eusmtrp2X; Thu, 12 Nov 2020 14:10:50 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-60-5fad426a7beb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 06.0F.16282.9624DAF5; Thu, 12 Nov 2020 14:10:49 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201112141049eusmtip2a60c36a4c3acd15056f7ea83e788a079~GyAbtIaiE3001030010eusmtip28; Thu, 12 Nov 2020 14:10:49 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com Cc: krzk@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@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 v9 2/5] interconnect: Add generic interconnect driver for Exynos SoCs Date: Thu, 12 Nov 2020 15:09:28 +0100 Message-Id: <20201112140931.31139-3-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201112140931.31139-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBKsWRmVe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By7ZWavPKfeiPe8so3116OZ88T7TKZ3S1dF hi0R3sbxwPDqEhul4qkfgndbPO5bzSWwbu/vLZ3ZnfX1GTW3kwM5wkLFLid7zL+rxzhRoPxm 9nKpFJt0JZbijERDLeai4kQAd6HGqF4DAAA= X-CMS-MailID: 20201112141050eucas1p250f62d09adf38b97c521ef67b4b540f0 X-Msg-Generator: CA X-RootMTR: 20201112141050eucas1p250f62d09adf38b97c521ef67b4b540f0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201112141050eucas1p250f62d09adf38b97c521ef67b4b540f0 References: <20201112140931.31139-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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. Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Acked-by: Krzysztof Kozlowski Signed-off-by: Artur Świgoń Signed-off-by: Sylwester Nawrocki --- Changes for v9: - Makefile and Kconfig fixes/improvements. 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..97d393f 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/ diff --git a/drivers/interconnect/samsung/Kconfig b/drivers/interconnect/samsung/Kconfig new file mode 100644 index 0000000..6820e4f --- /dev/null +++ b/drivers/interconnect/samsung/Kconfig @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-only +config INTERCONNECT_SAMSUNG + bool "Samsung SoC 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 + default y if ARCH_EXYNOS + 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 Thu Nov 12 14:09:29 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: 11900323 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDD641391 for ; Thu, 12 Nov 2020 14:11:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AACB222248 for ; Thu, 12 Nov 2020 14:11:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="FO9oeXGf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728312AbgKLOLI (ORCPT ); Thu, 12 Nov 2020 09:11:08 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60486 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728393AbgKLOLH (ORCPT ); Thu, 12 Nov 2020 09:11:07 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201112141054euoutp02a7d07ee78a3dc209e2a61b91bf72e042~GyAgzJ6ls1498614986euoutp02B for ; Thu, 12 Nov 2020 14:10:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201112141054euoutp02a7d07ee78a3dc209e2a61b91bf72e042~GyAgzJ6ls1498614986euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605190254; bh=ifeX9jM6Nj9NQH/PbyRcohNnfKEnI/gwBb9dDyit1ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FO9oeXGfGiAMfPQyPuyMrX//oXYQWoU96528Yl1HoggygLbKI53c012GFt8A18RiE IyNuhQ6t7Qo9t+IRVQ9ywibdsoQJhEqpf9aBT1NcMUYqQOqBG8jspDBp6PpFA1S/Tk TuJp5IkowbZ6LtLfpV9RqDwSBtmafIR0s1ucmg8A= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201112141052eucas1p10fe743ce2efb797033cae19b408e54e1~GyAeXAzNH1698416984eucas1p1m; Thu, 12 Nov 2020 14:10:52 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FB.B9.44805.C624DAF5; Thu, 12 Nov 2020 14:10:52 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201112141051eucas1p1c94de8fd6032e0a9966cbff9e41c0f2f~GyAd89kSV1700417004eucas1p1s; Thu, 12 Nov 2020 14:10:51 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201112141051eusmtrp17e7746e109f8668bfadbd9d027e39dae~GyAd8QmPV1172011720eusmtrp1f; Thu, 12 Nov 2020 14:10:51 +0000 (GMT) X-AuditID: cbfec7f4-b37ff7000000af05-65-5fad426c473b Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 59.11.21957.B624DAF5; Thu, 12 Nov 2020 14:10:51 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201112141050eusmtip21d92e9213206af69f58b783917e1dc6f~GyAdKblpN3001030010eusmtip29; Thu, 12 Nov 2020 14:10:50 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com Cc: krzk@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@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 v9 3/5] MAINTAINERS: Add entry for Samsung interconnect drivers Date: Thu, 12 Nov 2020 15:09:29 +0100 Message-Id: <20201112140931.31139-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201112140931.31139-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJKsWRmVeSWpSXmKPExsWy7djP87o5TmvjDbramC3uz2tltNg4Yz2r xfUvz1kt5h85x2px5et7NovpezexWUy6P4HF4vz5DewWmx5fY7W4vGsOm8Xn3iOMFjPO72Oy WHvkLrvF7cYVbBate4+wWxx+085qMWPySzYHQY9NqzrZPO5c28Pmcb/7OJPH5iX1Hn1bVjF6 fN4kF8AWxWWTkpqTWZZapG+XwJUx7c5WpoJXHBVH/11kamDcwt7FyMkhIWAisfXIO6YuRi4O IYEVjBJNs78wQjhfGCXWrJzJDuF8ZpRYt/4vG0zLxws7WCESyxkltt9ZzA7X0tm2nhmkik3A UKL3aB/QLA4OEQFPiZMN+iA1zALNzBINzZsYQWqEBQIldv1/yApiswioSty/eokJxOYVsJbY decnK8Q2eYnVGw6AzeQUsJGY+7SVDaJGUOLkzCcsIDYzUE3z1tnMIAskBOZzSnS9+8gI0ewi ceLQRqizhSVeHYf5Wkbi9OQeFoiGZkaJnt232SGcCYwS948vgOq2lrhz7hcbyAvMApoS63fp Q4QdJd4tmccKEpYQ4JO48VYQ4gg+iUnbpjNDhHklOtqEIKpVJH6vms4EYUtJdD/5zwJhe0gs vbqVaQKj4iwk78xC8s4shL0LGJlXMYqnlhbnpqcWG+WllusVJ+YWl+al6yXn525iBKa20/+O f9nBuPzVR71DjEwcjIcYJTiYlUR4lR3WxAvxpiRWVqUW5ccXleakFh9ilOZgURLnTdoClBJI TyxJzU5NLUgtgskycXBKNTDVtfsGTn+1pavyYscug/4Q60YhWY6pPiKWH1yWPo6xaXsR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akFsH0 MXFwSjUwLQy4e+luFFu4zbsPz/d/NlhS6s5mX+1+T/X8H49Nsns+qVovczfvN1uXeoN5qok3 7/PmCtXsQ+9f+DYGzA7g03FOdA4sPnxrV85SO6ngyHeO1XqyE+dw/5DL4dO4ZXLZL6Vac3YO 36nZc3cHrSnfIP5tcorup1vHnDanC0hN6O1IdZ13LbGkJPn/1acKDzpe5K6cffjAzg1fSu8l ilycvmXvjcrG3c9Unz6YV3lc4U1/vNy8L5deu3NLTq9Zt3SJ29/Losbf1pvKML/U52/8I9e+ 53y5c/tyI4mmaHfPFfk3H7QyXcy+lLM9cPG3OzG7L8bYOK+ddUppfVRHUQTDNhaOmMUppre5 Q5teGzwKVGIpzkg01GIuKk4EACwfgtZfAwAA X-CMS-MailID: 20201112141051eucas1p1c94de8fd6032e0a9966cbff9e41c0f2f X-Msg-Generator: CA X-RootMTR: 20201112141051eucas1p1c94de8fd6032e0a9966cbff9e41c0f2f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201112141051eucas1p1c94de8fd6032e0a9966cbff9e41c0f2f References: <20201112140931.31139-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add maintainers entry for the Samsung SoC interconnect drivers, this currently includes the Exynos generic interconnect driver. Reviewed-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski --- Changes for v9: - add linux-samsung-soc ML, - fixed Artur's last name spelling, - whole entry moved to maintain alphabetical order, - added missing traling '/' to directory path. Changes since v7: - new patch. --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e73636b..1d8246c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15400,6 +15400,14 @@ L: linux-fbdev@vger.kernel.org S: Maintained F: drivers/video/fbdev/s3c-fb.c +SAMSUNG INTERCONNECT DRIVERS +M: Sylwester Nawrocki +M: Artur Świgoń +L: linux-pm@vger.kernel.org +L: linux-samsung-soc@vger.kernel.org +S: Supported +F: drivers/interconnect/samsung/ + SAMSUNG LAPTOP DRIVER M: Corentin Chary L: platform-driver-x86@vger.kernel.org From patchwork Thu Nov 12 14:09:30 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: 11900329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FFE715E6 for ; Thu, 12 Nov 2020 14:11:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 183B922256 for ; Thu, 12 Nov 2020 14:11:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="CVhjmb+0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728482AbgKLOLV (ORCPT ); Thu, 12 Nov 2020 09:11:21 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:54999 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728466AbgKLOLS (ORCPT ); Thu, 12 Nov 2020 09:11:18 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201112141104euoutp01ac590c903bdb44f0b49fc2f2fcf8f60a~GyAqB04d81525215252euoutp01c for ; Thu, 12 Nov 2020 14:11:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201112141104euoutp01ac590c903bdb44f0b49fc2f2fcf8f60a~GyAqB04d81525215252euoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605190264; bh=6lyGsyIQRnO1IuwTnq84kfoSzkYQ7Jyzkt3YSw6gXik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CVhjmb+0ARYjVz5a65PsAo1GY40Ljus93il00MBmcKxEUEQycNgUlnyK/HaYAiwLz zO9d60n8iRf+mcx0UrD9Dk9ChGOvvOQMaO7FsO1WHU8tsJnArjkD++RhWzZjnnJ3SF 4UMs74/XWZseEbuMVfR94rPuJNLhcfbAJTE9ONBQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201112141054eucas1p11b681db57da737607808876e69a9be7e~GyAgIlRlc1698416984eucas1p1p; Thu, 12 Nov 2020 14:10:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0E.B9.44805.D624DAF5; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed~GyAfrs9KX2134621346eucas1p1v; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201112141053eusmtrp17516099eb5d554838d6d8ee262db638c~GyAfq1Cbo1178311783eusmtrp1C; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) X-AuditID: cbfec7f4-b37ff7000000af05-6b-5fad426dfb5f Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 89.0F.16282.D624DAF5; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201112141052eusmtip2ccc917644c7d599c11291d61b2753502~GyAe7MJLF2828528285eusmtip2s; Thu, 12 Nov 2020 14:10:52 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com Cc: krzk@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@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 v9 4/5] PM / devfreq: exynos-bus: Add registration of interconnect child device Date: Thu, 12 Nov 2020 15:09:30 +0100 Message-Id: <20201112140931.31139-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201112140931.31139-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKKsWRmVeSWpSXmKPExsWy7djPc7q5TmvjDS4ct7C4P6+V0WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFm07j3CbnH4TTurxYzJL9kcBD02repk87hzbQ+bx/3u40wem5fUe/RtWcXo 8XmTXABbFJdNSmpOZllqkb5dAlfGr7332QoeCFbsn7GBuYHxCl8XIyeHhICJxIL3i1m6GLk4 hARWMEqcWLACyvnCKNHbtp0RwvnMKLG68TQTTMv3hpPsEInljBL7uhYwwbWs37GdBaSKTcBQ ovdoH1A7B4eIgKfEyQZ9kBpmgWZmiYbmTYwgNcICiRK3JjwHm8oioCrR8u4TG4jNK2AtcWD5 ZnaIbfISqzccYAaxOQVsJOY+bWUDGSQh8IZDYtXtF6wQRS4SB2bdYYGwhSVeHd8C1SwjcXpy DwtEQzOjRM/u2+wQzgRGifvHFzBCVFlL3Dn3iw3kVGYBTYn1u/Qhwo4Sb5o3s4KEJQT4JG68 FQQ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LHFi+mR1igbzE6g0HmEFsTgEbiblPW6GWWUvs725jmsDI t4CRYRWjSGppcW56brGRXnFibnFpXrpecn7uJkZgfGw79nPLDsaVrz7qHWJk4mA8xCjBwawk wqvssCZeiDclsbIqtSg/vqg0J7X4EKMp0B0TmaVEk/OBEZpXEm9oZmBqaGJmaWBqaWasJM5r cgSoSSA9sSQ1OzW1ILUIpo+Jg1OqgWl5+MrfJ6pvT1u5UehBzaWYexIxTLPM52pevrOU2ZW3 WaD9LTPbErdecae/919t3touLjrTd/6yNL76iPRPx1vtIz4XJetE7bK4/rRS7sYZtcwPfznq Z67cwd4weZ/ko7bza2Y4Fl8J8pzEaqivuWbO0dNu7dvzf76fdDxylbtspuQRVY0nG5/3C0V3 x1ROv1I/7/WRXQVp3vmW0UKLdP9YiLd3Zu7U67l+oV9FbKble63lT36s8HjlljSR6W0a87Zk 51KHwOs8+87/dr619biG7Zv95du+3Vn7wTq9Oen98qTdonNXr5j36eK3ZbH61ge6bgZt+/p+ x+KNq/ll3V/qLt3T4nWoZs4GOa6DM9zClViKMxINtZiLihMBWxn57hgDAAA= X-CMS-MailID: 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed X-Msg-Generator: CA X-RootMTR: 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed References: <20201112140931.31139-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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 v9: - whitespace (indentation) corrections. Changes for v8...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..20447a4 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 Thu Nov 12 14:09:31 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: 11900331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A0AE1391 for ; Thu, 12 Nov 2020 14:11:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2072822240 for ; Thu, 12 Nov 2020 14:11:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="H8T7pWhq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728442AbgKLOLO (ORCPT ); Thu, 12 Nov 2020 09:11:14 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60538 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728428AbgKLOLM (ORCPT ); Thu, 12 Nov 2020 09:11:12 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201112141059euoutp022f7c7c57739f6143ea9b4a06d471a2f1~GyAljFCOd1501415014euoutp02E for ; Thu, 12 Nov 2020 14:10:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201112141059euoutp022f7c7c57739f6143ea9b4a06d471a2f1~GyAljFCOd1501415014euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605190259; bh=z4JUTeobWI7rzPyDZAkdJgoWhMqzwKoLxg3F51G+v3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H8T7pWhq3HOmElihwUpU+tJypkq+iRGQJoFRwacIjMaMdFy3lgLhrBxhF0YqMt4SU DGZdLdMG9MRbYzCBmUEuuYJR3SM+75mDzJ+kWbNRV6LqxaOp1UrRQpoPk57bHUL0zz ViWTiS3dJosdgKimafqs7cNNjctf88QrHztj30eg= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201112141056eucas1p1202ef75341f398d7da3df75b4802441e~GyAiGBz672319123191eucas1p11; Thu, 12 Nov 2020 14:10:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 00.C9.44805.F624DAF5; Thu, 12 Nov 2020 14:10:56 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201112141055eucas1p10bb68467fbb8c481b1275433f5f5f467~GyAhpP6402134621346eucas1p1x; Thu, 12 Nov 2020 14:10:55 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201112141055eusmtrp1092c57ac19bc5475fd4d52639f4074da~GyAhocMCc1178311783eusmtrp1G; Thu, 12 Nov 2020 14:10:55 +0000 (GMT) X-AuditID: cbfec7f4-b37ff7000000af05-71-5fad426ff678 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3D.0F.16282.F624DAF5; Thu, 12 Nov 2020 14:10:55 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201112141054eusmtip281ef57b5904537952b6019311d571aac~GyAg4LImV0118501185eusmtip2O; Thu, 12 Nov 2020 14:10:54 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com Cc: krzk@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, a.swigon@samsung.com, myungjoo.ham@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 v9 5/5] drm: exynos: mixer: Add interconnect support Date: Thu, 12 Nov 2020 15:09:31 +0100 Message-Id: <20201112140931.31139-6-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201112140931.31139-1-s.nawrocki@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBKsWRmVeSWpSXmKPExsWy7djP87oFTmvjDY4+ZrS4P6+V0WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFm07j3CbnH4TTurxYzJL9kcBD02repk87hzbQ+bx/3u40wem5fUe/RtWcXo 8XmTXABbFJdNSmpOZllqkb5dAlfGtOOLmQt2eFYc/fKVrYHxsnUXIyeHhICJxL9XLSxdjFwc QgIrGCXmHF/BDuF8YZQ4/O4UK4TzmVHi/MbFjDAth6//gEosZ5T48+glI1zLkalPwKrYBAwl eo/2AdkcHCICnhInG/RBapgFmpklGpo3gdUIC7hIfDzwgw3EZhFQlfj9sJkNpJ5XwFqi43kN xDJ5idUbDjCD2JwCNhJzn7aClfMKCEqcnPmEBcRmBqpp3jqbGWS+hMB8TomJN+awQDS7SNze tRfKFpZ4dXwLO4QtI3F6cg8LREMzo0TP7tvsEM4ERon7xxdA/WktcefcL7CLmAU0Jdbv0ocI O0p0Ll7BChKWEOCTuPFWEOIIPolJ26YzQ4R5JTrahCCqVSR+r5rOBGFLSXQ/+Q91jofE76kb mScwKs5C8s4sJO/MQti7gJF5FaN4amlxbnpqsVFearlecWJucWleul5yfu4mRmBiO/3v+Jcd jMtffdQ7xMjEwXiIUYKDWUmEV9lhTbwQb0piZVVqUX58UWlOavEhRmkOFiVx3qQtQCmB9MSS 1OzU1ILUIpgsEwenVANT2YYSmwWb9T4knnqU0m4g/MOt9M5Pq1XvI+onNU25s8Vl5ox77y8I LtN2lhcr5/US+7S3RvtRof+Jb/kfCz/ln638cHRNweECq5c/G2x3nHrEeGHu2wcnrN5290zL K9Oyktwu4vvtWNt5r59PF109L7ZkrununV5Pr1tO04n7PqNwW5tGz4L0x7tNFuwJsFeZPEF5 nx33kgPRO964Z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M3aIFtY39z+zSr1wPWzbY04t33te9VKMD+p9e/8fYH7/2fWw 4meWvyZxZhvepb6aMHNCO8PCV4dijEvW86fYzD2joVDXfzu+OOGXRJBRpQyH8Mxzbhqi5Ukq ddePmc2dYBH7pu3jjYL0dGuX23cPXSqZtPXbun/vHzJ4a6rlb/+8cWfrqqlzJqjv9IgWW3WA WXeiKdcXJZbijERDLeai4kQAmJo2HF0DAAA= X-CMS-MailID: 20201112141055eucas1p10bb68467fbb8c481b1275433f5f5f467 X-Msg-Generator: CA X-RootMTR: 20201112141055eucas1p10bb68467fbb8c481b1275433f5f5f467 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201112141055eucas1p10bb68467fbb8c481b1275433f5f5f467 References: <20201112140931.31139-1-s.nawrocki@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@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 Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Co-developed-by: Artur Świgoń Signed-off-by: Artur Świgoń Co-developed-by: Marek Szyprowski Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki --- Changes for v9: - whitespace cleanup, - Co-developed-by/Signed-off-by tags corrections. 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..502ce04 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; }