diff options
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/fault.c | 2 | ||||
-rw-r--r-- | arch/mips/mm/init.c | 16 | ||||
-rw-r--r-- | arch/mips/mm/r4xx0.c | 75 |
3 files changed, 47 insertions, 46 deletions
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 72e13336b..8385eb22f 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c @@ -85,7 +85,7 @@ bad_area: if (user_mode(regs)) { tsk->tss.cp0_badvaddr = address; tsk->tss.error_code = writeaccess; -#if 1 +#if 0 printk("do_page_fault() #2: sending SIGSEGV to %s for illegal %s\n" "%08lx (epc == %08lx, ra == %08lx)\n", tsk->comm, diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index b62e571d6..9cb47cefa 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c @@ -229,27 +229,11 @@ void mem_init(unsigned long start_mem, unsigned long end_mem) for(tmp = MAP_NR(start_mem);tmp < max_mapnr;tmp++) clear_bit(PG_reserved, &mem_map[tmp].flags); - /* - * For rPC44 and RM200 we've reserved some memory too much. Free - * the memory from PAGE_SIZE to PAGE_OFFSET + 0xa0000 again. We - * don't free the lowest page where the exception handlers will - * reside. - */ - if (mips_machgroup == MACH_GROUP_ARC && - mips_machtype == MACH_DESKSTATION_RPC44) - for(tmp = MAP_NR(PAGE_OFFSET + PAGE_SIZE); - tmp < MAP_NR(PAGE_OFFSET + 0xa000); tmp++) - clear_bit(PG_reserved, &mem_map[tmp].flags); - #ifdef CONFIG_SGI prom_fixup_mem_map(start_mem, (unsigned long)high_memory); #endif -#ifdef CONFIG_DESKSTATION_TYNE - deskstation_tyne_dma_init(); -#endif - for (tmp = PAGE_OFFSET; tmp < end_mem; tmp += PAGE_SIZE) { /* * This is only for PC-style DMA. The onboard DMA diff --git a/arch/mips/mm/r4xx0.c b/arch/mips/mm/r4xx0.c index a0786131f..4c7ebd6f0 100644 --- a/arch/mips/mm/r4xx0.c +++ b/arch/mips/mm/r4xx0.c @@ -3,7 +3,7 @@ * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * - * $Id: r4xx0.c,v 1.9 1997/12/01 17:57:36 ralf Exp $ + * $Id: r4xx0.c,v 1.10 1997/12/02 14:49:20 ralf Exp $ * * To do: * @@ -2424,6 +2424,38 @@ static void probe_dcache(unsigned long config) (int)(dcache_size >> 10), (int)dc_lsize); } +/* + * Activate the chipset controlled R4600 and R5000 caches of the Indy + */ +static inline void enable_indy_scache(void) +{ + unsigned long addr, tmp1, tmp2; + + /* This is really cool... */ + printk("Enabling R4600 SCACHE\n"); + __asm__ __volatile__(" + .set noreorder + .set mips3 + mfc0 %2, $12 + nop; nop; nop; nop; + li %1, 0x80 + mtc0 %1, $12 + nop; nop; nop; nop; + li %0, 0x1 + dsll %0, 31 + lui %1, 0x9000 + dsll32 %1, 0 + or %0, %1, %0 + sb $0, 0(%0) + mtc0 $0, $12 + nop; nop; nop; nop; + mtc0 %2, $12 + nop; nop; nop; nop; + .set mips0 + .set reorder" + : "=r" (tmp1), "=r" (tmp2), "=r" (addr)); +} + static int probe_scache_eeprom(unsigned long config) { #ifdef CONFIG_SGI @@ -2487,7 +2519,7 @@ static int probe_scache_eeprom(unsigned long config) printk("linesize %d bytes\n", sc_lsize); scache_size = data; if(data) { - unsigned long addr, tmp1, tmp2; + unsigned long addr; /* Enable r4600/r5000 cache. But flush it first. */ for(addr = KSEG0; addr < (KSEG0 + dcache_size); @@ -2500,42 +2532,26 @@ static int probe_scache_eeprom(unsigned long config) addr += sc_lsize) flush_scache_line_indexed(addr); - /* R5000 scache enable is in CP0 config, on R4600 variants + /* + * R5000 scache enable is in CP0 config, on R4600 variants * the scache is enable by the memory mapped cache controller. */ + if (mips_cputype == CPU_R4600 || + mips_cputype == CPU_R5000) { + enable_indy_scache(); + return 1; + } +#if 0 if(mips_cputype == CPU_R5000) { unsigned long config; config = read_32bit_cp0_register(CP0_CONFIG); config |= 0x1000; write_32bit_cp0_register(CP0_CONFIG, config); - } else { - /* This is really cool... */ - printk("Enabling R4600 SCACHE\n"); - __asm__ __volatile__(" - .set noreorder - .set mips3 - mfc0 %2, $12 - nop; nop; nop; nop; - li %1, 0x80 - mtc0 %1, $12 - nop; nop; nop; nop; - li %0, 0x1 - dsll %0, 31 - lui %1, 0x9000 - dsll32 %1, 0 - or %0, %1, %0 - sb $0, 0(%0) - mtc0 $0, $12 - nop; nop; nop; nop; - mtc0 %2, $12 - nop; nop; nop; nop; - .set mips0 - .set reorder - " : "=r" (tmp1), "=r" (tmp2), "=r" (addr)); } - +#endif return 1; + } else { if(mips_cputype == CPU_R5000) return -1; @@ -2831,7 +2847,8 @@ void ld_mmu_r4xx0(void) } else { /* Lacks true secondary cache. */ setup_noscache_funcs(); - if((mips_cputype != CPU_R5000)) { /* XXX */ + if (mips_cputype == CPU_R4600 || + mips_cputype == CPU_R5000) { flush_cache_page = r4k_flush_cache_page_d32i32_r4600; flush_page_to_ram = |