1.. _device-tree/opencapi:
2
3=============================
4OpenCAPI Device Tree Bindings
5=============================
6
7NPU bindings
8------------
9
10The NPU nodes are similar to those in :doc:`nvlink`.
11
12We distinguish between OpenCAPI and NVLink links using the
13`ibm.npu-link-type` property. NPUs with a mixture of OpenCAPI and
14NVLink links are currently unsupported.
15
16.. code-block:: dts
17
18  xscom@603fc00000000 {
19    npu@5011000 {
20      compatible = "ibm,power9-npu";
21      phandle = <0xe6>;
22      ibm,phb-index = <0x7>;
23      reg = <0x5011000 0x2c>;
24      ibm,npu-index = <0x0>;
25      ibm,npu-links = <0x2>; /* Number of links wired up to this npu. */
26
27      link@2 {
28	compatible = "ibm,npu-link";
29	ibm,npu-link-type = "opencapi";
30        ibm,npu-group-id = <0x1>;
31	ibm,npu-lane-mask = <0xf1e000>; /* Mask specifying which IBM PHY lanes
32	                                 * are used for this link. 24-bit,
33	                                 * lane 0 is most significant bit */
34        ibm,npu-phy = <0x80000000 0x9010c3f>; /* SCOM address of the IBM PHY
35	                                       * controlling this link. */
36	ibm,npu-link-index = <0x2>; /* Hardware link index.
37                                     * Used to calculate various address offsets. */
38	phandle = <0xe7>;
39      };
40
41      link@3 {
42	compatible = "ibm,npu-link";
43	ibm,npu-link-type = "opencapi";
44	ibm,npu-group-id = <0x2>;
45	ibm,npu-lane-mask = <0x78f>;
46	ibm,npu-phy = <0x80000000 0x9010c3f>;
47	ibm,npu-link-index = <0x3>;
48	phandle = <0xe8>;
49      };
50    };
51  };
52
53PCI device bindings
54-------------------
55
56The PCI devices mostly look like regular PCI devices (see :doc:`pci`),
57but have a few additional fields to allow the devices to be associated
58with the relevant NPU. These fields are presently not consumed by
59anything but may be used in future.
60
61.. code-block:: dts
62
63  pciex@600e800000000 {
64    /* OpenCAPI specific properties */
65    compatible = "ibm,power9-npu-opencapi-pciex", "ibm,ioda2-npu2-opencapi-phb";
66    ibm,npcq = <0xe6>; /* phandle to the NPU node */
67    ibm,npu-index = <0x0>;
68    ibm,links = <0x1>;
69    /* Generic PCI fields here */
70  }
71
72