···168168struct pcie_trio_ports_property169169{170170 struct pcie_port_property ports[TILEGX_TRIO_PCIES];171171+172172+ /** Set if this TRIO belongs to a Gx72 device. */173173+ uint8_t is_gx72;171174};172175173176/* Flags indicating traffic class. */
+30-3
arch/tile/kernel/pci_gx.c
···436436437437 /*438438 * Now determine which PCIe ports are configured to operate in RC439439- * mode. To use a port, it must be allowed to be in RC mode by the439439+ * mode. There is a differece in the port configuration capability440440+ * between the Gx36 and Gx72 devices.441441+ *442442+ * The Gx36 has configuration capability for each of the 3 PCIe443443+ * interfaces (disable, auto endpoint, auto RC, etc.).444444+ * On the Gx72, you can only select one of the 3 PCIe interfaces per445445+ * TRIO to train automatically. Further, the allowable training modes446446+ * are reduced to four options (auto endpoint, auto RC, stream x1,447447+ * stream x4).448448+ *449449+ * For Gx36 ports, it must be allowed to be in RC mode by the440450 * Board Information Block, and the hardware strapping pins must be441451 * set to RC mode.452452+ *453453+ * For Gx72 ports, the port will operate in RC mode if either of the454454+ * following is true:455455+ * 1. It is allowed to be in RC mode by the Board Information Block,456456+ * and the BIB doesn't allow the EP mode.457457+ * 2. It is allowed to be in either the RC or the EP mode by the BIB,458458+ * and the hardware strapping pin is set to RC mode.442459 */443460 for (i = 0; i < TILEGX_NUM_TRIO; i++) {444461 gxio_trio_context_t *context = &trio_contexts[i];···464447 continue;465448466449 for (j = 0; j < TILEGX_TRIO_PCIES; j++) {467467- if (pcie_ports[i].ports[j].allow_rc &&468468- strapped_for_rc(context, j)) {450450+ int is_rc = 0;451451+452452+ if (pcie_ports[i].is_gx72 &&453453+ pcie_ports[i].ports[j].allow_rc) {454454+ if (!pcie_ports[i].ports[j].allow_ep ||455455+ strapped_for_rc(context, j))456456+ is_rc = 1;457457+ } else if (pcie_ports[i].ports[j].allow_rc &&458458+ strapped_for_rc(context, j)) {459459+ is_rc = 1;460460+ }461461+ if (is_rc) {469462 pcie_rc[i][j] = 1;470463 num_rc_controllers++;471464 }