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: 13880500 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 324ADD6C290 for ; Tue, 19 Nov 2024 19:52:32 +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=L02xQI8CqGMvu/Xott6SAD1YcJnHf27P2jsLGw+ynKY=; b=zrtxpcnDjP6jK5yeAdLPwNgC3R /4/rkNtj2lfqv+WgM7DgMG3BDss5Qom8dlsZfXQx/h5DY9I4hfK0S+wX78nCuqoZbuwWmId4qXd8R 5Q+oBp/uVH1WXgAIRV8GG3tiobJpD64DIZXEC7PEsPyo9RfScCZYW7PywvF94g2u39DwZOOPkrpmw IMIxnR4ta99lE+XcVMgGv3rMe+R5lTTgRTFNbK2yyfo7bq1AEkxvxInsruTUds1xvW36LiNGr4dPq GP/neoatzcfD9LhQbUo4komtlXuxM5GeeZBREqIVhysSGWlnFW2uKRK15g5ScIcOSpjY+FaN5FMYy lEbHpuEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tDUGp-0000000DbDg-1Cni; Tue, 19 Nov 2024 19:52:19 +0000 Received: from mail-dbaeur03on20612.outbound.protection.outlook.com ([2a01:111:f403:260d::612] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tDU9x-0000000DZZW-36Kp for linux-arm-kernel@lists.infradead.org; Tue, 19 Nov 2024 19:45:15 +0000 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) 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/xFHLTlYM5Go9kwqz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o/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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241119_114513_786261_EBD1FCA7 X-CRM114-Status: GOOD ( 13.67 ) 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 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], }, {}, };