add a rebuild and a default mostlyclean target to packages.
[openwrt.git] / openwrt / target / linux / linux-2.4 / patches / brcm / 003-bcm47xx_workarounds.patch
1 diff -urN linux.old/arch/mips/mm/tlbex-mips32.S linux.dev/arch/mips/mm/tlbex-mips32.S
2 --- linux.old/arch/mips/mm/tlbex-mips32.S 2005-05-28 17:42:03.000000000 +0200
3 +++ linux.dev/arch/mips/mm/tlbex-mips32.S 2005-05-28 21:48:55.000000000 +0200
4 @@ -90,6 +90,9 @@
5 .set noat
6 LEAF(except_vec0_r4000)
7 .set mips3
8 +#ifdef CONFIG_BCM4704
9 + nop
10 +#endif
11 #ifdef CONFIG_SMP
12 mfc0 k1, CP0_CONTEXT
13 la k0, pgd_current
14 diff -urN linux.old/arch/mips/mm/pg-r4k.c linux.dev/arch/mips/mm/pg-r4k.c
15 --- linux.old/arch/mips/mm/pg-r4k.c 2005-01-19 15:09:29.000000000 +0100
16 +++ linux.dev/arch/mips/mm/pg-r4k.c 2005-05-28 21:57:52.000000000 +0200
17 @@ -180,6 +180,7 @@
18
19 static inline void build_cdex_s(void)
20 {
21 +#if !defined(CONFIG_BCM4704) && !defined(CONFIG_BCM4710)
22 union mips_instruction mi;
23
24 if ((store_offset & (cpu_scache_line_size() - 1)))
25 @@ -192,10 +193,12 @@
26 mi.c_format.simmediate = store_offset;
27
28 emit_instruction(mi);
29 +#endif
30 }
31
32 static inline void build_cdex_p(void)
33 {
34 +#if !defined(CONFIG_BCM4704) && !defined(CONFIG_BCM4710)
35 union mips_instruction mi;
36
37 if (store_offset & (cpu_dcache_line_size() - 1))
38 @@ -218,6 +221,7 @@
39 mi.c_format.simmediate = store_offset;
40
41 emit_instruction(mi);
42 +#endif
43 }
44
45 static void __build_store_reg(int reg)
46 diff -urN linux.old/include/asm-mips/stackframe.h linux.dev/include/asm-mips/stackframe.h
47 --- linux.old/include/asm-mips/stackframe.h 2002-11-29 00:53:15.000000000 +0100
48 +++ linux.dev/include/asm-mips/stackframe.h 2005-05-28 21:53:03.000000000 +0200
49 @@ -172,6 +172,46 @@
50 rfe; \
51 .set pop
52
53 +#elif defined(CONFIG_BCM4710) || defined(CONFIG_BCM4704)
54 +
55 +#define RESTORE_SOME \
56 + .set push; \
57 + .set reorder; \
58 + mfc0 t0, CP0_STATUS; \
59 + .set pop; \
60 + ori t0, 0x1f; \
61 + xori t0, 0x1f; \
62 + mtc0 t0, CP0_STATUS; \
63 + li v1, 0xff00; \
64 + and t0, v1; \
65 + lw v0, PT_STATUS(sp); \
66 + nor v1, $0, v1; \
67 + and v0, v1; \
68 + or v0, t0; \
69 + ori v1, v0, ST0_IE; \
70 + xori v1, v1, ST0_IE; \
71 + mtc0 v1, CP0_STATUS; \
72 + mtc0 v0, CP0_STATUS; \
73 + lw v1, PT_EPC(sp); \
74 + mtc0 v1, CP0_EPC; \
75 + lw $31, PT_R31(sp); \
76 + lw $28, PT_R28(sp); \
77 + lw $25, PT_R25(sp); \
78 + lw $7, PT_R7(sp); \
79 + lw $6, PT_R6(sp); \
80 + lw $5, PT_R5(sp); \
81 + lw $4, PT_R4(sp); \
82 + lw $3, PT_R3(sp); \
83 + lw $2, PT_R2(sp)
84 +
85 +#define RESTORE_SP_AND_RET \
86 + lw sp, PT_R29(sp); \
87 + nop; \
88 + nop; \
89 + .set mips3; \
90 + eret; \
91 + .set mips0
92 +
93 #else
94
95 #define RESTORE_SOME \
96 diff -urN linux.old/arch/mips/mm/tlbex-r4k.S linux.dev/arch/mips/mm/tlbex-r4k.S
97 --- linux.old/arch/mips/mm/tlbex-r4k.S 2005-05-28 17:42:03.000000000 +0200
98 +++ linux.dev/arch/mips/mm/tlbex-r4k.S 2005-05-29 15:04:43.000000000 +0200
99 @@ -168,6 +168,9 @@
100 .set noat
101 LEAF(except_vec0_r4000)
102 .set mips3
103 +#ifdef CONFIG_BCM4704
104 + nop
105 +#endif
106 GET_PGD(k0, k1) # get pgd pointer
107 mfc0 k0, CP0_BADVADDR # Get faulting address
108 srl k0, k0, _PGDIR_SHIFT # get pgd only bits
109 diff -urN linux.old/arch/mips/kernel/entry.S linux.dev/arch/mips/kernel/entry.S
110 --- linux.old/arch/mips/kernel/entry.S 2003-08-25 13:44:40.000000000 +0200
111 +++ linux.dev/arch/mips/kernel/entry.S 2005-06-01 20:10:36.000000000 +0200
112 @@ -100,6 +100,10 @@
113 * and R4400 SC and MC versions.
114 */
115 NESTED(except_vec3_generic, 0, sp)
116 +#ifdef CONFIG_BCM4710
117 + nop
118 + nop
119 +#endif
120 #if R5432_CP0_INTERRUPT_WAR
121 mfc0 k0, CP0_INDEX
122 #endif
This page took 0.045826 seconds and 5 git commands to generate.