@@ -105,7 +105,12 @@ Emulated PCI device bindings
vendor-id = <0x1014>;
ibm,gpu = <0x100002f7>; /* phandle pointing the associated GPU PCI device node */
memory-region = <0x10000abc>; /* phandle pointing to the GPU memory */
- phandle = <0x100002fc>;
+ ibm,nvlink-speed = <0x1>;
+
+ ; Denotes the speed the link is running at:
+ ; 0x3 == 20 Gbps, 0x8 = 25.78125 Gbps, 0x9 == 25.00000 Gbps
+
+ phandle = <0x100002fc>;
};
pci@1 {
@@ -683,6 +683,14 @@ static int npu2_dn_fixup(struct phb *phb,
npu2_dn_fixup_gmb(pd->dn, dev);
dt_add_property_cells(pd->dn, "ibm,nvlink", dev->dt_node->phandle);
+ /* NVLink supports multiple speeds and device drivers need to know what
+ * speed has been set by firmware. The speed is actually controlled by
+ * Hostboot, so until we get a HDAT entry telling us what speed they
+ * programmed we will just hard code it here and hope it matches. If it
+ * doesn't it is always possible to manually override it when installing
+ * the device driver. */
+ dt_add_property_cells(pd->dn, "ibm,nvlink-speed", 0x9);
+
/* NPU devices require a slot location to associate with GPUs */
dev->slot_label = dt_prop_get_def(pd->dn, "ibm,slot-label", NULL);
if (!dev->slot_label) {
NVLink2 links can support multiple different speeds. However the device driver has no way of determining which speed was programmed so pass it down as a device tree property. Signed-off-by: Alistair Popple <alistair@popple.id.au> --- doc/device-tree/nvlink.rst | 7 ++++++- hw/npu2.c | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)