2 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
4 * Modifications for ppc64:
5 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
13 #include <linux/string.h>
14 #include <linux/sched.h>
15 #include <linux/threads.h>
16 #include <linux/init.h>
17 #include <linux/module.h>
19 #include <asm/oprofile_impl.h>
20 #include <asm/cputable.h>
21 #include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */
23 struct cpu_spec* cur_cpu_spec = NULL;
24 EXPORT_SYMBOL(cur_cpu_spec);
27 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
28 * the responsibility of the appropriate CPU save/restore functions to
29 * eventually copy these settings over. Those save/restore aren't yet
30 * part of the cputable though. That has to be fixed for both ppc32
34 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
35 extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
36 extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
37 extern void __setup_cpu_750cx(unsigned long offset, struct cpu_spec* spec);
38 extern void __setup_cpu_750fx(unsigned long offset, struct cpu_spec* spec);
39 extern void __setup_cpu_7400(unsigned long offset, struct cpu_spec* spec);
40 extern void __setup_cpu_7410(unsigned long offset, struct cpu_spec* spec);
41 extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
42 #endif /* CONFIG_PPC32 */
44 extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
45 extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
46 extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
47 extern void __restore_cpu_pa6t(void);
48 extern void __restore_cpu_ppc970(void);
49 #endif /* CONFIG_PPC64 */
51 /* This table only contains "desktop" CPUs, it need to be filled with embedded
54 #define COMMON_USER (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
56 #define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
57 #define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
58 #define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
59 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
60 #define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
61 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
62 #define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
63 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
65 #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
66 PPC_FEATURE_TRUE_LE | \
67 PPC_FEATURE_HAS_ALTIVEC_COMP)
68 #define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
71 static struct cpu_spec cpu_specs[] = {
74 .pvr_mask = 0xffff0000,
75 .pvr_value = 0x00400000,
76 .cpu_name = "POWER3 (630)",
77 .cpu_features = CPU_FTRS_POWER3,
78 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
82 .pmc_type = PPC_PMC_IBM,
83 .oprofile_cpu_type = "ppc64/power3",
84 .oprofile_type = PPC_OPROFILE_RS64,
88 .pvr_mask = 0xffff0000,
89 .pvr_value = 0x00410000,
90 .cpu_name = "POWER3 (630+)",
91 .cpu_features = CPU_FTRS_POWER3,
92 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
96 .pmc_type = PPC_PMC_IBM,
97 .oprofile_cpu_type = "ppc64/power3",
98 .oprofile_type = PPC_OPROFILE_RS64,
102 .pvr_mask = 0xffff0000,
103 .pvr_value = 0x00330000,
104 .cpu_name = "RS64-II (northstar)",
105 .cpu_features = CPU_FTRS_RS64,
106 .cpu_user_features = COMMON_USER_PPC64,
110 .pmc_type = PPC_PMC_IBM,
111 .oprofile_cpu_type = "ppc64/rs64",
112 .oprofile_type = PPC_OPROFILE_RS64,
116 .pvr_mask = 0xffff0000,
117 .pvr_value = 0x00340000,
118 .cpu_name = "RS64-III (pulsar)",
119 .cpu_features = CPU_FTRS_RS64,
120 .cpu_user_features = COMMON_USER_PPC64,
124 .pmc_type = PPC_PMC_IBM,
125 .oprofile_cpu_type = "ppc64/rs64",
126 .oprofile_type = PPC_OPROFILE_RS64,
130 .pvr_mask = 0xffff0000,
131 .pvr_value = 0x00360000,
132 .cpu_name = "RS64-III (icestar)",
133 .cpu_features = CPU_FTRS_RS64,
134 .cpu_user_features = COMMON_USER_PPC64,
138 .pmc_type = PPC_PMC_IBM,
139 .oprofile_cpu_type = "ppc64/rs64",
140 .oprofile_type = PPC_OPROFILE_RS64,
144 .pvr_mask = 0xffff0000,
145 .pvr_value = 0x00370000,
146 .cpu_name = "RS64-IV (sstar)",
147 .cpu_features = CPU_FTRS_RS64,
148 .cpu_user_features = COMMON_USER_PPC64,
152 .pmc_type = PPC_PMC_IBM,
153 .oprofile_cpu_type = "ppc64/rs64",
154 .oprofile_type = PPC_OPROFILE_RS64,
158 .pvr_mask = 0xffff0000,
159 .pvr_value = 0x00350000,
160 .cpu_name = "POWER4 (gp)",
161 .cpu_features = CPU_FTRS_POWER4,
162 .cpu_user_features = COMMON_USER_POWER4,
166 .pmc_type = PPC_PMC_IBM,
167 .oprofile_cpu_type = "ppc64/power4",
168 .oprofile_type = PPC_OPROFILE_POWER4,
169 .platform = "power4",
172 .pvr_mask = 0xffff0000,
173 .pvr_value = 0x00380000,
174 .cpu_name = "POWER4+ (gq)",
175 .cpu_features = CPU_FTRS_POWER4,
176 .cpu_user_features = COMMON_USER_POWER4,
180 .pmc_type = PPC_PMC_IBM,
181 .oprofile_cpu_type = "ppc64/power4",
182 .oprofile_type = PPC_OPROFILE_POWER4,
183 .platform = "power4",
186 .pvr_mask = 0xffff0000,
187 .pvr_value = 0x00390000,
188 .cpu_name = "PPC970",
189 .cpu_features = CPU_FTRS_PPC970,
190 .cpu_user_features = COMMON_USER_POWER4 |
191 PPC_FEATURE_HAS_ALTIVEC_COMP,
195 .pmc_type = PPC_PMC_IBM,
196 .cpu_setup = __setup_cpu_ppc970,
197 .cpu_restore = __restore_cpu_ppc970,
198 .oprofile_cpu_type = "ppc64/970",
199 .oprofile_type = PPC_OPROFILE_POWER4,
200 .platform = "ppc970",
203 .pvr_mask = 0xffff0000,
204 .pvr_value = 0x003c0000,
205 .cpu_name = "PPC970FX",
206 .cpu_features = CPU_FTRS_PPC970,
207 .cpu_user_features = COMMON_USER_POWER4 |
208 PPC_FEATURE_HAS_ALTIVEC_COMP,
212 .pmc_type = PPC_PMC_IBM,
213 .cpu_setup = __setup_cpu_ppc970,
214 .cpu_restore = __restore_cpu_ppc970,
215 .oprofile_cpu_type = "ppc64/970",
216 .oprofile_type = PPC_OPROFILE_POWER4,
217 .platform = "ppc970",
219 { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
220 .pvr_mask = 0xffffffff,
221 .pvr_value = 0x00440100,
222 .cpu_name = "PPC970MP",
223 .cpu_features = CPU_FTRS_PPC970,
224 .cpu_user_features = COMMON_USER_POWER4 |
225 PPC_FEATURE_HAS_ALTIVEC_COMP,
229 .pmc_type = PPC_PMC_IBM,
230 .cpu_setup = __setup_cpu_ppc970,
231 .cpu_restore = __restore_cpu_ppc970,
232 .oprofile_cpu_type = "ppc64/970MP",
233 .oprofile_type = PPC_OPROFILE_POWER4,
234 .platform = "ppc970",
237 .pvr_mask = 0xffff0000,
238 .pvr_value = 0x00440000,
239 .cpu_name = "PPC970MP",
240 .cpu_features = CPU_FTRS_PPC970,
241 .cpu_user_features = COMMON_USER_POWER4 |
242 PPC_FEATURE_HAS_ALTIVEC_COMP,
246 .pmc_type = PPC_PMC_IBM,
247 .cpu_setup = __setup_cpu_ppc970MP,
248 .cpu_restore = __restore_cpu_ppc970,
249 .oprofile_cpu_type = "ppc64/970MP",
250 .oprofile_type = PPC_OPROFILE_POWER4,
251 .platform = "ppc970",
254 .pvr_mask = 0xffff0000,
255 .pvr_value = 0x00450000,
256 .cpu_name = "PPC970GX",
257 .cpu_features = CPU_FTRS_PPC970,
258 .cpu_user_features = COMMON_USER_POWER4 |
259 PPC_FEATURE_HAS_ALTIVEC_COMP,
263 .pmc_type = PPC_PMC_IBM,
264 .cpu_setup = __setup_cpu_ppc970,
265 .oprofile_cpu_type = "ppc64/970",
266 .oprofile_type = PPC_OPROFILE_POWER4,
267 .platform = "ppc970",
270 .pvr_mask = 0xffff0000,
271 .pvr_value = 0x003a0000,
272 .cpu_name = "POWER5 (gr)",
273 .cpu_features = CPU_FTRS_POWER5,
274 .cpu_user_features = COMMON_USER_POWER5,
278 .pmc_type = PPC_PMC_IBM,
279 .oprofile_cpu_type = "ppc64/power5",
280 .oprofile_type = PPC_OPROFILE_POWER4,
281 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
282 * and above but only works on POWER5 and above
284 .oprofile_mmcra_sihv = MMCRA_SIHV,
285 .oprofile_mmcra_sipr = MMCRA_SIPR,
286 .platform = "power5",
289 .pvr_mask = 0xffffff00,
290 .pvr_value = 0x003b0300,
291 .cpu_name = "POWER5+ (gs)",
292 .cpu_features = CPU_FTRS_POWER5,
293 .cpu_user_features = COMMON_USER_POWER5_PLUS,
297 .oprofile_cpu_type = "ppc64/power5++",
298 .oprofile_type = PPC_OPROFILE_POWER4,
299 .oprofile_mmcra_sihv = MMCRA_SIHV,
300 .oprofile_mmcra_sipr = MMCRA_SIPR,
301 .platform = "power5+",
304 .pvr_mask = 0xffff0000,
305 .pvr_value = 0x003b0000,
306 .cpu_name = "POWER5+ (gs)",
307 .cpu_features = CPU_FTRS_POWER5,
308 .cpu_user_features = COMMON_USER_POWER5_PLUS,
312 .pmc_type = PPC_PMC_IBM,
313 .oprofile_cpu_type = "ppc64/power5+",
314 .oprofile_type = PPC_OPROFILE_POWER4,
315 .oprofile_mmcra_sihv = MMCRA_SIHV,
316 .oprofile_mmcra_sipr = MMCRA_SIPR,
317 .platform = "power5+",
319 { /* POWER6 in P5+ mode; 2.04-compliant processor */
320 .pvr_mask = 0xffffffff,
321 .pvr_value = 0x0f000001,
322 .cpu_name = "POWER5+",
323 .cpu_features = CPU_FTRS_POWER5,
324 .cpu_user_features = COMMON_USER_POWER5_PLUS,
328 .pmc_type = PPC_PMC_IBM,
329 .oprofile_cpu_type = "ppc64/power6",
330 .oprofile_type = PPC_OPROFILE_POWER4,
331 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
332 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
333 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
335 .platform = "power5+",
338 .pvr_mask = 0xffff0000,
339 .pvr_value = 0x003e0000,
340 .cpu_name = "POWER6 (raw)",
341 .cpu_features = CPU_FTRS_POWER6,
342 .cpu_user_features = COMMON_USER_POWER6 |
343 PPC_FEATURE_POWER6_EXT,
347 .pmc_type = PPC_PMC_IBM,
348 .oprofile_cpu_type = "ppc64/power6",
349 .oprofile_type = PPC_OPROFILE_POWER4,
350 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
351 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
352 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
354 .platform = "power6x",
356 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
357 .pvr_mask = 0xffffffff,
358 .pvr_value = 0x0f000002,
359 .cpu_name = "POWER6 (architected)",
360 .cpu_features = CPU_FTRS_POWER6,
361 .cpu_user_features = COMMON_USER_POWER6,
365 .pmc_type = PPC_PMC_IBM,
366 .oprofile_cpu_type = "ppc64/power6",
367 .oprofile_type = PPC_OPROFILE_POWER4,
368 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
369 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
370 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
372 .platform = "power6",
374 { /* Cell Broadband Engine */
375 .pvr_mask = 0xffff0000,
376 .pvr_value = 0x00700000,
377 .cpu_name = "Cell Broadband Engine",
378 .cpu_features = CPU_FTRS_CELL,
379 .cpu_user_features = COMMON_USER_PPC64 |
380 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
385 .pmc_type = PPC_PMC_IBM,
386 .oprofile_cpu_type = "ppc64/cell-be",
387 .oprofile_type = PPC_OPROFILE_CELL,
388 .platform = "ppc-cell-be",
391 .pvr_mask = 0x7fff0000,
392 .pvr_value = 0x00900000,
394 .cpu_features = CPU_FTRS_PA6T,
395 .cpu_user_features = COMMON_USER_PA6T,
399 .pmc_type = PPC_PMC_PA6T,
400 .cpu_setup = __setup_cpu_pa6t,
401 .cpu_restore = __restore_cpu_pa6t,
402 .oprofile_cpu_type = "ppc64/pa6t",
403 .oprofile_type = PPC_OPROFILE_PA6T,
406 { /* default match */
407 .pvr_mask = 0x00000000,
408 .pvr_value = 0x00000000,
409 .cpu_name = "POWER4 (compatible)",
410 .cpu_features = CPU_FTRS_COMPATIBLE,
411 .cpu_user_features = COMMON_USER_PPC64,
415 .pmc_type = PPC_PMC_IBM,
416 .platform = "power4",
418 #endif /* CONFIG_PPC64 */
422 .pvr_mask = 0xffff0000,
423 .pvr_value = 0x00010000,
425 .cpu_features = CPU_FTRS_PPC601,
426 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
427 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
430 .platform = "ppc601",
433 .pvr_mask = 0xffff0000,
434 .pvr_value = 0x00030000,
436 .cpu_features = CPU_FTRS_603,
437 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
440 .cpu_setup = __setup_cpu_603,
441 .platform = "ppc603",
444 .pvr_mask = 0xffff0000,
445 .pvr_value = 0x00060000,
447 .cpu_features = CPU_FTRS_603,
448 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
451 .cpu_setup = __setup_cpu_603,
452 .platform = "ppc603",
455 .pvr_mask = 0xffff0000,
456 .pvr_value = 0x00070000,
458 .cpu_features = CPU_FTRS_603,
459 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
462 .cpu_setup = __setup_cpu_603,
463 .platform = "ppc603",
466 .pvr_mask = 0xffff0000,
467 .pvr_value = 0x00040000,
469 .cpu_features = CPU_FTRS_604,
470 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
474 .cpu_setup = __setup_cpu_604,
475 .platform = "ppc604",
478 .pvr_mask = 0xfffff000,
479 .pvr_value = 0x00090000,
481 .cpu_features = CPU_FTRS_604,
482 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
486 .cpu_setup = __setup_cpu_604,
487 .platform = "ppc604",
490 .pvr_mask = 0xffff0000,
491 .pvr_value = 0x00090000,
493 .cpu_features = CPU_FTRS_604,
494 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
498 .cpu_setup = __setup_cpu_604,
499 .platform = "ppc604",
502 .pvr_mask = 0xffff0000,
503 .pvr_value = 0x000a0000,
505 .cpu_features = CPU_FTRS_604,
506 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
510 .cpu_setup = __setup_cpu_604,
511 .platform = "ppc604",
513 { /* 740/750 (0x4202, don't support TAU ?) */
514 .pvr_mask = 0xffffffff,
515 .pvr_value = 0x00084202,
516 .cpu_name = "740/750",
517 .cpu_features = CPU_FTRS_740_NOTAU,
518 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
522 .cpu_setup = __setup_cpu_750,
523 .platform = "ppc750",
525 { /* 750CX (80100 and 8010x?) */
526 .pvr_mask = 0xfffffff0,
527 .pvr_value = 0x00080100,
529 .cpu_features = CPU_FTRS_750,
530 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
534 .cpu_setup = __setup_cpu_750cx,
535 .platform = "ppc750",
537 { /* 750CX (82201 and 82202) */
538 .pvr_mask = 0xfffffff0,
539 .pvr_value = 0x00082200,
541 .cpu_features = CPU_FTRS_750,
542 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
546 .cpu_setup = __setup_cpu_750cx,
547 .platform = "ppc750",
549 { /* 750CXe (82214) */
550 .pvr_mask = 0xfffffff0,
551 .pvr_value = 0x00082210,
552 .cpu_name = "750CXe",
553 .cpu_features = CPU_FTRS_750,
554 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
558 .cpu_setup = __setup_cpu_750cx,
559 .platform = "ppc750",
561 { /* 750CXe "Gekko" (83214) */
562 .pvr_mask = 0xffffffff,
563 .pvr_value = 0x00083214,
564 .cpu_name = "750CXe",
565 .cpu_features = CPU_FTRS_750,
566 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
570 .cpu_setup = __setup_cpu_750cx,
571 .platform = "ppc750",
574 .pvr_mask = 0xfffff0f0,
575 .pvr_value = 0x00087010,
577 .cpu_features = CPU_FTRS_750CL,
578 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
582 .cpu_setup = __setup_cpu_750,
583 .platform = "ppc750",
586 .pvr_mask = 0xfffff000,
587 .pvr_value = 0x00083000,
588 .cpu_name = "745/755",
589 .cpu_features = CPU_FTRS_750,
590 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
594 .cpu_setup = __setup_cpu_750,
595 .platform = "ppc750",
597 { /* 750FX rev 1.x */
598 .pvr_mask = 0xffffff00,
599 .pvr_value = 0x70000100,
601 .cpu_features = CPU_FTRS_750FX1,
602 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
606 .cpu_setup = __setup_cpu_750,
607 .platform = "ppc750",
609 { /* 750FX rev 2.0 must disable HID0[DPM] */
610 .pvr_mask = 0xffffffff,
611 .pvr_value = 0x70000200,
613 .cpu_features = CPU_FTRS_750FX2,
614 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
618 .cpu_setup = __setup_cpu_750,
619 .platform = "ppc750",
621 { /* 750FX (All revs except 2.0) */
622 .pvr_mask = 0xffff0000,
623 .pvr_value = 0x70000000,
625 .cpu_features = CPU_FTRS_750FX,
626 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
630 .cpu_setup = __setup_cpu_750fx,
631 .platform = "ppc750",
634 .pvr_mask = 0xffff0000,
635 .pvr_value = 0x70020000,
637 .cpu_features = CPU_FTRS_750GX,
638 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
642 .cpu_setup = __setup_cpu_750fx,
643 .platform = "ppc750",
645 { /* 740/750 (L2CR bit need fixup for 740) */
646 .pvr_mask = 0xffff0000,
647 .pvr_value = 0x00080000,
648 .cpu_name = "740/750",
649 .cpu_features = CPU_FTRS_740,
650 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
654 .cpu_setup = __setup_cpu_750,
655 .platform = "ppc750",
657 { /* 7400 rev 1.1 ? (no TAU) */
658 .pvr_mask = 0xffffffff,
659 .pvr_value = 0x000c1101,
660 .cpu_name = "7400 (1.1)",
661 .cpu_features = CPU_FTRS_7400_NOTAU,
662 .cpu_user_features = COMMON_USER |
663 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
667 .cpu_setup = __setup_cpu_7400,
668 .platform = "ppc7400",
671 .pvr_mask = 0xffff0000,
672 .pvr_value = 0x000c0000,
674 .cpu_features = CPU_FTRS_7400,
675 .cpu_user_features = COMMON_USER |
676 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
680 .cpu_setup = __setup_cpu_7400,
681 .platform = "ppc7400",
684 .pvr_mask = 0xffff0000,
685 .pvr_value = 0x800c0000,
687 .cpu_features = CPU_FTRS_7400,
688 .cpu_user_features = COMMON_USER |
689 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
693 .cpu_setup = __setup_cpu_7410,
694 .platform = "ppc7400",
696 { /* 7450 2.0 - no doze/nap */
697 .pvr_mask = 0xffffffff,
698 .pvr_value = 0x80000200,
700 .cpu_features = CPU_FTRS_7450_20,
701 .cpu_user_features = COMMON_USER |
702 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
706 .cpu_setup = __setup_cpu_745x,
707 .oprofile_cpu_type = "ppc/7450",
708 .oprofile_type = PPC_OPROFILE_G4,
709 .platform = "ppc7450",
712 .pvr_mask = 0xffffffff,
713 .pvr_value = 0x80000201,
715 .cpu_features = CPU_FTRS_7450_21,
716 .cpu_user_features = COMMON_USER |
717 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
721 .cpu_setup = __setup_cpu_745x,
722 .oprofile_cpu_type = "ppc/7450",
723 .oprofile_type = PPC_OPROFILE_G4,
724 .platform = "ppc7450",
726 { /* 7450 2.3 and newer */
727 .pvr_mask = 0xffff0000,
728 .pvr_value = 0x80000000,
730 .cpu_features = CPU_FTRS_7450_23,
731 .cpu_user_features = COMMON_USER |
732 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
736 .cpu_setup = __setup_cpu_745x,
737 .oprofile_cpu_type = "ppc/7450",
738 .oprofile_type = PPC_OPROFILE_G4,
739 .platform = "ppc7450",
742 .pvr_mask = 0xffffff00,
743 .pvr_value = 0x80010100,
745 .cpu_features = CPU_FTRS_7455_1,
746 .cpu_user_features = COMMON_USER |
747 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
751 .cpu_setup = __setup_cpu_745x,
752 .oprofile_cpu_type = "ppc/7450",
753 .oprofile_type = PPC_OPROFILE_G4,
754 .platform = "ppc7450",
757 .pvr_mask = 0xffffffff,
758 .pvr_value = 0x80010200,
760 .cpu_features = CPU_FTRS_7455_20,
761 .cpu_user_features = COMMON_USER |
762 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
766 .cpu_setup = __setup_cpu_745x,
767 .oprofile_cpu_type = "ppc/7450",
768 .oprofile_type = PPC_OPROFILE_G4,
769 .platform = "ppc7450",
772 .pvr_mask = 0xffff0000,
773 .pvr_value = 0x80010000,
775 .cpu_features = CPU_FTRS_7455,
776 .cpu_user_features = COMMON_USER |
777 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
781 .cpu_setup = __setup_cpu_745x,
782 .oprofile_cpu_type = "ppc/7450",
783 .oprofile_type = PPC_OPROFILE_G4,
784 .platform = "ppc7450",
786 { /* 7447/7457 Rev 1.0 */
787 .pvr_mask = 0xffffffff,
788 .pvr_value = 0x80020100,
789 .cpu_name = "7447/7457",
790 .cpu_features = CPU_FTRS_7447_10,
791 .cpu_user_features = COMMON_USER |
792 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
796 .cpu_setup = __setup_cpu_745x,
797 .oprofile_cpu_type = "ppc/7450",
798 .oprofile_type = PPC_OPROFILE_G4,
799 .platform = "ppc7450",
801 { /* 7447/7457 Rev 1.1 */
802 .pvr_mask = 0xffffffff,
803 .pvr_value = 0x80020101,
804 .cpu_name = "7447/7457",
805 .cpu_features = CPU_FTRS_7447_10,
806 .cpu_user_features = COMMON_USER |
807 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
811 .cpu_setup = __setup_cpu_745x,
812 .oprofile_cpu_type = "ppc/7450",
813 .oprofile_type = PPC_OPROFILE_G4,
814 .platform = "ppc7450",
816 { /* 7447/7457 Rev 1.2 and later */
817 .pvr_mask = 0xffff0000,
818 .pvr_value = 0x80020000,
819 .cpu_name = "7447/7457",
820 .cpu_features = CPU_FTRS_7447,
821 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
825 .cpu_setup = __setup_cpu_745x,
826 .oprofile_cpu_type = "ppc/7450",
827 .oprofile_type = PPC_OPROFILE_G4,
828 .platform = "ppc7450",
831 .pvr_mask = 0xffff0000,
832 .pvr_value = 0x80030000,
834 .cpu_features = CPU_FTRS_7447A,
835 .cpu_user_features = COMMON_USER |
836 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
840 .cpu_setup = __setup_cpu_745x,
841 .oprofile_cpu_type = "ppc/7450",
842 .oprofile_type = PPC_OPROFILE_G4,
843 .platform = "ppc7450",
846 .pvr_mask = 0xffff0000,
847 .pvr_value = 0x80040000,
849 .cpu_features = CPU_FTRS_7448,
850 .cpu_user_features = COMMON_USER |
851 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
855 .cpu_setup = __setup_cpu_745x,
856 .oprofile_cpu_type = "ppc/7450",
857 .oprofile_type = PPC_OPROFILE_G4,
858 .platform = "ppc7450",
860 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
861 .pvr_mask = 0x7fff0000,
862 .pvr_value = 0x00810000,
864 .cpu_features = CPU_FTRS_82XX,
865 .cpu_user_features = COMMON_USER,
868 .cpu_setup = __setup_cpu_603,
869 .platform = "ppc603",
871 { /* All G2_LE (603e core, plus some) have the same pvr */
872 .pvr_mask = 0x7fff0000,
873 .pvr_value = 0x00820000,
875 .cpu_features = CPU_FTRS_G2_LE,
876 .cpu_user_features = COMMON_USER,
879 .cpu_setup = __setup_cpu_603,
880 .platform = "ppc603",
882 { /* e300c1 (a 603e core, plus some) on 83xx */
883 .pvr_mask = 0x7fff0000,
884 .pvr_value = 0x00830000,
885 .cpu_name = "e300c1",
886 .cpu_features = CPU_FTRS_E300,
887 .cpu_user_features = COMMON_USER,
890 .cpu_setup = __setup_cpu_603,
891 .platform = "ppc603",
893 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
894 .pvr_mask = 0x7fff0000,
895 .pvr_value = 0x00840000,
896 .cpu_name = "e300c2",
897 .cpu_features = CPU_FTRS_E300C2,
898 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
901 .cpu_setup = __setup_cpu_603,
902 .platform = "ppc603",
904 { /* e300c3 on 83xx */
905 .pvr_mask = 0x7fff0000,
906 .pvr_value = 0x00850000,
907 .cpu_name = "e300c3",
908 .cpu_features = CPU_FTRS_E300,
909 .cpu_user_features = COMMON_USER,
912 .cpu_setup = __setup_cpu_603,
913 .platform = "ppc603",
915 { /* default match, we assume split I/D cache & TB (non-601)... */
916 .pvr_mask = 0x00000000,
917 .pvr_value = 0x00000000,
918 .cpu_name = "(generic PPC)",
919 .cpu_features = CPU_FTRS_CLASSIC32,
920 .cpu_user_features = COMMON_USER,
923 .platform = "ppc603",
925 #endif /* CLASSIC_PPC */
928 .pvr_mask = 0xffff0000,
929 .pvr_value = 0x00500000,
931 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
932 * if the 8xx code is there.... */
933 .cpu_features = CPU_FTRS_8XX,
934 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
937 .platform = "ppc823",
939 #endif /* CONFIG_8xx */
942 .pvr_mask = 0xffffff00,
943 .pvr_value = 0x00200200,
945 .cpu_features = CPU_FTRS_40X,
946 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
949 .platform = "ppc403",
952 .pvr_mask = 0xffffff00,
953 .pvr_value = 0x00201400,
954 .cpu_name = "403GCX",
955 .cpu_features = CPU_FTRS_40X,
956 .cpu_user_features = PPC_FEATURE_32 |
957 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
960 .platform = "ppc403",
963 .pvr_mask = 0xffff0000,
964 .pvr_value = 0x00200000,
965 .cpu_name = "403G ??",
966 .cpu_features = CPU_FTRS_40X,
967 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
970 .platform = "ppc403",
973 .pvr_mask = 0xffff0000,
974 .pvr_value = 0x40110000,
976 .cpu_features = CPU_FTRS_40X,
977 .cpu_user_features = PPC_FEATURE_32 |
978 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
981 .platform = "ppc405",
984 .pvr_mask = 0xffff0000,
985 .pvr_value = 0x40130000,
986 .cpu_name = "STB03xxx",
987 .cpu_features = CPU_FTRS_40X,
988 .cpu_user_features = PPC_FEATURE_32 |
989 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
992 .platform = "ppc405",
995 .pvr_mask = 0xffff0000,
996 .pvr_value = 0x41810000,
997 .cpu_name = "STB04xxx",
998 .cpu_features = CPU_FTRS_40X,
999 .cpu_user_features = PPC_FEATURE_32 |
1000 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1003 .platform = "ppc405",
1006 .pvr_mask = 0xffff0000,
1007 .pvr_value = 0x41610000,
1008 .cpu_name = "NP405L",
1009 .cpu_features = CPU_FTRS_40X,
1010 .cpu_user_features = PPC_FEATURE_32 |
1011 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1014 .platform = "ppc405",
1017 .pvr_mask = 0xffff0000,
1018 .pvr_value = 0x40B10000,
1019 .cpu_name = "NP4GS3",
1020 .cpu_features = CPU_FTRS_40X,
1021 .cpu_user_features = PPC_FEATURE_32 |
1022 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1025 .platform = "ppc405",
1028 .pvr_mask = 0xffff0000,
1029 .pvr_value = 0x41410000,
1030 .cpu_name = "NP405H",
1031 .cpu_features = CPU_FTRS_40X,
1032 .cpu_user_features = PPC_FEATURE_32 |
1033 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1036 .platform = "ppc405",
1039 .pvr_mask = 0xffff0000,
1040 .pvr_value = 0x50910000,
1041 .cpu_name = "405GPr",
1042 .cpu_features = CPU_FTRS_40X,
1043 .cpu_user_features = PPC_FEATURE_32 |
1044 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1047 .platform = "ppc405",
1050 .pvr_mask = 0xffff0000,
1051 .pvr_value = 0x51510000,
1052 .cpu_name = "STBx25xx",
1053 .cpu_features = CPU_FTRS_40X,
1054 .cpu_user_features = PPC_FEATURE_32 |
1055 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1058 .platform = "ppc405",
1061 .pvr_mask = 0xffff0000,
1062 .pvr_value = 0x41F10000,
1063 .cpu_name = "405LP",
1064 .cpu_features = CPU_FTRS_40X,
1065 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1068 .platform = "ppc405",
1070 { /* Xilinx Virtex-II Pro */
1071 .pvr_mask = 0xfffff000,
1072 .pvr_value = 0x20010000,
1073 .cpu_name = "Virtex-II Pro",
1074 .cpu_features = CPU_FTRS_40X,
1075 .cpu_user_features = PPC_FEATURE_32 |
1076 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1079 .platform = "ppc405",
1081 { /* Xilinx Virtex-4 FX */
1082 .pvr_mask = 0xfffff000,
1083 .pvr_value = 0x20011000,
1084 .cpu_name = "Virtex-4 FX",
1085 .cpu_features = CPU_FTRS_40X,
1086 .cpu_user_features = PPC_FEATURE_32 |
1087 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1090 .platform = "ppc405",
1093 .pvr_mask = 0xffff0000,
1094 .pvr_value = 0x51210000,
1095 .cpu_name = "405EP",
1096 .cpu_features = CPU_FTRS_40X,
1097 .cpu_user_features = PPC_FEATURE_32 |
1098 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1101 .platform = "ppc405",
1104 #endif /* CONFIG_40x */
1107 .pvr_mask = 0xf0000fff,
1108 .pvr_value = 0x40000850,
1109 .cpu_name = "440EP Rev. A",
1110 .cpu_features = CPU_FTRS_44X,
1111 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1114 .platform = "ppc440",
1117 .pvr_mask = 0xf0000fff,
1118 .pvr_value = 0x400008d3,
1119 .cpu_name = "440EP Rev. B",
1120 .cpu_features = CPU_FTRS_44X,
1121 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1124 .platform = "ppc440",
1127 .pvr_mask = 0xf0000ffb,
1128 .pvr_value = 0x200008D0,
1129 .cpu_name = "440EPX",
1130 .cpu_features = CPU_FTRS_44X,
1131 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1136 .pvr_mask = 0xf0000ffb,
1137 .pvr_value = 0x200008D8,
1138 .cpu_name = "440GRX",
1139 .cpu_features = CPU_FTRS_44X,
1140 .cpu_user_features = COMMON_USER_BOOKE,
1144 { /* 440GP Rev. B */
1145 .pvr_mask = 0xf0000fff,
1146 .pvr_value = 0x40000440,
1147 .cpu_name = "440GP Rev. B",
1148 .cpu_features = CPU_FTRS_44X,
1149 .cpu_user_features = COMMON_USER_BOOKE,
1152 .platform = "ppc440gp",
1154 { /* 440GP Rev. C */
1155 .pvr_mask = 0xf0000fff,
1156 .pvr_value = 0x40000481,
1157 .cpu_name = "440GP Rev. C",
1158 .cpu_features = CPU_FTRS_44X,
1159 .cpu_user_features = COMMON_USER_BOOKE,
1162 .platform = "ppc440gp",
1164 { /* 440GX Rev. A */
1165 .pvr_mask = 0xf0000fff,
1166 .pvr_value = 0x50000850,
1167 .cpu_name = "440GX Rev. A",
1168 .cpu_features = CPU_FTRS_44X,
1169 .cpu_user_features = COMMON_USER_BOOKE,
1172 .platform = "ppc440",
1174 { /* 440GX Rev. B */
1175 .pvr_mask = 0xf0000fff,
1176 .pvr_value = 0x50000851,
1177 .cpu_name = "440GX Rev. B",
1178 .cpu_features = CPU_FTRS_44X,
1179 .cpu_user_features = COMMON_USER_BOOKE,
1182 .platform = "ppc440",
1184 { /* 440GX Rev. C */
1185 .pvr_mask = 0xf0000fff,
1186 .pvr_value = 0x50000892,
1187 .cpu_name = "440GX Rev. C",
1188 .cpu_features = CPU_FTRS_44X,
1189 .cpu_user_features = COMMON_USER_BOOKE,
1192 .platform = "ppc440",
1194 { /* 440GX Rev. F */
1195 .pvr_mask = 0xf0000fff,
1196 .pvr_value = 0x50000894,
1197 .cpu_name = "440GX Rev. F",
1198 .cpu_features = CPU_FTRS_44X,
1199 .cpu_user_features = COMMON_USER_BOOKE,
1202 .platform = "ppc440",
1204 { /* 440SP Rev. A */
1205 .pvr_mask = 0xfff00fff,
1206 .pvr_value = 0x53200891,
1207 .cpu_name = "440SP Rev. A",
1208 .cpu_features = CPU_FTRS_44X,
1209 .cpu_user_features = COMMON_USER_BOOKE,
1212 .platform = "ppc440",
1214 { /* 440SPe Rev. A */
1215 .pvr_mask = 0xfff00fff,
1216 .pvr_value = 0x53400890,
1217 .cpu_name = "440SPe Rev. A",
1218 .cpu_features = CPU_FTRS_44X,
1219 .cpu_user_features = COMMON_USER_BOOKE,
1222 .platform = "ppc440",
1224 { /* 440SPe Rev. B */
1225 .pvr_mask = 0xfff00fff,
1226 .pvr_value = 0x53400891,
1227 .cpu_name = "440SPe Rev. B",
1228 .cpu_features = CPU_FTRS_44X,
1229 .cpu_user_features = COMMON_USER_BOOKE,
1232 .platform = "ppc440",
1234 #endif /* CONFIG_44x */
1235 #ifdef CONFIG_FSL_BOOKE
1237 .pvr_mask = 0xfff00000,
1238 .pvr_value = 0x81000000,
1239 .cpu_name = "e200z5",
1240 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1241 .cpu_features = CPU_FTRS_E200,
1242 .cpu_user_features = COMMON_USER_BOOKE |
1243 PPC_FEATURE_HAS_EFP_SINGLE |
1244 PPC_FEATURE_UNIFIED_CACHE,
1246 .platform = "ppc5554",
1249 .pvr_mask = 0xfff00000,
1250 .pvr_value = 0x81100000,
1251 .cpu_name = "e200z6",
1252 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1253 .cpu_features = CPU_FTRS_E200,
1254 .cpu_user_features = COMMON_USER_BOOKE |
1255 PPC_FEATURE_HAS_SPE_COMP |
1256 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1257 PPC_FEATURE_UNIFIED_CACHE,
1259 .platform = "ppc5554",
1262 .pvr_mask = 0xffff0000,
1263 .pvr_value = 0x80200000,
1265 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1266 .cpu_features = CPU_FTRS_E500,
1267 .cpu_user_features = COMMON_USER_BOOKE |
1268 PPC_FEATURE_HAS_SPE_COMP |
1269 PPC_FEATURE_HAS_EFP_SINGLE_COMP,
1273 .oprofile_cpu_type = "ppc/e500",
1274 .oprofile_type = PPC_OPROFILE_BOOKE,
1275 .platform = "ppc8540",
1278 .pvr_mask = 0xffff0000,
1279 .pvr_value = 0x80210000,
1280 .cpu_name = "e500v2",
1281 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1282 .cpu_features = CPU_FTRS_E500_2,
1283 .cpu_user_features = COMMON_USER_BOOKE |
1284 PPC_FEATURE_HAS_SPE_COMP |
1285 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1286 PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
1290 .oprofile_cpu_type = "ppc/e500",
1291 .oprofile_type = PPC_OPROFILE_BOOKE,
1292 .platform = "ppc8548",
1296 { /* default match */
1297 .pvr_mask = 0x00000000,
1298 .pvr_value = 0x00000000,
1299 .cpu_name = "(generic PPC)",
1300 .cpu_features = CPU_FTRS_GENERIC_32,
1301 .cpu_user_features = PPC_FEATURE_32,
1304 .platform = "powerpc",
1306 #endif /* !CLASSIC_PPC */
1307 #endif /* CONFIG_PPC32 */
1310 struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1312 struct cpu_spec *s = cpu_specs;
1313 struct cpu_spec **cur = &cur_cpu_spec;
1317 cur = PTRRELOC(cur);
1319 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1320 if ((pvr & s->pvr_mask) == s->pvr_value) {
1321 *cur = cpu_specs + i;
1323 /* ppc64 expects identify_cpu to also call setup_cpu
1324 * for that processor. I will consolidate that at a
1325 * later time, for now, just use our friend #ifdef.
1326 * we also don't need to PTRRELOC the function pointer
1327 * on ppc64 as we are running at 0 in real mode.
1330 s->cpu_setup(offset, s);
1332 #endif /* CONFIG_PPC64 */
1339 void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1341 struct fixup_entry {
1343 unsigned long value;
1351 for (; fcur < fend; fcur++) {
1352 unsigned int *pstart, *pend, *p;
1354 if ((value & fcur->mask) == fcur->value)
1357 /* These PTRRELOCs will disappear once the new scheme for
1358 * modules and vdso is implemented
1360 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1361 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1363 for (p = pstart; p < pend; p++) {
1365 asm volatile ("dcbst 0, %0" : : "r" (p));
1367 asm volatile ("sync" : : : "memory");
1368 for (p = pstart; p < pend; p++)
1369 asm volatile ("icbi 0,%0" : : "r" (p));
1370 asm volatile ("sync; isync" : : : "memory");