aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhalid Aziz <khalid.aziz@oracle.com>2016-04-19 13:12:54 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-21 16:43:47 -0400
commitc5b8b5beee1e2aadef0409dba555b7085d57910d (patch)
tree141dbfd81121c82f06c5a68b75426ae2ab77517b
parent5bde2c9be701c4583f0a9243bd46590ec401bfba (diff)
sparc64: recognize and support Sonoma CPU type
Add code to recognize SPARC-Sonoma cpu correctly and update cpu hardware caps and cpu distribution map. SPARC-Sonoma is based upon SPARC-M7 core along with additional PCI functions added on and is reported by firmware as "SPARC-SN". Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com> Acked-by: Allen Pais <allen.pais@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc/include/asm/spitfire.h1
-rw-r--r--arch/sparc/kernel/cpu.c6
-rw-r--r--arch/sparc/kernel/cpumap.c1
-rw-r--r--arch/sparc/kernel/head_64.S8
-rw-r--r--arch/sparc/kernel/setup_64.c7
-rw-r--r--arch/sparc/mm/init_64.c3
6 files changed, 25 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/spitfire.h b/arch/sparc/include/asm/spitfire.h
index 56f933816144..1d8321c827a8 100644
--- a/arch/sparc/include/asm/spitfire.h
+++ b/arch/sparc/include/asm/spitfire.h
@@ -48,6 +48,7 @@
48#define SUN4V_CHIP_SPARC_M6 0x06 48#define SUN4V_CHIP_SPARC_M6 0x06
49#define SUN4V_CHIP_SPARC_M7 0x07 49#define SUN4V_CHIP_SPARC_M7 0x07
50#define SUN4V_CHIP_SPARC64X 0x8a 50#define SUN4V_CHIP_SPARC64X 0x8a
51#define SUN4V_CHIP_SPARC_SN 0x8b
51#define SUN4V_CHIP_UNKNOWN 0xff 52#define SUN4V_CHIP_UNKNOWN 0xff
52 53
53#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index dfad8b1aea9f..493e023a468a 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void)
506 sparc_pmu_type = "sparc-m7"; 506 sparc_pmu_type = "sparc-m7";
507 break; 507 break;
508 508
509 case SUN4V_CHIP_SPARC_SN:
510 sparc_cpu_type = "SPARC-SN";
511 sparc_fpu_type = "SPARC-SN integrated FPU";
512 sparc_pmu_type = "sparc-sn";
513 break;
514
509 case SUN4V_CHIP_SPARC64X: 515 case SUN4V_CHIP_SPARC64X:
510 sparc_cpu_type = "SPARC64-X"; 516 sparc_cpu_type = "SPARC64-X";
511 sparc_fpu_type = "SPARC64-X integrated FPU"; 517 sparc_fpu_type = "SPARC64-X integrated FPU";
diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c
index e69ec0e3f155..45c820e1cba5 100644
--- a/arch/sparc/kernel/cpumap.c
+++ b/arch/sparc/kernel/cpumap.c
@@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
328 case SUN4V_CHIP_NIAGARA5: 328 case SUN4V_CHIP_NIAGARA5:
329 case SUN4V_CHIP_SPARC_M6: 329 case SUN4V_CHIP_SPARC_M6:
330 case SUN4V_CHIP_SPARC_M7: 330 case SUN4V_CHIP_SPARC_M7:
331 case SUN4V_CHIP_SPARC_SN:
331 case SUN4V_CHIP_SPARC64X: 332 case SUN4V_CHIP_SPARC64X:
332 rover_inc_table = niagara_iterate_method; 333 rover_inc_table = niagara_iterate_method;
333 break; 334 break;
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index cd1f592cd347..5b4f5c363674 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -414,6 +414,8 @@ sun4v_chip_type:
414 cmp %g2, 'T' 414 cmp %g2, 'T'
415 be,pt %xcc, 70f 415 be,pt %xcc, 70f
416 cmp %g2, 'M' 416 cmp %g2, 'M'
417 be,pt %xcc, 70f
418 cmp %g2, 'S'
417 bne,pn %xcc, 49f 419 bne,pn %xcc, 49f
418 nop 420 nop
419 421
@@ -433,6 +435,9 @@ sun4v_chip_type:
433 cmp %g2, '7' 435 cmp %g2, '7'
434 be,pt %xcc, 5f 436 be,pt %xcc, 5f
435 mov SUN4V_CHIP_SPARC_M7, %g4 437 mov SUN4V_CHIP_SPARC_M7, %g4
438 cmp %g2, 'N'
439 be,pt %xcc, 5f
440 mov SUN4V_CHIP_SPARC_SN, %g4
436 ba,pt %xcc, 49f 441 ba,pt %xcc, 49f
437 nop 442 nop
438 443
@@ -597,6 +602,9 @@ niagara_tlb_fixup:
597 cmp %g1, SUN4V_CHIP_SPARC_M7 602 cmp %g1, SUN4V_CHIP_SPARC_M7
598 be,pt %xcc, niagara4_patch 603 be,pt %xcc, niagara4_patch
599 nop 604 nop
605 cmp %g1, SUN4V_CHIP_SPARC_SN
606 be,pt %xcc, niagara4_patch
607 nop
600 608
601 call generic_patch_copyops 609 call generic_patch_copyops
602 nop 610 nop
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 26db95b54ee9..599f1207eed2 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -285,7 +285,8 @@ static void __init sun4v_patch(void)
285 285
286 sun4v_patch_2insn_range(&__sun4v_2insn_patch, 286 sun4v_patch_2insn_range(&__sun4v_2insn_patch,
287 &__sun4v_2insn_patch_end); 287 &__sun4v_2insn_patch_end);
288 if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7) 288 if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
289 sun4v_chip_type == SUN4V_CHIP_SPARC_SN)
289 sun_m7_patch_2insn_range(&__sun_m7_2insn_patch, 290 sun_m7_patch_2insn_range(&__sun_m7_2insn_patch,
290 &__sun_m7_2insn_patch_end); 291 &__sun_m7_2insn_patch_end);
291 292
@@ -524,6 +525,7 @@ static void __init init_sparc64_elf_hwcap(void)
524 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 525 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
525 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 526 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
526 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 527 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
528 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
527 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 529 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
528 cap |= HWCAP_SPARC_BLKINIT; 530 cap |= HWCAP_SPARC_BLKINIT;
529 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || 531 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
@@ -532,6 +534,7 @@ static void __init init_sparc64_elf_hwcap(void)
532 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 534 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
533 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 535 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
534 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 536 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
537 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
535 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 538 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
536 cap |= HWCAP_SPARC_N2; 539 cap |= HWCAP_SPARC_N2;
537 } 540 }
@@ -561,6 +564,7 @@ static void __init init_sparc64_elf_hwcap(void)
561 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 564 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
562 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 565 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
563 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 566 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
567 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
564 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 568 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
565 cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 | 569 cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
566 AV_SPARC_ASI_BLK_INIT | 570 AV_SPARC_ASI_BLK_INIT |
@@ -570,6 +574,7 @@ static void __init init_sparc64_elf_hwcap(void)
570 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 574 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
571 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 575 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
572 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 576 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
577 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
573 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 578 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
574 cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC | 579 cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
575 AV_SPARC_FMAF); 580 AV_SPARC_FMAF);
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 1cfe6aab7a11..09e838801e39 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1769,6 +1769,7 @@ static void __init setup_page_offset(void)
1769 max_phys_bits = 47; 1769 max_phys_bits = 47;
1770 break; 1770 break;
1771 case SUN4V_CHIP_SPARC_M7: 1771 case SUN4V_CHIP_SPARC_M7:
1772 case SUN4V_CHIP_SPARC_SN:
1772 default: 1773 default:
1773 /* M7 and later support 52-bit virtual addresses. */ 1774 /* M7 and later support 52-bit virtual addresses. */
1774 sparc64_va_hole_top = 0xfff8000000000000UL; 1775 sparc64_va_hole_top = 0xfff8000000000000UL;
@@ -1986,6 +1987,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
1986 */ 1987 */
1987 switch (sun4v_chip_type) { 1988 switch (sun4v_chip_type) {
1988 case SUN4V_CHIP_SPARC_M7: 1989 case SUN4V_CHIP_SPARC_M7:
1990 case SUN4V_CHIP_SPARC_SN:
1989 pagecv_flag = 0x00; 1991 pagecv_flag = 0x00;
1990 break; 1992 break;
1991 default: 1993 default:
@@ -2138,6 +2140,7 @@ void __init paging_init(void)
2138 */ 2140 */
2139 switch (sun4v_chip_type) { 2141 switch (sun4v_chip_type) {
2140 case SUN4V_CHIP_SPARC_M7: 2142 case SUN4V_CHIP_SPARC_M7:
2143 case SUN4V_CHIP_SPARC_SN:
2141 page_cache4v_flag = _PAGE_CP_4V; 2144 page_cache4v_flag = _PAGE_CP_4V;
2142 break; 2145 break;
2143 default: 2146 default: