From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BA2FC432C3 for ; Thu, 14 Nov 2019 20:11:54 +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 43213206D6 for ; Thu, 14 Nov 2019 20:11:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kXaHaBlx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43213206D6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Me72XuUeTwsL6zWyWa6GNvL1lVHzNwPh0FR9O5/0dos=; b=kXaHaBlxWXQ/CDCYLZwk7iG8wo Pf8JOMyvt/BuWWRCsNvDPo+2soEyPEGCOnV+5fEhjjekeeuJANrHhyMaG4yZKt6ibHPqbBFhe5ucs WMB0/NnFpEbMZ6wjBw9lKeFCm53nEwuLHKW6jCZvGEP+JB6VLCLC/r/F8rdjRqGvW3pC30yTUTQ9k Tb+m3UGQvlVsA2/7Ig4lAOPvujXfbS27J8tW6uOGlPhM9Ojundnon0C2Bvv9ZbLCtj6XPCT1WJJ2v 2qbqEd+hiC9F5QnIAjpAZwLbri2mPLx8fTgsCXKjkQIPfUvsrZ5j8tdtJ4gSguvc45Cl8wWGD7tDk VpajIFAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVLT4-0000q7-Bw; Thu, 14 Nov 2019 20:11:50 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iVLS1-0008M3-9r for linux-arm-kernel@lists.infradead.org; Thu, 14 Nov 2019 20:10:51 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9E91520045A; Thu, 14 Nov 2019 21:10:43 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 844F1200079; Thu, 14 Nov 2019 21:10:43 +0100 (CET) Received: from fsr-ub1864-112.ea.freescale.net (fsr-ub1864-112.ea.freescale.net [10.171.82.98]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 7479E205D5; Thu, 14 Nov 2019 21:10:42 +0100 (CET) From: Leonard Crestez To: Georgi Djakov , Rob Herring , Chanwoo Choi Subject: [PATCH RFC v6 3/9] PM / devfreq: imx: Register interconnect device Date: Thu, 14 Nov 2019 22:09:50 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191114_121045_660172_96729210 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , =?UTF-8?q?Artur=20=C5=9Awigo=C5=84?= , Jacky Bai , "Rafael J. Wysocki" , Viresh Kumar , Michael Turquette , Angus Ainslie , MyungJoo Ham , Abel Vesa , Anson Huang , Krzysztof Kozlowski , Matthias Kaehlcke , linux-imx@nxp.com, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Martin Kepplinger , Silvano di Ninno , linux-arm-kernel@lists.infradead.org, Dong Aisheng , Saravana Kannan , Stephen Boyd , Kyungmin Park , kernel@pengutronix.de, Fabio Estevam , Shawn Guo , Alexandre Bailon MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is no single device which can represent the imx interconnect. Instead of adding a virtual one just make the main &noc act as the global interconnect provider. The imx interconnect provider driver will scale the NOC and DDRC based on bandwidth request. More scalable nodes can be added in the future, for example for audio/display/vpu/gpu NICs. Signed-off-by: Leonard Crestez --- drivers/devfreq/imx-devfreq.c | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/devfreq/imx-devfreq.c b/drivers/devfreq/imx-devfreq.c index 620b344e87aa..585d340c0f6e 100644 --- a/drivers/devfreq/imx-devfreq.c +++ b/drivers/devfreq/imx-devfreq.c @@ -15,10 +15,11 @@ struct imx_devfreq { struct devfreq_dev_profile profile; struct devfreq *devfreq; struct clk *clk; struct devfreq_passive_data passive_data; + struct platform_device *icc_pdev; }; static int imx_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) { @@ -60,11 +61,40 @@ static int imx_devfreq_get_dev_status(struct device *dev, return 0; } static void imx_devfreq_exit(struct device *dev) { + struct imx_devfreq *priv = dev_get_drvdata(dev); + dev_pm_opp_of_remove_table(dev); + platform_device_unregister(priv->icc_pdev); +} + +/* imx_devfreq_init_icc() - register matching icc provider if required */ +static int imx_devfreq_init_icc(struct device *dev) +{ + struct imx_devfreq *priv = dev_get_drvdata(dev); + const char *icc_driver_name; + + if (!IS_ENABLED(CONFIG_INTERCONNECT_IMX)) + return 0; + if (!of_get_property(dev->of_node, "#interconnect-cells", 0)) + return 0; + + icc_driver_name = of_device_get_match_data(dev); + if (!icc_driver_name) + return 0; + + priv->icc_pdev = platform_device_register_data( + dev, icc_driver_name, 0, 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->devfreq)); + return PTR_ERR(priv->devfreq); + } + + return 0; } static int imx_devfreq_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -120,18 +150,25 @@ static int imx_devfreq_probe(struct platform_device *pdev) ret = PTR_ERR(priv->devfreq); dev_err(dev, "failed to add devfreq device: %d\n", ret); goto err; } + ret = imx_devfreq_init_icc(dev); + if (ret) + goto err; + return 0; err: dev_pm_opp_of_remove_table(dev); return ret; } static const struct of_device_id imx_devfreq_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,imx8m-noc", }, { .compatible = "fsl,imx8m-nic", }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, imx_devfreq_of_match); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel