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 /* We only set the spe features if the kernel was compiled with
75 #define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE
77 #define PPC_FEATURE_SPE_COMP 0
80 static struct cpu_spec cpu_specs[] = {
83 .pvr_mask = 0xffff0000,
84 .pvr_value = 0x00400000,
85 .cpu_name = "POWER3 (630)",
86 .cpu_features = CPU_FTRS_POWER3,
87 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
91 .pmc_type = PPC_PMC_IBM,
92 .oprofile_cpu_type = "ppc64/power3",
93 .oprofile_type = PPC_OPROFILE_RS64,
97 .pvr_mask = 0xffff0000,
98 .pvr_value = 0x00410000,
99 .cpu_name = "POWER3 (630+)",
100 .cpu_features = CPU_FTRS_POWER3,
101 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
105 .pmc_type = PPC_PMC_IBM,
106 .oprofile_cpu_type = "ppc64/power3",
107 .oprofile_type = PPC_OPROFILE_RS64,
108 .platform = "power3",
111 .pvr_mask = 0xffff0000,
112 .pvr_value = 0x00330000,
113 .cpu_name = "RS64-II (northstar)",
114 .cpu_features = CPU_FTRS_RS64,
115 .cpu_user_features = COMMON_USER_PPC64,
119 .pmc_type = PPC_PMC_IBM,
120 .oprofile_cpu_type = "ppc64/rs64",
121 .oprofile_type = PPC_OPROFILE_RS64,
125 .pvr_mask = 0xffff0000,
126 .pvr_value = 0x00340000,
127 .cpu_name = "RS64-III (pulsar)",
128 .cpu_features = CPU_FTRS_RS64,
129 .cpu_user_features = COMMON_USER_PPC64,
133 .pmc_type = PPC_PMC_IBM,
134 .oprofile_cpu_type = "ppc64/rs64",
135 .oprofile_type = PPC_OPROFILE_RS64,
139 .pvr_mask = 0xffff0000,
140 .pvr_value = 0x00360000,
141 .cpu_name = "RS64-III (icestar)",
142 .cpu_features = CPU_FTRS_RS64,
143 .cpu_user_features = COMMON_USER_PPC64,
147 .pmc_type = PPC_PMC_IBM,
148 .oprofile_cpu_type = "ppc64/rs64",
149 .oprofile_type = PPC_OPROFILE_RS64,
153 .pvr_mask = 0xffff0000,
154 .pvr_value = 0x00370000,
155 .cpu_name = "RS64-IV (sstar)",
156 .cpu_features = CPU_FTRS_RS64,
157 .cpu_user_features = COMMON_USER_PPC64,
161 .pmc_type = PPC_PMC_IBM,
162 .oprofile_cpu_type = "ppc64/rs64",
163 .oprofile_type = PPC_OPROFILE_RS64,
167 .pvr_mask = 0xffff0000,
168 .pvr_value = 0x00350000,
169 .cpu_name = "POWER4 (gp)",
170 .cpu_features = CPU_FTRS_POWER4,
171 .cpu_user_features = COMMON_USER_POWER4,
175 .pmc_type = PPC_PMC_IBM,
176 .oprofile_cpu_type = "ppc64/power4",
177 .oprofile_type = PPC_OPROFILE_POWER4,
178 .platform = "power4",
181 .pvr_mask = 0xffff0000,
182 .pvr_value = 0x00380000,
183 .cpu_name = "POWER4+ (gq)",
184 .cpu_features = CPU_FTRS_POWER4,
185 .cpu_user_features = COMMON_USER_POWER4,
189 .pmc_type = PPC_PMC_IBM,
190 .oprofile_cpu_type = "ppc64/power4",
191 .oprofile_type = PPC_OPROFILE_POWER4,
192 .platform = "power4",
195 .pvr_mask = 0xffff0000,
196 .pvr_value = 0x00390000,
197 .cpu_name = "PPC970",
198 .cpu_features = CPU_FTRS_PPC970,
199 .cpu_user_features = COMMON_USER_POWER4 |
200 PPC_FEATURE_HAS_ALTIVEC_COMP,
204 .pmc_type = PPC_PMC_IBM,
205 .cpu_setup = __setup_cpu_ppc970,
206 .cpu_restore = __restore_cpu_ppc970,
207 .oprofile_cpu_type = "ppc64/970",
208 .oprofile_type = PPC_OPROFILE_POWER4,
209 .platform = "ppc970",
212 .pvr_mask = 0xffff0000,
213 .pvr_value = 0x003c0000,
214 .cpu_name = "PPC970FX",
215 .cpu_features = CPU_FTRS_PPC970,
216 .cpu_user_features = COMMON_USER_POWER4 |
217 PPC_FEATURE_HAS_ALTIVEC_COMP,
221 .pmc_type = PPC_PMC_IBM,
222 .cpu_setup = __setup_cpu_ppc970,
223 .cpu_restore = __restore_cpu_ppc970,
224 .oprofile_cpu_type = "ppc64/970",
225 .oprofile_type = PPC_OPROFILE_POWER4,
226 .platform = "ppc970",
228 { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
229 .pvr_mask = 0xffffffff,
230 .pvr_value = 0x00440100,
231 .cpu_name = "PPC970MP",
232 .cpu_features = CPU_FTRS_PPC970,
233 .cpu_user_features = COMMON_USER_POWER4 |
234 PPC_FEATURE_HAS_ALTIVEC_COMP,
238 .pmc_type = PPC_PMC_IBM,
239 .cpu_setup = __setup_cpu_ppc970,
240 .cpu_restore = __restore_cpu_ppc970,
241 .oprofile_cpu_type = "ppc64/970MP",
242 .oprofile_type = PPC_OPROFILE_POWER4,
243 .platform = "ppc970",
246 .pvr_mask = 0xffff0000,
247 .pvr_value = 0x00440000,
248 .cpu_name = "PPC970MP",
249 .cpu_features = CPU_FTRS_PPC970,
250 .cpu_user_features = COMMON_USER_POWER4 |
251 PPC_FEATURE_HAS_ALTIVEC_COMP,
255 .pmc_type = PPC_PMC_IBM,
256 .cpu_setup = __setup_cpu_ppc970MP,
257 .cpu_restore = __restore_cpu_ppc970,
258 .oprofile_cpu_type = "ppc64/970MP",
259 .oprofile_type = PPC_OPROFILE_POWER4,
260 .platform = "ppc970",
263 .pvr_mask = 0xffff0000,
264 .pvr_value = 0x00450000,
265 .cpu_name = "PPC970GX",
266 .cpu_features = CPU_FTRS_PPC970,
267 .cpu_user_features = COMMON_USER_POWER4 |
268 PPC_FEATURE_HAS_ALTIVEC_COMP,
272 .pmc_type = PPC_PMC_IBM,
273 .cpu_setup = __setup_cpu_ppc970,
274 .oprofile_cpu_type = "ppc64/970",
275 .oprofile_type = PPC_OPROFILE_POWER4,
276 .platform = "ppc970",
279 .pvr_mask = 0xffff0000,
280 .pvr_value = 0x003a0000,
281 .cpu_name = "POWER5 (gr)",
282 .cpu_features = CPU_FTRS_POWER5,
283 .cpu_user_features = COMMON_USER_POWER5,
287 .pmc_type = PPC_PMC_IBM,
288 .oprofile_cpu_type = "ppc64/power5",
289 .oprofile_type = PPC_OPROFILE_POWER4,
290 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
291 * and above but only works on POWER5 and above
293 .oprofile_mmcra_sihv = MMCRA_SIHV,
294 .oprofile_mmcra_sipr = MMCRA_SIPR,
295 .platform = "power5",
298 .pvr_mask = 0xffffff00,
299 .pvr_value = 0x003b0300,
300 .cpu_name = "POWER5+ (gs)",
301 .cpu_features = CPU_FTRS_POWER5,
302 .cpu_user_features = COMMON_USER_POWER5_PLUS,
306 .oprofile_cpu_type = "ppc64/power5++",
307 .oprofile_type = PPC_OPROFILE_POWER4,
308 .oprofile_mmcra_sihv = MMCRA_SIHV,
309 .oprofile_mmcra_sipr = MMCRA_SIPR,
310 .platform = "power5+",
313 .pvr_mask = 0xffff0000,
314 .pvr_value = 0x003b0000,
315 .cpu_name = "POWER5+ (gs)",
316 .cpu_features = CPU_FTRS_POWER5,
317 .cpu_user_features = COMMON_USER_POWER5_PLUS,
321 .pmc_type = PPC_PMC_IBM,
322 .oprofile_cpu_type = "ppc64/power5+",
323 .oprofile_type = PPC_OPROFILE_POWER4,
324 .oprofile_mmcra_sihv = MMCRA_SIHV,
325 .oprofile_mmcra_sipr = MMCRA_SIPR,
326 .platform = "power5+",
328 { /* POWER6 in P5+ mode; 2.04-compliant processor */
329 .pvr_mask = 0xffffffff,
330 .pvr_value = 0x0f000001,
331 .cpu_name = "POWER5+",
332 .cpu_features = CPU_FTRS_POWER5,
333 .cpu_user_features = COMMON_USER_POWER5_PLUS,
337 .pmc_type = PPC_PMC_IBM,
338 .oprofile_cpu_type = "ppc64/power6",
339 .oprofile_type = PPC_OPROFILE_POWER4,
340 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
341 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
342 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
344 .platform = "power5+",
347 .pvr_mask = 0xffff0000,
348 .pvr_value = 0x003e0000,
349 .cpu_name = "POWER6 (raw)",
350 .cpu_features = CPU_FTRS_POWER6,
351 .cpu_user_features = COMMON_USER_POWER6 |
352 PPC_FEATURE_POWER6_EXT,
356 .pmc_type = PPC_PMC_IBM,
357 .oprofile_cpu_type = "ppc64/power6",
358 .oprofile_type = PPC_OPROFILE_POWER4,
359 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
360 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
361 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
363 .platform = "power6x",
365 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
366 .pvr_mask = 0xffffffff,
367 .pvr_value = 0x0f000002,
368 .cpu_name = "POWER6 (architected)",
369 .cpu_features = CPU_FTRS_POWER6,
370 .cpu_user_features = COMMON_USER_POWER6,
374 .pmc_type = PPC_PMC_IBM,
375 .oprofile_cpu_type = "ppc64/power6",
376 .oprofile_type = PPC_OPROFILE_POWER4,
377 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
378 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
379 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
381 .platform = "power6",
383 { /* Cell Broadband Engine */
384 .pvr_mask = 0xffff0000,
385 .pvr_value = 0x00700000,
386 .cpu_name = "Cell Broadband Engine",
387 .cpu_features = CPU_FTRS_CELL,
388 .cpu_user_features = COMMON_USER_PPC64 |
389 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
394 .pmc_type = PPC_PMC_IBM,
395 .oprofile_cpu_type = "ppc64/cell-be",
396 .oprofile_type = PPC_OPROFILE_CELL,
397 .platform = "ppc-cell-be",
400 .pvr_mask = 0x7fff0000,
401 .pvr_value = 0x00900000,
403 .cpu_features = CPU_FTRS_PA6T,
404 .cpu_user_features = COMMON_USER_PA6T,
408 .pmc_type = PPC_PMC_PA6T,
409 .cpu_setup = __setup_cpu_pa6t,
410 .cpu_restore = __restore_cpu_pa6t,
411 .oprofile_cpu_type = "ppc64/pa6t",
412 .oprofile_type = PPC_OPROFILE_PA6T,
415 { /* default match */
416 .pvr_mask = 0x00000000,
417 .pvr_value = 0x00000000,
418 .cpu_name = "POWER4 (compatible)",
419 .cpu_features = CPU_FTRS_COMPATIBLE,
420 .cpu_user_features = COMMON_USER_PPC64,
424 .pmc_type = PPC_PMC_IBM,
425 .platform = "power4",
427 #endif /* CONFIG_PPC64 */
431 .pvr_mask = 0xffff0000,
432 .pvr_value = 0x00010000,
434 .cpu_features = CPU_FTRS_PPC601,
435 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
436 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
439 .platform = "ppc601",
442 .pvr_mask = 0xffff0000,
443 .pvr_value = 0x00030000,
445 .cpu_features = CPU_FTRS_603,
446 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
449 .cpu_setup = __setup_cpu_603,
450 .platform = "ppc603",
453 .pvr_mask = 0xffff0000,
454 .pvr_value = 0x00060000,
456 .cpu_features = CPU_FTRS_603,
457 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
460 .cpu_setup = __setup_cpu_603,
461 .platform = "ppc603",
464 .pvr_mask = 0xffff0000,
465 .pvr_value = 0x00070000,
467 .cpu_features = CPU_FTRS_603,
468 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
471 .cpu_setup = __setup_cpu_603,
472 .platform = "ppc603",
475 .pvr_mask = 0xffff0000,
476 .pvr_value = 0x00040000,
478 .cpu_features = CPU_FTRS_604,
479 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
483 .cpu_setup = __setup_cpu_604,
484 .platform = "ppc604",
487 .pvr_mask = 0xfffff000,
488 .pvr_value = 0x00090000,
490 .cpu_features = CPU_FTRS_604,
491 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
495 .cpu_setup = __setup_cpu_604,
496 .platform = "ppc604",
499 .pvr_mask = 0xffff0000,
500 .pvr_value = 0x00090000,
502 .cpu_features = CPU_FTRS_604,
503 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
507 .cpu_setup = __setup_cpu_604,
508 .platform = "ppc604",
511 .pvr_mask = 0xffff0000,
512 .pvr_value = 0x000a0000,
514 .cpu_features = CPU_FTRS_604,
515 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
519 .cpu_setup = __setup_cpu_604,
520 .platform = "ppc604",
522 { /* 740/750 (0x4202, don't support TAU ?) */
523 .pvr_mask = 0xffffffff,
524 .pvr_value = 0x00084202,
525 .cpu_name = "740/750",
526 .cpu_features = CPU_FTRS_740_NOTAU,
527 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
531 .cpu_setup = __setup_cpu_750,
532 .platform = "ppc750",
534 { /* 750CX (80100 and 8010x?) */
535 .pvr_mask = 0xfffffff0,
536 .pvr_value = 0x00080100,
538 .cpu_features = CPU_FTRS_750,
539 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
543 .cpu_setup = __setup_cpu_750cx,
544 .platform = "ppc750",
546 { /* 750CX (82201 and 82202) */
547 .pvr_mask = 0xfffffff0,
548 .pvr_value = 0x00082200,
550 .cpu_features = CPU_FTRS_750,
551 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
555 .cpu_setup = __setup_cpu_750cx,
556 .platform = "ppc750",
558 { /* 750CXe (82214) */
559 .pvr_mask = 0xfffffff0,
560 .pvr_value = 0x00082210,
561 .cpu_name = "750CXe",
562 .cpu_features = CPU_FTRS_750,
563 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
567 .cpu_setup = __setup_cpu_750cx,
568 .platform = "ppc750",
570 { /* 750CXe "Gekko" (83214) */
571 .pvr_mask = 0xffffffff,
572 .pvr_value = 0x00083214,
573 .cpu_name = "750CXe",
574 .cpu_features = CPU_FTRS_750,
575 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
579 .cpu_setup = __setup_cpu_750cx,
580 .platform = "ppc750",
583 .pvr_mask = 0xfffff0f0,
584 .pvr_value = 0x00087010,
586 .cpu_features = CPU_FTRS_750CL,
587 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
591 .cpu_setup = __setup_cpu_750,
592 .platform = "ppc750",
595 .pvr_mask = 0xfffff000,
596 .pvr_value = 0x00083000,
597 .cpu_name = "745/755",
598 .cpu_features = CPU_FTRS_750,
599 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
603 .cpu_setup = __setup_cpu_750,
604 .platform = "ppc750",
606 { /* 750FX rev 1.x */
607 .pvr_mask = 0xffffff00,
608 .pvr_value = 0x70000100,
610 .cpu_features = CPU_FTRS_750FX1,
611 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
615 .cpu_setup = __setup_cpu_750,
616 .platform = "ppc750",
618 { /* 750FX rev 2.0 must disable HID0[DPM] */
619 .pvr_mask = 0xffffffff,
620 .pvr_value = 0x70000200,
622 .cpu_features = CPU_FTRS_750FX2,
623 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
627 .cpu_setup = __setup_cpu_750,
628 .platform = "ppc750",
630 { /* 750FX (All revs except 2.0) */
631 .pvr_mask = 0xffff0000,
632 .pvr_value = 0x70000000,
634 .cpu_features = CPU_FTRS_750FX,
635 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
639 .cpu_setup = __setup_cpu_750fx,
640 .platform = "ppc750",
643 .pvr_mask = 0xffff0000,
644 .pvr_value = 0x70020000,
646 .cpu_features = CPU_FTRS_750GX,
647 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
651 .cpu_setup = __setup_cpu_750fx,
652 .platform = "ppc750",
654 { /* 740/750 (L2CR bit need fixup for 740) */
655 .pvr_mask = 0xffff0000,
656 .pvr_value = 0x00080000,
657 .cpu_name = "740/750",
658 .cpu_features = CPU_FTRS_740,
659 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
663 .cpu_setup = __setup_cpu_750,
664 .platform = "ppc750",
666 { /* 7400 rev 1.1 ? (no TAU) */
667 .pvr_mask = 0xffffffff,
668 .pvr_value = 0x000c1101,
669 .cpu_name = "7400 (1.1)",
670 .cpu_features = CPU_FTRS_7400_NOTAU,
671 .cpu_user_features = COMMON_USER |
672 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
676 .cpu_setup = __setup_cpu_7400,
677 .platform = "ppc7400",
680 .pvr_mask = 0xffff0000,
681 .pvr_value = 0x000c0000,
683 .cpu_features = CPU_FTRS_7400,
684 .cpu_user_features = COMMON_USER |
685 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
689 .cpu_setup = __setup_cpu_7400,
690 .platform = "ppc7400",
693 .pvr_mask = 0xffff0000,
694 .pvr_value = 0x800c0000,
696 .cpu_features = CPU_FTRS_7400,
697 .cpu_user_features = COMMON_USER |
698 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
702 .cpu_setup = __setup_cpu_7410,
703 .platform = "ppc7400",
705 { /* 7450 2.0 - no doze/nap */
706 .pvr_mask = 0xffffffff,
707 .pvr_value = 0x80000200,
709 .cpu_features = CPU_FTRS_7450_20,
710 .cpu_user_features = COMMON_USER |
711 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
715 .cpu_setup = __setup_cpu_745x,
716 .oprofile_cpu_type = "ppc/7450",
717 .oprofile_type = PPC_OPROFILE_G4,
718 .platform = "ppc7450",
721 .pvr_mask = 0xffffffff,
722 .pvr_value = 0x80000201,
724 .cpu_features = CPU_FTRS_7450_21,
725 .cpu_user_features = COMMON_USER |
726 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
730 .cpu_setup = __setup_cpu_745x,
731 .oprofile_cpu_type = "ppc/7450",
732 .oprofile_type = PPC_OPROFILE_G4,
733 .platform = "ppc7450",
735 { /* 7450 2.3 and newer */
736 .pvr_mask = 0xffff0000,
737 .pvr_value = 0x80000000,
739 .cpu_features = CPU_FTRS_7450_23,
740 .cpu_user_features = COMMON_USER |
741 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
745 .cpu_setup = __setup_cpu_745x,
746 .oprofile_cpu_type = "ppc/7450",
747 .oprofile_type = PPC_OPROFILE_G4,
748 .platform = "ppc7450",
751 .pvr_mask = 0xffffff00,
752 .pvr_value = 0x80010100,
754 .cpu_features = CPU_FTRS_7455_1,
755 .cpu_user_features = COMMON_USER |
756 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
760 .cpu_setup = __setup_cpu_745x,
761 .oprofile_cpu_type = "ppc/7450",
762 .oprofile_type = PPC_OPROFILE_G4,
763 .platform = "ppc7450",
766 .pvr_mask = 0xffffffff,
767 .pvr_value = 0x80010200,
769 .cpu_features = CPU_FTRS_7455_20,
770 .cpu_user_features = COMMON_USER |
771 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
775 .cpu_setup = __setup_cpu_745x,
776 .oprofile_cpu_type = "ppc/7450",
777 .oprofile_type = PPC_OPROFILE_G4,
778 .platform = "ppc7450",
781 .pvr_mask = 0xffff0000,
782 .pvr_value = 0x80010000,
784 .cpu_features = CPU_FTRS_7455,
785 .cpu_user_features = COMMON_USER |
786 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
790 .cpu_setup = __setup_cpu_745x,
791 .oprofile_cpu_type = "ppc/7450",
792 .oprofile_type = PPC_OPROFILE_G4,
793 .platform = "ppc7450",
795 { /* 7447/7457 Rev 1.0 */
796 .pvr_mask = 0xffffffff,
797 .pvr_value = 0x80020100,
798 .cpu_name = "7447/7457",
799 .cpu_features = CPU_FTRS_7447_10,
800 .cpu_user_features = COMMON_USER |
801 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
805 .cpu_setup = __setup_cpu_745x,
806 .oprofile_cpu_type = "ppc/7450",
807 .oprofile_type = PPC_OPROFILE_G4,
808 .platform = "ppc7450",
810 { /* 7447/7457 Rev 1.1 */
811 .pvr_mask = 0xffffffff,
812 .pvr_value = 0x80020101,
813 .cpu_name = "7447/7457",
814 .cpu_features = CPU_FTRS_7447_10,
815 .cpu_user_features = COMMON_USER |
816 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
820 .cpu_setup = __setup_cpu_745x,
821 .oprofile_cpu_type = "ppc/7450",
822 .oprofile_type = PPC_OPROFILE_G4,
823 .platform = "ppc7450",
825 { /* 7447/7457 Rev 1.2 and later */
826 .pvr_mask = 0xffff0000,
827 .pvr_value = 0x80020000,
828 .cpu_name = "7447/7457",
829 .cpu_features = CPU_FTRS_7447,
830 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
834 .cpu_setup = __setup_cpu_745x,
835 .oprofile_cpu_type = "ppc/7450",
836 .oprofile_type = PPC_OPROFILE_G4,
837 .platform = "ppc7450",
840 .pvr_mask = 0xffff0000,
841 .pvr_value = 0x80030000,
843 .cpu_features = CPU_FTRS_7447A,
844 .cpu_user_features = COMMON_USER |
845 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
849 .cpu_setup = __setup_cpu_745x,
850 .oprofile_cpu_type = "ppc/7450",
851 .oprofile_type = PPC_OPROFILE_G4,
852 .platform = "ppc7450",
855 .pvr_mask = 0xffff0000,
856 .pvr_value = 0x80040000,
858 .cpu_features = CPU_FTRS_7448,
859 .cpu_user_features = COMMON_USER |
860 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
864 .cpu_setup = __setup_cpu_745x,
865 .oprofile_cpu_type = "ppc/7450",
866 .oprofile_type = PPC_OPROFILE_G4,
867 .platform = "ppc7450",
869 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
870 .pvr_mask = 0x7fff0000,
871 .pvr_value = 0x00810000,
873 .cpu_features = CPU_FTRS_82XX,
874 .cpu_user_features = COMMON_USER,
877 .cpu_setup = __setup_cpu_603,
878 .platform = "ppc603",
880 { /* All G2_LE (603e core, plus some) have the same pvr */
881 .pvr_mask = 0x7fff0000,
882 .pvr_value = 0x00820000,
884 .cpu_features = CPU_FTRS_G2_LE,
885 .cpu_user_features = COMMON_USER,
888 .cpu_setup = __setup_cpu_603,
889 .platform = "ppc603",
891 { /* e300c1 (a 603e core, plus some) on 83xx */
892 .pvr_mask = 0x7fff0000,
893 .pvr_value = 0x00830000,
894 .cpu_name = "e300c1",
895 .cpu_features = CPU_FTRS_E300,
896 .cpu_user_features = COMMON_USER,
899 .cpu_setup = __setup_cpu_603,
900 .platform = "ppc603",
902 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
903 .pvr_mask = 0x7fff0000,
904 .pvr_value = 0x00840000,
905 .cpu_name = "e300c2",
906 .cpu_features = CPU_FTRS_E300C2,
907 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
910 .cpu_setup = __setup_cpu_603,
911 .platform = "ppc603",
913 { /* e300c3 on 83xx */
914 .pvr_mask = 0x7fff0000,
915 .pvr_value = 0x00850000,
916 .cpu_name = "e300c3",
917 .cpu_features = CPU_FTRS_E300,
918 .cpu_user_features = COMMON_USER,
921 .cpu_setup = __setup_cpu_603,
922 .platform = "ppc603",
924 { /* default match, we assume split I/D cache & TB (non-601)... */
925 .pvr_mask = 0x00000000,
926 .pvr_value = 0x00000000,
927 .cpu_name = "(generic PPC)",
928 .cpu_features = CPU_FTRS_CLASSIC32,
929 .cpu_user_features = COMMON_USER,
932 .platform = "ppc603",
934 #endif /* CLASSIC_PPC */
937 .pvr_mask = 0xffff0000,
938 .pvr_value = 0x00500000,
940 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
941 * if the 8xx code is there.... */
942 .cpu_features = CPU_FTRS_8XX,
943 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
946 .platform = "ppc823",
948 #endif /* CONFIG_8xx */
951 .pvr_mask = 0xffffff00,
952 .pvr_value = 0x00200200,
954 .cpu_features = CPU_FTRS_40X,
955 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
958 .platform = "ppc403",
961 .pvr_mask = 0xffffff00,
962 .pvr_value = 0x00201400,
963 .cpu_name = "403GCX",
964 .cpu_features = CPU_FTRS_40X,
965 .cpu_user_features = PPC_FEATURE_32 |
966 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
969 .platform = "ppc403",
972 .pvr_mask = 0xffff0000,
973 .pvr_value = 0x00200000,
974 .cpu_name = "403G ??",
975 .cpu_features = CPU_FTRS_40X,
976 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
979 .platform = "ppc403",
982 .pvr_mask = 0xffff0000,
983 .pvr_value = 0x40110000,
985 .cpu_features = CPU_FTRS_40X,
986 .cpu_user_features = PPC_FEATURE_32 |
987 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
990 .platform = "ppc405",
993 .pvr_mask = 0xffff0000,
994 .pvr_value = 0x40130000,
995 .cpu_name = "STB03xxx",
996 .cpu_features = CPU_FTRS_40X,
997 .cpu_user_features = PPC_FEATURE_32 |
998 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1001 .platform = "ppc405",
1004 .pvr_mask = 0xffff0000,
1005 .pvr_value = 0x41810000,
1006 .cpu_name = "STB04xxx",
1007 .cpu_features = CPU_FTRS_40X,
1008 .cpu_user_features = PPC_FEATURE_32 |
1009 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1012 .platform = "ppc405",
1015 .pvr_mask = 0xffff0000,
1016 .pvr_value = 0x41610000,
1017 .cpu_name = "NP405L",
1018 .cpu_features = CPU_FTRS_40X,
1019 .cpu_user_features = PPC_FEATURE_32 |
1020 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1023 .platform = "ppc405",
1026 .pvr_mask = 0xffff0000,
1027 .pvr_value = 0x40B10000,
1028 .cpu_name = "NP4GS3",
1029 .cpu_features = CPU_FTRS_40X,
1030 .cpu_user_features = PPC_FEATURE_32 |
1031 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1034 .platform = "ppc405",
1037 .pvr_mask = 0xffff0000,
1038 .pvr_value = 0x41410000,
1039 .cpu_name = "NP405H",
1040 .cpu_features = CPU_FTRS_40X,
1041 .cpu_user_features = PPC_FEATURE_32 |
1042 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1045 .platform = "ppc405",
1048 .pvr_mask = 0xffff0000,
1049 .pvr_value = 0x50910000,
1050 .cpu_name = "405GPr",
1051 .cpu_features = CPU_FTRS_40X,
1052 .cpu_user_features = PPC_FEATURE_32 |
1053 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1056 .platform = "ppc405",
1059 .pvr_mask = 0xffff0000,
1060 .pvr_value = 0x51510000,
1061 .cpu_name = "STBx25xx",
1062 .cpu_features = CPU_FTRS_40X,
1063 .cpu_user_features = PPC_FEATURE_32 |
1064 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1067 .platform = "ppc405",
1070 .pvr_mask = 0xffff0000,
1071 .pvr_value = 0x41F10000,
1072 .cpu_name = "405LP",
1073 .cpu_features = CPU_FTRS_40X,
1074 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1077 .platform = "ppc405",
1079 { /* Xilinx Virtex-II Pro */
1080 .pvr_mask = 0xfffff000,
1081 .pvr_value = 0x20010000,
1082 .cpu_name = "Virtex-II Pro",
1083 .cpu_features = CPU_FTRS_40X,
1084 .cpu_user_features = PPC_FEATURE_32 |
1085 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1088 .platform = "ppc405",
1090 { /* Xilinx Virtex-4 FX */
1091 .pvr_mask = 0xfffff000,
1092 .pvr_value = 0x20011000,
1093 .cpu_name = "Virtex-4 FX",
1094 .cpu_features = CPU_FTRS_40X,
1095 .cpu_user_features = PPC_FEATURE_32 |
1096 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1099 .platform = "ppc405",
1102 .pvr_mask = 0xffff0000,
1103 .pvr_value = 0x51210000,
1104 .cpu_name = "405EP",
1105 .cpu_features = CPU_FTRS_40X,
1106 .cpu_user_features = PPC_FEATURE_32 |
1107 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1110 .platform = "ppc405",
1113 #endif /* CONFIG_40x */
1116 .pvr_mask = 0xf0000fff,
1117 .pvr_value = 0x40000850,
1118 .cpu_name = "440EP Rev. A",
1119 .cpu_features = CPU_FTRS_44X,
1120 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1123 .platform = "ppc440",
1126 .pvr_mask = 0xf0000fff,
1127 .pvr_value = 0x400008d3,
1128 .cpu_name = "440EP Rev. B",
1129 .cpu_features = CPU_FTRS_44X,
1130 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1133 .platform = "ppc440",
1135 { /* 440GP Rev. B */
1136 .pvr_mask = 0xf0000fff,
1137 .pvr_value = 0x40000440,
1138 .cpu_name = "440GP Rev. B",
1139 .cpu_features = CPU_FTRS_44X,
1140 .cpu_user_features = COMMON_USER_BOOKE,
1143 .platform = "ppc440gp",
1145 { /* 440GP Rev. C */
1146 .pvr_mask = 0xf0000fff,
1147 .pvr_value = 0x40000481,
1148 .cpu_name = "440GP Rev. C",
1149 .cpu_features = CPU_FTRS_44X,
1150 .cpu_user_features = COMMON_USER_BOOKE,
1153 .platform = "ppc440gp",
1155 { /* 440GX Rev. A */
1156 .pvr_mask = 0xf0000fff,
1157 .pvr_value = 0x50000850,
1158 .cpu_name = "440GX Rev. A",
1159 .cpu_features = CPU_FTRS_44X,
1160 .cpu_user_features = COMMON_USER_BOOKE,
1163 .platform = "ppc440",
1165 { /* 440GX Rev. B */
1166 .pvr_mask = 0xf0000fff,
1167 .pvr_value = 0x50000851,
1168 .cpu_name = "440GX Rev. B",
1169 .cpu_features = CPU_FTRS_44X,
1170 .cpu_user_features = COMMON_USER_BOOKE,
1173 .platform = "ppc440",
1175 { /* 440GX Rev. C */
1176 .pvr_mask = 0xf0000fff,
1177 .pvr_value = 0x50000892,
1178 .cpu_name = "440GX Rev. C",
1179 .cpu_features = CPU_FTRS_44X,
1180 .cpu_user_features = COMMON_USER_BOOKE,
1183 .platform = "ppc440",
1185 { /* 440GX Rev. F */
1186 .pvr_mask = 0xf0000fff,
1187 .pvr_value = 0x50000894,
1188 .cpu_name = "440GX Rev. F",
1189 .cpu_features = CPU_FTRS_44X,
1190 .cpu_user_features = COMMON_USER_BOOKE,
1193 .platform = "ppc440",
1195 { /* 440SP Rev. A */
1196 .pvr_mask = 0xfff00fff,
1197 .pvr_value = 0x53200891,
1198 .cpu_name = "440SP Rev. A",
1199 .cpu_features = CPU_FTRS_44X,
1200 .cpu_user_features = COMMON_USER_BOOKE,
1203 .platform = "ppc440",
1205 { /* 440SPe Rev. A */
1206 .pvr_mask = 0xfff00fff,
1207 .pvr_value = 0x53400890,
1208 .cpu_name = "440SPe Rev. A",
1209 .cpu_features = CPU_FTRS_44X,
1210 .cpu_user_features = COMMON_USER_BOOKE,
1213 .platform = "ppc440",
1215 { /* 440SPe Rev. B */
1216 .pvr_mask = 0xfff00fff,
1217 .pvr_value = 0x53400891,
1218 .cpu_name = "440SPe Rev. B",
1219 .cpu_features = CPU_FTRS_44X,
1220 .cpu_user_features = COMMON_USER_BOOKE,
1223 .platform = "ppc440",
1225 #endif /* CONFIG_44x */
1226 #ifdef CONFIG_FSL_BOOKE
1228 .pvr_mask = 0xfff00000,
1229 .pvr_value = 0x81000000,
1230 .cpu_name = "e200z5",
1231 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1232 .cpu_features = CPU_FTRS_E200,
1233 .cpu_user_features = COMMON_USER_BOOKE |
1234 PPC_FEATURE_HAS_EFP_SINGLE |
1235 PPC_FEATURE_UNIFIED_CACHE,
1237 .platform = "ppc5554",
1240 .pvr_mask = 0xfff00000,
1241 .pvr_value = 0x81100000,
1242 .cpu_name = "e200z6",
1243 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1244 .cpu_features = CPU_FTRS_E200,
1245 .cpu_user_features = COMMON_USER_BOOKE |
1246 PPC_FEATURE_SPE_COMP |
1247 PPC_FEATURE_HAS_EFP_SINGLE |
1248 PPC_FEATURE_UNIFIED_CACHE,
1250 .platform = "ppc5554",
1253 .pvr_mask = 0xffff0000,
1254 .pvr_value = 0x80200000,
1256 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1257 .cpu_features = CPU_FTRS_E500,
1258 .cpu_user_features = COMMON_USER_BOOKE |
1259 PPC_FEATURE_SPE_COMP |
1260 PPC_FEATURE_HAS_EFP_SINGLE,
1264 .oprofile_cpu_type = "ppc/e500",
1265 .oprofile_type = PPC_OPROFILE_BOOKE,
1266 .platform = "ppc8540",
1269 .pvr_mask = 0xffff0000,
1270 .pvr_value = 0x80210000,
1271 .cpu_name = "e500v2",
1272 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1273 .cpu_features = CPU_FTRS_E500_2,
1274 .cpu_user_features = COMMON_USER_BOOKE |
1275 PPC_FEATURE_SPE_COMP |
1276 PPC_FEATURE_HAS_EFP_SINGLE |
1277 PPC_FEATURE_HAS_EFP_DOUBLE,
1281 .oprofile_cpu_type = "ppc/e500",
1282 .oprofile_type = PPC_OPROFILE_BOOKE,
1283 .platform = "ppc8548",
1287 { /* default match */
1288 .pvr_mask = 0x00000000,
1289 .pvr_value = 0x00000000,
1290 .cpu_name = "(generic PPC)",
1291 .cpu_features = CPU_FTRS_GENERIC_32,
1292 .cpu_user_features = PPC_FEATURE_32,
1295 .platform = "powerpc",
1297 #endif /* !CLASSIC_PPC */
1298 #endif /* CONFIG_PPC32 */
1301 struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1303 struct cpu_spec *s = cpu_specs;
1304 struct cpu_spec **cur = &cur_cpu_spec;
1308 cur = PTRRELOC(cur);
1310 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1311 if ((pvr & s->pvr_mask) == s->pvr_value) {
1312 *cur = cpu_specs + i;
1314 /* ppc64 expects identify_cpu to also call setup_cpu
1315 * for that processor. I will consolidate that at a
1316 * later time, for now, just use our friend #ifdef.
1317 * we also don't need to PTRRELOC the function pointer
1318 * on ppc64 as we are running at 0 in real mode.
1321 s->cpu_setup(offset, s);
1323 #endif /* CONFIG_PPC64 */
1330 void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1332 struct fixup_entry {
1334 unsigned long value;
1342 for (; fcur < fend; fcur++) {
1343 unsigned int *pstart, *pend, *p;
1345 if ((value & fcur->mask) == fcur->value)
1348 /* These PTRRELOCs will disappear once the new scheme for
1349 * modules and vdso is implemented
1351 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1352 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1354 for (p = pstart; p < pend; p++) {
1356 asm volatile ("dcbst 0, %0" : : "r" (p));
1358 asm volatile ("sync" : : : "memory");
1359 for (p = pstart; p < pend; p++)
1360 asm volatile ("icbi 0,%0" : : "r" (p));
1361 asm volatile ("sync; isync" : : : "memory");