kldir.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Derived from IRIX <sys/SN/kldir.h>, revision 1.21.
  7. *
  8. * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc.
  9. * Copyright (C) 1999, 2000 by Ralf Baechle
  10. */
  11. #ifndef _ASM_SN_KLDIR_H
  12. #define _ASM_SN_KLDIR_H
  13. /*
  14. * The kldir memory area resides at a fixed place in each node's memory and
  15. * provides pointers to most other IP27 memory areas. This allows us to
  16. * resize and/or relocate memory areas at a later time without breaking all
  17. * firmware and kernels that use them. Indices in the array are
  18. * permanently dedicated to areas listed below. Some memory areas (marked
  19. * below) reside at a permanently fixed location, but are included in the
  20. * directory for completeness.
  21. */
  22. #define KLDIR_MAGIC 0x434d5f53505f5357
  23. /*
  24. * The upper portion of the memory map applies during boot
  25. * only and is overwritten by IRIX/SYMMON.
  26. *
  27. * MEMORY MAP PER NODE
  28. *
  29. * 0x2000000 (32M) +-----------------------------------------+
  30. * | IO6 BUFFERS FOR FLASH ENET IOC3 |
  31. * 0x1F80000 (31.5M) +-----------------------------------------+
  32. * | IO6 TEXT/DATA/BSS/stack |
  33. * 0x1C00000 (30M) +-----------------------------------------+
  34. * | IO6 PROM DEBUG TEXT/DATA/BSS/stack |
  35. * 0x0800000 (28M) +-----------------------------------------+
  36. * | IP27 PROM TEXT/DATA/BSS/stack |
  37. * 0x1B00000 (27M) +-----------------------------------------+
  38. * | IP27 CFG |
  39. * 0x1A00000 (26M) +-----------------------------------------+
  40. * | Graphics PROM |
  41. * 0x1800000 (24M) +-----------------------------------------+
  42. * | 3rd Party PROM drivers |
  43. * 0x1600000 (22M) +-----------------------------------------+
  44. * | |
  45. * | Free |
  46. * | |
  47. * +-----------------------------------------+
  48. * | UNIX DEBUG Version |
  49. * 0x190000 (2M--) +-----------------------------------------+
  50. * | SYMMON |
  51. * | (For UNIX Debug only) |
  52. * 0x34000 (208K) +-----------------------------------------+
  53. * | SYMMON STACK [NUM_CPU_PER_NODE] |
  54. * | (For UNIX Debug only) |
  55. * 0x25000 (148K) +-----------------------------------------+
  56. * | KLCONFIG - II (temp) |
  57. * | |
  58. * | ---------------------------- |
  59. * | |
  60. * | UNIX NON-DEBUG Version |
  61. * 0x19000 (100K) +-----------------------------------------+
  62. *
  63. *
  64. * The lower portion of the memory map contains information that is
  65. * permanent and is used by the IP27PROM, IO6PROM and IRIX.
  66. *
  67. * 0x19000 (100K) +-----------------------------------------+
  68. * | |
  69. * | PI Error Spools (32K) |
  70. * | |
  71. * 0x12000 (72K) +-----------------------------------------+
  72. * | Unused |
  73. * 0x11c00 (71K) +-----------------------------------------+
  74. * | CPU 1 NMI Eframe area |
  75. * 0x11a00 (70.5K) +-----------------------------------------+
  76. * | CPU 0 NMI Eframe area |
  77. * 0x11800 (70K) +-----------------------------------------+
  78. * | CPU 1 NMI Register save area |
  79. * 0x11600 (69.5K) +-----------------------------------------+
  80. * | CPU 0 NMI Register save area |
  81. * 0x11400 (69K) +-----------------------------------------+
  82. * | GDA (1k) |
  83. * 0x11000 (68K) +-----------------------------------------+
  84. * | Early cache Exception stack |
  85. * | and/or |
  86. * | kernel/io6prom nmi registers |
  87. * 0x10800 (66k) +-----------------------------------------+
  88. * | cache error eframe |
  89. * 0x10400 (65K) +-----------------------------------------+
  90. * | Exception Handlers (UALIAS copy) |
  91. * 0x10000 (64K) +-----------------------------------------+
  92. * | |
  93. * | |
  94. * | KLCONFIG - I (permanent) (48K) |
  95. * | |
  96. * | |
  97. * | |
  98. * 0x4000 (16K) +-----------------------------------------+
  99. * | NMI Handler (Protected Page) |
  100. * 0x3000 (12K) +-----------------------------------------+
  101. * | ARCS PVECTORS (master node only) |
  102. * 0x2c00 (11K) +-----------------------------------------+
  103. * | ARCS TVECTORS (master node only) |
  104. * 0x2800 (10K) +-----------------------------------------+
  105. * | LAUNCH [NUM_CPU] |
  106. * 0x2400 (9K) +-----------------------------------------+
  107. * | Low memory directory (KLDIR) |
  108. * 0x2000 (8K) +-----------------------------------------+
  109. * | ARCS SPB (1K) |
  110. * 0x1000 (4K) +-----------------------------------------+
  111. * | Early cache Exception stack |
  112. * | and/or |
  113. * | kernel/io6prom nmi registers |
  114. * 0x800 (2k) +-----------------------------------------+
  115. * | cache error eframe |
  116. * 0x400 (1K) +-----------------------------------------+
  117. * | Exception Handlers |
  118. * 0x0 (0K) +-----------------------------------------+
  119. */
  120. #ifdef __ASSEMBLY__
  121. #define KLDIR_OFF_MAGIC 0x00
  122. #define KLDIR_OFF_OFFSET 0x08
  123. #define KLDIR_OFF_POINTER 0x10
  124. #define KLDIR_OFF_SIZE 0x18
  125. #define KLDIR_OFF_COUNT 0x20
  126. #define KLDIR_OFF_STRIDE 0x28
  127. #endif /* __ASSEMBLY__ */
  128. /*
  129. * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
  130. * we define here. Since it's set up in the prom. We can't redefine it later
  131. * and expect more space to be allocated. The way to find out the true size
  132. * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE
  133. * for a particular node.
  134. */
  135. #define SYMMON_STACK_SIZE 0x8000
  136. #if defined(PROM)
  137. /*
  138. * These defines are prom version dependent. No code other than the IP27
  139. * prom should attempt to use these values.
  140. */
  141. #define IP27_LAUNCH_OFFSET 0x2400
  142. #define IP27_LAUNCH_SIZE 0x400
  143. #define IP27_LAUNCH_COUNT 2
  144. #define IP27_LAUNCH_STRIDE 0x200
  145. #define IP27_KLCONFIG_OFFSET 0x4000
  146. #define IP27_KLCONFIG_SIZE 0xc000
  147. #define IP27_KLCONFIG_COUNT 1
  148. #define IP27_KLCONFIG_STRIDE 0
  149. #define IP27_NMI_OFFSET 0x3000
  150. #define IP27_NMI_SIZE 0x40
  151. #define IP27_NMI_COUNT 2
  152. #define IP27_NMI_STRIDE 0x40
  153. #define IP27_PI_ERROR_OFFSET 0x12000
  154. #define IP27_PI_ERROR_SIZE 0x4000
  155. #define IP27_PI_ERROR_COUNT 1
  156. #define IP27_PI_ERROR_STRIDE 0
  157. #define IP27_SYMMON_STK_OFFSET 0x25000
  158. #define IP27_SYMMON_STK_SIZE 0xe000
  159. #define IP27_SYMMON_STK_COUNT 2
  160. /* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */
  161. #define IP27_SYMMON_STK_STRIDE 0x7000
  162. #define IP27_FREEMEM_OFFSET 0x19000
  163. #define IP27_FREEMEM_SIZE -1
  164. #define IP27_FREEMEM_COUNT 1
  165. #define IP27_FREEMEM_STRIDE 0
  166. #endif /* PROM */
  167. /*
  168. * There will be only one of these in a partition so the IO6 must set it up.
  169. */
  170. #define IO6_GDA_OFFSET 0x11000
  171. #define IO6_GDA_SIZE 0x400
  172. #define IO6_GDA_COUNT 1
  173. #define IO6_GDA_STRIDE 0
  174. /*
  175. * save area of kernel nmi regs in the prom format
  176. */
  177. #define IP27_NMI_KREGS_OFFSET 0x11400
  178. #define IP27_NMI_KREGS_CPU_SIZE 0x200
  179. /*
  180. * save area of kernel nmi regs in eframe format
  181. */
  182. #define IP27_NMI_EFRAME_OFFSET 0x11800
  183. #define IP27_NMI_EFRAME_SIZE 0x200
  184. #define KLDIR_ENT_SIZE 0x40
  185. #define KLDIR_MAX_ENTRIES (0x400 / 0x40)
  186. #ifndef __ASSEMBLY__
  187. typedef struct kldir_ent_s {
  188. u64 magic; /* Indicates validity of entry */
  189. off_t offset; /* Offset from start of node space */
  190. unsigned long pointer; /* Pointer to area in some cases */
  191. size_t size; /* Size in bytes */
  192. u64 count; /* Repeat count if array, 1 if not */
  193. size_t stride; /* Stride if array, 0 if not */
  194. char rsvd[16]; /* Pad entry to 0x40 bytes */
  195. /* NOTE: These 16 bytes are used in the Partition KLDIR
  196. entry to store partition info. Refer to klpart.h for this. */
  197. } kldir_ent_t;
  198. #endif /* !__ASSEMBLY__ */
  199. #endif /* _ASM_SN_KLDIR_H */