From patchwork Wed Dec 27 18:27:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758499 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2040.outbound.protection.outlook.com [40.107.7.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C83647A4E; Wed, 27 Dec 2023 18:27:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="GPLuXs/p" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YuOmKwuU7jQ0kQ3Ynu6Lw0IzyOCgL7j8MOmfuIA9oNYQrP9RNGwjAobVlRUGjIKi9zZR0yBpfW2vk6AV85fxHXeSPz5F642RWbPr1DlzP9jEcOefFx2nnyqpFNlVGZQSWeeIG+GCUzAszOq532fhDE3SyOEX+LjZtLaFKIViQ7fXgnN9o4K/9Tc+/8YAngN9tjTDh5JAlRAdCDLCMPDdx1Zbhy3LnYqOkNGLuMuz9EQgkiZ6s3YWuA8XRjUABcD00pFeamko5iH9kVYFDf8FmWkvEwi2ATKfr4ezSTOJYso6IGUxWJDt3dSOLngDCaC/A1/TEZC8nywb17FO89zFfw== 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=1LAXOsM+n+ieruYA80YmPJNWaLohdzjp04MJ2htd6vM=; b=X4KkaZLQuQiwrU5lb/57ZGEergFzle9h7/Ft6/ys3tSg331+obLljd7Bik4XOICFifo9svqgGJSKsv2mmApK9bKKMoPR4//aPXgyczEDgZxL9exjxvnJmyLa+RrWoXDUyYmrftCTvlpphIwoq+rbaXxO2W1D2lWn+myy7cmvzz7SixoaCQSm4DOcilCCTdYfa7YzEXgFm0hszSqUNf2bAuhMoXqmOf6DRywtRb8neyKWSzbhdCoW9oeysIBZvFwQkLxeKOTJ5OWMsaHLD1ESAXc+FlJ8NzqPADTRgGvMmNvfqpXlOftYDQDIsQOkKTUwvw43Z4/zfKtWGZm63FdKgw== 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=1LAXOsM+n+ieruYA80YmPJNWaLohdzjp04MJ2htd6vM=; b=GPLuXs/ppBoIrTy14dlWJCVKrPWZWgKtB5KFhf34K/bhpLxw1piZ1K1IY9zPoUgjPIjx2S893IAy8XAqMMI92vq8itxei7VADqCxAkhXR5ShXbt1HNa1GfNfJr0C0J0g5d6gaQ63dVTtuIMitwDR5GtpISTRZlBEWx8uYK4I5uE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:27:54 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:27:54 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 01/16] PCI: imx6: Simplify clock handling by using bulk_clk_*() function Date: Wed, 27 Dec 2023 13:27:12 -0500 Message-Id: <20231227182727.1747435-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: ca149d39-283f-4b11-3868-08dc07098ad4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8IrBct6uyGR4g04ZZpbPNAquLOXP3avVbwZxRMmuZOkhzn2Tq0XP2m2mXlCHyMSXcVgRXGp4elLbr4h0SE+Wfm/HTIkteuP8AeVNhPA1Gy3oY42wPrqctlg6IyIGGJO1UQRxayAbO9s24g6in1gU0knALwa3ID1gMD1w/7SPdBY6EvtpqT51MQvSoHsqjzMvHxTMp+YMrgO7WofdW/BKI/dQKrdfBHnamOY/Od1g9jN3vuXudAVpIe4exYN5tIoGPdao1ZsiUEyJ6uE374Hlzhqc/3FAZyJ7EAqF3usZV2k6Pc6NHVkdi/cz9nO9f3bAMqpNBMs2IEu/B67v23bbkqwo7tTxRz3tRy8UAh2sO2z4yMyilE2yI6uZwlQ3VvtmKJC10VKZbqAB+4aFKzuNXidHii2jtQAza0f1ocBRuQA63AuIwp2rr1EHS9YKRFszrLDu+gamMMoHWw6FdCM666A9cbHWHP+8ver/rC4sQL5Vf/47CdCukbCiOIJ2cEGcgpFHTitjVtKBY9JWD5soYMVja78721YENws9qcDEOmbhkcZPBJhEbLRyfaZesQQIIUbvn3r8Pcvd2Q0GwGU1vBrs56xrFc9/1EmB71UxRudbqiQmVbMVGNWW2FUbVIZM X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6666004)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /X89HBIY44INsZco7sK8ltLxC2iSOhex2EtIjPEl+CXFj0Qdwszqi4lnxwC+sZlx7ojAoHBysbkxw6sIrrt88n7uvlV5qCxY7mvGCKj8zF55lJpbosWvCV9/UgbYU7qP4Z1NAtSsgjf8pPy0aVupQNFwovsBpgp/DKtdFLnDnSNSVMgyONn4uzaNUxzCuu1Ona5LQdhnq+O5WkYuYPoaodkJA7GbjCH7PC1AuWmYLVSz+8bsdtr76xK1/Qds4++1W0d9SyVmbm/A0HlNYJPRqOUuigsiqFcejrfxb3cPpF+3l01ChqNTUApbSRvo32wQ529tNDV6+WCZyLZ4pHSO+85HSWkeUGxaInNwUOzX942RrRJ0cK2NFYimX6mM/126H/XDyn1HfC67Oytc0SHgjR8jpmahafnZxt3V087DhCmo+B/beOtFiF+Qw8zVj/TqIAzq+UH77h6eZ0LDwdB09OxPdf2QAYnJVaLqUPA7GL7Johzqk8CVWOKsZyQ7V9t7bXHrXgzQfK5dDtxBGhyTmmLG0oPXeAISokrvtNcOc2q0l0LdBcY8474naBYnkYmQUKZD0emPN96l9PwU5NDCKCKpbbjs5Sfo2yIPcLEnzixcZpjifkReapjTAKWBXqWQEWRRSG50XeHi4xTAcXkzBGyQ/EDVyNEjP8iekINbbxVSxrj9q5jaWjhOEXS02J5aPLabrrfaN0zuwX0ixnHrHKIUSevioD9hIV7VTM0yJQE8dTa9wj9OosZYBR453RQIyAXylcy9Q82EweIQ/c7DngTXSmexTHKCkjzKOD1fM6lxUZ9XoLfT7+p3tk3SxaoO78YegB7i+Bg73x/tiaOZZ56aXDTeHdyVKjkh6+nzFrqoeNMRtY/gzxelzrO5Is1ZZaetK75oh2v+YPOXsXRDrkiY/qcap5+Ehb8rVS26bTyIrbEXgCatIvW/G9Fq4TP2irIdabBtjCiqfHQk/i6KT4HphLSS+v0OmPunrlqI2LBX4+tv+603RLHV+ueb6yq6STuhxyaSoOaWMq7nVMBVW25ok3oS2eXRTpy0bWmzxP91CY+0WvRkgCFU9bRenSBrjgBVvmemw+zO7bWKh1aQvZd92S1+dHblefcLbuzmRZvB9ZlI1dLTEDzGU4drbV3pNVr/SMX52huv7981ekgUU8lT1ZajhbghPYBmH6OveLSjgRDJDzo4tBNy6bELukrPCGP+fcVk/aXJNb7MpITvCz386YxoiBDQe71iYyt28p51/DWBwJ+aHiEVA/e6vZcqW9XRirb/GGgrNk+oETRzKBzGtVrW43SW8V58UwKcuIiYBsAV7bWI5J0eLHnBd4U9AXg1X56u5KBRyf2TMR/T3n8td2uZUu42GekjdmbOWLdXG/Hf/+KP+9O+ABsVZYSTs/JWrneW/nLPA6OJXmOmLSQ28WdBiipIQmNIHegjHWX7FwJ9BciLbLZf3MASY+3IGJkzMo/RR2+DiXjXWimCxpPp18P0XhK5KBbLPCmm3ZZxJDIWt3PnXPZ5kKNAChwYc4MMCpzBfwEikSXCzfhZty0LfVxr+m2e/6j1ew8KA+s= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca149d39-283f-4b11-3868-08dc07098ad4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:27:54.7986 (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: UnydRHcGo+LBgVDn6q4ln91Dr8PZReiutZvWJUWGoKcBsWfcKkPOvZ9JcDV3Q46nzax+Kap7ebecFrNgsAAwjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 Refactors the clock handling logic. Adds clk_names[] define in drvdata. Using clk_bulk*() api simplifies the code. Signed-off-by: Frank Li --- Notes: Change from v4 to v5 - update commit message - direct using clk name list, instead of macro - still keep caculate clk list count because sizeof return pre allocated array size. Change from v3 to v4 - using clk_bulk_*() API Change from v1 to v3 - none drivers/pci/controller/dwc/pci-imx6.c | 125 ++++++++------------------ 1 file changed, 35 insertions(+), 90 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 74703362aeec7..50d9faaa17f71 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -61,12 +61,15 @@ enum imx6_pcie_variants { #define IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE BIT(1) #define IMX6_PCIE_FLAG_SUPPORTS_SUSPEND BIT(2) +#define IMX6_PCIE_MAX_CLKS 6 + struct imx6_pcie_drvdata { enum imx6_pcie_variants variant; enum dw_pcie_device_mode mode; u32 flags; int dbi_length; const char *gpr; + const char *clk_names[IMX6_PCIE_MAX_CLKS]; }; struct imx6_pcie { @@ -74,11 +77,8 @@ struct imx6_pcie { int reset_gpio; bool gpio_active_high; bool link_is_up; - struct clk *pcie_bus; - struct clk *pcie_phy; - struct clk *pcie_inbound_axi; - struct clk *pcie; - struct clk *pcie_aux; + struct clk_bulk_data clks[IMX6_PCIE_MAX_CLKS]; + u32 clks_cnt; struct regmap *iomuxc_gpr; u16 msi_ctrl; u32 controller_id; @@ -407,13 +407,18 @@ static void imx7d_pcie_wait_for_phy_pll_lock(struct imx6_pcie *imx6_pcie) static int imx6_setup_phy_mpll(struct imx6_pcie *imx6_pcie) { - unsigned long phy_rate = clk_get_rate(imx6_pcie->pcie_phy); + unsigned long phy_rate = 0; int mult, div; u16 val; + int i; if (!(imx6_pcie->drvdata->flags & IMX6_PCIE_FLAG_IMX6_PHY)) return 0; + for (i = 0; i < imx6_pcie->clks_cnt; i++) + if (strncmp(imx6_pcie->clks[i].id, "pcie_phy", 8) == 0) + phy_rate = clk_get_rate(imx6_pcie->clks[i].clk); + switch (phy_rate) { case 125000000: /* @@ -550,19 +555,11 @@ static int imx6_pcie_attach_pd(struct device *dev) static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie) { - struct dw_pcie *pci = imx6_pcie->pci; - struct device *dev = pci->dev; unsigned int offset; int ret = 0; switch (imx6_pcie->drvdata->variant) { case IMX6SX: - ret = clk_prepare_enable(imx6_pcie->pcie_inbound_axi); - if (ret) { - dev_err(dev, "unable to enable pcie_axi clock\n"); - break; - } - regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, IMX6SX_GPR12_PCIE_TEST_POWERDOWN, 0); break; @@ -589,12 +586,6 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie) case IMX8MQ_EP: case IMX8MP: case IMX8MP_EP: - ret = clk_prepare_enable(imx6_pcie->pcie_aux); - if (ret) { - dev_err(dev, "unable to enable pcie_aux clock\n"); - break; - } - offset = imx6_pcie_grp_offset(imx6_pcie); /* * Set the over ride low and enabled @@ -615,9 +606,6 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie) static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie) { switch (imx6_pcie->drvdata->variant) { - case IMX6SX: - clk_disable_unprepare(imx6_pcie->pcie_inbound_axi); - break; case IMX6QP: case IMX6Q: regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, @@ -631,14 +619,6 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie) IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, IMX7D_GPR12_PCIE_PHY_REFCLK_SEL); break; - case IMX8MM: - case IMX8MM_EP: - case IMX8MQ: - case IMX8MQ_EP: - case IMX8MP: - case IMX8MP_EP: - clk_disable_unprepare(imx6_pcie->pcie_aux); - break; default: break; } @@ -650,23 +630,9 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie) struct device *dev = pci->dev; int ret; - ret = clk_prepare_enable(imx6_pcie->pcie_phy); - if (ret) { - dev_err(dev, "unable to enable pcie_phy clock\n"); + ret = clk_bulk_prepare_enable(imx6_pcie->clks_cnt, imx6_pcie->clks); + if (ret) return ret; - } - - ret = clk_prepare_enable(imx6_pcie->pcie_bus); - if (ret) { - dev_err(dev, "unable to enable pcie_bus clock\n"); - goto err_pcie_bus; - } - - ret = clk_prepare_enable(imx6_pcie->pcie); - if (ret) { - dev_err(dev, "unable to enable pcie clock\n"); - goto err_pcie; - } ret = imx6_pcie_enable_ref_clk(imx6_pcie); if (ret) { @@ -679,11 +645,7 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie) return 0; err_ref_clk: - clk_disable_unprepare(imx6_pcie->pcie); -err_pcie: - clk_disable_unprepare(imx6_pcie->pcie_bus); -err_pcie_bus: - clk_disable_unprepare(imx6_pcie->pcie_phy); + clk_bulk_disable_unprepare(imx6_pcie->clks_cnt, imx6_pcie->clks); return ret; } @@ -691,9 +653,7 @@ static int imx6_pcie_clk_enable(struct imx6_pcie *imx6_pcie) static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie) { imx6_pcie_disable_ref_clk(imx6_pcie); - clk_disable_unprepare(imx6_pcie->pcie); - clk_disable_unprepare(imx6_pcie->pcie_bus); - clk_disable_unprepare(imx6_pcie->pcie_phy); + clk_bulk_disable_unprepare(imx6_pcie->clks_cnt, imx6_pcie->clks); } static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) @@ -1305,32 +1265,19 @@ static int imx6_pcie_probe(struct platform_device *pdev) return imx6_pcie->reset_gpio; } - /* Fetch clocks */ - imx6_pcie->pcie_bus = devm_clk_get(dev, "pcie_bus"); - if (IS_ERR(imx6_pcie->pcie_bus)) - return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_bus), - "pcie_bus clock source missing or invalid\n"); + while (imx6_pcie->drvdata->clk_names[imx6_pcie->clks_cnt]) { + int i = imx6_pcie->clks_cnt; + + imx6_pcie->clks[i].id = imx6_pcie->drvdata->clk_names[i]; + imx6_pcie->clks_cnt++; + } - imx6_pcie->pcie = devm_clk_get(dev, "pcie"); - if (IS_ERR(imx6_pcie->pcie)) - return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie), - "pcie clock source missing or invalid\n"); + /* Fetch clocks */ + ret = devm_clk_bulk_get(dev, imx6_pcie->clks_cnt, imx6_pcie->clks); + if (ret) + return ret; switch (imx6_pcie->drvdata->variant) { - case IMX6SX: - imx6_pcie->pcie_inbound_axi = devm_clk_get(dev, - "pcie_inbound_axi"); - if (IS_ERR(imx6_pcie->pcie_inbound_axi)) - return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_inbound_axi), - "pcie_inbound_axi clock missing or invalid\n"); - break; - case IMX8MQ: - case IMX8MQ_EP: - imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux"); - if (IS_ERR(imx6_pcie->pcie_aux)) - return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux), - "pcie_aux clock source missing or invalid\n"); - fallthrough; case IMX7D: if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) imx6_pcie->controller_id = 1; @@ -1353,10 +1300,6 @@ static int imx6_pcie_probe(struct platform_device *pdev) case IMX8MM_EP: case IMX8MP: case IMX8MP_EP: - imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux"); - if (IS_ERR(imx6_pcie->pcie_aux)) - return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux), - "pcie_aux clock source missing or invalid\n"); imx6_pcie->apps_reset = devm_reset_control_get_exclusive(dev, "apps"); if (IS_ERR(imx6_pcie->apps_reset)) @@ -1372,14 +1315,6 @@ static int imx6_pcie_probe(struct platform_device *pdev) default: break; } - /* Don't fetch the pcie_phy clock, if it has abstract PHY driver */ - if (imx6_pcie->phy == NULL) { - imx6_pcie->pcie_phy = devm_clk_get(dev, "pcie_phy"); - if (IS_ERR(imx6_pcie->pcie_phy)) - return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_phy), - "pcie_phy clock source missing or invalid\n"); - } - /* Grab turnoff reset */ imx6_pcie->turnoff_reset = devm_reset_control_get_optional_exclusive(dev, "turnoff"); @@ -1477,6 +1412,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE, .dbi_length = 0x200, .gpr = "fsl,imx6q-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, }, [IMX6SX] = { .variant = IMX6SX, @@ -1484,6 +1420,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE | IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, .gpr = "fsl,imx6q-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_inbound_axi"}, }, [IMX6QP] = { .variant = IMX6QP, @@ -1492,40 +1429,48 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, .dbi_length = 0x200, .gpr = "fsl,imx6q-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, }, [IMX7D] = { .variant = IMX7D, .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, .gpr = "fsl,imx7d-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, }, [IMX8MQ] = { .variant = IMX8MQ, .gpr = "fsl,imx8mq-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}, }, [IMX8MM] = { .variant = IMX8MM, .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, .gpr = "fsl,imx8mm-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, }, [IMX8MP] = { .variant = IMX8MP, .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, .gpr = "fsl,imx8mp-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, }, [IMX8MQ_EP] = { .variant = IMX8MQ_EP, .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mq-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}, }, [IMX8MM_EP] = { .variant = IMX8MM_EP, .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mm-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, }, [IMX8MP_EP] = { .variant = IMX8MP_EP, .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mp-iomuxc-gpr", + .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, }, }; From patchwork Wed Dec 27 18:27:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758498 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2089.outbound.protection.outlook.com [40.107.7.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A214A47771; Wed, 27 Dec 2023 18:28:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="fgO6asKJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y1N9rD/QYhGQq0LiiPJDtAScB/31lrsSqjWVKZqdBtuRHvzaABBPyy/ja9TLUDuslWXV8DGfdQY6Kce2AkeJJK/tPMxd5HP8CcAsqfDmnYci8y/f4kmFF67eodaBWW8qsgDRJ/EGONr8zmnPOHOj4A6crTLxgMgLfYZGu804LNJRsiCfjXh3LTDHMbkz4FuHo8c2bQx4nNoJJRuEzGLufJb25H7aSxruQlcO6afXDPNL5o8lrg97lcvr0gN8JxDY5KCfYrDLJEbbOrNu/k0ewbuxT4y6hEqJ064mCpH25I4BHEYI3DjL3FcF8FnUIh7jpBC36L7iuseDv10lDmZW8Q== 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=qx01HvuG0xZ04g5Qs1emA81XcCk2ClpOFDJT/IqUaUE=; b=FDsoJpjkkkVnXMY8E2wuz3GMzmFuJF4wV0DhL0655leXFt6KiU1g/7D2D3NRJtLyWPjg4hqXPCKwCtKm3NiJVl1oebEsnEB3bNoouYFzsBml9y1gc9Mm00OGn08PNf8wi9Mhzz/fjo1K2xhSPeKc7vMOma+flzi/6nbrPpLpzRJWYlJZ63NKXlrFKrTQDeM/oRb6LxtInNLc+hAh9zcC3r5AY5CTE4YjbFeplpddKahDXykmAqkOU5ncX9cDSTx8Mrxq7aEO38gqyBPYTp5Zkg/wCgyWY50QeNkuK5iE0JxfVFJ8I3xoxssHfZZcRhOCR/YDQa6rqIByHnwRkhwfmA== 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=qx01HvuG0xZ04g5Qs1emA81XcCk2ClpOFDJT/IqUaUE=; b=fgO6asKJ67uEFxYYXUVxzmsou9sp7JmdpAYsLl2vhOWiOgx0k/AVDzVtXdq3ar1QCI9aEq5h4xa1gY+7lfeucosH4M8VM65shLEEWIPKo3jRngJ3AFMZiCawSA800uTg3A1UpE/gRP8vAbscjRPNd42vIOw++GpTiavCDP5tk6A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:28:05 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:28:05 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 03/16] PCI: imx6: Simplify reset handling by using by using *_FLAG_HAS_*_RESET Date: Wed, 27 Dec 2023 13:27:14 -0500 Message-Id: <20231227182727.1747435-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: b6e641f5-cfe8-485b-120b-08dc07099146 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zAnA8Gj3TRLWmnqsrOeteb2KDzFslKmLtO9jo3umbneI+poGkbCc5I2PW5ikNQqaJtDYXLQCNUAlXBJKB1ijBf1PfTuNwgZRc3QsHL1OwvqZH4J7bfGJC/+Kf5h0vto3R85VviVSSKcmSsqzj8EuIhjBWu0xOh2zWRDg51PDA4BqM75W6TxA7vTUTNrsB+4li3vBx4F8RA1+w7QKgBPK2e44R3jWgF2PaeGIcAjGKlKNoIyjX1nbTSg0xSPpSyMuY3z7ee444Q3PgRQno9h39mdGvqTb0/2R976Hd7EQOgE2/auQbn0j/1WzGiDCGQqUk2pneLgUPnIW0gSF9dwrgbqRIqOQ4xvUCwYTlNfjOOYo3pZ0JQiKckG8AP589Ckoy4P5bZja2tT4gWjxnLlC874W9UIeK+6qfSX4JsQP1kf9pwH9u2p0ZgCPEzTMBwmSx3MJquqrayQfkWr0LOwgkavVLZW6giw2Wytn+oPpiPESSCyPwDU4WwFf2bvEES5chYVtMARXgVZXKOH5owq2XPRD8gde6cELYeDdZibHXaKqMj6eEF2p3Z9Jc2TP7xES0FINXt4kC9q54VGETcDzc5ScQQlizKJl7bWzB4C66gcm8/M5/VkIOqxs3fYnsRVx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6666004)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jqoyXje/A5JaC0aqxXtpNBaxc/EpE23a8eyMnDeHQTAWIkh/X0BmO0F1VIcjcGpHXcs8xYjcF6OeHyqoyQ/HpHOax5rvogLgx9IAWETID/8HQGlsI/mkq5M9b6dE+duKF+N3ADyB/tBrpFdj8S72c8BBi7Wg65+k5Xlv8sxZkZZzi1cOC8v2LVtY5Hi+SCzO6Kt/NQcaAzjWzmCQX8GsuY0cB8txvzBKJFQm45E52osAv5puFBjEo1E8D7kvrjALtWPTxVtqvYEBdPS8AEI5BKtsCNIxQOSLZfzhmAm5pmMIpIlY7auAlaNbPUFoAzpqPVmTktwD1BP2FUiyp+M2K+mpsnTEBrVU3Suck1V72P6xlyx1SFj5zGDoMwqzKkdDvyQACNJJ3bfDKvnTRlv2dl0fK1MeY0m6ZO51R9E3woP7GsJLXEPICSqGu6DJkO4Pn+ICtllYgHZa/ThEqgaRdDnU2b7YQMB/UhCTFz2C+p1laEs6xzo+ia7WoCT/Kv8sqb/3bKmjORCkeZiXMx7WY/piWz+r/7ZG1kuSro5KcVHVZjP/L6E9cnXBtV9ypyh2/D06RaRp0uwGxl5YmyPj9e/SskCaL1Fw0xK8NhBJE7finAh44MYQQA0+DkiiVmbXX0p2MFi7l4mg3KZ66laD4WzOlodfZZ5dfIsOYIhbFz9eY4bONX4TYHfkiQiEP3bdq0V/kyjCs0lfFFb/Oaxjcmh6ybIcM3EThcFj+VSFTOa/RIeYtcjDAR7JAr6byKjSWoqzONk23U5Om7Og0L0p77W0THErByAmX6WWhLdclHYduLS5/EeFUZgxisYck2D6T9itDZxS22nmosHBG8Bj40F7Xt6XMRdBApUSshildCFoUizGAsoq2xO4dZVSt0ta9qiSP2coC/X4DjSaebru7PDYw+OAzsyui0DSrQnjtS/XVt1Ay4XyesQRdQastFC6XHPRsHnBsq6XFmxM0pPOpTiTQZhAbB7D547xnGn3F2/rRNCODA04YlETY3/Xq6RwouWyZHuOIcPGcKkHwDtBigEVqM96M9tceKG3bwpQSLb33stmFs33bw9/3wUpQhWjt1gSFoUVosof0opbkZJm/gi08a5YcQAHHSvbzY0pouJ8aTyRpg+3p/1NWHV+LKlXlGALvobFcLeYY+YS8bvj2SSxJq3QblVx0nmf9FJy/lqNSkj1t+G+53GEaxPh2t4n3GslHZ3LPc4ekfEw0Uy2TM9ZbLmHWeiF4aao2+66pMPi5YU4geyXtscIzyg9P7QYjvGFQyL4whUiGnfSy04Z/+H9xy4fBnVDp0NqSWSAHm/TCe6C/tKa1Xfw2oDj/GiEpsYZSd6QY4NXQIgiPjBejZ4h4TVvpoJBjjOOJ8QZbZCFzH1X2gttKSEhYiVVQIjJiXBTVnkuAbyEQELKB+pLUcjKhhRYvi7v+QpY4G0JSJtdnPCCmy8cJEB7wlZYGJR+0ndOvnDnAoXp/N7+27xKqHfafOq2R5Esx3ANtNXlT9FZmBlYGMRxoznl6TNPmOk1gVnAw1rULzX7f+ePt37f5ZdNbZShME6nxn3OLBPe5jg= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6e641f5-cfe8-485b-120b-08dc07099146 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:28:05.5804 (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: oMypvFw7fA8q4e15XNrcUVIa5D+NSh67h7MnhkYmfavPbS33IGRR2HXvsIMtJwBbPQ7ogU88gDKHchPPwtBmUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 Refactors the reset handling logic in the imx6 PCI driver by adding IMX6_PCIE_FLAG_HAS_*_RESET bitmask define for drvdata::flags. The drvdata::flags and a bitmask ensures a cleaner and more scalable switch-case structure for handling reset. Reviewed-by: Manivannan Sadhasivam Reviewed-by: Philipp Zabel Signed-off-by: Frank Li --- Notes: Change from v4 to v5: - Add Mani's Reviewed-by tag - Fixed MQ_EP's flags Chagne from v3 to v4: - none Change from v2 to v3: - add Philipp's Reviewed-by tag Change from v1 to v2: - remove condition check before reset_control_(de)assert() because it is none ops if a NULL pointer pass down. - still keep condition check at probe to help identify dts file mismatch problem. Change from v1 to v2: - remove condition check before reset_control_(de)assert() because it is none ops if a NULL pointer pass down. - still keep condition check at probe to help identify dts file mismatch problem. drivers/pci/controller/dwc/pci-imx6.c | 108 ++++++++++---------------- 1 file changed, 41 insertions(+), 67 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 4d620249f3d52..294f61a9c6fd9 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -61,6 +61,8 @@ enum imx6_pcie_variants { #define IMX6_PCIE_FLAG_IMX6_SPEED_CHANGE BIT(1) #define IMX6_PCIE_FLAG_SUPPORTS_SUSPEND BIT(2) #define IMX6_PCIE_FLAG_HAS_PHY BIT(3) +#define IMX6_PCIE_FLAG_HAS_APP_RESET BIT(4) +#define IMX6_PCIE_FLAG_HAS_PHY_RESET BIT(5) #define imx6_check_flag(pci, val) (pci->drvdata->flags & val) @@ -661,18 +663,10 @@ static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie) static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) { + reset_control_assert(imx6_pcie->pciephy_reset); + reset_control_assert(imx6_pcie->apps_reset); + switch (imx6_pcie->drvdata->variant) { - case IMX7D: - case IMX8MQ: - case IMX8MQ_EP: - reset_control_assert(imx6_pcie->pciephy_reset); - fallthrough; - case IMX8MM: - case IMX8MM_EP: - case IMX8MP: - case IMX8MP_EP: - reset_control_assert(imx6_pcie->apps_reset); - break; case IMX6SX: regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, IMX6SX_GPR12_PCIE_TEST_POWERDOWN, @@ -693,6 +687,8 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, IMX6Q_GPR1_PCIE_REF_CLK_EN, 0 << 16); break; + default: + break; } /* Some boards don't have PCIe reset GPIO. */ @@ -706,14 +702,10 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie) struct dw_pcie *pci = imx6_pcie->pci; struct device *dev = pci->dev; + reset_control_deassert(imx6_pcie->pciephy_reset); + switch (imx6_pcie->drvdata->variant) { - case IMX8MQ: - case IMX8MQ_EP: - reset_control_deassert(imx6_pcie->pciephy_reset); - break; case IMX7D: - reset_control_deassert(imx6_pcie->pciephy_reset); - /* Workaround for ERR010728, failure of PCI-e PLL VCO to * oscillate, especially when cold. This turns off "Duty-cycle * Corrector" and other mysterious undocumented things. @@ -745,11 +737,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie) usleep_range(200, 500); break; - case IMX6Q: /* Nothing to do */ - case IMX8MM: - case IMX8MM_EP: - case IMX8MP: - case IMX8MP_EP: + default: break; } @@ -796,16 +784,11 @@ static void imx6_pcie_ltssm_enable(struct device *dev) IMX6Q_GPR12_PCIE_CTL_2, IMX6Q_GPR12_PCIE_CTL_2); break; - case IMX7D: - case IMX8MQ: - case IMX8MQ_EP: - case IMX8MM: - case IMX8MM_EP: - case IMX8MP: - case IMX8MP_EP: - reset_control_deassert(imx6_pcie->apps_reset); + default: break; } + + reset_control_deassert(imx6_pcie->apps_reset); } static void imx6_pcie_ltssm_disable(struct device *dev) @@ -819,16 +802,11 @@ static void imx6_pcie_ltssm_disable(struct device *dev) regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, IMX6Q_GPR12_PCIE_CTL_2, 0); break; - case IMX7D: - case IMX8MQ: - case IMX8MQ_EP: - case IMX8MM: - case IMX8MM_EP: - case IMX8MP: - case IMX8MP_EP: - reset_control_assert(imx6_pcie->apps_reset); + default: break; } + + reset_control_assert(imx6_pcie->apps_reset); } static int imx6_pcie_start_link(struct dw_pcie *pci) @@ -1287,36 +1265,24 @@ static int imx6_pcie_probe(struct platform_device *pdev) "failed to get pcie phy\n"); } - switch (imx6_pcie->drvdata->variant) { - case IMX7D: - if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) - imx6_pcie->controller_id = 1; - - imx6_pcie->pciephy_reset = devm_reset_control_get_exclusive(dev, - "pciephy"); - if (IS_ERR(imx6_pcie->pciephy_reset)) { - dev_err(dev, "Failed to get PCIEPHY reset control\n"); - return PTR_ERR(imx6_pcie->pciephy_reset); - } - - imx6_pcie->apps_reset = devm_reset_control_get_exclusive(dev, - "apps"); - if (IS_ERR(imx6_pcie->apps_reset)) { - dev_err(dev, "Failed to get PCIE APPS reset control\n"); - return PTR_ERR(imx6_pcie->apps_reset); - } - break; - case IMX8MM: - case IMX8MM_EP: - case IMX8MP: - case IMX8MP_EP: - imx6_pcie->apps_reset = devm_reset_control_get_exclusive(dev, - "apps"); + if (imx6_check_flag(imx6_pcie, IMX6_PCIE_FLAG_HAS_APP_RESET)) { + imx6_pcie->apps_reset = devm_reset_control_get_exclusive(dev, "apps"); if (IS_ERR(imx6_pcie->apps_reset)) return dev_err_probe(dev, PTR_ERR(imx6_pcie->apps_reset), "failed to get pcie apps reset control\n"); + } - break; + if (imx6_check_flag(imx6_pcie, IMX6_PCIE_FLAG_HAS_PHY_RESET)) { + imx6_pcie->pciephy_reset = devm_reset_control_get_exclusive(dev, "pciephy"); + if (IS_ERR(imx6_pcie->pciephy_reset)) + return dev_err_probe(dev, PTR_ERR(imx6_pcie->pciephy_reset), + "Failed to get PCIEPHY reset control\n"); + } + + switch (imx6_pcie->drvdata->variant) { + case IMX7D: + if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) + imx6_pcie->controller_id = 1; default: break; } @@ -1438,31 +1404,39 @@ static const struct imx6_pcie_drvdata drvdata[] = { }, [IMX7D] = { .variant = IMX7D, - .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, + .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND | + IMX6_PCIE_FLAG_HAS_APP_RESET | + IMX6_PCIE_FLAG_HAS_PHY_RESET, .gpr = "fsl,imx7d-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, }, [IMX8MQ] = { .variant = IMX8MQ, + .flags = IMX6_PCIE_FLAG_HAS_APP_RESET | + IMX6_PCIE_FLAG_HAS_PHY_RESET, .gpr = "fsl,imx8mq-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}, }, [IMX8MM] = { .variant = IMX8MM, .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND | - IMX6_PCIE_FLAG_HAS_PHY, + IMX6_PCIE_FLAG_HAS_PHY | + IMX6_PCIE_FLAG_HAS_APP_RESET, .gpr = "fsl,imx8mm-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, }, [IMX8MP] = { .variant = IMX8MP, .flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND | - IMX6_PCIE_FLAG_HAS_PHY, + IMX6_PCIE_FLAG_HAS_PHY | + IMX6_PCIE_FLAG_HAS_APP_RESET, .gpr = "fsl,imx8mp-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, }, [IMX8MQ_EP] = { .variant = IMX8MQ_EP, + .flags = IMX6_PCIE_FLAG_HAS_APP_RESET | + IMX6_PCIE_FLAG_HAS_PHY_RESET, .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mq-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}, From patchwork Wed Dec 27 18:27:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758497 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06167481D6; Wed, 27 Dec 2023 18:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="n5TxEjPH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XdwYhseCLSeSpPa5ribMcvVE2P67xusRZr/Lu2/eVx9aQyLEz7zzw1pjfaPRK00tuSfR+KIYQXM7cXRe+Ak4RryLhLOUF390YqOYauqcfmSgnwQ1m9vYX6Jc8h3tl1r6wOpfMLfOz+/Xd3iv0LIUciieXZlFKFifau6YBKDl25sV013HPONkGuwH6LR/t1B/vQWF3G/LqcLL5oTfjI0AZilIbAsUcpg1IN/KK00HJXN5zpxN+PJ0kXrXWcPN4BWxcjk4aKJORyZG5AfGXYG67RKePvH0V+GV4Ue1qVbDqaR1AvaQvNF03Ne8nZ1E/vCITeR5IZWjLj4k+zYqXPRTFw== 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=9RVrid8a+eD+TtnotxTbO7QIeCjkzOMmpoWCT3IQ2Ho=; b=oAN6iNz3k3xJhl79sCP7MBjR3RgpwBfFxaqqq4GgCjrNZq278KgA4GYVD04xUjTxXJqYnl45aTYf/OpRNGLQGHI5703HkM590Q283VDi/X6/RP/8pNPMzT71ucdjUQ77OmIfQ+clDZC7k8rtPwkhFj6/9eKoZ0Yzy6lR5MV5+71FnD/NxdsKRlsyzs9HYoA+k8wX4PNmTx4xKs8MedIe4TEoF3AbXDNYfLrt+HczKCtn9HPkmvaVOjDzA69QZJnGrNjomkYqqHF2jN0UXyskQjMiDmy6tgZ8Eh/zUHao8BhW4YLhPUXFWvOzDOBHAoFZRSqIrr+CN+EEamS98bc9pA== 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=9RVrid8a+eD+TtnotxTbO7QIeCjkzOMmpoWCT3IQ2Ho=; b=n5TxEjPHD0YZyriXR0s+E1mhZq4oo3GNFArC3mTcutNbuNUHFBxR3cfy2dH/ViIjQG4eD0D4U1v50F6+eIa63iejdPCIJN7QLVEGz4zxGTv6M7k7JtWQ/vseioUUgzEO1rgaOxF8GNyGx1Fn9Fp4s1EY3xOpsjUVKudDNh4b1vc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:28:16 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:28:16 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 05/16] PCI: imx6: Using "linux,pci-domain" as slot ID Date: Wed, 27 Dec 2023 13:27:16 -0500 Message-Id: <20231227182727.1747435-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: 15a90c3b-fdca-4c00-4fb9-08dc0709979b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2nx37v6Qs2mL7y1jNiMIR3/AhXq6UgxLE1cMR5/mNm6cmsGfsMBFABCiRiVZqmiw54ScqZIS0SCBfXCw0d+Vo8AxRr21d5Jr+qrxQj3YcthHs/bX5E84N5ci3b1dIGj9B7aFWboCyNKrsXTPTePfltMBrkG7NE6TS7wBJLP84/4v8wocRsA+rzIRR+NWdOxb+ConAthMyvaGhyc+eQHT4/U4aXg4dtUcexC1swBBOaCbu98/5sQ+Jo7Ryp2rGzTITuCQis9Ps0v495O1Lcm7jt/RjZVnyu3YRna8SWGjT/Spg4ezZ/K+QSTiWAxhTHekYaYDwM7O2s2wLhPsMw/JvtJMCv4hxXcBxItx6/JhSHdjKojl5OR4mf97v32kNDcnYI+yj+fPDmLqcyw8ugyaqqvuRnsiimyoLdTw5z3lY+cJihNfxl99RocZbcBeq8khHxWdYJhY/BPwFCLgl6ZwZpFI/R4mDYH9O3szJcY7eqsmDZLAz7kLAyQSGR478JkuJWSK5G0epnsEXQv8XfkRwRKgbfA0MJKhrRspw2MnhWLdopQh1uvITkzRm1zwhFKQyvYNGv6mGlH+2YocuT9VvZn79rtG1sY/YPo9g2u6aiDyy4+1k3rK4vI3tl1zR5Gs X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5OuciWYXMu0zddc8RrreJNJjPR/Sa2gFoFSH+ZUzr/IUdzZeVz5sHkcIKz69YdN2busIWZg55LEhVyq1/Ri33tM7wFvgYW3DyobH9YwuDYTB7Yp/3oJon8zHwlBUDGENdeoLTmn30KGH2hacJ/mhQCVU8GrFnLHvd+YW0w3u/+d5AjoBM4prXCdniN1cLrfpwroRK4MLFPJBTADhfR5zRU3nEOpg1lmSFkyxYkoTMaG3udEzxLb90W/cIxngoh1NKelui5J/BIK5vDgthd7KY8kAAosoR2Idlcfo5wywk8UGrXOYzrOT2qQqiKyMdNujPZP3/ujf7j9OM7QlBYDAn6SgS5N0uEZiiZk3hu422+pwA8bhePzCJzEuPW3hUQ9qXWAPVw/gytqX+HADEl+b1BAdfvTnvOwqY/CyZQZfyUOnnyLIqIDNxgjc568QeMg1bSERDO2hGkd+n26VhxtH1k6OScNGy8LnEkMRV3jR05tyyTNS2txxfQuaSVfPmYGKq3DSEHf5hyfAtayHholmRemHf1EauG99wvinrmZu7IVmXGMpglD4ZJOI7yfLRV+U7SgxYtBJXYt3Ree7IG5CB6mv7f+uaPNMDLwJMoSzClH5dUaCZBSx506oQAiiT/KFvplQNy5pWriaDPyHxC0bvgSQFXD5Xx24T0gwTsVPi+4uG+iOzcWPb4LHhEF4jRPFRdh6YW6C4+q3rcSQkY3r6TFGctOvAtzAgis8RyuPEyHXXdEfmcR/bec9DJK10DgHGwHJDFxQg5MIiLr7kKK9Ko7JezNHPivztI4zw69cra12qofnIynhsHNbKI3WFuLExk3Nf9L2z4BviSkbNEsp0vnr5LUM8JApWPu1smYzzxRbsGBGecxJYmH2lMi/XTmRXtrt9EJ7fb6ewg8PSXOMZJwtRgftgPEUO+k6Q55HlkUhSXg0Yrf4+GXyEOaaIHxJLFRbiYho3WxFZPiLLssUy2C9gqOa8scv34zpMSrHCZWSHGx4JMv2Rxf3pBg2tIiiEShDH4XU9LFpQAw94zLE1jJc5vjaVCXcrxM08RN1LVQVe5x/MqNsFA48y+nTQnX386jyjJnZT8au9RXrF/4/u5EbKySiQaj39wSeXMve3qMnUrKd7pQ1dsIDzHbaSla8WCAK1qtO55EgrF64kdRrmFNXKa1Q48InQj3uF35KsXYebvhtRuw95937bbwaSF/sRRC1cAxa49RiA4MYsaYYerhv4RsmWMYmgZpKdnxeR3TzARhf27k0+Nr65unTzow1UZMx6Nqb1esZPXe0ar7JA6Nm8e0iK8DaDpyr3bieZxXTZ41NGBV4jDDvsfDw5FXLGWgra0eKO0s4mVTed3G0r5982ezotsqC9hpAhEVVPm+7xbnsEOkw2cvh+ftOz8PLo4XAFfPD/FxFymSUTzGM6RiORQcRkniqkCACZfyONFZzMNM4172LNEJYBIG3QV0J3bh7GZyWf5KKU2zae9D0ad3peiTvvXZG90dWwkDUNt1J7Csg2vTl0crKdkcuDPuZdPKiyMcmRiEVnCe8YTO+o3mgRu5cJVte9a00OGERu/g= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15a90c3b-fdca-4c00-4fb9-08dc0709979b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:28:16.0969 (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: JqDoQDJQwgvkj8U6cPZ66V+VWDqpdhjOMVWM0T7vsRChglyGtM+CZLQdO+Ndz/aHbj8nbfAnb0aE4KQPkSwaLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 Avoid use get slot id by compared with register physical address. If there are more than 2 slots, compared logic will become complex. "linux,pci-domain" already exist at dts since commit: commit (c0b70f05c87f3b arm64: dts: imx8mq: use_dt_domains for pci node). So it is safe to remove compare basic address code: ... if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) imx6_pcie->controller_id = 1; ... Signed-off-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- Notes: Change from v3 to v4 - remove compare basic address logic Change from v2 to v3 - none Change from v1 to v2 - fix of_get_pci_domain_nr return value check logic drivers/pci/controller/dwc/pci-imx6.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 294f61a9c6fd9..332c392f8e5bc 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -33,6 +33,7 @@ #include #include +#include "../../pci.h" #include "pcie-designware.h" #define IMX8MQ_GPR_PCIE_REF_USE_PAD BIT(9) @@ -40,7 +41,6 @@ #define IMX8MQ_GPR_PCIE_CLK_REQ_OVERRIDE BIT(11) #define IMX8MQ_GPR_PCIE_VREG_BYPASS BIT(12) #define IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE GENMASK(11, 8) -#define IMX8MQ_PCIE2_BASE_ADDR 0x33c00000 #define to_imx6_pcie(x) dev_get_drvdata((x)->dev) @@ -1279,13 +1279,14 @@ static int imx6_pcie_probe(struct platform_device *pdev) "Failed to get PCIEPHY reset control\n"); } - switch (imx6_pcie->drvdata->variant) { - case IMX7D: - if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) - imx6_pcie->controller_id = 1; - default: - break; - } + /* Using linux,pci-domain as PCI slot id */ + imx6_pcie->controller_id = of_get_pci_domain_nr(node); + /* If there are not "linux,pci-domain" in dts file, means only 1 controller */ + if (imx6_pcie->controller_id == -EINVAL) + imx6_pcie->controller_id = 0; + else if (imx6_pcie->controller_id < 0) + return dev_err_probe(dev, imx6_pcie->controller_id, + "linux,pci-domain have wrong value\n"); /* Grab turnoff reset */ imx6_pcie->turnoff_reset = devm_reset_control_get_optional_exclusive(dev, "turnoff"); From patchwork Wed Dec 27 18:27:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758496 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2055.outbound.protection.outlook.com [40.107.7.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7506F48CC2; Wed, 27 Dec 2023 18:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="E0rxngrk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZmtmSr1r8qGHtDy8F5XS6GVjof7ls+p4vhAeyR0KZxr7z1eCnlkZMrjDLfkK8jB+5KhuaojCF2DF5jK1uVoy1FucwaPvl3QHCvwNcJG0fklD1XmI6WHfb4WuajhaHsjUIh6l2NcOcaWBK/z8f+dWXwV4lJenfxsuTRX4Gd7Ikq/REXXTw9lkWJdi98k19VbLfIY7xA7JgeIyoeCfwalNwA9FQ9Yj1HFmbg8S7Fo675D0gbi+QjjRa4fBeaGIE+w+mWz2Jn1JqLpNk4j+jnwN8ilTRb9sHF9mIHXhvX+5k3hG4WnTTHCRXHZWQeUBChI+MDczGyobcVaPXoCxFTakQ== 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=kVST7tU/jdCw6hjOhyZAUn8Z1JeHyuDnhtEpQSTZNgw=; b=Fap+7N/RSJ/XURwu21o7owwBAtOy99SS3Pkcziitwd7PZQWK0/Fj+0EP9lguvWL0AoVml+8Wp8NUuwIN0Tmb43IlXPdv51G01f3/r11WTZEIPw61L/hrStqGbB6BI1pBFvof0kOP/a42O+sT3kxreX/BKEDh0yXVrmRhdY+iW6aomF8c+zKa7mqkHcST+8avhWuaKk//q9zAlkhUrW6HBO5heEssQLwJhMTHeuMO0Tve5kVRoNvzRxV4gJakfI5zrd00W6RYMEgbngpLEEbRToFZ7a9GT+JP9JOtWdlmOHbO+XdNuHalWzs363cF4Wya3hz9DXmtoZq+64UqPXFzEg== 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=kVST7tU/jdCw6hjOhyZAUn8Z1JeHyuDnhtEpQSTZNgw=; b=E0rxngrkuTxOs272ubqlVHHz13F13LfsDOeRgmgB/fQZdTwSO+D99lsM95pY3uI0lhHGEXyV/a1PIRxx73NSFTRxxQNpB91+VAOsmsyB1KuenlevU/6rx6CKs011bv4dj3ChSUx1X9bJS/FAFwG5OWiLyV5Eh8M+lnQqA9F2VrQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:28:26 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:28:26 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 07/16] PCI: imx6: Simplify configure_type() by using mode_off and mode_mask Date: Wed, 27 Dec 2023 13:27:18 -0500 Message-Id: <20231227182727.1747435-8-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a9706ab-457c-4b87-a1b5-08dc07099de4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HIhCqb1rZKYb/0ednvXZTsn95tJklk0mNxaMC8tLRLMwLaPNu2csiZ3XokOrJmtGyeo+Ihim6eOP2rdMDgVvnCPHHvA3VMghNhdNmXYnFogmKLmfzTy8bK8OIf+/w6ae1r9fRQXBo8wvKXJ6Uy9ex7UxNFZl0WAbI2nOluC8vaTV0pZnWjJyP2T/l/3CfdV8+qTpP+9LlfZySVSYi0tTkIT8P590LZ+QrezGuT3Ll7eefgKyjaUbie3R65i6o+cO5ErMJmyQseV8Jre2vC/LHmcFeAUG6klAzTRZ2vHa7jEWTqNc36LBHP0d58cpJV+F/kFYDu3+/sdm0mctikx68zdWX5kbRcvFydlMJf3ZWFYRRWTafmlfy2YC3NOlftjhpVbGqA7jfGt32Ae+sxqXoMuoijYbs3kOTmSHyZ02iEO522BNw7LPR0diU8D/QdDUrfdF1bujgebw8pmTmi25jDv/qx8rhhQzaNEB0AadlD3j7LyFJdxitB8hfvGF9BOwByzvCSzUgU9/CAnM4ductYWqQGYwpsgudB2/IwmzSVuYgSy8+LJK3rdGCSJYwOn8jlD3KXSdLewepSIh7rO5+PsZYQQLZCC6ilgPAvgmntUDYDd7oOo+F2S0VIfZt7Jc X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6666004)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SOv8KpG3Zr6PuouDNMZRt/HlWbbjJ5P4+ngw2po6VMRZtfCDrSC8rc+Xa0UZH5mK+Eda/bOFSyk3uKpn4mO7u4L5E2amOhLWZMYnY7J09/vS0exO/bZuRd8UGobzmxdNnCUI5f1Pqwo/KPL3r6eME0UHLEaMmLcUPpr5vfKfuLo02yvBMOtN3Oa/I/W+fUENMGmk1eEygwRUoJ6NHyk0SYwmGr7GalP0iGd8Gdnu89b0vj9cn8l3ZeiUgDx2b7xEgzcuXjFYezvg61JIb14DMY6I1Qh99pz33f3FK6QHySOiPHk31F5bqtOWtO7Qgh+8xx8elgYlY97EN3jBOQol+ajlTRC7nz7cyNI/jSPt/WeRjwrHUWdHjNkPwJnYrqN1aEOOrvXN9HDZOdv4zR1UQ/Mx21fAnvLXvsz3kf/no1tG4bl1rampvaa4a93L/yMfZ1hJBvuuRbGKIk+S7zXlgJaiknssIcFfH0F1coij+XdhugpSodZNWhxIY0VYIMF1zZEnYLumj0xSggsjThY2EOlliT7YFjOO95CsyKZ710b5tQCFuQCQPK7p8/gVnLWS7ATNHFpySC9rA0XknORBdZO7CLYEk7NhMpZpsdt8CPLgPFC/XyGV7CXzSLddXNhnW02p5lJGiHeLKvqOB9QB3CIcpZxukSHXdehJs3Q6yfHVwvGh5te4BM/8pi/EYPr1ryPJVUX1HLsaJz2taphWXgTMdVoBkpqvXO9KlSgmVLVp1HFQM5EKFmorxLNchxua+pyZYE95m2VOrLQ066X2YqcU4g+nLqtwqL/Rfr7wMNaqRYA5PUQl896MbKrgJuKSoBQMtM9TOBhL+G4E/1DrtNIos17I3p5wDa/AFClE+neJnOkftetUufX+02niPh9c23eaPcflxgmfQaVG1fqH4bFad7vhmB7fqDN3qMOTcZ5ZF8s1l7kjfFTHrOy2zMlN2dCHSrjGNVicbj8opSuYT8P5PUayctQ4t9ie0Nlh/K2VpDMN07EGmpb7eArjT/ItbdGIeU/52G8lG15F+PGIvnZAjBHx41Pegk3bsWY812GdWnmOhXm4r6Pq7ENul/4kUXIgvrnFeQHvTyM+J5I216fAxyv/vLTDOjz0/Aw/ekqQtWsADFEX83VX8+jka9JhdQhTeWX31ocGnifnaoLQUJ1mi90HBVNWCCNI4LgQlxdHl7GeEmJEF4ebmwcz4syt1PGBX71xH7EUhrv+BiBM9YIUH2EVriMbvLy5fKvrgnSSzMWv/OfmiB3HLcDAqV+7JHz1D/ensjjC5AjBRPArYdTd4yOz6HR7xxop9w9/d6/ZBjgK8SZG+XFasI/5tnEyOTpyTKs6qZY+reuxuQrNzDmFY/f8q2RddcSc68b6uHVIi3CmMmwCb1iheOji8I6Jqr7R4XwIK+lq3/QpmsOqXIOIYd2a88XB8o81fX2hFTbeAuB64iz6aSfKOPB9Bernl2/bQ50FZ7UbXjbO/pjsg1jONRznQ1y+t1VCblQqgkZ9PQIrBdM5iKj+8worboRz3yiD7nrMN+vYRtKUMLw9Kdr43Sg9CoAgHzU+++mvpBg= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a9706ab-457c-4b87-a1b5-08dc07099de4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:28:26.6499 (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: 9XeHYQJFX4iGO8o8+FI9EFFPSI60f1TDUhGzWqvhrhagZvOjRkWUyBk8l1oOHS26xWuS95+uNKzkHMor6gNc9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 Add drvdata::mode_off and drvdata::mode_mask to simple imx6_pcie_configure_type() logic. Signed-off-by: Frank Li --- Notes: Change from v2 to v3 - none Change from v1 to v2 - use ffs() to fixe build error. drivers/pci/controller/dwc/pci-imx6.c | 60 ++++++++++++++++++--------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 588bfb616260e..717e8fa030deb 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -68,6 +68,7 @@ enum imx6_pcie_variants { #define IMX6_PCIE_MAX_CLKS 6 +#define IMX6_PCIE_MAX_INSTANCES 2 struct imx6_pcie_drvdata { enum imx6_pcie_variants variant; enum dw_pcie_device_mode mode; @@ -77,6 +78,8 @@ struct imx6_pcie_drvdata { const char *clk_names[IMX6_PCIE_MAX_CLKS]; const u32 ltssm_off; const u32 ltssm_mask; + const u32 mode_off[IMX6_PCIE_MAX_INSTANCES]; + const u32 mode_mask[IMX6_PCIE_MAX_INSTANCES]; }; struct imx6_pcie { @@ -174,32 +177,25 @@ static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie) static void imx6_pcie_configure_type(struct imx6_pcie *imx6_pcie) { - unsigned int mask, val, mode; + const struct imx6_pcie_drvdata *drvdata = imx6_pcie->drvdata; + unsigned int mask, val, mode, id; - if (imx6_pcie->drvdata->mode == DW_PCIE_EP_TYPE) + if (drvdata->mode == DW_PCIE_EP_TYPE) mode = PCI_EXP_TYPE_ENDPOINT; else mode = PCI_EXP_TYPE_ROOT_PORT; - switch (imx6_pcie->drvdata->variant) { - case IMX8MQ: - case IMX8MQ_EP: - if (imx6_pcie->controller_id == 1) { - mask = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE; - val = FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, - mode); - } else { - mask = IMX6Q_GPR12_DEVICE_TYPE; - val = FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode); - } - break; - default: - mask = IMX6Q_GPR12_DEVICE_TYPE; - val = FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode); - break; - } + id = imx6_pcie->controller_id; + + /* If mode_mask[id] is zero, means each controller have its individual gpr */ + if (!drvdata->mode_mask[id]) + id = 0; + + mask = drvdata->mode_mask[id]; + /* FIELD_PREP mask have been constant */ + val = mode << (ffs(mask) - 1); - regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, mask, val); + regmap_update_bits(imx6_pcie->iomuxc_gpr, drvdata->mode_off[id], mask, val); } static int pcie_phy_poll_ack(struct imx6_pcie *imx6_pcie, bool exp_val) @@ -1376,6 +1372,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, .ltssm_off = IOMUXC_GPR12, .ltssm_mask = IMX6Q_GPR12_PCIE_CTL_2, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX6SX] = { .variant = IMX6SX, @@ -1386,6 +1384,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_inbound_axi"}, .ltssm_off = IOMUXC_GPR12, .ltssm_mask = IMX6Q_GPR12_PCIE_CTL_2, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX6QP] = { .variant = IMX6QP, @@ -1397,6 +1397,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, .ltssm_off = IOMUXC_GPR12, .ltssm_mask = IMX6Q_GPR12_PCIE_CTL_2, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX7D] = { .variant = IMX7D, @@ -1405,6 +1407,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_HAS_PHY_RESET, .gpr = "fsl,imx7d-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_phy"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX8MQ] = { .variant = IMX8MQ, @@ -1412,6 +1416,10 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_HAS_PHY_RESET, .gpr = "fsl,imx8mq-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, + .mode_off[1] = IOMUXC_GPR12, + .mode_mask[1] = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, }, [IMX8MM] = { .variant = IMX8MM, @@ -1420,6 +1428,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_HAS_APP_RESET, .gpr = "fsl,imx8mm-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX8MP] = { .variant = IMX8MP, @@ -1428,6 +1438,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { IMX6_PCIE_FLAG_HAS_APP_RESET, .gpr = "fsl,imx8mp-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX8MQ_EP] = { .variant = IMX8MQ_EP, @@ -1436,6 +1448,10 @@ static const struct imx6_pcie_drvdata drvdata[] = { .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mq-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_phy", "pcie_aux"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, + .mode_off[1] = IOMUXC_GPR12, + .mode_mask[1] = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, }, [IMX8MM_EP] = { .variant = IMX8MM_EP, @@ -1443,6 +1459,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mm-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, [IMX8MP_EP] = { .variant = IMX8MP_EP, @@ -1450,6 +1468,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mp-iomuxc-gpr", .clk_names = {"pcie_bus", "pcie", "pcie_aux"}, + .mode_off[0] = IOMUXC_GPR12, + .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, }, }; From patchwork Wed Dec 27 18:27:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758495 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2080.outbound.protection.outlook.com [40.107.7.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B390C495F7; Wed, 27 Dec 2023 18:28:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="LupW/Qws" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UcRTtsAotYO0fhBbIqzNbnsv/v5Q9TtyX9gajlm8mkTFYizBmh0Gj+B9DCldjpATSkLD2tg1dfdVoTEUUu9xjqsQC5mh2QqkTkT1QOrpXbjiXlZsxArIAv6EdL7X+aW2efv7jkxMJM2gwoMptY3GmP8LwZ2BqfcYnVtUUiRQ1g4TDPJvSjWwdkfabw+U400weqCkoiVJHH5wT6mRvOzjA5dtS6hPAAIt+QDlxn7yuw3eWLHFg6eo0gZm/FBV0Fs3iicszFNp3J/Ol7+bZF/pR+ePW/gevK08uLQSMqxoNO+uTE7V8ZM9QubSGiI/fj7Bu5S8+8rZ3Ean69ffA49fhw== 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=tJkTHzjCQwUmpxaPt2WdiulHlG0YMJvncKXbLMUyMrA=; b=ldu9sO0W+Uzm3U1bd7A/cW9D/zjYstkMvT+03HJhKAoGSEQs9VUlJYA81niyXkkb6TfOqOsNDhszucxQcsI41O2nuGB5qYLNce29wA4b468xt6pr8IMaMzAS15zRzGWzSxNql7RmQ0QFOCiXeCDIkQqwIyAcWdJKMa1IcuWIg7OEW/dMSwxjfeDtjX6Ue8fB9TANox6XQMiNI1INi0JClDqKLM68SQGkT8CQAS1LZwrS/3zHWBG5cw1XTiiRdWZVFeX4cooMv66DUAXmUZBTjrk8bEK2A0bDjoQRfuKrRNoE/dNl/1Y11BQutu7CCq75jaRQ9GnyQxoFRs0hFZWRvQ== 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=tJkTHzjCQwUmpxaPt2WdiulHlG0YMJvncKXbLMUyMrA=; b=LupW/QwsTphEci1ZeYJbxQoPBce3mxxofMmdcRlvQZidrsBZ3a07pXLiGRj80XPANrnzYPtfgcbBCpPatP2SF8AHRR+WTWiieeEWXmk1kVK5APLHwts5qj4JdxHz0weR8xHWTWrC/Z8KGKS7MymK11IFwXwOWzFxPp47F636/+Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:28:37 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:28:37 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 09/16] dt-bindings: imx6q-pcie: Clean up irrationality clocks check Date: Wed, 27 Dec 2023 13:27:20 -0500 Message-Id: <20231227182727.1747435-10-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: a726d24e-9f97-4aaf-f32f-08dc0709a42d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: leea3dxdhVtoEjK7n0ANVlbBuzM3Z2/n7MQ2z1OyDevmXA8D79+K/n5QrFF13SsjIvdkiZ8sp373C2kNKq04mO2ONT1AteciskjpLM0Bqoy++YCL999iVa70+zPpU5ZOj8xBzgcK3TrXHJCXDmg7eFOHdH7ZRgKBPd9YjVeb9orcAADeqf/bOArl4mWWSji1pt6IMw5tjPk1uWTKD7rmVf1y2RYExP21FsA57ePLE8nFDc3acWDAtrSZY0dBgIM1NrUDj5H8U2ZKtkWwn80zuAwbFUK3LMgNLRCAeGLtUmT5JhLgHabq3b+y6usKd7W1bgOZEBtbftqfi3Snl19QtEy0pwQrhOeRi6UHcjOyCXXezVyD3qT9DWMzFFZM2OqKeuvOk3nPZ31p3edrg2NCDr4VkXH8CLILwgUl0pjhwcbv+KwQqT+8V7DwushOUfpgeQzgf+S69HQHXcl1xWu+KWqTOa8hfLc+nLlVkBBha6fw7xGsn0e3va4c+rqkNSab2IEbT1oEHItqM2at68onlOwo93cPr92VKsEZA8CRE56SZUmjcyoWscbYbmJLOad6/2Eswcin/7ahoAlgt9Npm7fUa0J229uMAY+AhvRnvMPYFn3GQpppIDs/Kxy3RA62X9qMV8zvzRqZ4p9iNiRoPg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6666004)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i0h5YnM4dVaqfu2fgubgsXAiUT8wyN2stgVoVZRIepeC049Q6OztF52R4LsUvPmFOQ8Ge7xgLF+1kzowiRkIJd+PiaNFaqkAHeCj1pSh6xiz5uCnmwpTHtFydESjPyekglbeQLchZENaq52ti/NwWMjtWi8oN1iSjXWg+tws253kYxeonWvskxTN1mGmFa+CrThfLMNEudYY1J2vqKS6YNDTbXTcy/wF7hVm5hIdN+C5N7ztu5xD5DXPQfRxeJ6yKAStGivFTL7nQEb+hgbvekH0cbMVXamqa1h7PBQEYx1fnODo585cD6FQlkDSSsvRpAn9970+v9cj77MU0BwRyjfLLLqM+QYxKS/GQVrsXSed5mlGEIUxEQWUwoqVSewKDnO6nobISxM0Pbi1G72xGNzLrs2GzDW3sOlD5/nKRF+GK9k0cP3pvzX/DC5LDnlDNOzJGt1YPc15wQVrIzSCzUeixvYLKZXOvQXwtPGpBly3vglrMh4LmgBTqB7B4B6DjYqvMBO9Fmqclgg9y1Cuxkg6CpaNJww1QZ6mZK6GHpm21nuKNqY6fTj0BGUyTi9CEsx0C1PQz3WdUdu1hPV/zKyAffKFdz9WSacKEMILobmiwtbDU9AAUYVOXGCxHpxk0yB43FoqqbHBirNY76qt62tudIxOzUBOuYjGVOeN6NMD+xLwzT/1oxCLzfi7hxXXwCHGTj98m/bSThNOgmHgJic8GEOJon4tReNXcBCNC2+Gz7gkU1SoUsOs0iITukSUdDNyOHFJ4fWd5I4aLlrWG+wIp267tuCRc3hGKq6Vif5UWxL8rT51YF4qBkTrsk4in9g9Ih1aYUhzOtvaINfT8ANCfbtoy1HsdGvJsThTjWMiOSEFkU7+/WSdnrjV8Pq8vOgxyCFVf6XLeKQHLxMEF9toxQmxzhhDc4zF6Tvc15W5Bc4BZ1CGTHDzSItv2xr9lHg+9TKaRLWPV36JyFvW1frw0SPgn3U8wdANxUZH6dmAZjmKLIAY3BHM9ZvkyAgYCmtOVwG+8jQLMZweMafKci25nTq+KQ7RScfxAZ4/YILICiZcgl7lGlE7/HtP8oFO9lp5KW8xk0CI0SyWgVsR6uDW4g0FvcYAzjSLYgQmx5wxZKXI+8zkHqKav383q9W0W8ih8XkMx4i4CtyPuyOAoygUizSiK5tdlc0NsImXzS62bh+zFt6DunGs95a+/YN8nLY+8AkasuIIANJ8F2hA2+MeGmD+kuwZ6E7HG6V702VqrTtf5rGQXZJPrggilW0edOQEULgQAGOKBokueGm1SUCcfFjr8lywfpz1Zoi2iVT0MBK5A+HELn0Ha/mpLB9D1PG2z6ISLvdpBnBRwDVXDTsow0CB2feraEl5aQx88g/f9aYnldQPvAyzM47cryXYKkPcUhsD5nypm3lDaXG2zKl2SBI1CuQf7/WKBckJ0bP7fqcmffslhm/YG5IfL+ptlz7psSR9X9lyzJI7cQMRVz0SSz65yRKPUx2WXisJa+drzmdmTFQv9dYq09ZkKGZzuz7FJg/bX3hysWNigliDo/6h58RSjlpRrKJ+sKAHN9k= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a726d24e-9f97-4aaf-f32f-08dc0709a42d X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:28:37.2036 (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: Db95d/lzb77iinjp/w3RBmVSWUOFtw1GPFD82EO2dqUGomuIA7VcXLg+sWoHbGq9UY+MHYWxx9lMHnH6VziMnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 The bindings referencing this file already define these constraints for each of the variants, so the if not: then: is redundant. Acked-by: Rob Herring Signed-off-by: Frank Li Acked-by: Manivannan Sadhasivam --- Notes: Change from v6 to v7 - rewrite git commit message by using simple words Change from v5 to v6 - rewrite git commit message and explain why remove it safely. - Add Rob's Ack Change from v1 to v4 - new patch at v4 .../bindings/pci/fsl,imx6q-pcie-common.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml index 8f39b4e6e8491..a284a27c5e873 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml @@ -150,22 +150,6 @@ allOf: - {} - const: pcie_phy - const: pcie_aux - - if: - properties: - compatible: - not: - contains: - enum: - - fsl,imx6sx-pcie - - fsl,imx8mq-pcie - - fsl,imx6sx-pcie-ep - - fsl,imx8mq-pcie-ep - then: - properties: - clocks: - maxItems: 3 - clock-names: - maxItems: 3 - if: properties: From patchwork Wed Dec 27 18:27:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758494 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2049.outbound.protection.outlook.com [40.107.7.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0A0349F68; Wed, 27 Dec 2023 18:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="M/WXM2n0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRFnMMQTwBVJkKIEjxq6w2mH1j78MxW7a0hsnPn95QHPATPc2WiEfg2BIiBrstf+pcS+JwK6X1u5pAxsIuJYh7I3sbcUSGUE8u9DSPpKAvh9N1GdSN/VklpEMCOMlizSkUfDR8HoRsUvwNPCzM2t/P6pbBiS3Sr81VapZwZtpSFoAzclHj79o7jtfom7DCcChxaiBwdT28TA2zSbdVp4dcIaOo/geu2MAY1tvoy+Wu2gPvgIg8SeflS8QLMxtJUF6oZYoH654TIF00HZu2xQnPqNWTQI5PDapQ6TYw9UeXHzWexFn5vWaG9xWwG7WlEhDDAT3JCmRK+6wTsy9M8Fig== 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=JbWvqYteYvr1zWHZKqAAJdl2+jva0a7FHdVtrlJj7y8=; b=cJyJQgyfHSODFGnjHr9Eu0U1Lw6rbNZUYJFsX4fzp/bG/3wVjmI2VHefRu87ZfYN0pRkQQHUUz+MrN5huCwUU1A0bIx3H6UbzZQSt2MaFzsK8Fy9Bf3Z0dB5gi5jOYkbYFiv7UxMPsUV5MyofrT8ckkjV0QPuZceR/rSzfiTr5rrETGPt0nE7rKoQ3OyRiZowGiEdXXgN48nfw5pys82iZJ+1bcryrTjV2guCxERjHXIS/HFDMWgeBGlszQz16e68P75ewOJxCUIoQr6z0VjKjVq2dy1aZwIBLDYEnNEyW4FDMAl6X22bJbpOyY+uUy5rmz3n9MmyzYXVWRW/rjT4g== 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=JbWvqYteYvr1zWHZKqAAJdl2+jva0a7FHdVtrlJj7y8=; b=M/WXM2n0NHXDsxTLeqZVsODyaMbmW76ymg2ahzncyP7YnIl5o0jju3xPY+RAjH59bhJDVsWExlXduBLp+G2oiy4rz3S9y1UbVcNgnPlSObD7wSVWEjMcVg87vZHHwiX0O8mSwyvzpSf3Uc8aAZtL9SuDOvk4q2LJ0MQ2uIHuwWg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:28:48 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:28:47 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 11/16] dt-bindings: imx6q-pcie: Add imx95 pcie compatible string Date: Wed, 27 Dec 2023 13:27:22 -0500 Message-Id: <20231227182727.1747435-12-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c2d6d39-4fa5-4663-a77e-08dc0709aa79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8h95sDOQFsm9H1g5rRZsWQ0hw9GKwO+OYmnOtz9colibmrne/xU7v3p8/Dk0LYt8kIY7QC5gVv8c7T73BWP67x0MRaXXQK+FBSR0aUBtML0EuzbwE0O3K+XkjezFY3xmblAE53vK0X/il3aECLnNqnfqfd8ee/AKtXpeIrLLE53q7PGQsBJxi0OZTMcQOADxSDh6gB1ALIEV0n6aPHDrXJqBXmpNGgHpUyMzKTjfnTrN4nDLuN3NKGlwcKmGVyCJsyYXBTTJK2nfWxs+2NtFXGg7xmHoUUmdLngi8yDJP/YQ1nFEESRPbJ3B6x8wMHnWpBdut48KfBRODTpzKKmmfTqHE5JjwYhV2YXN0s8O6Md3rsDLrHHx29OVtMLMEZvEgprybdll0Lnh6EDccWCo5IpEwF6fdff/xtY9aOLwPX0cAutHDwoZTmhnpaHqEKn178WZLb9d940clIR7tW7jdiW8djAloBPzp6jMSKN+yS1u87jpf5USHObZ6X4VvQxiyIIQ7rz5fjf7P6JBqMJEnkRT2Z9lQR0hkwulndEXee/7zUlDnWaO6OdM2G7tg2a4MmZTRdttG+YWQNtEMUAx0v1K0hKP30SedrUj8PMBVGYuxeaU0YpxPQamapVFQSj10da6r5SCGVJ/KpikxxM4cA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6666004)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eEj0Ka0i6EDImFpi1t/1VDKqmgYFKtTEwuzEYcTryoLaC+Sal3A7w5i8pNU9dsnasy2PUcKbUopuHWemnxYDHblmeSILtEQkdHqvlAcvuCSMkac6ZmP6vGx47svgVazqTszKgL7QF1BIc3GlG0Bu+PzbVWH8ihhKtqzZbuZLnAPuzaCr2+3hqJPVCrmlsn294zF3cJSxlalQRAY43Gpt+3nfCFYUF8ePVYKCrWe9KRkOxMhINercohRaRKKI6mTi+gBgN5BVroflk7fCOmVRNtJrEGycEscIOMaubG/A/6beULRraPkaEWlGqCfV5mKXOB/nZ1Z7HGu1w00Fi1cTzWsnNYJUCZm1kdBzwx33q7/KWTeGqRvHS+Ohf7e711x3jD/u0oFTzB6NYee0wABqjwDSwcxOj7NHmTjCC41WIksDee+QBGfiKz3H4trzWwIs2KzAuRjR0tvY0Wb0hf7lmAvMiQLVw8PbNg5a2gJOlHIGvysDlNs63tizKJiQZOm5L7DxsAQuvOOReV+pSHJJrI9zQWJ2WM0Q3sTvgie9eGgDreyIqi2GggiDLvRaZMkTdE9khYzNz4MbCwrHFlSTsjmK2ymfcC62ZEdb50JS+q7vnc6z2W25jjAxvTZFe00bMtNKm9xYdfOzqciMAvOmraP/1u0DukN/KessMEKeBhtYmqtuZQSKW5daNQNa5c790ftnNdpPC2VGbmxgqfGDR+GZXP+idQuA39IWgLWFhEYz/Nk+uhpYaJevBs5ek00b3BwxgNaL4CFfXUowBmMRBlIDacIzceVc1lSc+tBkrEWRq2VJh8jqYSPRbP7ySDyIt/2yk3ulbwtNgJ0Fjdpa69FVA05ittgVE392p779+1XKkudQYY1qE1TB9/DKrv9fI9FLXqvnKNUeEQBNVA6gwfdDGzReNBKUXeSeFFVOpo4CHgKCe8nQbsgKS1MWrhFxHvRGA1tp4gkMaGnY/ndzlgoFv24XMarr8EzpZ1qcona8yWRU/8bHukDSReAwMzWxiuVggy4V29aWThhe+pE6NYaKdWNCTQ57JzPMrIt0+X8l5ejrS3nIFsFkvV7WLIevOMdeXt2/8dn/d7Ha6b4CZDtEduwvMp9qoE+GIztSKxxBkVHPVmEv3GmGNDDgPLIxnpLm7zZygsEq5iaQqgZbR0ESCd4gwhkaoR0zF+veB/rcYS2CcCh6FrONOTUpmhqR0YuJV3s4s6SVxGZwqJD5wbFbPQ4S6om6PZw4hx4NXbprbSPYx4L70VPL2cM/4TGmjzfJRX6wA+/gbqULU9eWztkfz3k6+hBx4VQCyyd6kRgxl+/qv/ivzoN79DkdHnmLH18BD81rQze+JhYSrTuW+oXJd5AhicQcYfK0liJMhX9GANLHKliahhLGGz9cVSBcnmhLO1NhVx7klIeNtc11VRy+UaVqUj3XHCB3ZygY0flvTHvkTEpQOMcWgkaO7nr3wDESXaXkzA/iti3A5+5OSqEM7kkQGxrrsC/ahArkK+ZLy2CjOJOJI3J3P5UBqXasunUFg0Csah18xxrLp/dYtLrFD+Cy2tMUgjKvCexJ5TY= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c2d6d39-4fa5-4663-a77e-08dc0709aa79 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:28:47.7697 (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: /JEfqonJivWpiS517OXcF3KvLu0lZMHfctlT1NnPW/N764nsAhjruqap+dPvK6Vb7jGrnEgK1mlw4cPfLiWEUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 From: Richard Zhu Add i.MX95 PCIe "fsl,imx95-pcie" compatible string. Add "atu" and "app" to reg-names. Signed-off-by: Richard Zhu Signed-off-by: Frank Li --- Notes: Change from v6 to v7 - Added my sign off Change from v5 to v6 - move atu and app after config Change from v2 to v3 - Remove krzy's ACK tag - Add condition check for imx95, which required more reg-names then old platform, so need Krzy review again, Change from v1 to v2 - add Krzy's ACK tag .../bindings/pci/fsl,imx6q-pcie-common.yaml | 1 + .../bindings/pci/fsl,imx6q-pcie.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml index a284a27c5e873..1b63089ff0aee 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml @@ -207,6 +207,7 @@ allOf: - fsl,imx6sx-pcie - fsl,imx6q-pcie - fsl,imx6qp-pcie + - fsl,imx95-pcie - fsl,imx6sx-pcie-ep - fsl,imx6q-pcie-ep - fsl,imx6qp-pcie-ep diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml index eeca6b7b540f9..8b8d77b1154b5 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml @@ -29,6 +29,7 @@ properties: - fsl,imx8mq-pcie - fsl,imx8mm-pcie - fsl,imx8mp-pcie + - fsl,imx95-pcie clocks: minItems: 3 @@ -100,6 +101,23 @@ allOf: - const: dbi - const: config + - if: + properties: + compatible: + enum: + - fsl,imx95-pcie + then: + properties: + reg: + minItems: 4 + maxItems: 4 + reg-names: + items: + - const: dbi + - const: config + - const: atu + - const: app + - if: properties: compatible: @@ -121,6 +139,7 @@ allOf: compatible: enum: - fsl,imx8mq-pcie + - fsl,imx95-pcie then: properties: clocks: From patchwork Wed Dec 27 18:27:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758493 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2075.outbound.protection.outlook.com [40.107.7.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CBF647F66; Wed, 27 Dec 2023 18:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="e/QdcYeI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WLWqnPXXqj/+Tx208pO1CddN+VCrmKkAB924WdJcoyweTAgRXxLZTtNMGO7SzB8JBdxTyRYaD/Q6mJ35zTRVATAOkG/A0yiaY8LO13i0LYr/sOSYXHu1f89HSSFxK8SkmHyEuz79xAeSFgZrw4F2LzYV9iwzx0lLhbHKd4Tt4Nstq8xKk2P9WPJ1Wh/u6qfQeGb+yWHC1g0c4PwCvRmEMqSgL0wOeXugxB4pKciROpHsAZwmHmL+g+dV/F11I5Zqia3dVrU+iiIPfBCZE8fYngezdR2IjtzqCBCTYbbebguGCrJbp9lgOQUotFzgh5FOr8DbIkvSuZhXHUiwAjDRbQ== 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=pouqXGwboygEHGEyEH0UcBGMdn3xWvJFgCWv7qfcMzg=; b=ToEsJ0ir63eXajvlNUxOZ3wSsDdQTj6XV1DA5GEfl5nbjuVRi4AeQXuEkxNj1mCx0AQMg8uirM4TpufNhdC5jGzQyUq8QUAzQ37mWfxN0lUnp8Y/oJTRWlFU7p6Ezjsvzj68e7KJR0kwJhRBXffdNR5Ah/wRZvQ4lpnilLkNtyxtmP3Qf3IOcy4QVprmizMbckIY4KQz8dvh/Bun1wg+y9qwbokaY79yGPtbKHR1y1p6hub5M7HmpTL3Yzom6KyeXMouFsVN6LXW63tZG7tZl0fsBLKAJLSiribANhGQqxSERfAHnM6tRs/ypPlZnO4W1g9SJABGnCl951a/N+rmLA== 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=pouqXGwboygEHGEyEH0UcBGMdn3xWvJFgCWv7qfcMzg=; b=e/QdcYeIoBZ/rUqYbaL7PW4aLL3wJciFxbCCSQmN5nzllxWdQ/wCt66PWCOh0eVl6g1/cxhlRh8ZE58gVQO2kfgin4uwnxBGr7G/vIAtsLt8f5CbdU0fx7roaKM5I+p7K4Z2/uFDyDrsQOkqVyv6gl0VIqsNFdKVSwyHMbAOTMc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DU2PR04MB9050.eurprd04.prod.outlook.com (2603:10a6:10:2e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:28:58 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:28:58 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 13/16] PCI: imx6: Clean up get addr_space code Date: Wed, 27 Dec 2023 13:27:24 -0500 Message-Id: <20231227182727.1747435-14-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DU2PR04MB9050:EE_ X-MS-Office365-Filtering-Correlation-Id: 2147a8d3-9d2a-48df-5b84-08dc0709b0c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JCLNRTPv87Qrst+9KLNGvKXi+S8oXe4EyK4Lh7bmb+cv4ebm7Xt77azr5SAmtgjoPJ+F22SbczWqkRVK1OXgOzsirFeHL2EBbBmdoDpNItflMMUztpw2SIWv3RNK8KlOWW17BPq8pa3HcF7rkBoufZfCwY+MtKovKCvl5ZihQ1keH7meZH93T0+bclKSjMNg7Y12yPNaa2MDj2MOfVtq5KqLUVnA2ZbujAnyqAycmFmWy+Zi4P2/Z5F3nefRmZhRjEcyjyQ6Mwdq5TcYmBgQsaANoaNeetp54+J43Xevla6+z8mgoB+nTo7B22kOs46aW4onRVhrTWQ4nMrov3QYQjm2hDUoXx6nFasU0fvtnuLjXOzxyn/ltSW3FHYagA+tcNtg9csjFU8osnA/7hHHSOvOESlWyTiPW9pdS4Ub4IdWOZlwaf1ViMCBKwxPL/SZ1qt0nU9FyG0agGWsnSWTmtkHqkRd2ZNBochXH9qpIUNE+vL8WpdoeyvV+Qpr405LImtbKjPAVU0Nx9Xdso+GCMSqnX9TToNGUwiv+Djb45m4LrczyXxMEww7E6igGG0tTV5BQ56Y4a0BN9kLd2VlVTvEP6yaO32Rf2bJcErvofyJmeD49CkwazxvZoMZ/BZU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(136003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(5660300002)(2906002)(7416002)(478600001)(38100700002)(2616005)(26005)(52116002)(1076003)(6486002)(41300700001)(36756003)(86362001)(38350700005)(66556008)(316002)(66476007)(66946007)(6916009)(6666004)(6512007)(8676002)(4326008)(8936002)(6506007)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fCnbbb39zlxNL9IHmBiOxmmOFakr+IqIZSNgXEqK7UZsapjaOK63gyC912TgYQFA9wiw0/tJaem8x5NFm5IKklY0ySDsElED/2jAzYRfOoy8lsJLfOq/e4POG0yukyuSOp0En17/OICfotDy/yuJXQ8bJjI+jAFiBb2yAf4Gs77mgFEuJ/NT40YMxA02DvlFguW0w9GS5OxsoZPP5+6LpK20tS9oJuqewcUtFN0ZwR6eAsEbm09wGTU55ngwAQkEjStFs4bR9/rcg1MJc9qh3h3inFX+mBsjkROXNoLT3CbBSxeomi+ruPaRHmO2E4Z5H6eVNt02cZCOlGA2Njl6vNwQFhd+KEHrlGRm/iMaJIQp9LxZsu0pg+HJl9POtpsi0nnlSDZGI+ef0ILU9zPN19YCJU1k+w4n7JGSxLZQrYHp2lvMVaYIZ/W2xcxIbSQyXPm7afjixIMXu3gYzTBU0lNKEM0EGYIk1PyOIU7yHcS4JDHw7Kt5vt0sK69pEJqi/W5/O3ER//bM+yWD883uY4GxplRTp3OfBnDUVRSlGqLfTNQQxPDRHql8+YUOoDI+yfwglgzN+G989abUBtu/QTGscpGlBGGSxSOBVaEUXi4DrR1CUSn3M7LGRA0UOBMSWLUb2YVhEhlZelMn7vblcy4SI22uUPtj+9TVJAWE0+bN9r43myl0txRcbndtxMPn8Op/hCTsFSBgSPKG9j0To1DMJ7L/ijNSjtg44C2k1/8STorJIC7WXDxECOCxGwT65BYhb9r04T0/c9uMlbcbRvUdj9yJM7ZPPeiauBFTVmImmP1LNJCbLRjN2mwWo+bGMs5hG4UTrop62yWJDqzfF1aXH1Il0mDrhBM0uI5rW2mhVLqp7gjzOP+z+GkdzQRDTjQNX0WBvmbnNlJgU6XbJIt45WlXC/4VeH2CUX4T1Z2ZVOpQPQD6aCksP9t631rTcSEsk+07NBw3Lb0A7sfqy7zg8Si7niEywY8ZE/080zGevhDF8xdLSwn60Qm4DMo/ubTWcgn0qlqCqWQ2Kz3NeFW0x+Th0z38uH3qhWCs/MPhTCot0b/IWeLK3l4Sw132GBWbJZs/GlqVA2vPzRouvN5YGPpbwS/wMEyOKXvdut5mzK8NgPAIIMIFYbnQYty8FMXpPCPSlfq/Q6UTEE/62j6oEm0ys5JqXyCweSt0BO3fdXv67IOxQhbLiwWhrwnZMfoU9337+Nte9PUTEhX67fb9eE/2u2pRDNcXkNCv+N4pc75Sh+MZ8AEBY/S4rAeGLkOEV/Alq2eSlv7ZA6E0pcRQlu+X4IAm0K3girviajH0TaYMiDuRocHLF4SV2u/9WhKaw4rTYK5mWEBLoWqidqX5xzpB2R0cu3eRdBRXkhsNQ/qmrKGl3/ZkGvlmsS43wJ1S5Q4CSj5R6gc5v+yvSX/0CbgCdbCJLyKA2BEmNNzk98TNU60oal8uiEzLEZuBoaQqPIPm/OI+zFs69v4McZcyWUTJszgkC2PELxZ3uCfSS38VXnjT/q0DB/nKa6ZlKiSR87r/GkN8ZwMIuloRHHlfuTf96NApvJVivzowgwc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2147a8d3-9d2a-48df-5b84-08dc0709b0c5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:28:58.4517 (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: BbbWFmsxdDyDS7Ce0g/HqvoIUpfY3eTv+KFFnIr//vDpEUy+ll4j5wYN0dN/lbwIBWDEYQRDcR7HeR6wgAVg9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9050 The common dw_pcie_ep_init() already do the same thing. Needn't platform driver do it again. Signed-off-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- Notes: Change from v1 to v3 - new patches drivers/pci/controller/dwc/pci-imx6.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 9e60ab6f1885a..4b2b9aafad1b4 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1080,7 +1080,6 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, int ret; unsigned int pcie_dbi2_offset; struct dw_pcie_ep *ep; - struct resource *res; struct dw_pcie *pci = imx6_pcie->pci; struct dw_pcie_rp *pp = &pci->pp; struct device *dev = pci->dev; @@ -1099,14 +1098,8 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, pcie_dbi2_offset = SZ_4K; break; } - pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); - if (!res) - return -EINVAL; - ep->phys_base = res->start; - ep->addr_size = resource_size(res); - ep->page_size = SZ_64K; + pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; ret = dw_pcie_ep_init(ep); if (ret) { From patchwork Wed Dec 27 18:27:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 758492 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2068.outbound.protection.outlook.com [40.107.104.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 758BF4C3B6; Wed, 27 Dec 2023 18:29:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="gDw2mRSX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NNGNthzRo1zCiRmU8NAocUUQzwNMWzp9nVdcj48cByh981VLfMb5dLVNLJVR6CO+JsYaNEDt0eDFIQjJSJOJiUzU042Sofkb7098PvFaJmCKQ/faarA36LDQLARcQhHaMC58PUo8/aiuDvtSdhXXj571rQmFOm9NeLILNRluP0ColNt7oz3zbIjmc5ogJd8VvJhOKLKzXEZOi8KL+VweqymNuP2OqVUpNI5L9Sv648co9+mgyQwkwVc3PoOFKq9M0tkGcWpHYpZSxhtUFWC0nsV2x42Mvl90AF399VisJDvJtKSIlVicf6UCWF1DkAecBNb/NCXv+csEZtTMN7pOOg== 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=KqwMa6eMbLnQJ2/DnJpJInA1vRcpd1Bx4zYAn3HEDQw=; b=RYREh3KJ5RVQdNX6PZ6jcGYkGV+M6aawNQ0DgqLRmMpeGHNtNxaItXFvYid2YuXybYVwH07V4ah1XEf9/MBa3sjjga/T7SrGBW46uUR39XaH1sjGXH00vXnK5BB9BJh7nuVyz7PDEX8dh0FNoOKupxkkY4IuLuHuRpFtjzr5/4KwNTTRVqmGE99K+16A4cZcZhdD1MN1m9Zs4e/mepTY8WqgF0wXajvnaUs+Klh9LAwc3vS2mxbkQSICPLT9rnfAtIxUx9eBwYkQBix38F+o6Gdj9+xQwDLX/al61i3hpgMl5A1WjTl0S/tNUIsLmfOrmmEsLp02eB9WClOC1230tA== 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=KqwMa6eMbLnQJ2/DnJpJInA1vRcpd1Bx4zYAn3HEDQw=; b=gDw2mRSXqXN5GDJ1UK1XRGex4WTEF6nLDD9L5ePXVr9D7USdSDRUxx9Zu8tx39hwwd9FlYQAPxiWtUhdzinXAeit4zuOW1BcONMV4oxc/YpiVcAB7BceHU87I+YIti+MdTuOikgQqw0rwZOlPO1WIi3HML6vjedCOnpyoIPbVAI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by PAXPR04MB8271.eurprd04.prod.outlook.com (2603:10a6:102:1ca::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 18:29:09 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 18:29:09 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.Li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v7 15/16] dt-bindings: imx6q-pcie: Add iMX95 pcie endpoint compatible string Date: Wed, 27 Dec 2023 13:27:26 -0500 Message-Id: <20231227182727.1747435-16-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231227182727.1747435-1-Frank.Li@nxp.com> References: <20231227182727.1747435-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ2PR07CA0018.namprd07.prod.outlook.com (2603:10b6:a03:505::22) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB8271:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cf2aef7-f2dc-417f-2290-08dc0709b724 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NLLQGUMP65t8rDxO32E/O7/2YAB5RPElre0m46ytZW5fzcNMqnHhe2G1affeudrSVeQjeW8v5sY37AnpuQIL0Dxkg4Y0N+5DW9N14AeNNVYZuXdHv2lsKaCG2EPIAumXPIVzbouRka9KIQb2mLauW4U9CH5vN40wYMZVAqhAWgKf+tQsESupxiJQHtyb4icQWGSVtBSEz1syuc8voCPnRyUSSAHMKMnQQmxUDC/pwITT31H6MEszHnr++91OhR/6HsNJUv4ejLSuUg4i4V8HiDtnSYhjvHCgwidmSNtIeo0kgENRiN/CEHgQUOCFAbHwjd855sncKgL+D79ZJVXWZIaOUsKvby3qhjWM040hZ6ED/sAJ4X/gHUzUa88HZwzRiAS816L5FyAFlVn2bEaUz1SDacmbgyE9li6OPRT5hgibbGy8Tk320ODyW+p8TJ6R0GBFNyE4gVWVOldvNC/tE6pjwp10OzP05vDyvp02pwCjW47c3dOtTlpB3xymCLJViaMD2nT72biikDiNrZyhluV0ggqbZmV/3KyHqUruI9XbEgVEBjhaxX0//EW1M7N9FFoopMAZNFrF/nYZyF/Ydzc79FpP/Hl63x03cAmS5eyYT+QiIYULKu14O42bKaone/rfStJfdnIUNCGxlrIkPA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4838.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(39860400002)(396003)(136003)(346002)(376002)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(36756003)(52116002)(6666004)(6512007)(6916009)(6506007)(6486002)(66946007)(66556008)(66476007)(86362001)(38350700005)(26005)(38100700002)(83380400001)(1076003)(41300700001)(2616005)(2906002)(5660300002)(7416002)(478600001)(4326008)(316002)(8676002)(8936002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PMN3hWb9CUOW17xIdSTIBYMMUDE3AWETA/YZ4Ipv1ySa6gJ25eMuwCl+yAUWshnKhf9o5261wgJidj2HC634K5xgId/VjQBxiq7QFvG3/KbUKb1TGmIWKi8z9s2/O0W3DodC30wfMHMYzXf7ZIvNPmkbAxuiWxoCUx/2hmHJl0dxlwVzM36wyqXYaAFWExLQCyon0gVvY2A4zIHP+fl7w+zAbe0d9OxkIUhnr+jS04lEnXgKDkq7qCPJCrO0V227Nb9O/NbMG12vFxFhgMn8XrQEPZXq74dnYfNyKHNDDb+HVKdbsEhKxpven46XgO/hWW2cLlObpSAEPST71U3eTtmr+SvMEJtom/I849//ToQYOCCxH6OamrOd/l5wrKx7xp9K4AwHkhXvdhd+noxkYhRGu8P1HT7rEvvYFo3n1x2iWwLBo1fbLVHtV/+YpTXLT26Iln5TcMVGWxHB6mOQMDfNt/OtX0llCDNv1mya8z6iaooi2Sq4xVuIM/RcALkIev5XH0Yi00Oqm2mr+nLIrXACnNfwsHZ/a2ct2IUDw+ca1tY+z6AVuneGgaZYfX713PI6CZxsEtP2L2C/87NIiQEUs5MSbFVEaupzenJlxpUbe1Ss1Zzt92Ea0XwpMw5jRwOR9Y4MKpenv+7Xntw1feqw8GvJxf3myhCo07m0E/HeHBQUOdYVV+HMbzuF5YyOHiKoPqcivXI6Ij5CMv/RmP4qTg8anx8SITTRr4SJcpsd/5yXs1QSnP55vFvLVrdAdHwKmrwcmCN/4XGxhKx9kQ8CuYSMiAbwnP8zcI3eM8DANCYF8PhyE5u+EWG5ARrQwE5oo6kYorTzB6XmTRFT+GOdS8YTtJCKbw2XPs5SCIzXWLsisZj+JEaaFzqSOVV6dqIHJIUphp2cjoX561qX57X5CK2FboIv3wp6OHf9Csb9qfQdMmUv808GWUYEuJTJkuocUmCOHREjn3J7PM4uovx43GhrOF/K7i9q3l/9D9xNCVdJ/I+ChLNBqiZ/cQrddw9R/ka7GnuKp8TdR1ybVZ4z4w6f85dGMz0TDT7MK53MO56kMcforCHEe/S0HSBYCGkKl+fd/Fvci9DM1aeFW3dyZwXGynIpAT2TDWlJibN+nE449sOFX7RCnS4SjpHScVvSv6Ot/2ecmPNl5qY0nAsU+nOxJJzxkag5cr/p5RM5VkuOpql2pcrPzkINnFF/SfOB4qApldoZMB68uGL2VaN1OTPiCQW+IlpsTPSdQvGU8xIUMiy7n3MxzjWsnuOBqfBjg6g1hFsnkhKXiwIKaNjGbzC011KDcndRefw7sXjCZWQD40GUSQ6AclIsPa/w6geFnJaFOwZ7or2C4hgpZ5YCC4nG5nDDrmMpQ9fwYOJUt3bEF1LM9g8DAR0U5og05uSj00U8oAGt9jp6t3rrILjmkLVCscv/izDSrKTr5LqE1YvFty9hTpLBCWFSGe4qGw5nr+DJ3A2ank2ShAI4GJn8iRbDZr4NzHJpnEqTlo2mMNsfgPZzCuJxC3+N5cdJ1uvKm5fydVo5bNprjGKlmdwCJ7oOHQBDJSJnvjrNYIM= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cf2aef7-f2dc-417f-2290-08dc0709b724 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 18:29:08.9995 (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: 5ePVppjzaezBlAenKsjz3WKXFS/48oBEdsrC7kKP/Jd8AfW34K2lfxHvsjh99KYVvlE4T1X4xDSMTenzYFu0dA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8271 Add i.MX95 PCIe "fsl,imx95-pcie-ep" compatible string. Add reg-name: "atu", "dbi2", "dma" and "app". Reuse PCI linux,pci-domain as controller id at endpoint. Signed-off-by: Frank Li Reviewed-by: Rob Herring --- Notes: Change from v1 to v3 - new patches at v3 .../bindings/pci/fsl,imx6q-pcie-ep.yaml | 57 ++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml index ee155ed5f1811..f4d6ae5dab785 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml @@ -22,14 +22,7 @@ properties: - fsl,imx8mm-pcie-ep - fsl,imx8mq-pcie-ep - fsl,imx8mp-pcie-ep - - reg: - minItems: 2 - - reg-names: - items: - - const: dbi - - const: addr_space + - fsl,imx95-pcie-ep clocks: minItems: 3 @@ -62,11 +55,48 @@ required: allOf: - $ref: /schemas/pci/snps,dw-pcie-ep.yaml# - $ref: /schemas/pci/fsl,imx6q-pcie-common.yaml# + - if: + properties: + compatible: + enum: + - fsl,imx8mm-pcie-ep + - fsl,imx8mq-pcie-ep + - fsl,imx8mp-pcie-ep + then: + properties: + reg: + minItems: 2 + maxItems: 2 + reg-names: + items: + - const: dbi + - const: addr_space + + - if: + properties: + compatible: + enum: + - fsl,imx95-pcie-ep + then: + properties: + reg: + minItems: 6 + maxItems: 6 + reg-names: + items: + - const: dbi + - const: atu + - const: dbi2 + - const: app + - const: dma + - const: addr_space + - if: properties: compatible: enum: - fsl,imx8mq-pcie-ep + - fsl,imx95-pcie-ep then: properties: clocks: @@ -87,6 +117,17 @@ allOf: - const: pcie_bus - const: pcie_aux +# reuse PCI linux,pci-domain as controller id at Endpoint + - if: + properties: + compatible: + enum: + - fsl,imx95-pcie-ep + then: + properties: + linux,pci-domain: true + required: + - linux,pci-domain unevaluatedProperties: false