1 --- a/arch/mips/include/asm/r4kcache.h
2 +++ b/arch/mips/include/asm/r4kcache.h
5 #include <asm/paccess.h>
6 #include <linux/ssb/ssb.h>
7 -#define BCM4710_DUMMY_RREG() ((void) *((u8 *) KSEG1ADDR(SSB_ENUM_BASE)))
8 +#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
10 +static inline unsigned long bcm4710_dummy_rreg(void) {
11 + return (*(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE)));
14 +#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void*)(addr))
16 +static inline unsigned long bcm4710_fill_tlb(void *addr) {
17 + return (*(unsigned long *)addr);
20 +#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void*)(addr))
22 +static inline void bcm4710_protected_fill_tlb(void *addr) {
24 + get_dbe(x, (unsigned long *)addr);;
27 -#define BCM4710_FILL_TLB(addr) (*(volatile unsigned long *)(addr))
28 -#define BCM4710_PROTECTED_FILL_TLB(addr) ({ unsigned long x; get_dbe(x, (volatile unsigned long *)(addr)); })
30 #define BCM4710_DUMMY_RREG()
32 --- a/arch/mips/mm/tlbex.c
33 +++ b/arch/mips/mm/tlbex.c
34 @@ -707,6 +707,9 @@ build_get_pgde32(u32 **p, unsigned int t
36 uasm_i_addu(p, ptr, tmp, ptr);
38 +#ifdef CONFIG_BCM47XX
41 UASM_i_LA_mostly(p, ptr, pgdc);
43 uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
44 @@ -868,12 +871,12 @@ static void __cpuinit build_r4000_tlb_re
45 /* No need for uasm_i_nop */
48 -#ifdef CONFIG_BCM47XX
52 build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
54 +# ifdef CONFIG_BCM47XX
57 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
60 @@ -885,6 +888,9 @@ static void __cpuinit build_r4000_tlb_re
61 build_update_entries(&p, K0, K1);
62 build_tlb_write_entry(&p, &l, &r, tlb_random);
64 +#ifdef CONFIG_BCM47XX
67 uasm_i_eret(&p); /* return from trap */
69 #ifdef CONFIG_HUGETLB_PAGE
70 @@ -1321,12 +1327,12 @@ build_r4000_tlbchange_handler_head(u32 *
71 struct uasm_reloc **r, unsigned int pte,
74 -#ifdef CONFIG_BCM47XX
78 build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */
80 +# ifdef CONFIG_BCM47XX
83 build_get_pgde32(p, pte, ptr); /* get pgd in ptr */
86 @@ -1363,6 +1369,9 @@ build_r4000_tlbchange_handler_tail(u32 *
87 build_update_entries(p, tmp, ptr);
88 build_tlb_write_entry(p, l, r, tlb_indexed);
90 +#ifdef CONFIG_BCM47XX
93 uasm_i_eret(p); /* return from trap */
96 --- a/arch/mips/kernel/genex.S
97 +++ b/arch/mips/kernel/genex.S
100 #include <asm/thread_info.h>
102 +#ifdef CONFIG_BCM47XX
115 #define PANIC_PIC(msg) \
118 @@ -54,7 +67,6 @@ NESTED(except_vec3_generic, 0, sp)
120 #ifdef CONFIG_BCM47XX
124 #if R5432_CP0_INTERRUPT_WAR
126 @@ -79,6 +91,9 @@ NESTED(except_vec3_r4000, 0, sp)
130 +#ifdef CONFIG_BCM47XX