i.MX6SX hang when enabling pcie on sabresd.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX6SX hang when enabling pcie on sabresd.

1,354 Views
mattiasbarthel
Contributor II

Following the thread https://community.nxp.com/message/888683 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!

Labels (1)
0 Kudos
7 Replies

899 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mattias

seems only CONFIG_PCI=y, CONFIG_PCI_IMX6=y may be needed as mentioned on
https://lists.yoctoproject.org/pipermail/meta-freescale/2015-March/013063.html

Best regards
igor

0 Kudos

899 Views
mattiasbarthel
Contributor II

Hi Igor,

Yes, I got the PCIe working finally as mentioned in this thread:

https://community.nxp.com/message/888493 

Thanks for all the help! Really appreciate it!

Now I am still wondering why I needed to to the uboot tweak?

What is it that uboot is switching on or off?

Regards,

Mattias

0 Kudos

899 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mattias

one can check comments about uboot pcie usage in mx6sxsabresd.h

http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/include/configs/mx6sxsabresd.h?h=imx_v2... 

Best regards
igor

0 Kudos

899 Views
mattiasbarthel
Contributor II

Thanks  Igor,

Yes I read that comment various times. It only says that it would affect

EP/RC validation negatively. And I dont even have that part activated in the MX6 PCIe driver.

Thus, I dont have the EP/RC validation turned on in Kconfig.

/*  * The PCIe support in uboot would bring failures in i.MX6SX PCIe  * EP/RC validations. Disable PCIe support in uboot here.  * RootCause: The bit10(ltssm_en) of GPR12 would be set in uboot,  * thus the i.MX6SX PCIe EP would be cheated that the other i.MX6SX  * PCIe RC had been configured and trying to setup PCIe link directly,  * although the i.MX6SX RC is not properly configured at that time.  * PCIe can be supported in uboot, if the i.MX6SX PCIe EP/RC validation  * is not running. */ /* #define CONFIG_CMD_PCI */

Best regards,

Mattias

0 Kudos

899 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mattias

this remark is valid for all configurations, not only for EP/RC validation

Best regards
igor

0 Kudos

899 Views
mattiasbarthel
Contributor II

Sorry, Igor.

I dont quite follow. Are you saying that it is not valid to run with PCI enabled in kernel when it was already enabled in uboot at all? That this will give failure?

If so how?

0 Kudos

899 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mattias

 

right, this is recommended, since there may be issues as desribed in uboot comments.

So if issue appears, first step would be check if it is enabled in uboot.

 

Best regards
igor

0 Kudos