msi-pic.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. * Freescale MSI interrupt controller
  2. Required properties:
  3. - compatible : compatible list, contains 2 entries,
  4. 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" depending on
  6. the parent type.
  7. - reg : It may contain one or two regions. The first region should contain
  8. the address and the length of the shared message interrupt register set.
  9. The second region should contain the address of aliased MSIIR register for
  10. platforms that have such an alias.
  11. - msi-available-ranges: use <start count> style section to define which
  12. msi interrupt can be used in the 256 msi interrupts. This property is
  13. optional, without this, all the 256 MSI interrupts can be used.
  14. Each available range must begin and end on a multiple of 32 (i.e.
  15. no splitting an individual MSI register or the associated PIC interrupt).
  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-address-64: 64-bit PCI address of the MSIIR register. The MSIIR register
  26. is used for MSI messaging. The address of MSIIR in PCI address space is
  27. the MSI message address.
  28. This property may be used in virtualized environments where the hypervisor
  29. has created an alternate mapping for the MSIR block. See below for an
  30. explanation.
  31. Example:
  32. msi@41600 {
  33. compatible = "fsl,mpc8610-msi", "fsl,mpic-msi";
  34. reg = <0x41600 0x80>;
  35. msi-available-ranges = <0 0x100>;
  36. interrupts = <
  37. 0xe0 0
  38. 0xe1 0
  39. 0xe2 0
  40. 0xe3 0
  41. 0xe4 0
  42. 0xe5 0
  43. 0xe6 0
  44. 0xe7 0>;
  45. interrupt-parent = <&mpic>;
  46. };
  47. The Freescale hypervisor and msi-address-64
  48. -------------------------------------------
  49. Normally, PCI devices have access to all of CCSR via an ATMU mapping. The
  50. Freescale MSI driver calculates the address of MSIIR (in the MSI register
  51. block) and sets that address as the MSI message address.
  52. In a virtualized environment, the hypervisor may need to create an IOMMU
  53. mapping for MSIIR. The Freescale ePAPR hypervisor has this requirement
  54. because of hardware limitations of the Peripheral Access Management Unit
  55. (PAMU), which is currently the only IOMMU that the hypervisor supports.
  56. The ATMU is programmed with the guest physical address, and the PAMU
  57. intercepts transactions and reroutes them to the true physical address.
  58. In the PAMU, each PCI controller is given only one primary window. The
  59. PAMU restricts DMA operations so that they can only occur within a window.
  60. Because PCI devices must be able to DMA to memory, the primary window must
  61. be used to cover all of the guest's memory space.
  62. PAMU primary windows can be divided into 256 subwindows, and each
  63. subwindow can have its own address mapping ("guest physical" to "true
  64. physical"). However, each subwindow has to have the same alignment, which
  65. means they cannot be located at just any address. Because of these
  66. restrictions, it is usually impossible to create a 4KB subwindow that
  67. covers MSIIR where it's normally located.
  68. Therefore, the hypervisor has to create a subwindow inside the same
  69. primary window used for memory, but mapped to the MSIR block (where MSIIR
  70. lives). The first subwindow after the end of guest memory is used for
  71. this. The address specified in the msi-address-64 property is the PCI
  72. address of MSIIR. The hypervisor configures the PAMU to map that address to
  73. the true physical address of MSIIR.