msi-pic.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. * Freescale MSI interrupt controller
  2. Required properties:
  3. - compatible : compatible list, may contain one or two entries
  4. The first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572,
  5. etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" or
  6. "fsl,mpic-msi-v4.3" depending on the parent type and version. If mpic
  7. version is 4.3, the number of MSI registers is increased to 16, MSIIR1 is
  8. provided to access these 16 registers, and compatible "fsl,mpic-msi-v4.3"
  9. should be used. The first entry is optional; the second entry is
  10. required.
  11. - reg : It may contain one or two regions. The first region should contain
  12. the address and the length of the shared message interrupt register set.
  13. The second region should contain the address of aliased MSIIR or MSIIR1
  14. register for platforms that have such an alias, if using MSIIR1, the second
  15. region must be added because different MSI group has different MSIIR1 offset.
  16. - interrupts : each one of the interrupts here is one entry per 32 MSIs,
  17. and routed to the host interrupt controller. the interrupts should
  18. be set as edge sensitive. If msi-available-ranges is present, only
  19. the interrupts that correspond to available ranges shall be present.
  20. - interrupt-parent: the phandle for the interrupt controller
  21. that services interrupts for this device. for 83xx cpu, the interrupts
  22. are routed to IPIC, and for 85xx/86xx cpu the interrupts are routed
  23. to MPIC.
  24. Optional properties:
  25. - msi-available-ranges: use <start count> style section to define which
  26. msi interrupt can be used in the 256 msi interrupts. This property is
  27. optional, without this, all the MSI interrupts can be used.
  28. Each available range must begin and end on a multiple of 32 (i.e.
  29. no splitting an individual MSI register or the associated PIC interrupt).
  30. MPIC v4.3 does not support this property because the 32 interrupts of an
  31. individual register are not continuous when using MSIIR1.
  32. - msi-address-64: 64-bit PCI address of the MSIIR register. The MSIIR register
  33. is used for MSI messaging. The address of MSIIR in PCI address space is
  34. the MSI message address.
  35. This property may be used in virtualized environments where the hypervisor
  36. has created an alternate mapping for the MSIR block. See below for an
  37. explanation.
  38. Example:
  39. msi@41600 {
  40. compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
  41. reg = <0x41600 0x80>;
  42. msi-available-ranges = <0 0x100>;
  43. interrupts = <
  44. 0xe0 0
  45. 0xe1 0
  46. 0xe2 0
  47. 0xe3 0
  48. 0xe4 0
  49. 0xe5 0
  50. 0xe6 0
  51. 0xe7 0>;
  52. interrupt-parent = <&mpic>;
  53. };
  54. msi@41600 {
  55. compatible = "fsl,mpic-msi-v4.3";
  56. reg = <0x41600 0x200 0x44148 4>;
  57. interrupts = <
  58. 0xe0 0 0 0
  59. 0xe1 0 0 0
  60. 0xe2 0 0 0
  61. 0xe3 0 0 0
  62. 0xe4 0 0 0
  63. 0xe5 0 0 0
  64. 0xe6 0 0 0
  65. 0xe7 0 0 0
  66. 0x100 0 0 0
  67. 0x101 0 0 0
  68. 0x102 0 0 0
  69. 0x103 0 0 0
  70. 0x104 0 0 0
  71. 0x105 0 0 0
  72. 0x106 0 0 0
  73. 0x107 0 0 0>;
  74. };
  75. The Freescale hypervisor and msi-address-64
  76. -------------------------------------------
  77. Normally, PCI devices have access to all of CCSR via an ATMU mapping. The
  78. Freescale MSI driver calculates the address of MSIIR (in the MSI register
  79. block) and sets that address as the MSI message address.
  80. In a virtualized environment, the hypervisor may need to create an IOMMU
  81. mapping for MSIIR. The Freescale ePAPR hypervisor has this requirement
  82. because of hardware limitations of the Peripheral Access Management Unit
  83. (PAMU), which is currently the only IOMMU that the hypervisor supports.
  84. The ATMU is programmed with the guest physical address, and the PAMU
  85. intercepts transactions and reroutes them to the true physical address.
  86. In the PAMU, each PCI controller is given only one primary window. The
  87. PAMU restricts DMA operations so that they can only occur within a window.
  88. Because PCI devices must be able to DMA to memory, the primary window must
  89. be used to cover all of the guest's memory space.
  90. PAMU primary windows can be divided into 256 subwindows, and each
  91. subwindow can have its own address mapping ("guest physical" to "true
  92. physical"). However, each subwindow has to have the same alignment, which
  93. means they cannot be located at just any address. Because of these
  94. restrictions, it is usually impossible to create a 4KB subwindow that
  95. covers MSIIR where it's normally located.
  96. Therefore, the hypervisor has to create a subwindow inside the same
  97. primary window used for memory, but mapped to the MSIR block (where MSIIR
  98. lives). The first subwindow after the end of guest memory is used for
  99. this. The address specified in the msi-address-64 property is the PCI
  100. address of MSIIR. The hypervisor configures the PAMU to map that address to
  101. the true physical address of MSIIR.