Skip to contentSkip to conversation

fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

PATCH New Roy Zang 3 participants 5 messages Jun 12, 2014 – Jun 20, 2014 PCI

lore
Share & tools
lore

Roy Zang

author
#0 lore raw

PATCH 1/1 fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

Even u-boot boots up, the pcie link may not setup correctly when Freescale SOC acts as endpoint.
So change the link status from 'no link' to 'undetermined' to reduce the confusion.
The link status can check from host side eventually.

---
 drivers/pci/fsl_pci_init.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/pci/fsl_pci_init.c +8 -2
index 3a41b0e..231b075 100644
@@ -504,8 +504,14 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
 		}
 #endif
 		if (!enabled) {
-			/* Let the user know there's no PCIe link */
-			printf("no link, regs @ 0x%lx\n", pci_info->regs);
+			/* Let the user know there's no PCIe link for root
+			 * complex. for endpoint, the link may not setup, so
+			 * print undetermined.
+			 */
+			if (fsl_is_pci_agent(hose))
+				printf("undetermined, regs @ 0x%lx\n", pci_info->regs);
+			else
+				printf("no link, regs @ 0x%lx\n", pci_info->regs);
 			hose->last_busno = hose->first_busno;
 			return;
 		}
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

Dear Roy Zang,

Quoted 5 lines · In message <[email protected]> you…

Even u-boot boots up, the pcie link may not setup correctly when Freescale SOC acts as endpoint.
So change the link status from 'no link' to 'undetermined' to reduce the confusion.
The link status can check from host side eventually.

Sorry, but can you please explain what exactly you are doing here? I'm sorry, but I don't understand above text.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Experience is what causes a person to make new  mistakes  instead  of
old ones.
author
#2 lore raw

PATCH 1/1 fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

Quoted 10 lines · Wolfgang Denk

Dear Roy Zang,

Quoted 5 lines · In message <[email protected]> you…

Even u-boot boots up, the pcie link may not setup correctly when Freescale SOC acts as endpoint.
So change the link status from 'no link' to 'undetermined' to reduce the confusion.
The link status can check from host side eventually.

Sorry, but can you please explain what exactly you are doing here? I'm sorry, but I don't understand above text.

Freescale card acted as PCIe endpoint plugs into a X86 host via PCIe slot. We do see some case that the u-boot prints "no link" when boot up, however in X86 Linux, the pcie link sets up correctly. Host Linux boots up slow than u-boot.
So if u-boot can capture the link up status, it will print the endpoint link up status, or it will print "undetermined" to reduce confusion. User can still confirm the link up status from host.
Thank.
Roy

#3 lore raw

PATCH 1/1 fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

In reply to Roy Zang

Hi Roy,

Quoted 17 lines · Roy Zang

Even u-boot boots up, the pcie link may not setup correctly when Freescale SOC acts as endpoint.
So change the link status from 'no link' to 'undetermined' to reduce the confusion.
The link status can check from host side eventually.

---
  drivers/pci/fsl_pci_init.c |   10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/pci/fsl_pci_init.c +0 -0
index 3a41b0e..231b075 100644
@@ -504,8 +504,14 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
  		}

drivers/pci/fsl_pci_init.c void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) · line 512

Quoted 10 lines
drivers/pci/fsl_pci_init.c +6 -2
  #endif
  		if (!enabled) {
-			/* Let the user know there's no PCIe link */
-			printf("no link, regs @ 0x%lx\n", pci_info->regs);
+			/* Let the user know there's no PCIe link for root
+			 * complex. for endpoint, the link may not setup, so
+			 * print undetermined.
+			 */
+			if (fsl_is_pci_agent(hose))
+				printf("undetermined, regs @ 0x%lx\n", pci_info->regs);

As description of commit message saying "The link status can check from host side eventually "
It will be good, if we can also print link status at this point to let user know about status of end point.

-prabhakar

author
#4 lore raw

PATCH 1/1 fsl/pcie: Change 'no link' to 'undetermined' for pcie endpoint

Quoted 29 lines · Prabhakar Kushwaha

Hi Roy,

Quoted 25 lines · Roy Zang

Even u-boot boots up, the pcie link may not setup correctly when Freescale SOC acts as endpoint.
So change the link status from 'no link' to 'undetermined' to reduce the confusion.
The link status can check from host side eventually.

---
  drivers/pci/fsl_pci_init.c |   10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/pci/fsl_pci_init.c +3 -2
index 3a41b0e..231b075 100644
@@ -504,8 +504,14 @@ void fsl_pci_init(struct pci_controller *hose, 
 struct fsl_pci_info *pci_info)
          }
  #endif
          if (!enabled) {
-            /* Let the user know there's no PCIe link */
-            printf("no link, regs @ 0x%lx\n", pci_info->regs);
+            /* Let the user know there's no PCIe link for root
+             * complex. for endpoint, the link may not setup, so
+             * print undetermined.
Quoted 9 lines

drivers/pci/fsl_pci_init.c void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info) · line 512

Quoted 3 lines
drivers/pci/fsl_pci_init.c +3 -0
+             */
+            if (fsl_is_pci_agent(hose))
+                printf("undetermined, regs @ 0x%lx\n", pci_info->regs);

As description of commit message saying "The link status can check from host side eventually "
It will be good, if we can also print link status at this point to let user know about status of end point.

however, the *no link* status prints by u-boot may not reflect the final link up status. It will cause confusion.
Roy