mpic.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. * OpenPIC and its interrupt numbers on Freescale's e500/e600 cores
  2. The OpenPIC specification does not specify which interrupt source has to
  3. become which interrupt number. This is up to the software implementation
  4. of the interrupt controller. The only requirement is that every
  5. interrupt source has to have an unique interrupt number / vector number.
  6. To accomplish this the current implementation assigns the number zero to
  7. the first source, the number one to the second source and so on until
  8. all interrupt sources have their unique number.
  9. Usually the assigned vector number equals the interrupt number mentioned
  10. in the documentation for a given core / CPU. This is however not true
  11. for the e500 cores (MPC85XX CPUs) where the documentation distinguishes
  12. between internal and external interrupt sources and starts counting at
  13. zero for both of them.
  14. So what to write for external interrupt source X or internal interrupt
  15. source Y into the device tree? Here is an example:
  16. The memory map for the interrupt controller in the MPC8544[0] shows,
  17. that the first interrupt source starts at 0x5_0000 (PIC Register Address
  18. Map-Interrupt Source Configuration Registers). This source becomes the
  19. number zero therefore:
  20. External interrupt 0 = interrupt number 0
  21. External interrupt 1 = interrupt number 1
  22. External interrupt 2 = interrupt number 2
  23. ...
  24. Every interrupt number allocates 0x20 bytes register space. So to get
  25. its number it is sufficient to shift the lower 16bits to right by five.
  26. So for the external interrupt 10 we have:
  27. 0x0140 >> 5 = 10
  28. After the external sources, the internal sources follow. The in core I2C
  29. controller on the MPC8544 for instance has the internal source number
  30. 27. Oo obtain its interrupt number we take the lower 16bits of its memory
  31. address (0x5_0560) and shift it right:
  32. 0x0560 >> 5 = 43
  33. Therefore the I2C device node for the MPC8544 CPU has to have the
  34. interrupt number 43 specified in the device tree.
  35. [0] MPC8544E PowerQUICCTM III, Integrated Host Processor Family Reference Manual
  36. MPC8544ERM Rev. 1 10/2007