U-Boot PCI driver for mx6sxsabresd

Hi Marek, I saw your commit c5773ccdca8a ("pci: imx: Add iMX6SX compatible") and I've been trying to convert the PCI driver to DM_PCI on a mx6sxsabresd board.
I did the following changes:
--git a/arch/arm/dts/imx6sx-sdb.dtsi b/arch/arm/dts/imx6sx-sdb.dtsi index da815527a7..f5b0e9ee3f 100644 --- a/arch/arm/dts/imx6sx-sdb.dtsi +++ b/arch/arm/dts/imx6sx-sdb.dtsi @@ -78,6 +78,17 @@ enable-active-high; };
+ reg_pcie_gpio: regulator-pcie-gpio { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie_reg>; + regulator-name = "MPCIE_3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio2 1 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + reg_usb_otg2_vbus: regulator@2 { compatible = "regulator-fixed"; reg = <2>; @@ -154,6 +165,14 @@ status = "okay"; };
+&pcie { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcie>; + reset-gpio = <&gpio2 0 GPIO_ACTIVE_LOW>; + vpcie-supply = <®_pcie_gpio>; + status = "okay"; +}; + &fec1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enet1>; @@ -453,6 +472,18 @@ >; };
+ pinctrl_pcie: pciegrp { + fsl,pins = < + MX6SX_PAD_ENET1_COL__GPIO2_IO_0 0x10b0 + >; + }; + + pinctrl_pcie_reg: pciereggrp { + fsl,pins = < + MX6SX_PAD_ENET1_CRS__GPIO2_IO_1 0x10b0 + >; + }; + pinctrl_peri_3v3: peri3v3grp { fsl,pins = < MX6SX_PAD_QSPI1A_DATA0__GPIO4_IO_16 0x80000000 diff --git a/configs/mx6sxsabresd_defconfig b/configs/mx6sxsabresd_defconfig index 5150e3a837..6ce7e01b5f 100644 --- a/configs/mx6sxsabresd_defconfig +++ b/configs/mx6sxsabresd_defconfig @@ -68,3 +68,4 @@ CONFIG_USB_STORAGE=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_VIDEO=y +CONFIG_DM_PCI=y diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 55aace1c6e..52aaa82fbc 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -166,12 +166,10 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #endif
-#ifdef CONFIG_CMD_PCI #define CONFIG_PCI_SCAN_SHOW #define CONFIG_PCIE_IMX #define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(2, 0) #define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(2, 1) -#endif
#define CONFIG_IMX_THERMAL
Which obtained the following output:
=> pci enum => pci 0 No such bus => pci 1 No such bus
Before the DM conversion. Do you have any suggestions as to why the PCI device is not detected after the DM_PCI conversion? Are you able to get i.MX6SX to detect PCI devices when using DM_PCI?
Thank you in advance, Pedro Jardim.

On 1/28/20 6:11 PM, Pedro Jardim wrote:
Hi Marek,
Hi,
I saw your commit c5773ccdca8a ("pci: imx: Add iMX6SX compatible") and I've been trying to convert the PCI driver to DM_PCI on a mx6sxsabresd board.
I did the following changes:
--git a/arch/arm/dts/imx6sx-sdb.dtsi b/arch/arm/dts/imx6sx-sdb.dtsi index da815527a7..f5b0e9ee3f 100644 --- a/arch/arm/dts/imx6sx-sdb.dtsi +++ b/arch/arm/dts/imx6sx-sdb.dtsi @@ -78,6 +78,17 @@ enable-active-high; };
reg_pcie_gpio: regulator-pcie-gpio {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcie_reg>;
regulator-name = "MPCIE_3V3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpio = <&gpio2 1 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
reg_usb_otg2_vbus: regulator@2 { compatible = "regulator-fixed"; reg = <2>;
@@ -154,6 +165,14 @@ status = "okay"; };
+&pcie {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pcie>;
reset-gpio = <&gpio2 0 GPIO_ACTIVE_LOW>;
vpcie-supply = <®_pcie_gpio>;
^ Is this even a valid DT ?
[...]
diff --git a/configs/mx6sxsabresd_defconfig b/configs/mx6sxsabresd_defconfig index 5150e3a837..6ce7e01b5f 100644 --- a/configs/mx6sxsabresd_defconfig +++ b/configs/mx6sxsabresd_defconfig @@ -68,3 +68,4 @@ CONFIG_USB_STORAGE=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_VIDEO=y +CONFIG_DM_PCI=y
You might need DM regulator somewhere. Take a look at what VINING 2000 does there, the PCI worked on that one.
diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 55aace1c6e..52aaa82fbc 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -166,12 +166,10 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 #endif
-#ifdef CONFIG_CMD_PCI #define CONFIG_PCI_SCAN_SHOW #define CONFIG_PCIE_IMX #define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(2, 0) #define CONFIG_PCIE_IMX_POWER_GPIO IMX_GPIO_NR(2, 1) -#endif
#define CONFIG_IMX_THERMAL
Which obtained the following output:
=> pci enum => pci 0 No such bus => pci 1 No such bus
Before the DM conversion. Do you have any suggestions as to why the PCI device is not detected after the DM_PCI conversion? Are you able to get i.MX6SX to detect PCI devices when using DM_PCI?
Yep, see above.
participants (2)
-
Marek Vasut
-
Pedro Jardim