aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/cputable.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/cputable.c')
-rw-r--r--arch/powerpc/kernel/cputable.c105
1 files changed, 66 insertions, 39 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e44d5530f0a6..f7f3c215d06f 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -37,6 +37,7 @@ extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
37extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec); 37extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
38extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec); 38extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec); 39extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); 41extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
41extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); 42extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
42extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); 43extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -52,6 +53,8 @@ extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
52extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec); 53extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
53extern void __restore_cpu_pa6t(void); 54extern void __restore_cpu_pa6t(void);
54extern void __restore_cpu_ppc970(void); 55extern void __restore_cpu_ppc970(void);
56extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec);
57extern void __restore_cpu_power7(void);
55#endif /* CONFIG_PPC64 */ 58#endif /* CONFIG_PPC64 */
56 59
57/* This table only contains "desktop" CPUs, it need to be filled with embedded 60/* This table only contains "desktop" CPUs, it need to be filled with embedded
@@ -67,7 +70,12 @@ extern void __restore_cpu_ppc970(void);
67 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP) 70 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
68#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\ 71#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
69 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ 72 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
70 PPC_FEATURE_TRUE_LE) 73 PPC_FEATURE_TRUE_LE | \
74 PPC_FEATURE_PSERIES_PERFMON_COMPAT)
75#define COMMON_USER_POWER7 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\
76 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
77 PPC_FEATURE_TRUE_LE | \
78 PPC_FEATURE_PSERIES_PERFMON_COMPAT)
71#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ 79#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
72 PPC_FEATURE_TRUE_LE | \ 80 PPC_FEATURE_TRUE_LE | \
73 PPC_FEATURE_HAS_ALTIVEC_COMP) 81 PPC_FEATURE_HAS_ALTIVEC_COMP)
@@ -380,6 +388,37 @@ static struct cpu_spec __initdata cpu_specs[] = {
380 .machine_check = machine_check_generic, 388 .machine_check = machine_check_generic,
381 .platform = "power6", 389 .platform = "power6",
382 }, 390 },
391 { /* 2.06-compliant processor, i.e. Power7 "architected" mode */
392 .pvr_mask = 0xffffffff,
393 .pvr_value = 0x0f000003,
394 .cpu_name = "POWER7 (architected)",
395 .cpu_features = CPU_FTRS_POWER7,
396 .cpu_user_features = COMMON_USER_POWER7,
397 .icache_bsize = 128,
398 .dcache_bsize = 128,
399 .machine_check = machine_check_generic,
400 .platform = "power7",
401 },
402 { /* Power7 */
403 .pvr_mask = 0xffff0000,
404 .pvr_value = 0x003f0000,
405 .cpu_name = "POWER7 (raw)",
406 .cpu_features = CPU_FTRS_POWER7,
407 .cpu_user_features = COMMON_USER_POWER7,
408 .icache_bsize = 128,
409 .dcache_bsize = 128,
410 .num_pmcs = 6,
411 .pmc_type = PPC_PMC_IBM,
412 .cpu_setup = __setup_cpu_power7,
413 .cpu_restore = __restore_cpu_power7,
414 .oprofile_cpu_type = "ppc64/power7",
415 .oprofile_type = PPC_OPROFILE_POWER4,
416 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
417 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
418 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
419 POWER6_MMCRA_OTHER,
420 .platform = "power7",
421 },
383 { /* Cell Broadband Engine */ 422 { /* Cell Broadband Engine */
384 .pvr_mask = 0xffff0000, 423 .pvr_mask = 0xffff0000,
385 .pvr_value = 0x00700000, 424 .pvr_value = 0x00700000,
@@ -1410,6 +1449,16 @@ static struct cpu_spec __initdata cpu_specs[] = {
1410 .machine_check = machine_check_440A, 1449 .machine_check = machine_check_440A,
1411 .platform = "ppc440", 1450 .platform = "ppc440",
1412 }, 1451 },
1452 { /* 440 in Xilinx Virtex-5 FXT */
1453 .pvr_mask = 0xfffffff0,
1454 .pvr_value = 0x7ff21910,
1455 .cpu_name = "440 in Virtex-5 FXT",
1456 .cpu_features = CPU_FTRS_44X,
1457 .cpu_user_features = COMMON_USER_BOOKE,
1458 .icache_bsize = 32,
1459 .dcache_bsize = 32,
1460 .platform = "ppc440",
1461 },
1413 { /* 460EX */ 1462 { /* 460EX */
1414 .pvr_mask = 0xffff0002, 1463 .pvr_mask = 0xffff0002,
1415 .pvr_value = 0x13020002, 1464 .pvr_value = 0x13020002,
@@ -1427,9 +1476,10 @@ static struct cpu_spec __initdata cpu_specs[] = {
1427 .pvr_value = 0x13020000, 1476 .pvr_value = 0x13020000,
1428 .cpu_name = "460GT", 1477 .cpu_name = "460GT",
1429 .cpu_features = CPU_FTRS_44X, 1478 .cpu_features = CPU_FTRS_44X,
1430 .cpu_user_features = COMMON_USER_BOOKE, 1479 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1431 .icache_bsize = 32, 1480 .icache_bsize = 32,
1432 .dcache_bsize = 32, 1481 .dcache_bsize = 32,
1482 .cpu_setup = __setup_cpu_460gt,
1433 .machine_check = machine_check_440A, 1483 .machine_check = machine_check_440A,
1434 .platform = "ppc440", 1484 .platform = "ppc440",
1435 }, 1485 },
@@ -1491,7 +1541,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
1491 .pvr_mask = 0xffff0000, 1541 .pvr_mask = 0xffff0000,
1492 .pvr_value = 0x80200000, 1542 .pvr_value = 0x80200000,
1493 .cpu_name = "e500", 1543 .cpu_name = "e500",
1494 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1495 .cpu_features = CPU_FTRS_E500, 1544 .cpu_features = CPU_FTRS_E500,
1496 .cpu_user_features = COMMON_USER_BOOKE | 1545 .cpu_user_features = COMMON_USER_BOOKE |
1497 PPC_FEATURE_HAS_SPE_COMP | 1546 PPC_FEATURE_HAS_SPE_COMP |
@@ -1508,7 +1557,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
1508 .pvr_mask = 0xffff0000, 1557 .pvr_mask = 0xffff0000,
1509 .pvr_value = 0x80210000, 1558 .pvr_value = 0x80210000,
1510 .cpu_name = "e500v2", 1559 .cpu_name = "e500v2",
1511 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1512 .cpu_features = CPU_FTRS_E500_2, 1560 .cpu_features = CPU_FTRS_E500_2,
1513 .cpu_user_features = COMMON_USER_BOOKE | 1561 .cpu_user_features = COMMON_USER_BOOKE |
1514 PPC_FEATURE_HAS_SPE_COMP | 1562 PPC_FEATURE_HAS_SPE_COMP |
@@ -1522,6 +1570,20 @@ static struct cpu_spec __initdata cpu_specs[] = {
1522 .machine_check = machine_check_e500, 1570 .machine_check = machine_check_e500,
1523 .platform = "ppc8548", 1571 .platform = "ppc8548",
1524 }, 1572 },
1573 { /* e500mc */
1574 .pvr_mask = 0xffff0000,
1575 .pvr_value = 0x80230000,
1576 .cpu_name = "e500mc",
1577 .cpu_features = CPU_FTRS_E500MC,
1578 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1579 .icache_bsize = 64,
1580 .dcache_bsize = 64,
1581 .num_pmcs = 4,
1582 .oprofile_cpu_type = "ppc/e500", /* xxx - galak, e500mc? */
1583 .oprofile_type = PPC_OPROFILE_FSL_EMB,
1584 .machine_check = machine_check_e500,
1585 .platform = "ppce500mc",
1586 },
1525 { /* default match */ 1587 { /* default match */
1526 .pvr_mask = 0x00000000, 1588 .pvr_mask = 0x00000000,
1527 .pvr_value = 0x00000000, 1589 .pvr_value = 0x00000000,
@@ -1587,38 +1649,3 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
1587 BUG(); 1649 BUG();
1588 return NULL; 1650 return NULL;
1589} 1651}
1590
1591void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1592{
1593 struct fixup_entry {
1594 unsigned long mask;
1595 unsigned long value;
1596 long start_off;
1597 long end_off;
1598 } *fcur, *fend;
1599
1600 fcur = fixup_start;
1601 fend = fixup_end;
1602
1603 for (; fcur < fend; fcur++) {
1604 unsigned int *pstart, *pend, *p;
1605
1606 if ((value & fcur->mask) == fcur->value)
1607 continue;
1608
1609 /* These PTRRELOCs will disappear once the new scheme for
1610 * modules and vdso is implemented
1611 */
1612 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1613 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1614
1615 for (p = pstart; p < pend; p++) {
1616 *p = 0x60000000u;
1617 asm volatile ("dcbst 0, %0" : : "r" (p));
1618 }
1619 asm volatile ("sync" : : : "memory");
1620 for (p = pstart; p < pend; p++)
1621 asm volatile ("icbi 0,%0" : : "r" (p));
1622 asm volatile ("sync; isync" : : : "memory");
1623 }
1624}