From patchwork Fri Jan 19 17:11:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13524026 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2069.outbound.protection.outlook.com [40.107.22.69]) (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 3234A5A0F3; Fri, 19 Jan 2024 17:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705684380; cv=fail; b=lHZDlNHedQz47VmpBRcCMH4ZpRjmbX+2CWKmxBSpnm1QRJFNmgCnEgcG5kXTPAMt5O3ItcK2I/gupmaeho83W5RQc3BiLuoNLNbSPM3/qbAWPpGFmNZ1JSUprv1dLoAz/7K9BifaWgNQKaCeUSFXzmAVAIb/acinzWSTjTeYlv0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705684380; c=relaxed/simple; bh=aX2kTfFTJOTjQdaIHXjavecSGExg6HdmtZPNEUTxQbM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=WdwpjOxf5tdIyTceR5/XuTMyqrgz2b/3T9zoio5x2yMFouWUP8MhD3c4v4LRykCToWnawiEkw0DNLwXTHpiGKp8e7zuFRv2OuX16KlMcEZT8SWTpoVMQwqksGQ0S0C7yZB6DzJsxvDdpLupZbonpDilhx2j2YTul6yuDByJ0nAE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=TMlt01eN; arc=fail smtp.client-ip=40.107.22.69 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="TMlt01eN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=io7KPmd5upo/kz9lnbAQjxqdfPlz2xjp9LPMmz0rRfe1cXv7KCxh9g+TXrEuUtpsyTCzZ6ZzsQUvata0wB5VWK3zADjHBQ8VWgJzMnek4kvi0UKzhmWiANG+lKSNbtcuYPtE1ALeXUsxxbsU5xEqEwp39ijxBuX9MPv25HuZDSkhdP24KG9TtMq78WP9oNOOYcgt5SN5eqU6ZJUP3GMleEAPgs+b67sqOSL3Pj91GTFcnW0bBy8Mv+PNto/ij7qrLaRcxbZqAjvFS8CyhlHHk+eSf0jdPQ1vafN0xDj/rUX34AB0J1GWNPCKiiF6L/Bkbc9KNAEi/afHh9QhRBAI/g== 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=mORbb/XK4m6oYgU5P0b5hJ5Fygw88yyPr9Eg3vUULhc=; b=GGSq8fdjLEEWSI2dp0irYnRv3pIfUH3SGPN3AyEY/gicbTLFCENh/BLQa1fMXUMJkSH7P3fShqo+XYdQ/BsiQlKdh9rQHNY2Mr8jImKvbWCiQc1GL81RZ4k/74UoQKSc3Qj4wwliJjlRfHM8nrNAc9J3qK0tHVZ6Lti2697unLbCzEJ3W8xM2qLXcDWiwZktxzxyhZUS6ebeonvw+Q1H2YNoW4xLf4arwsdgGaLV79e+65FqISa6YgQT+0AcO7ztetOhD+HtI8e3cdwq/Q8oL5+fmHhGR7kl3jyOuWAFHSsnXKtmdjO71EjpNb9o8GukjFEZDx6+dtrablmefwLFwQ== 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=mORbb/XK4m6oYgU5P0b5hJ5Fygw88yyPr9Eg3vUULhc=; b=TMlt01eNoQ1/BwWnhZumY5D8/5olICETlS1gDAVlxDTLTSuj7Fama9nw8W82GuflDQeoHmRw0Twc1QFi3S+0kpTKS0q3G68sKNsubm4z2ioa/t3vAx+2rIj18/Mb2ehNGf3v+Qe8sPClx7jIG6SGXjlzQusGrV9RseYBQDUEUfo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PA4PR04MB9688.eurprd04.prod.outlook.com (2603:10a6:102:271::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.24; Fri, 19 Jan 2024 17:12:54 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::b8af:bfe5:dffd:59a9]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::b8af:bfe5:dffd:59a9%4]) with mapi id 15.20.7202.020; Fri, 19 Jan 2024 17:12:54 +0000 From: Frank Li To: manivannan.sadhasivam@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, krzysztof.kozlowski@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, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v9 14/16] PCI: imx6: Add epc_features in imx6_pcie_drvdata Date: Fri, 19 Jan 2024 12:11:20 -0500 Message-Id: <20240119171122.3057511-15-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119171122.3057511-1-Frank.Li@nxp.com> References: <20240119171122.3057511-1-Frank.Li@nxp.com> X-ClientProxiedBy: BY5PR20CA0023.namprd20.prod.outlook.com (2603:10b6:a03:1f4::36) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PA4PR04MB9688:EE_ X-MS-Office365-Filtering-Correlation-Id: ea694171-f8e7-4a23-aa0e-08dc1911dff7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sYlVnyu5XdowAaHmVN9ji5aVleTdhhsKk7ajYvXJsxohWlMuLFM8iHOmnbx6M0xpr4zizcV8NqPRtYWEzgMrBa+ULTKPQoZj1DvR1z4OmoOAFJO8dmDDeWCgBb8b9i2Nk/2SjCo27qq2V1HJCRvkgUo+NluVohCzYs7vphSt6wDm9kaLOqgjfShUcyDAGpEaPkDFdzqSyWUa2VbuC+LxE5HGlddWIuCrYasomhN/Td3eheJuMgqqdEVPiFMHrfASY852nGS1Z94JU0WMqrLfq+YtSEazJ5QvZceq7HmPK4VSJxQf6v+wRiUzyzQAagQNdgaVzQcBvM8j1fT4JfJbjasVbCA4RhIULy7Eh0RbHF5REFISqQQYm7OqxdOTCgmhIH5dVfqcK3GxLHzBA+kCuiHhMM2u/TfJMrfvioRQrv7oStAcVJcFwb3gE+JMK8l4Pi0LkY5zOdJaRK6L7UkO+KafSqdIuxez1u5FFLc7edyJ5diM1WbzrXjELBI7uYkbRtJJ36l8+qXWavUy03b8qSGPLAuIddwy3vYnfTWTfYrekzx2Tll5rO5bFEmw+FzYMuErSwo5wOKLRUE6I2NmRNLo+97JAXLwIslW7BcvHDUWCJLkJz3Sui+4X9rQsU+u X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(136003)(396003)(39860400002)(346002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(38100700002)(6666004)(41300700001)(6486002)(478600001)(6506007)(52116002)(26005)(83380400001)(2616005)(6512007)(86362001)(6916009)(316002)(2906002)(7416002)(36756003)(8936002)(4326008)(8676002)(66946007)(38350700005)(66556008)(66476007)(5660300002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u20wEspbUnU59aHyUVLqIo7SFojg7RlE2Yg/6o807aL1bKXriNoI/CAYMAi+B5XnC/rquZV5lAXbAaYqJ+Ko0oEGxiU9Rmy7xMNDmLwGhrnVZnGxg/5LbWBjDqPYI7ISkuuYFXVkqBeg1tc5KYIR2S4ejLDA3WIM8lYy4DJ+2hYbtzen+0q+TFeIyTHqjKIJ2zxYPWHVQd81xYT2rLbcggb1JpCmsysLVlQiyEVaYieRIgC3TALZLywLFXwyLIUQHz6ba/ADsFZlJKpV2tvsMg1BJqds5aRlN9Hb8+usy5L2RFeOKJEdzbacwQRK5o5IYHV+1KTeVZG5oZ6rjGXvR+1rzR3GBQeotXZfPPdizneZwGSgF6i4qdJyBVmD8j4j+tnb+FIwl+5hQsutVjA1+y53ToM5T5FTIdioM3Fj2DYCEvy0V764Q2sHd5Nyd3rZH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eMgSWaS26b8TKCDeVMNWdA45OTIKNYivTiokfLFK0U= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea694171-f8e7-4a23-aa0e-08dc1911dff7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2024 17:12:54.3901 (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: a6BtqW11dPEzN+VoyFLGIKrnfTLP4ECBKlMtWeMuIJCs0J1d2YFD1cCllMNDpQDu3pz1Y6u1GCTmpLAN2P7bvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9688 The i.MX EP exhibits variations in epc_features among different EP configurations. This introduces the addition of epc_features in imx6_pcie_drvdata to accommodate these differences. It's important to note that there are no functional changes in this commit; instead, it lays the groundwork for supporting i.MX95 EP functions. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Notes: Change from v7 to v8 - Added Manivannan Sadhasivam's review tag Change from v6 to v7 - none Change from v5 to v6 - add missed maxitems. - add comments about reuse linux,pci-domain as controller id. linux,pci-domain have not defined at PCI endpoint side. Change from v1 to v3 - new patch at v3 drivers/pci/controller/dwc/pci-imx6.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 139ed618bfccc..bbaa45c08323b 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -105,6 +105,7 @@ struct imx6_pcie_drvdata { const u32 ltssm_mask; const u32 mode_off[IMX6_PCIE_MAX_INSTANCES]; const u32 mode_mask[IMX6_PCIE_MAX_INSTANCES]; + const struct pci_epc_features *epc_features; int (*init_phy)(struct imx6_pcie *pcie); }; @@ -1052,7 +1053,10 @@ static const struct pci_epc_features imx8m_pcie_epc_features = { static const struct pci_epc_features* imx6_pcie_ep_get_features(struct dw_pcie_ep *ep) { - return &imx8m_pcie_epc_features; + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); + struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci); + + return imx6_pcie->drvdata->epc_features; } static const struct dw_pcie_ep_ops pcie_ep_ops = { @@ -1534,6 +1538,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, .mode_off[1] = IOMUXC_GPR12, .mode_mask[1] = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, + .epc_features = &imx8m_pcie_epc_features, .init_phy = imx8mq_pcie_init_phy, }, [IMX8MM_EP] = { @@ -1545,6 +1550,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clks_cnt = ARRAY_SIZE(imx8mm_clks), .mode_off[0] = IOMUXC_GPR12, .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, + .epc_features = &imx8m_pcie_epc_features, }, [IMX8MP_EP] = { .variant = IMX8MP_EP, @@ -1555,6 +1561,7 @@ static const struct imx6_pcie_drvdata drvdata[] = { .clks_cnt = ARRAY_SIZE(imx8mm_clks), .mode_off[0] = IOMUXC_GPR12, .mode_mask[0] = IMX6Q_GPR12_DEVICE_TYPE, + .epc_features = &imx8m_pcie_epc_features, }, };