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)
12 + return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE));
15 +#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr))
17 +static inline unsigned long bcm4710_fill_tlb(void *addr)
19 + return *(unsigned long *)addr;
22 +#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr))
24 +static inline void bcm4710_protected_fill_tlb(void *addr)
27 + get_dbe(x, (unsigned long *)addr);;
30 -#define BCM4710_FILL_TLB(addr) (*(volatile unsigned long *)(addr))
31 -#define BCM4710_PROTECTED_FILL_TLB(addr) ({ unsigned long x; get_dbe(x, (volatile unsigned long *)(addr)); })
33 #define BCM4710_DUMMY_RREG()
35 --- a/arch/mips/mm/tlbex.c
36 +++ b/arch/mips/mm/tlbex.c
37 @@ -835,6 +835,9 @@ build_get_pgde32(u32 **p, unsigned int t
39 uasm_i_addu(p, ptr, tmp, ptr);
41 +#ifdef CONFIG_BCM47XX
44 UASM_i_LA_mostly(p, ptr, pgdc);
46 uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
47 @@ -1188,12 +1191,12 @@ static void __cpuinit build_r4000_tlb_re
48 /* No need for uasm_i_nop */
51 -#ifdef CONFIG_BCM47XX
55 build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
57 +# ifdef CONFIG_BCM47XX
60 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
63 @@ -1205,6 +1208,9 @@ static void __cpuinit build_r4000_tlb_re
64 build_update_entries(&p, K0, K1);
65 build_tlb_write_entry(&p, &l, &r, tlb_random);
67 +#ifdef CONFIG_BCM47XX
70 uasm_i_eret(&p); /* return from trap */
72 #ifdef CONFIG_HUGETLB_PAGE
73 @@ -1710,12 +1716,12 @@ build_r4000_tlbchange_handler_head(u32 *
74 struct uasm_reloc **r, unsigned int pte,
77 -#ifdef CONFIG_BCM47XX
81 build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */
83 +# ifdef CONFIG_BCM47XX
86 build_get_pgde32(p, pte, ptr); /* get pgd in ptr */
89 @@ -1752,6 +1758,9 @@ build_r4000_tlbchange_handler_tail(u32 *
90 build_update_entries(p, tmp, ptr);
91 build_tlb_write_entry(p, l, r, tlb_indexed);
93 +#ifdef CONFIG_BCM47XX
96 uasm_i_eret(p); /* return from trap */
99 --- a/arch/mips/kernel/genex.S
100 +++ b/arch/mips/kernel/genex.S
102 #include <asm/page.h>
103 #include <asm/thread_info.h>
105 +#ifdef CONFIG_BCM47XX
118 #define PANIC_PIC(msg) \
121 @@ -54,7 +67,6 @@ NESTED(except_vec3_generic, 0, sp)
123 #ifdef CONFIG_BCM47XX
127 #if R5432_CP0_INTERRUPT_WAR
129 @@ -79,6 +91,9 @@ NESTED(except_vec3_r4000, 0, sp)
133 +#ifdef CONFIG_BCM47XX