blob: 25ab72323c58d5341d4ac37a957e89eee1090f49 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Stephen Rothwell8d15a3e2005-08-03 14:40:16 +10008 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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
15#include <linux/config.h>
16#include <linux/string.h>
17#include <linux/sched.h>
18#include <linux/threads.h>
19#include <linux/init.h>
20#include <linux/module.h>
21
22#include <asm/cputable.h>
23
24struct cpu_spec* cur_cpu_spec = NULL;
25EXPORT_SYMBOL(cur_cpu_spec);
26
27/* NOTE:
28 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
29 * the responsibility of the appropriate CPU save/restore functions to
30 * eventually copy these settings over. Those save/restore aren't yet
31 * part of the cputable though. That has to be fixed for both ppc32
32 * and ppc64
33 */
34extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
35extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
Arnd Bergmannfef1c772005-06-23 09:43:37 +100037extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39
40/* We only set the altivec features if the kernel was compiled with altivec
41 * support
42 */
43#ifdef CONFIG_ALTIVEC
44#define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC
45#define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC
46#else
47#define CPU_FTR_ALTIVEC_COMP 0
48#define PPC_FEATURE_HAS_ALTIVEC_COMP 0
49#endif
50
51struct cpu_spec cpu_specs[] = {
Anton Blanchard315a6992005-07-07 17:56:11 -070052 { /* Power3 */
53 .pvr_mask = 0xffff0000,
54 .pvr_value = 0x00400000,
55 .cpu_name = "POWER3 (630)",
56 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
Anton Blanchard85309352005-09-06 14:50:48 +100057 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR,
Anton Blanchard315a6992005-07-07 17:56:11 -070058 .cpu_user_features = COMMON_USER_PPC64,
59 .icache_bsize = 128,
60 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100061 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070062 .cpu_setup = __setup_cpu_power3,
Anton Blanchard315a6992005-07-07 17:56:11 -070063 },
64 { /* Power3+ */
65 .pvr_mask = 0xffff0000,
66 .pvr_value = 0x00410000,
67 .cpu_name = "POWER3 (630+)",
68 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
Anton Blanchard85309352005-09-06 14:50:48 +100069 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR,
Anton Blanchard315a6992005-07-07 17:56:11 -070070 .cpu_user_features = COMMON_USER_PPC64,
71 .icache_bsize = 128,
72 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100073 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070074 .cpu_setup = __setup_cpu_power3,
Anton Blanchard315a6992005-07-07 17:56:11 -070075 },
76 { /* Northstar */
77 .pvr_mask = 0xffff0000,
78 .pvr_value = 0x00330000,
79 .cpu_name = "RS64-II (northstar)",
80 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
81 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
Anton Blanchard85309352005-09-06 14:50:48 +100082 CPU_FTR_MMCRA | CPU_FTR_CTRL,
Anton Blanchard315a6992005-07-07 17:56:11 -070083 .cpu_user_features = COMMON_USER_PPC64,
84 .icache_bsize = 128,
85 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100086 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070087 .cpu_setup = __setup_cpu_power3,
Anton Blanchard315a6992005-07-07 17:56:11 -070088 },
89 { /* Pulsar */
90 .pvr_mask = 0xffff0000,
91 .pvr_value = 0x00340000,
92 .cpu_name = "RS64-III (pulsar)",
93 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
94 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
Anton Blanchard85309352005-09-06 14:50:48 +100095 CPU_FTR_MMCRA | CPU_FTR_CTRL,
Anton Blanchard315a6992005-07-07 17:56:11 -070096 .cpu_user_features = COMMON_USER_PPC64,
97 .icache_bsize = 128,
98 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100099 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700100 .cpu_setup = __setup_cpu_power3,
Anton Blanchard315a6992005-07-07 17:56:11 -0700101 },
102 { /* I-star */
103 .pvr_mask = 0xffff0000,
104 .pvr_value = 0x00360000,
105 .cpu_name = "RS64-III (icestar)",
106 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
107 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
Anton Blanchard85309352005-09-06 14:50:48 +1000108 CPU_FTR_MMCRA | CPU_FTR_CTRL,
Anton Blanchard315a6992005-07-07 17:56:11 -0700109 .cpu_user_features = COMMON_USER_PPC64,
110 .icache_bsize = 128,
111 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000112 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700113 .cpu_setup = __setup_cpu_power3,
Anton Blanchard315a6992005-07-07 17:56:11 -0700114 },
115 { /* S-star */
116 .pvr_mask = 0xffff0000,
117 .pvr_value = 0x00370000,
118 .cpu_name = "RS64-IV (sstar)",
119 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
120 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR |
Anton Blanchard85309352005-09-06 14:50:48 +1000121 CPU_FTR_MMCRA | CPU_FTR_CTRL,
Anton Blanchard315a6992005-07-07 17:56:11 -0700122 .cpu_user_features = COMMON_USER_PPC64,
123 .icache_bsize = 128,
124 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000125 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700126 .cpu_setup = __setup_cpu_power3,
Anton Blanchard315a6992005-07-07 17:56:11 -0700127 },
128 { /* Power4 */
129 .pvr_mask = 0xffff0000,
130 .pvr_value = 0x00350000,
131 .cpu_name = "POWER4 (gp)",
132 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
133 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
Anton Blanchard85309352005-09-06 14:50:48 +1000134 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA,
Anton Blanchard315a6992005-07-07 17:56:11 -0700135 .cpu_user_features = COMMON_USER_PPC64,
136 .icache_bsize = 128,
137 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000138 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700139 .cpu_setup = __setup_cpu_power4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700140 },
141 { /* Power4+ */
142 .pvr_mask = 0xffff0000,
143 .pvr_value = 0x00380000,
144 .cpu_name = "POWER4+ (gq)",
145 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
146 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
Anton Blanchard85309352005-09-06 14:50:48 +1000147 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA,
Anton Blanchard315a6992005-07-07 17:56:11 -0700148 .cpu_user_features = COMMON_USER_PPC64,
149 .icache_bsize = 128,
150 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000151 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700152 .cpu_setup = __setup_cpu_power4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700153 },
154 { /* PPC970 */
155 .pvr_mask = 0xffff0000,
156 .pvr_value = 0x00390000,
157 .cpu_name = "PPC970",
158 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
159 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
160 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
Anton Blanchard85309352005-09-06 14:50:48 +1000161 CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
Anton Blanchard315a6992005-07-07 17:56:11 -0700162 .cpu_user_features = COMMON_USER_PPC64 |
163 PPC_FEATURE_HAS_ALTIVEC_COMP,
164 .icache_bsize = 128,
165 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000166 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700167 .cpu_setup = __setup_cpu_ppc970,
Anton Blanchard315a6992005-07-07 17:56:11 -0700168 },
169 { /* PPC970FX */
170 .pvr_mask = 0xffff0000,
171 .pvr_value = 0x003c0000,
172 .cpu_name = "PPC970FX",
173 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
174 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
175 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
Anton Blanchard85309352005-09-06 14:50:48 +1000176 CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
Anton Blanchard315a6992005-07-07 17:56:11 -0700177 .cpu_user_features = COMMON_USER_PPC64 |
178 PPC_FEATURE_HAS_ALTIVEC_COMP,
179 .icache_bsize = 128,
180 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000181 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700182 .cpu_setup = __setup_cpu_ppc970,
Anton Blanchard315a6992005-07-07 17:56:11 -0700183 },
Olof Johanssonf264cc22005-07-13 01:11:44 -0700184 { /* PPC970MP */
185 .pvr_mask = 0xffff0000,
186 .pvr_value = 0x00440000,
187 .cpu_name = "PPC970MP",
188 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
189 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
190 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
Anton Blanchard85309352005-09-06 14:50:48 +1000191 CPU_FTR_CAN_NAP | CPU_FTR_MMCRA,
Olof Johanssonf264cc22005-07-13 01:11:44 -0700192 .cpu_user_features = COMMON_USER_PPC64 |
193 PPC_FEATURE_HAS_ALTIVEC_COMP,
194 .icache_bsize = 128,
195 .dcache_bsize = 128,
196 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf264cc22005-07-13 01:11:44 -0700197 },
Anton Blanchard315a6992005-07-07 17:56:11 -0700198 { /* Power5 */
199 .pvr_mask = 0xffff0000,
200 .pvr_value = 0x003a0000,
201 .cpu_name = "POWER5 (gr)",
202 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
203 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
204 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
205 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
206 CPU_FTR_MMCRA_SIHV,
207 .cpu_user_features = COMMON_USER_PPC64,
208 .icache_bsize = 128,
209 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000210 .num_pmcs = 6,
Anton Blanchard315a6992005-07-07 17:56:11 -0700211 .cpu_setup = __setup_cpu_power4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700212 },
213 { /* Power5 */
214 .pvr_mask = 0xffff0000,
215 .pvr_value = 0x003b0000,
216 .cpu_name = "POWER5 (gs)",
217 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
218 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
219 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
220 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
221 CPU_FTR_MMCRA_SIHV,
222 .cpu_user_features = COMMON_USER_PPC64,
223 .icache_bsize = 128,
224 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000225 .num_pmcs = 6,
Anton Blanchard315a6992005-07-07 17:56:11 -0700226 .cpu_setup = __setup_cpu_power4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700227 },
228 { /* BE DD1.x */
229 .pvr_mask = 0xffff0000,
230 .pvr_value = 0x00700000,
231 .cpu_name = "Broadband Engine",
232 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
233 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
234 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP |
235 CPU_FTR_SMT,
236 .cpu_user_features = COMMON_USER_PPC64 |
237 PPC_FEATURE_HAS_ALTIVEC_COMP,
238 .icache_bsize = 128,
239 .dcache_bsize = 128,
240 .cpu_setup = __setup_cpu_be,
Anton Blanchard315a6992005-07-07 17:56:11 -0700241 },
242 { /* default match */
243 .pvr_mask = 0x00000000,
244 .pvr_value = 0x00000000,
245 .cpu_name = "POWER4 (compatible)",
246 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
247 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
248 CPU_FTR_PPCAS_ARCH_V2,
249 .cpu_user_features = COMMON_USER_PPC64,
250 .icache_bsize = 128,
251 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000252 .num_pmcs = 6,
Anton Blanchard315a6992005-07-07 17:56:11 -0700253 .cpu_setup = __setup_cpu_power4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700254 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255};