msi-pic.txt 3.6 KB

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