1 --- a/arch/mips/Kconfig
2 +++ b/arch/mips/Kconfig
3 @@ -18,6 +18,23 @@ choice
8 + bool "Texas Instruments AR7"
10 + select DMA_NONCOHERENT
14 + select SWAP_IO_SPACE
15 + select SYS_HAS_CPU_MIPS32_R1
16 + select SYS_HAS_EARLY_PRINTK
17 + select SYS_SUPPORTS_32BIT_KERNEL
18 + select SYS_SUPPORTS_KGDB
19 + select SYS_SUPPORTS_LITTLE_ENDIAN
20 + select SYS_SUPPORTS_BIG_ENDIAN
22 + select GENERIC_HARDIRQS_NO__DO_IRQ
25 bool "Alchemy processor based machines"
27 --- a/arch/mips/kernel/traps.c
28 +++ b/arch/mips/kernel/traps.c
29 @@ -1188,9 +1188,22 @@ void *set_except_vector(int n, void *add
31 exception_handlers[n] = handler;
32 if (n == 0 && cpu_has_divec) {
33 - *(u32 *)(ebase + 0x200) = 0x08000000 |
34 - (0x03ffffff & (handler >> 2));
35 - flush_icache_range(ebase + 0x200, ebase + 0x204);
36 + if ((handler ^ (ebase + 4)) & 0xfc000000) {
37 + /* lui k0, 0x0000 */
38 + *(u32 *)(ebase + 0x200) = 0x3c1a0000 | (handler >> 16);
39 + /* ori k0, 0x0000 */
40 + *(u32 *)(ebase + 0x204) =
41 + 0x375a0000 | (handler & 0xffff);
43 + *(u32 *)(ebase + 0x208) = 0x03400008;
45 + *(u32 *)(ebase + 0x20C) = 0x00000000;
46 + flush_icache_range(ebase + 0x200, ebase + 0x210);
48 + *(u32 *)(ebase + 0x200) =
49 + 0x08000000 | (0x03ffffff & (handler >> 2));
50 + flush_icache_range(ebase + 0x200, ebase + 0x204);
53 return (void *)old_handler;
55 --- a/arch/mips/Makefile
56 +++ b/arch/mips/Makefile
57 @@ -167,6 +167,13 @@ libs-$(CONFIG_SIBYTE_CFE) += arch/mips/s
61 +# Texas Instruments AR7
63 +core-$(CONFIG_AR7) += arch/mips/ar7/
64 +cflags-$(CONFIG_AR7) += -Iinclude/asm-mips/ar7
65 +load-$(CONFIG_AR7) += 0xffffffff94100000
68 # Acer PICA 61, Mips Magnum 4000 and Olivetti M700.
70 core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/
71 --- a/include/asm-mips/page.h
72 +++ b/include/asm-mips/page.h
73 @@ -182,8 +182,10 @@ typedef struct { unsigned long pgprot; }
74 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
75 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
77 -#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
78 -#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
79 +#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \
81 +#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \
84 #include <asm-generic/memory_model.h>
85 #include <asm-generic/page.h>