msi.txt 3.8 KB

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