AnsweredAssumed Answered

i.MX6SX hang when enabling pcie on sabresd.

Question asked by Mattias Barthel on Mar 21, 2017
Latest reply on Mar 27, 2017 by igorpadykov

Following the thread i.MX6SX hang when enabling pcie that was strangely set to Assumed Answered but it is not resolved.

 

I managed to build from the release bsp (4.1.15_2.0.0.ga) as instructed by Igor. I used the DTS files as they are.

I enabled PCI support, MSI and from PCI host controller drivers,  imx6 pcie driver in Kconfig:

[*] PCI support                                                                           
                  [*] Message Signaled Interrupts (MSI and MSI-X)                                           
                  [ ] PCI Debugging                                                                         
                  [ ] Enable PCI resource re-allocation detection                                           
                  < > PCI Stub driver                                                                       
                  [ ] PCI IOV support                                                                       
                  [ ] PCI PRI support                                                                       
                  [ ] PCI PASID support                                                                     
                      PCI host controller drivers  --->                                                     
                  -*- PCI Express Port Bus support                                                          
                  [*]   Root Port Advanced Error Reporting support                                          
                  [ ]     PCI Express ECRC settings control                                                 
                  < >     PCIe AER error injector support                                                   
                  [*]   PCI Express ASPM control                                                            
                  [ ]     Debug PCI Express ASPM                                                            
                          Default ASPM policy (BIOS default)  --->                                          
                  < > PCCard (PCMCIA/CardBus) support  ----             

 

 

[*] Freescale i.MX6 PCIe controller                                                       
                  [ ]   Enable pcie compliance tests on imx6                                                
                  [ ]   PCI Express EP mode in the IMX6 RC/EP interconnection system                        
                  [*]     PCI Express RC mode in the IMX6 RC/EP interconnection system                     
                  [*]       i.MX6 PCI Express EP skeleton driver                                            
                  [ ] Generic PCI host controller                                                           
                  [ ] Freescale Layerscape PCIe controller                                                  
                  < > Broadcom iProc PCIe controller         

 


Build Configuration:
BB_VERSION        = "1.30.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx6sxsabresd"
DISTRO            = "fsl-imx-x11"
DISTRO_VERSION    = "4.1.15-2.0.0"
TUNE_FEATURES     = "arm armv7a vfp  neon        callconvention-hard        cortexa9"
TARGET_FPU        = "hard"
meta               
meta-poky         = "HEAD:f5da2a5913319ad6ac2141438ba1aa17576326ab"
meta-oe            
meta-multimedia   = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-fsl-arm      = "HEAD:be78894e4682f111575470fb23e51e6ba523508d"
meta-fsl-arm-extra = "HEAD:3dfb82fc7e703eae9891b3ffda0e9393701f2396"
meta-fsl-demos    = "HEAD:a165068f8a0d1cf29aabe4b4053f28be1c2aa492"
meta-bsp           
meta-sdk          = "HEAD:0451810f7ec7da962bd899f5b0fe26afee1676ca"
meta-browser      = "HEAD:77736988073a5d90fcff9d0005c8477332ede387"
meta-gnome         
meta-networking    
meta-python        
meta-filesystems  = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-qt5          = "HEAD:ccae79be69c5268df3b47e4e14cea0591c39a531"
-------------

 

 

 

I did the following modifications to the IMX6 pci driver to enable PCIe 3.3V bus regulator and just added a debug printout:

---------------

builder@build-server-1:~/fsl-release-bsp/build/tmp/work-shared/imx6sxsabresd/kernel-source$ git diff drivers/pci/host/pci-imx6.c
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 7a661dd1..cbb27e5 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -683,9 +683,9 @@ static int imx6_pcie_host_init(struct pcie_port *pp)
       imx6_pcie_init_phy(pp);
 
       imx6_pcie_deassert_core_reset(pp);
-
+        printk(KERN_CRIT"before dw_pcie_setup_rc\n");
       dw_pcie_setup_rc(pp);
-
+       printk(KERN_CRIT"after dw_pcie_setup_rc\n");
       ret = imx6_pcie_start_link(pp);
       if (ret < 0)
               return ret;
@@ -1262,7 +1262,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
       }
 
       imx6_pcie->pcie_bus_regulator = devm_regulator_get(pp->dev,
-                       "pcie-bus");
+                       "MPCIE_3V3");
       if (IS_ERR(imx6_pcie->pcie_bus_regulator))
               imx6_pcie->pcie_bus_regulator = NULL;


---diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index e179a76..e806c72 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -792,7 +792,9 @@ void dw_pcie_setup_rc(struct pcie_port *pp)
       u32 memlimit;
 
       /* set the number of lanes */
+        printk(KERN_CRIT"dw_pcie_readl_rc\n");
       dw_pcie_readl_rc(pp, PCIE_PORT_LINK_CONTROL, &val);
+        printk(KERN_CRIT" after dw_pcie_readl_rc\n");
       val &= ~PORT_LINK_MODE_MASK;
       switch (pp->lanes) {
       case 1:

---------------

But it hangs just the same as in the community code. (The first access towards CDM port logic registers).

Kernel boot printouts:

-------

NET: Registered protocol family 26
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Bluetooth: HIDP socket layer initialized
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
before dw_pcie_setup_rc
dw_pcie_readl_rc

Why is this hang occurring?

 

All eventual help is highly appreciated!

 

Outcomes