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",
229 .pvr_mask = 0xffff0000,
230 .pvr_value = 0x00440000,
231 .cpu_name = "PPC970MP",
232 .cpu_features = CPU_FTRS_PPC970,
233 .cpu_user_features = COMMON_USER_POWER4 |
234 PPC_FEATURE_HAS_ALTIVEC_COMP,
238 .cpu_setup = __setup_cpu_ppc970MP,
239 .cpu_restore = __restore_cpu_ppc970,
240 .oprofile_cpu_type = "ppc64/970MP",
241 .oprofile_type = PPC_OPROFILE_POWER4,
242 .platform = "ppc970",
245 .pvr_mask = 0xffff0000,
246 .pvr_value = 0x00450000,
247 .cpu_name = "PPC970GX",
248 .cpu_features = CPU_FTRS_PPC970,
249 .cpu_user_features = COMMON_USER_POWER4 |
250 PPC_FEATURE_HAS_ALTIVEC_COMP,
254 .pmc_type = PPC_PMC_IBM,
255 .cpu_setup = __setup_cpu_ppc970,
256 .oprofile_cpu_type = "ppc64/970",
257 .oprofile_type = PPC_OPROFILE_POWER4,
258 .platform = "ppc970",
261 .pvr_mask = 0xffff0000,
262 .pvr_value = 0x003a0000,
263 .cpu_name = "POWER5 (gr)",
264 .cpu_features = CPU_FTRS_POWER5,
265 .cpu_user_features = COMMON_USER_POWER5,
269 .pmc_type = PPC_PMC_IBM,
270 .oprofile_cpu_type = "ppc64/power5",
271 .oprofile_type = PPC_OPROFILE_POWER4,
272 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
273 * and above but only works on POWER5 and above
275 .oprofile_mmcra_sihv = MMCRA_SIHV,
276 .oprofile_mmcra_sipr = MMCRA_SIPR,
277 .platform = "power5",
280 .pvr_mask = 0xffff0000,
281 .pvr_value = 0x003b0000,
282 .cpu_name = "POWER5+ (gs)",
283 .cpu_features = CPU_FTRS_POWER5,
284 .cpu_user_features = COMMON_USER_POWER5_PLUS,
288 .pmc_type = PPC_PMC_IBM,
289 .oprofile_cpu_type = "ppc64/power5+",
290 .oprofile_type = PPC_OPROFILE_POWER4,
291 .oprofile_mmcra_sihv = MMCRA_SIHV,
292 .oprofile_mmcra_sipr = MMCRA_SIPR,
293 .platform = "power5+",
295 { /* POWER6 in P5+ mode; 2.04-compliant processor */
296 .pvr_mask = 0xffffffff,
297 .pvr_value = 0x0f000001,
298 .cpu_name = "POWER5+",
299 .cpu_features = CPU_FTRS_POWER5,
300 .cpu_user_features = COMMON_USER_POWER5_PLUS,
304 .oprofile_cpu_type = "ppc64/power6",
305 .oprofile_type = PPC_OPROFILE_POWER4,
306 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
307 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
308 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
310 .platform = "power5+",
313 .pvr_mask = 0xffff0000,
314 .pvr_value = 0x003e0000,
315 .cpu_name = "POWER6 (raw)",
316 .cpu_features = CPU_FTRS_POWER6,
317 .cpu_user_features = COMMON_USER_POWER6 |
318 PPC_FEATURE_POWER6_EXT,
322 .oprofile_cpu_type = "ppc64/power6",
323 .oprofile_type = PPC_OPROFILE_POWER4,
324 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
325 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
326 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
328 .platform = "power6x",
330 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
331 .pvr_mask = 0xffffffff,
332 .pvr_value = 0x0f000002,
333 .cpu_name = "POWER6 (architected)",
334 .cpu_features = CPU_FTRS_POWER6,
335 .cpu_user_features = COMMON_USER_POWER6,
339 .pmc_type = PPC_PMC_IBM,
340 .oprofile_cpu_type = "ppc64/power6",
341 .oprofile_type = PPC_OPROFILE_POWER4,
342 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
343 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
344 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
346 .platform = "power6",
348 { /* Cell Broadband Engine */
349 .pvr_mask = 0xffff0000,
350 .pvr_value = 0x00700000,
351 .cpu_name = "Cell Broadband Engine",
352 .cpu_features = CPU_FTRS_CELL,
353 .cpu_user_features = COMMON_USER_PPC64 |
354 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
359 .pmc_type = PPC_PMC_IBM,
360 .oprofile_cpu_type = "ppc64/cell-be",
361 .oprofile_type = PPC_OPROFILE_CELL,
362 .platform = "ppc-cell-be",
365 .pvr_mask = 0x7fff0000,
366 .pvr_value = 0x00900000,
368 .cpu_features = CPU_FTRS_PA6T,
369 .cpu_user_features = COMMON_USER_PA6T,
373 .pmc_type = PPC_PMC_PA6T,
374 .cpu_setup = __setup_cpu_pa6t,
375 .cpu_restore = __restore_cpu_pa6t,
378 { /* default match */
379 .pvr_mask = 0x00000000,
380 .pvr_value = 0x00000000,
381 .cpu_name = "POWER4 (compatible)",
382 .cpu_features = CPU_FTRS_COMPATIBLE,
383 .cpu_user_features = COMMON_USER_PPC64,
387 .pmc_type = PPC_PMC_IBM,
388 .platform = "power4",
390 #endif /* CONFIG_PPC64 */
394 .pvr_mask = 0xffff0000,
395 .pvr_value = 0x00010000,
397 .cpu_features = CPU_FTRS_PPC601,
398 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
399 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
402 .platform = "ppc601",
405 .pvr_mask = 0xffff0000,
406 .pvr_value = 0x00030000,
408 .cpu_features = CPU_FTRS_603,
409 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
412 .cpu_setup = __setup_cpu_603,
413 .platform = "ppc603",
416 .pvr_mask = 0xffff0000,
417 .pvr_value = 0x00060000,
419 .cpu_features = CPU_FTRS_603,
420 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
423 .cpu_setup = __setup_cpu_603,
424 .platform = "ppc603",
427 .pvr_mask = 0xffff0000,
428 .pvr_value = 0x00070000,
430 .cpu_features = CPU_FTRS_603,
431 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
434 .cpu_setup = __setup_cpu_603,
435 .platform = "ppc603",
438 .pvr_mask = 0xffff0000,
439 .pvr_value = 0x00040000,
441 .cpu_features = CPU_FTRS_604,
442 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
446 .cpu_setup = __setup_cpu_604,
447 .platform = "ppc604",
450 .pvr_mask = 0xfffff000,
451 .pvr_value = 0x00090000,
453 .cpu_features = CPU_FTRS_604,
454 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
458 .cpu_setup = __setup_cpu_604,
459 .platform = "ppc604",
462 .pvr_mask = 0xffff0000,
463 .pvr_value = 0x00090000,
465 .cpu_features = CPU_FTRS_604,
466 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
470 .cpu_setup = __setup_cpu_604,
471 .platform = "ppc604",
474 .pvr_mask = 0xffff0000,
475 .pvr_value = 0x000a0000,
477 .cpu_features = CPU_FTRS_604,
478 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
482 .cpu_setup = __setup_cpu_604,
483 .platform = "ppc604",
485 { /* 740/750 (0x4202, don't support TAU ?) */
486 .pvr_mask = 0xffffffff,
487 .pvr_value = 0x00084202,
488 .cpu_name = "740/750",
489 .cpu_features = CPU_FTRS_740_NOTAU,
490 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
494 .cpu_setup = __setup_cpu_750,
495 .platform = "ppc750",
497 { /* 750CX (80100 and 8010x?) */
498 .pvr_mask = 0xfffffff0,
499 .pvr_value = 0x00080100,
501 .cpu_features = CPU_FTRS_750,
502 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
506 .cpu_setup = __setup_cpu_750cx,
507 .platform = "ppc750",
509 { /* 750CX (82201 and 82202) */
510 .pvr_mask = 0xfffffff0,
511 .pvr_value = 0x00082200,
513 .cpu_features = CPU_FTRS_750,
514 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
518 .cpu_setup = __setup_cpu_750cx,
519 .platform = "ppc750",
521 { /* 750CXe (82214) */
522 .pvr_mask = 0xfffffff0,
523 .pvr_value = 0x00082210,
524 .cpu_name = "750CXe",
525 .cpu_features = CPU_FTRS_750,
526 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
530 .cpu_setup = __setup_cpu_750cx,
531 .platform = "ppc750",
533 { /* 750CXe "Gekko" (83214) */
534 .pvr_mask = 0xffffffff,
535 .pvr_value = 0x00083214,
536 .cpu_name = "750CXe",
537 .cpu_features = CPU_FTRS_750,
538 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
542 .cpu_setup = __setup_cpu_750cx,
543 .platform = "ppc750",
546 .pvr_mask = 0xfffff000,
547 .pvr_value = 0x00083000,
548 .cpu_name = "745/755",
549 .cpu_features = CPU_FTRS_750,
550 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
554 .cpu_setup = __setup_cpu_750,
555 .platform = "ppc750",
557 { /* 750FX rev 1.x */
558 .pvr_mask = 0xffffff00,
559 .pvr_value = 0x70000100,
561 .cpu_features = CPU_FTRS_750FX1,
562 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
566 .cpu_setup = __setup_cpu_750,
567 .platform = "ppc750",
569 { /* 750FX rev 2.0 must disable HID0[DPM] */
570 .pvr_mask = 0xffffffff,
571 .pvr_value = 0x70000200,
573 .cpu_features = CPU_FTRS_750FX2,
574 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
578 .cpu_setup = __setup_cpu_750,
579 .platform = "ppc750",
581 { /* 750FX (All revs except 2.0) */
582 .pvr_mask = 0xffff0000,
583 .pvr_value = 0x70000000,
585 .cpu_features = CPU_FTRS_750FX,
586 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
590 .cpu_setup = __setup_cpu_750fx,
591 .platform = "ppc750",
594 .pvr_mask = 0xffff0000,
595 .pvr_value = 0x70020000,
597 .cpu_features = CPU_FTRS_750GX,
598 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
602 .cpu_setup = __setup_cpu_750fx,
603 .platform = "ppc750",
605 { /* 740/750 (L2CR bit need fixup for 740) */
606 .pvr_mask = 0xffff0000,
607 .pvr_value = 0x00080000,
608 .cpu_name = "740/750",
609 .cpu_features = CPU_FTRS_740,
610 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
614 .cpu_setup = __setup_cpu_750,
615 .platform = "ppc750",
617 { /* 7400 rev 1.1 ? (no TAU) */
618 .pvr_mask = 0xffffffff,
619 .pvr_value = 0x000c1101,
620 .cpu_name = "7400 (1.1)",
621 .cpu_features = CPU_FTRS_7400_NOTAU,
622 .cpu_user_features = COMMON_USER |
623 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
627 .cpu_setup = __setup_cpu_7400,
628 .platform = "ppc7400",
631 .pvr_mask = 0xffff0000,
632 .pvr_value = 0x000c0000,
634 .cpu_features = CPU_FTRS_7400,
635 .cpu_user_features = COMMON_USER |
636 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
640 .cpu_setup = __setup_cpu_7400,
641 .platform = "ppc7400",
644 .pvr_mask = 0xffff0000,
645 .pvr_value = 0x800c0000,
647 .cpu_features = CPU_FTRS_7400,
648 .cpu_user_features = COMMON_USER |
649 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
653 .cpu_setup = __setup_cpu_7410,
654 .platform = "ppc7400",
656 { /* 7450 2.0 - no doze/nap */
657 .pvr_mask = 0xffffffff,
658 .pvr_value = 0x80000200,
660 .cpu_features = CPU_FTRS_7450_20,
661 .cpu_user_features = COMMON_USER |
662 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
666 .cpu_setup = __setup_cpu_745x,
667 .oprofile_cpu_type = "ppc/7450",
668 .oprofile_type = PPC_OPROFILE_G4,
669 .platform = "ppc7450",
672 .pvr_mask = 0xffffffff,
673 .pvr_value = 0x80000201,
675 .cpu_features = CPU_FTRS_7450_21,
676 .cpu_user_features = COMMON_USER |
677 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
681 .cpu_setup = __setup_cpu_745x,
682 .oprofile_cpu_type = "ppc/7450",
683 .oprofile_type = PPC_OPROFILE_G4,
684 .platform = "ppc7450",
686 { /* 7450 2.3 and newer */
687 .pvr_mask = 0xffff0000,
688 .pvr_value = 0x80000000,
690 .cpu_features = CPU_FTRS_7450_23,
691 .cpu_user_features = COMMON_USER |
692 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
696 .cpu_setup = __setup_cpu_745x,
697 .oprofile_cpu_type = "ppc/7450",
698 .oprofile_type = PPC_OPROFILE_G4,
699 .platform = "ppc7450",
702 .pvr_mask = 0xffffff00,
703 .pvr_value = 0x80010100,
705 .cpu_features = CPU_FTRS_7455_1,
706 .cpu_user_features = COMMON_USER |
707 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
711 .cpu_setup = __setup_cpu_745x,
712 .oprofile_cpu_type = "ppc/7450",
713 .oprofile_type = PPC_OPROFILE_G4,
714 .platform = "ppc7450",
717 .pvr_mask = 0xffffffff,
718 .pvr_value = 0x80010200,
720 .cpu_features = CPU_FTRS_7455_20,
721 .cpu_user_features = COMMON_USER |
722 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
726 .cpu_setup = __setup_cpu_745x,
727 .oprofile_cpu_type = "ppc/7450",
728 .oprofile_type = PPC_OPROFILE_G4,
729 .platform = "ppc7450",
732 .pvr_mask = 0xffff0000,
733 .pvr_value = 0x80010000,
735 .cpu_features = CPU_FTRS_7455,
736 .cpu_user_features = COMMON_USER |
737 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
741 .cpu_setup = __setup_cpu_745x,
742 .oprofile_cpu_type = "ppc/7450",
743 .oprofile_type = PPC_OPROFILE_G4,
744 .platform = "ppc7450",
746 { /* 7447/7457 Rev 1.0 */
747 .pvr_mask = 0xffffffff,
748 .pvr_value = 0x80020100,
749 .cpu_name = "7447/7457",
750 .cpu_features = CPU_FTRS_7447_10,
751 .cpu_user_features = COMMON_USER |
752 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
756 .cpu_setup = __setup_cpu_745x,
757 .oprofile_cpu_type = "ppc/7450",
758 .oprofile_type = PPC_OPROFILE_G4,
759 .platform = "ppc7450",
761 { /* 7447/7457 Rev 1.1 */
762 .pvr_mask = 0xffffffff,
763 .pvr_value = 0x80020101,
764 .cpu_name = "7447/7457",
765 .cpu_features = CPU_FTRS_7447_10,
766 .cpu_user_features = COMMON_USER |
767 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
771 .cpu_setup = __setup_cpu_745x,
772 .oprofile_cpu_type = "ppc/7450",
773 .oprofile_type = PPC_OPROFILE_G4,
774 .platform = "ppc7450",
776 { /* 7447/7457 Rev 1.2 and later */
777 .pvr_mask = 0xffff0000,
778 .pvr_value = 0x80020000,
779 .cpu_name = "7447/7457",
780 .cpu_features = CPU_FTRS_7447,
781 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
785 .cpu_setup = __setup_cpu_745x,
786 .oprofile_cpu_type = "ppc/7450",
787 .oprofile_type = PPC_OPROFILE_G4,
788 .platform = "ppc7450",
791 .pvr_mask = 0xffff0000,
792 .pvr_value = 0x80030000,
794 .cpu_features = CPU_FTRS_7447A,
795 .cpu_user_features = COMMON_USER |
796 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
800 .cpu_setup = __setup_cpu_745x,
801 .oprofile_cpu_type = "ppc/7450",
802 .oprofile_type = PPC_OPROFILE_G4,
803 .platform = "ppc7450",
806 .pvr_mask = 0xffff0000,
807 .pvr_value = 0x80040000,
809 .cpu_features = CPU_FTRS_7447A,
810 .cpu_user_features = COMMON_USER |
811 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
815 .cpu_setup = __setup_cpu_745x,
816 .oprofile_cpu_type = "ppc/7450",
817 .oprofile_type = PPC_OPROFILE_G4,
818 .platform = "ppc7450",
820 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
821 .pvr_mask = 0x7fff0000,
822 .pvr_value = 0x00810000,
824 .cpu_features = CPU_FTRS_82XX,
825 .cpu_user_features = COMMON_USER,
828 .cpu_setup = __setup_cpu_603,
829 .platform = "ppc603",
831 { /* All G2_LE (603e core, plus some) have the same pvr */
832 .pvr_mask = 0x7fff0000,
833 .pvr_value = 0x00820000,
835 .cpu_features = CPU_FTRS_G2_LE,
836 .cpu_user_features = COMMON_USER,
839 .cpu_setup = __setup_cpu_603,
840 .platform = "ppc603",
842 { /* e300c1 (a 603e core, plus some) on 83xx */
843 .pvr_mask = 0x7fff0000,
844 .pvr_value = 0x00830000,
845 .cpu_name = "e300c1",
846 .cpu_features = CPU_FTRS_E300,
847 .cpu_user_features = COMMON_USER,
850 .cpu_setup = __setup_cpu_603,
851 .platform = "ppc603",
853 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
854 .pvr_mask = 0x7fff0000,
855 .pvr_value = 0x00840000,
856 .cpu_name = "e300c2",
857 .cpu_features = CPU_FTRS_E300C2,
858 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
861 .cpu_setup = __setup_cpu_603,
862 .platform = "ppc603",
864 { /* e300c3 on 83xx */
865 .pvr_mask = 0x7fff0000,
866 .pvr_value = 0x00850000,
867 .cpu_name = "e300c3",
868 .cpu_features = CPU_FTRS_E300,
869 .cpu_user_features = COMMON_USER,
872 .cpu_setup = __setup_cpu_603,
873 .platform = "ppc603",
875 { /* default match, we assume split I/D cache & TB (non-601)... */
876 .pvr_mask = 0x00000000,
877 .pvr_value = 0x00000000,
878 .cpu_name = "(generic PPC)",
879 .cpu_features = CPU_FTRS_CLASSIC32,
880 .cpu_user_features = COMMON_USER,
883 .platform = "ppc603",
885 #endif /* CLASSIC_PPC */
888 .pvr_mask = 0xffff0000,
889 .pvr_value = 0x00500000,
891 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
892 * if the 8xx code is there.... */
893 .cpu_features = CPU_FTRS_8XX,
894 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
897 .platform = "ppc823",
899 #endif /* CONFIG_8xx */
902 .pvr_mask = 0xffffff00,
903 .pvr_value = 0x00200200,
905 .cpu_features = CPU_FTRS_40X,
906 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
909 .platform = "ppc403",
912 .pvr_mask = 0xffffff00,
913 .pvr_value = 0x00201400,
914 .cpu_name = "403GCX",
915 .cpu_features = CPU_FTRS_40X,
916 .cpu_user_features = PPC_FEATURE_32 |
917 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
920 .platform = "ppc403",
923 .pvr_mask = 0xffff0000,
924 .pvr_value = 0x00200000,
925 .cpu_name = "403G ??",
926 .cpu_features = CPU_FTRS_40X,
927 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
930 .platform = "ppc403",
933 .pvr_mask = 0xffff0000,
934 .pvr_value = 0x40110000,
936 .cpu_features = CPU_FTRS_40X,
937 .cpu_user_features = PPC_FEATURE_32 |
938 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
941 .platform = "ppc405",
944 .pvr_mask = 0xffff0000,
945 .pvr_value = 0x40130000,
946 .cpu_name = "STB03xxx",
947 .cpu_features = CPU_FTRS_40X,
948 .cpu_user_features = PPC_FEATURE_32 |
949 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
952 .platform = "ppc405",
955 .pvr_mask = 0xffff0000,
956 .pvr_value = 0x41810000,
957 .cpu_name = "STB04xxx",
958 .cpu_features = CPU_FTRS_40X,
959 .cpu_user_features = PPC_FEATURE_32 |
960 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
963 .platform = "ppc405",
966 .pvr_mask = 0xffff0000,
967 .pvr_value = 0x41610000,
968 .cpu_name = "NP405L",
969 .cpu_features = CPU_FTRS_40X,
970 .cpu_user_features = PPC_FEATURE_32 |
971 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
974 .platform = "ppc405",
977 .pvr_mask = 0xffff0000,
978 .pvr_value = 0x40B10000,
979 .cpu_name = "NP4GS3",
980 .cpu_features = CPU_FTRS_40X,
981 .cpu_user_features = PPC_FEATURE_32 |
982 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
985 .platform = "ppc405",
988 .pvr_mask = 0xffff0000,
989 .pvr_value = 0x41410000,
990 .cpu_name = "NP405H",
991 .cpu_features = CPU_FTRS_40X,
992 .cpu_user_features = PPC_FEATURE_32 |
993 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
996 .platform = "ppc405",
999 .pvr_mask = 0xffff0000,
1000 .pvr_value = 0x50910000,
1001 .cpu_name = "405GPr",
1002 .cpu_features = CPU_FTRS_40X,
1003 .cpu_user_features = PPC_FEATURE_32 |
1004 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1007 .platform = "ppc405",
1010 .pvr_mask = 0xffff0000,
1011 .pvr_value = 0x51510000,
1012 .cpu_name = "STBx25xx",
1013 .cpu_features = CPU_FTRS_40X,
1014 .cpu_user_features = PPC_FEATURE_32 |
1015 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1018 .platform = "ppc405",
1021 .pvr_mask = 0xffff0000,
1022 .pvr_value = 0x41F10000,
1023 .cpu_name = "405LP",
1024 .cpu_features = CPU_FTRS_40X,
1025 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1028 .platform = "ppc405",
1030 { /* Xilinx Virtex-II Pro */
1031 .pvr_mask = 0xfffff000,
1032 .pvr_value = 0x20010000,
1033 .cpu_name = "Virtex-II Pro",
1034 .cpu_features = CPU_FTRS_40X,
1035 .cpu_user_features = PPC_FEATURE_32 |
1036 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1039 .platform = "ppc405",
1041 { /* Xilinx Virtex-4 FX */
1042 .pvr_mask = 0xfffff000,
1043 .pvr_value = 0x20011000,
1044 .cpu_name = "Virtex-4 FX",
1045 .cpu_features = CPU_FTRS_40X,
1046 .cpu_user_features = PPC_FEATURE_32 |
1047 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1050 .platform = "ppc405",
1053 .pvr_mask = 0xffff0000,
1054 .pvr_value = 0x51210000,
1055 .cpu_name = "405EP",
1056 .cpu_features = CPU_FTRS_40X,
1057 .cpu_user_features = PPC_FEATURE_32 |
1058 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1061 .platform = "ppc405",
1064 #endif /* CONFIG_40x */
1067 .pvr_mask = 0xf0000fff,
1068 .pvr_value = 0x40000850,
1069 .cpu_name = "440EP Rev. A",
1070 .cpu_features = CPU_FTRS_44X,
1071 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1074 .platform = "ppc440",
1077 .pvr_mask = 0xf0000fff,
1078 .pvr_value = 0x400008d3,
1079 .cpu_name = "440EP Rev. B",
1080 .cpu_features = CPU_FTRS_44X,
1081 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1084 .platform = "ppc440",
1086 { /* 440GP Rev. B */
1087 .pvr_mask = 0xf0000fff,
1088 .pvr_value = 0x40000440,
1089 .cpu_name = "440GP Rev. B",
1090 .cpu_features = CPU_FTRS_44X,
1091 .cpu_user_features = COMMON_USER_BOOKE,
1094 .platform = "ppc440gp",
1096 { /* 440GP Rev. C */
1097 .pvr_mask = 0xf0000fff,
1098 .pvr_value = 0x40000481,
1099 .cpu_name = "440GP Rev. C",
1100 .cpu_features = CPU_FTRS_44X,
1101 .cpu_user_features = COMMON_USER_BOOKE,
1104 .platform = "ppc440gp",
1106 { /* 440GX Rev. A */
1107 .pvr_mask = 0xf0000fff,
1108 .pvr_value = 0x50000850,
1109 .cpu_name = "440GX Rev. A",
1110 .cpu_features = CPU_FTRS_44X,
1111 .cpu_user_features = COMMON_USER_BOOKE,
1114 .platform = "ppc440",
1116 { /* 440GX Rev. B */
1117 .pvr_mask = 0xf0000fff,
1118 .pvr_value = 0x50000851,
1119 .cpu_name = "440GX Rev. B",
1120 .cpu_features = CPU_FTRS_44X,
1121 .cpu_user_features = COMMON_USER_BOOKE,
1124 .platform = "ppc440",
1126 { /* 440GX Rev. C */
1127 .pvr_mask = 0xf0000fff,
1128 .pvr_value = 0x50000892,
1129 .cpu_name = "440GX Rev. C",
1130 .cpu_features = CPU_FTRS_44X,
1131 .cpu_user_features = COMMON_USER_BOOKE,
1134 .platform = "ppc440",
1136 { /* 440GX Rev. F */
1137 .pvr_mask = 0xf0000fff,
1138 .pvr_value = 0x50000894,
1139 .cpu_name = "440GX Rev. F",
1140 .cpu_features = CPU_FTRS_44X,
1141 .cpu_user_features = COMMON_USER_BOOKE,
1144 .platform = "ppc440",
1146 { /* 440SP Rev. A */
1147 .pvr_mask = 0xff000fff,
1148 .pvr_value = 0x53000891,
1149 .cpu_name = "440SP Rev. A",
1150 .cpu_features = CPU_FTRS_44X,
1151 .cpu_user_features = COMMON_USER_BOOKE,
1154 .platform = "ppc440",
1156 { /* 440SPe Rev. A */
1157 .pvr_mask = 0xff000fff,
1158 .pvr_value = 0x53000890,
1159 .cpu_name = "440SPe Rev. A",
1160 .cpu_features = CPU_FTRS_44X,
1161 .cpu_user_features = COMMON_USER_BOOKE,
1164 .platform = "ppc440",
1166 #endif /* CONFIG_44x */
1167 #ifdef CONFIG_FSL_BOOKE
1169 .pvr_mask = 0xfff00000,
1170 .pvr_value = 0x81000000,
1171 .cpu_name = "e200z5",
1172 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1173 .cpu_features = CPU_FTRS_E200,
1174 .cpu_user_features = COMMON_USER_BOOKE |
1175 PPC_FEATURE_HAS_EFP_SINGLE |
1176 PPC_FEATURE_UNIFIED_CACHE,
1178 .platform = "ppc5554",
1181 .pvr_mask = 0xfff00000,
1182 .pvr_value = 0x81100000,
1183 .cpu_name = "e200z6",
1184 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1185 .cpu_features = CPU_FTRS_E200,
1186 .cpu_user_features = COMMON_USER_BOOKE |
1187 PPC_FEATURE_SPE_COMP |
1188 PPC_FEATURE_HAS_EFP_SINGLE |
1189 PPC_FEATURE_UNIFIED_CACHE,
1191 .platform = "ppc5554",
1194 .pvr_mask = 0xffff0000,
1195 .pvr_value = 0x80200000,
1197 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1198 .cpu_features = CPU_FTRS_E500,
1199 .cpu_user_features = COMMON_USER_BOOKE |
1200 PPC_FEATURE_SPE_COMP |
1201 PPC_FEATURE_HAS_EFP_SINGLE,
1205 .oprofile_cpu_type = "ppc/e500",
1206 .oprofile_type = PPC_OPROFILE_BOOKE,
1207 .platform = "ppc8540",
1210 .pvr_mask = 0xffff0000,
1211 .pvr_value = 0x80210000,
1212 .cpu_name = "e500v2",
1213 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1214 .cpu_features = CPU_FTRS_E500_2,
1215 .cpu_user_features = COMMON_USER_BOOKE |
1216 PPC_FEATURE_SPE_COMP |
1217 PPC_FEATURE_HAS_EFP_SINGLE |
1218 PPC_FEATURE_HAS_EFP_DOUBLE,
1222 .oprofile_cpu_type = "ppc/e500",
1223 .oprofile_type = PPC_OPROFILE_BOOKE,
1224 .platform = "ppc8548",
1228 { /* default match */
1229 .pvr_mask = 0x00000000,
1230 .pvr_value = 0x00000000,
1231 .cpu_name = "(generic PPC)",
1232 .cpu_features = CPU_FTRS_GENERIC_32,
1233 .cpu_user_features = PPC_FEATURE_32,
1236 .platform = "powerpc",
1238 #endif /* !CLASSIC_PPC */
1239 #endif /* CONFIG_PPC32 */
1242 struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1244 struct cpu_spec *s = cpu_specs;
1245 struct cpu_spec **cur = &cur_cpu_spec;
1249 cur = PTRRELOC(cur);
1251 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1252 if ((pvr & s->pvr_mask) == s->pvr_value) {
1253 *cur = cpu_specs + i;
1255 /* ppc64 expects identify_cpu to also call setup_cpu
1256 * for that processor. I will consolidate that at a
1257 * later time, for now, just use our friend #ifdef.
1258 * we also don't need to PTRRELOC the function pointer
1259 * on ppc64 as we are running at 0 in real mode.
1262 s->cpu_setup(offset, s);
1264 #endif /* CONFIG_PPC64 */
1271 void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1273 struct fixup_entry {
1275 unsigned long value;
1283 for (; fcur < fend; fcur++) {
1284 unsigned int *pstart, *pend, *p;
1286 if ((value & fcur->mask) == fcur->value)
1289 /* These PTRRELOCs will disappear once the new scheme for
1290 * modules and vdso is implemented
1292 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1293 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1295 for (p = pstart; p < pend; p++) {
1297 asm volatile ("dcbst 0, %0" : : "r" (p));
1299 asm volatile ("sync" : : : "memory");
1300 for (p = pstart; p < pend; p++)
1301 asm volatile ("icbi 0,%0" : : "r" (p));
1302 asm volatile ("sync; isync" : : : "memory");