cputable.c 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. struct cpu_spec cpu_specs[] = {
  36. { /* Power3 */
  37. .pvr_mask = 0xffff0000,
  38. .pvr_value = 0x00400000,
  39. .cpu_name = "POWER3 (630)",
  40. .cpu_features = CPU_FTRS_POWER3,
  41. .cpu_user_features = COMMON_USER_PPC64,
  42. .icache_bsize = 128,
  43. .dcache_bsize = 128,
  44. .num_pmcs = 8,
  45. .cpu_setup = __setup_cpu_power3,
  46. #ifdef CONFIG_OPROFILE
  47. .oprofile_cpu_type = "ppc64/power3",
  48. .oprofile_model = &op_model_rs64,
  49. #endif
  50. },
  51. { /* Power3+ */
  52. .pvr_mask = 0xffff0000,
  53. .pvr_value = 0x00410000,
  54. .cpu_name = "POWER3 (630+)",
  55. .cpu_features = CPU_FTRS_POWER3,
  56. .cpu_user_features = COMMON_USER_PPC64,
  57. .icache_bsize = 128,
  58. .dcache_bsize = 128,
  59. .num_pmcs = 8,
  60. .cpu_setup = __setup_cpu_power3,
  61. #ifdef CONFIG_OPROFILE
  62. .oprofile_cpu_type = "ppc64/power3",
  63. .oprofile_model = &op_model_rs64,
  64. #endif
  65. },
  66. { /* Northstar */
  67. .pvr_mask = 0xffff0000,
  68. .pvr_value = 0x00330000,
  69. .cpu_name = "RS64-II (northstar)",
  70. .cpu_features = CPU_FTRS_RS64,
  71. .cpu_user_features = COMMON_USER_PPC64,
  72. .icache_bsize = 128,
  73. .dcache_bsize = 128,
  74. .num_pmcs = 8,
  75. .cpu_setup = __setup_cpu_power3,
  76. #ifdef CONFIG_OPROFILE
  77. .oprofile_cpu_type = "ppc64/rs64",
  78. .oprofile_model = &op_model_rs64,
  79. #endif
  80. },
  81. { /* Pulsar */
  82. .pvr_mask = 0xffff0000,
  83. .pvr_value = 0x00340000,
  84. .cpu_name = "RS64-III (pulsar)",
  85. .cpu_features = CPU_FTRS_RS64,
  86. .cpu_user_features = COMMON_USER_PPC64,
  87. .icache_bsize = 128,
  88. .dcache_bsize = 128,
  89. .num_pmcs = 8,
  90. .cpu_setup = __setup_cpu_power3,
  91. #ifdef CONFIG_OPROFILE
  92. .oprofile_cpu_type = "ppc64/rs64",
  93. .oprofile_model = &op_model_rs64,
  94. #endif
  95. },
  96. { /* I-star */
  97. .pvr_mask = 0xffff0000,
  98. .pvr_value = 0x00360000,
  99. .cpu_name = "RS64-III (icestar)",
  100. .cpu_features = CPU_FTRS_RS64,
  101. .cpu_user_features = COMMON_USER_PPC64,
  102. .icache_bsize = 128,
  103. .dcache_bsize = 128,
  104. .num_pmcs = 8,
  105. .cpu_setup = __setup_cpu_power3,
  106. #ifdef CONFIG_OPROFILE
  107. .oprofile_cpu_type = "ppc64/rs64",
  108. .oprofile_model = &op_model_rs64,
  109. #endif
  110. },
  111. { /* S-star */
  112. .pvr_mask = 0xffff0000,
  113. .pvr_value = 0x00370000,
  114. .cpu_name = "RS64-IV (sstar)",
  115. .cpu_features = CPU_FTRS_RS64,
  116. .cpu_user_features = COMMON_USER_PPC64,
  117. .icache_bsize = 128,
  118. .dcache_bsize = 128,
  119. .num_pmcs = 8,
  120. .cpu_setup = __setup_cpu_power3,
  121. #ifdef CONFIG_OPROFILE
  122. .oprofile_cpu_type = "ppc64/rs64",
  123. .oprofile_model = &op_model_rs64,
  124. #endif
  125. },
  126. { /* Power4 */
  127. .pvr_mask = 0xffff0000,
  128. .pvr_value = 0x00350000,
  129. .cpu_name = "POWER4 (gp)",
  130. .cpu_features = CPU_FTRS_POWER4,
  131. .cpu_user_features = COMMON_USER_PPC64,
  132. .icache_bsize = 128,
  133. .dcache_bsize = 128,
  134. .num_pmcs = 8,
  135. .cpu_setup = __setup_cpu_power4,
  136. #ifdef CONFIG_OPROFILE
  137. .oprofile_cpu_type = "ppc64/power4",
  138. .oprofile_model = &op_model_rs64,
  139. #endif
  140. },
  141. { /* Power4+ */
  142. .pvr_mask = 0xffff0000,
  143. .pvr_value = 0x00380000,
  144. .cpu_name = "POWER4+ (gq)",
  145. .cpu_features = CPU_FTRS_POWER4,
  146. .cpu_user_features = COMMON_USER_PPC64,
  147. .icache_bsize = 128,
  148. .dcache_bsize = 128,
  149. .num_pmcs = 8,
  150. .cpu_setup = __setup_cpu_power4,
  151. #ifdef CONFIG_OPROFILE
  152. .oprofile_cpu_type = "ppc64/power4",
  153. .oprofile_model = &op_model_power4,
  154. #endif
  155. },
  156. { /* PPC970 */
  157. .pvr_mask = 0xffff0000,
  158. .pvr_value = 0x00390000,
  159. .cpu_name = "PPC970",
  160. .cpu_features = CPU_FTRS_PPC970,
  161. .cpu_user_features = COMMON_USER_PPC64 |
  162. PPC_FEATURE_HAS_ALTIVEC_COMP,
  163. .icache_bsize = 128,
  164. .dcache_bsize = 128,
  165. .num_pmcs = 8,
  166. .cpu_setup = __setup_cpu_ppc970,
  167. #ifdef CONFIG_OPROFILE
  168. .oprofile_cpu_type = "ppc64/970",
  169. .oprofile_model = &op_model_power4,
  170. #endif
  171. },
  172. { /* PPC970FX */
  173. .pvr_mask = 0xffff0000,
  174. .pvr_value = 0x003c0000,
  175. .cpu_name = "PPC970FX",
  176. .cpu_features = CPU_FTRS_PPC970,
  177. .cpu_user_features = COMMON_USER_PPC64 |
  178. PPC_FEATURE_HAS_ALTIVEC_COMP,
  179. .icache_bsize = 128,
  180. .dcache_bsize = 128,
  181. .num_pmcs = 8,
  182. .cpu_setup = __setup_cpu_ppc970,
  183. #ifdef CONFIG_OPROFILE
  184. .oprofile_cpu_type = "ppc64/970",
  185. .oprofile_model = &op_model_power4,
  186. #endif
  187. },
  188. { /* PPC970MP */
  189. .pvr_mask = 0xffff0000,
  190. .pvr_value = 0x00440000,
  191. .cpu_name = "PPC970MP",
  192. .cpu_features = CPU_FTRS_PPC970,
  193. .cpu_user_features = COMMON_USER_PPC64 |
  194. PPC_FEATURE_HAS_ALTIVEC_COMP,
  195. .icache_bsize = 128,
  196. .dcache_bsize = 128,
  197. .cpu_setup = __setup_cpu_ppc970,
  198. #ifdef CONFIG_OPROFILE
  199. .oprofile_cpu_type = "ppc64/970",
  200. .oprofile_model = &op_model_power4,
  201. #endif
  202. },
  203. { /* Power5 */
  204. .pvr_mask = 0xffff0000,
  205. .pvr_value = 0x003a0000,
  206. .cpu_name = "POWER5 (gr)",
  207. .cpu_features = CPU_FTRS_POWER5,
  208. .cpu_user_features = COMMON_USER_PPC64,
  209. .icache_bsize = 128,
  210. .dcache_bsize = 128,
  211. .num_pmcs = 6,
  212. .cpu_setup = __setup_cpu_power4,
  213. #ifdef CONFIG_OPROFILE
  214. .oprofile_cpu_type = "ppc64/power5",
  215. .oprofile_model = &op_model_power4,
  216. #endif
  217. },
  218. { /* Power5 */
  219. .pvr_mask = 0xffff0000,
  220. .pvr_value = 0x003b0000,
  221. .cpu_name = "POWER5 (gs)",
  222. .cpu_features = CPU_FTRS_POWER5,
  223. .cpu_user_features = COMMON_USER_PPC64,
  224. .icache_bsize = 128,
  225. .dcache_bsize = 128,
  226. .num_pmcs = 6,
  227. .cpu_setup = __setup_cpu_power4,
  228. #ifdef CONFIG_OPROFILE
  229. .oprofile_cpu_type = "ppc64/power5",
  230. .oprofile_model = &op_model_power4,
  231. #endif
  232. },
  233. { /* BE DD1.x */
  234. .pvr_mask = 0xffff0000,
  235. .pvr_value = 0x00700000,
  236. .cpu_name = "Cell Broadband Engine",
  237. .cpu_features = CPU_FTRS_CELL,
  238. .cpu_user_features = COMMON_USER_PPC64 |
  239. PPC_FEATURE_HAS_ALTIVEC_COMP,
  240. .icache_bsize = 128,
  241. .dcache_bsize = 128,
  242. .cpu_setup = __setup_cpu_be,
  243. },
  244. { /* default match */
  245. .pvr_mask = 0x00000000,
  246. .pvr_value = 0x00000000,
  247. .cpu_name = "POWER4 (compatible)",
  248. .cpu_features = CPU_FTRS_COMPATIBLE,
  249. .cpu_user_features = COMMON_USER_PPC64,
  250. .icache_bsize = 128,
  251. .dcache_bsize = 128,
  252. .num_pmcs = 6,
  253. .cpu_setup = __setup_cpu_power4,
  254. }
  255. };