cputable.c 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. /*
  2. * arch/ppc64/kernel/cputable.c
  3. *
  4. * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
  5. *
  6. * Modifications for ppc64:
  7. * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. */
  14. #include <linux/config.h>
  15. #include <linux/string.h>
  16. #include <linux/sched.h>
  17. #include <linux/threads.h>
  18. #include <linux/init.h>
  19. #include <linux/module.h>
  20. #include <asm/cputable.h>
  21. struct cpu_spec* cur_cpu_spec = NULL;
  22. EXPORT_SYMBOL(cur_cpu_spec);
  23. /* NOTE:
  24. * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
  25. * the responsibility of the appropriate CPU save/restore functions to
  26. * eventually copy these settings over. Those save/restore aren't yet
  27. * part of the cputable though. That has to be fixed for both ppc32
  28. * and ppc64
  29. */
  30. extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
  31. extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
  32. extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
  33. extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
  34. /* We only set the altivec features if the kernel was compiled with altivec
  35. * support
  36. */
  37. #ifdef CONFIG_ALTIVEC
  38. #define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC
  39. #define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
  40. #else
  41. #define CPU_FTR_ALTIVEC_COMP 0
  42. #define PPC_FEATURE_HAS_ALTIVEC_COMP 0
  43. #endif
  44. struct cpu_spec cpu_specs[] = {
  45. { /* Power3 */
  46. .pvr_mask = 0xffff0000,
  47. .pvr_value = 0x00400000,
  48. .cpu_name = "POWER3 (630)",
  49. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  50. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  51. CPU_FTR_PMC8,
  52. .cpu_user_features = COMMON_USER_PPC64,
  53. .icache_bsize = 128,
  54. .dcache_bsize = 128,
  55. .cpu_setup = __setup_cpu_power3,
  56. .firmware_features = COMMON_PPC64_FW,
  57. },
  58. { /* Power3+ */
  59. .pvr_mask = 0xffff0000,
  60. .pvr_value = 0x00410000,
  61. .cpu_name = "POWER3 (630+)",
  62. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  63. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  64. CPU_FTR_PMC8,
  65. .cpu_user_features = COMMON_USER_PPC64,
  66. .icache_bsize = 128,
  67. .dcache_bsize = 128,
  68. .cpu_setup = __setup_cpu_power3,
  69. .firmware_features = COMMON_PPC64_FW,
  70. },
  71. { /* Northstar */
  72. .pvr_mask = 0xffff0000,
  73. .pvr_value = 0x00330000,
  74. .cpu_name = "RS64-II (northstar)",
  75. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  76. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  77. CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
  78. .cpu_user_features = COMMON_USER_PPC64,
  79. .icache_bsize = 128,
  80. .dcache_bsize = 128,
  81. .cpu_setup = __setup_cpu_power3,
  82. .firmware_features = COMMON_PPC64_FW,
  83. },
  84. { /* Pulsar */
  85. .pvr_mask = 0xffff0000,
  86. .pvr_value = 0x00340000,
  87. .cpu_name = "RS64-III (pulsar)",
  88. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  89. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  90. CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
  91. .cpu_user_features = COMMON_USER_PPC64,
  92. .icache_bsize = 128,
  93. .dcache_bsize = 128,
  94. .cpu_setup = __setup_cpu_power3,
  95. .firmware_features = COMMON_PPC64_FW,
  96. },
  97. { /* I-star */
  98. .pvr_mask = 0xffff0000,
  99. .pvr_value = 0x00360000,
  100. .cpu_name = "RS64-III (icestar)",
  101. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  102. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  103. CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
  104. .cpu_user_features = COMMON_USER_PPC64,
  105. .icache_bsize = 128,
  106. .dcache_bsize = 128,
  107. .cpu_setup = __setup_cpu_power3,
  108. .firmware_features = COMMON_PPC64_FW,
  109. },
  110. { /* S-star */
  111. .pvr_mask = 0xffff0000,
  112. .pvr_value = 0x00370000,
  113. .cpu_name = "RS64-IV (sstar)",
  114. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  115. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  116. CPU_FTR_PMC8 | CPU_FTR_MMCRA | CPU_FTR_CTRL,
  117. .cpu_user_features = COMMON_USER_PPC64,
  118. .icache_bsize = 128,
  119. .dcache_bsize = 128,
  120. .cpu_setup = __setup_cpu_power3,
  121. .firmware_features = COMMON_PPC64_FW,
  122. },
  123. { /* Power4 */
  124. .pvr_mask = 0xffff0000,
  125. .pvr_value = 0x00350000,
  126. .cpu_name = "POWER4 (gp)",
  127. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  128. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  129. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
  130. .cpu_user_features = COMMON_USER_PPC64,
  131. .icache_bsize = 128,
  132. .dcache_bsize = 128,
  133. .cpu_setup = __setup_cpu_power4,
  134. .firmware_features = COMMON_PPC64_FW,
  135. },
  136. { /* Power4+ */
  137. .pvr_mask = 0xffff0000,
  138. .pvr_value = 0x00380000,
  139. .cpu_name = "POWER4+ (gq)",
  140. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  141. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  142. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
  143. .cpu_user_features = COMMON_USER_PPC64,
  144. .icache_bsize = 128,
  145. .dcache_bsize = 128,
  146. .cpu_setup = __setup_cpu_power4,
  147. .firmware_features = COMMON_PPC64_FW,
  148. },
  149. { /* PPC970 */
  150. .pvr_mask = 0xffff0000,
  151. .pvr_value = 0x00390000,
  152. .cpu_name = "PPC970",
  153. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  154. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  155. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  156. CPU_FTR_CAN_NAP | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
  157. .cpu_user_features = COMMON_USER_PPC64 |
  158. PPC_FEATURE_HAS_ALTIVEC_COMP,
  159. .icache_bsize = 128,
  160. .dcache_bsize = 128,
  161. .cpu_setup = __setup_cpu_ppc970,
  162. .firmware_features = COMMON_PPC64_FW,
  163. },
  164. { /* PPC970FX */
  165. .pvr_mask = 0xffff0000,
  166. .pvr_value = 0x003c0000,
  167. .cpu_name = "PPC970FX",
  168. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  169. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  170. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  171. CPU_FTR_CAN_NAP | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
  172. .cpu_user_features = COMMON_USER_PPC64 |
  173. PPC_FEATURE_HAS_ALTIVEC_COMP,
  174. .icache_bsize = 128,
  175. .dcache_bsize = 128,
  176. .cpu_setup = __setup_cpu_ppc970,
  177. .firmware_features = COMMON_PPC64_FW,
  178. },
  179. { /* PPC970MP */
  180. .pvr_mask = 0xffff0000,
  181. .pvr_value = 0x00440000,
  182. .cpu_name = "PPC970MP",
  183. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  184. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  185. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  186. CPU_FTR_CAN_NAP | CPU_FTR_PMC8 | CPU_FTR_MMCRA,
  187. .cpu_user_features = COMMON_USER_PPC64 |
  188. PPC_FEATURE_HAS_ALTIVEC_COMP,
  189. .icache_bsize = 128,
  190. .dcache_bsize = 128,
  191. .cpu_setup = __setup_cpu_ppc970,
  192. .firmware_features = COMMON_PPC64_FW,
  193. },
  194. { /* Power5 */
  195. .pvr_mask = 0xffff0000,
  196. .pvr_value = 0x003a0000,
  197. .cpu_name = "POWER5 (gr)",
  198. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  199. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  200. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
  201. CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
  202. CPU_FTR_MMCRA_SIHV,
  203. .cpu_user_features = COMMON_USER_PPC64,
  204. .icache_bsize = 128,
  205. .dcache_bsize = 128,
  206. .cpu_setup = __setup_cpu_power4,
  207. .firmware_features = COMMON_PPC64_FW,
  208. },
  209. { /* Power5 */
  210. .pvr_mask = 0xffff0000,
  211. .pvr_value = 0x003b0000,
  212. .cpu_name = "POWER5 (gs)",
  213. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  214. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  215. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
  216. CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
  217. CPU_FTR_MMCRA_SIHV,
  218. .cpu_user_features = COMMON_USER_PPC64,
  219. .icache_bsize = 128,
  220. .dcache_bsize = 128,
  221. .cpu_setup = __setup_cpu_power4,
  222. .firmware_features = COMMON_PPC64_FW,
  223. },
  224. { /* BE DD1.x */
  225. .pvr_mask = 0xffff0000,
  226. .pvr_value = 0x00700000,
  227. .cpu_name = "Broadband Engine",
  228. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  229. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  230. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  231. CPU_FTR_SMT,
  232. .cpu_user_features = COMMON_USER_PPC64 |
  233. PPC_FEATURE_HAS_ALTIVEC_COMP,
  234. .icache_bsize = 128,
  235. .dcache_bsize = 128,
  236. .cpu_setup = __setup_cpu_be,
  237. .firmware_features = COMMON_PPC64_FW,
  238. },
  239. { /* default match */
  240. .pvr_mask = 0x00000000,
  241. .pvr_value = 0x00000000,
  242. .cpu_name = "POWER4 (compatible)",
  243. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  244. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  245. CPU_FTR_PPCAS_ARCH_V2,
  246. .cpu_user_features = COMMON_USER_PPC64,
  247. .icache_bsize = 128,
  248. .dcache_bsize = 128,
  249. .cpu_setup = __setup_cpu_power4,
  250. .firmware_features = COMMON_PPC64_FW,
  251. }
  252. };
  253. firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = {
  254. {FW_FEATURE_PFT, "hcall-pft"},
  255. {FW_FEATURE_TCE, "hcall-tce"},
  256. {FW_FEATURE_SPRG0, "hcall-sprg0"},
  257. {FW_FEATURE_DABR, "hcall-dabr"},
  258. {FW_FEATURE_COPY, "hcall-copy"},
  259. {FW_FEATURE_ASR, "hcall-asr"},
  260. {FW_FEATURE_DEBUG, "hcall-debug"},
  261. {FW_FEATURE_PERF, "hcall-perf"},
  262. {FW_FEATURE_DUMP, "hcall-dump"},
  263. {FW_FEATURE_INTERRUPT, "hcall-interrupt"},
  264. {FW_FEATURE_MIGRATE, "hcall-migrate"},
  265. {FW_FEATURE_PERFMON, "hcall-perfmon"},
  266. {FW_FEATURE_CRQ, "hcall-crq"},
  267. {FW_FEATURE_VIO, "hcall-vio"},
  268. {FW_FEATURE_RDMA, "hcall-rdma"},
  269. {FW_FEATURE_LLAN, "hcall-lLAN"},
  270. {FW_FEATURE_BULK, "hcall-bulk"},
  271. {FW_FEATURE_XDABR, "hcall-xdabr"},
  272. {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
  273. {FW_FEATURE_SPLPAR, "hcall-splpar"},
  274. };