From patchwork Mon Sep 13 17:37:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490301 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 1835BC433EF for ; Mon, 13 Sep 2021 17:41:21 +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 DD5DC610CE for ; Mon, 13 Sep 2021 17:41:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DD5DC610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yjzPkLVnRmSchkIWa3M13AnOsggCb0IDmt1zaBfmByc=; b=V/10JwZsVvGoYm qPJNJWJxyVu5g5MinE7NTRx60rBBv3XoekXtGKLaPGoxOcd0znmBVdG//L6k215YlgMv7T2QLLgaC MDkxIqBGMEKV8M0Y+gbPKgDbiwjsOC0eK1KVYlujT3JMzotmAIOrnqRxOyWn0YYmj48mZLhAE2iZN n5GJo6dJELEnX4oIcLLzu1UZkOWigkq7j4aV24WLkoR2b5foeZGpRPx7uAJrLFr4j4pOk1Sqc2hkf 5XoR9YtgtWMwdKhIMsXz38Es043+b5l57BServ2sgrLYBjCyLcNR3/wqtgksYH5Ko4YbttO3Kkl/K wmxvO4HCfF9iYSmd8wGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpui-002jra-NA; Mon, 13 Sep 2021 17:38:40 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuS-002jjj-Ud for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:26 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4890A1A039A; Mon, 13 Sep 2021 19:38:23 +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 3A66C1A0394; Mon, 13 Sep 2021 19:38:23 +0200 (CEST) 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 63C2020363; Mon, 13 Sep 2021 19:38:22 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 01/19] dt-bindings: interconnect: imx8mq: Add missing pl301 and SAI ids Date: Mon, 13 Sep 2021 20:37:56 +0300 Message-Id: <1631554694-9599-2-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103825_171763_210A797F X-CRM114-Status: GOOD ( 11.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org According to the bus diagram, there are two more pl301s that need to be added here. The pl301_per_m which is an intermediary node between pl301_main and its masters: usdhc1, usdhc2 and sdma. The pl301_wakeup is an intermediary node between pl301_main and its masters, in this case all the SAIs. Signed-off-by: Abel Vesa --- include/dt-bindings/interconnect/imx8mq.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/dt-bindings/interconnect/imx8mq.h b/include/dt-bindings/interconnect/imx8mq.h index 1a4cae7f8be2..1953de8af5cb 100644 --- a/include/dt-bindings/interconnect/imx8mq.h +++ b/include/dt-bindings/interconnect/imx8mq.h @@ -44,5 +44,14 @@ #define IMX8MQ_ICM_PCIE1 26 #define IMX8MQ_ICM_PCIE2 27 #define IMX8MQ_ICN_MAIN 28 +#define IMX8MQ_ICN_PER_M 30 + +#define IMX8MQ_ICN_WAKEUP 31 +#define IMX8MQ_ICM_SAI1 32 +#define IMX8MQ_ICM_SAI2 33 +#define IMX8MQ_ICM_SAI3 34 +#define IMX8MQ_ICM_SAI4 35 +#define IMX8MQ_ICM_SAI5 36 +#define IMX8MQ_ICM_SAI6 37 #endif /* __DT_BINDINGS_INTERCONNECT_IMX8MQ_H */ From patchwork Mon Sep 13 17:37: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: 12490305 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 1727FC433EF for ; Mon, 13 Sep 2021 17:41:38 +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 D357D601FA for ; Mon, 13 Sep 2021 17:41:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D357D601FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TvG4IFDDYidDg77Ed/k9aWEcbnb4U9MB4gV26qjIE98=; b=16W0R/OklaAzpS XtRVWq9lQaq7bQ/rd2T7v1/coZhdDEDLXXJusU4SiKBc0rw49V/9qYDMZwwzr/PJJ9ZjLAnyDoN3V rit1LBNGqs2jNURtb7OjByuOmsKuZH+8ZH7ZZvcrXVu1Knt+RgIUDj0TAzMPp0n5ANWwSV4qoYCsQ tMvpjhT3ynYOrH8SrCKi1+WgSGhAjNlAicrAhloIM5T11ba5acaW5ZghYk/r/MffAK86KKR3kfJaC fpn/zLt5omR71PMZTjbkqsIQyrbIVJVTof2Ht21ynH8meTRgailVKxB3SwAsDnNWyGgeSDPZjJNJB vm8BMbiXiHdDd+Kj3XTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPput-002juN-Nq; Mon, 13 Sep 2021 17:38:51 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuT-002jjx-EB for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:26 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 305801A038F; Mon, 13 Sep 2021 19:38:24 +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 227801A010C; Mon, 13 Sep 2021 19:38:24 +0200 (CEST) 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 4BB9E20363; Mon, 13 Sep 2021 19:38:23 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 02/19] devfreq: imx-bus: Switch governor to powersave Date: Mon, 13 Sep 2021 20:37:57 +0300 Message-Id: <1631554694-9599-3-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103825_650449_9DFB733F X-CRM114-Status: GOOD ( 13.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org By switching to powersave governor, we allow the imx-bus to always run at minimum rate needed by all the running masters. Signed-off-by: Abel Vesa --- drivers/devfreq/imx-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/imx-bus.c b/drivers/devfreq/imx-bus.c index f3f6e25053ed..9d8dc9824d21 100644 --- a/drivers/devfreq/imx-bus.c +++ b/drivers/devfreq/imx-bus.c @@ -87,7 +87,7 @@ static int imx_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct imx_bus *priv; - const char *gov = DEVFREQ_GOV_USERSPACE; + const char *gov = DEVFREQ_GOV_POWERSAVE; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); From patchwork Mon Sep 13 17:37:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490295 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 79EFFC433EF for ; Mon, 13 Sep 2021 17:40:45 +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 4D625610CC for ; Mon, 13 Sep 2021 17:40:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4D625610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sQC0g/zZkZEKpfSWg6ndj87CVi6Ej6YYh4+VVordIas=; b=rhCGNA40PHFrEk xfwuNzJ0oHgmmm2Tbc2p1L8fYoCUcu2escgMia7IZliMoh5kCeG8n1uZQ+VLw/P8iycyCAEr88OMe 0a/CQnpTVdk2ABT4V7OQWC82AUV2mOUowN23m0reyIL14uWVL0pX3NcllWmKcibVH582unceBHUww EKJheNM+TdT0iyUiqn2hOGI9PVvT0W3/j9Tb9w5VSRU6fsosYnJ7gIHFkW2G30p+GRWFVZ+C/xEPv ujt1DPDciy/6di/MUdWMm7kZkxwjVUTwYTIN/9Mu0vPvWs8S+KTaosjYAljPEq63JfWYGyvwuBVbp jJQtTVCX+zZ7KI9PlMrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpv7-002jxj-0n; Mon, 13 Sep 2021 17:39:05 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuU-002jkN-Ak for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:27 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 193BC2005BE; Mon, 13 Sep 2021 19:38:25 +0200 (CEST) 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 00D1D2005AC; Mon, 13 Sep 2021 19:38:25 +0200 (CEST) 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 337AE20363; Mon, 13 Sep 2021 19:38:24 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 03/19] devfreq: imx-bus: Decouple imx-bus from icc made Date: Mon, 13 Sep 2021 20:37:58 +0300 Message-Id: <1631554694-9599-4-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103826_691905_0F0CB929 X-CRM114-Status: GOOD ( 15.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The link between an imx-bus device and its icc id will be done through the fsl,icc-id property in each dts node. The imx interconnect driver will pick up all the dts nodes that have that property defined and will link them to the rightfull icc id. Signed-off-by: Abel Vesa --- drivers/devfreq/imx-bus.c | 40 +++------------------------------------ 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/drivers/devfreq/imx-bus.c b/drivers/devfreq/imx-bus.c index 9d8dc9824d21..95339de8cccf 100644 --- a/drivers/devfreq/imx-bus.c +++ b/drivers/devfreq/imx-bus.c @@ -53,36 +53,6 @@ static void imx_bus_exit(struct device *dev) platform_device_unregister(priv->icc_pdev); } -/* imx_bus_init_icc() - register matching icc provider if required */ -static int imx_bus_init_icc(struct device *dev) -{ - struct imx_bus *priv = dev_get_drvdata(dev); - const char *icc_driver_name; - - if (!of_get_property(dev->of_node, "#interconnect-cells", 0)) - return 0; - if (!IS_ENABLED(CONFIG_INTERCONNECT_IMX)) { - dev_warn(dev, "imx interconnect drivers disabled\n"); - return 0; - } - - icc_driver_name = of_device_get_match_data(dev); - if (!icc_driver_name) { - dev_err(dev, "unknown interconnect driver\n"); - return 0; - } - - priv->icc_pdev = platform_device_register_data( - dev, icc_driver_name, -1, NULL, 0); - if (IS_ERR(priv->icc_pdev)) { - dev_err(dev, "failed to register icc provider %s: %ld\n", - icc_driver_name, PTR_ERR(priv->icc_pdev)); - return PTR_ERR(priv->icc_pdev); - } - - return 0; -} - static int imx_bus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -130,10 +100,6 @@ static int imx_bus_probe(struct platform_device *pdev) goto err; } - ret = imx_bus_init_icc(dev); - if (ret) - goto err; - return 0; err: @@ -142,9 +108,9 @@ static int imx_bus_probe(struct platform_device *pdev) } static const struct of_device_id imx_bus_of_match[] = { - { .compatible = "fsl,imx8mq-noc", .data = "imx8mq-interconnect", }, - { .compatible = "fsl,imx8mm-noc", .data = "imx8mm-interconnect", }, - { .compatible = "fsl,imx8mn-noc", .data = "imx8mn-interconnect", }, + { .compatible = "fsl,imx8mq-noc",}, + { .compatible = "fsl,imx8mm-noc",}, + { .compatible = "fsl,imx8mn-noc",}, { .compatible = "fsl,imx8m-noc", }, { .compatible = "fsl,imx8m-nic", }, { /* sentinel */ }, From patchwork Mon Sep 13 17:37:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490309 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 D29ABC4332F for ; Mon, 13 Sep 2021 17:41:57 +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 A2B58610CC for ; Mon, 13 Sep 2021 17:41:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A2B58610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mzH37fuNdIAlB8RQXAnM8Uh2GP8rRbBwKWQvLWunTQs=; b=AVGfM3VPdyw9Ci S7GPnPycXmQXUGcY8kZLbUClIcVjkxD/GMqwYcj6SNKarPdu1ch1Ptgc8DTTwEhaWloetOIWzW3ms 0gzs9apWInUaAPelnCYgSeLVMpqPfhdGgZ8KBGic8Dj/eI2Y1JAvCD3SEZRHGUfo34jLd8aRabenb FkG2uHMaErjnx0MSStXYJREvick0tY7bOSim4mOaDNByOd32z3QdvfTW0R0++lGZE7KoFK+ZDnvht VO191R000GApEiuCj3hHIdqKewN/typfFRc+MpeHAWundvjmSdLRiz5/dL9I/j+oNdWBH/MycdpuR JoD2Br7Lu6zHMo7lQdGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpvJ-002k0t-42; Mon, 13 Sep 2021 17:39:17 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuV-002jkk-7m for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:28 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0340A2005D5; Mon, 13 Sep 2021 19:38:26 +0200 (CEST) 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 DFCE92005AC; Mon, 13 Sep 2021 19:38:25 +0200 (CEST) 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 118A020363; Mon, 13 Sep 2021 19:38:25 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 04/19] devfreq: imx8m-ddrc: Change governor to powersave Date: Mon, 13 Sep 2021 20:37:59 +0300 Message-Id: <1631554694-9599-5-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103827_455681_239C94D3 X-CRM114-Status: GOOD ( 13.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org By switching to powersave governor, we allow the imx8m-ddrc to always run at minimum rate needed by all the running masters. Signed-off-by: Abel Vesa --- drivers/devfreq/imx8m-ddrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c index 16636973eb10..583123bf2100 100644 --- a/drivers/devfreq/imx8m-ddrc.c +++ b/drivers/devfreq/imx8m-ddrc.c @@ -367,7 +367,7 @@ static int imx8m_ddrc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct imx8m_ddrc *priv; - const char *gov = DEVFREQ_GOV_USERSPACE; + const char *gov = DEVFREQ_GOV_POWERSAVE; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); From patchwork Mon Sep 13 17:38:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490297 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 50161C433EF for ; Mon, 13 Sep 2021 17:41:01 +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 191FB610CC for ; Mon, 13 Sep 2021 17:41:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 191FB610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5ha6iCAaKTH3s/dSI74PCvi1PfNJbk33nC5klyHd6JI=; b=hopf+bl/pZOG6E Px/d8lfxjcUQuODeW3jd++S4y+p2D/Cv0wPHXLGmuWE2CO9/M65HknjVa5S7MXPgmbCJkqigkAdZv sUoZgys1f2m4On4eVyCfMNbcrX8uM0ynkuwfmUv4ZqovAfy3+m76yNHDpSHn1bdgx4pJ6IpBI7S1O g8w4Fd8UTNrGh2+1EKetY5WZfkgjiyy/tL6HsOt0IYCRbMCfyl9LcJmJ5/23syuCJAjH1mzlLFpya u+GOFrPSgpDn6bY2X7QgvQf5SEVYrMDbZgAdZfBw3yi8Fl/AE4kZg/ABD9LOdixxr633q/2Z9emN6 kJJTxKd0Rp3iV9kIl69Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpvY-002k87-K0; Mon, 13 Sep 2021 17:39:32 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuW-002jlB-0p for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:29 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id CC4AF1A0396; Mon, 13 Sep 2021 19:38:26 +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 BE23F1A0394; Mon, 13 Sep 2021 19:38:26 +0200 (CEST) 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 EF06520363; Mon, 13 Sep 2021 19:38:25 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 05/19] devfreq: imx8m-ddrc: Use the opps acquired from EL3 Date: Mon, 13 Sep 2021 20:38:00 +0300 Message-Id: <1631554694-9599-6-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103828_398170_037459FF X-CRM114-Status: GOOD ( 16.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org i.MX8M platforms get their dram OPPs from the EL3. We don't need to duplicate that in the kernel dram dts node. We should just trust the OPPs provided by the EL3. Signed-off-by: Abel Vesa --- drivers/devfreq/imx8m-ddrc.c | 50 +++--------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c index 583123bf2100..f18a5c3c1c03 100644 --- a/drivers/devfreq/imx8m-ddrc.c +++ b/drivers/devfreq/imx8m-ddrc.c @@ -321,38 +321,9 @@ static int imx8m_ddrc_init_freq_info(struct device *dev) if (freq->dram_core_parent_index == 2 && freq->dram_alt_parent_index == 0) return -ENODEV; - } - - return 0; -} - -static int imx8m_ddrc_check_opps(struct device *dev) -{ - struct imx8m_ddrc *priv = dev_get_drvdata(dev); - struct imx8m_ddrc_freq *freq_info; - struct dev_pm_opp *opp; - unsigned long freq; - int i, opp_count; - - /* Enumerate DT OPPs and disable those not supported by firmware */ - opp_count = dev_pm_opp_get_opp_count(dev); - if (opp_count < 0) - return opp_count; - for (i = 0, freq = 0; i < opp_count; ++i, ++freq) { - opp = dev_pm_opp_find_freq_ceil(dev, &freq); - if (IS_ERR(opp)) { - dev_err(dev, "Failed enumerating OPPs: %ld\n", - PTR_ERR(opp)); - return PTR_ERR(opp); - } - dev_pm_opp_put(opp); - freq_info = imx8m_ddrc_find_freq(priv, freq); - if (!freq_info) { - dev_info(dev, "Disable unsupported OPP %luHz %luMT/s\n", - freq, DIV_ROUND_CLOSEST(freq, 250000)); - dev_pm_opp_disable(dev, freq); - } + if (dev_pm_opp_add(dev, freq->rate * 250000, 0)) + return -ENODEV; } return 0; @@ -360,7 +331,6 @@ static int imx8m_ddrc_check_opps(struct device *dev) static void imx8m_ddrc_exit(struct device *dev) { - dev_pm_opp_of_remove_table(dev); } static int imx8m_ddrc_probe(struct platform_device *pdev) @@ -407,16 +377,7 @@ static int imx8m_ddrc_probe(struct platform_device *pdev) return ret; } - ret = dev_pm_opp_of_add_table(dev); - if (ret < 0) { - dev_err(dev, "failed to get OPP table\n"); - return ret; - } - - ret = imx8m_ddrc_check_opps(dev); - if (ret < 0) - goto err; - + priv->profile.polling_ms = 1000; priv->profile.target = imx8m_ddrc_target; priv->profile.exit = imx8m_ddrc_exit; priv->profile.get_cur_freq = imx8m_ddrc_get_cur_freq; @@ -427,13 +388,8 @@ static int imx8m_ddrc_probe(struct platform_device *pdev) if (IS_ERR(priv->devfreq)) { ret = PTR_ERR(priv->devfreq); dev_err(dev, "failed to add devfreq device: %d\n", ret); - goto err; } - return 0; - -err: - dev_pm_opp_of_remove_table(dev); return ret; } From patchwork Mon Sep 13 17:38:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490299 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 25CB3C433F5 for ; Mon, 13 Sep 2021 17:41:20 +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 E4E11610CC for ; Mon, 13 Sep 2021 17:41:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E4E11610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GSfEp5qyrREs5TKKQMvlYILGL3VlCS5a5OzCc9kbuAc=; b=yLZgaw5gFk86aE xhHZ0AoLt/2bJBeNFuLuY2jHUEEBmZfqblFH+VRc8LVyRLDHJZg+J1avg25OPL4jdhehWUoJWSSXn FVBLRLzOBj5NrmuGQm/6gGXJmaJPMYyqsenB6TLKwS+EHTiiUkJCJtoLj0C6OIFRyvw3fszGaSbys bRdE8smJQionfdNMxCXCRFVleHEHxEVEokiHqPgWwrYEydyuvMvr1jA4zyBTkgwrWzg/CnQKXex03 JagokEAL0z9rQgSH8oKMUTCraxM3kH2pqvzj08AQnE8MQukn1Vg/C+LX9CNJgw0m9iA8X6evg8Yiu hPpTOx/8PVWWTpH62eDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpvl-002kEA-Kh; Mon, 13 Sep 2021 17:39:45 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuW-002jla-Vi for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:30 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B49E02005E2; Mon, 13 Sep 2021 19:38:27 +0200 (CEST) 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 9CD002005DD; Mon, 13 Sep 2021 19:38:27 +0200 (CEST) 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 CF2F020363; Mon, 13 Sep 2021 19:38:26 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 06/19] devfreq: imx8m-ddrc: Add late system sleep PM ops Date: Mon, 13 Sep 2021 20:38:01 +0300 Message-Id: <1631554694-9599-7-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103829_340211_A3E75D16 X-CRM114-Status: GOOD ( 16.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Seems that, in order to be able to resume from suspend, the dram rate needs to be the highest one available. Therefore, add the late system suspend/resume PM ops which set the highest rate on suspend and the latest one used before suspending on resume. Signed-off-by: Abel Vesa --- drivers/devfreq/imx8m-ddrc.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/imx8m-ddrc.c b/drivers/devfreq/imx8m-ddrc.c index f18a5c3c1c03..f39741b4a0b0 100644 --- a/drivers/devfreq/imx8m-ddrc.c +++ b/drivers/devfreq/imx8m-ddrc.c @@ -72,6 +72,8 @@ struct imx8m_ddrc { struct clk *dram_alt; struct clk *dram_apb; + unsigned long suspend_rate; + unsigned long resume_rate; int freq_count; struct imx8m_ddrc_freq freq_table[IMX8M_DDRC_MAX_FREQ_COUNT]; }; @@ -271,6 +273,22 @@ static int imx8m_ddrc_target(struct device *dev, unsigned long *freq, u32 flags) return ret; } +static int imx8m_ddrc_suspend(struct device *dev) +{ + struct imx8m_ddrc *priv = dev_get_drvdata(dev); + + priv->resume_rate = clk_get_rate(priv->dram_core); + + return imx8m_ddrc_target(dev, &priv->suspend_rate, 0); +} + +static int imx8m_ddrc_resume(struct device *dev) +{ + struct imx8m_ddrc *priv = dev_get_drvdata(dev); + + return imx8m_ddrc_target(dev, &priv->resume_rate, 0); +} + static int imx8m_ddrc_get_cur_freq(struct device *dev, unsigned long *freq) { struct imx8m_ddrc *priv = dev_get_drvdata(dev); @@ -324,6 +342,9 @@ static int imx8m_ddrc_init_freq_info(struct device *dev) if (dev_pm_opp_add(dev, freq->rate * 250000, 0)) return -ENODEV; + + if (index == 0) + priv->suspend_rate = freq->rate * 250000; } return 0; @@ -399,11 +420,16 @@ static const struct of_device_id imx8m_ddrc_of_match[] = { }; MODULE_DEVICE_TABLE(of, imx8m_ddrc_of_match); +static const struct dev_pm_ops imx8m_ddrc_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(imx8m_ddrc_suspend, imx8m_ddrc_resume) +}; + static struct platform_driver imx8m_ddrc_platdrv = { .probe = imx8m_ddrc_probe, .driver = { .name = "imx8m-ddrc-devfreq", - .of_match_table = imx8m_ddrc_of_match, + .pm = &imx8m_ddrc_pm_ops, + .of_match_table = of_match_ptr(imx8m_ddrc_of_match), }, }; module_platform_driver(imx8m_ddrc_platdrv); From patchwork Mon Sep 13 17:38:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490307 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 5A311C433FE for ; Mon, 13 Sep 2021 17:41:39 +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 2970E60E76 for ; Mon, 13 Sep 2021 17:41:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2970E60E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o9qeBVULCudQKPjNFzcOF2SuHe9QWrWa6LcMXQu+jkA=; b=MmfGPwW3EUHx+C XwrBkFuktgKXrnhbMxOdmGuUHQiIJyvXl6CXmH4YmXm688j9ITLnae2WyUJEmpGUyqYERfX0yUMFs i9elchCa2ngGRR/S5aP/E3CXoeyOBmRChOMwAZsbiH1Shk1/Say+6f/nsKKQJW678s6GqKHk/D3Dq yUgJw3ftPjhcXjYDDAAMxX9/nJWSKceYTKj7YLrirJo6lZMUTLU1PyfcCPrlOnDx4lXXbh+n3ZOed F1g1o5RP/ly1Z+V5CHd6Bn0jL3i4xol50qtmramRMKrhTqWnGb2Es0tIoyPma4Y2jr8WHEjEDkTj8 SSVictvTEy/pDDSQ+yIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpw3-002kM9-4m; Mon, 13 Sep 2021 17:40:03 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuX-002jmB-Pd for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:32 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8C92E2005E1; Mon, 13 Sep 2021 19:38:28 +0200 (CEST) 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 7E3C12005D8; Mon, 13 Sep 2021 19:38:28 +0200 (CEST) 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 AD8EB20363; Mon, 13 Sep 2021 19:38:27 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 07/19] interconnect: imx: Switch from imx_icc_node_adj_desc to fsl, icc-id node assignment Date: Mon, 13 Sep 2021 20:38:02 +0300 Message-Id: <1631554694-9599-8-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103830_567058_4C90EE25 X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to be able to have more than one NoCs in the interconnect net we need to decouple the NoC from the dram. So instead of using the imx_icc_node_adj_desc, we use the fsl,icc-id property that is in each NoC (or pl301) to the icc node (based on the id) to it. Along with all the NoC and pl301 nodes in the dts we will have a interconnect dedicated node. This node will be the actual device of the icc provider. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx.c | 72 +++++++++++++++------------------- 1 file changed, 32 insertions(+), 40 deletions(-) diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index c770951a909c..db048df80011 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -34,9 +34,9 @@ static int imx_icc_node_set(struct icc_node *node) if (!node_data->qos_dev) return 0; - freq = (node->avg_bw + node->peak_bw) * node_data->desc->adj->bw_mul; - do_div(freq, node_data->desc->adj->bw_div); - dev_dbg(dev, "node %s device %s avg_bw %ukBps peak_bw %ukBps min_freq %llukHz\n", + freq = max(node->avg_bw, node->peak_bw); + + dev_dbg(dev, " DBG node %s device %s avg_bw %ukBps peak_bw %ukBps min_freq %llukHz\n", node->name, dev_name(node_data->qos_dev), node->avg_bw, node->peak_bw, freq); @@ -79,41 +79,35 @@ static int imx_icc_node_init_qos(struct icc_provider *provider, struct icc_node *node) { struct imx_icc_node *node_data = node->data; - const struct imx_icc_node_adj_desc *adj = node_data->desc->adj; struct device *dev = provider->dev; - struct device_node *dn = NULL; struct platform_device *pdev; + struct device_node *np = NULL, *dn = NULL; + int idx; - if (adj->main_noc) { - node_data->qos_dev = dev; - dev_dbg(dev, "icc node %s[%d] is main noc itself\n", - node->name, node->id); - } else { - dn = of_parse_phandle(dev->of_node, adj->phandle_name, 0); - if (!dn) { - dev_warn(dev, "Failed to parse %s\n", - adj->phandle_name); - return -ENODEV; - } - /* Allow scaling to be disabled on a per-node basis */ - if (!of_device_is_available(dn)) { - dev_warn(dev, "Missing property %s, skip scaling %s\n", - adj->phandle_name, node->name); - of_node_put(dn); - return 0; - } + for_each_node_with_property(np, "fsl,icc-id") { + of_property_read_u32(np, "fsl,icc-id", &idx); + if (idx == node_data->desc->id) + dn = np; + } - pdev = of_find_device_by_node(dn); - of_node_put(dn); - if (!pdev) { - dev_warn(dev, "node %s[%d] missing device for %pOF\n", - node->name, node->id, dn); - return -EPROBE_DEFER; - } - node_data->qos_dev = &pdev->dev; - dev_dbg(dev, "node %s[%d] has device node %pOF\n", - node->name, node->id, dn); + if (!dn) + return 0; + + if (!of_device_is_available(dn)) { + dev_warn(dev, "%pOF is disabled\n", dn); + return 0; + } + + pdev = of_find_device_by_node(dn); + of_node_put(dn); + if (!pdev) { + dev_warn(dev, "node %s[%d] missing device for %pOF\n", + node->name, node->id, dn); + return -EPROBE_DEFER; } + node_data->qos_dev = &pdev->dev; + dev_dbg(dev, "node %s[%d] has device node %pOF\n", node->name, + node->id, dn); return dev_pm_qos_add_request(node_data->qos_dev, &node_data->qos_req, @@ -151,12 +145,10 @@ static struct icc_node *imx_icc_node_add(struct icc_provider *provider, node_data->desc = node_desc; icc_node_add(node, provider); - if (node_desc->adj) { - ret = imx_icc_node_init_qos(provider, node); - if (ret < 0) { - imx_icc_node_destroy(node); - return ERR_PTR(ret); - } + ret = imx_icc_node_init_qos(provider, node); + if (ret < 0) { + imx_icc_node_destroy(node); + return ERR_PTR(ret); } return node; @@ -244,7 +236,7 @@ int imx_icc_register(struct platform_device *pdev, provider->aggregate = icc_std_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data; - provider->dev = dev->parent; + provider->dev = dev; platform_set_drvdata(pdev, provider); ret = icc_provider_add(provider); From patchwork Mon Sep 13 17:38:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490311 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=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,UPPERCASE_50_75,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 98F39C433EF for ; Mon, 13 Sep 2021 17:42:04 +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 60632610CC for ; Mon, 13 Sep 2021 17:42:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 60632610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nE/8Fb1dOrLtMZUe4wJnmXjsLvQfhbczwQ6jAwv77a4=; b=QA26hc/Q7EaaOF iNbRs3w/NxHOpAZKGjJv+8D5zeoLLOxzhgHNPKYCeXrAobJDiY03mrdQRdlyLAvJIx7tN2pD6d67Q FNrujC3B/qRUa1lHtMEH3KCN6TU1kvA94/HV8AzP9pu7BgnojSiZ90ZqBM8OKGNqWGBimDc84ECUr qPW9IetWBP/KlEEToN/GHznOlIRvY3EgJZIXy7uBLLWi3croTaoZmW4GWuxFghBdsa/uass1PvcXG 5T7YhRo9gPGVz/uJyGUmPHQwvgh8DyM0zbIaP2uvH5DI4G/yhXFyMdGfi2CS+aJ4IUv1NZvK7UjPD DTT9fCofHONec+tql/bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpwM-002kWu-AQ; Mon, 13 Sep 2021 17:40:23 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuY-002jmS-Mi for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:33 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6B4F62005BE; Mon, 13 Sep 2021 19:38:29 +0200 (CEST) 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 5BF812005AC; Mon, 13 Sep 2021 19:38:29 +0200 (CEST) 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 8E9AD20363; Mon, 13 Sep 2021 19:38:28 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 08/19] interconnect: imx8: Remove the imx_icc_node_adj_desc Date: Mon, 13 Sep 2021 20:38:03 +0300 Message-Id: <1631554694-9599-9-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103831_057673_1F8F7CDF X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that the imx generic interconnect doesn't use the imx_icc_node_adj_desc, we remove it from all the i.MX8M platform drivers. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx.h | 19 ++++------------- drivers/interconnect/imx/imx8mm.c | 32 +++++++++------------------- drivers/interconnect/imx/imx8mn.c | 28 +++++++------------------ drivers/interconnect/imx/imx8mq.c | 35 ++++++++++--------------------- 4 files changed, 33 insertions(+), 81 deletions(-) diff --git a/drivers/interconnect/imx/imx.h b/drivers/interconnect/imx/imx.h index 75da51076c68..5c9f5138f6aa 100644 --- a/drivers/interconnect/imx/imx.h +++ b/drivers/interconnect/imx/imx.h @@ -14,15 +14,6 @@ #define IMX_ICC_MAX_LINKS 4 -/* - * struct imx_icc_node_adj - Describe a dynamic adjustable node - */ -struct imx_icc_node_adj_desc { - unsigned int bw_mul, bw_div; - const char *phandle_name; - bool main_noc; -}; - /* * struct imx_icc_node - Describe an interconnect node * @name: name of the node @@ -35,23 +26,21 @@ struct imx_icc_node_desc { u16 id; u16 links[IMX_ICC_MAX_LINKS]; u16 num_links; - const struct imx_icc_node_adj_desc *adj; }; -#define DEFINE_BUS_INTERCONNECT(_name, _id, _adj, ...) \ +#define DEFINE_BUS_INTERCONNECT(_name, _id, ...) \ { \ .id = _id, \ .name = _name, \ - .adj = _adj, \ .num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })), \ .links = { __VA_ARGS__ }, \ } #define DEFINE_BUS_MASTER(_name, _id, _dest_id) \ - DEFINE_BUS_INTERCONNECT(_name, _id, NULL, _dest_id) + DEFINE_BUS_INTERCONNECT(_name, _id, _dest_id) -#define DEFINE_BUS_SLAVE(_name, _id, _adj) \ - DEFINE_BUS_INTERCONNECT(_name, _id, _adj) +#define DEFINE_BUS_SLAVE(_name, _id) \ + DEFINE_BUS_INTERCONNECT(_name, _id) int imx_icc_register(struct platform_device *pdev, struct imx_icc_node_desc *nodes, diff --git a/drivers/interconnect/imx/imx8mm.c b/drivers/interconnect/imx/imx8mm.c index 1083490bb391..0c16110bef9d 100644 --- a/drivers/interconnect/imx/imx8mm.c +++ b/drivers/interconnect/imx/imx8mm.c @@ -14,18 +14,6 @@ #include "imx.h" -static const struct imx_icc_node_adj_desc imx8mm_dram_adj = { - .bw_mul = 1, - .bw_div = 16, - .phandle_name = "fsl,ddrc", -}; - -static const struct imx_icc_node_adj_desc imx8mm_noc_adj = { - .bw_mul = 1, - .bw_div = 16, - .main_noc = true, -}; - /* * Describe bus masters, slaves and connections between them * @@ -33,43 +21,43 @@ static const struct imx_icc_node_adj_desc imx8mm_noc_adj = { * PL301 nics which are skipped/merged into PL301_MAIN */ static struct imx_icc_node_desc nodes[] = { - DEFINE_BUS_INTERCONNECT("NOC", IMX8MM_ICN_NOC, &imx8mm_noc_adj, + DEFINE_BUS_INTERCONNECT("NOC", IMX8MM_ICN_NOC, IMX8MM_ICS_DRAM, IMX8MM_ICN_MAIN), - DEFINE_BUS_SLAVE("DRAM", IMX8MM_ICS_DRAM, &imx8mm_dram_adj), - DEFINE_BUS_SLAVE("OCRAM", IMX8MM_ICS_OCRAM, NULL), + DEFINE_BUS_SLAVE("DRAM", IMX8MM_ICS_DRAM), + DEFINE_BUS_SLAVE("OCRAM", IMX8MM_ICS_OCRAM), DEFINE_BUS_MASTER("A53", IMX8MM_ICM_A53, IMX8MM_ICN_NOC), /* VPUMIX */ DEFINE_BUS_MASTER("VPU H1", IMX8MM_ICM_VPU_H1, IMX8MM_ICN_VIDEO), DEFINE_BUS_MASTER("VPU G1", IMX8MM_ICM_VPU_G1, IMX8MM_ICN_VIDEO), DEFINE_BUS_MASTER("VPU G2", IMX8MM_ICM_VPU_G2, IMX8MM_ICN_VIDEO), - DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MM_ICN_VIDEO, NULL, IMX8MM_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MM_ICN_VIDEO, IMX8MM_ICN_NOC), /* GPUMIX */ DEFINE_BUS_MASTER("GPU 2D", IMX8MM_ICM_GPU2D, IMX8MM_ICN_GPU), DEFINE_BUS_MASTER("GPU 3D", IMX8MM_ICM_GPU3D, IMX8MM_ICN_GPU), - DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MM_ICN_GPU, NULL, IMX8MM_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MM_ICN_GPU, IMX8MM_ICN_NOC), /* DISPLAYMIX */ DEFINE_BUS_MASTER("CSI", IMX8MM_ICM_CSI, IMX8MM_ICN_MIPI), DEFINE_BUS_MASTER("LCDIF", IMX8MM_ICM_LCDIF, IMX8MM_ICN_MIPI), - DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MM_ICN_MIPI, NULL, IMX8MM_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MM_ICN_MIPI, IMX8MM_ICN_NOC), /* HSIO */ DEFINE_BUS_MASTER("USB1", IMX8MM_ICM_USB1, IMX8MM_ICN_HSIO), DEFINE_BUS_MASTER("USB2", IMX8MM_ICM_USB2, IMX8MM_ICN_HSIO), DEFINE_BUS_MASTER("PCIE", IMX8MM_ICM_PCIE, IMX8MM_ICN_HSIO), - DEFINE_BUS_INTERCONNECT("PL301_HSIO", IMX8MM_ICN_HSIO, NULL, IMX8MM_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_HSIO", IMX8MM_ICN_HSIO, IMX8MM_ICN_NOC), /* Audio */ DEFINE_BUS_MASTER("SDMA2", IMX8MM_ICM_SDMA2, IMX8MM_ICN_AUDIO), DEFINE_BUS_MASTER("SDMA3", IMX8MM_ICM_SDMA3, IMX8MM_ICN_AUDIO), - DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MM_ICN_AUDIO, NULL, IMX8MM_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MM_ICN_AUDIO, IMX8MM_ICN_MAIN), /* Ethernet */ DEFINE_BUS_MASTER("ENET", IMX8MM_ICM_ENET, IMX8MM_ICN_ENET), - DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MM_ICN_ENET, NULL, IMX8MM_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MM_ICN_ENET, IMX8MM_ICN_MAIN), /* Other */ DEFINE_BUS_MASTER("SDMA1", IMX8MM_ICM_SDMA1, IMX8MM_ICN_MAIN), @@ -77,7 +65,7 @@ static struct imx_icc_node_desc nodes[] = { DEFINE_BUS_MASTER("USDHC1", IMX8MM_ICM_USDHC1, IMX8MM_ICN_MAIN), DEFINE_BUS_MASTER("USDHC2", IMX8MM_ICM_USDHC2, IMX8MM_ICN_MAIN), DEFINE_BUS_MASTER("USDHC3", IMX8MM_ICM_USDHC3, IMX8MM_ICN_MAIN), - DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MM_ICN_MAIN, NULL, + DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MM_ICN_MAIN, IMX8MM_ICN_NOC, IMX8MM_ICS_OCRAM), }; diff --git a/drivers/interconnect/imx/imx8mn.c b/drivers/interconnect/imx/imx8mn.c index ad97e55fd4e5..8d16bd5cf006 100644 --- a/drivers/interconnect/imx/imx8mn.c +++ b/drivers/interconnect/imx/imx8mn.c @@ -11,18 +11,6 @@ #include "imx.h" -static const struct imx_icc_node_adj_desc imx8mn_dram_adj = { - .bw_mul = 1, - .bw_div = 4, - .phandle_name = "fsl,ddrc", -}; - -static const struct imx_icc_node_adj_desc imx8mn_noc_adj = { - .bw_mul = 1, - .bw_div = 4, - .main_noc = true, -}; - /* * Describe bus masters, slaves and connections between them * @@ -30,23 +18,23 @@ static const struct imx_icc_node_adj_desc imx8mn_noc_adj = { * PL301 nics which are skipped/merged into PL301_MAIN */ static struct imx_icc_node_desc nodes[] = { - DEFINE_BUS_INTERCONNECT("NOC", IMX8MN_ICN_NOC, &imx8mn_noc_adj, + DEFINE_BUS_INTERCONNECT("NOC", IMX8MN_ICN_NOC, IMX8MN_ICS_DRAM, IMX8MN_ICN_MAIN), - DEFINE_BUS_SLAVE("DRAM", IMX8MN_ICS_DRAM, &imx8mn_dram_adj), - DEFINE_BUS_SLAVE("OCRAM", IMX8MN_ICS_OCRAM, NULL), + DEFINE_BUS_SLAVE("DRAM", IMX8MN_ICS_DRAM), + DEFINE_BUS_SLAVE("OCRAM", IMX8MN_ICS_OCRAM), DEFINE_BUS_MASTER("A53", IMX8MN_ICM_A53, IMX8MN_ICN_NOC), /* GPUMIX */ DEFINE_BUS_MASTER("GPU", IMX8MN_ICM_GPU, IMX8MN_ICN_GPU), - DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MN_ICN_GPU, NULL, IMX8MN_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MN_ICN_GPU, IMX8MN_ICN_NOC), /* DISPLAYMIX */ DEFINE_BUS_MASTER("CSI1", IMX8MN_ICM_CSI1, IMX8MN_ICN_MIPI), DEFINE_BUS_MASTER("CSI2", IMX8MN_ICM_CSI2, IMX8MN_ICN_MIPI), DEFINE_BUS_MASTER("ISI", IMX8MN_ICM_ISI, IMX8MN_ICN_MIPI), DEFINE_BUS_MASTER("LCDIF", IMX8MN_ICM_LCDIF, IMX8MN_ICN_MIPI), - DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MN_ICN_MIPI, NULL, IMX8MN_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_MIPI", IMX8MN_ICN_MIPI, IMX8MN_ICN_NOC), /* USB goes straight to NOC */ DEFINE_BUS_MASTER("USB", IMX8MN_ICM_USB, IMX8MN_ICN_NOC), @@ -54,11 +42,11 @@ static struct imx_icc_node_desc nodes[] = { /* Audio */ DEFINE_BUS_MASTER("SDMA2", IMX8MN_ICM_SDMA2, IMX8MN_ICN_AUDIO), DEFINE_BUS_MASTER("SDMA3", IMX8MN_ICM_SDMA3, IMX8MN_ICN_AUDIO), - DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MN_ICN_AUDIO, NULL, IMX8MN_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MN_ICN_AUDIO, IMX8MN_ICN_MAIN), /* Ethernet */ DEFINE_BUS_MASTER("ENET", IMX8MN_ICM_ENET, IMX8MN_ICN_ENET), - DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MN_ICN_ENET, NULL, IMX8MN_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MN_ICN_ENET, IMX8MN_ICN_MAIN), /* Other */ DEFINE_BUS_MASTER("SDMA1", IMX8MN_ICM_SDMA1, IMX8MN_ICN_MAIN), @@ -66,7 +54,7 @@ static struct imx_icc_node_desc nodes[] = { DEFINE_BUS_MASTER("USDHC1", IMX8MN_ICM_USDHC1, IMX8MN_ICN_MAIN), DEFINE_BUS_MASTER("USDHC2", IMX8MN_ICM_USDHC2, IMX8MN_ICN_MAIN), DEFINE_BUS_MASTER("USDHC3", IMX8MN_ICM_USDHC3, IMX8MN_ICN_MAIN), - DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MN_ICN_MAIN, NULL, + DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MN_ICN_MAIN IMX8MN_ICN_NOC, IMX8MN_ICS_OCRAM), }; diff --git a/drivers/interconnect/imx/imx8mq.c b/drivers/interconnect/imx/imx8mq.c index d7768d3c6d8a..b8c36d668946 100644 --- a/drivers/interconnect/imx/imx8mq.c +++ b/drivers/interconnect/imx/imx8mq.c @@ -12,18 +12,6 @@ #include "imx.h" -static const struct imx_icc_node_adj_desc imx8mq_dram_adj = { - .bw_mul = 1, - .bw_div = 4, - .phandle_name = "fsl,ddrc", -}; - -static const struct imx_icc_node_adj_desc imx8mq_noc_adj = { - .bw_mul = 1, - .bw_div = 4, - .main_noc = true, -}; - /* * Describe bus masters, slaves and connections between them * @@ -31,43 +19,42 @@ static const struct imx_icc_node_adj_desc imx8mq_noc_adj = { * PL301 nics which are skipped/merged into PL301_MAIN */ static struct imx_icc_node_desc nodes[] = { - DEFINE_BUS_INTERCONNECT("NOC", IMX8MQ_ICN_NOC, &imx8mq_noc_adj, - IMX8MQ_ICS_DRAM, IMX8MQ_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("NOC", IMX8MQ_ICN_NOC, IMX8MQ_ICS_DRAM, IMX8MQ_ICN_MAIN), - DEFINE_BUS_SLAVE("DRAM", IMX8MQ_ICS_DRAM, &imx8mq_dram_adj), - DEFINE_BUS_SLAVE("OCRAM", IMX8MQ_ICS_OCRAM, NULL), + DEFINE_BUS_SLAVE("DRAM", IMX8MQ_ICS_DRAM), + DEFINE_BUS_SLAVE("OCRAM", IMX8MQ_ICS_OCRAM), DEFINE_BUS_MASTER("A53", IMX8MQ_ICM_A53, IMX8MQ_ICN_NOC), /* VPUMIX */ DEFINE_BUS_MASTER("VPU", IMX8MQ_ICM_VPU, IMX8MQ_ICN_VIDEO), - DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MQ_ICN_VIDEO, NULL, IMX8MQ_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_VIDEO", IMX8MQ_ICN_VIDEO, IMX8MQ_ICN_NOC), /* GPUMIX */ DEFINE_BUS_MASTER("GPU", IMX8MQ_ICM_GPU, IMX8MQ_ICN_GPU), - DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MQ_ICN_GPU, NULL, IMX8MQ_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_GPU", IMX8MQ_ICN_GPU, IMX8MQ_ICN_NOC), /* DISPMIX (only for DCSS) */ DEFINE_BUS_MASTER("DC", IMX8MQ_ICM_DCSS, IMX8MQ_ICN_DCSS), - DEFINE_BUS_INTERCONNECT("PL301_DC", IMX8MQ_ICN_DCSS, NULL, IMX8MQ_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_DC", IMX8MQ_ICN_DCSS, IMX8MQ_ICN_NOC), /* USBMIX */ DEFINE_BUS_MASTER("USB1", IMX8MQ_ICM_USB1, IMX8MQ_ICN_USB), DEFINE_BUS_MASTER("USB2", IMX8MQ_ICM_USB2, IMX8MQ_ICN_USB), - DEFINE_BUS_INTERCONNECT("PL301_USB", IMX8MQ_ICN_USB, NULL, IMX8MQ_ICN_NOC), + DEFINE_BUS_INTERCONNECT("PL301_USB", IMX8MQ_ICN_USB, IMX8MQ_ICN_NOC), /* PL301_DISPLAY (IPs other than DCSS, inside SUPERMIX) */ DEFINE_BUS_MASTER("CSI1", IMX8MQ_ICM_CSI1, IMX8MQ_ICN_DISPLAY), DEFINE_BUS_MASTER("CSI2", IMX8MQ_ICM_CSI2, IMX8MQ_ICN_DISPLAY), DEFINE_BUS_MASTER("LCDIF", IMX8MQ_ICM_LCDIF, IMX8MQ_ICN_DISPLAY), - DEFINE_BUS_INTERCONNECT("PL301_DISPLAY", IMX8MQ_ICN_DISPLAY, NULL, IMX8MQ_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("PL301_DISPLAY", IMX8MQ_ICN_DISPLAY, IMX8MQ_ICN_MAIN), /* AUDIO */ DEFINE_BUS_MASTER("SDMA2", IMX8MQ_ICM_SDMA2, IMX8MQ_ICN_AUDIO), - DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MQ_ICN_AUDIO, NULL, IMX8MQ_ICN_DISPLAY), + DEFINE_BUS_INTERCONNECT("PL301_AUDIO", IMX8MQ_ICN_AUDIO, IMX8MQ_ICN_DISPLAY), /* ENET */ DEFINE_BUS_MASTER("ENET", IMX8MQ_ICM_ENET, IMX8MQ_ICN_ENET), - DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MQ_ICN_ENET, NULL, IMX8MQ_ICN_MAIN), + DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MQ_ICN_ENET, IMX8MQ_ICN_MAIN), /* OTHER */ DEFINE_BUS_MASTER("SDMA1", IMX8MQ_ICM_SDMA1, IMX8MQ_ICN_MAIN), @@ -76,7 +63,7 @@ static struct imx_icc_node_desc nodes[] = { DEFINE_BUS_MASTER("USDHC2", IMX8MQ_ICM_USDHC2, IMX8MQ_ICN_MAIN), DEFINE_BUS_MASTER("PCIE1", IMX8MQ_ICM_PCIE1, IMX8MQ_ICN_MAIN), DEFINE_BUS_MASTER("PCIE2", IMX8MQ_ICM_PCIE2, IMX8MQ_ICN_MAIN), - DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MQ_ICN_MAIN, NULL, + DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MQ_ICN_MAIN, IMX8MQ_ICN_NOC, IMX8MQ_ICS_OCRAM), }; From patchwork Mon Sep 13 17:38:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490313 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75, 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 C12F6C433F5 for ; Mon, 13 Sep 2021 17:43:13 +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 87E7460E9C for ; Mon, 13 Sep 2021 17:43:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 87E7460E9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MByxxNsofWPZD0BlXrpRkqCGZ1Rt/ZCk+mnJp9N6xOs=; b=cZUWvGqTgSPaIE TKiXFVDPdKG4uVHp7nIFom10TbzOg/UUPNnDA5FNRc+WWxY5IVLrB0lFglXnI+5ExDWT6Y118U84I cV6+EDwpVbSz8frTRxmLC3KlGGFqJ0ZPFo9jhQ3BIblCojU6TGGmMDslZrnwIvTyw/fOyz72ueYbN SAgI8JGsLPcJ63q6DSLDXRZLRgudi95Z8Ny/MVvpg3ICbffw7mw1abglJ0yx8ZzPp92IV2X3dchIl Prx+/wCOX8hFXUH3ii7+yHtZ7FraI2u7yX/SJqjnZGKAQOOzM0vFbopSLzBeOUBiScuAzd0WmB8MD uLiCw0nHbXTyIdeWrL5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpwr-002koS-L2; Mon, 13 Sep 2021 17:40:54 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuZ-002jmt-IV for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:33 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 498691A0394; Mon, 13 Sep 2021 19:38:30 +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 3AF011A038F; Mon, 13 Sep 2021 19:38:30 +0200 (CEST) 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 6CCDA20363; Mon, 13 Sep 2021 19:38:29 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 09/19] interconnect: imx8mq: Add the pl301_per_m and pl301_wakeup nodes and subnodes Date: Mon, 13 Sep 2021 20:38:04 +0300 Message-Id: <1631554694-9599-10-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103831_798962_1465F867 X-CRM114-Status: GOOD ( 12.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org According to the bus diagram, there are two more pl301s that need to be added here. The pl301_per_m which is an intermediary node between pl301_main and its masters: usdhc1, usdhc2 and sdma. The pl301_wakeup is an intermediary node between pl301_main and its masters, in this case all the SAIs. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx8mq.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/interconnect/imx/imx8mq.c b/drivers/interconnect/imx/imx8mq.c index b8c36d668946..010ad3d76286 100644 --- a/drivers/interconnect/imx/imx8mq.c +++ b/drivers/interconnect/imx/imx8mq.c @@ -57,14 +57,25 @@ static struct imx_icc_node_desc nodes[] = { DEFINE_BUS_INTERCONNECT("PL301_ENET", IMX8MQ_ICN_ENET, IMX8MQ_ICN_MAIN), /* OTHER */ - DEFINE_BUS_MASTER("SDMA1", IMX8MQ_ICM_SDMA1, IMX8MQ_ICN_MAIN), DEFINE_BUS_MASTER("NAND", IMX8MQ_ICM_NAND, IMX8MQ_ICN_MAIN), - DEFINE_BUS_MASTER("USDHC1", IMX8MQ_ICM_USDHC1, IMX8MQ_ICN_MAIN), - DEFINE_BUS_MASTER("USDHC2", IMX8MQ_ICM_USDHC2, IMX8MQ_ICN_MAIN), DEFINE_BUS_MASTER("PCIE1", IMX8MQ_ICM_PCIE1, IMX8MQ_ICN_MAIN), DEFINE_BUS_MASTER("PCIE2", IMX8MQ_ICM_PCIE2, IMX8MQ_ICN_MAIN), DEFINE_BUS_INTERCONNECT("PL301_MAIN", IMX8MQ_ICN_MAIN, IMX8MQ_ICN_NOC, IMX8MQ_ICS_OCRAM), + DEFINE_BUS_MASTER("SDMA1", IMX8MQ_ICM_SDMA1, IMX8MQ_ICN_PER_M), + DEFINE_BUS_MASTER("USDHC1", IMX8MQ_ICM_USDHC1, IMX8MQ_ICN_PER_M), + DEFINE_BUS_MASTER("USDHC2", IMX8MQ_ICM_USDHC2, IMX8MQ_ICN_PER_M), + DEFINE_BUS_INTERCONNECT("PL301_PER_M", IMX8MQ_ICN_PER_M, + IMX8MQ_ICN_MAIN), + + DEFINE_BUS_MASTER("SAI1", IMX8MQ_ICM_SAI1, IMX8MQ_ICN_WAKEUP), + DEFINE_BUS_MASTER("SAI2", IMX8MQ_ICM_SAI2, IMX8MQ_ICN_WAKEUP), + DEFINE_BUS_MASTER("SAI3", IMX8MQ_ICM_SAI3, IMX8MQ_ICN_WAKEUP), + DEFINE_BUS_MASTER("SAI4", IMX8MQ_ICM_SAI4, IMX8MQ_ICN_WAKEUP), + DEFINE_BUS_MASTER("SAI5", IMX8MQ_ICM_SAI5, IMX8MQ_ICN_WAKEUP), + DEFINE_BUS_MASTER("SAI6", IMX8MQ_ICM_SAI6, IMX8MQ_ICN_WAKEUP), + DEFINE_BUS_INTERCONNECT("PL301_WAKEUP", IMX8MQ_ICN_WAKEUP, + IMX8MQ_ICN_MAIN), }; static int imx8mq_icc_probe(struct platform_device *pdev) From patchwork Mon Sep 13 17:38:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490333 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 EC7B5C433F5 for ; Mon, 13 Sep 2021 17:44:12 +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 AF007610CE for ; Mon, 13 Sep 2021 17:44:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AF007610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4ZBjiRGt2cDPwKEeMRqtAiWM4N5uo3zQ1l0DbxqDEvU=; b=0dzasXRermIO2Q uYmaP6djq9GyjkH6KXQjQdtfORFPf+HAko9KPKFDfYoOdhyzXMSHTuQ/Q7Nb7KQlEpgq0wb3Q/OJ8 ukBMp2Sf2Z8FTzcttyXkXqXB485kEufyhE2bLeFLvV9QmlcOnuHNFbwZZe6gIQ0de+UmDJDNQs4YA HRptAuVvE5WwNub+GWtEK3RPMkDXASGf/jVSQKJ+DLgl0L3aM9SK0JXtd8NzwZdcF/DuV4CPT/KeZ fEyr/bsNtIqKz13k6ThqVsozweGBA0x2dE26cCgdWSLK/p02sdPhKVPaFCGgkFIr2vn1/rCo89QxF yMo1QqPJILJnIU75WivA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpy1-002lYr-O4; Mon, 13 Sep 2021 17:42:07 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpua-002jnV-EU for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:33 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3085B1A038F; Mon, 13 Sep 2021 19:38:31 +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 2327D1A010C; Mon, 13 Sep 2021 19:38:31 +0200 (CEST) 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 4C21E20363; Mon, 13 Sep 2021 19:38:30 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 10/19] interconnect: imx8mq: Add of_match_table Date: Mon, 13 Sep 2021 20:38:05 +0300 Message-Id: <1631554694-9599-11-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103832_672014_E510E70D X-CRM114-Status: GOOD ( 13.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The i.MX8MQ driver will probe based on the compatible string instead of using device data in imx-bus devfreq driver. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx8mq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/interconnect/imx/imx8mq.c b/drivers/interconnect/imx/imx8mq.c index 010ad3d76286..64321f1d323b 100644 --- a/drivers/interconnect/imx/imx8mq.c +++ b/drivers/interconnect/imx/imx8mq.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -88,12 +89,18 @@ static int imx8mq_icc_remove(struct platform_device *pdev) return imx_icc_unregister(pdev); } +static const struct of_device_id imx8mq_icc_of_match[] = { + { .compatible = "fsl,imx8mq-icc" }, + { /* sentinel */ }, +}; + static struct platform_driver imx8mq_icc_driver = { .probe = imx8mq_icc_probe, .remove = imx8mq_icc_remove, .driver = { .name = "imx8mq-interconnect", .sync_state = icc_sync_state, + .of_match_table = of_match_ptr(imx8mq_icc_of_match), }, }; From patchwork Mon Sep 13 17:38:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490335 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 4EC42C433EF for ; Mon, 13 Sep 2021 17:45:13 +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 17C4D610CE for ; Mon, 13 Sep 2021 17:45:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 17C4D610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=38QnYus2U5h8dAtsX/77C8Bagk7qTCp9WzWugRMmUnU=; b=WYgzzPPugxV/Hw bIet6rV5sCm84boWC1qjbJ4dqNsY9BeXAROoZYvwL2jfHQ09rmm1JHFJbiarxvAZ5lZG6Z0fyOuMf oQ0aRL8S6oOfM327WJlhchgU5jMhpRJYlBAymmxPgF5kugGRZq2URWQhMdgSiJhxmFTzifM0BbP7u TCPYS3srnHKjGZM9VI4JQ7m0eNmVE+wHVTTzoKVUikyXzDb6lH7QcA3DBB0+0hohuAaIQqylHrlpB NdRq09BXK52AC2QDvz6pu90nehFnHkRiGdHNAseQjRtbyEBlNl+vmF3TZmlgPJrPkVwd7KnC9oy7B rmQRQ49MOhzLQJSBDZZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpyb-002lvT-OR; Mon, 13 Sep 2021 17:42:42 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpub-002jnp-A1 for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:34 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 101E11A0396; Mon, 13 Sep 2021 19:38:32 +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 0261E1A0393; Mon, 13 Sep 2021 19:38:32 +0200 (CEST) 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 34AC320363; Mon, 13 Sep 2021 19:38:31 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 11/19] interconnect: imx: Add imx_icc_get_bw and imx_icc_aggregate functions Date: Mon, 13 Sep 2021 20:38:06 +0300 Message-Id: <1631554694-9599-12-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103833_546191_D30EEA23 X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The aggregate function will return whatever is the highest rate for that specific node. The imx_icc_get_bw sets the initial avg and peak to 0 in order to avoid setting them to INT_MAX by the interconnect core. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index db048df80011..5cc1ce55406c 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -25,6 +25,23 @@ struct imx_icc_node { struct dev_pm_qos_request qos_req; }; +static int imx_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak) +{ + *avg = 0; + *peak = 0; + + return 0; +} + +static int imx_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) +{ + *agg_avg = max(*agg_avg, avg_bw); + *agg_peak = max(*agg_peak, peak_bw); + + return 0; +} + static int imx_icc_node_set(struct icc_node *node) { struct device *dev = node->provider->dev; @@ -233,7 +250,8 @@ int imx_icc_register(struct platform_device *pdev, if (!provider) return -ENOMEM; provider->set = imx_icc_set; - provider->aggregate = icc_std_aggregate; + provider->get_bw = imx_icc_get_bw; + provider->aggregate = imx_icc_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data; provider->dev = dev; From patchwork Mon Sep 13 17:38:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490337 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 D17C7C433F5 for ; Mon, 13 Sep 2021 17:45:53 +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 A1CE4610CE for ; Mon, 13 Sep 2021 17:45:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1CE4610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SzX6ccdVieLiv85BMhscoUMWbbOB0b4Y6p7qYRyI8iA=; b=GbNabcBJE2t/sc bqbXpGugGKoAXWMRKDTs0A7JFP0OaveuFAw6P0zJumwn+C23xYK9AmMe9kTNNXyQdcmEGN/q5tx1a lAMT7ZhxsGfFkqtWo7OXYaJ2EYM91Xk36Sg4T8yxse8MAHI1UqaWNKuK3CuglYxW8JVz3CUSAL0jL pwq4YP3Vp4AoutreJqyxcjOYTltajrzagOAc/Cpx947Ifj5X/kgW9zwZouv85S2269nbXLNFpXtPr gxP0ryjkyKfCe/fmmtnj2MP7d4XCp6+I/QDxGrHAVBvOi+ippsTT2TBf1DDobJqm6hO7ht8PUsZOx hexlIJeJ2W7QKllTKIvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpzJ-002mEQ-KD; Mon, 13 Sep 2021 17:43:26 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuc-002joQ-9D for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:35 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0CA751A0397; Mon, 13 Sep 2021 19:38:33 +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 EA37D1A010C; Mon, 13 Sep 2021 19:38:32 +0200 (CEST) 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 131AA20363; Mon, 13 Sep 2021 19:38:32 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 12/19] arm64: dts: imx8mq: Add fsl,icc-id property to ddrc node Date: Mon, 13 Sep 2021 20:38:07 +0300 Message-Id: <1631554694-9599-13-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103834_504582_04431F63 X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The fsl,icc-id property here is used to link the icc node registered by the imx8mq interconnect driver with the ddrc device. Signed-off-by: Abel Vesa --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index 4066b1612655..8ddbeaddf55a 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1552,10 +1552,12 @@ ddrc: memory-controller@3d400000 { compatible = "fsl,imx8mq-ddrc", "fsl,imx8m-ddrc"; reg = <0x3d400000 0x400000>; clock-names = "core", "pll", "alt", "apb"; + fsl,icc-id = ; clocks = <&clk IMX8MQ_CLK_DRAM_CORE>, <&clk IMX8MQ_DRAM_PLL_OUT>, <&clk IMX8MQ_CLK_DRAM_ALT>, <&clk IMX8MQ_CLK_DRAM_APB>; + #interconnect-cells = <0>; }; ddr-pmu@3d800000 { From patchwork Mon Sep 13 17:38:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490339 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 BEF79C433EF for ; Mon, 13 Sep 2021 17:46:24 +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 88D31610CE for ; Mon, 13 Sep 2021 17:46:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 88D31610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/dJdI1xZGve4CPksz5iXnwTD5+QDhTywm50gTvXoooE=; b=GiIFOeK5dlDXFh ShlYvWIWWUUN8QsG7PmLlEqeLEyvI7V0AQjks0a6lNU+S39ijqZ/u18z9qz46KZT40wNrfsK1g9wG QLKARk5UWx/tOYq4/OjRBkFNwotcidbfzwOr+lW0FbFdn/ROQ8+AshgRrhEbmTuyxfmU491QdEYi8 AqfVFp6E7Cp0g5qJhrSQXc9YGO+J0tfOK6nd09RU4ApF05b1sFpZaV7Hya5wTfk7y3f7rQijMwhHF ROrn8cGP2v5zsmIV4ZyVBpd9JisspsIreoDh33X2oh8NA6trL2S26e+xHXvW0q7XY8PHlb/KhEl/q MyVIMiuPA7bBlL4cKxew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpzz-002mZw-94; Mon, 13 Sep 2021 17:44:07 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpud-002joq-3s for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:36 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D73F32005BE; Mon, 13 Sep 2021 19:38:33 +0200 (CEST) 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 C9DB12005AC; Mon, 13 Sep 2021 19:38:33 +0200 (CEST) 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 F2A1F2039E; Mon, 13 Sep 2021 19:38:32 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 13/19] arm64: dts: imx8mq: Add fsl,icc-id to noc node Date: Mon, 13 Sep 2021 20:38:08 +0300 Message-Id: <1631554694-9599-14-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103835_351061_22887258 X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The fsl,icc-id property here is used to link the icc node registered by the imx8mq interconnect driver with the noc device. Remove the fsl,ddrc property since it will not be used anymore. Signed-off-by: Abel Vesa --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index 8ddbeaddf55a..ab528665a217 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1298,11 +1298,11 @@ fec1: ethernet@30be0000 { }; }; - noc: interconnect@32700000 { + noc: noc@32700000 { compatible = "fsl,imx8mq-noc", "fsl,imx8m-noc"; reg = <0x32700000 0x100000>; clocks = <&clk IMX8MQ_CLK_NOC>; - fsl,ddrc = <&ddrc>; + fsl,icc-id = ; #interconnect-cells = <1>; operating-points-v2 = <&noc_opp_table>; From patchwork Mon Sep 13 17:38:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490341 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 3AA82C433EF for ; Mon, 13 Sep 2021 17:47:25 +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 01C8E610CC for ; Mon, 13 Sep 2021 17:47:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 01C8E610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eWGDUaMi9Hw5BGgOCWx31+MjXInloPSDtO2+b4pdkSI=; b=DBXUa6/f88TaVj ckkphLTy0VbXIdACiGGTo9U5tKa5G1YUymUEKXRiiLOHuYlsuR5v5Bl+dsyEzUUN4Nb0Bl4U1FFoC 0e461SLyB/gWc5E/Bn+U81uKq1tpQ5/FheNKbh+52CXPUHHMT8pV81Ex28u7hMXAmlDxRnRthMnZV Addr0lyX9LmuZxb5lYKX7boCZFssC4xxRRIW2I8alC+mJ0bSh+n6+j5yfmbe0nHBhL98144T+UddP PDdnkoJ1/j1VBtPGYG2H7nDF8o1rW6yivonjcfI+RQ+8STvP2jVBsqrd05G21qhvSmJ+5e/PeNdmT fvCzFzKznmPfNKMwUofQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPq0s-002mwg-Vz; Mon, 13 Sep 2021 17:45:03 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpud-002jpG-Ty for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:37 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B7BE31A0393; Mon, 13 Sep 2021 19:38:34 +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 AA73A1A038F; Mon, 13 Sep 2021 19:38:34 +0200 (CEST) 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 DA8BE20363; Mon, 13 Sep 2021 19:38:33 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 14/19] arm64: dts: imx8mq: Add all pl301 nodes Date: Mon, 13 Sep 2021 20:38:09 +0300 Message-Id: <1631554694-9599-15-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103836_300422_28301E06 X-CRM114-Status: GOOD ( 10.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add all the pl301s found on i.MX8MQ, according to the bus diagram. Each pl301 has its own clock, icc id and opp table. They are probed by the imx-bus driver. Signed-off-by: Abel Vesa --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 202 ++++++++++++++++++++++ 1 file changed, 202 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index ab528665a217..a05bccbb1342 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1566,5 +1566,207 @@ ddr-pmu@3d800000 { interrupt-parent = <&gic>; interrupts = ; }; + + pl301_main: pl301@0 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_MAIN_AXI>; + operating-points-v2 = <&pl301_main_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_main_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-133M { + opp-hz = /bits/ 64 <133333333>; + }; + opp-333M { + opp-hz = /bits/ 64 <333333333>; + }; + }; + }; + + pl301_enet: pl301@1 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_ENET_AXI>; + operating-points-v2 = <&pl301_enet_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_enet_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-266M { + opp-hz = /bits/ 64 <266666666>; + }; + }; + }; + + pl301_gpu: pl301@2 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_GPU_AXI>; + operating-points-v2 = <&pl301_gpu_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_gpu_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-800M { + opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + + pl301_dc: pl301@3 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_DISP_AXI>; + operating-points-v2 = <&pl301_dc_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_dc_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-800M { + opp-hz = /bits/ 64 <800000000>; + }; + }; + }; + + /* PL301_DISPLAY (IPs other than DCSS, inside SUPERMIX) */ + pl301_display: pl301@4 { + compatible = "fsl,imx8m-nic"; + /* FIXME: don't know which clock yet */ + clocks = <&clk IMX8MQ_CLK_DUMMY>; + operating-points-v2 = <&pl301_display_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_display_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-333M { + opp-hz = /bits/ 64 <333333333>; + }; + }; + }; + + pl301_audio: pl301@5 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_AUDIO_AHB>; + operating-points-v2 = <&pl301_audio_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_audio_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-500M { + opp-hz = /bits/ 64 <500000000>; + }; + }; + }; + + pl301_video: pl301@6 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_VPU_BUS>; + operating-points-v2 = <&pl301_video_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_video_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-500M { + opp-hz = /bits/ 64 <500000000>; + }; + }; + }; + + pl301_usb: pl301@7 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_USB_BUS>; + operating-points-v2 = <&pl301_usb_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_usb_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-128M { + opp-hz = /bits/ 64 <128000000>; + }; + opp-500M { + opp-hz = /bits/ 64 <500000000>; + }; + }; + }; + + pl301_wakeup: pl301@8 { + compatible = "fsl,imx8m-nic"; + /* FIXME: don't know which clock yet */ + clocks = <&clk IMX8MQ_CLK_DUMMY>; + operating-points-v2 = <&pl301_wakeup_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_wakeup_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-133M { + opp-hz = /bits/ 64 <133333333>; + }; + }; + }; + + pl301_per_m: pl301@9 { + compatible = "fsl,imx8m-nic"; + clocks = <&clk IMX8MQ_CLK_NAND_USDHC_BUS>; + operating-points-v2 = <&pl301_per_m_opp_table>; + #interconnect-cells = <0>; + fsl,icc-id = ; + + pl301_per_m_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-25M { + opp-hz = /bits/ 64 <25000000>; + }; + opp-133M { + opp-hz = /bits/ 64 <133333333>; + }; + opp-266M { + opp-hz = /bits/ 64 <266666666>; + }; + }; + }; }; }; From patchwork Mon Sep 13 17:38:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490343 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 5BD74C433EF for ; Mon, 13 Sep 2021 17:48:06 +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 2C057610CC for ; Mon, 13 Sep 2021 17:48:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C057610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wLV7c801a7b7a1Kpk0YzRBrp/8yxFRZFcB9IXRbygjI=; b=idUfqM3nn8fzNw 2T0DOZjCYMT2EtFlqkszHDJYNgLQqFZWtpSXjJKZJo2ACOCpDwwjxyi2Ey9x1/Sc3cyqgPpS9vi4x 9uKyuusfG31WhvFp5cnrNsQHLfcxkxUnPboUo4tHsGPtadzFfv39QJVCYI4f/q5OLSrUMEeLIoGGp nEkzShdk8OCC9AmN39pLOBdtqLeo0bnH+PRuTbjkqhfVkzkuLx1bguk4j/IdT8qf23UEeC7tcBIy5 lL9sbQzd3Jn8c0b/H3iszwqUXpBGSy33s3UdsAaO9beQ60QXD6gezAmT0v0veFzfxDoltDU3cxIS0 2oDBEcMo3BI/EwOpI7kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPq1i-002nNJ-5w; Mon, 13 Sep 2021 17:45:54 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpue-002jpl-Si for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:38 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A0CDC2005E2; Mon, 13 Sep 2021 19:38:35 +0200 (CEST) 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 92E802005AC; Mon, 13 Sep 2021 19:38:35 +0200 (CEST) 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 BBCFD20363; Mon, 13 Sep 2021 19:38:34 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 15/19] arm64: dts: imx8mq: Add the interconnect node Date: Mon, 13 Sep 2021 20:38:10 +0300 Message-Id: <1631554694-9599-16-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103837_120709_16C6ABD0 X-CRM114-Status: GOOD ( 11.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The icc node will be probed by the imx8mq interconnect driver. Will look-up the NoC and all the pl301s (identified by fsl,icc-id property) and will assign the corresponding icc node to each one of them. Then, it will register the icc provider. Signed-off-by: Abel Vesa --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index a05bccbb1342..5a73ebda6bb3 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1768,5 +1768,10 @@ opp-266M { }; }; }; + + icc: interconnect@0 { + compatible = "fsl,imx8mq-icc", "fsl,imx8m-icc"; + #interconnect-cells = <1>; + }; }; }; From patchwork Mon Sep 13 17:38:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490345 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 2B73AC433F5 for ; Mon, 13 Sep 2021 17:49:14 +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 E79B6610CC for ; Mon, 13 Sep 2021 17:49:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E79B6610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tDYYHJniHMxnZKqi/qsPHSLfx9ayyaanSYj246in7Dk=; b=bfO3MfCPZZ9q4s 62kwQ6pEFHuWpEiZi0TmQjOoZ06cs7gCR0W13NpxSH+qXzfjGQ+vv3KrURcqFdXRvOVcQ+Fzvt/OQ 0PSpiPfzLxiKMYc7kUHO6MojEDN90OyKFJcaQotq/H5/8MnT8kCEohc+lOcaHZejb7MSC+xrDQ4yn BhTbm/uKk6Nvop0+SvJgL4JenaiyQ6P+HU1kdFOn1wpUX410Jz/lWuuwtk9M7FVRqNI/L/Pic7tP7 a7gEuy+7Sg9lLwTL6lOk9P/hUb+9IIC6IpfB8kzbmMdFbRrhfKrWfUsSfI83Xh8NxE3nF1ExYHCrV 7YLM6hxmrsn3ko4Yvr4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPq2o-002nsT-8o; Mon, 13 Sep 2021 17:47:03 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuf-002jqD-QV for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:39 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 882BC2005D5; Mon, 13 Sep 2021 19:38:36 +0200 (CEST) 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 7060A2005AC; Mon, 13 Sep 2021 19:38:36 +0200 (CEST) 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 A25C620363; Mon, 13 Sep 2021 19:38:35 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 16/19] arm64: dts: imx8mq: Add interconnect properties to icc consumer nodes Date: Mon, 13 Sep 2021 20:38:11 +0300 Message-Id: <1631554694-9599-17-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103838_038372_C03FDC1D X-CRM114-Status: GOOD ( 10.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We add all the properties necessary to control the interconnect based on the required rates all the way from consumers to the dram. The fsl,icc-rate specifies the minimum required rate the consumer needs in order to operate. For now, only the fec, usdhc1 and usdhc2 are added as consumers. Signed-off-by: Abel Vesa --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index 5a73ebda6bb3..0489f7416993 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1215,6 +1215,9 @@ usdhc1: mmc@30b40000 { "fsl,imx7d-usdhc"; reg = <0x30b40000 0x10000>; interrupts = ; + interconnects = <&icc IMX8MQ_ICM_USDHC1 &icc IMX8MQ_ICS_DRAM>; + interconnect-names = "path"; + fsl,icc-rate = <266666>; clocks = <&clk IMX8MQ_CLK_IPG_ROOT>, <&clk IMX8MQ_CLK_NAND_USDHC_BUS>, <&clk IMX8MQ_CLK_USDHC1_ROOT>; @@ -1230,6 +1233,9 @@ usdhc2: mmc@30b50000 { "fsl,imx7d-usdhc"; reg = <0x30b50000 0x10000>; interrupts = ; + interconnects = <&icc IMX8MQ_ICM_USDHC2 &icc IMX8MQ_ICS_DRAM>; + interconnect-names = "path"; + fsl,icc-rate = <266666>; clocks = <&clk IMX8MQ_CLK_IPG_ROOT>, <&clk IMX8MQ_CLK_NAND_USDHC_BUS>, <&clk IMX8MQ_CLK_USDHC2_ROOT>; @@ -1272,6 +1278,9 @@ fec1: ethernet@30be0000 { , , ; + interconnects = <&icc IMX8MQ_ICM_ENET &icc IMX8MQ_ICS_DRAM>; + interconnect-names = "path"; + fsl,icc-rate = <800000>; clocks = <&clk IMX8MQ_CLK_ENET1_ROOT>, <&clk IMX8MQ_CLK_ENET1_ROOT>, <&clk IMX8MQ_CLK_ENET_TIMER>, From patchwork Mon Sep 13 17:38:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490347 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 527D5C433EF for ; Mon, 13 Sep 2021 17:50:27 +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 2A1A3610CF for ; Mon, 13 Sep 2021 17:50:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2A1A3610CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cjo3eM0tDnJR/90y0+vk7CngwGf2UIA+qWjtIBg3P58=; b=T9w/TFiQsf++CB ux9UMU8WtmJ9lIrIS4ABdT3d9toBT7RuC2JjASO95QMyj+ciHV/RZDSLrI4AZKcWbynkSQcyxPtSK ZAChjeroaiyZ91/WCzoWObQmTORRFHZFk9XooGEfmxapwx8RZxoHY2RGrx+MZaL0x8k0zAcv4JT81 N0RfCygyZvLKGL1KStFJ+qu/xnmK5q1lh76vSky04y3rQBJtMVOsF2zGXuaXnaiCuNTogjst5qqbq 3Iiy7VX/6kEs3ffbkFT4pl2r+K+dJF3wXKuKfBy7VznqcydG21hGSWvxVKOpl25XBIYK74vRvvtAT TxexaUSk3zzOB4rjSW+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPq3t-002oLX-Cv; Mon, 13 Sep 2021 17:48:09 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpug-002jqf-Kv for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:40 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 674092005AC; Mon, 13 Sep 2021 19:38:37 +0200 (CEST) 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 4F5EE2005E6; Mon, 13 Sep 2021 19:38:37 +0200 (CEST) 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 80C6820363; Mon, 13 Sep 2021 19:38:36 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 17/19] net: ethernet: fec_main: Add interconnect support Date: Mon, 13 Sep 2021 20:38:12 +0300 Message-Id: <1631554694-9599-18-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103839_010131_1F2E8932 X-CRM114-Status: GOOD ( 18.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On probe, if the dts node contains a valid icc path, then look for the fsl,icc-rate property and get the rate. Also set the icc bandwidth for that path to the nominal rate needed for fec to function right. Then enable and disable the path every time the fec is used or not. This will result in reducing the clock speeds along the icc path for each pl301 and NoC, but still meet the requirements for all the other icc consumers. Signed-off-by: Abel Vesa --- drivers/net/ethernet/freescale/fec.h | 3 +++ drivers/net/ethernet/freescale/fec_main.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 7b4961daa254..2c5784febbeb 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -558,6 +558,9 @@ struct fec_enet_private { unsigned int num_tx_queues; unsigned int num_rx_queues; + struct icc_path *bus_path; + unsigned int bus_rate; + /* The saved address of a sent-in-place packet/buffer, for skfree(). */ struct fec_enet_priv_tx_q *tx_queue[FEC_ENET_MAX_TX_QS]; struct fec_enet_priv_rx_q *rx_queue[FEC_ENET_MAX_RX_QS]; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 80bd5c629fa0..67374d436e73 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -3805,6 +3806,18 @@ fec_probe(struct platform_device *pdev) fep->pdev = pdev; fep->dev_id = dev_id++; + fep->bus_path = devm_of_icc_get(&pdev->dev, "path"); + if (IS_ERR(fep->bus_path)) { + return PTR_ERR(fep->bus_path); + } else if (fep->bus_path) { + if (of_property_read_u32(np, "fsl,icc-rate", &fep->bus_rate)) { + dev_err(&pdev->dev, "icc-rate missing\n"); + return -EINVAL; + } + + icc_set_bw(fep->bus_path, 0, fep->bus_rate); + } + platform_set_drvdata(pdev, ndev); if ((of_machine_is_compatible("fsl,imx6q") || @@ -4075,6 +4088,8 @@ static int __maybe_unused fec_suspend(struct device *dev) if (fep->clk_enet_out || fep->reg_phy) fep->link = 0; + icc_disable(fep->bus_path); + return 0; } @@ -4085,6 +4100,8 @@ static int __maybe_unused fec_resume(struct device *dev) int ret; int val; + icc_enable(fep->bus_path); + if (fep->reg_phy && !(fep->wol_flag & FEC_WOL_FLAG_ENABLE)) { ret = regulator_enable(fep->reg_phy); if (ret) @@ -4134,6 +4151,7 @@ static int __maybe_unused fec_runtime_suspend(struct device *dev) clk_disable_unprepare(fep->clk_ahb); clk_disable_unprepare(fep->clk_ipg); + icc_disable(fep->bus_path); return 0; } @@ -4143,6 +4161,7 @@ static int __maybe_unused fec_runtime_resume(struct device *dev) struct fec_enet_private *fep = netdev_priv(ndev); int ret; + icc_enable(fep->bus_path); ret = clk_prepare_enable(fep->clk_ahb); if (ret) return ret; From patchwork Mon Sep 13 17:38:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490349 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 8D285C433F5 for ; Mon, 13 Sep 2021 17:51:24 +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 57E6660EB4 for ; Mon, 13 Sep 2021 17:51:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 57E6660EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tBZhnmaivhMge+W5gWY2x350l09P2NFDID00Aa28Tto=; b=RCX6wWLd4maeDT 93rn9aTqjKR48713UzZIpLZ6xYP7fbMN2OYsW2IJg62IG9SGT64ylxcIfrBAsMoUmpyw1QYB9Sfo9 obNEGiN7Sh5i5WFzAWfRiDnuR3eLwnJpMd1y0+WnxApJbfcclbZpUkTItRhqQz+jMLcQrC9VKEFCc ANEbt2edXABiuReeIHDF3heo7XDli502F/Vf7360OaMZoVtpxTpULG/OEbzXe89uPpHvVxygtXFrz MBRx0Ugmxm9K7TNgJ96Z8gAugb4vVfEOUJ1dYAHxlTeTBei0WaqZHn/WZrfn4vzdeolw2mrWiK/P4 QevxEdzIgPfh/oIzxcbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPq56-002ooK-Mw; Mon, 13 Sep 2021 17:49:25 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpuh-002jr6-Fz for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:41 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3B02C2005F5; Mon, 13 Sep 2021 19:38:38 +0200 (CEST) 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 2DE712005F0; Mon, 13 Sep 2021 19:38:38 +0200 (CEST) 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 6011620363; Mon, 13 Sep 2021 19:38:37 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 18/19] mmc: sdhci-esdhc-imx: Add interconnect support Date: Mon, 13 Sep 2021 20:38:13 +0300 Message-Id: <1631554694-9599-19-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103839_853105_D2ED2A02 X-CRM114-Status: GOOD ( 18.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On probe, if the dts node contains a valid icc path, then look for the fsl,icc-rate property and get the rate. Also set the icc bandwidth for that path to the nominal rate needed for sdhc to function right. Then enable and disable the path every time the sdhc is used or not. This will result in reducing the clock speeds along the icc path for each pl301 and NoC, but still meet the requirements for all the other icc consumers. Signed-off-by: Abel Vesa --- drivers/mmc/host/sdhci-esdhc-imx.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index f18d169bc8ff..9773a9efaae1 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -9,6 +9,7 @@ */ #include +#include #include #include #include @@ -324,6 +325,9 @@ struct pltfm_imx_data { struct clk *clk_ahb; struct clk *clk_per; unsigned int actual_clock; + struct icc_path *bus_path; + unsigned int bus_rate; + enum { NO_CMD_PENDING, /* no multiblock command pending */ MULTIBLK_IN_PROCESS, /* exact multiblock cmd in process */ @@ -1573,6 +1577,19 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) cpu_latency_qos_add_request(&imx_data->pm_qos_req, 0); + imx_data->bus_path = devm_of_icc_get(&pdev->dev, "path"); + if (IS_ERR(imx_data->bus_path)) { + err = PTR_ERR(imx_data->bus_path); + goto free_sdhci; + } else if (imx_data->bus_path) { + if (of_property_read_u32(pdev->dev.of_node, "fsl,icc-rate", &imx_data->bus_rate)) { + dev_err(&pdev->dev, "icc-rate missing\n"); + return -EINVAL; + } + + err = icc_set_bw(imx_data->bus_path, 0, imx_data->bus_rate); + } + imx_data->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); if (IS_ERR(imx_data->clk_ipg)) { err = PTR_ERR(imx_data->clk_ipg); @@ -1762,14 +1779,20 @@ static int sdhci_esdhc_suspend(struct device *dev) ret = mmc_gpio_set_cd_wake(host->mmc, true); + icc_disable(imx_data->bus_path); + return ret; } static int sdhci_esdhc_resume(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); int ret; + icc_enable(imx_data->bus_path); + ret = pinctrl_pm_select_default_state(dev); if (ret) return ret; @@ -1821,6 +1844,8 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev) if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) cpu_latency_qos_remove_request(&imx_data->pm_qos_req); + icc_disable(imx_data->bus_path); + return ret; } @@ -1831,6 +1856,8 @@ static int sdhci_esdhc_runtime_resume(struct device *dev) struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); int err; + icc_enable(imx_data->bus_path); + if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS) cpu_latency_qos_add_request(&imx_data->pm_qos_req, 0); From patchwork Mon Sep 13 17:38:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12490351 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 49F71C433F5 for ; Mon, 13 Sep 2021 17:52:32 +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 0DD1660EB4 for ; Mon, 13 Sep 2021 17:52:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0DD1660EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zRp/n9HJYRuh0V1wYRe4ZW9JsdIVKceh/mHv05xuY2A=; b=lk7Hl117WxemUz XiefQyTkjnihJMwJK9DDuJ6yuNYslsAm/RkleOAMXqmZA4J7uasliraj6MrHEUwwWT6OmFUfAe6Ln 6nojjETrtJsi4HpZEt8At+81mDqR88BvEOhqLPMwx9J2izS0WTU0+uKYUtqNaehU1cfffbOYvZDeA qFWQTilfAR0oI30TQa9+tSkPwo7Rlqe7qkSMkTClQvlU/GfsstjmBR+8IEjVe2huEgyHOeB/h93e8 4B6IK+3D9AuBEBUStrrEvwHrJKbZZZsGBqmzpjj1vI9X5qSA/TaiedEN2jasHyg1u9BIr1OmWdvMC d48fZhVQzkhWASjfKMMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPq6C-002pH6-3d; Mon, 13 Sep 2021 17:50:32 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPpui-002jrn-Db for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 17:38:41 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2572C1A039A; Mon, 13 Sep 2021 19:38:39 +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 168711A010C; Mon, 13 Sep 2021 19:38:39 +0200 (CEST) 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 3E7AB20363; Mon, 13 Sep 2021 19:38:38 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 19/19] arm64: defconfig: Add necessary configs for icc+devfreq on i.MX8MQ Date: Mon, 13 Sep 2021 20:38:14 +0300 Message-Id: <1631554694-9599-20-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_103840_642561_228C9036 X-CRM114-Status: GOOD ( 10.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Compile in the interconnect and devfreq drivers for the i.MX8MQ. Also compile in the powersave devfreq governor. Signed-off-by: Abel Vesa --- arch/arm64/configs/defconfig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 3bf6f8a86aae..b06f1b01714d 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1063,8 +1063,9 @@ CONFIG_ARCH_TEGRA_186_SOC=y CONFIG_ARCH_TEGRA_194_SOC=y CONFIG_ARCH_TEGRA_234_SOC=y CONFIG_TI_SCI_PM_DOMAINS=y -CONFIG_ARM_IMX_BUS_DEVFREQ=m -CONFIG_ARM_IMX8M_DDRC_DEVFREQ=m +CONFIG_DEVFREQ_GOV_POWERSAVE=y +CONFIG_ARM_IMX_BUS_DEVFREQ=y +CONFIG_ARM_IMX8M_DDRC_DEVFREQ=y CONFIG_EXTCON_PTN5150=m CONFIG_EXTCON_USB_GPIO=y CONFIG_EXTCON_USBC_CROS_EC=y @@ -1156,8 +1157,8 @@ CONFIG_SLIM_QCOM_CTRL=m CONFIG_SLIM_QCOM_NGD_CTRL=m CONFIG_MUX_MMIO=y CONFIG_INTERCONNECT=y -CONFIG_INTERCONNECT_IMX=m -CONFIG_INTERCONNECT_IMX8MQ=m +CONFIG_INTERCONNECT_IMX=y +CONFIG_INTERCONNECT_IMX8MQ=y CONFIG_INTERCONNECT_QCOM=y CONFIG_INTERCONNECT_QCOM_MSM8916=m CONFIG_INTERCONNECT_QCOM_OSM_L3=m