From patchwork Mon Apr 6 12:03:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 11475423 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 6480E112C for ; Mon, 6 Apr 2020 12:03:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3FF44208E4 for ; Mon, 6 Apr 2020 12:03:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="p+mMkQpB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FF44208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=caZlzazEHR0hTp58z9xbtjppcsQ7k2XFVvsATdP1rKM=; b=p+m MkQpBEoAN86chUH3l9zcgyZ+hF/mT2FIGlQq1+7rVHDSnYEFPhgxtkF2zIA/o+i6tkdOW38rzQQNj NN19jU+YUvz9ynMmv6EwB5F9lG73cRIyQfbYWXTzNC5XP5XY9PksPZ7CouwEcys6Lf1ucf3UP5C4v tVXtKDf196aw0s8ZXeaKVRqyzDedmielr7juy4GcvNxDWWXuoeUMWGC2iVsELzzwVJbktOCyygogN dSbWk/5yr/LGGsm2RLU0acxGK/lWMf0S65KgToAlWzqvUygcvHm92r2HLvdsHJYa+60ni6GvlUu5C Jhfnq3JRFUZaTvCiMGC4SrKmBIN79EQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jLQTL-0003L4-Ah; Mon, 06 Apr 2020 12:03:23 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jLQTI-0003Ja-Fw for linux-arm-kernel@lists.infradead.org; Mon, 06 Apr 2020 12:03:22 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A02FB1A0DCF; Mon, 6 Apr 2020 14:03:16 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 85B791A0DC9; Mon, 6 Apr 2020 14:03:16 +0200 (CEST) Received: from fsr-ub1864-112.ea.freescale.net (fsr-ub1864-112.ea.freescale.net [10.171.82.98]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id CAD88204E6; Mon, 6 Apr 2020 14:03:14 +0200 (CEST) From: Leonard Crestez To: Georgi Djakov , Rob Herring , Chanwoo Choi Subject: [PATCH v3 0/8] interconnect: Add imx support via devfreq Date: Mon, 6 Apr 2020 15:03:05 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200406_050320_809694_280FEE34 X-CRM114-Status: GOOD ( 11.06 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.13 listed in list.dnswl.org] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Jacky Bai , "Rafael J. Wysocki" , Viresh Kumar , Michael Turquette , Angus Ainslie , =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , Alexandre Bailon , Matthias Kaehlcke , Abel Vesa , Anson Huang , Krzysztof Kozlowski , MyungJoo Ham , linux-imx@nxp.com, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Martin Kepplinger , Silvano di Ninno , linux-arm-kernel@lists.infradead.org, Dong Aisheng , Saravana Kannan , Stephen Boyd , Kyungmin Park , kernel@pengutronix.de, Fabio Estevam , Shawn Guo MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This series adds interconnect scaling support for imx8m series chips. It uses a per-SOC interconnect provider layered on top of multiple instances of devfreq for scalable nodes along the interconnect. Existing qcom interconnect providers mostly translate bandwidth requests into firmware calls but equivalent firmware on imx8m is much thinner. Scaling support for individual nodes is implemented as distinct devfreq drivers instead. The imx interconnect provider doesn't communicate with devfreq directly but rather computes "minimum frequencies" for nodes along the path and creates dev_pm_qos requests. Since there is no single devicetree node that can represent the "interconnect" the main NOC is picked as the "interconnect provider" and will probe the interconnect platform device if #interconnect-cells is present. This avoids introducing "virtual" devices but it means that DT bindings of main NOC includes properties for both devfreq and interconnect. Only the ddrc and main noc are scalable right now but more can be added. Also available on a github branch (with various unrelated changes): https://github.com/cdleonard/linux/tree/next_leonard Changes since v2: * Fix unused variable in imx_bus_target * Sort imx before qcom in interconnect makefile/kconfig * Use icc_std_aggregate * Adjust prints in imx interconnect core. * Adjust included guarts for dt bindings * Remove imx_icc_unregister warning when there are active users, should be handled inside core instead. Link: https://patchwork.kernel.org/cover/11469157/ Changes since v1: * Fix dt_bindings_check for yaml and reduce example to fit current features * Fix comment spelling in imx-bus * Drop mentions of passive governor from imx-bus (will repost later) * Improve error message in imx_bus_init_icc * Use dev_pm_opp_set_rate Link: https://patchwork.kernel.org/cover/11458971/ Changes since RFCv6: * Allow building interconnect drivers as modules * Handle icc_provider_del errors in imx_icc_unregister (like EBUSY). * Rename imx-devfreq to imx-bus, similar to exynos-bus * Explain why imx bus clock enabling is not required Link: https://patchwork.kernel.org/cover/11244421/ Changes since RFCv5: * Replace scanning for interconnect-node-id with explicit scalable-nodes/scalable-node-ids property on NoC. * Now passes make `dtbs_check` * Remove struct imx_icc_provider * Switch to of_icc_xlate_onecell * Use of_find_device_by_node to fetch QoS target, this causes fewer probe deferrals, removes dependency on devfreq API and even allows reloading ddrc module at runtime * Add imx_icc_node_destroy helper * Remove 0/1 on DEFINE_BUS_SLAVE/MASTER which created spurious links Link: https://patchwork.kernel.org/cover/11222015/ Changes since RFCv4: * Drop icc proxy nonsense * Make devfreq driver for NOC probe the ICC driver if #interconnect-cells is present * Move NOC support to interconnect series and rename the node in DT * Add support for all chips at once, differences are not intereseting and there is more community interest for 8mq than 8mm. Link: https://patchwork.kernel.org/cover/11111865/ Changes since RFCv3: * Remove the virtual "icc" node and add devfreq nodes as proxy providers * Fix build on 32-bit arm (reported by kbuilt test robot) * Remove ARCH_MXC_ARM64 (never existed in upstream) * Remove _numlinks, calculate instead * Replace __BUSFREQ_H header guard * Improve commit message and comment spelling * Fix checkpatch issues Link to RFCv3: https://patchwork.kernel.org/cover/11078671/ Changes since RFCv2 and initial work by Alexandre Bailon: * Relying on devfreq and dev_pm_qos instead of CLK * No more "platform opp" stuff * No more special suspend handling: use suspend-opp on devfreq instead * Replace all mentions of "busfreq" with "interconnect" Link to v2: https://patchwork.kernel.org/cover/11021563/ Leonard Crestez (8): dt-bindings: interconnect: Add bindings for imx8m noc PM / devfreq: Add generic imx bus scaling driver PM / devfreq: imx: Register interconnect device interconnect: Add imx core driver interconnect: imx: Add platform driver for imx8mm interconnect: imx: Add platform driver for imx8mq interconnect: imx: Add platform driver for imx8mn arm64: dts: imx8m: Add NOC nodes .../bindings/interconnect/fsl,imx8m-noc.yaml | 101 +++++++ arch/arm64/boot/dts/freescale/imx8mm.dtsi | 24 ++ arch/arm64/boot/dts/freescale/imx8mn.dtsi | 24 ++ arch/arm64/boot/dts/freescale/imx8mq.dtsi | 24 ++ drivers/devfreq/Kconfig | 8 + drivers/devfreq/Makefile | 1 + drivers/devfreq/imx-bus.c | 179 +++++++++++ drivers/interconnect/Kconfig | 1 + drivers/interconnect/Makefile | 1 + drivers/interconnect/imx/Kconfig | 17 ++ drivers/interconnect/imx/Makefile | 9 + drivers/interconnect/imx/imx.c | 284 ++++++++++++++++++ drivers/interconnect/imx/imx.h | 61 ++++ drivers/interconnect/imx/imx8mm.c | 105 +++++++ drivers/interconnect/imx/imx8mn.c | 94 ++++++ drivers/interconnect/imx/imx8mq.c | 103 +++++++ include/dt-bindings/interconnect/imx8mm.h | 50 +++ include/dt-bindings/interconnect/imx8mn.h | 41 +++ include/dt-bindings/interconnect/imx8mq.h | 48 +++ 19 files changed, 1175 insertions(+) create mode 100644 Documentation/devicetree/bindings/interconnect/fsl,imx8m-noc.yaml create mode 100644 drivers/devfreq/imx-bus.c create mode 100644 drivers/interconnect/imx/Kconfig create mode 100644 drivers/interconnect/imx/Makefile create mode 100644 drivers/interconnect/imx/imx.c create mode 100644 drivers/interconnect/imx/imx.h create mode 100644 drivers/interconnect/imx/imx8mm.c create mode 100644 drivers/interconnect/imx/imx8mn.c create mode 100644 drivers/interconnect/imx/imx8mq.c create mode 100644 include/dt-bindings/interconnect/imx8mm.h create mode 100644 include/dt-bindings/interconnect/imx8mn.h create mode 100644 include/dt-bindings/interconnect/imx8mq.h