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>
This commit is contained in:
Khalid Aziz 2016-04-19 11:12:54 -06:00 committed by David S. Miller
parent 5bde2c9be7
commit c5b8b5beee
6 changed files with 25 additions and 1 deletions

View File

@ -48,6 +48,7 @@
#define SUN4V_CHIP_SPARC_M6 0x06 #define SUN4V_CHIP_SPARC_M6 0x06
#define SUN4V_CHIP_SPARC_M7 0x07 #define SUN4V_CHIP_SPARC_M7 0x07
#define SUN4V_CHIP_SPARC64X 0x8a #define SUN4V_CHIP_SPARC64X 0x8a
#define SUN4V_CHIP_SPARC_SN 0x8b
#define SUN4V_CHIP_UNKNOWN 0xff #define SUN4V_CHIP_UNKNOWN 0xff
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__

View File

@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void)
sparc_pmu_type = "sparc-m7"; sparc_pmu_type = "sparc-m7";
break; break;
case SUN4V_CHIP_SPARC_SN:
sparc_cpu_type = "SPARC-SN";
sparc_fpu_type = "SPARC-SN integrated FPU";
sparc_pmu_type = "sparc-sn";
break;
case SUN4V_CHIP_SPARC64X: case SUN4V_CHIP_SPARC64X:
sparc_cpu_type = "SPARC64-X"; sparc_cpu_type = "SPARC64-X";
sparc_fpu_type = "SPARC64-X integrated FPU"; sparc_fpu_type = "SPARC64-X integrated FPU";

View File

@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
case SUN4V_CHIP_NIAGARA5: case SUN4V_CHIP_NIAGARA5:
case SUN4V_CHIP_SPARC_M6: case SUN4V_CHIP_SPARC_M6:
case SUN4V_CHIP_SPARC_M7: case SUN4V_CHIP_SPARC_M7:
case SUN4V_CHIP_SPARC_SN:
case SUN4V_CHIP_SPARC64X: case SUN4V_CHIP_SPARC64X:
rover_inc_table = niagara_iterate_method; rover_inc_table = niagara_iterate_method;
break; break;

View File

@ -414,6 +414,8 @@ sun4v_chip_type:
cmp %g2, 'T' cmp %g2, 'T'
be,pt %xcc, 70f be,pt %xcc, 70f
cmp %g2, 'M' cmp %g2, 'M'
be,pt %xcc, 70f
cmp %g2, 'S'
bne,pn %xcc, 49f bne,pn %xcc, 49f
nop nop
@ -433,6 +435,9 @@ sun4v_chip_type:
cmp %g2, '7' cmp %g2, '7'
be,pt %xcc, 5f be,pt %xcc, 5f
mov SUN4V_CHIP_SPARC_M7, %g4 mov SUN4V_CHIP_SPARC_M7, %g4
cmp %g2, 'N'
be,pt %xcc, 5f
mov SUN4V_CHIP_SPARC_SN, %g4
ba,pt %xcc, 49f ba,pt %xcc, 49f
nop nop
@ -595,6 +600,9 @@ niagara_tlb_fixup:
be,pt %xcc, niagara4_patch be,pt %xcc, niagara4_patch
nop nop
cmp %g1, SUN4V_CHIP_SPARC_M7 cmp %g1, SUN4V_CHIP_SPARC_M7
be,pt %xcc, niagara4_patch
nop
cmp %g1, SUN4V_CHIP_SPARC_SN
be,pt %xcc, niagara4_patch be,pt %xcc, niagara4_patch
nop nop

View File

@ -285,7 +285,8 @@ static void __init sun4v_patch(void)
sun4v_patch_2insn_range(&__sun4v_2insn_patch, sun4v_patch_2insn_range(&__sun4v_2insn_patch,
&__sun4v_2insn_patch_end); &__sun4v_2insn_patch_end);
if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7) if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN)
sun_m7_patch_2insn_range(&__sun_m7_2insn_patch, sun_m7_patch_2insn_range(&__sun_m7_2insn_patch,
&__sun_m7_2insn_patch_end); &__sun_m7_2insn_patch_end);
@ -524,6 +525,7 @@ static void __init init_sparc64_elf_hwcap(void)
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X) sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= HWCAP_SPARC_BLKINIT; cap |= HWCAP_SPARC_BLKINIT;
if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
@ -532,6 +534,7 @@ static void __init init_sparc64_elf_hwcap(void)
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X) sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= HWCAP_SPARC_N2; cap |= HWCAP_SPARC_N2;
} }
@ -561,6 +564,7 @@ static void __init init_sparc64_elf_hwcap(void)
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X) sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 | cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
AV_SPARC_ASI_BLK_INIT | AV_SPARC_ASI_BLK_INIT |
@ -570,6 +574,7 @@ static void __init init_sparc64_elf_hwcap(void)
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X) sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC | cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
AV_SPARC_FMAF); AV_SPARC_FMAF);

View File

@ -1769,6 +1769,7 @@ static void __init setup_page_offset(void)
max_phys_bits = 47; max_phys_bits = 47;
break; break;
case SUN4V_CHIP_SPARC_M7: case SUN4V_CHIP_SPARC_M7:
case SUN4V_CHIP_SPARC_SN:
default: default:
/* M7 and later support 52-bit virtual addresses. */ /* M7 and later support 52-bit virtual addresses. */
sparc64_va_hole_top = 0xfff8000000000000UL; sparc64_va_hole_top = 0xfff8000000000000UL;
@ -1986,6 +1987,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
*/ */
switch (sun4v_chip_type) { switch (sun4v_chip_type) {
case SUN4V_CHIP_SPARC_M7: case SUN4V_CHIP_SPARC_M7:
case SUN4V_CHIP_SPARC_SN:
pagecv_flag = 0x00; pagecv_flag = 0x00;
break; break;
default: default:
@ -2138,6 +2140,7 @@ void __init paging_init(void)
*/ */
switch (sun4v_chip_type) { switch (sun4v_chip_type) {
case SUN4V_CHIP_SPARC_M7: case SUN4V_CHIP_SPARC_M7:
case SUN4V_CHIP_SPARC_SN:
page_cache4v_flag = _PAGE_CP_4V; page_cache4v_flag = _PAGE_CP_4V;
break; break;
default: default: