From patchwork Sat Jan 1 16:39:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12702111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FEB5C433EF for ; Sat, 1 Jan 2022 16:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbiAAQkU (ORCPT ); Sat, 1 Jan 2022 11:40:20 -0500 Received: from mail-vi1eur05on2078.outbound.protection.outlook.com ([40.107.21.78]:37760 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232535AbiAAQkS (ORCPT ); Sat, 1 Jan 2022 11:40:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jA39r04TnZrEeurx5kS3yle2lvX6DS8LE0diA0K750kU3CMAntFYuHsc6tJ7+wzv0uKUNLCjLac42Q04JOGcu7uLVYfHz3AE6hwZ5fbc5t2oXDx/Tmgfse0F90MI8r0Ld7MS+ouDVr3dBYtrHdDwvWL4aAckNH0VhEWZbxCV+L37MqMNbDM4A574FVFRbxfVBmD6jFjY5KrHGn+gmGaKvuQyleo28Fy6elINEu7dg7qqsmipJSuxOJ/ocnnJuqeAHc4sYmQfIt2xvpXfYaGSwSgDIGNYE0YdwAktTSZndtmkvELQG+saDpWyHBHR8WgM8hst7FY4qQYvELwR+mFAsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mHV70ZFxuNKZwO/6Zm4FAcelOFlwfp+t9TvLmt6+jUA=; b=MyBQ0ZN1UCaIK/KY6nxZhuTDBmxYZQJzlqMXjpTstneSS1XjxSkLEbhhab/egzdl3JOVrXl3MmD9exfjfzk30u6ezcbnZJul/vhBz09xdHIvXW8xrhgn0YqDugVlJXVZlLSKpPJn0uvcdUAEgsD7hHQYnGHJ+7qDo5p1mn1aqrh/A6soDNrk1CkVFtIvVXrOATNDUUrjgH5dprp2Sv1f/XaGP9+o+LApvD8P568tys0sbPRcTx4k/xBdNX/aWoSqvwvVmM3hGj706qVIjvk59iuNlNjhJSdP5Ql7Vql31c31s/3cM+glbC9d4rp1uxoDjqIg6Wm+hHX97mZQMT4ZZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mHV70ZFxuNKZwO/6Zm4FAcelOFlwfp+t9TvLmt6+jUA=; b=HSSV6z3dJZraI+qM1/i1FOv7O6PFeoaKac9sVlStkciUUsRNpDB5kKnqPTzF23nXQV3nZfvdX0yab/55TKanMQ4tg5Vta1Uvxmb9u2xLGkSljn9QebLXEsE/E0Tz0ua5UYu4jTEvzGtLvVCHKo5T8VBO5WXzAk6IaZyTuRW0C/0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by VI1PR0402MB2797.eurprd04.prod.outlook.com (2603:10a6:800:ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14; Sat, 1 Jan 2022 16:40:14 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841%6]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 16:40:14 +0000 From: Abel Vesa To: Georgi Djakov , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Subject: [PATCH v2 1/3] interconnect: imx: Switch from imx_icc_node_adj_desc to fsl,icc-id node assignment Date: Sat, 1 Jan 2022 18:39:54 +0200 Message-Id: <20220101163956.3344467-1-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: VI1P18901CA0014.EURP189.PROD.OUTLOOK.COM (2603:10a6:801::24) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88b8dafb-1cfa-4fd6-cbd0-08d9cd4562b5 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2797:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:541; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rTHFay5IYkn5vf/IGK5Unnh/0qgh0FYfuCzuwdB9X9Jq8mSIXUgsG6ej8LnkNfTXr6dZNb1ltspYVoF+1aWN4rqAmWpQ59kDgporpwLvZZZdS/kFHoVqXLUPAKpGlrASZMBLbhf2j2zNnkaVqZuEQGGFdJ1txVtvwNnN8mPWBvNZdMdSbVCv9AnyG6/bkxusctsOnImy3aCTm/HAU793XmKNWDGozcE6CfjENksL8GKW5UbJ/16lo2up+ikgloCxDVMXMKyBesgNP7+MIs/61spmubUmxMsoeZmLYzgK2pTf7ElQq9wBFX/ZcxbhNiSjGeSxHjZUk9XEHPE0mfmL65iH+IhBlhjZtAdS8fVVy4MdmHojh/3hKP0CeDNb01TrBl4wlv6ZVPc/YKMF9QGpFS3Cr189dAmWccDusSI5QQAvklGEnvH4KZ+aLVCzvQsa2O3qIk9TtI3SG9Hmajilt5Z7/Io6mjdgFOnBXgZfkouYBgfeg52pG/QKmqUKrzCS86U2O6fqujTWTuX8K83wn7uyr8JZ2z1nsD/KanfMWvu9D0SPYIgC4PkrxGvpnhxFRJaZffW0cUxw1gIlb8SET+FjmvIYoJLG6TqMerS+mwp6web6HoNygSkH2TwcnsV2yWJJxNZHpbDZehpIC+zJHIaPp9XfNDMcSpx8hVW6rFgJl0AktKr5wClghPBU/JHXRk5hLs6XtpR9ZY2MSSXFuQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4688.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(4326008)(6512007)(5660300002)(6486002)(36756003)(38350700002)(38100700002)(66476007)(316002)(2906002)(44832011)(86362001)(8936002)(110136005)(52116002)(2616005)(1076003)(186003)(6666004)(508600001)(8676002)(66556008)(83380400001)(26005)(6506007)(66946007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4dZiDv5rvxsyaFaFcCpglUmHjo3I+fMJRBHNzoPWujWoj2yTVg5zC9OH3zyZ+IHRf6pKCD5ASjo167VHYERz7dsvGN+teeGDkZyREna7LlU5YZRfnsJeeFkbhzam/btxBg7HgPeqAgEBGky1uDQ7Z6mHfSbfZB7+7phCgioFa4Zi1v7qpFXdy04eH5ci4Jbsvrmc2555T85qNdfU6OsUGe8bFjGYEQPp8j8IiXdtURCVqXH6ekFgzP7u7+sYO/12lIL+26jxsPVMSAeVU3DYJZmN3oLNqP7C71vy2loXlCI/6BOZCI7PltVBjtzNw15wOe4CF2aTHpKCBK1eqyHPXOUv5QeG3E+M1mhHFrdTmiS7K+BpSIljIJhH5l5fx1Wv/9E3oX7pxN8QaXN1dHgtEPIJqk+pGr2aT2ZT842QnfcF2jCIB/QYalPNi+DzX9aPvtzIoqshx1JwLKv/XImHgCMeEB0ynxi9xMQxTTktBiVpobDZxo6fKTUTcnagsOeeHntrYf6ssQjXoLkz0cnNTYj+qgcBOXashzvzGfRbxIXkyUXQqIk8/hZnxQVqZSj3jq3xcxXCyffxBkte6DjWVKmoS7ywx/fYl2wHj0FBlzJi879TeSMFSk0ozAyl6sBqL+zoBL5QYLfVCWdHklrWKTIQ6I9x7R+zKDKIX5KQ69idIkBu32QsRcHELEneRQTYMFLPzM/MbzRxVSGh4Khie0H8OHr3qTX5xIil4ujyk/iZqA7TjUJxGcnOrT0imh/g2eIPmxCEUmSUp3dXiBbqUzWbXENOjNS27r56/iMhdlyXcx2klKIaeT64EQxS9FEMxyplwztsK1GGyMDQoU5UtbLe1+wYeAfloFpGh5/mhYH5RO0QG+KA3ibov7bFoz7307/WEyVTTrfQmzk5eDpna8C2ci4pjywqdfYEEr1vaANVwbpHSTuzuZdb0I7uq01nZTYzL2GmuW5HoTDH1/yotq5x7oVVmeA4MLixB3bYw/9DQKW+GQb9pCvRxVBSw8obh0CLT6tUYiZsTSCktJ6byTJB4Nh6YT1my7dr7cbneYXDXZA7mBTV31N6702mZRWcpTC+XCyDSoeP5xrmpC9EIDWPPZocHsMbZL3qPqStriePj+QAwJWDeJMYVF9H7WyqwWsQyzBFbSPrBT65VVhPmlAXzsi+55Y+LR+oTfIERAny/Lh5einn0kuRuNxZkvoLy0fYNeSa97HsL53loF5Zi3Wgcqq73UTo5J2d52N8tDZX71OFeKcJlaH1SdaaVC7GusCXy7sF/Mw0Ue82ZVc0igrgTGINxE0SPY126cSQ50tmL6WTHDChtu0fkasNNIAZcjZwML8FAxTJ1XK2mVDjnkRd9SlqjsbtvgckT3SUxRnTr8+kTZE47P1+hb+dIrSHF+yizzinphRX585GIMrFQYtqhskIs8m+esdjLOtBTFO6T8U/z9pMM54RhYLjmGqV7HZeMvcrg3R99yQmRcC+haSHJ2+uRQjPAf8WvYd9SY6DXZ6ACwD9l5ZL7g7RPqis24Vrckxr97fT+K6YDm08GPj1nUjZK9/EuMt8MAGiJcD4BP/z9DjxB6mGECzv6d+KdgmgBdW76B3W/VtpVRna5gYhDlBBiGVR9StbgxN9K7c= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88b8dafb-1cfa-4fd6-cbd0-08d9cd4562b5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 16:40:14.3723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NIgn5uBAEkNZpNq+n63k3ykBodlwguenSDY+VbeOHC3aTOIsJdZUfanzNCODTfKD0CXBT7UjzGuJ/eOqXMAVBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2797 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 --- No changes since v1. drivers/interconnect/imx/imx.c | 70 +++++++++++++++------------------- 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index c770951a909c..34bfc7936387 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -34,8 +34,8 @@ 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); + freq = max(node->avg_bw, node->peak_bw); + dev_dbg(dev, "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 Sat Jan 1 16:39:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12702110 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19C8EC433F5 for ; Sat, 1 Jan 2022 16:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232537AbiAAQkS (ORCPT ); Sat, 1 Jan 2022 11:40:18 -0500 Received: from mail-vi1eur05on2078.outbound.protection.outlook.com ([40.107.21.78]:37760 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230122AbiAAQkR (ORCPT ); Sat, 1 Jan 2022 11:40:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h/roGSBm/QhfmqUgOG4VRvJMd6tEVCMhJfm2K3rXW14ropEjebaLp5TRI1kmcxgTdijNn3QAwISBzQ05kbzz9xqQLltYH8HWpkMlfqOfSOGMHA+UXh2Gt2jh51JWSQyTVZkhFeqFLMGzdGXCx5WSR9UzoCUOKW96Iq9lHA58PloCoNij73zs1su52zhkKqTKxRGdTkfMpuXZm4agD4Tu2YcrdFHL0qiqi3XFmqh656ridCzHXOuMe9+kCsPgmG8O8tXpbBgPOz7W/WlLUKXzmyVJbIV+Q7dQEzAxUa5/d4jGYcwkop2J0X4DP4fTisqW3BdoBnHa3gaX74aFUnPJ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b4d8jtgQPovNcyAGsqOUAeVMwIFS/fOgOpYnzGWvMhM=; b=aWHyu135tFN9Uw4Q9QyYQE+nxlxh4dFgLkHrmR8qzYnVXDtcbUBdqWovz49WLk8tEuNU+ZctTOd3ooHeZb2ljdGcH7JUzV+1Dq5DOg0RRScmQQY4tfeY8KN2vBQs87s+aRJi7oeYACmvzHzDbZvChkooUtms5j/FtEmLQ3BuKNlEqCjXDtr67regaq6LfYkdWnaQQ9jM5A1am9APeZOJiSaPDtMRC9umU8qu1b6nPOMUmHs4UYdTDtLSRSiRi5efHIUFOpn26V2lQcf/7xSPM0L+z3WWz0JEYAPX4+7l4GHpGoUSRaeyNBg4xznEHRwbxC4XmKGz6Xnchp1WCc1pew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b4d8jtgQPovNcyAGsqOUAeVMwIFS/fOgOpYnzGWvMhM=; b=Fd2n1rUYbzcnUN297rizKzJ7eX1m3Bn2J66+AOR2TllWuDILN4Wb9/mzMl6/4Cc9Nc7zbTX3fRyZn54nNdv60MFgW1VCwp7mrGH2X2EpKmPCG0GRBqOdimzB+KAsmMCog00lceE5X1UDT300cu1w5Np0QUBJH5v0WaQszQTc/i4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by VI1PR0402MB2797.eurprd04.prod.outlook.com (2603:10a6:800:ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14; Sat, 1 Jan 2022 16:40:15 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841%6]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 16:40:15 +0000 From: Abel Vesa To: Georgi Djakov , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Subject: [PATCH v2 2/3] interconnect: imx: Add imx_icc_get_bw and imx_icc_aggregate functions Date: Sat, 1 Jan 2022 18:39:55 +0200 Message-Id: <20220101163956.3344467-2-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220101163956.3344467-1-abel.vesa@nxp.com> References: <20220101163956.3344467-1-abel.vesa@nxp.com> X-ClientProxiedBy: VI1P18901CA0014.EURP189.PROD.OUTLOOK.COM (2603:10a6:801::24) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4592535-0bac-409c-66b4-08d9cd456305 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2797:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DGch2a/Trea0cVL58HiyYRQLMtdlz8KuArLrufXiu++9ZporpWYn4sj+vpCdRUE187+RAmQHEtc63I9SjMNY5sGnUvfyexXdwr8ipOth7w54i3MlfO5Q63y5OCFDQ+GgLg1zIc7jWAfHElVMIbcXUqw58MBYuLx23nYb9nHYn0QtJRZkcuUHoCsGkELZr2qHUmJLGOa5bvIXaqyK/SYsp69lwe34AHbXyzHgZEWAl26leqfXKlv+w+oJ6CXe8DjHyhTq/J7xLwzRHbHZ0Y0oZh6PG/KtIdemCEvXs+RQZvY5h7OCydENVju9yc1EewG5dVPe+72AyoZ3aZbi/f09s/E5fqYNNA36p84FQwUJjC5je6KJ6dMmnf1kZYIR0Q5YdnpbhGJDOzVqJbxCRU6u2m9te+HHIFPCgpG/X3EKXuvgbs/0hzmkY7527gSkdhozV7sGkGwR2giFlFgbYLxlAPNp0ZWqGjsqIT5EiFn79u7ADrFocsZn1UkYA8m0xDvHdxda/EDOcuotq2WF4GW0YmYKtRZFQYITl8A+jycXLY9tkmDVAtwkZ9I7XYGDbdfdxCTCC3VtUQFg/S2GrFnUHkUqbGt5y59dNIbYuE4HRsKl6aIuwQq89ZVUzpXOS4I8ggQ7w3M+cQK4Kdc8YulfynglkpraklvZkBUaQmNX8wUSPlMYwZrAAteJo5QES+y9UiEf7xzPdV81qXgKE1YE8g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4688.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(4326008)(6512007)(5660300002)(6486002)(36756003)(38350700002)(38100700002)(66476007)(316002)(2906002)(44832011)(86362001)(8936002)(110136005)(52116002)(2616005)(1076003)(186003)(6666004)(508600001)(8676002)(66556008)(83380400001)(26005)(6506007)(66946007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TiUtF3z/d1RwszTlg6rB1IETEgbIw1qdF8keU0/lqRKlpQtcQjBSwflnIkL04DrOqwEQb+TdhvEOO/h+Eh84ecj7J355GOWxkU38Q6D/28ik9qokVSlse1vhitICDnwS1ArhZgnAPlWHTY4PjRNirC2V8bV4yBklWltt4bbpdpVSAA23beZmy9aSgkLvvgilfbg3v+Iw/TjHyrwFHubQa2ORMy8ADW1vUg/aRRrGd/gZkSSBDeWNRzpdh7s2FBOwfMtHbWLPQVlLc0881CanwQnZeF7VAb+gNJ4GlkYbyTN8+UTgWKT3H8u5tdNx8aDSrYVh693h1ugbpYBhyp7y4zijhLp8NBTP5QAFzHby+LQiOShiYHHIyZYDj9wWrqhBN800UG490MhLH7yZxVRBINqsWgK3/lNxjUy7tBZOyZkhVjAjXZ1exDrtgF5Ypbw+hZzQ9hKYlvdvHYXN8zfcFVDFFEZX68Hs03k0m7u4ZMy1KfBOdQBP+gqiXYMp3mY1qUwmbEkw2FAxjWVfX3YI11UjeIZkkhv7ClDK8+w8yvvL9ID0AfQFMYfgXQ9cb8yeT04iNgdMeXIDa7FAumOqzOKeOjaBwMublb/r23b5f69fFmgPh/+78nGIV7EmR/aobuOp76IAihOSREMXwwD9c5DBiQ38GUE7zLv1HVHbC8leGQRhipEjTD21/CCXY3Uu10zpzfOhrTdYqGzkZSpcCrYabvIKTzxuqCwI2lRFdp2ZkghPAUie/tS+ClvZfD41Bz9x9rBgGmo4cSt4Yd2rhfK361/K3ZoBQfCwqQRTFpqKKYR96R39RzF3+FFfgKucXgx1+obL6ToezF7WdPxLbRRV4g0ugpq2cg4VDOMMFVbNha4e1sPhC3jqg88wiR65MCyHrhLeUhzDVAdxz97b5g+wVHW/TnX5PNji6TLXRjKBytXv6LLqGwR3XDPghv1nUUSaqwkEgo/mPJ3yN+L99q/CYiWNTRV/q5ct0hB/lUXeEkSNyLbbPxYIXCCi8bMM1AHUfKaMypfnI7AVxXBoL+hQIjWVOZSqNc3coWqISGIbGXvn5ijJ5Ipkxh7DgOWpe4VCNcN/H2F/IPtHaVAkzZhb56r+X7btrWD+yytXvjrawUD8dlpAlPez/goCJh9jb1ZUr6JZllTaOrrOM+J7vm7XLueuNJ56A7Zgte4AkSnc/yvo3q/ZVWUwvPjfq+X4eA9mdornKnG7JZlkd7h5K+KPu7U2mY89AIVWrHrEPBJwrsQPowAzYvOFpOgGDG910YbZPX/INB6xk4yA+Oa39vE/ZQCcDjh0Jtly355NPcE142LysN8HFWZjg2fz/4FyZXekYwY139oxcrcPPjF8HA78EReZcOncrEt3jDLtjYv0uO1083vgGHDpsgG5gQWNG62jknribwk07/Js5lhiZNytp83V7/hv0dwcaU8dLVl5np5IGLdMyj7GcWsD3usok+Cu/XQj2ys2UkoSc66HpBcNybUIre9lqSw4BB++kvyVOboB7+kCbaNeir+N18tWDDED7rzeKM9SoWccF7vAtvcTdmHWwG9C1VSCGjUOCjhprtRNQ4HGW5JnHnToxseTPjc5PpClZyhTcpudNWsG1M1mnFNrFqQy0YWiCNp2SmM= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4592535-0bac-409c-66b4-08d9cd456305 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 16:40:14.8810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5UqQ3RqBm+kDe0TWRF6wUg2lGyI6OoE9T6/V61QWuMBBXmtXVzBOo45akGnvZhVIfhdETmx3ZajSogZkux2a8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2797 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 --- No changes since v1. 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 34bfc7936387..4d8a2a2d2608 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 Sat Jan 1 16:39:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12702112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 297CDC433FE for ; Sat, 1 Jan 2022 16:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232546AbiAAQkU (ORCPT ); Sat, 1 Jan 2022 11:40:20 -0500 Received: from mail-vi1eur05on2078.outbound.protection.outlook.com ([40.107.21.78]:37760 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232544AbiAAQkU (ORCPT ); Sat, 1 Jan 2022 11:40:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J5VpsQ2Xw0LhzVP/Sz93OZj8FslSxKS6WDE/dqrHRqO55u1LsgSaetgWrAn8Ms8Tg+iArxeOR4VcLrA80X1F0FF2ONzkSa7b7sjXdjfer4zbPO2xZHhNLvAqRz81jD7fNZG5bN2Hv4KoBHW/2T0yWJXOTpC0G/hAEDAX5luDR6viwbL2sYUzEQ+Cnbyu3bbJho8ayQy0AHkxSp9eYTVgvWYwWSj3jdymgUKsnoTkcG7liqM4dOrXd20C/328U4ekw00OuP7nmm3oKwjgN5FmCNOWNqprEClb/nvVq/WDKNxFVv9024oOTP4AzUSQJP6a+jPpDRwn5VulZeI/jjIQUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eriNmF3W4OEwQACsARp7f70NQGA2G3W1AGI+3SUrvxM=; b=KEyeB2P6gteq30kQZ4ceOSmH332dQF1xLHVw2q9uOBfIPHyznCxMeMMWLL55rQd9PbPrsF8ovzjB54Qxz8Fk4SOcGIZULIaDExwphdN4Rx7unE7eKtu/Pp4i1n23rKQd/35BQDp8389iUGTLNEpCCtat4oQ53XE4BfWLzPcfWLbE6hM1kJmkMucq4++O9IwfpDDK75kcVQ178kocUFQLGbLgp5m0x2Y7fzXwmLz5NZl22V1rYthWMbmAofJOYIp0hyt7GqMlGWUbbqZnTeVvBclgvEwP5OfFlGBpSKMdpG6+EF/mDyeBKQ+RLcC7llgIa35LB6PvCl3WZIjOG9BVng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eriNmF3W4OEwQACsARp7f70NQGA2G3W1AGI+3SUrvxM=; b=S1WrQUQXzIE5r2Fg9ubi5LScwhSsWSbMp0qPQ8PxE59wPIQzRz7SjLVzG1Wps71ywblSsG94GGhhrJb4J+7Vc43duH88aahpMI/5EH8EkLv3Pm3PFqOl25DCQ2Cvt1e+xoeOl8QxsjR0vTGk0zMkucoBNoAuLLGpnjrpqkZ3iaM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by VI1PR0402MB2797.eurprd04.prod.outlook.com (2603:10a6:800:ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14; Sat, 1 Jan 2022 16:40:15 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::4c4c:f2b2:addb:841%6]) with mapi id 15.20.4844.015; Sat, 1 Jan 2022 16:40:15 +0000 From: Abel Vesa To: Georgi Djakov , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , NXP Linux Team , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Subject: [PATCH v2 3/3] interconnect: imx8: Remove the imx_icc_node_adj_desc Date: Sat, 1 Jan 2022 18:39:56 +0200 Message-Id: <20220101163956.3344467-3-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220101163956.3344467-1-abel.vesa@nxp.com> References: <20220101163956.3344467-1-abel.vesa@nxp.com> X-ClientProxiedBy: VI1P18901CA0014.EURP189.PROD.OUTLOOK.COM (2603:10a6:801::24) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a13f5f0-4d78-405d-24b3-08d9cd45634e X-MS-TrafficTypeDiagnostic: VI1PR0402MB2797:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ng2kXErhQpJIYcQw5Id6dv3j61TR6U7gJkBhlhmudeUsWFFirsC7Z6A/bX3TBDJITo9A4r7n3EiWKF46jRySYxgI8a0w1Y6qT/CkHGhDulxS3l4M+WRTE4Oxk892aXp1mL/ak6vV/DPRKNHyeDeOucH5Tab7V82JNkU8gfLa46hRZ2/W9gG24JLBlo1J6piT/s3ltSWK9eDIItxmMfjT8/mbU6S1/xs6mPv7uUfmrwxNbhbPcOhne3MLRcub5DuSTdoca0iQX9TAqGTOyeDuP46bMlwj1Hyn0en/uRATJr3jUSrQ44nZuGA79wgkRn2OTZDIA5wuOhMC28MBux5dTLbQCSaiw91e56TNvC6UGNT+YAe65PiFB1FbLHI6IyAxpBnlL9yzSDgdAIxgPO8NCev+ui5bL8LRnHAwQiY3HaoalFAozwq73aoInJti2vQnFErwzkObQYgK5lo+/amvLh4PlWergaIC9rWras5A0+JWxXNGoAOzIPbKf8ZdePmD/1X5jU7ZulgIvBP5cpiDdrlRCoE7/uYH+CWv+H2JVxoCuH0RS1Fh1fBZOAGusGnrMpso/iENG8d27ZN/LwcgMA8vRAEWDWumRCIHtCVwhGtRqk7ewRRJzhtlnx1TGf3C828CipH3jd/nGIhMvzQ7sSWt5KjJB6WL969utzIx+Vy4y8o/o2f2S5IJo5/d5C3gZmjoORkNj59PCZ8qpCaWSA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4688.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(4326008)(6512007)(5660300002)(6486002)(36756003)(38350700002)(38100700002)(66476007)(316002)(2906002)(44832011)(86362001)(8936002)(110136005)(52116002)(2616005)(1076003)(186003)(6666004)(30864003)(508600001)(8676002)(66556008)(83380400001)(26005)(6506007)(66946007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Rllc6JscAFrokJiPxi2umSrPGVbgpFqPyG2paLAgOt4PANkLiEfelSDq3M4296phxCin1GQ4jOAFRV7H5I8AmHxqkQG/eiyLhRlJ0yF/wOGu5U3VJvYgQucoWxLTiB+8qNN3FhxZxM+JGeCfeFmh+sFZVzhXz/mX7g4ngUgDBsyEhYvi5cruQXiVxKDH9vGDFt4E5nCh/uGVKvu5/EO3hTe4awkldGxNVfpGRurvY9XOla0VFgqnbSxgXZzQH9maq4NGQmsDbqsCc29fzeC6yGW8vFVsaZppJ5Jbyxvtx0aRgRDErVwShC15q3fhBw/SI51gJWdbKsVZOGNmsBknxpShEYWerlnGQ8wjh8ZZ2hX0rrbkEF2nFqUqCfhHKcGef//yPDsf7eoceUfvx6Lst5wQrB38bArxb/HDFtUl22+J8hZMYtw9XMjuH8SO0FzxlWJA/7HQA6civSe1+JcCvon53LrYmcsa6kyEozftqcN4FW01nBzDUBo676TP9gweGjtu5UYedM8BUUwue06eXIgnQjcJi8+wPB9OsrxEvljbNfizQ3lFnJDePh+v3x1k33m6pFg7ET4lCllJK72IyZfRZgfm6CMDI78gDrbf98RR89/pz+vSoUX46pc/cXMzBGdKextLo/c/fiZj4Q5cMS4VHQ9l0m/uYk2Xmj2Gal+bNxUpD8tsMTgpEIq08z5gIUQ+cZucaccdVrtEyev2SPFCznm7poFX5Ii0FmDGLfuq/WbCQ9LAajAY6D71iKGc5t7OLJhzRS66e+qxFkIhaEIhg5mokdR4bBOB+Q4intbMzmd+FfwzE+8VnjEtzptAGeqraMhGPslOMTJj2KegcPmzuY8z/8T5Ml8J/Kj1EHNT6hRf8owzzouccn1yOuOQiZrS4ngl93o76vC5XWAZZ8XhYTzxkZz3L1/vbQN6zOIKgWTtYc2eNe0QPE5HBtBO3bRaclP/OBzyS3bWoGQa5POmt/utcHmHU9ZoAfYLqT2HpNBn+WAE1pZc2NPf64ibjgUhwLLktp5GTeMkCCRIWUG1tHiEpwERTTuf6lDFJSY0Ev4eg9hKLi+cdyXH0MY1N12OBF1Tv+7pYdRzFMD3t/b/oG0vgvq2wENpB8ARyqqzQghsTVvbMX5fdiucRPrUXDy/mxD718fUY5flht9s8G2uJF5BNi41fwXSi3Q6GeqeJfUKg7u+kunzM/MSTkycZQsqqxSBDSOdZJBtdNwdFODVm/soba0VrlXts1qY7ZboAYxTEhzB4xUJdt0B4Mu8SONJHgi0KHt8kKvOE88YNiN1CsYYXSq9p5LyqiupeIZnrPN4H1zEEepxcv7pGiqxRPYPuxgF3GD5p1CG5TzZHs8mbd2rBVqdJwK3bYyf88qccgX+bOsUcIkM1KXUzaPAN62bAev6YwTzaWAypDy1A6m93fniASv+pvvCUpnsTUkBOxqN9Xva/WDMV6GPyxRUTOubCAZQkYSLoIrIVyiCbN3tMRD5TvPEyNRFJmCAdVOLorbI/EN9Py/H2XC9pgMLPe6wihq3epq9zRkVzC7N5f87aQmSLDi72ym3kq0ITxgcK9td/SQY6n6pUtbILAcuRNr2ZHq2fQBI8DoKm/ABw4DyUswat5wjzpOyaR0OhjI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a13f5f0-4d78-405d-24b3-08d9cd45634e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jan 2022 16:40:15.3478 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f6CUEc9zpZH2NyZt1cn2cu0kJE+wvK9y7k2KXiXKf2aB4BU4OhxZZAZmCqhhV1fDOJqdylw5+cgay3/l84BMcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2797 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 --- Changes since v1: * added missing comma for the "PL301_MAIN" node in i.MX8MN which fixes the build 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..f03f8db00917 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), };