From patchwork Fri Feb 19 15:59:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12095747 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,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 C5AA8C433E6 for ; Fri, 19 Feb 2021 16:04:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2542064EB1 for ; Fri, 19 Feb 2021 16:04:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2542064EB1 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=VcUPmDG53/dzn3CJYKQ1OrEw5u/aYbYXUmQ8J//I2I8=; b=faQuvbEzMlHkzjC8WEe6xNonKk XSpSJQzmcEcpOsWgSY9UQfkAudBTZxzAOYkmliRYb3IFovdLiPLda69iMJQUeAQxLWhohggrllO5t td98BiGImmui95RrUU46F+fvGdgWyFobdoXx06kakOynkGUhxByVUjfYr97XTk9ADPehrR0VgTVCE 10dHbh+Ze65fIhROHGJubgT+AiVmmwiWY7RouvAui84Sw8RSaGTLQAIvm11HQ/38/oRPsyjj1kAcL Hodjwi9jV31GwL34HwpNuMyXMWp5eF9efS3RLNUk8lDrYueWhAw3etMJFV7QA57vM+u8+A9CQ89gN 9sMfUwRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lD8DJ-0007mQ-4X; Fri, 19 Feb 2021 16:01:05 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lD8DF-0007jF-Df for linux-arm-kernel@lists.infradead.org; Fri, 19 Feb 2021 16:01:03 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 527112000AA; Fri, 19 Feb 2021 17:00:57 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 413E72000E5; Fri, 19 Feb 2021 17:00:57 +0100 (CET) Received: from fsr-ub1664-175.ea.freescale.net (fsr-ub1664-175.ea.freescale.net [10.171.82.40]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 9DCC22042F; Fri, 19 Feb 2021 17:00:56 +0100 (CET) From: Abel Vesa To: Rob Herring , Shawn Guo , Sascha Hauer , Lucas Stach , Fabio Estevam , Chanwoo Choi , Georgi Djakov , Dong Aisheng , Peng Fan , Martin Kepplinger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, Linux Kernel Mailing List Subject: [RFC 00/19] Rework support for i.MX8MQ interconnect with devfreq Date: Fri, 19 Feb 2021 17:59:57 +0200 Message-Id: <1613750416-11901-1-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210219_110101_808886_B7EA2B35 X-CRM114-Status: GOOD ( 19.49 ) 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: NXP Linux Team , Abel Vesa MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This has been on my queue for quite some time now. It is more of a proof-of-concept. This rework is done with the compatibility of future i.MX platforms in mind. For example, the i.MX8MP platform has multiple NoCs. This patchsets prepares the imx interconnect and imx devfreq for that too. As of now, none of the drivers involved are being used and there is no icc consumer on any off the i.MX platforms. Basically, the steps taken here are the following: 1. Make the dram_apb clock "reparantable" from kernel. This is needed in order to keep track of the actual parent of the dram_apb clock in the kernel clock hierarchy. Note that the actual switch is done EL3 (TF-A). 2. Rework the imx-bus so the actual link between the icc and the NoCs or the pl301s is not tightly coupled. This allows us to have as many NoCs as necessary but also allows as to use the same driver for the pl301s. The pl301s have their own clocks too, so we need to reduce their rates too. 3. Rework the imx8m-ddrc driver. Remove the support for dts defined OPPs. The EL3 provides those. So instead of havingi to keep the OPP table in both EL3 and kernel in sync, we rely on what the EL3 gives us. Also, when the platform suspends, the bus needs to be running at highest rate, otherwise there is a chance it might not resume anymore. By adding the late system sleep PM ops we can handle that easily. 4. Rework the imx interconnect driver to use the fsl,icc-id instead of the robust imx_icc_node_adj_desc for linking with the target node. By adding the fsl,icc-id property to all the NoC and pl301 dts nodes, we can link each icc node to their corresponding NoC, pl301 or dram. Basically, when the imx interconnect platform specific driver probes, it will take each node defined for that platform and look-up the corresponding dts node based on the id and add that as the qos device. 5. Added the fec and usdhc as icc consumers. This is just as an example. All the other consumers can be added later. Basically, each consumer will add a path to their device node and in the driver will have to handle that icc path accordingly. Abel Vesa (19): clk: imx8mq: Replace critical with ignore_unused flag for dram_apb clock dt-bindings: interconnect: imx8mq: Add missing pl301 and SAI ids devfreq: imx-bus: Switch governor to powersave devfreq: imx-bus: Decouple imx-bus from icc made devfreq: imx8m-ddrc: Change governor to powersave devfreq: imx8m-ddrc: Use the opps acquired from EL3 devfreq: imx8m-ddrc: Add late system sleep PM ops interconnect: imx: Switch from imx_icc_node_adj_desc to fsl,icc-id node assignment interconnect: imx8: Remove the imx_icc_node_adj_desc interconnect: imx8mq: Add the pl301_per_m and pl301_wakeup nodes and subnodes interconnect: imx8mq: Add of_match_table interconnect: imx: Add imx_icc_get_bw and imx_icc_aggregate functions arm64: dts: imx8mq: Add fsl,icc-id property to ddrc node arm64: dts: imx8mq: Add fsl,icc-id to noc node arm64: dts: imx8mq: Add all pl301 nodes arm64: dts: imx8mq: Add the interconnect node arm64: dts: imx8mq: Add interconnect properties to icc consumer nodes net: ethernet: fec_main: Add interconnect support mmc: sdhci-esdhc-imx: Add interconnect support arch/arm64/boot/dts/freescale/imx8mq.dtsi | 200 +++++++++++++++++++++- drivers/clk/imx/clk-imx8mq.c | 2 +- drivers/devfreq/imx-bus.c | 42 +---- drivers/devfreq/imx8m-ddrc.c | 75 +++----- drivers/interconnect/imx/imx.c | 92 +++++----- drivers/interconnect/imx/imx.h | 19 +- drivers/interconnect/imx/imx8mm.c | 32 ++-- drivers/interconnect/imx/imx8mn.c | 28 +-- drivers/interconnect/imx/imx8mq.c | 59 ++++--- drivers/mmc/host/sdhci-esdhc-imx.c | 26 +++ drivers/net/ethernet/freescale/fec.h | 3 + drivers/net/ethernet/freescale/fec_main.c | 19 ++ include/dt-bindings/interconnect/imx8mq.h | 9 + scripts/dtc/fdtoverlay | Bin 0 -> 61280 bytes 14 files changed, 393 insertions(+), 213 deletions(-) create mode 100755 scripts/dtc/fdtoverlay