aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/npu2.c')
-rw-r--r--hw/npu2.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/hw/npu2.c b/hw/npu2.c
index 806f848..4c1545a 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -1170,6 +1170,25 @@ static int64_t npu2_freset(struct pci_slot *slot __unused)
return OPAL_SUCCESS;
}
+static int64_t npu2_creset(struct pci_slot *slot)
+{
+ struct npu2 *p;
+ int i;
+ struct npu2_dev *ndev;
+
+ p = phb_to_npu2(slot->phb);
+ NPU2INF(p, "Creset PHB state\n");
+
+ for (i = 0; i < p->total_devices; i++) {
+ ndev = &p->devices[i];
+ if (ndev) {
+ NPU2DEVINF(ndev, "Resetting device\n");
+ reset_ntl(ndev);
+ }
+ }
+ return OPAL_SUCCESS;
+}
+
static struct pci_slot *npu2_slot_create(struct phb *phb)
{
struct pci_slot *slot;
@@ -1191,7 +1210,7 @@ static struct pci_slot *npu2_slot_create(struct phb *phb)
slot->ops.poll_link = NULL;
slot->ops.hreset = npu2_hreset;
slot->ops.freset = npu2_freset;
- slot->ops.creset = NULL;
+ slot->ops.creset = npu2_creset;
return slot;
}