1*c66ec88fSEmmanuel VadotThis document describes the generic device tree binding for MSI controllers and 2*c66ec88fSEmmanuel Vadottheir master(s). 3*c66ec88fSEmmanuel Vadot 4*c66ec88fSEmmanuel VadotMessage Signaled Interrupts (MSIs) are a class of interrupts generated by a 5*c66ec88fSEmmanuel Vadotwrite to an MMIO address. 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel VadotMSIs were originally specified by PCI (and are used with PCIe), but may also be 8*c66ec88fSEmmanuel Vadotused with other busses, and hence a mechanism is required to relate devices on 9*c66ec88fSEmmanuel Vadotthose busses to the MSI controllers which they are capable of using, 10*c66ec88fSEmmanuel Vadotpotentially including additional information. 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel VadotMSIs are distinguished by some combination of: 13*c66ec88fSEmmanuel Vadot 14*c66ec88fSEmmanuel Vadot- The doorbell (the MMIO address written to). 15*c66ec88fSEmmanuel Vadot 16*c66ec88fSEmmanuel Vadot Devices may be configured by software to write to arbitrary doorbells which 17*c66ec88fSEmmanuel Vadot they can address. An MSI controller may feature a number of doorbells. 18*c66ec88fSEmmanuel Vadot 19*c66ec88fSEmmanuel Vadot- The payload (the value written to the doorbell). 20*c66ec88fSEmmanuel Vadot 21*c66ec88fSEmmanuel Vadot Devices may be configured to write an arbitrary payload chosen by software. 22*c66ec88fSEmmanuel Vadot MSI controllers may have restrictions on permitted payloads. 23*c66ec88fSEmmanuel Vadot 24*c66ec88fSEmmanuel Vadot- Sideband information accompanying the write. 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel Vadot Typically this is neither configurable nor probeable, and depends on the path 27*c66ec88fSEmmanuel Vadot taken through the memory system (i.e. it is a property of the combination of 28*c66ec88fSEmmanuel Vadot MSI controller and device rather than a property of either in isolation). 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel Vadot 31*c66ec88fSEmmanuel VadotMSI controllers: 32*c66ec88fSEmmanuel Vadot================ 33*c66ec88fSEmmanuel Vadot 34*c66ec88fSEmmanuel VadotAn MSI controller signals interrupts to a CPU when a write is made to an MMIO 35*c66ec88fSEmmanuel Vadotaddress by some master. An MSI controller may feature a number of doorbells. 36*c66ec88fSEmmanuel Vadot 37*c66ec88fSEmmanuel VadotRequired properties: 38*c66ec88fSEmmanuel Vadot-------------------- 39*c66ec88fSEmmanuel Vadot 40*c66ec88fSEmmanuel Vadot- msi-controller: Identifies the node as an MSI controller. 41*c66ec88fSEmmanuel Vadot 42*c66ec88fSEmmanuel VadotOptional properties: 43*c66ec88fSEmmanuel Vadot-------------------- 44*c66ec88fSEmmanuel Vadot 45*c66ec88fSEmmanuel Vadot- #msi-cells: The number of cells in an msi-specifier, required if not zero. 46*c66ec88fSEmmanuel Vadot 47*c66ec88fSEmmanuel Vadot Typically this will encode information related to sideband data, and will 48*c66ec88fSEmmanuel Vadot not encode doorbells or payloads as these can be configured dynamically. 49*c66ec88fSEmmanuel Vadot 50*c66ec88fSEmmanuel Vadot The meaning of the msi-specifier is defined by the device tree binding of 51*c66ec88fSEmmanuel Vadot the specific MSI controller. 52*c66ec88fSEmmanuel Vadot 53*c66ec88fSEmmanuel Vadot 54*c66ec88fSEmmanuel VadotMSI clients 55*c66ec88fSEmmanuel Vadot=========== 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel VadotMSI clients are devices which generate MSIs. For each MSI they wish to 58*c66ec88fSEmmanuel Vadotgenerate, the doorbell and payload may be configured, though sideband 59*c66ec88fSEmmanuel Vadotinformation may not be configurable. 60*c66ec88fSEmmanuel Vadot 61*c66ec88fSEmmanuel VadotRequired properties: 62*c66ec88fSEmmanuel Vadot-------------------- 63*c66ec88fSEmmanuel Vadot 64*c66ec88fSEmmanuel Vadot- msi-parent: A list of phandle + msi-specifier pairs, one for each MSI 65*c66ec88fSEmmanuel Vadot controller which the device is capable of using. 66*c66ec88fSEmmanuel Vadot 67*c66ec88fSEmmanuel Vadot This property is unordered, and MSIs may be allocated from any combination of 68*c66ec88fSEmmanuel Vadot MSI controllers listed in the msi-parent property. 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel Vadot If a device has restrictions on the allocation of MSIs, these restrictions 71*c66ec88fSEmmanuel Vadot must be described with additional properties. 72*c66ec88fSEmmanuel Vadot 73*c66ec88fSEmmanuel Vadot When #msi-cells is non-zero, busses with an msi-parent will require 74*c66ec88fSEmmanuel Vadot additional properties to describe the relationship between devices on the bus 75*c66ec88fSEmmanuel Vadot and the set of MSIs they can potentially generate. 76*c66ec88fSEmmanuel Vadot 77*c66ec88fSEmmanuel Vadot 78*c66ec88fSEmmanuel VadotExample 79*c66ec88fSEmmanuel Vadot======= 80*c66ec88fSEmmanuel Vadot 81*c66ec88fSEmmanuel Vadot/ { 82*c66ec88fSEmmanuel Vadot #address-cells = <1>; 83*c66ec88fSEmmanuel Vadot #size-cells = <1>; 84*c66ec88fSEmmanuel Vadot 85*c66ec88fSEmmanuel Vadot msi_a: msi-controller@a { 86*c66ec88fSEmmanuel Vadot reg = <0xa 0xf00>; 87*c66ec88fSEmmanuel Vadot compatible = "vendor-a,some-controller"; 88*c66ec88fSEmmanuel Vadot msi-controller; 89*c66ec88fSEmmanuel Vadot /* No sideband data, so #msi-cells omitted */ 90*c66ec88fSEmmanuel Vadot }; 91*c66ec88fSEmmanuel Vadot 92*c66ec88fSEmmanuel Vadot msi_b: msi-controller@b { 93*c66ec88fSEmmanuel Vadot reg = <0xb 0xf00>; 94*c66ec88fSEmmanuel Vadot compatible = "vendor-b,another-controller"; 95*c66ec88fSEmmanuel Vadot msi-controller; 96*c66ec88fSEmmanuel Vadot /* Each device has some unique ID */ 97*c66ec88fSEmmanuel Vadot #msi-cells = <1>; 98*c66ec88fSEmmanuel Vadot }; 99*c66ec88fSEmmanuel Vadot 100*c66ec88fSEmmanuel Vadot msi_c: msi-controller@c { 101*c66ec88fSEmmanuel Vadot reg = <0xc 0xf00>; 102*c66ec88fSEmmanuel Vadot compatible = "vendor-b,another-controller"; 103*c66ec88fSEmmanuel Vadot msi-controller; 104*c66ec88fSEmmanuel Vadot /* Each device has some unique ID */ 105*c66ec88fSEmmanuel Vadot #msi-cells = <1>; 106*c66ec88fSEmmanuel Vadot }; 107*c66ec88fSEmmanuel Vadot 108*c66ec88fSEmmanuel Vadot dev@0 { 109*c66ec88fSEmmanuel Vadot reg = <0x0 0xf00>; 110*c66ec88fSEmmanuel Vadot compatible = "vendor-c,some-device"; 111*c66ec88fSEmmanuel Vadot 112*c66ec88fSEmmanuel Vadot /* Can only generate MSIs to msi_a */ 113*c66ec88fSEmmanuel Vadot msi-parent = <&msi_a>; 114*c66ec88fSEmmanuel Vadot }; 115*c66ec88fSEmmanuel Vadot 116*c66ec88fSEmmanuel Vadot dev@1 { 117*c66ec88fSEmmanuel Vadot reg = <0x1 0xf00>; 118*c66ec88fSEmmanuel Vadot compatible = "vendor-c,some-device"; 119*c66ec88fSEmmanuel Vadot 120*c66ec88fSEmmanuel Vadot /* 121*c66ec88fSEmmanuel Vadot * Can generate MSIs to either A or B. 122*c66ec88fSEmmanuel Vadot */ 123*c66ec88fSEmmanuel Vadot msi-parent = <&msi_a>, <&msi_b 0x17>; 124*c66ec88fSEmmanuel Vadot }; 125*c66ec88fSEmmanuel Vadot 126*c66ec88fSEmmanuel Vadot dev@2 { 127*c66ec88fSEmmanuel Vadot reg = <0x2 0xf00>; 128*c66ec88fSEmmanuel Vadot compatible = "vendor-c,some-device"; 129*c66ec88fSEmmanuel Vadot /* 130*c66ec88fSEmmanuel Vadot * Has different IDs at each MSI controller. 131*c66ec88fSEmmanuel Vadot * Can generate MSIs to all of the MSI controllers. 132*c66ec88fSEmmanuel Vadot */ 133*c66ec88fSEmmanuel Vadot msi-parent = <&msi_a>, <&msi_b 0x17>, <&msi_c 0x53>; 134*c66ec88fSEmmanuel Vadot }; 135*c66ec88fSEmmanuel Vadot}; 136