cputable.c 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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/oprofile_impl.h>
  21. #include <asm/cputable.h>
  22. struct cpu_spec* cur_cpu_spec = NULL;
  23. EXPORT_SYMBOL(cur_cpu_spec);
  24. /* NOTE:
  25. * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
  26. * the responsibility of the appropriate CPU save/restore functions to
  27. * eventually copy these settings over. Those save/restore aren't yet
  28. * part of the cputable though. That has to be fixed for both ppc32
  29. * and ppc64
  30. */
  31. extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
  32. extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
  33. extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
  34. extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
  35. /* We only set the altivec features if the kernel was compiled with altivec
  36. * support
  37. */
  38. #ifdef CONFIG_ALTIVEC
  39. #define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC
  40. #define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
  41. #else
  42. #define CPU_FTR_ALTIVEC_COMP 0
  43. #define PPC_FEATURE_HAS_ALTIVEC_COMP 0
  44. #endif
  45. struct cpu_spec cpu_specs[] = {
  46. { /* Power3 */
  47. .pvr_mask = 0xffff0000,
  48. .pvr_value = 0x00400000,
  49. .cpu_name = "POWER3 (630)",
  50. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  51. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR,
  52. .cpu_user_features = COMMON_USER_PPC64,
  53. .icache_bsize = 128,
  54. .dcache_bsize = 128,
  55. .num_pmcs = 8,
  56. .cpu_setup = __setup_cpu_power3,
  57. #ifdef CONFIG_OPROFILE
  58. .oprofile_cpu_type = "ppc64/power3",
  59. .oprofile_model = &op_model_rs64,
  60. #endif
  61. },
  62. { /* Power3+ */
  63. .pvr_mask = 0xffff0000,
  64. .pvr_value = 0x00410000,
  65. .cpu_name = "POWER3 (630+)",
  66. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  67. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR,
  68. .cpu_user_features = COMMON_USER_PPC64,
  69. .icache_bsize = 128,
  70. .dcache_bsize = 128,
  71. .num_pmcs = 8,
  72. .cpu_setup = __setup_cpu_power3,
  73. #ifdef CONFIG_OPROFILE
  74. .oprofile_cpu_type = "ppc64/power3",
  75. .oprofile_model = &op_model_rs64,
  76. #endif
  77. },
  78. { /* Northstar */
  79. .pvr_mask = 0xffff0000,
  80. .pvr_value = 0x00330000,
  81. .cpu_name = "RS64-II (northstar)",
  82. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  83. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  84. CPU_FTR_MMCRA | CPU_FTR_CTRL,
  85. .cpu_user_features = COMMON_USER_PPC64,
  86. .icache_bsize = 128,
  87. .dcache_bsize = 128,
  88. .num_pmcs = 8,
  89. .cpu_setup = __setup_cpu_power3,
  90. #ifdef CONFIG_OPROFILE
  91. .oprofile_cpu_type = "ppc64/rs64",
  92. .oprofile_model = &op_model_rs64,
  93. #endif
  94. },
  95. { /* Pulsar */
  96. .pvr_mask = 0xffff0000,
  97. .pvr_value = 0x00340000,
  98. .cpu_name = "RS64-III (pulsar)",
  99. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  100. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  101. CPU_FTR_MMCRA | CPU_FTR_CTRL,
  102. .cpu_user_features = COMMON_USER_PPC64,
  103. .icache_bsize = 128,
  104. .dcache_bsize = 128,
  105. .num_pmcs = 8,
  106. .cpu_setup = __setup_cpu_power3,
  107. #ifdef CONFIG_OPROFILE
  108. .oprofile_cpu_type = "ppc64/rs64",
  109. .oprofile_model = &op_model_rs64,
  110. #endif
  111. },
  112. { /* I-star */
  113. .pvr_mask = 0xffff0000,
  114. .pvr_value = 0x00360000,
  115. .cpu_name = "RS64-III (icestar)",
  116. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  117. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  118. CPU_FTR_MMCRA | CPU_FTR_CTRL,
  119. .cpu_user_features = COMMON_USER_PPC64,
  120. .icache_bsize = 128,
  121. .dcache_bsize = 128,
  122. .num_pmcs = 8,
  123. .cpu_setup = __setup_cpu_power3,
  124. #ifdef CONFIG_OPROFILE
  125. .oprofile_cpu_type = "ppc64/rs64",
  126. .oprofile_model = &op_model_rs64,
  127. #endif
  128. },
  129. { /* S-star */
  130. .pvr_mask = 0xffff0000,
  131. .pvr_value = 0x00370000,
  132. .cpu_name = "RS64-IV (sstar)",
  133. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  134. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
  135. CPU_FTR_MMCRA | CPU_FTR_CTRL,
  136. .cpu_user_features = COMMON_USER_PPC64,
  137. .icache_bsize = 128,
  138. .dcache_bsize = 128,
  139. .num_pmcs = 8,
  140. .cpu_setup = __setup_cpu_power3,
  141. #ifdef CONFIG_OPROFILE
  142. .oprofile_cpu_type = "ppc64/rs64",
  143. .oprofile_model = &op_model_rs64,
  144. #endif
  145. },
  146. { /* Power4 */
  147. .pvr_mask = 0xffff0000,
  148. .pvr_value = 0x00350000,
  149. .cpu_name = "POWER4 (gp)",
  150. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  151. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  152. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA,
  153. .cpu_user_features = COMMON_USER_PPC64,
  154. .icache_bsize = 128,
  155. .dcache_bsize = 128,
  156. .num_pmcs = 8,
  157. .cpu_setup = __setup_cpu_power4,
  158. #ifdef CONFIG_OPROFILE
  159. .oprofile_cpu_type = "ppc64/power4",
  160. .oprofile_model = &op_model_rs64,
  161. #endif
  162. },
  163. { /* Power4+ */
  164. .pvr_mask = 0xffff0000,
  165. .pvr_value = 0x00380000,
  166. .cpu_name = "POWER4+ (gq)",
  167. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  168. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  169. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA,
  170. .cpu_user_features = COMMON_USER_PPC64,
  171. .icache_bsize = 128,
  172. .dcache_bsize = 128,
  173. .num_pmcs = 8,
  174. .cpu_setup = __setup_cpu_power4,
  175. #ifdef CONFIG_OPROFILE
  176. .oprofile_cpu_type = "ppc64/power4",
  177. .oprofile_model = &op_model_power4,
  178. #endif
  179. },
  180. { /* PPC970 */
  181. .pvr_mask = 0xffff0000,
  182. .pvr_value = 0x00390000,
  183. .cpu_name = "PPC970",
  184. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  185. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  186. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  187. CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
  188. .cpu_user_features = COMMON_USER_PPC64 |
  189. PPC_FEATURE_HAS_ALTIVEC_COMP,
  190. .icache_bsize = 128,
  191. .dcache_bsize = 128,
  192. .num_pmcs = 8,
  193. .cpu_setup = __setup_cpu_ppc970,
  194. #ifdef CONFIG_OPROFILE
  195. .oprofile_cpu_type = "ppc64/970",
  196. .oprofile_model = &op_model_power4,
  197. #endif
  198. },
  199. { /* PPC970FX */
  200. .pvr_mask = 0xffff0000,
  201. .pvr_value = 0x003c0000,
  202. .cpu_name = "PPC970FX",
  203. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  204. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  205. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  206. CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
  207. .cpu_user_features = COMMON_USER_PPC64 |
  208. PPC_FEATURE_HAS_ALTIVEC_COMP,
  209. .icache_bsize = 128,
  210. .dcache_bsize = 128,
  211. .num_pmcs = 8,
  212. .cpu_setup = __setup_cpu_ppc970,
  213. #ifdef CONFIG_OPROFILE
  214. .oprofile_cpu_type = "ppc64/970",
  215. .oprofile_model = &op_model_power4,
  216. #endif
  217. },
  218. { /* PPC970MP */
  219. .pvr_mask = 0xffff0000,
  220. .pvr_value = 0x00440000,
  221. .cpu_name = "PPC970MP",
  222. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  223. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  224. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  225. CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
  226. .cpu_user_features = COMMON_USER_PPC64 |
  227. PPC_FEATURE_HAS_ALTIVEC_COMP,
  228. .icache_bsize = 128,
  229. .dcache_bsize = 128,
  230. .cpu_setup = __setup_cpu_ppc970,
  231. #ifdef CONFIG_OPROFILE
  232. .oprofile_cpu_type = "ppc64/970",
  233. .oprofile_model = &op_model_power4,
  234. #endif
  235. },
  236. { /* Power5 */
  237. .pvr_mask = 0xffff0000,
  238. .pvr_value = 0x003a0000,
  239. .cpu_name = "POWER5 (gr)",
  240. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  241. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  242. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
  243. CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
  244. CPU_FTR_MMCRA_SIHV,
  245. .cpu_user_features = COMMON_USER_PPC64,
  246. .icache_bsize = 128,
  247. .dcache_bsize = 128,
  248. .num_pmcs = 6,
  249. .cpu_setup = __setup_cpu_power4,
  250. #ifdef CONFIG_OPROFILE
  251. .oprofile_cpu_type = "ppc64/power5",
  252. .oprofile_model = &op_model_power4,
  253. #endif
  254. },
  255. { /* Power5 */
  256. .pvr_mask = 0xffff0000,
  257. .pvr_value = 0x003b0000,
  258. .cpu_name = "POWER5 (gs)",
  259. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  260. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  261. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
  262. CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
  263. CPU_FTR_MMCRA_SIHV,
  264. .cpu_user_features = COMMON_USER_PPC64,
  265. .icache_bsize = 128,
  266. .dcache_bsize = 128,
  267. .num_pmcs = 6,
  268. .cpu_setup = __setup_cpu_power4,
  269. #ifdef CONFIG_OPROFILE
  270. .oprofile_cpu_type = "ppc64/power5",
  271. .oprofile_model = &op_model_power4,
  272. #endif
  273. },
  274. { /* BE DD1.x */
  275. .pvr_mask = 0xffff0000,
  276. .pvr_value = 0x00700000,
  277. .cpu_name = "Broadband Engine",
  278. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  279. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  280. CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
  281. CPU_FTR_SMT,
  282. .cpu_user_features = COMMON_USER_PPC64 |
  283. PPC_FEATURE_HAS_ALTIVEC_COMP,
  284. .icache_bsize = 128,
  285. .dcache_bsize = 128,
  286. .cpu_setup = __setup_cpu_be,
  287. },
  288. { /* default match */
  289. .pvr_mask = 0x00000000,
  290. .pvr_value = 0x00000000,
  291. .cpu_name = "POWER4 (compatible)",
  292. .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
  293. CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
  294. CPU_FTR_PPCAS_ARCH_V2,
  295. .cpu_user_features = COMMON_USER_PPC64,
  296. .icache_bsize = 128,
  297. .dcache_bsize = 128,
  298. .num_pmcs = 6,
  299. .cpu_setup = __setup_cpu_power4,
  300. }
  301. };