aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-08-05 14:27:05 -0400
committerChris Metcalf <cmetcalf@tilera.com>2013-08-06 12:56:08 -0400
commit5026dafa177133f9b6bf0000dfc98596fa4ad2fd (patch)
treede55adb83145e8815f287a0ef89ce01dbdeaaa30
parent02b67e09541b85d8f92e0a68a9deb1c33e6626bb (diff)
tile PCI RC: support PCIe TRIO 0 MAC 0 on Gx72 system
On Tilera Gx72 systems, the logic for figuring out whether a given port is root complex is slightly different. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
-rw-r--r--arch/tile/include/hv/drv_trio_intf.h3
-rw-r--r--arch/tile/kernel/pci_gx.c33
2 files changed, 33 insertions, 3 deletions
diff --git a/arch/tile/include/hv/drv_trio_intf.h b/arch/tile/include/hv/drv_trio_intf.h
index ec643a02b4c5..237e04dee66c 100644
--- a/arch/tile/include/hv/drv_trio_intf.h
+++ b/arch/tile/include/hv/drv_trio_intf.h
@@ -168,6 +168,9 @@ pcie_stream_intr_config_sel_t;
168struct pcie_trio_ports_property 168struct pcie_trio_ports_property
169{ 169{
170 struct pcie_port_property ports[TILEGX_TRIO_PCIES]; 170 struct pcie_port_property ports[TILEGX_TRIO_PCIES];
171
172 /** Set if this TRIO belongs to a Gx72 device. */
173 uint8_t is_gx72;
171}; 174};
172 175
173/* Flags indicating traffic class. */ 176/* Flags indicating traffic class. */
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index de5008b72fa3..f2bf200b641b 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -436,9 +436,26 @@ int __init tile_pci_init(void)
436 436
437 /* 437 /*
438 * Now determine which PCIe ports are configured to operate in RC 438 * Now determine which PCIe ports are configured to operate in RC
439 * mode. To use a port, it must be allowed to be in RC mode by the 439 * mode. There is a differece in the port configuration capability
440 * between the Gx36 and Gx72 devices.
441 *
442 * The Gx36 has configuration capability for each of the 3 PCIe
443 * interfaces (disable, auto endpoint, auto RC, etc.).
444 * On the Gx72, you can only select one of the 3 PCIe interfaces per
445 * TRIO to train automatically. Further, the allowable training modes
446 * are reduced to four options (auto endpoint, auto RC, stream x1,
447 * stream x4).
448 *
449 * For Gx36 ports, it must be allowed to be in RC mode by the
440 * Board Information Block, and the hardware strapping pins must be 450 * Board Information Block, and the hardware strapping pins must be
441 * set to RC mode. 451 * set to RC mode.
452 *
453 * For Gx72 ports, the port will operate in RC mode if either of the
454 * following is true:
455 * 1. It is allowed to be in RC mode by the Board Information Block,
456 * and the BIB doesn't allow the EP mode.
457 * 2. It is allowed to be in either the RC or the EP mode by the BIB,
458 * and the hardware strapping pin is set to RC mode.
442 */ 459 */
443 for (i = 0; i < TILEGX_NUM_TRIO; i++) { 460 for (i = 0; i < TILEGX_NUM_TRIO; i++) {
444 gxio_trio_context_t *context = &trio_contexts[i]; 461 gxio_trio_context_t *context = &trio_contexts[i];
@@ -447,8 +464,18 @@ int __init tile_pci_init(void)
447 continue; 464 continue;
448 465
449 for (j = 0; j < TILEGX_TRIO_PCIES; j++) { 466 for (j = 0; j < TILEGX_TRIO_PCIES; j++) {
450 if (pcie_ports[i].ports[j].allow_rc && 467 int is_rc = 0;
451 strapped_for_rc(context, j)) { 468
469 if (pcie_ports[i].is_gx72 &&
470 pcie_ports[i].ports[j].allow_rc) {
471 if (!pcie_ports[i].ports[j].allow_ep ||
472 strapped_for_rc(context, j))
473 is_rc = 1;
474 } else if (pcie_ports[i].ports[j].allow_rc &&
475 strapped_for_rc(context, j)) {
476 is_rc = 1;
477 }
478 if (is_rc) {
452 pcie_rc[i][j] = 1; 479 pcie_rc[i][j] = 1;
453 num_rc_controllers++; 480 num_rc_controllers++;
454 } 481 }