diff options
| author | Paul Mackerras <paulus@samba.org> | 2003-03-16 17:27:28 +1100 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2003-03-16 17:27:28 +1100 |
| commit | e106935f0fab07a319b0fa2943ef7c11e932630b (patch) | |
| tree | 7c85af5a5f7b3b7f845d73e2fad1c4eed63da99e /arch/ppc | |
| parent | 2b3163d4ed502d8eda3b24323126ef88b230ce7a (diff) | |
| parent | a76d1bae3aa55f9fc981738ab3f1dd304a2a212b (diff) | |
Merge bk://stop.crashing.org/linux-2.5-misc
into samba.org:/home/paulus/kernel/for-linus-ppc
Diffstat (limited to 'arch/ppc')
| -rw-r--r-- | arch/ppc/boot/common/util.S | 51 | ||||
| -rw-r--r-- | arch/ppc/boot/simple/head.S | 13 | ||||
| -rw-r--r-- | arch/ppc/kernel/ppc-stub.c | 23 | ||||
| -rw-r--r-- | arch/ppc/platforms/lopec_setup.c | 4 |
4 files changed, 65 insertions, 26 deletions
diff --git a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S index 9d3b34de0b87..9f3fc6193a48 100644 --- a/arch/ppc/boot/common/util.S +++ b/arch/ppc/boot/common/util.S @@ -14,7 +14,7 @@ * trini@mvista.com * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others). * - * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * 2001-2003 (c) MontaVista, Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. @@ -98,7 +98,7 @@ _setup_L2CR: isync mfspr r8,L2CR rlwinm r8,r8,0,1,31 - oris r8,r8,0x0020 + oris r8,r8,L2CR_L2I@h sync isync mtspr L2CR,r8 @@ -106,11 +106,25 @@ _setup_L2CR: isync /* Wait for the invalidation to complete */ -1: mfspr r8,L2CR - rlwinm. r9,r8,0,31,31 + mfspr r8,PVR + srwi r8,r8,16 + cmpli cr0,r8,0x8000 /* 7450 */ + cmpli cr1,r8,0x8001 /* 7455 */ + cmpli cr2,r8,0x8002 /* 7457 */ + cror 4*cr0+eq,4*cr0+eq,4*cr1+eq /* Now test if any are true. */ + cror 4*cr0+eq,4*cr0+eq,4*cr2+eq + bne 2f + +1: mfspr r8,L2CR /* On 745x, poll L2I bit (bit 10) */ + rlwinm. r9,r8,0,10,10 bne 1b + b 3f + +2: mfspr r8,L2CR /* On 75x & 74[01]0, poll L2IP bit (bit 31) */ + rlwinm. r9,r8,0,31,31 + bne 2b - rlwinm r8,r8,0,11,9 /* Turn off L2I bit */ +3: rlwinm r8,r8,0,11,9 /* Turn off L2I bit */ sync isync mtspr L2CR,r8 @@ -118,6 +132,33 @@ _setup_L2CR: isync blr + .globl _setup_L3CR +_setup_L3CR: + /* Invalidate/disable L3 cache */ + sync + isync + mfspr r8,L3CR + rlwinm r8,r8,0,1,31 + ori r8,r8,L3CR_L3I@l + sync + isync + mtspr L3CR,r8 + sync + isync + + /* Wait for the invalidation to complete */ +1: mfspr r8,L3CR + rlwinm. r9,r8,0,21,21 + bne 1b + + rlwinm r8,r8,0,22,20 /* Turn off L3I bit */ + sync + isync + mtspr L3CR,r8 + sync + isync + blr + /* * Delay for a number of microseconds diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S index d4d2dbf016c2..d1729f3fbe30 100644 --- a/arch/ppc/boot/simple/head.S +++ b/arch/ppc/boot/simple/head.S @@ -7,7 +7,7 @@ * trini@mvista.com * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others). * - * 2001 (c) MontaVista, Software, Inc. This file is licensed under + * 2001-2003 (c) MontaVista, Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. @@ -74,6 +74,17 @@ start_: #if defined(CONFIG_FORCE) || defined(CONFIG_K2) \ || defined(CONFIG_EV64260) || defined(CONFIG_PAL4) bl _setup_L2CR + + /* If 745x, turn off L3CR as well */ + mfspr r8,PVR + srwi r8,r8,16 + + cmpli cr0,r8,0x8000 /* 7450 */ + cmpli cr1,r8,0x8001 /* 7455 */ + cmpli cr2,r8,0x8002 /* 7457 */ + cror 4*cr0+eq,4*cr0+eq,4*cr1+eq /* Now test if any are true. */ + cror 4*cr0+eq,4*cr0+eq,4*cr2+eq + beql _setup_L3CR #endif #endif diff --git a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c index 3a048ee52736..acc76c5f264b 100644 --- a/arch/ppc/kernel/ppc-stub.c +++ b/arch/ppc/kernel/ppc-stub.c @@ -420,18 +420,6 @@ static void kgdb_flush_cache_all(void) flush_instruction_cache(); } -static inline int get_msr(void) -{ - int msr; - asm volatile("mfmsr %0" : "=r" (msr):); - return msr; -} - -static inline void set_msr(int msr) -{ - asm volatile("mtmsr %0" : : "r" (msr)); -} - /* Set up exception handlers for tracing and breakpoints * [could be called kgdb_init()] */ @@ -598,8 +586,8 @@ handle_exception (struct pt_regs *regs) kgdb_interruptible(0); lock_kernel(); - msr = get_msr(); - set_msr(msr & ~MSR_EE); /* disable interrupts */ + msr = mfmsr(); + mtmsr(msr & ~MSR_EE); /* disable interrupts */ if (regs->nip == (unsigned long)breakinst) { /* Skip over breakpoint trap insn */ @@ -626,7 +614,7 @@ handle_exception (struct pt_regs *regs) *ptr++ = hexchars[SP_REGNUM >> 4]; *ptr++ = hexchars[SP_REGNUM & 0xf]; *ptr++ = ':'; - ptr = mem2hex(((char *)®s) + SP_REGNUM*4, ptr, 4); + ptr = mem2hex(((char *)regs) + SP_REGNUM*4, ptr, 4); *ptr++ = ';'; #endif @@ -786,7 +774,7 @@ handle_exception (struct pt_regs *regs) strcpy(remcomOutBuffer, "OK"); putpacket(remcomOutBuffer); #endif - set_msr(msr); + mtmsr(msr); kgdb_interruptible(1); unlock_kernel(); @@ -802,10 +790,9 @@ handle_exception (struct pt_regs *regs) #if defined(CONFIG_40x) regs->msr |= MSR_DE; regs->dbcr0 |= (DBCR0_IDM | DBCR0_IC); - set_msr(msr); + mtmsr(msr); #else regs->msr |= MSR_SE; - set_msr(msr | MSR_SE); #endif unlock_kernel(); kgdb_active = 0; diff --git a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c index 4d929ec1f331..029ef110d2c7 100644 --- a/arch/ppc/platforms/lopec_setup.c +++ b/arch/ppc/platforms/lopec_setup.c @@ -324,7 +324,7 @@ lopec_setup_arch(void) ROOT_DEV = Root_SDA1; #endif -#ifdef CONFIG_DUMMY_CONSOLE +#ifdef CONFIG_VT conswitchp = &dummy_con; #endif #ifdef CONFIG_PPCBUG_NVRAM @@ -378,7 +378,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_ID_MODULE) +#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) ppc_ide_md.default_irq = lopec_ide_default_irq; ppc_ide_md.default_io_base = lopec_ide_default_io_base; ppc_ide_md.ide_init_hwif = lopec_ide_init_hwif_ports; |
