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: 13808025 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 4D737CF3976 for ; Thu, 19 Sep 2024 22:15:09 +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=TI/+hz4zadbRPbk/iDobP7lBSIpozrAa1jkmXmREWUU=; b=z41O+d8nnxsLXPVlOtZqoQ518f f/hbvwJ5E8DAbEbBJr2s5a2np2vWvzwezawI6EQz3F+JeTPqp4Z9u9hwSOSLw8x7RqAzyTQ8jeV05 LfmngGre/oTqq2qSCqR11TLRruxXw62Ca53P3As7p9VspW/A6jbTyPhNTjxKARBwZm5mmUaXlVrMe CwsFtDJuXzyr34HQksTgfk7OOsahsujbNHg4uXdLLTe4lVbyCqOwwxU/pwxx95HzUYU2RjI0/Xdj6 DTvQ+T1udAF/t4cnX1Kt4629q4yenYb+2+iQITPwU05zYzjbwvNbmLz/Pj/UtwUf5mIR3bBO8IV3/ FFFr34nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srPQR-0000000B62O-1tvy; Thu, 19 Sep 2024 22:14:59 +0000 Received: from mail-westeuropeazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c201::] helo=AM0PR83CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srPGM-0000000B4kK-1067 for linux-arm-kernel@lists.infradead.org; Thu, 19 Sep 2024 22:04:35 +0000 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) 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?0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qTgTd+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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_150434_321490_451217ED X-CRM114-Status: GOOD ( 13.19 ) 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 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], }, {}, };