# This is a BitKeeper generated patch for the following project: # Project Name: Linux 2.4 # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.129 -> 1.130 # arch/ppc/kernel/ppc4xx_pic.h 1.7 -> 1.8 # arch/ppc/kernel/setup.c 1.39 -> 1.40 # arch/ppc/kernel/idle.c 1.13 -> 1.14 # arch/ppc/kernel/process.c 1.18 -> 1.19 # arch/ppc/kernel/misc.S 1.18 -> 1.19 # arch/ppc/lib/string.S 1.7 -> 1.8 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 01/06/05 trini@bill-the-cat.bloom.county 1.130 # 4xxupdate.patch # -------------------------------------------- # diff -Nru a/arch/ppc/kernel/idle.c b/arch/ppc/kernel/idle.c --- a/arch/ppc/kernel/idle.c Tue Jun 5 14:59:26 2001 +++ b/arch/ppc/kernel/idle.c Tue Jun 5 14:59:26 2001 @@ -50,15 +50,19 @@ { int do_power_save = 0; - /* only sleep on the 603-family/750 processors */ + /* We can sleep on 603-family, 750 (G3) 74xx (G4) and some 4xx processors */ switch (_get_PVR() >> 16) { - case 3: /* 603 */ - case 6: /* 603e */ - case 7: /* 603ev */ - case 8: /* 750 */ - case 12: /* 7400 */ - case 0x800c: /* 7410 */ + case 3: /* 603 */ + case 6: /* 603e */ + case 7: /* 603ev */ + case 8: /* 750 */ + case 12: /* 7400 */ + case 0x800c: /* 7410 */ + case PVR_VER( PVR_405GP ): /* 405GP */ + case PVR_VER( PVR_STB03XXX ): do_power_save = 1; + default: + ; } /* endless loop with no priority at all */ @@ -101,7 +105,7 @@ PTE *reclaim_ptr = 0; void inline htab_reclaim(void) { -#ifndef CONFIG_8xx +#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx) #if 0 PTE *ptr, *start; static int dir = 1; @@ -307,15 +311,29 @@ _nmask_and_or_msr(MSR_EE, 0); if (!current->need_resched) { - asm("mfspr %0,1008" : "=r" (hid0) :); - hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE); - hid0 |= (powersave_nap? HID0_NAP: HID0_DOZE) | HID0_DPM; - asm("mtspr 1008,%0" : : "r" (hid0)); - - /* set the POW bit in the MSR, and enable interrupts - * so we wake up sometime! */ - _nmask_and_or_msr(0, MSR_POW | MSR_EE); + switch (_get_PVR() >> 16) { + case 3: /* 603 */ + case 6: /* 603e */ + case 7: /* 603ev */ + case 8: /* 750 */ + case 12: /* 7400 */ + case 0x800c: /* 7410 */ + asm("mfspr %0,1008" : "=r" (hid0) :); + hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE); + hid0 |= (powersave_nap? HID0_NAP: HID0_DOZE) | HID0_DPM; + asm("mtspr 1008,%0" : : "r" (hid0)); + /* set the POW bit in the MSR, and enable interrupts + * so we wake up sometime! */ + _nmask_and_or_msr(0, MSR_POW | MSR_EE); + break; + + case PVR_VER( PVR_405GP ): /* 405GP */ + case PVR_VER( PVR_STB03XXX ): + _nmask_and_or_msr(0, MSR_WE | MSR_EE); + return; + default: + ; + } } _nmask_and_or_msr(0, MSR_EE); } - diff -Nru a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S --- a/arch/ppc/kernel/misc.S Tue Jun 5 14:59:26 2001 +++ b/arch/ppc/kernel/misc.S Tue Jun 5 14:59:26 2001 @@ -263,10 +263,13 @@ * This is a no-op on the 601. */ _GLOBAL(flush_instruction_cache) -#ifdef CONFIG_8xx +#if defined(CONFIG_8xx) isync lis r5, IDC_INVALL@h mtspr IC_CST, r5 +#elif defined(CONFIG_4xx) + lis r3, KERNELBASE@h + iccci 0,r3 #else mfspr r3,PVR rlwinm r3,r3,16,16,31 diff -Nru a/arch/ppc/kernel/ppc4xx_pic.h b/arch/ppc/kernel/ppc4xx_pic.h --- a/arch/ppc/kernel/ppc4xx_pic.h Tue Jun 5 14:59:26 2001 +++ b/arch/ppc/kernel/ppc4xx_pic.h Tue Jun 5 14:59:26 2001 @@ -14,12 +14,8 @@ #ifndef __PPC4XX_PIC_H__ #define __PPC4XX_PIC_H__ -#include - - -#ifdef __cplusplus -extern "C" { -#endif +#include +#include "local_irq.h" /* External Global Variables */ @@ -30,10 +26,5 @@ extern void ppc4xx_pic_init(void); extern int ppc4xx_pic_get_irq(struct pt_regs *regs); - - -#ifdef __cplusplus -} -#endif #endif /* __PPC4XX_PIC_H__ */ diff -Nru a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c --- a/arch/ppc/kernel/process.c Tue Jun 5 14:59:26 2001 +++ b/arch/ppc/kernel/process.c Tue Jun 5 14:59:26 2001 @@ -267,6 +267,15 @@ printk("Last syscall: %ld ", current->thread.last_syscall); printk("\nlast math %p last altivec %p", last_task_used_math, last_task_used_altivec); + +#ifdef CONFIG_4xx + printk("\nPLB0: bear= 0x%8.8x acr= 0x%8.8x besr= 0x%8.8x\n", + mfdcr(DCRN_POB0_BEAR), mfdcr(DCRN_PLB0_ACR), + mfdcr(DCRN_PLB0_BESR)); + printk("PLB0 to OPB: bear= 0x%8.8x besr0= 0x%8.8x besr1= 0x%8.8x\n", + mfdcr(DCRN_PLB0_BEAR), mfdcr(DCRN_POB0_BESR0), + mfdcr(DCRN_POB0_BESR1)); +#endif #ifdef CONFIG_SMP printk(" CPU: %d", current->processor); diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c --- a/arch/ppc/kernel/setup.c Tue Jun 5 14:59:26 2001 +++ b/arch/ppc/kernel/setup.c Tue Jun 5 14:59:26 2001 @@ -36,14 +36,14 @@ #include #include #endif +#ifdef CONFIG_4xx +#include +#endif #include #include #include #include -#ifdef CONFIG_OAK -#include "oak_setup.h" -#endif /* CONFIG_OAK */ extern void pmac_init(unsigned long r3, unsigned long r4, @@ -379,11 +379,12 @@ break; } - len += sprintf(len+buffer, "revision\t: %hd.%hd\n", maj, min); + len += sprintf(len+buffer, "revision\t: %hd.%hd (pvr %04x %04x)\n", + maj, min, PVR_VER(pvr), PVR_REV(pvr)); len += sprintf(buffer+len, "bogomips\t: %lu.%02lu\n", - (CD(loops_per_jiffy)+2500)/(500000/HZ), - (CD(loops_per_jiffy)+2500)/(5000/HZ) % 100); + CD(loops_per_jiffy)/(500000/HZ), + CD(loops_per_jiffy)/(5000/HZ) % 100); bogosum += CD(loops_per_jiffy); } @@ -391,8 +392,8 @@ if ( i ) len += sprintf(buffer+len, "\n"); len += sprintf(buffer+len,"total bogomips\t: %lu.%02lu\n", - (bogosum+2500)/(500000/HZ), - (bogosum+2500)/(5000/HZ) % 100); + bogosum/500000, + bogosum/5000 % 100); #endif /* CONFIG_SMP */ /* diff -Nru a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S --- a/arch/ppc/lib/string.S Tue Jun 5 14:59:26 2001 +++ b/arch/ppc/lib/string.S Tue Jun 5 14:59:26 2001 @@ -176,6 +176,12 @@ stw r4, 8(r6) stw r4, 12(r6) stw r4, 16(r6) +#ifdef CONFIG_4xx + stw r4, 20(r6) + stw r4, 24(r6) + stw r4, 28(r6) + stw r4, 32(r6) +#endif #endif addi r6,r6,CACHELINE_BYTES bdnz 10b @@ -454,7 +460,7 @@ li r11,4 beq 63f -#if !defined(CONFIG_8xx) +#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx) /* Here we decide how far ahead to prefetch the source */ #if MAX_COPY_PREFETCH > 1 /* Heuristically, for large transfers we prefetch @@ -477,7 +483,7 @@ mtctr r0 53: -#if !defined(CONFIG_8xx) +#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx) dcbt r3,r4 dcbz r11,r6 #endif ===== include/asm-ppc/processor.h 1.22 vs edited ===== --- 1.22/include/asm-ppc/processor.h Tue Jun 5 04:45:22 2001 +++ edited/include/asm-ppc/processor.h Thu Jun 7 14:00:01 2001 @@ -445,6 +445,7 @@ #define PVR_403GC 0x00200200 #define PVR_403GCX 0x00201400 #define PVR_405GP 0x40110000 +#define PVR_STB03XXX 0x40310000 #define PVR_601 0x00010000 #define PVR_602 0x00050000 #define PVR_603 0x00030000