From patchwork Tue Nov 19 19:44:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13880492 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2071.outbound.protection.outlook.com [40.107.104.71]) (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 1B08E1D7E37 for ; Tue, 19 Nov 2024 19:45:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045515; cv=fail; b=YAchwjlacl0ktT1vbweRDwhWws8KEkazpUDlkuGlTdtfOnp9l7RZmQ+2/4yI0OB05SIpzSFFw18t50vAIzWdZHnl/j/tuylwMqrROPS+LA3kxRrp11WEh1112u98TkrsHFU4rWOiTSu55Dmsjbk44vRZHLeSxWJzWGl+cPhKmdo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045515; c=relaxed/simple; bh=mbHe59tkIpbHTtvY3w/H80mU68bHhQgeFO0tnBttso8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ZNFaEdPgYfMJKsx6e+M0LS8zRyQS2Z3i4Wy+dneYJKILC2CPBSM5//z2t+LFK2BTh42efnWDDM42oNxse2obdAR2oFMgaEQaN+T8LVcfWqJTYdZ6gBu5Y/yVjgf7bjPbkSkvVzHJs6LnMIS++5Nr1JAFhSYfTbniJZ1sBS2wlGo= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=iId3zEjR; arc=fail smtp.client-ip=40.107.104.71 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="iId3zEjR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qMyUQHftAbEqaz4D3/FUQTGQzGzCzf62tVdlP0tPB6rhWdWFsle8ZiFlfp/z82eZfnhsGvnhGmhcKxJVBOkWoAOrN4KddEHZpFWWwvsAoNNGNfs7A7f0DceEhMSdiL7XWsU9SBgaAQj6FBEPpAa2GFftaCoG4Fzctyi+H33W9W4qO7Wbm79HyN3bkyMjjdOMLBzSAYhb6QS75yZYULryP06P0S6xS00b9I1bCtZIFaqDJFm9u5FYR1iQfotcEFsIb/uVEeT3wvd83VPAOKQjIgtz5mV0N8BCIbEcADbzbxm3JeBETUE5FDIQns1pXaSA9WNTiQAP50gTiLVZ77iIag== 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=L02xQI8CqGMvu/Xott6SAD1YcJnHf27P2jsLGw+ynKY=; b=sPHpX0Hq1E/5XgiCIqkk/+GZsdLipcZ09aTKO7fd2+bFf2gyAi25t//9p8f4swT2yQM9oM0vN97xxOS6+8KNx2AsCWwZmflDOaJ5gVrlogIHYPr73xoNFFNDA/TbKGCltvBiuGeuUh2QHlC6/4xcsz2GCfGLc8SHhsh5oKZwOu3Nc6WIYtffdAZ35Nyht1nSOaKXJ3nG5CJ1rk1HNAH5y1h70tcJqdQrkFWEVUA1/mwmLdqrvn6kPeHZvYM7NH5CEivoELup95Sx4Fj+xxqAK098VIBbakmdBu0CIM4VVfiRo2SZFNR8s9qE4knfV6Uj4xaH1lJ0R3dKmE5amZ6kmw== 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=L02xQI8CqGMvu/Xott6SAD1YcJnHf27P2jsLGw+ynKY=; b=iId3zEjRBJIpCymv3E28zXpQYv5o3XkQRx25nvmzsAHPi3J8anUdcc7YtsWop+PDqC5P2Mj/PR2ZR+5/Q7CiOoKgZQjV9MNl426Pf+URC9wNvOp4nNgwfJnnK9z9uYbSX/lnvE6sj14vKN5g1kdcAaRKuNDDhj+GlE52rjXNPBnIJ3BQmcra5K9jC6o1RJQfQSLPQtzFiFBgOuyDlaTcAjm96kI+j0lce5LxMU8g7suX7mj572bmd78uq8kxKaXKNHOcKfWV38c0BzCEdgujEMoJolckscA+cdVAdmOjD5A/GPGqAlji1lFy/bJk2JKbIaXASXgQb9TMnv0240cvdw== 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 DUZPR04MB10014.eurprd04.prod.outlook.com (2603:10a6:10:4db::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 19:45:09 +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.8158.021; Tue, 19 Nov 2024 19:45:09 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:25 -0500 Subject: [PATCH v8 7/7] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20241119-pci_fixup_addr-v8-7-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@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=1732045469; l=2548; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=mbHe59tkIpbHTtvY3w/H80mU68bHhQgeFO0tnBttso8=; b=s8zSC1wVV41AI86MzbTvnNDCe+Z8XvF9S85E+UaQQbDhYDbZkgOb+t8zjBVPlKUYzwzLYX+1y hYuk1VmUiZvCBQjEUR43aRvHcrRiY+707uRzoIMZKJgS7iCtVRIH1Ob X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DUZPR04MB10014:EE_ X-MS-Office365-Filtering-Correlation-Id: 97664a82-7382-4f8c-661c-08dd08d2aceb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|7416014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?r5IzKFWwdtoF+tAdG//AARaMFDRl1jK?= =?utf-8?q?dOnA8GJ3LNC62nD1cEN9U/j1xbhroqkWVwx881/M3/XKXNwuRtLrR6fmAIATfpLsz?= =?utf-8?q?6NMT9RM5DM9mTWbHxFg+A7o/KIfvbnIyC09eof1u2pmNlFQ2R4ACgbCALTej5AUyH?= =?utf-8?q?cPSAYShPAPdF0abFdeqNeFYPou7RCxrlayddZRXe6OAXofa3SVTmJZR7d5iCn1Egf?= =?utf-8?q?39mPs5Die5YIM2MsBr1d/FK/sAEaz8c7EQE/rTZqDXTYceJZ6XizcuoO3tEOM2Hsd?= =?utf-8?q?0wkNZ97es7EOGrkZReg/nzSHgdQWmFvppFI4nDAMuWg+KoWZ9EtgUuVVTzutCMeSW?= =?utf-8?q?4dSyYzGKtavhb49I0MMEelLrlX+GpsIlxpbJQAWRAmtiz8Iy/HaKRZ9QE4TuXtjE8?= =?utf-8?q?xa7Jf5kQWrjKaasevGK2qz+CBtlqfzrKtaNZSuxVyycr/EIFTfTf10X/MypxkH36U?= =?utf-8?q?l4mxTxc3LP7lVIYDM3cMJaDFwFuCAx7XnFQNQGY0RTeBtvvEC7H78jB48lsdi0tMk?= =?utf-8?q?+YD7S2KlmjHIxIdjFTEntXdZGaOQy7Z1OgT/J1ToJJeSnYMu2Wqr1Inyl7pnf3sOV?= =?utf-8?q?cQnPInLt8JPpxBcsQYTiKEu17Wfm0I65dST0t7eF+hQWYMMjCWH+Ms6YRwF3KbG55?= =?utf-8?q?SE9B3Ase/Lyml6cSCWTGHwvEA8jP8foxntsLJyfWiIUL73Y3IpKZJ5z2hy1Ru6jTP?= =?utf-8?q?Xp9R21YERwY0yM6wX978J/U8uYPS8C7g7UbKjJ83FPrUTlj1Q9CuT1N3s02JJpzyU?= =?utf-8?q?6KLz16uVJlaKrwSTGHkPRJvQmqgIapRI67M60gWcbJ02rbhyEAihGrJC0KidIgRal?= =?utf-8?q?bBA3qFXYFUtEdllj57yJMShmZHOu+Nwj9HkisuKoWVfTzHDlY/OZ6ZBaKrsTfqUif?= =?utf-8?q?vdvTql9ifEWPLp3tGc08CJuGw79emEk6+zVVajShAT+qkcUYUkLiw1daC6D9lj5xP?= =?utf-8?q?zrK7Fd9t5VLT7z3m3kTvFULa4BLORKDDXa649fQb57EodY5nlS+8pkzIUoGVJwZuK?= =?utf-8?q?JgkCFx3z1y8YfPS2zNMlj6xjHDVcxgBHhmog/CwHGbei0qY1Y5BUcQL4geiCsYxtB?= =?utf-8?q?gL6XRtoobL/GvmDlAlXI1j9y+qKHyWbWZPOcNpyVL9fLeLMnlo0uMh9Zkppk1sTsr?= =?utf-8?q?2XJW8Q7AHxOyTsn2tojPTq0Wo8Xoryre+TEzKS605vecQZB3ih9bx9co1FSiulNzE?= =?utf-8?q?Iw0LXOUN7RV+KN2I8F8qO0E1DyrbCGs4iYwVvo4AVptbDyG5KomQJQyS39cKbj7yi?= =?utf-8?q?w30KfPU9S9xLXdrJw/jL8PhGyG173Q9zevGA5QIw2VACy5AAJkZ3oTHkkzEcZ3uJM?= =?utf-8?q?Aw3ArUFJQKd8?= 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)(1800799024)(52116014)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Hx/Dyj+XueNg6+lsfWyKt3488+VU?= =?utf-8?q?rQOx/MlsTCE47R7yQJHrmoEV1ZUbLqdnjFmw07e12hM2o6URFuwjT6R3RubiM1GBt?= =?utf-8?q?Ulot4o81DVUyOX8IzxPcw/xFHLTlYM5Go9kwq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Vo/NaEqF5LkHxML6FRDOIkhy?= =?utf-8?q?eKEfKNTWXFLZ4/mooCRFySt1FNxRo1oGhk8cr+71yyhoUXhVFZM6wjE7k7J6JtZOo?= =?utf-8?q?EzbuIpFqrZ/r+Pfes/Y2JHhY+ab8+ZQC6azRXF8n34pbKPeDAR/GZO9zjUTXvoIbE?= =?utf-8?q?LViese7r+pD7WGW+lT8x+SRt+lfbggCUWXvOM18p8P4JbxIGxUTXeu7o3yqKPhfVB?= =?utf-8?q?e1pwgs7Z3bj7ETUlxTkYOH9T/2MNlYclRMysagINDjluHYZxv7sdgTr6HIQfIFDx3?= =?utf-8?q?4WlURpXuU185WBC6TCLXx00W8zl2Qhjx0LcBB/K+dYlLyGLydcaGp5oUkydIALK40?= =?utf-8?q?6qRBaFg9OYpHURU3nDySEhRqJuS9JGOdDqcN1ZKQ8bwnkSgdMVi9x32j1pnWq7X3n?= =?utf-8?q?Tqjc2MHn4oI/NiS6crwMjUonHjgYyFnhQdO+6z9lNdnEMI3NUo2Bdl7L2mMEtk2KJ?= =?utf-8?q?/Mc2s8WDs8BrwcwFu9vRpbV8xgtDFfaGodOQVqkZ3L8xVhOisrjcawv8=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97664a82-7382-4f8c-661c-08dd08d2aceb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:45:09.5248 (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: d1/zzoPF1jcGfQUTur3z25o48loXrecIP4G7FWte5TGJr/KqpsHaxD1XXtmiBG52vTubhOrrYs/yx/JJPd2nMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB10014 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 v8 - 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 5303dfc3dbb41..d457514d17485 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], }, {}, };