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