Skip to content

Commit

Permalink
npu2-opencapi: Train OpenCAPI links and setup devices
Browse files Browse the repository at this point in the history
Scan the OpenCAPI links under the NPU, and for each link, reset the card,
set up a device, train the link and register a PHB.

Implement the necessary operations for the OpenCAPI PHB type.

For bringup, test and debug purposes, we allow an NVRAM setting,
"opencapi-link-training" that can be set to either disable link training
completely or to use the prbs31 test pattern.

To disable link training:

    nvram -p ibm,skiboot --update-config opencapi-link-training=none

To use prbs31:

    nvram -p ibm,skiboot --update-config opencapi-link-training=prbs31

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ajdlinux authored and stewartsmith committed Mar 2, 2018
1 parent 9db58b1 commit 6b1cded
Show file tree
Hide file tree
Showing 5 changed files with 746 additions and 10 deletions.
3 changes: 2 additions & 1 deletion core/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,8 @@ static void pci_add_one_device_node(struct phb *phb,
pd->dn = np = dt_new(parent_node, name);

/* XXX FIXME: make proper "compatible" properties */
if (pci_has_cap(pd, PCI_CFG_CAP_ID_EXP, false)) {
if (pci_has_cap(pd, PCI_CFG_CAP_ID_EXP, false) ||
phb->phb_type == phb_type_npu_v2_opencapi) {
snprintf(compat, MAX_NAME, "pciex%x,%x",
vdid & 0xffff, vdid >> 16);
dt_add_property_cells(np, "ibm,pci-config-space-type", 1);
Expand Down

0 comments on commit 6b1cded

Please sign in to comment.