Commit e106935f authored by Paul Mackerras's avatar Paul Mackerras

Merge bk://stop.crashing.org/linux-2.5-misc

into samba.org:/home/paulus/kernel/for-linus-ppc
parents 2b3163d4 a76d1bae
......@@ -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
......
......@@ -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
......
......@@ -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 *)&regs) + 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;
......
......@@ -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;
......
......@@ -469,8 +469,8 @@
#define ICMP SPRN_ICMP /* Instruction TLB Compare Register */
#define IMISS SPRN_IMISS /* Instruction TLB Miss Register */
#define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */
#define L2CR SPRN_L2CR /* PPC 750 L2 control register */
#define L3CR SPRN_L3CR /* PPC 7450 L3 Cache control register */
#define L2CR SPRN_L2CR /* Classic PPC L2 cache control register */
#define L3CR SPRN_L3CR /* PPC 745x L3 cache control register */
#define LR SPRN_LR
#define PVR SPRN_PVR /* Processor Version */
#define RPA SPRN_RPA /* Required Physical Address Register */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment