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