From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7AB2C6FA91 for ; Fri, 23 Sep 2022 06:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230227AbiIWGZ5 (ORCPT ); Fri, 23 Sep 2022 02:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiIWGZz (ORCPT ); Fri, 23 Sep 2022 02:25:55 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A1F6115BE8; Thu, 22 Sep 2022 23:25:53 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E9B78200DC1; Fri, 23 Sep 2022 08:25:51 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 9FBE3215AEA; Fri, 23 Sep 2022 08:25:51 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 9BAE01820F5A; Fri, 23 Sep 2022 14:25:49 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 01/14] dt-bindings: imx6q-pcie: Add iMX8MM PCIe EP mode compatible string Date: Fri, 23 Sep 2022 14:06:47 +0800 Message-Id: <1663913220-9523-2-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8MM PCIe endpoint mode compatible string. Signed-off-by: Richard Zhu Acked-by: Rob Herring --- Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Do= cumentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml index 376e739bcad4..e4038e2b3de9 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml @@ -27,6 +27,7 @@ properties: - fsl,imx8mq-pcie - fsl,imx8mm-pcie - fsl,imx8mp-pcie + - fsl,imx8mm-pcie-ep =20 reg: items: --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C16FECAAD8 for ; Fri, 23 Sep 2022 06:26:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbiIWGZ7 (ORCPT ); Fri, 23 Sep 2022 02:25:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiIWGZ4 (ORCPT ); Fri, 23 Sep 2022 02:25:56 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BEBD1176EE; Thu, 22 Sep 2022 23:25:54 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 419FD215AEA; Fri, 23 Sep 2022 08:25:53 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EBB76215AE6; Fri, 23 Sep 2022 08:25:52 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id E7A26180031F; Fri, 23 Sep 2022 14:25:50 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 02/14] dt-bindings: imx6q-pcie: Add iMX8MQ PCIe EP mode compatible string Date: Fri, 23 Sep 2022 14:06:48 +0800 Message-Id: <1663913220-9523-3-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8MQ PCIe endpoint mode compatible string. Signed-off-by: Richard Zhu Acked-by: Rob Herring --- Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Do= cumentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml index e4038e2b3de9..114e11b62195 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml @@ -28,6 +28,7 @@ properties: - fsl,imx8mm-pcie - fsl,imx8mp-pcie - fsl,imx8mm-pcie-ep + - fsl,imx8mq-pcie-ep =20 reg: items: --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8DA9C6FA86 for ; Fri, 23 Sep 2022 06:26:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230310AbiIWG0G (ORCPT ); Fri, 23 Sep 2022 02:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiIWGZ6 (ORCPT ); Fri, 23 Sep 2022 02:25:58 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55237115BE8; Thu, 22 Sep 2022 23:25:55 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 967191B67CE; Fri, 23 Sep 2022 08:25:54 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4C4FF1A0DCA; Fri, 23 Sep 2022 08:25:54 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 416361820F59; Fri, 23 Sep 2022 14:25:52 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 03/14] dt-bindings: imx6q-pcie: Add iMX8MP PCIe EP mode compatible string Date: Fri, 23 Sep 2022 14:06:49 +0800 Message-Id: <1663913220-9523-4-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8MP PCIe endpoint mode compatible string. Signed-off-by: Richard Zhu Acked-by: Rob Herring --- Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Do= cumentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml index 114e11b62195..d79cbc55064a 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml @@ -29,6 +29,7 @@ properties: - fsl,imx8mp-pcie - fsl,imx8mm-pcie-ep - fsl,imx8mq-pcie-ep + - fsl,imx8mp-pcie-ep =20 reg: items: --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EFA2ECAAD8 for ; Fri, 23 Sep 2022 06:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbiIWG0K (ORCPT ); Fri, 23 Sep 2022 02:26:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbiIWGZ6 (ORCPT ); Fri, 23 Sep 2022 02:25:58 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7317BFFA64; Thu, 22 Sep 2022 23:25:57 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D732C215AEF; Fri, 23 Sep 2022 08:25:55 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8C31C215AE6; Fri, 23 Sep 2022 08:25:55 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 916C0180031F; Fri, 23 Sep 2022 14:25:53 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 04/14] PCI: dwc: Kconfig: Add iMX PCIe EP mode support Date: Fri, 23 Sep 2022 14:06:50 +0800 Message-Id: <1663913220-9523-5-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since i.MX PCIe is one dual mode PCIe controller. Add i.MX PCIe EP mode support, and split the PCIe modes to the Root Complex mode and Endpoint mode. Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/Kconfig | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dw= c/Kconfig index 62ce3abf0f19..a24d8cacf1be 100644 --- a/drivers/pci/controller/dwc/Kconfig +++ b/drivers/pci/controller/dwc/Kconfig @@ -92,10 +92,33 @@ config PCI_EXYNOS functions to implement the driver. =20 config PCI_IMX6 - bool "Freescale i.MX6/7/8 PCIe controller" + bool + +config PCI_IMX6_HOST + bool "Freescale i.MX6/7/8 PCIe controller host mode" depends on ARCH_MXC || COMPILE_TEST depends on PCI_MSI_IRQ_DOMAIN select PCIE_DW_HOST + select PCI_IMX6 + help + Enables support for the PCIe controller Root Complex mode in the + iMX6/7/8 SoCs. + This controller can work either as EP or RC. In order to enable + host-specific features PCIE_DW_HOST must be selected and in order + to enable device-specific features PCIE_DW_EP must be selected. + +config PCI_IMX6_EP + bool "Freescale i.MX6/7/8 PCIe controller endpoint mode" + depends on ARCH_MXC || COMPILE_TEST + depends on PCI_ENDPOINT + select PCIE_DW_EP + select PCI_IMX6 + help + Enables support for the PCIe controller endpoint mode in the + iMX6/7/8 SoCs. + This controller can work either as EP or RC. In order to enable + host-specific features PCIE_DW_HOST must be selected and in order + to enable device-specific features PCIE_DW_EP must be selected. =20 config PCIE_SPEAR13XX bool "STMicroelectronics SPEAr PCIe controller" --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A905EC6FA82 for ; Fri, 23 Sep 2022 06:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbiIWG0N (ORCPT ); Fri, 23 Sep 2022 02:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbiIWG0A (ORCPT ); Fri, 23 Sep 2022 02:26:00 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC497FFA64; Thu, 22 Sep 2022 23:25:58 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 369441B67CC; Fri, 23 Sep 2022 08:25:57 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DF9481B67CA; Fri, 23 Sep 2022 08:25:56 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id D6382181D0CB; Fri, 23 Sep 2022 14:25:54 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 05/14] arm64: dts: Add iMX8MM PCIe EP support Date: Fri, 23 Sep 2022 14:06:51 +0800 Message-Id: <1663913220-9523-6-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add iMX8MM PCIe EP support. Signed-off-by: Richard Zhu --- arch/arm64/boot/dts/freescale/imx8mm.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dt= s/freescale/imx8mm.dtsi index afb90f59c83c..eca7a42ac52a 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi @@ -1291,6 +1291,26 @@ pcie0: pcie@33800000 { status =3D "disabled"; }; =20 + pcie0_ep: pcie_ep@33800000 { + compatible =3D "fsl,imx8mm-pcie-ep"; + reg =3D <0x33800000 0x400000>, + <0x18000000 0x8000000>; + reg-names =3D "regs", "addr_space"; + num-lanes =3D <1>; + interrupts =3D ; + interrupt-names =3D "dma"; + fsl,max-link-speed =3D <2>; + power-domains =3D <&pgc_pcie>; + resets =3D <&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>, + <&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>; + reset-names =3D "apps", "turnoff"; + phys =3D <&pcie_phy>; + phy-names =3D "pcie-phy"; + num-ib-windows =3D <4>; + num-ob-windows =3D <4>; + status =3D "disabled"; + }; + gpu_3d: gpu@38000000 { compatible =3D "vivante,gc"; reg =3D <0x38000000 0x8000>; --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE5F9C6FA82 for ; Fri, 23 Sep 2022 06:26:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230372AbiIWG0P (ORCPT ); Fri, 23 Sep 2022 02:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiIWG0E (ORCPT ); Fri, 23 Sep 2022 02:26:04 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BB781176EB; Thu, 22 Sep 2022 23:26:00 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 80B771B67D6; Fri, 23 Sep 2022 08:25:58 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 364841B67CD; Fri, 23 Sep 2022 08:25:58 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 3047B180031F; Fri, 23 Sep 2022 14:25:56 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 06/14] arm64: dts: Add iMX8MM PCIe EP support on EVK board Date: Fri, 23 Sep 2022 14:06:52 +0800 Message-Id: <1663913220-9523-7-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add iMX8MM PCIe EP support on EVK board. Signed-off-by: Richard Zhu --- arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boo= t/dts/freescale/imx8mm-evk.dtsi index 7d6317d95b13..d43eb2eb23bf 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi @@ -380,6 +380,20 @@ &sai2 { status =3D "okay"; }; =20 +&pcie0_ep{ + pinctrl-names =3D "default"; + pinctrl-0 =3D <&pinctrl_pcie0>; + clocks =3D <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>, + <&pcie0_refclk>; + clock-names =3D "pcie", "pcie_aux", "pcie_bus"; + assigned-clocks =3D <&clk IMX8MM_CLK_PCIE1_AUX>, + <&clk IMX8MM_CLK_PCIE1_CTRL>; + assigned-clock-rates =3D <10000000>, <250000000>; + assigned-clock-parents =3D <&clk IMX8MM_SYS_PLL2_50M>, + <&clk IMX8MM_SYS_PLL2_250M>; + status =3D "disabled"; +}; + &sai3 { pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_sai3>; --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F25DC6FA82 for ; Fri, 23 Sep 2022 06:26:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbiIWG0S (ORCPT ); Fri, 23 Sep 2022 02:26:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiIWG0F (ORCPT ); Fri, 23 Sep 2022 02:26:05 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4884B127CB3; Thu, 22 Sep 2022 23:26:01 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 99ED9215B06; Fri, 23 Sep 2022 08:26:00 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5988A215B0C; Fri, 23 Sep 2022 08:26:00 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 7BD45181D0CB; Fri, 23 Sep 2022 14:25:57 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 07/14] arm64: dts: Add iMX8MQ PCIe EP support Date: Fri, 23 Sep 2022 14:06:53 +0800 Message-Id: <1663913220-9523-8-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add iMX8MQ PCIe EP support. Signed-off-by: Richard Zhu --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dt= s/freescale/imx8mq.dtsi index e9f0cdd10ab6..1c94e798e02f 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1581,6 +1581,33 @@ pcie1: pcie@33c00000 { status =3D "disabled"; }; =20 + pcie1_ep: pcie_ep@33c00000 { + compatible =3D "fsl,imx8mq-pcie-ep"; + reg =3D <0x33c00000 0x000400000>, + <0x20000000 0x08000000>; + reg-names =3D "regs", "addr_space"; + num-lanes =3D <1>; + interrupts =3D ; + interrupt-names =3D "dma"; + fsl,max-link-speed =3D <2>; + power-domains =3D <&pgc_pcie>; + resets =3D <&src IMX8MQ_RESET_PCIEPHY2>, + <&src IMX8MQ_RESET_PCIE2_CTRL_APPS_EN>, + <&src IMX8MQ_RESET_PCIE2_CTRL_APPS_TURNOFF>; + reset-names =3D "pciephy", "apps", "turnoff"; + assigned-clocks =3D <&clk IMX8MQ_CLK_PCIE2_CTRL>, + <&clk IMX8MQ_CLK_PCIE2_PHY>, + <&clk IMX8MQ_CLK_PCIE2_AUX>; + assigned-clock-parents =3D <&clk IMX8MQ_SYS2_PLL_250M>, + <&clk IMX8MQ_SYS2_PLL_100M>, + <&clk IMX8MQ_SYS1_PLL_80M>; + assigned-clock-rates =3D <250000000>, <100000000>, + <10000000>; + num-ib-windows =3D <4>; + num-ob-windows =3D <4>; + status =3D "disabled"; + }; + gic: interrupt-controller@38800000 { compatible =3D "arm,gic-v3"; reg =3D <0x38800000 0x10000>, /* GIC Dist */ --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E5E9C6FA82 for ; Fri, 23 Sep 2022 06:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbiIWG01 (ORCPT ); Fri, 23 Sep 2022 02:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbiIWG0I (ORCPT ); Fri, 23 Sep 2022 02:26:08 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A339C1284AB; Thu, 22 Sep 2022 23:26:03 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 23E6B215B09; Fri, 23 Sep 2022 08:26:01 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D7D4E215B13; Fri, 23 Sep 2022 08:26:00 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id BEE8B180031F; Fri, 23 Sep 2022 14:25:58 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 08/14] arm64: dts: Add iMX8MQ PCIe EP support on EVK board Date: Fri, 23 Sep 2022 14:06:54 +0800 Message-Id: <1663913220-9523-9-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add iMX8MQ PCIe EP support on EVK board. Signed-off-by: Richard Zhu --- arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mq-evk.dts index 82387b9cb800..9f3bad9b49a6 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts @@ -377,6 +377,18 @@ &pcie1 { status =3D "okay"; }; =20 +&pcie1_ep { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&pinctrl_pcie1>; + clocks =3D <&clk IMX8MQ_CLK_PCIE2_ROOT>, + <&clk IMX8MQ_CLK_PCIE2_AUX>, + <&clk IMX8MQ_CLK_PCIE2_PHY>, + <&pcie0_refclk>; + clock-names =3D "pcie", "pcie_aux", "pcie_phy", "pcie_bus"; + vph-supply =3D <&vgen5_reg>; + status =3D "disabled"; +}; + &pgc_gpu { power-supply =3D <&sw1a_reg>; }; --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0066EC6FA82 for ; Fri, 23 Sep 2022 06:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229709AbiIWG0X (ORCPT ); Fri, 23 Sep 2022 02:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230281AbiIWG0G (ORCPT ); Fri, 23 Sep 2022 02:26:06 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D009F1284B4; Thu, 22 Sep 2022 23:26:03 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DF8CB215AF3; Fri, 23 Sep 2022 08:26:01 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 94E35215B05; Fri, 23 Sep 2022 08:26:01 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 172811820F5A; Fri, 23 Sep 2022 14:26:00 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 09/14] arm64: dts: Add iMX8MP PCIe EP support Date: Fri, 23 Sep 2022 14:06:55 +0800 Message-Id: <1663913220-9523-10-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8MP PCIe EP support. Signed-off-by: Richard Zhu --- arch/arm64/boot/dts/freescale/imx8mp.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dt= s/freescale/imx8mp.dtsi index 21a4cc417c81..104d61a64a00 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi @@ -1142,6 +1142,25 @@ pcie: pcie@33800000 { status =3D "disabled"; }; =20 + pcie_ep: pcie_ep@33800000 { + compatible =3D "fsl,imx8mp-pcie-ep"; + reg =3D <0x33800000 0x000400000>, <0x18000000 0x08000000>; + reg-names =3D "regs", "addr_space"; + num-lanes =3D <1>; + interrupts =3D ; /* eDMA */ + interrupt-names =3D "dma"; + fsl,max-link-speed =3D <3>; + power-domains =3D <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_PCIE>; + resets =3D <&src IMX8MP_RESET_PCIE_CTRL_APPS_EN>, + <&src IMX8MP_RESET_PCIE_CTRL_APPS_TURNOFF>; + reset-names =3D "apps", "turnoff"; + phys =3D <&pcie_phy>; + phy-names =3D "pcie-phy"; + num-ib-windows =3D <4>; + num-ob-windows =3D <4>; + status =3D "disabled"; + }; + gpu3d: gpu@38000000 { compatible =3D "vivante,gc"; reg =3D <0x38000000 0x8000>; --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FE26C6FA82 for ; Fri, 23 Sep 2022 06:26:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230422AbiIWG0x (ORCPT ); Fri, 23 Sep 2022 02:26:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbiIWG0Q (ORCPT ); Fri, 23 Sep 2022 02:26:16 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D6112871F; Thu, 22 Sep 2022 23:26:05 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B4A711B67CD; Fri, 23 Sep 2022 08:26:03 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 69F1F1B67CA; Fri, 23 Sep 2022 08:26:03 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 63329180031F; Fri, 23 Sep 2022 14:26:01 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 10/14] arm64: dts: Add iMX8MP PCIe EP support on EVK board Date: Fri, 23 Sep 2022 14:06:56 +0800 Message-Id: <1663913220-9523-11-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i.MX8MP PCIe EP support on EVK board. Signed-off-by: Richard Zhu --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot= /dts/freescale/imx8mp-evk.dts index 9f1469db554d..6daaa5ddc6b6 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -390,6 +390,19 @@ &pcie { status =3D "okay"; }; =20 +&pcie_ep{ + pinctrl-names =3D "default"; + pinctrl-0 =3D <&pinctrl_pcie0>; + clocks =3D <&clk IMX8MP_CLK_HSIO_ROOT>, + <&clk IMX8MP_CLK_PCIE_ROOT>, + <&clk IMX8MP_CLK_HSIO_AXI>; + clock-names =3D "pcie", "pcie_aux", "pcie_bus"; + assigned-clocks =3D <&clk IMX8MP_CLK_PCIE_AUX>; + assigned-clock-rates =3D <10000000>; + assigned-clock-parents =3D <&clk IMX8MP_SYS_PLL2_50M>; + status =3D "disabled"; +}; + &snvs_pwrkey { status =3D "okay"; }; --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A28E4C6FA86 for ; Fri, 23 Sep 2022 06:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbiIWG0a (ORCPT ); Fri, 23 Sep 2022 02:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230351AbiIWG0N (ORCPT ); Fri, 23 Sep 2022 02:26:13 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA9611BCE0; Thu, 22 Sep 2022 23:26:06 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0A2B7215AF5; Fri, 23 Sep 2022 08:26:05 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B2B30200DC1; Fri, 23 Sep 2022 08:26:04 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id AEE8E1820F59; Fri, 23 Sep 2022 14:26:02 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 11/14] misc: pci_endpoint_test: Add iMX8 PCIe EP device support Date: Fri, 23 Sep 2022 14:06:57 +0800 Message-Id: <1663913220-9523-12-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Set the DEVICE_ID of i.MX8 PCIe and add iMX8 PCIE EP device support in pci_endpoint_test driver. Signed-off-by: Richard Zhu --- drivers/misc/pci_endpoint_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_t= est.c index 8f786a225dcf..18cea40c697b 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -72,6 +72,7 @@ #define PCI_DEVICE_ID_TI_J7200 0xb00f #define PCI_DEVICE_ID_TI_AM64 0xb010 #define PCI_DEVICE_ID_LS1088A 0x80c0 +#define PCI_DEVICE_ID_IMX8 0x0808 =20 #define is_am654_pci_dev(pdev) \ ((pdev)->device =3D=3D PCI_DEVICE_ID_TI_AM654) @@ -958,6 +959,7 @@ static const struct pci_device_id pci_endpoint_test_tbl= [] =3D { { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, 0x81c0), .driver_data =3D (kernel_ulong_t)&default_data, }, + { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_IMX8),}, { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_LS1088A), .driver_data =3D (kernel_ulong_t)&default_data, }, --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A03FCC6FA90 for ; Fri, 23 Sep 2022 06:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiIWG0m (ORCPT ); Fri, 23 Sep 2022 02:26:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbiIWG0O (ORCPT ); Fri, 23 Sep 2022 02:26:14 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94DC912872B; Thu, 22 Sep 2022 23:26:08 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 92A151B67D0; Fri, 23 Sep 2022 08:26:06 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 08D151B67CC; Fri, 23 Sep 2022 08:26:06 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 06C00180031F; Fri, 23 Sep 2022 14:26:03 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 12/14] PCI: imx6: Add iMX8MM PCIe EP mode Date: Fri, 23 Sep 2022 14:06:58 +0800 Message-Id: <1663913220-9523-13-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Based on i.MX8MM platforms, add the i.MX8MM PCIe EP mode support. Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 147 +++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 13 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index facc8e7b01c2..1044b0726405 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -52,6 +52,7 @@ enum imx6_pcie_variants { IMX8MQ, IMX8MM, IMX8MP, + IMX8MM_EP, }; =20 #define IMX6_PCIE_FLAG_IMX6_PHY BIT(0) @@ -60,6 +61,7 @@ enum imx6_pcie_variants { =20 struct imx6_pcie_drvdata { enum imx6_pcie_variants variant; + enum dw_pcie_device_mode mode; u32 flags; int dbi_length; const char *gpr; @@ -153,23 +155,27 @@ static unsigned int imx6_pcie_grp_offset(const struct= imx6_pcie *imx6_pcie) { WARN_ON(imx6_pcie->drvdata->variant !=3D IMX8MQ && imx6_pcie->drvdata->variant !=3D IMX8MM && + imx6_pcie->drvdata->variant !=3D IMX8MM_EP && imx6_pcie->drvdata->variant !=3D IMX8MP); return imx6_pcie->controller_id =3D=3D 1 ? IOMUXC_GPR16 : IOMUXC_GPR14; } =20 static void imx6_pcie_configure_type(struct imx6_pcie *imx6_pcie) { - unsigned int mask, val; + unsigned int mask, val, mode; + + if (imx6_pcie->drvdata->mode =3D=3D DW_PCIE_EP_TYPE) + mode =3D PCI_EXP_TYPE_ENDPOINT; + else + mode =3D PCI_EXP_TYPE_ROOT_PORT; =20 if (imx6_pcie->drvdata->variant =3D=3D IMX8MQ && imx6_pcie->controller_id =3D=3D 1) { mask =3D IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE; - val =3D FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, - PCI_EXP_TYPE_ROOT_PORT); + val =3D FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, mode); } else { mask =3D IMX6Q_GPR12_DEVICE_TYPE; - val =3D FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, - PCI_EXP_TYPE_ROOT_PORT); + val =3D FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode); } =20 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, mask, val); @@ -304,6 +310,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_p= cie) { switch (imx6_pcie->drvdata->variant) { case IMX8MM: + case IMX8MM_EP: case IMX8MP: /* * The PHY initialization had been done in the PHY @@ -561,6 +568,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *i= mx6_pcie) case IMX7D: break; case IMX8MM: + case IMX8MM_EP: case IMX8MQ: case IMX8MP: ret =3D clk_prepare_enable(imx6_pcie->pcie_aux); @@ -606,6 +614,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie = *imx6_pcie) IMX7D_GPR12_PCIE_PHY_REFCLK_SEL); break; case IMX8MM: + case IMX8MM_EP: case IMX8MQ: case IMX8MP: clk_disable_unprepare(imx6_pcie->pcie_aux); @@ -675,6 +684,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pci= e *imx6_pcie) reset_control_assert(imx6_pcie->pciephy_reset); fallthrough; case IMX8MM: + case IMX8MM_EP: case IMX8MP: reset_control_assert(imx6_pcie->apps_reset); break; @@ -751,6 +761,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pc= ie *imx6_pcie) break; case IMX6Q: /* Nothing to do */ case IMX8MM: + case IMX8MM_EP: case IMX8MP: break; } @@ -801,6 +812,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev) case IMX7D: case IMX8MQ: case IMX8MM: + case IMX8MM_EP: case IMX8MP: reset_control_deassert(imx6_pcie->apps_reset); break; @@ -821,6 +833,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev) case IMX7D: case IMX8MQ: case IMX8MM: + case IMX8MM_EP: case IMX8MP: reset_control_assert(imx6_pcie->apps_reset); break; @@ -1002,8 +1015,102 @@ static const struct dw_pcie_host_ops imx6_pcie_host= _ops =3D { =20 static const struct dw_pcie_ops dw_pcie_ops =3D { .start_link =3D imx6_pcie_start_link, + .stop_link =3D imx6_pcie_stop_link, +}; + +static void imx6_pcie_ep_init(struct dw_pcie_ep *ep) +{ + enum pci_barno bar; + struct dw_pcie *pci =3D to_dw_pcie_from_ep(ep); + + for (bar =3D BAR_0; bar <=3D BAR_5; bar++) + dw_pcie_ep_reset_bar(pci, bar); +} + +static int imx6_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no, + enum pci_epc_irq_type type, + u16 interrupt_num) +{ + struct dw_pcie *pci =3D to_dw_pcie_from_ep(ep); + + switch (type) { + case PCI_EPC_IRQ_LEGACY: + return dw_pcie_ep_raise_legacy_irq(ep, func_no); + case PCI_EPC_IRQ_MSI: + return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num); + case PCI_EPC_IRQ_MSIX: + return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num); + default: + dev_err(pci->dev, "UNKNOWN IRQ type\n"); + return -EINVAL; + } + + return 0; +} + +static const struct pci_epc_features imx8m_pcie_epc_features =3D { + .linkup_notifier =3D false, + .msi_capable =3D true, + .msix_capable =3D false, + .reserved_bar =3D 1 << BAR_1 | 1 << BAR_3, + .align =3D SZ_64K, +}; + +static const struct pci_epc_features* +imx6_pcie_ep_get_features(struct dw_pcie_ep *ep) +{ + return &imx8m_pcie_epc_features; +} + +static const struct dw_pcie_ep_ops pcie_ep_ops =3D { + .ep_init =3D imx6_pcie_ep_init, + .raise_irq =3D imx6_pcie_ep_raise_irq, + .get_features =3D imx6_pcie_ep_get_features, }; =20 +static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, + struct platform_device *pdev) +{ + int ret; + unsigned int pcie_dbi2_offset; + struct dw_pcie_ep *ep; + struct resource *res; + struct dw_pcie *pci =3D imx6_pcie->pci; + struct dw_pcie_rp *pp =3D &pci->pp; + struct device *dev =3D pci->dev; + + imx6_pcie_host_init(pp); + ep =3D &pci->ep; + ep->ops =3D &pcie_ep_ops; + + switch (imx6_pcie->drvdata->variant) { + case IMX8MM_EP: + pcie_dbi2_offset =3D SZ_1M; + break; + default: + pcie_dbi2_offset =3D SZ_4K; + break; + } + pci->dbi_base2 =3D pci->dbi_base + pcie_dbi2_offset; + res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); + if (!res) + return -EINVAL; + + ep->phys_base =3D res->start; + ep->addr_size =3D resource_size(res); + ep->page_size =3D SZ_64K; + + ret =3D dw_pcie_ep_init(ep); + if (ret) { + dev_err(dev, "failed to initialize endpoint\n"); + return ret; + } + /* Start LTSSM. */ + imx6_pcie_ltssm_enable(dev); + + return 0; +} + static void imx6_pcie_pm_turnoff(struct imx6_pcie *imx6_pcie) { struct device *dev =3D imx6_pcie->pci->dev; @@ -1189,6 +1296,7 @@ static int imx6_pcie_probe(struct platform_device *pd= ev) } break; case IMX8MM: + case IMX8MM_EP: case IMX8MP: imx6_pcie->pcie_aux =3D devm_clk_get(dev, "pcie_aux"); if (IS_ERR(imx6_pcie->pcie_aux)) @@ -1278,15 +1386,22 @@ static int imx6_pcie_probe(struct platform_device *= pdev) if (ret) return ret; =20 - ret =3D dw_pcie_host_init(&pci->pp); - if (ret < 0) - return ret; + if (imx6_pcie->drvdata->mode =3D=3D DW_PCIE_EP_TYPE) { + ret =3D imx6_add_pcie_ep(imx6_pcie, pdev); + if (ret < 0) + return ret; + } else { + ret =3D dw_pcie_host_init(&pci->pp); + if (ret < 0) + return ret; + + if (pci_msi_enabled()) { + u8 offset =3D dw_pcie_find_capability(pci, PCI_CAP_ID_MSI); =20 - if (pci_msi_enabled()) { - u8 offset =3D dw_pcie_find_capability(pci, PCI_CAP_ID_MSI); - val =3D dw_pcie_readw_dbi(pci, offset + PCI_MSI_FLAGS); - val |=3D PCI_MSI_FLAGS_ENABLE; - dw_pcie_writew_dbi(pci, offset + PCI_MSI_FLAGS, val); + val =3D dw_pcie_readw_dbi(pci, offset + PCI_MSI_FLAGS); + val |=3D PCI_MSI_FLAGS_ENABLE; + dw_pcie_writew_dbi(pci, offset + PCI_MSI_FLAGS, val); + } } =20 return 0; @@ -1342,6 +1457,11 @@ static const struct imx6_pcie_drvdata drvdata[] =3D { .flags =3D IMX6_PCIE_FLAG_SUPPORTS_SUSPEND, .gpr =3D "fsl,imx8mp-iomuxc-gpr", }, + [IMX8MM_EP] =3D { + .variant =3D IMX8MM_EP, + .mode =3D DW_PCIE_EP_TYPE, + .gpr =3D "fsl,imx8mm-iomuxc-gpr", + }, }; =20 static const struct of_device_id imx6_pcie_of_match[] =3D { @@ -1352,6 +1472,7 @@ static const struct of_device_id imx6_pcie_of_match[]= =3D { { .compatible =3D "fsl,imx8mq-pcie", .data =3D &drvdata[IMX8MQ], }, { .compatible =3D "fsl,imx8mm-pcie", .data =3D &drvdata[IMX8MM], }, { .compatible =3D "fsl,imx8mp-pcie", .data =3D &drvdata[IMX8MP], }, + { .compatible =3D "fsl,imx8mm-pcie-ep", .data =3D &drvdata[IMX8MM_EP], }, {}, }; =20 --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D16CECAAD8 for ; Fri, 23 Sep 2022 06:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbiIWG0s (ORCPT ); Fri, 23 Sep 2022 02:26:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbiIWG0Q (ORCPT ); Fri, 23 Sep 2022 02:26:16 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D374612873D; Thu, 22 Sep 2022 23:26:09 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DEA901B67D6; Fri, 23 Sep 2022 08:26:07 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 562081B67D2; Fri, 23 Sep 2022 08:26:07 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 4EE17181D0CB; Fri, 23 Sep 2022 14:26:05 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 13/14] PCI: imx6: Add iMX8MQ PCIe EP support Date: Fri, 23 Sep 2022 14:06:59 +0800 Message-Id: <1663913220-9523-14-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add the iMX8MQ PCIe EP support Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 36 +++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index 1044b0726405..931243e36252 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -53,6 +53,7 @@ enum imx6_pcie_variants { IMX8MM, IMX8MP, IMX8MM_EP, + IMX8MQ_EP, }; =20 #define IMX6_PCIE_FLAG_IMX6_PHY BIT(0) @@ -154,6 +155,7 @@ struct imx6_pcie { static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie) { WARN_ON(imx6_pcie->drvdata->variant !=3D IMX8MQ && + imx6_pcie->drvdata->variant !=3D IMX8MQ_EP && imx6_pcie->drvdata->variant !=3D IMX8MM && imx6_pcie->drvdata->variant !=3D IMX8MM_EP && imx6_pcie->drvdata->variant !=3D IMX8MP); @@ -169,13 +171,22 @@ static void imx6_pcie_configure_type(struct imx6_pcie= *imx6_pcie) else mode =3D PCI_EXP_TYPE_ROOT_PORT; =20 - if (imx6_pcie->drvdata->variant =3D=3D IMX8MQ && - imx6_pcie->controller_id =3D=3D 1) { - mask =3D IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE; - val =3D FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, mode); - } else { + switch (imx6_pcie->drvdata->variant) { + case IMX8MQ: + case IMX8MQ_EP: + if (imx6_pcie->controller_id =3D=3D 1) { + mask =3D IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE; + val =3D FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, + mode); + } else { + mask =3D IMX6Q_GPR12_DEVICE_TYPE; + val =3D FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode); + } + break; + default: mask =3D IMX6Q_GPR12_DEVICE_TYPE; val =3D FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode); + break; } =20 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, mask, val); @@ -318,6 +329,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_p= cie) */ break; case IMX8MQ: + case IMX8MQ_EP: /* * TODO: Currently this code assumes external * oscillator is being used @@ -570,6 +582,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *i= mx6_pcie) case IMX8MM: case IMX8MM_EP: case IMX8MQ: + case IMX8MQ_EP: case IMX8MP: ret =3D clk_prepare_enable(imx6_pcie->pcie_aux); if (ret) { @@ -616,6 +629,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie = *imx6_pcie) case IMX8MM: case IMX8MM_EP: case IMX8MQ: + case IMX8MQ_EP: case IMX8MP: clk_disable_unprepare(imx6_pcie->pcie_aux); break; @@ -681,6 +695,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pci= e *imx6_pcie) switch (imx6_pcie->drvdata->variant) { case IMX7D: case IMX8MQ: + case IMX8MQ_EP: reset_control_assert(imx6_pcie->pciephy_reset); fallthrough; case IMX8MM: @@ -723,6 +738,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pc= ie *imx6_pcie) =20 switch (imx6_pcie->drvdata->variant) { case IMX8MQ: + case IMX8MQ_EP: reset_control_deassert(imx6_pcie->pciephy_reset); break; case IMX7D: @@ -811,6 +827,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev) break; case IMX7D: case IMX8MQ: + case IMX8MQ_EP: case IMX8MM: case IMX8MM_EP: case IMX8MP: @@ -832,6 +849,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev) break; case IMX7D: case IMX8MQ: + case IMX8MQ_EP: case IMX8MM: case IMX8MM_EP: case IMX8MP: @@ -1085,6 +1103,7 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pc= ie, =20 switch (imx6_pcie->drvdata->variant) { case IMX8MM_EP: + case IMX8MQ_EP: pcie_dbi2_offset =3D SZ_1M; break; default: @@ -1272,6 +1291,7 @@ static int imx6_pcie_probe(struct platform_device *pd= ev) "pcie_inbound_axi clock missing or invalid\n"); break; case IMX8MQ: + case IMX8MQ_EP: imx6_pcie->pcie_aux =3D devm_clk_get(dev, "pcie_aux"); if (IS_ERR(imx6_pcie->pcie_aux)) return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux), @@ -1462,6 +1482,11 @@ static const struct imx6_pcie_drvdata drvdata[] =3D { .mode =3D DW_PCIE_EP_TYPE, .gpr =3D "fsl,imx8mm-iomuxc-gpr", }, + [IMX8MQ_EP] =3D { + .variant =3D IMX8MQ_EP, + .mode =3D DW_PCIE_EP_TYPE, + .gpr =3D "fsl,imx8mq-iomuxc-gpr", + }, }; =20 static const struct of_device_id imx6_pcie_of_match[] =3D { @@ -1473,6 +1498,7 @@ static const struct of_device_id imx6_pcie_of_match[]= =3D { { .compatible =3D "fsl,imx8mm-pcie", .data =3D &drvdata[IMX8MM], }, { .compatible =3D "fsl,imx8mp-pcie", .data =3D &drvdata[IMX8MP], }, { .compatible =3D "fsl,imx8mm-pcie-ep", .data =3D &drvdata[IMX8MM_EP], }, + { .compatible =3D "fsl,imx8mq-pcie-ep", .data =3D &drvdata[IMX8MQ_EP], }, {}, }; =20 --=20 2.25.1 From nobody Thu Apr 2 13:16:03 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFB84ECAAD8 for ; Fri, 23 Sep 2022 06:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229578AbiIWG07 (ORCPT ); Fri, 23 Sep 2022 02:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbiIWG0Q (ORCPT ); Fri, 23 Sep 2022 02:26:16 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8986128720; Thu, 22 Sep 2022 23:26:10 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B82F01B67D1; Fri, 23 Sep 2022 08:26:08 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 2FAB51B67CC; Fri, 23 Sep 2022 08:26:08 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 9CC841820F5A; Fri, 23 Sep 2022 14:26:06 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, shawnguo@kernel.org, kishon@ti.com, kw@linux.com, frank.li@nxp.com Cc: hongxing.zhu@nxp.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v3 14/14] PCI: imx6: Add iMX8MP PCIe EP support Date: Fri, 23 Sep 2022 14:07:00 +0800 Message-Id: <1663913220-9523-15-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> References: <1663913220-9523-1-git-send-email-hongxing.zhu@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add the iMX8MP PCIe EP support Signed-off-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index 931243e36252..e339e32d97f8 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -54,6 +54,7 @@ enum imx6_pcie_variants { IMX8MP, IMX8MM_EP, IMX8MQ_EP, + IMX8MP_EP, }; =20 #define IMX6_PCIE_FLAG_IMX6_PHY BIT(0) @@ -158,7 +159,8 @@ static unsigned int imx6_pcie_grp_offset(const struct i= mx6_pcie *imx6_pcie) imx6_pcie->drvdata->variant !=3D IMX8MQ_EP && imx6_pcie->drvdata->variant !=3D IMX8MM && imx6_pcie->drvdata->variant !=3D IMX8MM_EP && - imx6_pcie->drvdata->variant !=3D IMX8MP); + imx6_pcie->drvdata->variant !=3D IMX8MP && + imx6_pcie->drvdata->variant !=3D IMX8MP_EP); return imx6_pcie->controller_id =3D=3D 1 ? IOMUXC_GPR16 : IOMUXC_GPR14; } =20 @@ -323,6 +325,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_p= cie) case IMX8MM: case IMX8MM_EP: case IMX8MP: + case IMX8MP_EP: /* * The PHY initialization had been done in the PHY * driver, break here directly. @@ -584,6 +587,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *i= mx6_pcie) case IMX8MQ: case IMX8MQ_EP: case IMX8MP: + case IMX8MP_EP: ret =3D clk_prepare_enable(imx6_pcie->pcie_aux); if (ret) { dev_err(dev, "unable to enable pcie_aux clock\n"); @@ -631,6 +635,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie = *imx6_pcie) case IMX8MQ: case IMX8MQ_EP: case IMX8MP: + case IMX8MP_EP: clk_disable_unprepare(imx6_pcie->pcie_aux); break; default: @@ -701,6 +706,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pci= e *imx6_pcie) case IMX8MM: case IMX8MM_EP: case IMX8MP: + case IMX8MP_EP: reset_control_assert(imx6_pcie->apps_reset); break; case IMX6SX: @@ -779,6 +785,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pc= ie *imx6_pcie) case IMX8MM: case IMX8MM_EP: case IMX8MP: + case IMX8MP_EP: break; } =20 @@ -831,6 +838,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev) case IMX8MM: case IMX8MM_EP: case IMX8MP: + case IMX8MP_EP: reset_control_deassert(imx6_pcie->apps_reset); break; } @@ -853,6 +861,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev) case IMX8MM: case IMX8MM_EP: case IMX8MP: + case IMX8MP_EP: reset_control_assert(imx6_pcie->apps_reset); break; } @@ -1104,6 +1113,7 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pc= ie, switch (imx6_pcie->drvdata->variant) { case IMX8MM_EP: case IMX8MQ_EP: + case IMX8MP_EP: pcie_dbi2_offset =3D SZ_1M; break; default: @@ -1318,6 +1328,7 @@ static int imx6_pcie_probe(struct platform_device *pd= ev) case IMX8MM: case IMX8MM_EP: case IMX8MP: + case IMX8MP_EP: imx6_pcie->pcie_aux =3D devm_clk_get(dev, "pcie_aux"); if (IS_ERR(imx6_pcie->pcie_aux)) return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux), @@ -1487,6 +1498,11 @@ static const struct imx6_pcie_drvdata drvdata[] =3D { .mode =3D DW_PCIE_EP_TYPE, .gpr =3D "fsl,imx8mq-iomuxc-gpr", }, + [IMX8MP_EP] =3D { + .variant =3D IMX8MP_EP, + .mode =3D DW_PCIE_EP_TYPE, + .gpr =3D "fsl,imx8mp-iomuxc-gpr", + }, }; =20 static const struct of_device_id imx6_pcie_of_match[] =3D { @@ -1499,6 +1515,7 @@ static const struct of_device_id imx6_pcie_of_match[]= =3D { { .compatible =3D "fsl,imx8mp-pcie", .data =3D &drvdata[IMX8MP], }, { .compatible =3D "fsl,imx8mm-pcie-ep", .data =3D &drvdata[IMX8MM_EP], }, { .compatible =3D "fsl,imx8mq-pcie-ep", .data =3D &drvdata[IMX8MQ_EP], }, + { .compatible =3D "fsl,imx8mp-pcie-ep", .data =3D &drvdata[IMX8MP_EP], }, {}, }; =20 --=20 2.25.1