From patchwork Thu Sep 19 22:03:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13808014 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011058.outbound.protection.outlook.com [52.101.70.58]) (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 2D9931B2EEA for ; Thu, 19 Sep 2024 22:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726783476; cv=fail; b=t5l8P3BjenZjUp3re9TWIbe1ULZYS/Kt3wiDeimk+AqA6c1wwssPtPSok8iDzpxHzb+PRSQ42+iQnWo4F5iJDj4Cfch90loRfpq0rygvt02aF2O63VVtQtKnMbQ1I56EF6ak6ioLkfIwJMRsRbMBKC0VKz27KVqfihCsgD3MmXs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726783476; c=relaxed/simple; bh=3CxHSPzOMZdooiHhXBbUJeOq+L0OzXqE4BV6aNSmV6w=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=nB2mdTQOecw8+EqbHMr159+NwpJZD7dfvJGnwESO4wlvIa2rZJeAj26vLauUCdRHag+yXAz2rHcTNKkdxPpHal86PnnAXI8TcrLgCFJ35d7cD4xLTGdbfI03Ue70GwIWifu84bLax03Xw5mYsd9XEDLqOpGqT6KlwRpCUN8nN5I= 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=dblvluHU; arc=fail smtp.client-ip=52.101.70.58 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="dblvluHU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=clbKMLlrdDxV7nDbcwjsq9xfqj+ELuoJOpHO5KeicsRBiMKuxG4tSgRGeyYgY9KPClbDT/EwHuHJiBb1Lm7/ScsCJyCxfTtxtIcA9nfUIY/GWHJ9yzv2DRD2NCsEaRLyY7KlCMUFI6tTjydY3Up+BVpXVwHVdUv9YCBnPPIGSr+Nfi3+pg7AycGIxo0x1RO8RwY4hTkfCJHUB6AjBDm/lXaw2Bt965+StGnVjNsfTuYnymSe9kkiqAJPGJ4DnJsW5pR85gGHMcFmU09Fx5Zua3LxSxpJz/1wpGJd1UE47la5HVNHh+AZp5qnS6B1ucm68f2+e4yJh6e7MlklSTKfWg== 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=TI/+hz4zadbRPbk/iDobP7lBSIpozrAa1jkmXmREWUU=; b=cjcAwYctPBqHLgsjoxVu35MGtLUzc3tTu7ntIt8kQ3uI3DQpsYelJs9/7l+qBgLQOBXXcypdUcIc3Ryl/LoJCXRWg72L0ZAJ5upLpfhN81vCx8v5JRdG2uSxPRKeAtpDg6yjGA8e57IvfCYNIgnZCS5rfzks5zQnX1UQ/aJ0A14VdWO0VCLzcT/ZiriwwEZ7Y0C2OkY+t0QQFgXtmploN79aKmJKxGGCZObtYUNZqTM792A6dbCiVuvhOb31nvB2uPrYTKxagkpWLCdXmpbLJkjWYXSbpiOZnQV+OhjawKayfJcgv17Puq3DOCz1iT0Jn2cQ5hcUR9S1Teqbuvd+Bw== 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=TI/+hz4zadbRPbk/iDobP7lBSIpozrAa1jkmXmREWUU=; b=dblvluHU4Oo8Ypr94/ZKBxEx1ecF+3DE9owxQYOBmzNjZCOL7+smGwuVLsdSWuSrPxFUTqlFIwpLe+kpVg8ooHYXblcq1GRFlhJWZIUzTajwZL/OXBSJlr2dMShSLY4GL1pP8SD6IVnex/UV9ifikrGbQhvJOrSLgMylZtCBzMmZM6gRHBgIhQt5I1ogYZ5BdBQ25LONVfQn5fkaC3oZEAKQW6/mhy3bpWMUFvcnxqYo7Igi3anQ+sbpLWArsvGBlQjWw0yz2Mt/ApgaXbCM8jwPgtWHRt9GDyCNvO+Tp10M15bDepeWtW+QLMITmqP9DySvjyGTXg627roU92q/yA== 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 GVXPR04MB9849.eurprd04.prod.outlook.com (2603:10a6:150:112::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.22; Thu, 19 Sep 2024 22:04:31 +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.7982.018; Thu, 19 Sep 2024 22:04:31 +0000 From: Frank Li Date: Thu, 19 Sep 2024 18:03:09 -0400 Subject: [PATCH 9/9] PCI: imx6: Add i.MX8Q PCIe Endpoint (EP) support Message-Id: <20240919-pcie_ep_range-v1-9-b3e9d62780b7@nxp.com> References: <20240919-pcie_ep_range-v1-0-b3e9d62780b7@nxp.com> In-Reply-To: <20240919-pcie_ep_range-v1-0-b3e9d62780b7@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1726783409; l=2369; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=3CxHSPzOMZdooiHhXBbUJeOq+L0OzXqE4BV6aNSmV6w=; b=0nELTgmm7NYH3c0iwq01NuI/BzkMh1HQYQ0c4FpHrbs4t4Eyl7JQUfoVJauL8o/hlWr8DxmAL ouCcUNfHf+NCblLtizXrBtgxv9Fyux+SjzEWOzhBhaEy4X68ZT0+Fdh X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0057.namprd05.prod.outlook.com (2603:10b6:a03:33f::32) 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_|GVXPR04MB9849:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e832cc8-947c-432d-484b-08dcd8f709d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?XgKfUu9koFkgrwuHhCqZlvqN9iy2aaX?= =?utf-8?q?mpkH62V/H0PHDtgsMGauxkngFKdgdEmS61pXC0YKZB/y6euHN9/IivVSUNLyZEytO?= =?utf-8?q?jOrI2RaYrs/xXW7VVwIJTRZ1z7N5S0ZOoPEi5GhH5oySfCRguGC1gnT0uNoNRyKkK?= =?utf-8?q?uW433ohIx4LdgCA0blw+RZIegxIJC4io4ec/IpfbZa0TEot3O8bFielW8kMp8+/kH?= =?utf-8?q?OZC92YQcODidEAD/oDLtHnUBv2P0UH/fMUgHYl95EzFMeBxA8k1gX1rYLqsxvCSlG?= =?utf-8?q?WIWKHV8rKazwKUJhAj1UQTnWN3OGlBnwhDjdtfdmh/OChWXwPzzW7yszoe1depOS6?= =?utf-8?q?lDed70X+TpofEXK5AD1hLhdhu6aFpjS1r+KYj6UEVHDuUan03l5tCEbAehkgvITaV?= =?utf-8?q?62pT2J5MKLodwSQ/rsINPZMu2JEYotSmmMiXPDlEL+1DajN2hsNba/YKxwv/p620A?= =?utf-8?q?I8DxwfsS+C9olM2UvN+DPK+eVHsTBphs9AGWIDYZSukMt1uPw5DBpln4fTLgVfGuN?= =?utf-8?q?qdBI2GdUFdn40fiGlm5XimLQolvJZh5fhbZ6ayRL8wiXOyOYEVawMNcVQ5zzUw7TZ?= =?utf-8?q?Yj8PEyFbxbULotYa2n63Vy4BlHZo35kgBk6C4blhUKbPVqNf1UcLw92y9tZst6t0k?= =?utf-8?q?gzkDgX2spdvbSvYp/lJWU/wsfC9dCDlEk8uEkp6mTBaWBPX8Dacjf4SIyR1pkwVGq?= =?utf-8?q?H0m9vCmPWgZPKYTEwemaExKJvq/VubnaWKmL2bspoFO1MZs73ezk5BLRtfQiqVYH1?= =?utf-8?q?CxIHB3XEdweilJJFMhi9IAUt11iAY+BfxtlLsEbgTNIVqu/IRAsc40nMYlE5QS7ii?= =?utf-8?q?ZrEgDEmYZAqfzxh14ZlKr4KL+dDTHkYJKzgDkSdyKlCkBKWFKWnltn41mWN3AZm5e?= =?utf-8?q?ifiYf4+K1AyYqHHZbik8af/ArT2CcARVtMhw9Rui1zu7MZkMHqekJJxlAK4+7pS5Y?= =?utf-8?q?YJWW7ZhZj1dOylZ9I9g11OdVN2ANdmDevTAO5d3D15jO6O+2l9Jj0G0AsVwVagl4L?= =?utf-8?q?zhHJneviZ1kv2Up5xNmsvt11m3HHh8hcKHNSifdIwrtCDbyd2beyVWwV72lxIPk8/?= =?utf-8?q?nxIxUMRP0VyVAR+ZPljZYivXuiyVkdX6O5/e76gjJOEITiErPA2y3xNaEw/Y5QNaY?= =?utf-8?q?KC4JeLpdA0OzgH14/a75IwMQJe5soWPV3MV+McGh3j5C4tEzZnQb4Hq1gmEB3+UkL?= =?utf-8?q?Cn3TE1UjiuvLlqzGXL/msArsIdl9H2qtaAhm60VnLDkOKFpeOLoaacZbtrm10uOz1?= =?utf-8?q?rWmpmiPLbPFpwCIQ0upUDODyJt66iAEFiSfHnFMBk7sCIJEbhLctzLt4SlTS4UHil?= =?utf-8?q?rCyUkuxDxV1LmHqSAKUOswyRjqFb0mXSMoXT5hnRg3MAzaxOkl779ms=3D?= 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)(7416014)(376014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0rc5n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d+E7j4w9Sl4/7sBrIVhPLc?= =?utf-8?q?uHqyU6RyHfi3mxcwci7hjzXsBLhVKbYG05ekSYpT5y/hCuxMHcCVzK4RJTkLDvVCm?= =?utf-8?q?Fm80WA8BFqS7B/yQjdOmfzAlTtoh5S9OTXR2DViCANmYNvDjWaTNxXN+cJW38B9LA?= =?utf-8?q?Iahe8YlACQgGmnu7YjAzKdVEDHoqnoVah2kUjUdlYubmzl3iT3t59mvRFv89JwlJ/?= =?utf-8?q?UfnxLKVqMqVQgp7pWx7qAYUT6ZU+hjzoBdxkQtmqU+oNwc5RgiCRASLdpfJyD3P+6?= =?utf-8?q?ia8q+o+R9WihdEMd94MyUufL4U+cw/+k0yT3BYikednC7D2JcikCjgqOxwoACWJ7F?= =?utf-8?q?WolqSV6Mzq1jwwXqN6SNui3NLNmrsvDjjU+ssVOqElXBm+69yi677utmq06ytKDJv?= =?utf-8?q?+8OyXt5i9NGWcobuma59Qn/30sJDLuAVt/ZMH15YxjYfy7pk9bRGI1MGtAUtq85tG?= =?utf-8?q?OEXI4BZwidEqMkDyktcuBH3tWEjteKWOjxaaRFaux7egUlrKNY54xKKSd5RlaWRGl?= =?utf-8?q?YEcGg/6PXcawmT2NFNrSPv9Wx4X/Fwzm6qw2uoaQZywZ/s+oBC/PhTupIzs2lXOGy?= =?utf-8?q?0mJ1f1pLb3gR3HlJ0XyjgmkrO1k4y+/A1RjCgoBMH1rZm258PRb1HL12slR5k18fn?= =?utf-8?q?86jcAm//Lhag?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e832cc8-947c-432d-484b-08dcd8f709d0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 22:04:31.4232 (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: hozC1GG9I+qVBmIFXFq8zLAsCTuxes5zLlXWdE16N2McvRnBySvcnKjX7eI7TEwxUaQOSEs+xuKg60Q9NFGG1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9849 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 by using the 'ranges' property in the Device Tree (DT) file. Signed-off-by: Frank Li --- 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 bdc2b372e6c13..1e58c24137e7f 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, }; @@ -1079,6 +1080,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 * ================================================================================================ @@ -1645,6 +1656,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 | @@ -1674,6 +1693,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], }, {}, };