diff options
author | Jayachandran C <jayachandranc@netlogicmicro.com> | 2011-11-15 19:21:20 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-12-07 17:04:55 -0500 |
commit | a3d4fb2d2a4c52b22cde90049a78e323cde187e5 (patch) | |
tree | e5ed7235b8f8a0b29b9aad11b4d1f57ef2f59809 /arch/mips | |
parent | 0be3d9bb1460a87170a1b78b9ab12cb0ac02c2dc (diff) |
MIPS: Netlogic: XLP CPU support.
Add support for Netlogic's XLP MIPS SoC. This patch adds:
* XLP processor ID in cpu_probe.c and asm/cpu.h
* XLP case to asm/module.h
* CPU_XLP case to mm/tlbex.c
* minor change to r4k cache handling to ignore XLP secondary cache
* XLP cpu overrides to mach-netlogic/cpu-feature-overrides.h
Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2966/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/cpu.h | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h | 18 | ||||
-rw-r--r-- | arch/mips/include/asm/module.h | 2 | ||||
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 19 | ||||
-rw-r--r-- | arch/mips/mm/c-r4k.c | 3 |
5 files changed, 37 insertions, 8 deletions
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h index 2f7f41873f24..6e94c7e2c164 100644 --- a/arch/mips/include/asm/cpu.h +++ b/arch/mips/include/asm/cpu.h | |||
@@ -170,6 +170,7 @@ | |||
170 | #define PRID_IMP_NETLOGIC_XLS408B 0x4e00 | 170 | #define PRID_IMP_NETLOGIC_XLS408B 0x4e00 |
171 | #define PRID_IMP_NETLOGIC_XLS404B 0x4f00 | 171 | #define PRID_IMP_NETLOGIC_XLS404B 0x4f00 |
172 | 172 | ||
173 | #define PRID_IMP_NETLOGIC_XLP832 0x1000 | ||
173 | /* | 174 | /* |
174 | * Definitions for 7:0 on legacy processors | 175 | * Definitions for 7:0 on legacy processors |
175 | */ | 176 | */ |
@@ -263,7 +264,7 @@ enum cpu_type_enum { | |||
263 | */ | 264 | */ |
264 | CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, | 265 | CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, |
265 | CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, CPU_CAVIUM_OCTEON2, | 266 | CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, CPU_CAVIUM_OCTEON2, |
266 | CPU_XLR, | 267 | CPU_XLR, CPU_XLP, |
267 | 268 | ||
268 | CPU_LAST | 269 | CPU_LAST |
269 | }; | 270 | }; |
diff --git a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h index 3780743a74b2..d193fb68cf27 100644 --- a/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h | |||
@@ -24,23 +24,33 @@ | |||
24 | 24 | ||
25 | #define cpu_has_llsc 1 | 25 | #define cpu_has_llsc 1 |
26 | #define cpu_has_vtag_icache 0 | 26 | #define cpu_has_vtag_icache 0 |
27 | #define cpu_has_dc_aliases 0 | ||
28 | #define cpu_has_ic_fills_f_dc 1 | 27 | #define cpu_has_ic_fills_f_dc 1 |
29 | #define cpu_has_dsp 0 | 28 | #define cpu_has_dsp 0 |
30 | #define cpu_has_mipsmt 0 | 29 | #define cpu_has_mipsmt 0 |
31 | #define cpu_has_userlocal 0 | ||
32 | #define cpu_icache_snoops_remote_store 1 | 30 | #define cpu_icache_snoops_remote_store 1 |
33 | 31 | ||
34 | #define cpu_has_64bits 1 | 32 | #define cpu_has_64bits 1 |
35 | 33 | ||
36 | #define cpu_has_mips32r1 1 | 34 | #define cpu_has_mips32r1 1 |
37 | #define cpu_has_mips32r2 0 | ||
38 | #define cpu_has_mips64r1 1 | 35 | #define cpu_has_mips64r1 1 |
39 | #define cpu_has_mips64r2 0 | ||
40 | 36 | ||
41 | #define cpu_has_inclusive_pcaches 0 | 37 | #define cpu_has_inclusive_pcaches 0 |
42 | 38 | ||
43 | #define cpu_dcache_line_size() 32 | 39 | #define cpu_dcache_line_size() 32 |
44 | #define cpu_icache_line_size() 32 | 40 | #define cpu_icache_line_size() 32 |
45 | 41 | ||
42 | #if defined(CONFIG_CPU_XLR) | ||
43 | #define cpu_has_userlocal 0 | ||
44 | #define cpu_has_dc_aliases 0 | ||
45 | #define cpu_has_mips32r2 0 | ||
46 | #define cpu_has_mips64r2 0 | ||
47 | #elif defined(CONFIG_CPU_XLP) | ||
48 | #define cpu_has_userlocal 1 | ||
49 | #define cpu_has_mips32r2 1 | ||
50 | #define cpu_has_mips64r2 1 | ||
51 | #define cpu_has_dc_aliases 1 | ||
52 | #else | ||
53 | #error "Unknown Netlogic CPU" | ||
54 | #endif | ||
55 | |||
46 | #endif /* __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H */ | 56 | #endif /* __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h index bc01a02cacd8..2278e3442b09 100644 --- a/arch/mips/include/asm/module.h +++ b/arch/mips/include/asm/module.h | |||
@@ -120,6 +120,8 @@ search_module_dbetables(unsigned long addr) | |||
120 | #define MODULE_PROC_FAMILY "OCTEON " | 120 | #define MODULE_PROC_FAMILY "OCTEON " |
121 | #elif defined CONFIG_CPU_XLR | 121 | #elif defined CONFIG_CPU_XLR |
122 | #define MODULE_PROC_FAMILY "XLR " | 122 | #define MODULE_PROC_FAMILY "XLR " |
123 | #elif defined CONFIG_CPU_XLP | ||
124 | #define MODULE_PROC_FAMILY "XLP " | ||
123 | #else | 125 | #else |
124 | #error MODULE_PROC_FAMILY undefined for your processor configuration | 126 | #error MODULE_PROC_FAMILY undefined for your processor configuration |
125 | #endif | 127 | #endif |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index aa20382b9305..92fae7f459cf 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -192,6 +192,7 @@ void __init check_wait(void) | |||
192 | case CPU_CAVIUM_OCTEON2: | 192 | case CPU_CAVIUM_OCTEON2: |
193 | case CPU_JZRISC: | 193 | case CPU_JZRISC: |
194 | case CPU_XLR: | 194 | case CPU_XLR: |
195 | case CPU_XLP: | ||
195 | cpu_wait = r4k_wait; | 196 | cpu_wait = r4k_wait; |
196 | break; | 197 | break; |
197 | 198 | ||
@@ -1024,6 +1025,11 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) | |||
1024 | MIPS_CPU_LLSC); | 1025 | MIPS_CPU_LLSC); |
1025 | 1026 | ||
1026 | switch (c->processor_id & 0xff00) { | 1027 | switch (c->processor_id & 0xff00) { |
1028 | case PRID_IMP_NETLOGIC_XLP832: | ||
1029 | c->cputype = CPU_XLP; | ||
1030 | __cpu_name[cpu] = "Netlogic XLP"; | ||
1031 | break; | ||
1032 | |||
1027 | case PRID_IMP_NETLOGIC_XLR732: | 1033 | case PRID_IMP_NETLOGIC_XLR732: |
1028 | case PRID_IMP_NETLOGIC_XLR716: | 1034 | case PRID_IMP_NETLOGIC_XLR716: |
1029 | case PRID_IMP_NETLOGIC_XLR532: | 1035 | case PRID_IMP_NETLOGIC_XLR532: |
@@ -1054,14 +1060,21 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) | |||
1054 | break; | 1060 | break; |
1055 | 1061 | ||
1056 | default: | 1062 | default: |
1057 | printk(KERN_INFO "Unknown Netlogic chip id [%02x]!\n", | 1063 | pr_info("Unknown Netlogic chip id [%02x]!\n", |
1058 | c->processor_id); | 1064 | c->processor_id); |
1059 | c->cputype = CPU_XLR; | 1065 | c->cputype = CPU_XLR; |
1060 | break; | 1066 | break; |
1061 | } | 1067 | } |
1062 | 1068 | ||
1063 | c->isa_level = MIPS_CPU_ISA_M64R1; | 1069 | if (c->cputype == CPU_XLP) { |
1064 | c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1; | 1070 | c->isa_level = MIPS_CPU_ISA_M64R2; |
1071 | c->options |= (MIPS_CPU_FPU | MIPS_CPU_ULRI | MIPS_CPU_MCHECK); | ||
1072 | /* This will be updated again after all threads are woken up */ | ||
1073 | c->tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1; | ||
1074 | } else { | ||
1075 | c->isa_level = MIPS_CPU_ISA_M64R1; | ||
1076 | c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1; | ||
1077 | } | ||
1065 | } | 1078 | } |
1066 | 1079 | ||
1067 | #ifdef CONFIG_64BIT | 1080 | #ifdef CONFIG_64BIT |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index a79fe9aa7721..4f9eb0b23036 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -1235,6 +1235,9 @@ static void __cpuinit setup_scache(void) | |||
1235 | loongson2_sc_init(); | 1235 | loongson2_sc_init(); |
1236 | return; | 1236 | return; |
1237 | #endif | 1237 | #endif |
1238 | case CPU_XLP: | ||
1239 | /* don't need to worry about L2, fully coherent */ | ||
1240 | return; | ||
1238 | 1241 | ||
1239 | default: | 1242 | default: |
1240 | if (c->isa_level == MIPS_CPU_ISA_M32R1 || | 1243 | if (c->isa_level == MIPS_CPU_ISA_M32R1 || |