MIPS: Netlogic: Add support for XLP2XX

XLP2XX is first in the series of 28nm XLPII processors.

The changes are to:
* Add processor ID for XLP2XX to asm/cpu.h and kernel/cpu-probe.c.
* Add a cpu_is_xlpii() function to check for XLPII processors.
* Update xlp_mmu_init() to use config4 to enable extended TLB.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5698/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Jayachandran C 2013-08-11 14:43:54 +05:30 коммит произвёл Ralf Baechle
Родитель 13314a91f0
Коммит 4ca86a2ff3
4 изменённых файлов: 32 добавлений и 6 удалений

Просмотреть файл

@ -179,6 +179,7 @@
#define PRID_IMP_NETLOGIC_XLP8XX 0x1000 #define PRID_IMP_NETLOGIC_XLP8XX 0x1000
#define PRID_IMP_NETLOGIC_XLP3XX 0x1100 #define PRID_IMP_NETLOGIC_XLP3XX 0x1100
#define PRID_IMP_NETLOGIC_XLP2XX 0x1200
/* /*
* Definitions for 7:0 on legacy processors * Definitions for 7:0 on legacy processors

Просмотреть файл

@ -64,5 +64,12 @@ int xlp_get_dram_map(int n, uint64_t *dram_map);
/* Device tree related */ /* Device tree related */
void *xlp_dt_init(void *fdtp); void *xlp_dt_init(void *fdtp);
static inline int cpu_is_xlpii(void)
{
int chip = read_c0_prid() & 0xff00;
return chip == PRID_IMP_NETLOGIC_XLP2XX;
}
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* _ASM_NLM_XLP_H */ #endif /* _ASM_NLM_XLP_H */

Просмотреть файл

@ -906,6 +906,11 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu)
MIPS_CPU_LLSC); MIPS_CPU_LLSC);
switch (c->processor_id & 0xff00) { switch (c->processor_id & 0xff00) {
case PRID_IMP_NETLOGIC_XLP2XX:
c->cputype = CPU_XLP;
__cpu_name[cpu] = "Broadcom XLPII";
break;
case PRID_IMP_NETLOGIC_XLP8XX: case PRID_IMP_NETLOGIC_XLP8XX:
case PRID_IMP_NETLOGIC_XLP3XX: case PRID_IMP_NETLOGIC_XLP3XX:
c->cputype = CPU_XLP; c->cputype = CPU_XLP;

Просмотреть файл

@ -110,7 +110,12 @@ void __init plat_mem_setup(void)
const char *get_system_type(void) const char *get_system_type(void)
{ {
return "Netlogic XLP Series"; switch (read_c0_prid() & 0xff00) {
case PRID_IMP_NETLOGIC_XLP2XX:
return "Broadcom XLPII Series";
default:
return "Netlogic XLP Series";
}
} }
void __init prom_free_prom_memory(void) void __init prom_free_prom_memory(void)
@ -120,12 +125,20 @@ void __init prom_free_prom_memory(void)
void xlp_mmu_init(void) void xlp_mmu_init(void)
{ {
/* enable extended TLB and Large Fixed TLB */ u32 conf4;
write_c0_config6(read_c0_config6() | 0x24);
/* set page mask of Fixed TLB in config7 */ if (cpu_is_xlpii()) {
write_c0_config7(PM_DEFAULT_MASK >> /* XLPII series has extended pagesize in config 4 */
(13 + (ffz(PM_DEFAULT_MASK >> 13) / 2))); conf4 = read_c0_config4() & ~0x1f00u;
write_c0_config4(conf4 | ((PAGE_SHIFT - 10) / 2 << 8));
} else {
/* enable extended TLB and Large Fixed TLB */
write_c0_config6(read_c0_config6() | 0x24);
/* set page mask of extended Fixed TLB in config7 */
write_c0_config7(PM_DEFAULT_MASK >>
(13 + (ffz(PM_DEFAULT_MASK >> 13) / 2)));
}
} }
void nlm_percpu_init(int hwcpuid) void nlm_percpu_init(int hwcpuid)