From patchwork Mon Oct 28 19:06:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13853965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A084D3E2BB for ; Mon, 28 Oct 2024 19:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eIG3DwZHBHBFPNj0et0JCjxq4EvOWJCsaM4GFikwMac=; b=ZfrzYo8K53sFm8CxuzxSgsCbK+ t/DNLt9EikkYEcQKS2FpDep5YtXjF4CVs+RRS8EdZuHJDTiHaxzzZWHVjmylLdZIC/DDEcutINUOh mjHTfnpElGt6b7vMnAhlbIWKUkchsYQPfXiWUg09AefvmonWgU+xnJ25Sh42Lf9yyjm4Kp3dVbMNk Mz8leWf8RGC5YHR2wnDLQuDKkkzMKCfs7uL1rXCBB+KoIpdUUZoBix5RCafv99u768Bbg9UjYUsSp r/hSK3QCLy7zl+aDpQgLaS+8ILh4FxUdLvW6GQzqyjp2kwIW2S6oITcd1OW9V19LQeJHD0F1ojV9P YKBh/g4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5VZl-0000000C1pL-1PEs; Mon, 28 Oct 2024 19:38:53 +0000 Received: from mail-am7eur03on20609.outbound.protection.outlook.com ([2a01:111:f403:260e::609] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5V4c-0000000Bwju-0c0j for linux-arm-kernel@lists.infradead.org; Mon, 28 Oct 2024 19:06:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MN/KylURMhw6Bu2u0iiTSF4F2KH0xrbMV6d+BYBHUnVITbL2N5ZscSa8MYHRFvWfx1jGZMKPxWG74C7GSZSNtc1TYawMwv1HxHSwIXgRTzVyMg3TdWBaPO8Vh7OJwpcGKvxD4DC6YiqogCx3O6xIX2TPeKBoUmTCsB8mC1FCvW9bz+pCxP/59cbZvsIcwKaa6V481KtWWlevKoyQaayL4yZJVXChp0wEeGVYtynrEC1ZC+iyijwvTD5VLgpD6T/zziWkc6ji9WETbD4M/caANL2x5wjHNX0vVR7p5jNNYTsAsA0H/Ap6r2txQJAb4qGfLQB9au6/7SPYGUBMRQKVDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=eIG3DwZHBHBFPNj0et0JCjxq4EvOWJCsaM4GFikwMac=; b=KGalesmhdrs97FKwb1YskqE5YyEbhNPvcM4PShIWVkKCc5KDYd2I2BQsTSmdQZ0Em0R1G+7sGTUrCzLkXy9DZVRAJ1nQgDykDqRtOFmQqQ88W8ljtUx8obb0xAx7qS08PEHrMW7X8b1olJTbqbbwk+gGx1M47uPYet9jkbmr69pEiDBJriwjFPPgW15fWyCfPaAn0UhS04Vq18Y0in5sjMBkjBWgurDfqSg7aFUuHRSPc/JuRSA31u/OdeHvZo0Snw89kW1f1OiNm3RRQGotuMhwqlFaIrVCnH21YbdPLNv904bPXj+cQWaxHEdn2azsbhpUMDpdDLn48q11P3g0dQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eIG3DwZHBHBFPNj0et0JCjxq4EvOWJCsaM4GFikwMac=; b=cVjjYAoKGv9tyLZOG460zuHGCtEzSnYcqBQpLOXYKCGdmX7b1MJJFOWMEWV1ngyXlllud3Fh6/R433Khn0WKkCKI2IGQ5x6Mqxhz2KwH1/emAJv/8akbt7AkgCK1tbhSYbcapUFybGCrEBOZOHN5ltYuySzo5LoTtY/mRB+BeCZGSxuCrULhrvvCoCkBeatHD/JsfjdCmpkmKNXAPmBAUW44cbK4W1O4p36ueGYU4ikUA5JyDdFIpL3bPa6POvAT652CDP9UX45U5iqTlRmkc86lH2xy+5NHwP4ankoxQ5QpDjJl+JdmnEXgS2QBzLeSKARndXFOiSUlOkvyIR0E1Q== 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 DBBPR04MB7946.eurprd04.prod.outlook.com (2603:10a6:10:1ec::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 19:06:40 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8093.021; Mon, 28 Oct 2024 19:06:40 +0000 From: Frank Li Date: Mon, 28 Oct 2024 15:06:01 -0400 Subject: [PATCH v6 7/7] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20241028-pci_fixup_addr-v6-7-ebebcd8fd4ff@nxp.com> References: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com> In-Reply-To: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1730142363; l=2548; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=oBTuOyGf1p5J6QSrmR/H90B4rkHNLZfeWqkQs2nR+Ss=; b=k4cpxKXncruZS/S2xE5yJeROU6BdD2P8NV5gQAPw2o9sbickQbk8X+D0+Ae84EXIXvqc1vNFM S7JCn5F1nIZDZAhOy4Sjg7I1qnyHVWxCW0qVQBdGH1avRdG2zevRSPl X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR03CA0005.namprd03.prod.outlook.com (2603:10b6:a02:a8::18) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DBBPR04MB7946:EE_ X-MS-Office365-Filtering-Correlation-Id: e334dac4-ccc8-4c37-37cc-08dcf783a780 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?hFYCuDWz6rkbjqYcPkXa/gCnOzYhJBw?= =?utf-8?q?E6yoKuQsMIJk1BM7/SERWZcrR/bopqLHR64qsTBPdxaSYXIexMYoQPUR9XsbrxWGM?= =?utf-8?q?8Q+++4h9s/yOKc1c7gMTJeIAPhhhmGGLBhYoHg/q57cN4//ii/WGABiCkc4mMA38p?= =?utf-8?q?km6r/1QVsiEhE4JKP7z3jN0++rTu9D1y3XcBIrgU0NSkQvXqP3DKRpy9Iz9+9Qr7B?= =?utf-8?q?V6SCmFZRWremELj7rXuyIRl6ihMDOd+HzgETu1A1fqg+dXsLWzdtSeWFDctVudCp4?= =?utf-8?q?5OW0/qDlSEWp6wlBQpNkFWqlCUZiobp5U9SHxpwi/BCETVgl7Ov4ySDutwwbK7klF?= =?utf-8?q?eSXkftc2P/F9ueuaCiVISo5/cSJTqtM8GtTHKD7v7S1grV6h36qGBS05uiiKgSO+x?= =?utf-8?q?fDzeiMGmAUJJKYGqqfWTEo7+3P3nKrc8mIr9LbgQ6s9ttamjyYDc0PyLgzdZ1fCy4?= =?utf-8?q?AMJk1GaEnK3qvQ3I04YIjCikuYJ8h8Wnr9mAL8mEW5zcJe/ibSmsXpq6aNUaO0yiS?= =?utf-8?q?+wkKx3ctu7RUcTaUr0SrT8/Ls5r+HpKn9KixtYr0UHP/ndZqajMk+Ox5x7ZY46idi?= =?utf-8?q?vyH7nb5cBZgkNYmdAfw5yFNb5mt39QpuZUQAMlhspk3FX1fNJaSdtbCZLKM260aEU?= =?utf-8?q?uWzRNqaI7xG7j2moawwKaOaUEDmHK/HSHP2jUK8FCURb02H3N5HcPjSqcMpb4RdMi?= =?utf-8?q?q5jDoo9GXku9RUlwY8a8VxNBd7dYMgpAUd9SXpRC/cPaUwiGrrb1y95UWX5VGKsPE?= =?utf-8?q?GsXkqT7577po/X2Z3TIt+bBBIufwyvuVVstySS2d5mhN4ZDcZp0LWzGAtB/58EnPm?= =?utf-8?q?NzAEDj/mUYAN34TYdt7rPI6BHOA0v9T7qmEasyN5D7z1ImkPj/9f5hpcExbFRlxaP?= =?utf-8?q?o4n2/SSzuM4ApMGnk0enh+xMWxNdvKCKG0EIGYbyflX0ph8sUYRxDBlh8eDsHt9rI?= =?utf-8?q?EA43uQBUEdHRlREihSUTB5gRd/tMAGrRJpAG78tkaGt4JaxoFrxcg9de9gD529iLs?= =?utf-8?q?IIhjfqTKjjM6b6Kz+lW/4zEqndJuwUp6vDb/5KEn0GHImvOqIYhbkLKFVwI94v+3Y?= =?utf-8?q?jQpGV4eVK1GY2mYHRnebVpLHCiz5NMJoCyFCJTEfvY357r7DRx5CzFtwImdfJ15aM?= =?utf-8?q?Mm13yo87+YJjBm9x9OKJ9a2+aGnasFEB202tfbwUOe1FPUW8Q6aWNcQqpyFtzmYNB?= =?utf-8?q?7tl5h8Hrdhz9icUw9BYHZRJLqgME6SACcVx4h+IlQtRBNQHzCRWFKJDd2z7VYbE+6?= =?utf-8?q?YJp+gHwY6JBTN3atFuORVoMt8qoaFDlH4xn+kDRXw0a9S6Lt8FgRZ8ezrd6naJiTa?= =?utf-8?q?OIReBliVnLMw?= 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:(13230040)(52116014)(366016)(7416014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ECMP0wd2FvKAUt4niYS0qENtPfE+?= =?utf-8?q?OkPmG9pSqStLnzIHekSt5zPVrQ9E+fu68iYxqkMqfycxU57Nnd1jcuida6BYeC9KF?= =?utf-8?q?VIu/Sjngb+0OEg50Hk0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8jdKbeCyHaKoTSkottUZsb5XAgH2sMD+?= =?utf-8?q?zablZkNeh+I+snB9wzNMuDtBPDsKYGytebwC2IE3OJXhL92KI8qjHEGd1dHu7XHMN?= =?utf-8?q?lZRrkPQuZA7Ffa0Nf7WrOIDGUD12OMfHplc+J+FpmZZDlGchG2pdZrCLAXKcePdCk?= =?utf-8?q?GAwbfnDcxLEAtafGoyenBzurBWV/pnzV0B3+CrMVIheSMs2WqeRpRylZLJeeUC6gs?= =?utf-8?q?r01VGIENzEv5PJk1bFvILsVSHLpeSpFuTn7G/IaQzI/zN00yEujCDJ9hEYcwx8ki+?= =?utf-8?q?rsoTj7iymoMc40OXFQ5V3FQMHx7JRaucNohj3HVjYEvFaz/5+dojMIwmI7B0Kp8pR?= =?utf-8?q?PVKr+EtdxOOXIzZVb3zWBkUPnTedx7qT2y5PlZVPida/C62YVhYlZ/qw1RN4AEFnr?= =?utf-8?q?odB72qgEjJ5yUghAvD99hr3rwXdqTCFCDOcQPgTtHZ4xSzDLgM2WcXd+yf9cnI+AC?= =?utf-8?q?H598EocTOydLt0RXnL0STmEkXeByM6hBmwpHRWi8HRBc9QF4lHibeq/RXrVC+Vt9P?= =?utf-8?q?rQtpIw7Nrb33?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e334dac4-ccc8-4c37-37cc-08dcf783a780 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 19:06:40.3650 (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: W77i2dcd1YOj2GEBw28Tk2rkQHBJqC6DLfsPi+81pW9cFD2LIEnU/9qYJMEeI0CxUvlX+l3nIEVK/t7WbBfZNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7946 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241028_120642_231161_4C560B7E X-CRM114-Status: GOOD ( 13.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for i.MX8Q series (i.MX8QM, i.MX8QXP, and i.MX8DXL) PCIe Endpoint (EP). On i.MX8Q platforms, the PCI bus addresses differ from the CPU addresses. The DesignWare (DWC) driver already handles this in the common code. Reviewed-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Chagne from v3 to v6 - none change from v2 to v3 - add Mani's review tag - Add pci->using_dtbus_info = true; --- drivers/pci/controller/dwc/pci-imx6.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 8102a02a00b38..94f3411352bf0 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -70,6 +70,7 @@ enum imx_pcie_variants { IMX8MQ_EP, IMX8MM_EP, IMX8MP_EP, + IMX8Q_EP, IMX95_EP, }; @@ -1061,6 +1062,16 @@ static const struct pci_epc_features imx8m_pcie_epc_features = { .align = SZ_64K, }; +static const struct pci_epc_features imx8q_pcie_epc_features = { + .linkup_notifier = false, + .msi_capable = true, + .msix_capable = false, + .bar[BAR_1] = { .type = BAR_RESERVED, }, + .bar[BAR_3] = { .type = BAR_RESERVED, }, + .bar[BAR_5] = { .type = BAR_RESERVED, }, + .align = SZ_64K, +}; + /* * BAR# | Default BAR enable | Default BAR Type | Default BAR Size | BAR Sizing Scheme * ================================================================================================ @@ -1627,6 +1638,14 @@ static const struct imx_pcie_drvdata drvdata[] = { .epc_features = &imx8m_pcie_epc_features, .enable_ref_clk = imx8mm_pcie_enable_ref_clk, }, + [IMX8Q_EP] = { + .variant = IMX8Q_EP, + .flags = IMX_PCIE_FLAG_HAS_PHYDRV, + .mode = DW_PCIE_EP_TYPE, + .epc_features = &imx8q_pcie_epc_features, + .clk_names = imx8q_clks, + .clks_cnt = ARRAY_SIZE(imx8q_clks), + }, [IMX95_EP] = { .variant = IMX95_EP, .flags = IMX_PCIE_FLAG_HAS_SERDES | @@ -1656,6 +1675,7 @@ static const struct of_device_id imx_pcie_of_match[] = { { .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], }, { .compatible = "fsl,imx8mm-pcie-ep", .data = &drvdata[IMX8MM_EP], }, { .compatible = "fsl,imx8mp-pcie-ep", .data = &drvdata[IMX8MP_EP], }, + { .compatible = "fsl,imx8q-pcie-ep", .data = &drvdata[IMX8Q_EP], }, { .compatible = "fsl,imx95-pcie-ep", .data = &drvdata[IMX95_EP], }, {}, };