iosapic_private.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. * Private structs/constants for PARISC IOSAPIC support
  3. *
  4. * Copyright (C) 2000 Hewlett Packard (Grant Grundler)
  5. * Copyright (C) 2000,2003 Grant Grundler (grundler at parisc-linux.org)
  6. * Copyright (C) 2002 Matthew Wilcox (willy at parisc-linux.org)
  7. *
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. /*
  24. ** This file is private to iosapic driver.
  25. ** If stuff needs to be used by another driver, move it to a common file.
  26. **
  27. ** WARNING: fields most data structures here are ordered to make sure
  28. ** they pack nicely for 64-bit compilation. (ie sizeof(long) == 8)
  29. */
  30. /*
  31. ** Interrupt Routing Stuff
  32. ** -----------------------
  33. ** The interrupt routing table consists of entries derived from
  34. ** MP Specification Draft 1.5. There is one interrupt routing
  35. ** table per cell. N- and L-class consist of a single cell.
  36. */
  37. struct irt_entry {
  38. /* Entry Type 139 identifies an I/O SAPIC interrupt entry */
  39. u8 entry_type;
  40. /* Entry Length 16 indicates entry is 16 bytes long */
  41. u8 entry_length;
  42. /*
  43. ** Interrupt Type of 0 indicates a vectored interrupt,
  44. ** all other values are reserved
  45. */
  46. u8 interrupt_type;
  47. /*
  48. ** PO and EL
  49. ** Polarity of SAPIC I/O input signals:
  50. ** 00 = Reserved
  51. ** 01 = Active high
  52. ** 10 = Reserved
  53. ** 11 = Active low
  54. ** Trigger mode of SAPIC I/O input signals:
  55. ** 00 = Reserved
  56. ** 01 = Edge-triggered
  57. ** 10 = Reserved
  58. ** 11 = Level-triggered
  59. */
  60. u8 polarity_trigger;
  61. /*
  62. ** IRQ and DEVNO
  63. ** irq identifies PCI interrupt signal where
  64. ** 0x0 corresponds to INT_A#,
  65. ** 0x1 corresponds to INT_B#,
  66. ** 0x2 corresponds to INT_C#
  67. ** 0x3 corresponds to INT_D#
  68. ** PCI device number where interrupt originates
  69. */
  70. u8 src_bus_irq_devno;
  71. /* Source Bus ID identifies the bus where interrupt signal comes from */
  72. u8 src_bus_id;
  73. /*
  74. ** Segment ID is unique across a protection domain and
  75. ** identifies a segment of PCI buses (reserved in
  76. ** MP Specification Draft 1.5)
  77. */
  78. u8 src_seg_id;
  79. /*
  80. ** Destination I/O SAPIC INTIN# identifies the INTIN n pin
  81. ** to which the signal is connected
  82. */
  83. u8 dest_iosapic_intin;
  84. /*
  85. ** Destination I/O SAPIC Address identifies the I/O SAPIC
  86. ** to which the signal is connected
  87. */
  88. u64 dest_iosapic_addr;
  89. };
  90. #define IRT_IOSAPIC_TYPE 139
  91. #define IRT_IOSAPIC_LENGTH 16
  92. #define IRT_VECTORED_INTR 0
  93. #define IRT_PO_MASK 0x3
  94. #define IRT_ACTIVE_HI 1
  95. #define IRT_ACTIVE_LO 3
  96. #define IRT_EL_MASK 0x3
  97. #define IRT_EL_SHIFT 2
  98. #define IRT_EDGE_TRIG 1
  99. #define IRT_LEVEL_TRIG 3
  100. #define IRT_IRQ_MASK 0x3
  101. #define IRT_DEV_MASK 0x1f
  102. #define IRT_DEV_SHIFT 2
  103. #define IRT_IRQ_DEVNO_MASK ((IRT_DEV_MASK << IRT_DEV_SHIFT) | IRT_IRQ_MASK)
  104. #ifdef SUPPORT_MULTI_CELL
  105. struct iosapic_irt {
  106. struct iosapic_irt *irt_next; /* next routing table */
  107. struct irt_entry *irt_base; /* intr routing table address */
  108. size_t irte_count; /* number of entries in the table */
  109. size_t irte_size; /* size (bytes) of each entry */
  110. };
  111. #endif
  112. struct vector_info {
  113. struct iosapic_info *iosapic; /* I/O SAPIC this vector is on */
  114. struct irt_entry *irte; /* IRT entry */
  115. u32 __iomem *eoi_addr; /* precalculate EOI reg address */
  116. u32 eoi_data; /* IA64: ? PA: swapped txn_data */
  117. int txn_irq; /* virtual IRQ number for processor */
  118. ulong txn_addr; /* IA64: id_eid PA: partial HPA */
  119. u32 txn_data; /* CPU interrupt bit */
  120. u8 status; /* status/flags */
  121. u8 irqline; /* INTINn(IRQ) */
  122. };
  123. struct iosapic_info {
  124. struct iosapic_info * isi_next; /* list of I/O SAPIC */
  125. void __iomem * addr; /* remapped address */
  126. unsigned long isi_hpa; /* physical base address */
  127. struct vector_info * isi_vector; /* IRdT (IRQ line) array */
  128. int isi_num_vectors; /* size of IRdT array */
  129. int isi_status; /* status/flags */
  130. unsigned int isi_version; /* DEBUG: data fr version reg */
  131. };
  132. #ifdef __IA64__
  133. /*
  134. ** PA risc does NOT have any local sapics. IA64 does.
  135. ** PIB (Processor Interrupt Block) is handled by Astro or Dew (Stretch CEC).
  136. **
  137. ** PA: Get id_eid from IRT and hardcode PIB to 0xfeeNNNN0
  138. ** Emulate the data on PAT platforms.
  139. */
  140. struct local_sapic_info {
  141. struct local_sapic_info *lsi_next; /* point to next CPU info */
  142. int *lsi_cpu_id; /* point to logical CPU id */
  143. unsigned long *lsi_id_eid; /* point to IA-64 CPU id */
  144. int *lsi_status; /* point to CPU status */
  145. void *lsi_private; /* point to special info */
  146. };
  147. /*
  148. ** "root" data structure which ties everything together.
  149. ** Should always be able to start with sapic_root and locate
  150. ** the desired information.
  151. */
  152. struct sapic_info {
  153. struct sapic_info *si_next; /* info is per cell */
  154. int si_cellid; /* cell id */
  155. unsigned int si_status; /* status */
  156. char *si_pib_base; /* intr blk base address */
  157. local_sapic_info_t *si_local_info;
  158. io_sapic_info_t *si_io_info;
  159. extint_info_t *si_extint_info;/* External Intr info */
  160. };
  161. #endif