aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-08-02 11:56:44 -0400
committerChris Metcalf <cmetcalf@tilera.com>2013-08-05 16:13:08 -0400
commit26cde05a2cb7d4c0f4cd1d4aeeadc2939c972786 (patch)
tree889f4d44329ce9125cee94f01d7ab07a25ca699a
parentb3ad73a33ebfd585b3ab551a9fc65d684b82adc3 (diff)
tile PCI RC: handle case that PCI link is already up
If we are rebooting (e.g. via kexec) then the PCI RC link may already be up. In that case, we don't want to do the software fixup to force the link up, since that can degrade it to Gen1. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
-rw-r--r--arch/tile/kernel/pci_gx.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index e99809ecd272..2cc3e64ab0df 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -674,10 +674,33 @@ int __init pcibios_init(void)
674 continue; 674 continue;
675 } 675 }
676 676
677 ret = gxio_trio_force_rc_link_up(trio_context, mac); 677 /*
678 if (ret < 0) 678 * Check for PCIe link-up status to decide if we need
679 pr_err("PCI: PCIE_FORCE_LINK_UP failure, " 679 * to force the link to come up.
680 "MAC %d on TRIO %d\n", mac, trio_index); 680 */
681 reg_offset =
682 (TRIO_PCIE_INTFC_PORT_STATUS <<
683 TRIO_CFG_REGION_ADDR__REG_SHIFT) |
684 (TRIO_CFG_REGION_ADDR__INTFC_VAL_MAC_INTERFACE <<
685 TRIO_CFG_REGION_ADDR__INTFC_SHIFT) |
686 (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
687
688 port_status.word =
689 __gxio_mmio_read(trio_context->mmio_base_mac +
690 reg_offset);
691 if (!port_status.dl_up) {
692 if (rc_delay[trio_index][mac]) {
693 pr_info("Delaying PCIe RC TRIO init %d sec"
694 " on MAC %d on TRIO %d\n",
695 rc_delay[trio_index][mac], mac,
696 trio_index);
697 msleep(rc_delay[trio_index][mac] * 1000);
698 }
699 ret = gxio_trio_force_rc_link_up(trio_context, mac);
700 if (ret < 0)
701 pr_err("PCI: PCIE_FORCE_LINK_UP failure, "
702 "MAC %d on TRIO %d\n", mac, trio_index);
703 }
681 704
682 pr_info("PCI: Found PCI controller #%d on TRIO %d MAC %d\n", i, 705 pr_info("PCI: Found PCI controller #%d on TRIO %d MAC %d\n", i,
683 trio_index, controller->mac); 706 trio_index, controller->mac);
@@ -700,16 +723,8 @@ int __init pcibios_init(void)
700 } 723 }
701 724
702 /* 725 /*
703 * Check for PCIe link-up status. 726 * Check for PCIe link-up status again.
704 */ 727 */
705
706 reg_offset =
707 (TRIO_PCIE_INTFC_PORT_STATUS <<
708 TRIO_CFG_REGION_ADDR__REG_SHIFT) |
709 (TRIO_CFG_REGION_ADDR__INTFC_VAL_MAC_INTERFACE <<
710 TRIO_CFG_REGION_ADDR__INTFC_SHIFT ) |
711 (mac << TRIO_CFG_REGION_ADDR__MAC_SEL_SHIFT);
712
713 port_status.word = 728 port_status.word =
714 __gxio_mmio_read(trio_context->mmio_base_mac + 729 __gxio_mmio_read(trio_context->mmio_base_mac +
715 reg_offset); 730 reg_offset);