aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/asm-eva.h137
-rw-r--r--arch/mips/include/asm/asmmacro-32.h96
-rw-r--r--arch/mips/include/asm/bitops.h7
-rw-r--r--arch/mips/include/asm/bmips.h16
-rw-r--r--arch/mips/include/asm/cacheflush.h38
-rw-r--r--arch/mips/include/asm/cdmm.h98
-rw-r--r--arch/mips/include/asm/cevt-r4k.h19
-rw-r--r--arch/mips/include/asm/checksum.h6
-rw-r--r--arch/mips/include/asm/cmpxchg.h11
-rw-r--r--arch/mips/include/asm/cpu-features.h48
-rw-r--r--arch/mips/include/asm/cpu-info.h2
-rw-r--r--arch/mips/include/asm/cpu-type.h1
-rw-r--r--arch/mips/include/asm/cpu.h8
-rw-r--r--arch/mips/include/asm/dma-mapping.h2
-rw-r--r--arch/mips/include/asm/elf.h12
-rw-r--r--arch/mips/include/asm/fpu.h7
-rw-r--r--arch/mips/include/asm/fpu_emulator.h6
-rw-r--r--arch/mips/include/asm/irq.h3
-rw-r--r--arch/mips/include/asm/mach-ar7/war.h24
-rw-r--r--arch/mips/include/asm/mach-ath25/dma-coherence.h14
-rw-r--r--arch/mips/include/asm/mach-ath25/war.h25
-rw-r--r--arch/mips/include/asm/mach-ath79/war.h24
-rw-r--r--arch/mips/include/asm/mach-au1x00/war.h24
-rw-r--r--arch/mips/include/asm/mach-bcm3384/war.h24
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/bcm47xx.h1
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h4
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h21
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/war.h24
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/dma-coherence.h10
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/war.h24
-rw-r--r--arch/mips/include/asm/mach-bmips/dma-coherence.h (renamed from arch/mips/include/asm/mach-bcm3384/dma-coherence.h)12
-rw-r--r--arch/mips/include/asm/mach-bmips/spaces.h18
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h4
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/mangle-port.h74
-rw-r--r--arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-cobalt/war.h24
-rw-r--r--arch/mips/include/asm/mach-dec/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-dec/war.h24
-rw-r--r--arch/mips/include/asm/mach-emma2rh/war.h24
-rw-r--r--arch/mips/include/asm/mach-generic/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-generic/war.h (renamed from arch/mips/include/asm/mach-ralink/war.h)6
-rw-r--r--arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip27/dma-coherence.h4
-rw-r--r--arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-ip32/dma-coherence.h4
-rw-r--r--arch/mips/include/asm/mach-jazz/dma-coherence.h4
-rw-r--r--arch/mips/include/asm/mach-jazz/war.h24
-rw-r--r--arch/mips/include/asm/mach-jz4740/war.h24
-rw-r--r--arch/mips/include/asm/mach-lantiq/war.h23
-rw-r--r--arch/mips/include/asm/mach-lasat/war.h24
-rw-r--r--arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-loongson/dma-coherence.h4
-rw-r--r--arch/mips/include/asm/mach-loongson/loongson.h4
-rw-r--r--arch/mips/include/asm/mach-loongson/war.h24
-rw-r--r--arch/mips/include/asm/mach-loongson1/war.h24
-rw-r--r--arch/mips/include/asm/mach-netlogic/multi-node.h9
-rw-r--r--arch/mips/include/asm/mach-netlogic/topology.h15
-rw-r--r--arch/mips/include/asm/mach-netlogic/war.h25
-rw-r--r--arch/mips/include/asm/mach-paravirt/war.h25
-rw-r--r--arch/mips/include/asm/mach-pistachio/gpio.h21
-rw-r--r--arch/mips/include/asm/mach-pistachio/irq.h18
-rw-r--r--arch/mips/include/asm/mach-pnx833x/war.h24
-rw-r--r--arch/mips/include/asm/mach-rm/cpu-feature-overrides.h1
-rw-r--r--arch/mips/include/asm/mach-tx39xx/war.h24
-rw-r--r--arch/mips/include/asm/mach-vr41xx/war.h24
-rw-r--r--arch/mips/include/asm/mips-boards/sead3-addr.h83
-rw-r--r--arch/mips/include/asm/mips-r2-to-r6-emul.h9
-rw-r--r--arch/mips/include/asm/mipsregs.h312
-rw-r--r--arch/mips/include/asm/netlogic/common.h21
-rw-r--r--arch/mips/include/asm/netlogic/mips-extns.h8
-rw-r--r--arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h2
-rw-r--r--arch/mips/include/asm/netlogic/xlp-hal/sys.h3
-rw-r--r--arch/mips/include/asm/netlogic/xlp-hal/xlp.h3
-rw-r--r--arch/mips/include/asm/octeon/cvmx-address.h67
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootinfo.h55
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootmem.h14
-rw-r--r--arch/mips/include/asm/octeon/cvmx-fau.h22
-rw-r--r--arch/mips/include/asm/octeon/cvmx-fpa.h7
-rw-r--r--arch/mips/include/asm/octeon/cvmx-l2c.h9
-rw-r--r--arch/mips/include/asm/octeon/cvmx-packet.h8
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pko.h31
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pow.h247
-rw-r--r--arch/mips/include/asm/octeon/cvmx-wqe.h71
-rw-r--r--arch/mips/include/asm/octeon/cvmx.h8
-rw-r--r--arch/mips/include/asm/octeon/octeon.h2
-rw-r--r--arch/mips/include/asm/octeon/pci-octeon.h3
-rw-r--r--arch/mips/include/asm/page.h2
-rw-r--r--arch/mips/include/asm/pci.h2
-rw-r--r--arch/mips/include/asm/pci/bridge.h1
-rw-r--r--arch/mips/include/asm/pgtable-32.h15
-rw-r--r--arch/mips/include/asm/pgtable-64.h10
-rw-r--r--arch/mips/include/asm/pgtable-bits.h96
-rw-r--r--arch/mips/include/asm/pgtable.h83
-rw-r--r--arch/mips/include/asm/r4kcache.h89
-rw-r--r--arch/mips/include/asm/sgi/sgi.h15
-rw-r--r--arch/mips/include/asm/spinlock.h2
-rw-r--r--arch/mips/include/asm/thread_info.h4
98 files changed, 1565 insertions, 1022 deletions
diff --git a/arch/mips/include/asm/asm-eva.h b/arch/mips/include/asm/asm-eva.h
index e41c56e375b1..1e38f0e1ea3e 100644
--- a/arch/mips/include/asm/asm-eva.h
+++ b/arch/mips/include/asm/asm-eva.h
@@ -11,6 +11,36 @@
11#define __ASM_ASM_EVA_H 11#define __ASM_ASM_EVA_H
12 12
13#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
14
15/* Kernel variants */
16
17#define kernel_cache(op, base) "cache " op ", " base "\n"
18#define kernel_ll(reg, addr) "ll " reg ", " addr "\n"
19#define kernel_sc(reg, addr) "sc " reg ", " addr "\n"
20#define kernel_lw(reg, addr) "lw " reg ", " addr "\n"
21#define kernel_lwl(reg, addr) "lwl " reg ", " addr "\n"
22#define kernel_lwr(reg, addr) "lwr " reg ", " addr "\n"
23#define kernel_lh(reg, addr) "lh " reg ", " addr "\n"
24#define kernel_lb(reg, addr) "lb " reg ", " addr "\n"
25#define kernel_lbu(reg, addr) "lbu " reg ", " addr "\n"
26#define kernel_sw(reg, addr) "sw " reg ", " addr "\n"
27#define kernel_swl(reg, addr) "swl " reg ", " addr "\n"
28#define kernel_swr(reg, addr) "swr " reg ", " addr "\n"
29#define kernel_sh(reg, addr) "sh " reg ", " addr "\n"
30#define kernel_sb(reg, addr) "sb " reg ", " addr "\n"
31
32#ifdef CONFIG_32BIT
33/*
34 * No 'sd' or 'ld' instructions in 32-bit but the code will
35 * do the correct thing
36 */
37#define kernel_sd(reg, addr) user_sw(reg, addr)
38#define kernel_ld(reg, addr) user_lw(reg, addr)
39#else
40#define kernel_sd(reg, addr) "sd " reg", " addr "\n"
41#define kernel_ld(reg, addr) "ld " reg", " addr "\n"
42#endif /* CONFIG_32BIT */
43
14#ifdef CONFIG_EVA 44#ifdef CONFIG_EVA
15 45
16#define __BUILD_EVA_INSN(insn, reg, addr) \ 46#define __BUILD_EVA_INSN(insn, reg, addr) \
@@ -41,37 +71,60 @@
41 71
42#else 72#else
43 73
44#define user_cache(op, base) "cache " op ", " base "\n" 74#define user_cache(op, base) kernel_cache(op, base)
45#define user_ll(reg, addr) "ll " reg ", " addr "\n" 75#define user_ll(reg, addr) kernel_ll(reg, addr)
46#define user_sc(reg, addr) "sc " reg ", " addr "\n" 76#define user_sc(reg, addr) kernel_sc(reg, addr)
47#define user_lw(reg, addr) "lw " reg ", " addr "\n" 77#define user_lw(reg, addr) kernel_lw(reg, addr)
48#define user_lwl(reg, addr) "lwl " reg ", " addr "\n" 78#define user_lwl(reg, addr) kernel_lwl(reg, addr)
49#define user_lwr(reg, addr) "lwr " reg ", " addr "\n" 79#define user_lwr(reg, addr) kernel_lwr(reg, addr)
50#define user_lh(reg, addr) "lh " reg ", " addr "\n" 80#define user_lh(reg, addr) kernel_lh(reg, addr)
51#define user_lb(reg, addr) "lb " reg ", " addr "\n" 81#define user_lb(reg, addr) kernel_lb(reg, addr)
52#define user_lbu(reg, addr) "lbu " reg ", " addr "\n" 82#define user_lbu(reg, addr) kernel_lbu(reg, addr)
53#define user_sw(reg, addr) "sw " reg ", " addr "\n" 83#define user_sw(reg, addr) kernel_sw(reg, addr)
54#define user_swl(reg, addr) "swl " reg ", " addr "\n" 84#define user_swl(reg, addr) kernel_swl(reg, addr)
55#define user_swr(reg, addr) "swr " reg ", " addr "\n" 85#define user_swr(reg, addr) kernel_swr(reg, addr)
56#define user_sh(reg, addr) "sh " reg ", " addr "\n" 86#define user_sh(reg, addr) kernel_sh(reg, addr)
57#define user_sb(reg, addr) "sb " reg ", " addr "\n" 87#define user_sb(reg, addr) kernel_sb(reg, addr)
58 88
59#ifdef CONFIG_32BIT 89#ifdef CONFIG_32BIT
60/* 90#define user_sd(reg, addr) kernel_sw(reg, addr)
61 * No 'sd' or 'ld' instructions in 32-bit but the code will 91#define user_ld(reg, addr) kernel_lw(reg, addr)
62 * do the correct thing
63 */
64#define user_sd(reg, addr) user_sw(reg, addr)
65#define user_ld(reg, addr) user_lw(reg, addr)
66#else 92#else
67#define user_sd(reg, addr) "sd " reg", " addr "\n" 93#define user_sd(reg, addr) kernel_sd(reg, addr)
68#define user_ld(reg, addr) "ld " reg", " addr "\n" 94#define user_ld(reg, addr) kernel_ld(reg, addr)
69#endif /* CONFIG_32BIT */ 95#endif /* CONFIG_32BIT */
70 96
71#endif /* CONFIG_EVA */ 97#endif /* CONFIG_EVA */
72 98
73#else /* __ASSEMBLY__ */ 99#else /* __ASSEMBLY__ */
74 100
101#define kernel_cache(op, base) cache op, base
102#define kernel_ll(reg, addr) ll reg, addr
103#define kernel_sc(reg, addr) sc reg, addr
104#define kernel_lw(reg, addr) lw reg, addr
105#define kernel_lwl(reg, addr) lwl reg, addr
106#define kernel_lwr(reg, addr) lwr reg, addr
107#define kernel_lh(reg, addr) lh reg, addr
108#define kernel_lb(reg, addr) lb reg, addr
109#define kernel_lbu(reg, addr) lbu reg, addr
110#define kernel_sw(reg, addr) sw reg, addr
111#define kernel_swl(reg, addr) swl reg, addr
112#define kernel_swr(reg, addr) swr reg, addr
113#define kernel_sh(reg, addr) sh reg, addr
114#define kernel_sb(reg, addr) sb reg, addr
115
116#ifdef CONFIG_32BIT
117/*
118 * No 'sd' or 'ld' instructions in 32-bit but the code will
119 * do the correct thing
120 */
121#define kernel_sd(reg, addr) user_sw(reg, addr)
122#define kernel_ld(reg, addr) user_lw(reg, addr)
123#else
124#define kernel_sd(reg, addr) sd reg, addr
125#define kernel_ld(reg, addr) ld reg, addr
126#endif /* CONFIG_32BIT */
127
75#ifdef CONFIG_EVA 128#ifdef CONFIG_EVA
76 129
77#define __BUILD_EVA_INSN(insn, reg, addr) \ 130#define __BUILD_EVA_INSN(insn, reg, addr) \
@@ -101,31 +154,27 @@
101#define user_sd(reg, addr) user_sw(reg, addr) 154#define user_sd(reg, addr) user_sw(reg, addr)
102#else 155#else
103 156
104#define user_cache(op, base) cache op, base 157#define user_cache(op, base) kernel_cache(op, base)
105#define user_ll(reg, addr) ll reg, addr 158#define user_ll(reg, addr) kernel_ll(reg, addr)
106#define user_sc(reg, addr) sc reg, addr 159#define user_sc(reg, addr) kernel_sc(reg, addr)
107#define user_lw(reg, addr) lw reg, addr 160#define user_lw(reg, addr) kernel_lw(reg, addr)
108#define user_lwl(reg, addr) lwl reg, addr 161#define user_lwl(reg, addr) kernel_lwl(reg, addr)
109#define user_lwr(reg, addr) lwr reg, addr 162#define user_lwr(reg, addr) kernel_lwr(reg, addr)
110#define user_lh(reg, addr) lh reg, addr 163#define user_lh(reg, addr) kernel_lh(reg, addr)
111#define user_lb(reg, addr) lb reg, addr 164#define user_lb(reg, addr) kernel_lb(reg, addr)
112#define user_lbu(reg, addr) lbu reg, addr 165#define user_lbu(reg, addr) kernel_lbu(reg, addr)
113#define user_sw(reg, addr) sw reg, addr 166#define user_sw(reg, addr) kernel_sw(reg, addr)
114#define user_swl(reg, addr) swl reg, addr 167#define user_swl(reg, addr) kernel_swl(reg, addr)
115#define user_swr(reg, addr) swr reg, addr 168#define user_swr(reg, addr) kernel_swr(reg, addr)
116#define user_sh(reg, addr) sh reg, addr 169#define user_sh(reg, addr) kernel_sh(reg, addr)
117#define user_sb(reg, addr) sb reg, addr 170#define user_sb(reg, addr) kernel_sb(reg, addr)
118 171
119#ifdef CONFIG_32BIT 172#ifdef CONFIG_32BIT
120/* 173#define user_sd(reg, addr) kernel_sw(reg, addr)
121 * No 'sd' or 'ld' instructions in 32-bit but the code will 174#define user_ld(reg, addr) kernel_lw(reg, addr)
122 * do the correct thing
123 */
124#define user_sd(reg, addr) user_sw(reg, addr)
125#define user_ld(reg, addr) user_lw(reg, addr)
126#else 175#else
127#define user_sd(reg, addr) sd reg, addr 176#define user_sd(reg, addr) kernel_sd(reg, addr)
128#define user_ld(reg, addr) ld reg, addr 177#define user_ld(reg, addr) kernel_sd(reg, addr)
129#endif /* CONFIG_32BIT */ 178#endif /* CONFIG_32BIT */
130 179
131#endif /* CONFIG_EVA */ 180#endif /* CONFIG_EVA */
diff --git a/arch/mips/include/asm/asmmacro-32.h b/arch/mips/include/asm/asmmacro-32.h
index 80386470d3a4..0ef39ad0f2d4 100644
--- a/arch/mips/include/asm/asmmacro-32.h
+++ b/arch/mips/include/asm/asmmacro-32.h
@@ -16,38 +16,22 @@
16 .set push 16 .set push
17 SET_HARDFLOAT 17 SET_HARDFLOAT
18 cfc1 \tmp, fcr31 18 cfc1 \tmp, fcr31
19 swc1 $f0, THREAD_FPR0(\thread) 19 s.d $f0, THREAD_FPR0(\thread)
20 swc1 $f1, THREAD_FPR1(\thread) 20 s.d $f2, THREAD_FPR2(\thread)
21 swc1 $f2, THREAD_FPR2(\thread) 21 s.d $f4, THREAD_FPR4(\thread)
22 swc1 $f3, THREAD_FPR3(\thread) 22 s.d $f6, THREAD_FPR6(\thread)
23 swc1 $f4, THREAD_FPR4(\thread) 23 s.d $f8, THREAD_FPR8(\thread)
24 swc1 $f5, THREAD_FPR5(\thread) 24 s.d $f10, THREAD_FPR10(\thread)
25 swc1 $f6, THREAD_FPR6(\thread) 25 s.d $f12, THREAD_FPR12(\thread)
26 swc1 $f7, THREAD_FPR7(\thread) 26 s.d $f14, THREAD_FPR14(\thread)
27 swc1 $f8, THREAD_FPR8(\thread) 27 s.d $f16, THREAD_FPR16(\thread)
28 swc1 $f9, THREAD_FPR9(\thread) 28 s.d $f18, THREAD_FPR18(\thread)
29 swc1 $f10, THREAD_FPR10(\thread) 29 s.d $f20, THREAD_FPR20(\thread)
30 swc1 $f11, THREAD_FPR11(\thread) 30 s.d $f22, THREAD_FPR22(\thread)
31 swc1 $f12, THREAD_FPR12(\thread) 31 s.d $f24, THREAD_FPR24(\thread)
32 swc1 $f13, THREAD_FPR13(\thread) 32 s.d $f26, THREAD_FPR26(\thread)
33 swc1 $f14, THREAD_FPR14(\thread) 33 s.d $f28, THREAD_FPR28(\thread)
34 swc1 $f15, THREAD_FPR15(\thread) 34 s.d $f30, THREAD_FPR30(\thread)
35 swc1 $f16, THREAD_FPR16(\thread)
36 swc1 $f17, THREAD_FPR17(\thread)
37 swc1 $f18, THREAD_FPR18(\thread)
38 swc1 $f19, THREAD_FPR19(\thread)
39 swc1 $f20, THREAD_FPR20(\thread)
40 swc1 $f21, THREAD_FPR21(\thread)
41 swc1 $f22, THREAD_FPR22(\thread)
42 swc1 $f23, THREAD_FPR23(\thread)
43 swc1 $f24, THREAD_FPR24(\thread)
44 swc1 $f25, THREAD_FPR25(\thread)
45 swc1 $f26, THREAD_FPR26(\thread)
46 swc1 $f27, THREAD_FPR27(\thread)
47 swc1 $f28, THREAD_FPR28(\thread)
48 swc1 $f29, THREAD_FPR29(\thread)
49 swc1 $f30, THREAD_FPR30(\thread)
50 swc1 $f31, THREAD_FPR31(\thread)
51 sw \tmp, THREAD_FCR31(\thread) 35 sw \tmp, THREAD_FCR31(\thread)
52 .set pop 36 .set pop
53 .endm 37 .endm
@@ -56,38 +40,22 @@
56 .set push 40 .set push
57 SET_HARDFLOAT 41 SET_HARDFLOAT
58 lw \tmp, THREAD_FCR31(\thread) 42 lw \tmp, THREAD_FCR31(\thread)
59 lwc1 $f0, THREAD_FPR0(\thread) 43 l.d $f0, THREAD_FPR0(\thread)
60 lwc1 $f1, THREAD_FPR1(\thread) 44 l.d $f2, THREAD_FPR2(\thread)
61 lwc1 $f2, THREAD_FPR2(\thread) 45 l.d $f4, THREAD_FPR4(\thread)
62 lwc1 $f3, THREAD_FPR3(\thread) 46 l.d $f6, THREAD_FPR6(\thread)
63 lwc1 $f4, THREAD_FPR4(\thread) 47 l.d $f8, THREAD_FPR8(\thread)
64 lwc1 $f5, THREAD_FPR5(\thread) 48 l.d $f10, THREAD_FPR10(\thread)
65 lwc1 $f6, THREAD_FPR6(\thread) 49 l.d $f12, THREAD_FPR12(\thread)
66 lwc1 $f7, THREAD_FPR7(\thread) 50 l.d $f14, THREAD_FPR14(\thread)
67 lwc1 $f8, THREAD_FPR8(\thread) 51 l.d $f16, THREAD_FPR16(\thread)
68 lwc1 $f9, THREAD_FPR9(\thread) 52 l.d $f18, THREAD_FPR18(\thread)
69 lwc1 $f10, THREAD_FPR10(\thread) 53 l.d $f20, THREAD_FPR20(\thread)
70 lwc1 $f11, THREAD_FPR11(\thread) 54 l.d $f22, THREAD_FPR22(\thread)
71 lwc1 $f12, THREAD_FPR12(\thread) 55 l.d $f24, THREAD_FPR24(\thread)
72 lwc1 $f13, THREAD_FPR13(\thread) 56 l.d $f26, THREAD_FPR26(\thread)
73 lwc1 $f14, THREAD_FPR14(\thread) 57 l.d $f28, THREAD_FPR28(\thread)
74 lwc1 $f15, THREAD_FPR15(\thread) 58 l.d $f30, THREAD_FPR30(\thread)
75 lwc1 $f16, THREAD_FPR16(\thread)
76 lwc1 $f17, THREAD_FPR17(\thread)
77 lwc1 $f18, THREAD_FPR18(\thread)
78 lwc1 $f19, THREAD_FPR19(\thread)
79 lwc1 $f20, THREAD_FPR20(\thread)
80 lwc1 $f21, THREAD_FPR21(\thread)
81 lwc1 $f22, THREAD_FPR22(\thread)
82 lwc1 $f23, THREAD_FPR23(\thread)
83 lwc1 $f24, THREAD_FPR24(\thread)
84 lwc1 $f25, THREAD_FPR25(\thread)
85 lwc1 $f26, THREAD_FPR26(\thread)
86 lwc1 $f27, THREAD_FPR27(\thread)
87 lwc1 $f28, THREAD_FPR28(\thread)
88 lwc1 $f29, THREAD_FPR29(\thread)
89 lwc1 $f30, THREAD_FPR30(\thread)
90 lwc1 $f31, THREAD_FPR31(\thread)
91 ctc1 \tmp, fcr31 59 ctc1 \tmp, fcr31
92 .set pop 60 .set pop
93 .endm 61 .endm
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 9f935f6aa996..0cf29bd5dc5c 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -481,7 +481,7 @@ static inline unsigned long __fls(unsigned long word)
481{ 481{
482 int num; 482 int num;
483 483
484 if (BITS_PER_LONG == 32 && 484 if (BITS_PER_LONG == 32 && !__builtin_constant_p(word) &&
485 __builtin_constant_p(cpu_has_clo_clz) && cpu_has_clo_clz) { 485 __builtin_constant_p(cpu_has_clo_clz) && cpu_has_clo_clz) {
486 __asm__( 486 __asm__(
487 " .set push \n" 487 " .set push \n"
@@ -494,7 +494,7 @@ static inline unsigned long __fls(unsigned long word)
494 return 31 - num; 494 return 31 - num;
495 } 495 }
496 496
497 if (BITS_PER_LONG == 64 && 497 if (BITS_PER_LONG == 64 && !__builtin_constant_p(word) &&
498 __builtin_constant_p(cpu_has_mips64) && cpu_has_mips64) { 498 __builtin_constant_p(cpu_has_mips64) && cpu_has_mips64) {
499 __asm__( 499 __asm__(
500 " .set push \n" 500 " .set push \n"
@@ -559,7 +559,8 @@ static inline int fls(int x)
559{ 559{
560 int r; 560 int r;
561 561
562 if (__builtin_constant_p(cpu_has_clo_clz) && cpu_has_clo_clz) { 562 if (!__builtin_constant_p(x) &&
563 __builtin_constant_p(cpu_has_clo_clz) && cpu_has_clo_clz) {
563 __asm__( 564 __asm__(
564 " .set push \n" 565 " .set push \n"
565 " .set "MIPS_ISA_LEVEL" \n" 566 " .set "MIPS_ISA_LEVEL" \n"
diff --git a/arch/mips/include/asm/bmips.h b/arch/mips/include/asm/bmips.h
index 30939b02e3ff..6d25ad33ec78 100644
--- a/arch/mips/include/asm/bmips.h
+++ b/arch/mips/include/asm/bmips.h
@@ -122,6 +122,22 @@ static inline void bmips_write_zscm_reg(unsigned int offset, unsigned long data)
122 barrier(); 122 barrier();
123} 123}
124 124
125static inline void bmips_post_dma_flush(struct device *dev)
126{
127 void __iomem *cbr = BMIPS_GET_CBR();
128 u32 cfg;
129
130 if (boot_cpu_type() != CPU_BMIPS3300 &&
131 boot_cpu_type() != CPU_BMIPS4350 &&
132 boot_cpu_type() != CPU_BMIPS4380)
133 return;
134
135 /* Flush stale data out of the readahead cache */
136 cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
137 __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
138 __raw_readl(cbr + BMIPS_RAC_CONFIG);
139}
140
125#endif /* !defined(__ASSEMBLY__) */ 141#endif /* !defined(__ASSEMBLY__) */
126 142
127#endif /* _ASM_BMIPS_H */ 143#endif /* _ASM_BMIPS_H */
diff --git a/arch/mips/include/asm/cacheflush.h b/arch/mips/include/asm/cacheflush.h
index e08381a37f8b..723229f4cf27 100644
--- a/arch/mips/include/asm/cacheflush.h
+++ b/arch/mips/include/asm/cacheflush.h
@@ -29,6 +29,20 @@
29 * - flush_icache_all() flush the entire instruction cache 29 * - flush_icache_all() flush the entire instruction cache
30 * - flush_data_cache_page() flushes a page from the data cache 30 * - flush_data_cache_page() flushes a page from the data cache
31 */ 31 */
32
33 /*
34 * This flag is used to indicate that the page pointed to by a pte
35 * is dirty and requires cleaning before returning it to the user.
36 */
37#define PG_dcache_dirty PG_arch_1
38
39#define Page_dcache_dirty(page) \
40 test_bit(PG_dcache_dirty, &(page)->flags)
41#define SetPageDcacheDirty(page) \
42 set_bit(PG_dcache_dirty, &(page)->flags)
43#define ClearPageDcacheDirty(page) \
44 clear_bit(PG_dcache_dirty, &(page)->flags)
45
32extern void (*flush_cache_all)(void); 46extern void (*flush_cache_all)(void);
33extern void (*__flush_cache_all)(void); 47extern void (*__flush_cache_all)(void);
34extern void (*flush_cache_mm)(struct mm_struct *mm); 48extern void (*flush_cache_mm)(struct mm_struct *mm);
@@ -37,13 +51,15 @@ extern void (*flush_cache_range)(struct vm_area_struct *vma,
37 unsigned long start, unsigned long end); 51 unsigned long start, unsigned long end);
38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); 52extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
39extern void __flush_dcache_page(struct page *page); 53extern void __flush_dcache_page(struct page *page);
54extern void __flush_icache_page(struct vm_area_struct *vma, struct page *page);
40 55
41#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 56#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
42static inline void flush_dcache_page(struct page *page) 57static inline void flush_dcache_page(struct page *page)
43{ 58{
44 if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc) 59 if (cpu_has_dc_aliases)
45 __flush_dcache_page(page); 60 __flush_dcache_page(page);
46 61 else if (!cpu_has_ic_fills_f_dc)
62 SetPageDcacheDirty(page);
47} 63}
48 64
49#define flush_dcache_mmap_lock(mapping) do { } while (0) 65#define flush_dcache_mmap_lock(mapping) do { } while (0)
@@ -61,6 +77,11 @@ static inline void flush_anon_page(struct vm_area_struct *vma,
61static inline void flush_icache_page(struct vm_area_struct *vma, 77static inline void flush_icache_page(struct vm_area_struct *vma,
62 struct page *page) 78 struct page *page)
63{ 79{
80 if (!cpu_has_ic_fills_f_dc && (vma->vm_flags & VM_EXEC) &&
81 Page_dcache_dirty(page)) {
82 __flush_icache_page(vma, page);
83 ClearPageDcacheDirty(page);
84 }
64} 85}
65 86
66extern void (*flush_icache_range)(unsigned long start, unsigned long end); 87extern void (*flush_icache_range)(unsigned long start, unsigned long end);
@@ -95,19 +116,6 @@ extern void (*flush_icache_all)(void);
95extern void (*local_flush_data_cache_page)(void * addr); 116extern void (*local_flush_data_cache_page)(void * addr);
96extern void (*flush_data_cache_page)(unsigned long addr); 117extern void (*flush_data_cache_page)(unsigned long addr);
97 118
98/*
99 * This flag is used to indicate that the page pointed to by a pte
100 * is dirty and requires cleaning before returning it to the user.
101 */
102#define PG_dcache_dirty PG_arch_1
103
104#define Page_dcache_dirty(page) \
105 test_bit(PG_dcache_dirty, &(page)->flags)
106#define SetPageDcacheDirty(page) \
107 set_bit(PG_dcache_dirty, &(page)->flags)
108#define ClearPageDcacheDirty(page) \
109 clear_bit(PG_dcache_dirty, &(page)->flags)
110
111/* Run kernel code uncached, useful for cache probing functions. */ 119/* Run kernel code uncached, useful for cache probing functions. */
112unsigned long run_uncached(void *func); 120unsigned long run_uncached(void *func);
113 121
diff --git a/arch/mips/include/asm/cdmm.h b/arch/mips/include/asm/cdmm.h
new file mode 100644
index 000000000000..16e22ce9719f
--- /dev/null
+++ b/arch/mips/include/asm/cdmm.h
@@ -0,0 +1,98 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2014 Imagination Technologies Ltd.
7 */
8#ifndef __ASM_CDMM_H
9#define __ASM_CDMM_H
10
11#include <linux/device.h>
12#include <linux/mod_devicetable.h>
13
14/**
15 * struct mips_cdmm_device - Represents a single device on a CDMM bus.
16 * @dev: Driver model device object.
17 * @cpu: CPU which can access this device.
18 * @res: MMIO resource.
19 * @type: Device type identifier.
20 * @rev: Device revision number.
21 */
22struct mips_cdmm_device {
23 struct device dev;
24 unsigned int cpu;
25 struct resource res;
26 unsigned int type;
27 unsigned int rev;
28};
29
30/**
31 * struct mips_cdmm_driver - Represents a driver for a CDMM device.
32 * @drv: Driver model driver object.
33 * @probe Callback for probing newly discovered devices.
34 * @remove: Callback to remove the device.
35 * @shutdown: Callback on system shutdown.
36 * @cpu_down: Callback when the parent CPU is going down.
37 * Any CPU pinned threads/timers should be disabled.
38 * @cpu_up: Callback when the parent CPU is coming back up again.
39 * CPU pinned threads/timers can be restarted.
40 * @id_table: Table for CDMM IDs to match against.
41 */
42struct mips_cdmm_driver {
43 struct device_driver drv;
44 int (*probe)(struct mips_cdmm_device *);
45 int (*remove)(struct mips_cdmm_device *);
46 void (*shutdown)(struct mips_cdmm_device *);
47 int (*cpu_down)(struct mips_cdmm_device *);
48 int (*cpu_up)(struct mips_cdmm_device *);
49 const struct mips_cdmm_device_id *id_table;
50};
51
52/**
53 * mips_cdmm_phys_base() - Choose a physical base address for CDMM region.
54 *
55 * Picking a suitable physical address at which to map the CDMM region is
56 * platform specific, so this weak function can be defined by platform code to
57 * pick a suitable value if none is configured by the bootloader.
58 *
59 * This address must be 32kB aligned, and the region occupies a maximum of 32kB
60 * of physical address space which must not be used for anything else.
61 *
62 * Returns: Physical base address for CDMM region, or 0 on failure.
63 */
64phys_addr_t __weak mips_cdmm_phys_base(void);
65
66extern struct bus_type mips_cdmm_bustype;
67void __iomem *mips_cdmm_early_probe(unsigned int dev_type);
68
69#define to_mips_cdmm_device(d) container_of(d, struct mips_cdmm_device, dev)
70
71#define mips_cdmm_get_drvdata(d) dev_get_drvdata(&d->dev)
72#define mips_cdmm_set_drvdata(d, p) dev_set_drvdata(&d->dev, p)
73
74int mips_cdmm_driver_register(struct mips_cdmm_driver *);
75void mips_cdmm_driver_unregister(struct mips_cdmm_driver *);
76
77/*
78 * module_mips_cdmm_driver() - Helper macro for drivers that don't do
79 * anything special in module init/exit. This eliminates a lot of
80 * boilerplate. Each module may only use this macro once, and
81 * calling it replaces module_init() and module_exit()
82 */
83#define module_mips_cdmm_driver(__mips_cdmm_driver) \
84 module_driver(__mips_cdmm_driver, mips_cdmm_driver_register, \
85 mips_cdmm_driver_unregister)
86
87/* drivers/tty/mips_ejtag_fdc.c */
88
89#ifdef CONFIG_MIPS_EJTAG_FDC_EARLYCON
90int setup_early_fdc_console(void);
91#else
92static inline int setup_early_fdc_console(void)
93{
94 return -ENODEV;
95}
96#endif
97
98#endif /* __ASM_CDMM_H */
diff --git a/arch/mips/include/asm/cevt-r4k.h b/arch/mips/include/asm/cevt-r4k.h
index 65f9bdd02f1f..f0edf6fcd002 100644
--- a/arch/mips/include/asm/cevt-r4k.h
+++ b/arch/mips/include/asm/cevt-r4k.h
@@ -27,23 +27,4 @@ irqreturn_t c0_compare_interrupt(int, void *);
27extern struct irqaction c0_compare_irqaction; 27extern struct irqaction c0_compare_irqaction;
28extern int cp0_timer_irq_installed; 28extern int cp0_timer_irq_installed;
29 29
30/*
31 * Possibly handle a performance counter interrupt.
32 * Return true if the timer interrupt should not be checked
33 */
34
35static inline int handle_perf_irq(int r2)
36{
37 /*
38 * The performance counter overflow interrupt may be shared with the
39 * timer interrupt (cp0_perfcount_irq < 0). If it is and a
40 * performance counter has overflowed (perf_irq() == IRQ_HANDLED)
41 * and we can't reliably determine if a counter interrupt has also
42 * happened (!r2) then don't check for a timer interrupt.
43 */
44 return (cp0_perfcount_irq < 0) &&
45 perf_irq() == IRQ_HANDLED &&
46 !r2;
47}
48
49#endif /* __ASM_CEVT_R4K_H */ 30#endif /* __ASM_CEVT_R4K_H */
diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index 5c585c5c1c3e..3ceacde5eb6e 100644
--- a/arch/mips/include/asm/checksum.h
+++ b/arch/mips/include/asm/checksum.h
@@ -218,6 +218,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
218 __u32 len, unsigned short proto, 218 __u32 len, unsigned short proto,
219 __wsum sum) 219 __wsum sum)
220{ 220{
221 __wsum tmp;
222
221 __asm__( 223 __asm__(
222 " .set push # csum_ipv6_magic\n" 224 " .set push # csum_ipv6_magic\n"
223 " .set noreorder \n" 225 " .set noreorder \n"
@@ -270,9 +272,9 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
270 272
271 " addu %0, $1 # Add final carry\n" 273 " addu %0, $1 # Add final carry\n"
272 " .set pop" 274 " .set pop"
273 : "=r" (sum), "=r" (proto) 275 : "=&r" (sum), "=&r" (tmp)
274 : "r" (saddr), "r" (daddr), 276 : "r" (saddr), "r" (daddr),
275 "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); 277 "0" (htonl(len)), "r" (htonl(proto)), "r" (sum));
276 278
277 return csum_fold(sum); 279 return csum_fold(sum);
278} 280}
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index d0a2a68ca600..412f945f1f5e 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -229,21 +229,22 @@ extern void __cmpxchg_called_with_bad_pointer(void);
229#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_mb__before_llsc(), smp_llsc_mb()) 229#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_mb__before_llsc(), smp_llsc_mb())
230#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, , ) 230#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new, , )
231 231
232#define cmpxchg64(ptr, o, n) \ 232#ifdef CONFIG_64BIT
233#define cmpxchg64_local(ptr, o, n) \
233 ({ \ 234 ({ \
234 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 235 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
235 cmpxchg((ptr), (o), (n)); \ 236 cmpxchg_local((ptr), (o), (n)); \
236 }) 237 })
237 238
238#ifdef CONFIG_64BIT 239#define cmpxchg64(ptr, o, n) \
239#define cmpxchg64_local(ptr, o, n) \
240 ({ \ 240 ({ \
241 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 241 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
242 cmpxchg_local((ptr), (o), (n)); \ 242 cmpxchg((ptr), (o), (n)); \
243 }) 243 })
244#else 244#else
245#include <asm-generic/cmpxchg-local.h> 245#include <asm-generic/cmpxchg-local.h>
246#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 246#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
247#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
247#endif 248#endif
248 249
249#endif /* __ASM_CMPXCHG_H */ 250#endif /* __ASM_CMPXCHG_H */
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 0d8208de9a3f..5aeaf19c26b0 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -68,6 +68,7 @@
68#ifndef cpu_has_octeon_cache 68#ifndef cpu_has_octeon_cache
69#define cpu_has_octeon_cache 0 69#define cpu_has_octeon_cache 0
70#endif 70#endif
71/* Don't override `cpu_has_fpu' to 1 or the "nofpu" option won't work. */
71#ifndef cpu_has_fpu 72#ifndef cpu_has_fpu
72#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) 73#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU)
73#define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) 74#define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU)
@@ -139,6 +140,9 @@
139# endif 140# endif
140#endif 141#endif
141 142
143#ifndef cpu_has_xpa
144#define cpu_has_xpa (cpu_data[0].options & MIPS_CPU_XPA)
145#endif
142#ifndef cpu_has_vtag_icache 146#ifndef cpu_has_vtag_icache
143#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) 147#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
144#endif 148#endif
@@ -220,8 +224,11 @@
220#define cpu_has_mips_4_5_r (cpu_has_mips_4 | cpu_has_mips_5_r) 224#define cpu_has_mips_4_5_r (cpu_has_mips_4 | cpu_has_mips_5_r)
221#define cpu_has_mips_5_r (cpu_has_mips_5 | cpu_has_mips_r) 225#define cpu_has_mips_5_r (cpu_has_mips_5 | cpu_has_mips_r)
222 226
223#define cpu_has_mips_4_5_r2_r6 (cpu_has_mips_4_5 | cpu_has_mips_r2 | \ 227#define cpu_has_mips_3_4_5_64_r2_r6 \
224 cpu_has_mips_r6) 228 (cpu_has_mips_3 | cpu_has_mips_4_5_64_r2_r6)
229#define cpu_has_mips_4_5_64_r2_r6 \
230 (cpu_has_mips_4_5 | cpu_has_mips64r1 | \
231 cpu_has_mips_r2 | cpu_has_mips_r6)
225 232
226#define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2 | cpu_has_mips32r6) 233#define cpu_has_mips32 (cpu_has_mips32r1 | cpu_has_mips32r2 | cpu_has_mips32r6)
227#define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2 | cpu_has_mips64r6) 234#define cpu_has_mips64 (cpu_has_mips64r1 | cpu_has_mips64r2 | cpu_has_mips64r6)
@@ -235,8 +242,39 @@
235/* MIPSR2 and MIPSR6 have a lot of similarities */ 242/* MIPSR2 and MIPSR6 have a lot of similarities */
236#define cpu_has_mips_r2_r6 (cpu_has_mips_r2 | cpu_has_mips_r6) 243#define cpu_has_mips_r2_r6 (cpu_has_mips_r2 | cpu_has_mips_r6)
237 244
245/*
246 * cpu_has_mips_r2_exec_hazard - return if IHB is required on current processor
247 *
248 * Returns non-zero value if the current processor implementation requires
249 * an IHB instruction to deal with an instruction hazard as per MIPS R2
250 * architecture specification, zero otherwise.
251 */
238#ifndef cpu_has_mips_r2_exec_hazard 252#ifndef cpu_has_mips_r2_exec_hazard
239#define cpu_has_mips_r2_exec_hazard (cpu_has_mips_r2 | cpu_has_mips_r6) 253#define cpu_has_mips_r2_exec_hazard \
254({ \
255 int __res; \
256 \
257 switch (current_cpu_type()) { \
258 case CPU_M14KC: \
259 case CPU_74K: \
260 case CPU_1074K: \
261 case CPU_PROAPTIV: \
262 case CPU_P5600: \
263 case CPU_M5150: \
264 case CPU_QEMU_GENERIC: \
265 case CPU_CAVIUM_OCTEON: \
266 case CPU_CAVIUM_OCTEON_PLUS: \
267 case CPU_CAVIUM_OCTEON2: \
268 case CPU_CAVIUM_OCTEON3: \
269 __res = 0; \
270 break; \
271 \
272 default: \
273 __res = 1; \
274 } \
275 \
276 __res; \
277})
240#endif 278#endif
241 279
242/* 280/*
@@ -366,4 +404,8 @@
366# define cpu_has_fre (cpu_data[0].options & MIPS_CPU_FRE) 404# define cpu_has_fre (cpu_data[0].options & MIPS_CPU_FRE)
367#endif 405#endif
368 406
407#ifndef cpu_has_cdmm
408# define cpu_has_cdmm (cpu_data[0].options & MIPS_CPU_CDMM)
409#endif
410
369#endif /* __ASM_CPU_FEATURES_H */ 411#endif /* __ASM_CPU_FEATURES_H */
diff --git a/arch/mips/include/asm/cpu-info.h b/arch/mips/include/asm/cpu-info.h
index c3f4f2d2e108..e7dc785a91ca 100644
--- a/arch/mips/include/asm/cpu-info.h
+++ b/arch/mips/include/asm/cpu-info.h
@@ -49,6 +49,8 @@ struct cpuinfo_mips {
49 unsigned int udelay_val; 49 unsigned int udelay_val;
50 unsigned int processor_id; 50 unsigned int processor_id;
51 unsigned int fpu_id; 51 unsigned int fpu_id;
52 unsigned int fpu_csr31;
53 unsigned int fpu_msk31;
52 unsigned int msa_id; 54 unsigned int msa_id;
53 unsigned int cputype; 55 unsigned int cputype;
54 int isa_level; 56 int isa_level;
diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h
index 8245875f8b33..33f3cab9e689 100644
--- a/arch/mips/include/asm/cpu-type.h
+++ b/arch/mips/include/asm/cpu-type.h
@@ -157,6 +157,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
157 case CPU_R10000: 157 case CPU_R10000:
158 case CPU_R12000: 158 case CPU_R12000:
159 case CPU_R14000: 159 case CPU_R14000:
160 case CPU_R16000:
160#endif 161#endif
161#ifdef CONFIG_SYS_HAS_CPU_RM7000 162#ifdef CONFIG_SYS_HAS_CPU_RM7000
162 case CPU_RM7000: 163 case CPU_RM7000:
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 15687234d70a..e3adca1d0b99 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -67,7 +67,7 @@
67#define PRID_IMP_R4300 0x0b00 67#define PRID_IMP_R4300 0x0b00
68#define PRID_IMP_VR41XX 0x0c00 68#define PRID_IMP_VR41XX 0x0c00
69#define PRID_IMP_R12000 0x0e00 69#define PRID_IMP_R12000 0x0e00
70#define PRID_IMP_R14000 0x0f00 70#define PRID_IMP_R14000 0x0f00 /* R14K && R16K */
71#define PRID_IMP_R8000 0x1000 71#define PRID_IMP_R8000 0x1000
72#define PRID_IMP_PR4450 0x1200 72#define PRID_IMP_PR4450 0x1200
73#define PRID_IMP_R4600 0x2000 73#define PRID_IMP_R4600 0x2000
@@ -284,8 +284,8 @@ enum cpu_type_enum {
284 CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310, 284 CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310,
285 CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650, 285 CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650,
286 CPU_R4700, CPU_R5000, CPU_R5500, CPU_NEVADA, CPU_R5432, CPU_R10000, 286 CPU_R4700, CPU_R5000, CPU_R5500, CPU_NEVADA, CPU_R5432, CPU_R10000,
287 CPU_R12000, CPU_R14000, CPU_VR41XX, CPU_VR4111, CPU_VR4121, CPU_VR4122, 287 CPU_R12000, CPU_R14000, CPU_R16000, CPU_VR41XX, CPU_VR4111, CPU_VR4121,
288 CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000, 288 CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000,
289 CPU_SR71000, CPU_TX49XX, 289 CPU_SR71000, CPU_TX49XX,
290 290
291 /* 291 /*
@@ -377,6 +377,8 @@ enum cpu_type_enum {
377#define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */ 377#define MIPS_CPU_MAAR 0x400000000ull /* MAAR(I) registers are present */
378#define MIPS_CPU_FRE 0x800000000ull /* FRE & UFE bits implemented */ 378#define MIPS_CPU_FRE 0x800000000ull /* FRE & UFE bits implemented */
379#define MIPS_CPU_RW_LLB 0x1000000000ull /* LLADDR/LLB writes are allowed */ 379#define MIPS_CPU_RW_LLB 0x1000000000ull /* LLADDR/LLB writes are allowed */
380#define MIPS_CPU_XPA 0x2000000000ull /* CPU supports Extended Physical Addressing */
381#define MIPS_CPU_CDMM 0x4000000000ull /* CPU has Common Device Memory Map */
380 382
381/* 383/*
382 * CPU ASE encodings 384 * CPU ASE encodings
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index 06412aa9e3fb..fd1b4a150759 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -23,7 +23,7 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
23static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) 23static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
24{ 24{
25 if (!dev->dma_mask) 25 if (!dev->dma_mask)
26 return 0; 26 return false;
27 27
28 return addr + size <= *dev->dma_mask; 28 return addr + size <= *dev->dma_mask;
29} 29}
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index 31d747d46a23..a594d8ed9698 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -11,6 +11,9 @@
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <uapi/linux/elf.h> 12#include <uapi/linux/elf.h>
13 13
14#include <asm/cpu-info.h>
15#include <asm/current.h>
16
14/* ELF header e_flags defines. */ 17/* ELF header e_flags defines. */
15/* MIPS architecture level. */ 18/* MIPS architecture level. */
16#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ 19#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
@@ -294,9 +297,14 @@ do { \
294 if (personality(current->personality) != PER_LINUX) \ 297 if (personality(current->personality) != PER_LINUX) \
295 set_personality(PER_LINUX); \ 298 set_personality(PER_LINUX); \
296 \ 299 \
300 clear_thread_flag(TIF_HYBRID_FPREGS); \
301 set_thread_flag(TIF_32BIT_FPREGS); \
302 \
297 mips_set_personality_fp(state); \ 303 mips_set_personality_fp(state); \
298 \ 304 \
299 current->thread.abi = &mips_abi; \ 305 current->thread.abi = &mips_abi; \
306 \
307 current->thread.fpu.fcr31 = current_cpu_data.fpu_csr31; \
300} while (0) 308} while (0)
301 309
302#endif /* CONFIG_32BIT */ 310#endif /* CONFIG_32BIT */
@@ -319,6 +327,8 @@ do { \
319 do { \ 327 do { \
320 set_thread_flag(TIF_32BIT_REGS); \ 328 set_thread_flag(TIF_32BIT_REGS); \
321 set_thread_flag(TIF_32BIT_ADDR); \ 329 set_thread_flag(TIF_32BIT_ADDR); \
330 clear_thread_flag(TIF_HYBRID_FPREGS); \
331 set_thread_flag(TIF_32BIT_FPREGS); \
322 \ 332 \
323 mips_set_personality_fp(state); \ 333 mips_set_personality_fp(state); \
324 \ 334 \
@@ -356,6 +366,8 @@ do { \
356 else \ 366 else \
357 current->thread.abi = &mips_abi; \ 367 current->thread.abi = &mips_abi; \
358 \ 368 \
369 current->thread.fpu.fcr31 = current_cpu_data.fpu_csr31; \
370 \
359 p = personality(current->personality); \ 371 p = personality(current->personality); \
360 if (p != PER_LINUX32 && p != PER_LINUX) \ 372 if (p != PER_LINUX32 && p != PER_LINUX) \
361 set_personality(PER_LINUX); \ 373 set_personality(PER_LINUX); \
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
index b104ad9d655f..084780b355aa 100644
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
@@ -30,7 +30,7 @@
30struct sigcontext; 30struct sigcontext;
31struct sigcontext32; 31struct sigcontext32;
32 32
33extern void _init_fpu(void); 33extern void _init_fpu(unsigned int);
34extern void _save_fp(struct task_struct *); 34extern void _save_fp(struct task_struct *);
35extern void _restore_fp(struct task_struct *); 35extern void _restore_fp(struct task_struct *);
36 36
@@ -188,6 +188,7 @@ static inline void lose_fpu(int save)
188 188
189static inline int init_fpu(void) 189static inline int init_fpu(void)
190{ 190{
191 unsigned int fcr31 = current->thread.fpu.fcr31;
191 int ret = 0; 192 int ret = 0;
192 193
193 if (cpu_has_fpu) { 194 if (cpu_has_fpu) {
@@ -198,7 +199,7 @@ static inline int init_fpu(void)
198 return ret; 199 return ret;
199 200
200 if (!cpu_has_fre) { 201 if (!cpu_has_fre) {
201 _init_fpu(); 202 _init_fpu(fcr31);
202 203
203 return 0; 204 return 0;
204 } 205 }
@@ -212,7 +213,7 @@ static inline int init_fpu(void)
212 config5 = clear_c0_config5(MIPS_CONF5_FRE); 213 config5 = clear_c0_config5(MIPS_CONF5_FRE);
213 enable_fpu_hazard(); 214 enable_fpu_hazard();
214 215
215 _init_fpu(); 216 _init_fpu(fcr31);
216 217
217 /* Restore FRE */ 218 /* Restore FRE */
218 write_c0_config5(config5); 219 write_c0_config5(config5);
diff --git a/arch/mips/include/asm/fpu_emulator.h b/arch/mips/include/asm/fpu_emulator.h
index 3ee347713307..2f021cdfba4f 100644
--- a/arch/mips/include/asm/fpu_emulator.h
+++ b/arch/mips/include/asm/fpu_emulator.h
@@ -44,6 +44,7 @@ struct mips_fpu_emulator_stats {
44 unsigned long ieee754_overflow; 44 unsigned long ieee754_overflow;
45 unsigned long ieee754_zerodiv; 45 unsigned long ieee754_zerodiv;
46 unsigned long ieee754_invalidop; 46 unsigned long ieee754_invalidop;
47 unsigned long ds_emul;
47}; 48};
48 49
49DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats); 50DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats);
@@ -65,7 +66,8 @@ extern int do_dsemulret(struct pt_regs *xcp);
65extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, 66extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
66 struct mips_fpu_struct *ctx, int has_fpu, 67 struct mips_fpu_struct *ctx, int has_fpu,
67 void *__user *fault_addr); 68 void *__user *fault_addr);
68int process_fpemu_return(int sig, void __user *fault_addr); 69int process_fpemu_return(int sig, void __user *fault_addr,
70 unsigned long fcr31);
69int mm_isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn, 71int mm_isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn,
70 unsigned long *contpc); 72 unsigned long *contpc);
71 73
@@ -86,8 +88,6 @@ static inline void fpu_emulator_init_fpu(void)
86 struct task_struct *t = current; 88 struct task_struct *t = current;
87 int i; 89 int i;
88 90
89 t->thread.fpu.fcr31 = 0;
90
91 for (i = 0; i < 32; i++) 91 for (i = 0; i < 32; i++)
92 set_fpr64(&t->thread.fpu.fpr[i], 0, SIGNALLING_NAN); 92 set_fpr64(&t->thread.fpu.fpr[i], 0, SIGNALLING_NAN);
93} 93}
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h
index 5a4e1bb8fb1b..f0db99f8defe 100644
--- a/arch/mips/include/asm/irq.h
+++ b/arch/mips/include/asm/irq.h
@@ -47,6 +47,9 @@ extern void free_irqno(unsigned int irq);
47extern int cp0_compare_irq; 47extern int cp0_compare_irq;
48extern int cp0_compare_irq_shift; 48extern int cp0_compare_irq_shift;
49extern int cp0_perfcount_irq; 49extern int cp0_perfcount_irq;
50extern int cp0_fdc_irq;
51
52extern int __weak get_c0_fdc_int(void);
50 53
51void arch_trigger_all_cpu_backtrace(bool); 54void arch_trigger_all_cpu_backtrace(bool);
52#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace 55#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
diff --git a/arch/mips/include/asm/mach-ar7/war.h b/arch/mips/include/asm/mach-ar7/war.h
deleted file mode 100644
index 99071e50faab..000000000000
--- a/arch/mips/include/asm/mach-ar7/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_AR7_WAR_H
9#define __ASM_MIPS_MACH_AR7_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_AR7_WAR_H */
diff --git a/arch/mips/include/asm/mach-ath25/dma-coherence.h b/arch/mips/include/asm/mach-ath25/dma-coherence.h
index d8009c93a465..d5defdde32db 100644
--- a/arch/mips/include/asm/mach-ath25/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ath25/dma-coherence.h
@@ -59,16 +59,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
59 return 1; 59 return 1;
60} 60}
61 61
62static inline void plat_extra_sync_for_device(struct device *dev)
63{
64}
65
66static inline int plat_dma_mapping_error(struct device *dev,
67 dma_addr_t dma_addr)
68{
69 return 0;
70}
71
72static inline int plat_device_is_coherent(struct device *dev) 62static inline int plat_device_is_coherent(struct device *dev)
73{ 63{
74#ifdef CONFIG_DMA_COHERENT 64#ifdef CONFIG_DMA_COHERENT
@@ -79,4 +69,8 @@ static inline int plat_device_is_coherent(struct device *dev)
79#endif 69#endif
80} 70}
81 71
72static inline void plat_post_dma_flush(struct device *dev)
73{
74}
75
82#endif /* __ASM_MACH_ATH25_DMA_COHERENCE_H */ 76#endif /* __ASM_MACH_ATH25_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-ath25/war.h b/arch/mips/include/asm/mach-ath25/war.h
deleted file mode 100644
index e3a5250ebd67..000000000000
--- a/arch/mips/include/asm/mach-ath25/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
7 */
8#ifndef __ASM_MACH_ATH25_WAR_H
9#define __ASM_MACH_ATH25_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define RM9000_CDEX_SMP_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MACH_ATH25_WAR_H */
diff --git a/arch/mips/include/asm/mach-ath79/war.h b/arch/mips/include/asm/mach-ath79/war.h
deleted file mode 100644
index 0bb30905fd5b..000000000000
--- a/arch/mips/include/asm/mach-ath79/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MACH_ATH79_WAR_H
9#define __ASM_MACH_ATH79_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MACH_ATH79_WAR_H */
diff --git a/arch/mips/include/asm/mach-au1x00/war.h b/arch/mips/include/asm/mach-au1x00/war.h
deleted file mode 100644
index 72e260d24e59..000000000000
--- a/arch/mips/include/asm/mach-au1x00/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_AU1X00_WAR_H
9#define __ASM_MIPS_MACH_AU1X00_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_AU1X00_WAR_H */
diff --git a/arch/mips/include/asm/mach-bcm3384/war.h b/arch/mips/include/asm/mach-bcm3384/war.h
deleted file mode 100644
index 59d7599059b0..000000000000
--- a/arch/mips/include/asm/mach-bcm3384/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_BCM3384_WAR_H
9#define __ASM_MIPS_MACH_BCM3384_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_BCM3384_WAR_H */
diff --git a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
index 7527c1d33d02..8ed77f618940 100644
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx.h
@@ -22,6 +22,7 @@
22#include <linux/ssb/ssb.h> 22#include <linux/ssb/ssb.h>
23#include <linux/bcma/bcma.h> 23#include <linux/bcma/bcma.h>
24#include <linux/bcma/bcma_soc.h> 24#include <linux/bcma/bcma_soc.h>
25#include <linux/bcm47xx_nvram.h>
25 26
26enum bcm47xx_bus_type { 27enum bcm47xx_bus_type {
27#ifdef CONFIG_BCM47XX_SSB 28#ifdef CONFIG_BCM47XX_SSB
diff --git a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
index 1f5643b89a91..c41d1dce1062 100644
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
@@ -67,6 +67,7 @@ enum bcm47xx_board {
67 BCM47XX_BOARD_LINKSYS_WRT150NV11, 67 BCM47XX_BOARD_LINKSYS_WRT150NV11,
68 BCM47XX_BOARD_LINKSYS_WRT160NV1, 68 BCM47XX_BOARD_LINKSYS_WRT160NV1,
69 BCM47XX_BOARD_LINKSYS_WRT160NV3, 69 BCM47XX_BOARD_LINKSYS_WRT160NV3,
70 BCM47XX_BOARD_LINKSYS_WRT300N_V1,
70 BCM47XX_BOARD_LINKSYS_WRT300NV11, 71 BCM47XX_BOARD_LINKSYS_WRT300NV11,
71 BCM47XX_BOARD_LINKSYS_WRT310NV1, 72 BCM47XX_BOARD_LINKSYS_WRT310NV1,
72 BCM47XX_BOARD_LINKSYS_WRT310NV2, 73 BCM47XX_BOARD_LINKSYS_WRT310NV2,
@@ -74,6 +75,7 @@ enum bcm47xx_board {
74 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101, 75 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
75 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467, 76 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,
76 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, 77 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708,
78 BCM47XX_BOARD_LINKSYS_WRT600N_V11,
77 BCM47XX_BOARD_LINKSYS_WRT610NV1, 79 BCM47XX_BOARD_LINKSYS_WRT610NV1,
78 BCM47XX_BOARD_LINKSYS_WRT610NV2, 80 BCM47XX_BOARD_LINKSYS_WRT610NV2,
79 BCM47XX_BOARD_LINKSYS_WRTSL54GS, 81 BCM47XX_BOARD_LINKSYS_WRTSL54GS,
@@ -86,9 +88,11 @@ enum bcm47xx_board {
86 88
87 BCM47XX_BOARD_NETGEAR_WGR614V8, 89 BCM47XX_BOARD_NETGEAR_WGR614V8,
88 BCM47XX_BOARD_NETGEAR_WGR614V9, 90 BCM47XX_BOARD_NETGEAR_WGR614V9,
91 BCM47XX_BOARD_NETGEAR_WGR614_V10,
89 BCM47XX_BOARD_NETGEAR_WNDR3300, 92 BCM47XX_BOARD_NETGEAR_WNDR3300,
90 BCM47XX_BOARD_NETGEAR_WNDR3400V1, 93 BCM47XX_BOARD_NETGEAR_WNDR3400V1,
91 BCM47XX_BOARD_NETGEAR_WNDR3400V2, 94 BCM47XX_BOARD_NETGEAR_WNDR3400V2,
95 BCM47XX_BOARD_NETGEAR_WNDR3400_V3,
92 BCM47XX_BOARD_NETGEAR_WNDR3400VCNA, 96 BCM47XX_BOARD_NETGEAR_WNDR3400VCNA,
93 BCM47XX_BOARD_NETGEAR_WNDR3700V3, 97 BCM47XX_BOARD_NETGEAR_WNDR3700V3,
94 BCM47XX_BOARD_NETGEAR_WNDR4000, 98 BCM47XX_BOARD_NETGEAR_WNDR4000,
diff --git a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
deleted file mode 100644
index ee59ffe99922..000000000000
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 2005, Broadcom Corporation
3 * Copyright (C) 2006, Felix Fietkau <nbd@openwrt.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __BCM47XX_NVRAM_H
12#define __BCM47XX_NVRAM_H
13
14#include <linux/types.h>
15#include <linux/kernel.h>
16
17int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
18int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
19int bcm47xx_nvram_gpio_pin(const char *name);
20
21#endif /* __BCM47XX_NVRAM_H */
diff --git a/arch/mips/include/asm/mach-bcm47xx/war.h b/arch/mips/include/asm/mach-bcm47xx/war.h
deleted file mode 100644
index a3d2f448b10e..000000000000
--- a/arch/mips/include/asm/mach-bcm47xx/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_BCM47XX_WAR_H
9#define __ASM_MIPS_MACH_BCM47XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_BCM47XX_WAR_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/dma-coherence.h b/arch/mips/include/asm/mach-bcm63xx/dma-coherence.h
new file mode 100644
index 000000000000..11d3b572b1b3
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/dma-coherence.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_MACH_BCM63XX_DMA_COHERENCE_H
2#define __ASM_MACH_BCM63XX_DMA_COHERENCE_H
3
4#include <asm/bmips.h>
5
6#define plat_post_dma_flush bmips_post_dma_flush
7
8#include <asm/mach-generic/dma-coherence.h>
9
10#endif /* __ASM_MACH_BCM63XX_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-bcm63xx/war.h b/arch/mips/include/asm/mach-bcm63xx/war.h
deleted file mode 100644
index 05ee8671bef1..000000000000
--- a/arch/mips/include/asm/mach-bcm63xx/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_BCM63XX_WAR_H
9#define __ASM_MIPS_MACH_BCM63XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_BCM63XX_WAR_H */
diff --git a/arch/mips/include/asm/mach-bcm3384/dma-coherence.h b/arch/mips/include/asm/mach-bmips/dma-coherence.h
index a3be8e50e1f0..d29781f02285 100644
--- a/arch/mips/include/asm/mach-bcm3384/dma-coherence.h
+++ b/arch/mips/include/asm/mach-bmips/dma-coherence.h
@@ -12,8 +12,12 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 */ 13 */
14 14
15#ifndef __ASM_MACH_BCM3384_DMA_COHERENCE_H 15#ifndef __ASM_MACH_BMIPS_DMA_COHERENCE_H
16#define __ASM_MACH_BCM3384_DMA_COHERENCE_H 16#define __ASM_MACH_BMIPS_DMA_COHERENCE_H
17
18#include <asm/bmips.h>
19#include <asm/cpu-type.h>
20#include <asm/cpu.h>
17 21
18struct device; 22struct device;
19 23
@@ -45,4 +49,6 @@ static inline int plat_device_is_coherent(struct device *dev)
45 return 0; 49 return 0;
46} 50}
47 51
48#endif /* __ASM_MACH_BCM3384_DMA_COHERENCE_H */ 52#define plat_post_dma_flush bmips_post_dma_flush
53
54#endif /* __ASM_MACH_BMIPS_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-bmips/spaces.h b/arch/mips/include/asm/mach-bmips/spaces.h
new file mode 100644
index 000000000000..1b05bddc8ec5
--- /dev/null
+++ b/arch/mips/include/asm/mach-bmips/spaces.h
@@ -0,0 +1,18 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
7 * Copyright (C) 2000, 2002 Maciej W. Rozycki
8 * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
9 */
10#ifndef _ASM_BMIPS_SPACES_H
11#define _ASM_BMIPS_SPACES_H
12
13/* Avoid collisions with system base register (SBR) region on BMIPS3300 */
14#define FIXADDR_TOP ((unsigned long)(long)(int)0xff000000)
15
16#include <asm/mach-generic/spaces.h>
17
18#endif /* __ASM_BMIPS_SPACES_H */
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index fa1f3cfbae8d..d68e685cde60 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -50,7 +50,6 @@
50#define cpu_has_mips32r2 0 50#define cpu_has_mips32r2 0
51#define cpu_has_mips64r1 0 51#define cpu_has_mips64r1 0
52#define cpu_has_mips64r2 1 52#define cpu_has_mips64r2 1
53#define cpu_has_mips_r2_exec_hazard 0
54#define cpu_has_dsp 0 53#define cpu_has_dsp 0
55#define cpu_has_dsp2 0 54#define cpu_has_dsp2 0
56#define cpu_has_mipsmt 0 55#define cpu_has_mipsmt 0
diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
index f9f448650505..460042ee5d6f 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
@@ -57,6 +57,10 @@ static inline int plat_device_is_coherent(struct device *dev)
57 return 1; 57 return 1;
58} 58}
59 59
60static inline void plat_post_dma_flush(struct device *dev)
61{
62}
63
60dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr); 64dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
61phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr); 65phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
62 66
diff --git a/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
new file mode 100644
index 000000000000..374eefafb320
--- /dev/null
+++ b/arch/mips/include/asm/mach-cavium-octeon/mangle-port.h
@@ -0,0 +1,74 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H
9#define __ASM_MACH_GENERIC_MANGLE_PORT_H
10
11#include <asm/byteorder.h>
12
13#ifdef __BIG_ENDIAN
14
15# define __swizzle_addr_b(port) (port)
16# define __swizzle_addr_w(port) (port)
17# define __swizzle_addr_l(port) (port)
18# define __swizzle_addr_q(port) (port)
19
20#else /* __LITTLE_ENDIAN */
21
22static inline bool __should_swizzle_addr(unsigned long p)
23{
24 /* boot bus? */
25 return ((p >> 40) & 0xff) == 0;
26}
27
28# define __swizzle_addr_b(port) \
29 (__should_swizzle_addr(port) ? (port) ^ 7 : (port))
30# define __swizzle_addr_w(port) \
31 (__should_swizzle_addr(port) ? (port) ^ 6 : (port))
32# define __swizzle_addr_l(port) \
33 (__should_swizzle_addr(port) ? (port) ^ 4 : (port))
34# define __swizzle_addr_q(port) (port)
35
36#endif /* __BIG_ENDIAN */
37
38/*
39 * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware;
40 * less sane hardware forces software to fiddle with this...
41 *
42 * Regardless, if the host bus endianness mismatches that of PCI/ISA, then
43 * you can't have the numerical value of data and byte addresses within
44 * multibyte quantities both preserved at the same time. Hence two
45 * variations of functions: non-prefixed ones that preserve the value
46 * and prefixed ones that preserve byte addresses. The latters are
47 * typically used for moving raw data between a peripheral and memory (cf.
48 * string I/O functions), hence the "__mem_" prefix.
49 */
50#if defined(CONFIG_SWAP_IO_SPACE)
51
52# define ioswabb(a, x) (x)
53# define __mem_ioswabb(a, x) (x)
54# define ioswabw(a, x) le16_to_cpu(x)
55# define __mem_ioswabw(a, x) (x)
56# define ioswabl(a, x) le32_to_cpu(x)
57# define __mem_ioswabl(a, x) (x)
58# define ioswabq(a, x) le64_to_cpu(x)
59# define __mem_ioswabq(a, x) (x)
60
61#else
62
63# define ioswabb(a, x) (x)
64# define __mem_ioswabb(a, x) (x)
65# define ioswabw(a, x) (x)
66# define __mem_ioswabw(a, x) cpu_to_le16(x)
67# define ioswabl(a, x) (x)
68# define __mem_ioswabl(a, x) cpu_to_le32(x)
69# define ioswabq(a, x) (x)
70# define __mem_ioswabq(a, x) cpu_to_le32(x)
71
72#endif
73
74#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
diff --git a/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
index 71d4bface1dc..30c5cd9fd973 100644
--- a/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
@@ -14,7 +14,6 @@
14#define cpu_has_3k_cache 0 14#define cpu_has_3k_cache 0
15#define cpu_has_4k_cache 1 15#define cpu_has_4k_cache 1
16#define cpu_has_tx39_cache 0 16#define cpu_has_tx39_cache 0
17#define cpu_has_fpu 1
18#define cpu_has_32fpr 1 17#define cpu_has_32fpr 1
19#define cpu_has_counter 1 18#define cpu_has_counter 1
20#define cpu_has_watch 0 19#define cpu_has_watch 0
diff --git a/arch/mips/include/asm/mach-cobalt/war.h b/arch/mips/include/asm/mach-cobalt/war.h
deleted file mode 100644
index 34ae4046541e..000000000000
--- a/arch/mips/include/asm/mach-cobalt/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_COBALT_WAR_H
9#define __ASM_MIPS_MACH_COBALT_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_COBALT_WAR_H */
diff --git a/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h b/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
index acce27fd2bb8..bdf045fb00c8 100644
--- a/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
@@ -15,7 +15,6 @@
15/* Generic ones first. */ 15/* Generic ones first. */
16#define cpu_has_tlb 1 16#define cpu_has_tlb 1
17#define cpu_has_tx39_cache 0 17#define cpu_has_tx39_cache 0
18#define cpu_has_fpu 1
19#define cpu_has_divec 0 18#define cpu_has_divec 0
20#define cpu_has_prefetch 0 19#define cpu_has_prefetch 0
21#define cpu_has_mcheck 0 20#define cpu_has_mcheck 0
diff --git a/arch/mips/include/asm/mach-dec/war.h b/arch/mips/include/asm/mach-dec/war.h
deleted file mode 100644
index d29996feb3e7..000000000000
--- a/arch/mips/include/asm/mach-dec/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_DEC_WAR_H
9#define __ASM_MIPS_MACH_DEC_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_DEC_WAR_H */
diff --git a/arch/mips/include/asm/mach-emma2rh/war.h b/arch/mips/include/asm/mach-emma2rh/war.h
deleted file mode 100644
index 79ae82da3ec7..000000000000
--- a/arch/mips/include/asm/mach-emma2rh/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_EMMA2RH_WAR_H
9#define __ASM_MIPS_MACH_EMMA2RH_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_EMMA2RH_WAR_H */
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h
index 7629c35986f7..0f8a354fd468 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -52,6 +52,12 @@ static inline int plat_device_is_coherent(struct device *dev)
52 return coherentio; 52 return coherentio;
53} 53}
54 54
55#ifndef plat_post_dma_flush
56static inline void plat_post_dma_flush(struct device *dev)
57{
58}
59#endif
60
55#ifdef CONFIG_SWIOTLB 61#ifdef CONFIG_SWIOTLB
56static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) 62static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
57{ 63{
diff --git a/arch/mips/include/asm/mach-ralink/war.h b/arch/mips/include/asm/mach-generic/war.h
index c074b5dc1f82..a1bc2e71f983 100644
--- a/arch/mips/include/asm/mach-ralink/war.h
+++ b/arch/mips/include/asm/mach-generic/war.h
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */ 7 */
8#ifndef __ASM_MACH_RALINK_WAR_H 8#ifndef __ASM_MACH_GENERIC_WAR_H
9#define __ASM_MACH_RALINK_WAR_H 9#define __ASM_MACH_GENERIC_WAR_H
10 10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0 11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0 12#define R4600_V1_HIT_CACHEOP_WAR 0
@@ -21,4 +21,4 @@
21#define R10000_LLSC_WAR 0 21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0 22#define MIPS34K_MISSED_ITLB_WAR 0
23 23
24#endif /* __ASM_MACH_RALINK_WAR_H */ 24#endif /* __ASM_MACH_GENERIC_WAR_H */
diff --git a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
index 1dfe47453ea4..9b19b72dba56 100644
--- a/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
@@ -16,7 +16,6 @@
16#define cpu_has_tlb 1 16#define cpu_has_tlb 1
17#define cpu_has_4kex 1 17#define cpu_has_4kex 1
18#define cpu_has_4k_cache 1 18#define cpu_has_4k_cache 1
19#define cpu_has_fpu 1
20#define cpu_has_32fpr 1 19#define cpu_has_32fpr 1
21#define cpu_has_counter 1 20#define cpu_has_counter 1
22#define cpu_has_mips16 0 21#define cpu_has_mips16 0
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h
index 4ffddfdb5062..1daa64412569 100644
--- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
@@ -58,6 +58,10 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
58 return 1; 58 return 1;
59} 59}
60 60
61static inline void plat_post_dma_flush(struct device *dev)
62{
63}
64
61static inline int plat_device_is_coherent(struct device *dev) 65static inline int plat_device_is_coherent(struct device *dev)
62{ 66{
63 return 1; /* IP27 non-cohernet mode is unsupported */ 67 return 1; /* IP27 non-cohernet mode is unsupported */
diff --git a/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
index 2e1ec6cfedd5..241409b78ff1 100644
--- a/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
@@ -26,7 +26,6 @@
26/* Settings which are common for all ip32 CPUs */ 26/* Settings which are common for all ip32 CPUs */
27#define cpu_has_tlb 1 27#define cpu_has_tlb 1
28#define cpu_has_4kex 1 28#define cpu_has_4kex 1
29#define cpu_has_fpu 1
30#define cpu_has_32fpr 1 29#define cpu_has_32fpr 1
31#define cpu_has_counter 1 30#define cpu_has_counter 1
32#define cpu_has_mips16 0 31#define cpu_has_mips16 0
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h
index 104cfbc3ed63..0a0b0e2ced60 100644
--- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
@@ -80,6 +80,10 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
80 return 1; 80 return 1;
81} 81}
82 82
83static inline void plat_post_dma_flush(struct device *dev)
84{
85}
86
83static inline int plat_device_is_coherent(struct device *dev) 87static inline int plat_device_is_coherent(struct device *dev)
84{ 88{
85 return 0; /* IP32 is non-cohernet */ 89 return 0; /* IP32 is non-cohernet */
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h
index 949003ef97b3..dc347c25c343 100644
--- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
+++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
@@ -48,6 +48,10 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
48 return 1; 48 return 1;
49} 49}
50 50
51static inline void plat_post_dma_flush(struct device *dev)
52{
53}
54
51static inline int plat_device_is_coherent(struct device *dev) 55static inline int plat_device_is_coherent(struct device *dev)
52{ 56{
53 return 0; 57 return 0;
diff --git a/arch/mips/include/asm/mach-jazz/war.h b/arch/mips/include/asm/mach-jazz/war.h
deleted file mode 100644
index 5b18b9a3d0ec..000000000000
--- a/arch/mips/include/asm/mach-jazz/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_JAZZ_WAR_H
9#define __ASM_MIPS_MACH_JAZZ_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_JAZZ_WAR_H */
diff --git a/arch/mips/include/asm/mach-jz4740/war.h b/arch/mips/include/asm/mach-jz4740/war.h
deleted file mode 100644
index 9b511d323838..000000000000
--- a/arch/mips/include/asm/mach-jz4740/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_JZ4740_WAR_H
9#define __ASM_MIPS_MACH_JZ4740_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_JZ4740_WAR_H */
diff --git a/arch/mips/include/asm/mach-lantiq/war.h b/arch/mips/include/asm/mach-lantiq/war.h
deleted file mode 100644
index 358ca979c1bd..000000000000
--- a/arch/mips/include/asm/mach-lantiq/war.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 */
7#ifndef __ASM_MIPS_MACH_LANTIQ_WAR_H
8#define __ASM_MIPS_MACH_LANTIQ_WAR_H
9
10#define R4600_V1_INDEX_ICACHEOP_WAR 0
11#define R4600_V1_HIT_CACHEOP_WAR 0
12#define R4600_V2_HIT_CACHEOP_WAR 0
13#define R5432_CP0_INTERRUPT_WAR 0
14#define BCM1250_M3_WAR 0
15#define SIBYTE_1956_WAR 0
16#define MIPS4K_ICACHE_REFILL_WAR 0
17#define MIPS_CACHE_SYNC_WAR 0
18#define TX49XX_ICACHE_INDEX_INV_WAR 0
19#define ICACHE_REFILLS_WORKAROUND_WAR 0
20#define R10000_LLSC_WAR 0
21#define MIPS34K_MISSED_ITLB_WAR 0
22
23#endif
diff --git a/arch/mips/include/asm/mach-lasat/war.h b/arch/mips/include/asm/mach-lasat/war.h
deleted file mode 100644
index 741ae724adc6..000000000000
--- a/arch/mips/include/asm/mach-lasat/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_LASAT_WAR_H
9#define __ASM_MIPS_MACH_LASAT_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_LASAT_WAR_H */
diff --git a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
index 6d69332f21ec..acc376897e46 100644
--- a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
@@ -34,7 +34,6 @@
34#define cpu_has_dsp 0 34#define cpu_has_dsp 0
35#define cpu_has_dsp2 0 35#define cpu_has_dsp2 0
36#define cpu_has_ejtag 0 36#define cpu_has_ejtag 0
37#define cpu_has_fpu 1
38#define cpu_has_ic_fills_f_dc 0 37#define cpu_has_ic_fills_f_dc 0
39#define cpu_has_inclusive_pcaches 1 38#define cpu_has_inclusive_pcaches 1
40#define cpu_has_llsc 1 39#define cpu_has_llsc 1
diff --git a/arch/mips/include/asm/mach-loongson/dma-coherence.h b/arch/mips/include/asm/mach-loongson/dma-coherence.h
index a90534161bd2..4bf4e19f72e8 100644
--- a/arch/mips/include/asm/mach-loongson/dma-coherence.h
+++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h
@@ -78,4 +78,8 @@ static inline int plat_device_is_coherent(struct device *dev)
78#endif /* CONFIG_DMA_NONCOHERENT */ 78#endif /* CONFIG_DMA_NONCOHERENT */
79} 79}
80 80
81static inline void plat_post_dma_flush(struct device *dev)
82{
83}
84
81#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */ 85#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
index 5459ac09679f..9783103fd6f6 100644
--- a/arch/mips/include/asm/mach-loongson/loongson.h
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -255,6 +255,10 @@ static inline void do_perfcnt_IRQ(void)
255extern u64 loongson_chipcfg[MAX_PACKAGES]; 255extern u64 loongson_chipcfg[MAX_PACKAGES];
256#define LOONGSON_CHIPCFG(id) (*(volatile u32 *)(loongson_chipcfg[id])) 256#define LOONGSON_CHIPCFG(id) (*(volatile u32 *)(loongson_chipcfg[id]))
257 257
258/* Chip Temperature registor of each physical cpu package, PRid >= Loongson-3A */
259extern u64 loongson_chiptemp[MAX_PACKAGES];
260#define LOONGSON_CHIPTEMP(id) (*(volatile u32 *)(loongson_chiptemp[id]))
261
258/* Freq Control register of each physical cpu package, PRid >= Loongson-3B */ 262/* Freq Control register of each physical cpu package, PRid >= Loongson-3B */
259extern u64 loongson_freqctrl[MAX_PACKAGES]; 263extern u64 loongson_freqctrl[MAX_PACKAGES];
260#define LOONGSON_FREQCTRL(id) (*(volatile u32 *)(loongson_freqctrl[id])) 264#define LOONGSON_FREQCTRL(id) (*(volatile u32 *)(loongson_freqctrl[id]))
diff --git a/arch/mips/include/asm/mach-loongson/war.h b/arch/mips/include/asm/mach-loongson/war.h
deleted file mode 100644
index f2570df66bb5..000000000000
--- a/arch/mips/include/asm/mach-loongson/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MACH_LOONGSON_WAR_H
9#define __ASM_MACH_LOONGSON_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MACH_LEMOTE_WAR_H */
diff --git a/arch/mips/include/asm/mach-loongson1/war.h b/arch/mips/include/asm/mach-loongson1/war.h
deleted file mode 100644
index 8fb50d008131..000000000000
--- a/arch/mips/include/asm/mach-loongson1/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MACH_LOONGSON1_WAR_H
9#define __ASM_MACH_LOONGSON1_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MACH_LOONGSON1_WAR_H */
diff --git a/arch/mips/include/asm/mach-netlogic/multi-node.h b/arch/mips/include/asm/mach-netlogic/multi-node.h
index 9ed8dacdc37c..8bdf47e29145 100644
--- a/arch/mips/include/asm/mach-netlogic/multi-node.h
+++ b/arch/mips/include/asm/mach-netlogic/multi-node.h
@@ -48,15 +48,6 @@
48#endif 48#endif
49 49
50#define NLM_THREADS_PER_CORE 4 50#define NLM_THREADS_PER_CORE 4
51#ifdef CONFIG_CPU_XLR
52#define nlm_cores_per_node() 8
53#else
54extern unsigned int xlp_cores_per_node;
55#define nlm_cores_per_node() xlp_cores_per_node
56#endif
57
58#define nlm_threads_per_node() (nlm_cores_per_node() * NLM_THREADS_PER_CORE)
59#define nlm_cpuid_to_node(c) ((c) / nlm_threads_per_node())
60 51
61struct nlm_soc_info { 52struct nlm_soc_info {
62 unsigned long coremask; /* cores enabled on the soc */ 53 unsigned long coremask; /* cores enabled on the soc */
diff --git a/arch/mips/include/asm/mach-netlogic/topology.h b/arch/mips/include/asm/mach-netlogic/topology.h
deleted file mode 100644
index 0eb43c832b25..000000000000
--- a/arch/mips/include/asm/mach-netlogic/topology.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2013 Broadcom Corporation
7 */
8#ifndef _ASM_MACH_NETLOGIC_TOPOLOGY_H
9#define _ASM_MACH_NETLOGIC_TOPOLOGY_H
10
11#include <asm/mach-netlogic/multi-node.h>
12
13#include <asm-generic/topology.h>
14
15#endif /* _ASM_MACH_NETLOGIC_TOPOLOGY_H */
diff --git a/arch/mips/include/asm/mach-netlogic/war.h b/arch/mips/include/asm/mach-netlogic/war.h
deleted file mode 100644
index 2c7216840e18..000000000000
--- a/arch/mips/include/asm/mach-netlogic/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2011 Netlogic Microsystems.
7 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
8 */
9#ifndef __ASM_MIPS_MACH_NLM_WAR_H
10#define __ASM_MIPS_MACH_NLM_WAR_H
11
12#define R4600_V1_INDEX_ICACHEOP_WAR 0
13#define R4600_V1_HIT_CACHEOP_WAR 0
14#define R4600_V2_HIT_CACHEOP_WAR 0
15#define R5432_CP0_INTERRUPT_WAR 0
16#define BCM1250_M3_WAR 0
17#define SIBYTE_1956_WAR 0
18#define MIPS4K_ICACHE_REFILL_WAR 0
19#define MIPS_CACHE_SYNC_WAR 0
20#define TX49XX_ICACHE_INDEX_INV_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_NLM_WAR_H */
diff --git a/arch/mips/include/asm/mach-paravirt/war.h b/arch/mips/include/asm/mach-paravirt/war.h
deleted file mode 100644
index 36d3afb98451..000000000000
--- a/arch/mips/include/asm/mach-paravirt/war.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2013 Cavium Networks <support@caviumnetworks.com>
8 */
9#ifndef __ASM_MIPS_MACH_PARAVIRT_WAR_H
10#define __ASM_MIPS_MACH_PARAVIRT_WAR_H
11
12#define R4600_V1_INDEX_ICACHEOP_WAR 0
13#define R4600_V1_HIT_CACHEOP_WAR 0
14#define R4600_V2_HIT_CACHEOP_WAR 0
15#define R5432_CP0_INTERRUPT_WAR 0
16#define BCM1250_M3_WAR 0
17#define SIBYTE_1956_WAR 0
18#define MIPS4K_ICACHE_REFILL_WAR 0
19#define MIPS_CACHE_SYNC_WAR 0
20#define TX49XX_ICACHE_INDEX_INV_WAR 0
21#define ICACHE_REFILLS_WORKAROUND_WAR 0
22#define R10000_LLSC_WAR 0
23#define MIPS34K_MISSED_ITLB_WAR 0
24
25#endif /* __ASM_MIPS_MACH_PARAVIRT_WAR_H */
diff --git a/arch/mips/include/asm/mach-pistachio/gpio.h b/arch/mips/include/asm/mach-pistachio/gpio.h
new file mode 100644
index 000000000000..6c1649c27b8d
--- /dev/null
+++ b/arch/mips/include/asm/mach-pistachio/gpio.h
@@ -0,0 +1,21 @@
1/*
2 * Pistachio IRQ setup
3 *
4 * Copyright (C) 2014 Google, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_MACH_PISTACHIO_GPIO_H
12#define __ASM_MACH_PISTACHIO_GPIO_H
13
14#include <asm-generic/gpio.h>
15
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#define gpio_to_irq __gpio_to_irq
20
21#endif /* __ASM_MACH_PISTACHIO_GPIO_H */
diff --git a/arch/mips/include/asm/mach-pistachio/irq.h b/arch/mips/include/asm/mach-pistachio/irq.h
new file mode 100644
index 000000000000..b94a09a54221
--- /dev/null
+++ b/arch/mips/include/asm/mach-pistachio/irq.h
@@ -0,0 +1,18 @@
1/*
2 * Pistachio IRQ setup
3 *
4 * Copyright (C) 2014 Google, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_MACH_PISTACHIO_IRQ_H
12#define __ASM_MACH_PISTACHIO_IRQ_H
13
14#define NR_IRQS 256
15
16#include_next <irq.h>
17
18#endif /* __ASM_MACH_PISTACHIO_IRQ_H */
diff --git a/arch/mips/include/asm/mach-pnx833x/war.h b/arch/mips/include/asm/mach-pnx833x/war.h
deleted file mode 100644
index e410df4e1b3a..000000000000
--- a/arch/mips/include/asm/mach-pnx833x/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_PNX833X_WAR_H
9#define __ASM_MIPS_MACH_PNX833X_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_PNX833X_WAR_H */
diff --git a/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
index f095c529c48c..98cf40417c5d 100644
--- a/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
@@ -15,7 +15,6 @@
15#define cpu_has_tlb 1 15#define cpu_has_tlb 1
16#define cpu_has_4kex 1 16#define cpu_has_4kex 1
17#define cpu_has_4k_cache 1 17#define cpu_has_4k_cache 1
18#define cpu_has_fpu 1
19#define cpu_has_32fpr 1 18#define cpu_has_32fpr 1
20#define cpu_has_counter 1 19#define cpu_has_counter 1
21#define cpu_has_watch 0 20#define cpu_has_watch 0
diff --git a/arch/mips/include/asm/mach-tx39xx/war.h b/arch/mips/include/asm/mach-tx39xx/war.h
deleted file mode 100644
index 6a52e6534776..000000000000
--- a/arch/mips/include/asm/mach-tx39xx/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_TX39XX_WAR_H
9#define __ASM_MIPS_MACH_TX39XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_TX39XX_WAR_H */
diff --git a/arch/mips/include/asm/mach-vr41xx/war.h b/arch/mips/include/asm/mach-vr41xx/war.h
deleted file mode 100644
index ffe31e736009..000000000000
--- a/arch/mips/include/asm/mach-vr41xx/war.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 */
8#ifndef __ASM_MIPS_MACH_VR41XX_WAR_H
9#define __ASM_MIPS_MACH_VR41XX_WAR_H
10
11#define R4600_V1_INDEX_ICACHEOP_WAR 0
12#define R4600_V1_HIT_CACHEOP_WAR 0
13#define R4600_V2_HIT_CACHEOP_WAR 0
14#define R5432_CP0_INTERRUPT_WAR 0
15#define BCM1250_M3_WAR 0
16#define SIBYTE_1956_WAR 0
17#define MIPS4K_ICACHE_REFILL_WAR 0
18#define MIPS_CACHE_SYNC_WAR 0
19#define TX49XX_ICACHE_INDEX_INV_WAR 0
20#define ICACHE_REFILLS_WORKAROUND_WAR 0
21#define R10000_LLSC_WAR 0
22#define MIPS34K_MISSED_ITLB_WAR 0
23
24#endif /* __ASM_MIPS_MACH_VR41XX_WAR_H */
diff --git a/arch/mips/include/asm/mips-boards/sead3-addr.h b/arch/mips/include/asm/mips-boards/sead3-addr.h
new file mode 100644
index 000000000000..c0db57802f7c
--- /dev/null
+++ b/arch/mips/include/asm/mips-boards/sead3-addr.h
@@ -0,0 +1,83 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2015 Imagination Technologies, Inc.
7 * written by Ralf Baechle <ralf@linux-mips.org>
8 */
9#ifndef __ASM_MIPS_BOARDS_SEAD3_ADDR_H
10#define __ASM_MIPS_BOARDS_SEAD3_ADDR_H
11
12/*
13 * Target #0 Register Decode
14 */
15#define SEAD3_SD_SPDCNF 0xbb000040
16#define SEAD3_SD_SPADDR 0xbb000048
17#define SEAD3_SD_DATA 0xbb000050
18
19/*
20 * Target #1 Register Decode
21 */
22#define SEAD3_CFG 0xbb100110
23#define SEAD3_GIC_BASE_ADDRESS 0xbb1c0000
24#define SEAD3_SHARED_SECTION 0xbb1c0000
25#define SEAD3_VPE_LOCAL_SECTION 0xbb1c8000
26#define SEAD3_VPE_OTHER_SECTION 0xbb1cc000
27#define SEAD3_USER_MODE_VISIBLE_SECTION 0xbb1d0000
28
29/*
30 * Target #3 Register Decode
31 */
32#define SEAD3_USB_HS_BASE 0xbb200000
33#define SEAD3_USB_HS_IDENTIFICATION_REGS 0xbb200000
34#define SEAD3_USB_HS_CAPABILITY_REGS 0xbb200100
35#define SEAD3_USB_HS_OPERATIONAL_REGS 0xbb200140
36#define SEAD3_RESERVED 0xbe800000
37
38/*
39 * Target #3 Register Decode
40 */
41#define SEAD3_SRAM 0xbe000000
42#define SEAD3_OPTIONAL_SRAM 0xbe400000
43#define SEAD3_FPGA 0xbf000000
44
45#define SEAD3_PI_PIC32_USB_STATUS 0xbf000060
46#define SEAD3_PI_PIC32_USB_STATUS_IO_RDY (1 << 0)
47#define SEAD3_PI_PIC32_USB_STATUS_SPL_INT (1 << 1)
48#define SEAD3_PI_PIC32_USB_STATUS_GPIOA_INT (1 << 2)
49#define SEAD3_PI_PIC32_USB_STATUS_GPIOB_INT (1 << 3)
50
51#define SEAD3_PI_SOFT_ENDIAN 0xbf000070
52
53#define SEAD3_CPLD_P_SWITCH 0xbf000200
54#define SEAD3_CPLD_F_SWITCH 0xbf000208
55#define SEAD3_CPLD_P_LED 0xbf000210
56#define SEAD3_CPLD_F_LED 0xbf000218
57#define SEAD3_NEWSC_LIVE 0xbf000220
58#define SEAD3_NEWSC_REG 0xbf000228
59#define SEAD3_NEWSC_CTRL 0xbf000230
60
61#define SEAD3_LCD_CONTROL 0xbf000400
62#define SEAD3_LCD_DATA 0xbf000408
63#define SEAD3_CPLD_LCD_STATUS 0xbf000410
64#define SEAD3_CPLD_LCD_DATA 0xbf000418
65
66#define SEAD3_CPLD_PI_DEVRST 0xbf000480
67#define SEAD3_CPLD_PI_DEVRST_IC32_RST (1 << 0)
68#define SEAD3_RESERVED_0 0xbf000500
69
70#define SEAD3_PIC32_REGISTERS 0xbf000600
71#define SEAD3_RESERVED_1 0xbf000700
72#define SEAD3_UART_CH_0 0xbf000800
73#define SEAD3_UART_CH_1 0xbf000900
74#define SEAD3_RESERVED_2 0xbf000a00
75#define SEAD3_ETHERNET 0xbf010000
76#define SEAD3_RESERVED_3 0xbf020000
77#define SEAD3_USER_EXPANSION 0xbf400000
78#define SEAD3_RESERVED_4 0xbf800000
79#define SEAD3_BOOT_FLASH_EXTENSION 0xbfa00000
80#define SEAD3_BOOT_FLASH 0xbfc00000
81#define SEAD3_REVISION_REGISTER 0xbfc00010
82
83#endif /* __ASM_MIPS_BOARDS_SEAD3_ADDR_H */
diff --git a/arch/mips/include/asm/mips-r2-to-r6-emul.h b/arch/mips/include/asm/mips-r2-to-r6-emul.h
index 60570f2c3ba2..4b89f28047f7 100644
--- a/arch/mips/include/asm/mips-r2-to-r6-emul.h
+++ b/arch/mips/include/asm/mips-r2-to-r6-emul.h
@@ -84,11 +84,16 @@ extern void do_trap_or_bp(struct pt_regs *regs, unsigned int code,
84 84
85#ifndef CONFIG_MIPSR2_TO_R6_EMULATOR 85#ifndef CONFIG_MIPSR2_TO_R6_EMULATOR
86static int mipsr2_emulation; 86static int mipsr2_emulation;
87static __maybe_unused int mipsr2_decoder(struct pt_regs *regs, u32 inst) { return 0; }; 87static inline int mipsr2_decoder(struct pt_regs *regs, u32 inst,
88 unsigned long *fcr31)
89{
90 return 0;
91};
88#else 92#else
89/* MIPS R2 Emulator ON/OFF */ 93/* MIPS R2 Emulator ON/OFF */
90extern int mipsr2_emulation; 94extern int mipsr2_emulation;
91extern int mipsr2_decoder(struct pt_regs *regs, u32 inst); 95extern int mipsr2_decoder(struct pt_regs *regs, u32 inst,
96 unsigned long *fcr31);
92#endif /* CONFIG_MIPSR2_TO_R6_EMULATOR */ 97#endif /* CONFIG_MIPSR2_TO_R6_EMULATOR */
93 98
94#define NO_R6EMU (cpu_has_mips_r6 && !mipsr2_emulation) 99#define NO_R6EMU (cpu_has_mips_r6 && !mipsr2_emulation)
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index fef004434096..764e2756b54d 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -111,70 +111,6 @@
111 */ 111 */
112#define CP0_TX39_CACHE $7 112#define CP0_TX39_CACHE $7
113 113
114/*
115 * Coprocessor 1 (FPU) register names
116 */
117#define CP1_REVISION $0
118#define CP1_STATUS $31
119
120/*
121 * FPU Status Register Values
122 */
123/*
124 * Status Register Values
125 */
126
127#define FPU_CSR_FLUSH 0x01000000 /* flush denormalised results to 0 */
128#define FPU_CSR_COND 0x00800000 /* $fcc0 */
129#define FPU_CSR_COND0 0x00800000 /* $fcc0 */
130#define FPU_CSR_COND1 0x02000000 /* $fcc1 */
131#define FPU_CSR_COND2 0x04000000 /* $fcc2 */
132#define FPU_CSR_COND3 0x08000000 /* $fcc3 */
133#define FPU_CSR_COND4 0x10000000 /* $fcc4 */
134#define FPU_CSR_COND5 0x20000000 /* $fcc5 */
135#define FPU_CSR_COND6 0x40000000 /* $fcc6 */
136#define FPU_CSR_COND7 0x80000000 /* $fcc7 */
137
138/*
139 * Bits 18 - 20 of the FPU Status Register will be read as 0,
140 * and should be written as zero.
141 */
142#define FPU_CSR_RSVD 0x001c0000
143
144/*
145 * X the exception cause indicator
146 * E the exception enable
147 * S the sticky/flag bit
148*/
149#define FPU_CSR_ALL_X 0x0003f000
150#define FPU_CSR_UNI_X 0x00020000
151#define FPU_CSR_INV_X 0x00010000
152#define FPU_CSR_DIV_X 0x00008000
153#define FPU_CSR_OVF_X 0x00004000
154#define FPU_CSR_UDF_X 0x00002000
155#define FPU_CSR_INE_X 0x00001000
156
157#define FPU_CSR_ALL_E 0x00000f80
158#define FPU_CSR_INV_E 0x00000800
159#define FPU_CSR_DIV_E 0x00000400
160#define FPU_CSR_OVF_E 0x00000200
161#define FPU_CSR_UDF_E 0x00000100
162#define FPU_CSR_INE_E 0x00000080
163
164#define FPU_CSR_ALL_S 0x0000007c
165#define FPU_CSR_INV_S 0x00000040
166#define FPU_CSR_DIV_S 0x00000020
167#define FPU_CSR_OVF_S 0x00000010
168#define FPU_CSR_UDF_S 0x00000008
169#define FPU_CSR_INE_S 0x00000004
170
171/* Bits 0 and 1 of FPU Status Register specify the rounding mode */
172#define FPU_CSR_RM 0x00000003
173#define FPU_CSR_RN 0x0 /* nearest */
174#define FPU_CSR_RZ 0x1 /* towards zero */
175#define FPU_CSR_RU 0x2 /* towards +Infinity */
176#define FPU_CSR_RD 0x3 /* towards -Infinity */
177
178 114
179/* 115/*
180 * Values for PageMask register 116 * Values for PageMask register
@@ -341,39 +277,6 @@
341#define ST0_MX 0x01000000 277#define ST0_MX 0x01000000
342 278
343/* 279/*
344 * Bitfields in the TX39 family CP0 Configuration Register 3
345 */
346#define TX39_CONF_ICS_SHIFT 19
347#define TX39_CONF_ICS_MASK 0x00380000
348#define TX39_CONF_ICS_1KB 0x00000000
349#define TX39_CONF_ICS_2KB 0x00080000
350#define TX39_CONF_ICS_4KB 0x00100000
351#define TX39_CONF_ICS_8KB 0x00180000
352#define TX39_CONF_ICS_16KB 0x00200000
353
354#define TX39_CONF_DCS_SHIFT 16
355#define TX39_CONF_DCS_MASK 0x00070000
356#define TX39_CONF_DCS_1KB 0x00000000
357#define TX39_CONF_DCS_2KB 0x00010000
358#define TX39_CONF_DCS_4KB 0x00020000
359#define TX39_CONF_DCS_8KB 0x00030000
360#define TX39_CONF_DCS_16KB 0x00040000
361
362#define TX39_CONF_CWFON 0x00004000
363#define TX39_CONF_WBON 0x00002000
364#define TX39_CONF_RF_SHIFT 10
365#define TX39_CONF_RF_MASK 0x00000c00
366#define TX39_CONF_DOZE 0x00000200
367#define TX39_CONF_HALT 0x00000100
368#define TX39_CONF_LOCK 0x00000080
369#define TX39_CONF_ICE 0x00000020
370#define TX39_CONF_DCE 0x00000010
371#define TX39_CONF_IRSIZE_SHIFT 2
372#define TX39_CONF_IRSIZE_MASK 0x0000000c
373#define TX39_CONF_DRSIZE_SHIFT 0
374#define TX39_CONF_DRSIZE_MASK 0x00000003
375
376/*
377 * Status register bits available in all MIPS CPUs. 280 * Status register bits available in all MIPS CPUs.
378 */ 281 */
379#define ST0_IM 0x0000ff00 282#define ST0_IM 0x0000ff00
@@ -425,9 +328,9 @@
425 328
426/* 329/*
427 * Bitfields and bit numbers in the coprocessor 0 IntCtl register. (MIPSR2) 330 * Bitfields and bit numbers in the coprocessor 0 IntCtl register. (MIPSR2)
428 *
429 * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
430 */ 331 */
332#define INTCTLB_IPFDC 23
333#define INTCTLF_IPFDC (_ULCAST_(7) << INTCTLB_IPFDC)
431#define INTCTLB_IPPCI 26 334#define INTCTLB_IPPCI 26
432#define INTCTLF_IPPCI (_ULCAST_(7) << INTCTLB_IPPCI) 335#define INTCTLF_IPPCI (_ULCAST_(7) << INTCTLB_IPPCI)
433#define INTCTLB_IPTI 29 336#define INTCTLB_IPTI 29
@@ -438,10 +341,10 @@
438 * 341 *
439 * Refer to your MIPS R4xx0 manual, chapter 5 for explanation. 342 * Refer to your MIPS R4xx0 manual, chapter 5 for explanation.
440 */ 343 */
441#define CAUSEB_EXCCODE 2 344#define CAUSEB_EXCCODE 2
442#define CAUSEF_EXCCODE (_ULCAST_(31) << 2) 345#define CAUSEF_EXCCODE (_ULCAST_(31) << 2)
443#define CAUSEB_IP 8 346#define CAUSEB_IP 8
444#define CAUSEF_IP (_ULCAST_(255) << 8) 347#define CAUSEF_IP (_ULCAST_(255) << 8)
445#define CAUSEB_IP0 8 348#define CAUSEB_IP0 8
446#define CAUSEF_IP0 (_ULCAST_(1) << 8) 349#define CAUSEF_IP0 (_ULCAST_(1) << 8)
447#define CAUSEB_IP1 9 350#define CAUSEB_IP1 9
@@ -458,16 +361,18 @@
458#define CAUSEF_IP6 (_ULCAST_(1) << 14) 361#define CAUSEF_IP6 (_ULCAST_(1) << 14)
459#define CAUSEB_IP7 15 362#define CAUSEB_IP7 15
460#define CAUSEF_IP7 (_ULCAST_(1) << 15) 363#define CAUSEF_IP7 (_ULCAST_(1) << 15)
461#define CAUSEB_IV 23 364#define CAUSEB_FDCI 21
462#define CAUSEF_IV (_ULCAST_(1) << 23) 365#define CAUSEF_FDCI (_ULCAST_(1) << 21)
463#define CAUSEB_PCI 26 366#define CAUSEB_IV 23
464#define CAUSEF_PCI (_ULCAST_(1) << 26) 367#define CAUSEF_IV (_ULCAST_(1) << 23)
465#define CAUSEB_CE 28 368#define CAUSEB_PCI 26
466#define CAUSEF_CE (_ULCAST_(3) << 28) 369#define CAUSEF_PCI (_ULCAST_(1) << 26)
467#define CAUSEB_TI 30 370#define CAUSEB_CE 28
468#define CAUSEF_TI (_ULCAST_(1) << 30) 371#define CAUSEF_CE (_ULCAST_(3) << 28)
469#define CAUSEB_BD 31 372#define CAUSEB_TI 30
470#define CAUSEF_BD (_ULCAST_(1) << 31) 373#define CAUSEF_TI (_ULCAST_(1) << 30)
374#define CAUSEB_BD 31
375#define CAUSEF_BD (_ULCAST_(1) << 31)
471 376
472/* 377/*
473 * Bits in the coprocessor 0 config register. 378 * Bits in the coprocessor 0 config register.
@@ -689,18 +594,6 @@
689#define MIPS_CMGCRF_BASE (~_ULCAST_((1 << MIPS_CMGCRB_BASE) - 1)) 594#define MIPS_CMGCRF_BASE (~_ULCAST_((1 << MIPS_CMGCRB_BASE) - 1))
690 595
691/* 596/*
692 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
693 */
694#define MIPS_FPIR_S (_ULCAST_(1) << 16)
695#define MIPS_FPIR_D (_ULCAST_(1) << 17)
696#define MIPS_FPIR_PS (_ULCAST_(1) << 18)
697#define MIPS_FPIR_3D (_ULCAST_(1) << 19)
698#define MIPS_FPIR_W (_ULCAST_(1) << 20)
699#define MIPS_FPIR_L (_ULCAST_(1) << 21)
700#define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
701#define MIPS_FPIR_FREP (_ULCAST_(1) << 29)
702
703/*
704 * Bits in the MIPS32 Memory Segmentation registers. 597 * Bits in the MIPS32 Memory Segmentation registers.
705 */ 598 */
706#define MIPS_SEGCFG_PA_SHIFT 9 599#define MIPS_SEGCFG_PA_SHIFT 9
@@ -751,6 +644,172 @@
751#define MIPS_PWCTL_PSN_SHIFT 0 644#define MIPS_PWCTL_PSN_SHIFT 0
752#define MIPS_PWCTL_PSN_MASK 0x0000003f 645#define MIPS_PWCTL_PSN_MASK 0x0000003f
753 646
647/* CDMMBase register bit definitions */
648#define MIPS_CDMMBASE_SIZE_SHIFT 0
649#define MIPS_CDMMBASE_SIZE (_ULCAST_(511) << MIPS_CDMMBASE_SIZE_SHIFT)
650#define MIPS_CDMMBASE_CI (_ULCAST_(1) << 9)
651#define MIPS_CDMMBASE_EN (_ULCAST_(1) << 10)
652#define MIPS_CDMMBASE_ADDR_SHIFT 11
653#define MIPS_CDMMBASE_ADDR_START 15
654
655/*
656 * Bitfields in the TX39 family CP0 Configuration Register 3
657 */
658#define TX39_CONF_ICS_SHIFT 19
659#define TX39_CONF_ICS_MASK 0x00380000
660#define TX39_CONF_ICS_1KB 0x00000000
661#define TX39_CONF_ICS_2KB 0x00080000
662#define TX39_CONF_ICS_4KB 0x00100000
663#define TX39_CONF_ICS_8KB 0x00180000
664#define TX39_CONF_ICS_16KB 0x00200000
665
666#define TX39_CONF_DCS_SHIFT 16
667#define TX39_CONF_DCS_MASK 0x00070000
668#define TX39_CONF_DCS_1KB 0x00000000
669#define TX39_CONF_DCS_2KB 0x00010000
670#define TX39_CONF_DCS_4KB 0x00020000
671#define TX39_CONF_DCS_8KB 0x00030000
672#define TX39_CONF_DCS_16KB 0x00040000
673
674#define TX39_CONF_CWFON 0x00004000
675#define TX39_CONF_WBON 0x00002000
676#define TX39_CONF_RF_SHIFT 10
677#define TX39_CONF_RF_MASK 0x00000c00
678#define TX39_CONF_DOZE 0x00000200
679#define TX39_CONF_HALT 0x00000100
680#define TX39_CONF_LOCK 0x00000080
681#define TX39_CONF_ICE 0x00000020
682#define TX39_CONF_DCE 0x00000010
683#define TX39_CONF_IRSIZE_SHIFT 2
684#define TX39_CONF_IRSIZE_MASK 0x0000000c
685#define TX39_CONF_DRSIZE_SHIFT 0
686#define TX39_CONF_DRSIZE_MASK 0x00000003
687
688
689/*
690 * Coprocessor 1 (FPU) register names
691 */
692#define CP1_REVISION $0
693#define CP1_UFR $1
694#define CP1_UNFR $4
695#define CP1_FCCR $25
696#define CP1_FEXR $26
697#define CP1_FENR $28
698#define CP1_STATUS $31
699
700
701/*
702 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
703 */
704#define MIPS_FPIR_S (_ULCAST_(1) << 16)
705#define MIPS_FPIR_D (_ULCAST_(1) << 17)
706#define MIPS_FPIR_PS (_ULCAST_(1) << 18)
707#define MIPS_FPIR_3D (_ULCAST_(1) << 19)
708#define MIPS_FPIR_W (_ULCAST_(1) << 20)
709#define MIPS_FPIR_L (_ULCAST_(1) << 21)
710#define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
711#define MIPS_FPIR_HAS2008 (_ULCAST_(1) << 23)
712#define MIPS_FPIR_UFRP (_ULCAST_(1) << 28)
713#define MIPS_FPIR_FREP (_ULCAST_(1) << 29)
714
715/*
716 * Bits in the MIPS32/64 coprocessor 1 (FPU) condition codes register.
717 */
718#define MIPS_FCCR_CONDX_S 0
719#define MIPS_FCCR_CONDX (_ULCAST_(255) << MIPS_FCCR_CONDX_S)
720#define MIPS_FCCR_COND0_S 0
721#define MIPS_FCCR_COND0 (_ULCAST_(1) << MIPS_FCCR_COND0_S)
722#define MIPS_FCCR_COND1_S 1
723#define MIPS_FCCR_COND1 (_ULCAST_(1) << MIPS_FCCR_COND1_S)
724#define MIPS_FCCR_COND2_S 2
725#define MIPS_FCCR_COND2 (_ULCAST_(1) << MIPS_FCCR_COND2_S)
726#define MIPS_FCCR_COND3_S 3
727#define MIPS_FCCR_COND3 (_ULCAST_(1) << MIPS_FCCR_COND3_S)
728#define MIPS_FCCR_COND4_S 4
729#define MIPS_FCCR_COND4 (_ULCAST_(1) << MIPS_FCCR_COND4_S)
730#define MIPS_FCCR_COND5_S 5
731#define MIPS_FCCR_COND5 (_ULCAST_(1) << MIPS_FCCR_COND5_S)
732#define MIPS_FCCR_COND6_S 6
733#define MIPS_FCCR_COND6 (_ULCAST_(1) << MIPS_FCCR_COND6_S)
734#define MIPS_FCCR_COND7_S 7
735#define MIPS_FCCR_COND7 (_ULCAST_(1) << MIPS_FCCR_COND7_S)
736
737/*
738 * Bits in the MIPS32/64 coprocessor 1 (FPU) enables register.
739 */
740#define MIPS_FENR_FS_S 2
741#define MIPS_FENR_FS (_ULCAST_(1) << MIPS_FENR_FS_S)
742
743/*
744 * FPU Status Register Values
745 */
746#define FPU_CSR_COND_S 23 /* $fcc0 */
747#define FPU_CSR_COND (_ULCAST_(1) << FPU_CSR_COND_S)
748
749#define FPU_CSR_FS_S 24 /* flush denormalised results to 0 */
750#define FPU_CSR_FS (_ULCAST_(1) << FPU_CSR_FS_S)
751
752#define FPU_CSR_CONDX_S 25 /* $fcc[7:1] */
753#define FPU_CSR_CONDX (_ULCAST_(127) << FPU_CSR_CONDX_S)
754#define FPU_CSR_COND1_S 25 /* $fcc1 */
755#define FPU_CSR_COND1 (_ULCAST_(1) << FPU_CSR_COND1_S)
756#define FPU_CSR_COND2_S 26 /* $fcc2 */
757#define FPU_CSR_COND2 (_ULCAST_(1) << FPU_CSR_COND2_S)
758#define FPU_CSR_COND3_S 27 /* $fcc3 */
759#define FPU_CSR_COND3 (_ULCAST_(1) << FPU_CSR_COND3_S)
760#define FPU_CSR_COND4_S 28 /* $fcc4 */
761#define FPU_CSR_COND4 (_ULCAST_(1) << FPU_CSR_COND4_S)
762#define FPU_CSR_COND5_S 29 /* $fcc5 */
763#define FPU_CSR_COND5 (_ULCAST_(1) << FPU_CSR_COND5_S)
764#define FPU_CSR_COND6_S 30 /* $fcc6 */
765#define FPU_CSR_COND6 (_ULCAST_(1) << FPU_CSR_COND6_S)
766#define FPU_CSR_COND7_S 31 /* $fcc7 */
767#define FPU_CSR_COND7 (_ULCAST_(1) << FPU_CSR_COND7_S)
768
769/*
770 * Bits 22:20 of the FPU Status Register will be read as 0,
771 * and should be written as zero.
772 */
773#define FPU_CSR_RSVD (_ULCAST_(7) << 20)
774
775#define FPU_CSR_ABS2008 (_ULCAST_(1) << 19)
776#define FPU_CSR_NAN2008 (_ULCAST_(1) << 18)
777
778/*
779 * X the exception cause indicator
780 * E the exception enable
781 * S the sticky/flag bit
782*/
783#define FPU_CSR_ALL_X 0x0003f000
784#define FPU_CSR_UNI_X 0x00020000
785#define FPU_CSR_INV_X 0x00010000
786#define FPU_CSR_DIV_X 0x00008000
787#define FPU_CSR_OVF_X 0x00004000
788#define FPU_CSR_UDF_X 0x00002000
789#define FPU_CSR_INE_X 0x00001000
790
791#define FPU_CSR_ALL_E 0x00000f80
792#define FPU_CSR_INV_E 0x00000800
793#define FPU_CSR_DIV_E 0x00000400
794#define FPU_CSR_OVF_E 0x00000200
795#define FPU_CSR_UDF_E 0x00000100
796#define FPU_CSR_INE_E 0x00000080
797
798#define FPU_CSR_ALL_S 0x0000007c
799#define FPU_CSR_INV_S 0x00000040
800#define FPU_CSR_DIV_S 0x00000020
801#define FPU_CSR_OVF_S 0x00000010
802#define FPU_CSR_UDF_S 0x00000008
803#define FPU_CSR_INE_S 0x00000004
804
805/* Bits 0 and 1 of FPU Status Register specify the rounding mode */
806#define FPU_CSR_RM 0x00000003
807#define FPU_CSR_RN 0x0 /* nearest */
808#define FPU_CSR_RZ 0x1 /* towards zero */
809#define FPU_CSR_RU 0x2 /* towards +Infinity */
810#define FPU_CSR_RD 0x3 /* towards -Infinity */
811
812
754#ifndef __ASSEMBLY__ 813#ifndef __ASSEMBLY__
755 814
756/* 815/*
@@ -1282,6 +1341,9 @@ do { \
1282#define read_c0_ebase() __read_32bit_c0_register($15, 1) 1341#define read_c0_ebase() __read_32bit_c0_register($15, 1)
1283#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) 1342#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val)
1284 1343
1344#define read_c0_cdmmbase() __read_ulong_c0_register($15, 2)
1345#define write_c0_cdmmbase(val) __write_ulong_c0_register($15, 2, val)
1346
1285/* MIPSR3 */ 1347/* MIPSR3 */
1286#define read_c0_segctl0() __read_32bit_c0_register($5, 2) 1348#define read_c0_segctl0() __read_32bit_c0_register($5, 2)
1287#define write_c0_segctl0(val) __write_32bit_c0_register($5, 2, val) 1349#define write_c0_segctl0(val) __write_32bit_c0_register($5, 2, val)
diff --git a/arch/mips/include/asm/netlogic/common.h b/arch/mips/include/asm/netlogic/common.h
index c281f03eb312..2a4c128277e4 100644
--- a/arch/mips/include/asm/netlogic/common.h
+++ b/arch/mips/include/asm/netlogic/common.h
@@ -111,6 +111,25 @@ static inline int nlm_irq_to_xirq(int node, int irq)
111 return node * NR_IRQS / NLM_NR_NODES + irq; 111 return node * NR_IRQS / NLM_NR_NODES + irq;
112} 112}
113 113
114extern int nlm_cpu_ready[]; 114#ifdef CONFIG_CPU_XLR
115#define nlm_cores_per_node() 8
116#else
117static inline int nlm_cores_per_node(void)
118{
119 return ((read_c0_prid() & PRID_IMP_MASK)
120 == PRID_IMP_NETLOGIC_XLP9XX) ? 32 : 8;
121}
115#endif 122#endif
123static inline int nlm_threads_per_node(void)
124{
125 return nlm_cores_per_node() * NLM_THREADS_PER_CORE;
126}
127
128static inline int nlm_hwtid_to_node(int hwtid)
129{
130 return hwtid / nlm_threads_per_node();
131}
132
133extern int nlm_cpu_ready[];
134#endif /* __ASSEMBLY__ */
116#endif /* _NETLOGIC_COMMON_H_ */ 135#endif /* _NETLOGIC_COMMON_H_ */
diff --git a/arch/mips/include/asm/netlogic/mips-extns.h b/arch/mips/include/asm/netlogic/mips-extns.h
index 06f1f75bfa9b..788baf399e69 100644
--- a/arch/mips/include/asm/netlogic/mips-extns.h
+++ b/arch/mips/include/asm/netlogic/mips-extns.h
@@ -157,7 +157,13 @@ static inline int nlm_nodeid(void)
157 157
158static inline unsigned int nlm_core_id(void) 158static inline unsigned int nlm_core_id(void)
159{ 159{
160 return (read_c0_ebase() & 0x1c) >> 2; 160 uint32_t prid = read_c0_prid() & PRID_IMP_MASK;
161
162 if ((prid == PRID_IMP_NETLOGIC_XLP9XX) ||
163 (prid == PRID_IMP_NETLOGIC_XLP5XX))
164 return (read_c0_ebase() & 0x7c) >> 2;
165 else
166 return (read_c0_ebase() & 0x1c) >> 2;
161} 167}
162 168
163static inline unsigned int nlm_thread_id(void) 169static inline unsigned int nlm_thread_id(void)
diff --git a/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h b/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h
index 6d2e58a9a542..a06b59292153 100644
--- a/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h
+++ b/arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h
@@ -46,6 +46,8 @@
46#define CPU_BLOCKID_FPU 9 46#define CPU_BLOCKID_FPU 9
47#define CPU_BLOCKID_MAP 10 47#define CPU_BLOCKID_MAP 10
48 48
49#define IFU_BRUB_RESERVE 0x007
50
49#define ICU_DEFEATURE 0x100 51#define ICU_DEFEATURE 0x100
50 52
51#define LSU_DEFEATURE 0x304 53#define LSU_DEFEATURE 0x304
diff --git a/arch/mips/include/asm/netlogic/xlp-hal/sys.h b/arch/mips/include/asm/netlogic/xlp-hal/sys.h
index bc7bddf25be9..6bcf3952e556 100644
--- a/arch/mips/include/asm/netlogic/xlp-hal/sys.h
+++ b/arch/mips/include/asm/netlogic/xlp-hal/sys.h
@@ -177,6 +177,9 @@
177#define SYS_9XX_CLK_DEV_DIV 0x18d 177#define SYS_9XX_CLK_DEV_DIV 0x18d
178#define SYS_9XX_CLK_DEV_CHG 0x18f 178#define SYS_9XX_CLK_DEV_CHG 0x18f
179 179
180#define SYS_9XX_CLK_DEV_SEL_REG 0x1a4
181#define SYS_9XX_CLK_DEV_DIV_REG 0x1a6
182
180/* Registers changed on 9XX */ 183/* Registers changed on 9XX */
181#define SYS_9XX_POWER_ON_RESET_CFG 0x00 184#define SYS_9XX_POWER_ON_RESET_CFG 0x00
182#define SYS_9XX_CHIP_RESET 0x01 185#define SYS_9XX_CHIP_RESET 0x01
diff --git a/arch/mips/include/asm/netlogic/xlp-hal/xlp.h b/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
index a862b93223cc..feb6ed807ec6 100644
--- a/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
+++ b/arch/mips/include/asm/netlogic/xlp-hal/xlp.h
@@ -52,6 +52,7 @@
52#define PIC_2XX_XHCI_2_IRQ 25 52#define PIC_2XX_XHCI_2_IRQ 25
53#define PIC_9XX_XHCI_0_IRQ 23 53#define PIC_9XX_XHCI_0_IRQ 23
54#define PIC_9XX_XHCI_1_IRQ 24 54#define PIC_9XX_XHCI_1_IRQ 24
55#define PIC_9XX_XHCI_2_IRQ 25
55 56
56#define PIC_MMC_IRQ 29 57#define PIC_MMC_IRQ 29
57#define PIC_I2C_0_IRQ 30 58#define PIC_I2C_0_IRQ 30
@@ -89,7 +90,7 @@ void xlp_wakeup_secondary_cpus(void);
89 90
90void xlp_mmu_init(void); 91void xlp_mmu_init(void);
91void nlm_hal_init(void); 92void nlm_hal_init(void);
92int xlp_get_dram_map(int n, uint64_t *dram_map); 93int nlm_get_dram_map(int node, uint64_t *dram_map, int nentries);
93 94
94struct pci_dev; 95struct pci_dev;
95int xlp_socdev_to_node(const struct pci_dev *dev); 96int xlp_socdev_to_node(const struct pci_dev *dev);
diff --git a/arch/mips/include/asm/octeon/cvmx-address.h b/arch/mips/include/asm/octeon/cvmx-address.h
index e2d874e681f6..e4444f8c4a61 100644
--- a/arch/mips/include/asm/octeon/cvmx-address.h
+++ b/arch/mips/include/asm/octeon/cvmx-address.h
@@ -104,6 +104,7 @@ typedef enum {
104typedef union { 104typedef union {
105 105
106 uint64_t u64; 106 uint64_t u64;
107#ifdef __BIG_ENDIAN_BITFIELD
107 /* mapped or unmapped virtual address */ 108 /* mapped or unmapped virtual address */
108 struct { 109 struct {
109 uint64_t R:2; 110 uint64_t R:2;
@@ -202,6 +203,72 @@ typedef union {
202 uint64_t didspace:24; 203 uint64_t didspace:24;
203 uint64_t unused:40; 204 uint64_t unused:40;
204 } sfilldidspace; 205 } sfilldidspace;
206#else
207 struct {
208 uint64_t offset:62;
209 uint64_t R:2;
210 } sva;
211
212 struct {
213 uint64_t offset:31;
214 uint64_t zeroes:33;
215 } suseg;
216
217 struct {
218 uint64_t offset:29;
219 uint64_t sp:2;
220 uint64_t ones:33;
221 } sxkseg;
222
223 struct {
224 uint64_t pa:49;
225 uint64_t mbz:10;
226 uint64_t cca:3;
227 uint64_t R:2;
228 } sxkphys;
229
230 struct {
231 uint64_t offset:36;
232 uint64_t unaddr:4;
233 uint64_t did:8;
234 uint64_t is_io:1;
235 uint64_t mbz:15;
236 } sphys;
237
238 struct {
239 uint64_t offset:36;
240 uint64_t unaddr:4;
241 uint64_t zeroes:24;
242 } smem;
243
244 struct {
245 uint64_t offset:36;
246 uint64_t unaddr:4;
247 uint64_t did:8;
248 uint64_t is_io:1;
249 uint64_t mbz:13;
250 uint64_t mem_region:2;
251 } sio;
252
253 struct {
254 uint64_t addr:13;
255 cvmx_add_win_dec_t csrdec:2;
256 uint64_t ones:49;
257 } sscr;
258
259 struct {
260 uint64_t addr:7;
261 uint64_t type:3;
262 uint64_t unused2:3;
263 uint64_t csrdec:2;
264 uint64_t ones:49;
265 } sdma;
266
267 struct {
268 uint64_t unused:40;
269 uint64_t didspace:24;
270 } sfilldidspace;
271#endif
205 272
206} cvmx_addr_t; 273} cvmx_addr_t;
207 274
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
index 2298199a287e..c373d95b5e2c 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -53,6 +53,7 @@
53 * to 0. 53 * to 0.
54 */ 54 */
55struct cvmx_bootinfo { 55struct cvmx_bootinfo {
56#ifdef __BIG_ENDIAN_BITFIELD
56 uint32_t major_version; 57 uint32_t major_version;
57 uint32_t minor_version; 58 uint32_t minor_version;
58 59
@@ -123,6 +124,60 @@ struct cvmx_bootinfo {
123 */ 124 */
124 uint64_t fdt_addr; 125 uint64_t fdt_addr;
125#endif 126#endif
127#else /* __BIG_ENDIAN */
128 /*
129 * Little-Endian: When the CPU mode is switched to
130 * little-endian, the view of the structure has some of the
131 * fields swapped.
132 */
133 uint32_t minor_version;
134 uint32_t major_version;
135
136 uint64_t stack_top;
137 uint64_t heap_base;
138 uint64_t heap_end;
139 uint64_t desc_vaddr;
140
141 uint32_t stack_size;
142 uint32_t exception_base_addr;
143
144 uint32_t core_mask;
145 uint32_t flags;
146
147 uint32_t phy_mem_desc_addr;
148 uint32_t dram_size;
149
150 uint32_t eclock_hz;
151 uint32_t debugger_flags_base_addr;
152
153 uint32_t reserved0;
154 uint32_t dclock_hz;
155
156 uint8_t reserved3;
157 uint8_t reserved2;
158 uint16_t reserved1;
159 uint8_t board_rev_minor;
160 uint8_t board_rev_major;
161 uint16_t board_type;
162
163 char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN];
164 uint8_t mac_addr_base[6];
165 uint8_t mac_addr_count;
166 uint8_t pad[5];
167
168#if (CVMX_BOOTINFO_MIN_VER >= 1)
169 uint64_t compact_flash_common_base_addr;
170 uint64_t compact_flash_attribute_base_addr;
171 uint64_t led_display_base_addr;
172#endif
173#if (CVMX_BOOTINFO_MIN_VER >= 2)
174 uint32_t config_flags;
175 uint32_t dfa_ref_clock_hz;
176#endif
177#if (CVMX_BOOTINFO_MIN_VER >= 3)
178 uint64_t fdt_addr;
179#endif
180#endif
126}; 181};
127 182
128#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0) 183#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h
index 352f1dc2508b..374562507d0b 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootmem.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h
@@ -95,6 +95,7 @@ struct cvmx_bootmem_named_block_desc {
95 * positions for backwards compatibility. 95 * positions for backwards compatibility.
96 */ 96 */
97struct cvmx_bootmem_desc { 97struct cvmx_bootmem_desc {
98#if defined(__BIG_ENDIAN_BITFIELD) || defined(CVMX_BUILD_FOR_LINUX_HOST)
98 /* spinlock to control access to list */ 99 /* spinlock to control access to list */
99 uint32_t lock; 100 uint32_t lock;
100 /* flags for indicating various conditions */ 101 /* flags for indicating various conditions */
@@ -120,7 +121,20 @@ struct cvmx_bootmem_desc {
120 uint32_t named_block_name_len; 121 uint32_t named_block_name_len;
121 /* address of named memory block descriptors */ 122 /* address of named memory block descriptors */
122 uint64_t named_block_array_addr; 123 uint64_t named_block_array_addr;
124#else /* __LITTLE_ENDIAN */
125 uint32_t flags;
126 uint32_t lock;
127 uint64_t head_addr;
123 128
129 uint32_t minor_version;
130 uint32_t major_version;
131 uint64_t app_data_addr;
132 uint64_t app_data_size;
133
134 uint32_t named_block_name_len;
135 uint32_t named_block_num_blocks;
136 uint64_t named_block_array_addr;
137#endif
124}; 138};
125 139
126/** 140/**
diff --git a/arch/mips/include/asm/octeon/cvmx-fau.h b/arch/mips/include/asm/octeon/cvmx-fau.h
index ef98f7fc102f..dafeae300c97 100644
--- a/arch/mips/include/asm/octeon/cvmx-fau.h
+++ b/arch/mips/include/asm/octeon/cvmx-fau.h
@@ -105,6 +105,16 @@ typedef union {
105 } s; 105 } s;
106} cvmx_fau_async_tagwait_result_t; 106} cvmx_fau_async_tagwait_result_t;
107 107
108#ifdef __BIG_ENDIAN_BITFIELD
109#define SWIZZLE_8 0
110#define SWIZZLE_16 0
111#define SWIZZLE_32 0
112#else
113#define SWIZZLE_8 0x7
114#define SWIZZLE_16 0x6
115#define SWIZZLE_32 0x4
116#endif
117
108/** 118/**
109 * Builds a store I/O address for writing to the FAU 119 * Builds a store I/O address for writing to the FAU
110 * 120 *
@@ -175,6 +185,7 @@ static inline int64_t cvmx_fau_fetch_and_add64(cvmx_fau_reg_64_t reg,
175static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg, 185static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg,
176 int32_t value) 186 int32_t value)
177{ 187{
188 reg ^= SWIZZLE_32;
178 return cvmx_read64_int32(__cvmx_fau_atomic_address(0, reg, value)); 189 return cvmx_read64_int32(__cvmx_fau_atomic_address(0, reg, value));
179} 190}
180 191
@@ -189,6 +200,7 @@ static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg,
189static inline int16_t cvmx_fau_fetch_and_add16(cvmx_fau_reg_16_t reg, 200static inline int16_t cvmx_fau_fetch_and_add16(cvmx_fau_reg_16_t reg,
190 int16_t value) 201 int16_t value)
191{ 202{
203 reg ^= SWIZZLE_16;
192 return cvmx_read64_int16(__cvmx_fau_atomic_address(0, reg, value)); 204 return cvmx_read64_int16(__cvmx_fau_atomic_address(0, reg, value));
193} 205}
194 206
@@ -201,6 +213,7 @@ static inline int16_t cvmx_fau_fetch_and_add16(cvmx_fau_reg_16_t reg,
201 */ 213 */
202static inline int8_t cvmx_fau_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value) 214static inline int8_t cvmx_fau_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value)
203{ 215{
216 reg ^= SWIZZLE_8;
204 return cvmx_read64_int8(__cvmx_fau_atomic_address(0, reg, value)); 217 return cvmx_read64_int8(__cvmx_fau_atomic_address(0, reg, value));
205} 218}
206 219
@@ -247,6 +260,7 @@ cvmx_fau_tagwait_fetch_and_add32(cvmx_fau_reg_32_t reg, int32_t value)
247 uint64_t i32; 260 uint64_t i32;
248 cvmx_fau_tagwait32_t t; 261 cvmx_fau_tagwait32_t t;
249 } result; 262 } result;
263 reg ^= SWIZZLE_32;
250 result.i32 = 264 result.i32 =
251 cvmx_read64_int32(__cvmx_fau_atomic_address(1, reg, value)); 265 cvmx_read64_int32(__cvmx_fau_atomic_address(1, reg, value));
252 return result.t; 266 return result.t;
@@ -270,6 +284,7 @@ cvmx_fau_tagwait_fetch_and_add16(cvmx_fau_reg_16_t reg, int16_t value)
270 uint64_t i16; 284 uint64_t i16;
271 cvmx_fau_tagwait16_t t; 285 cvmx_fau_tagwait16_t t;
272 } result; 286 } result;
287 reg ^= SWIZZLE_16;
273 result.i16 = 288 result.i16 =
274 cvmx_read64_int16(__cvmx_fau_atomic_address(1, reg, value)); 289 cvmx_read64_int16(__cvmx_fau_atomic_address(1, reg, value));
275 return result.t; 290 return result.t;
@@ -292,6 +307,7 @@ cvmx_fau_tagwait_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value)
292 uint64_t i8; 307 uint64_t i8;
293 cvmx_fau_tagwait8_t t; 308 cvmx_fau_tagwait8_t t;
294 } result; 309 } result;
310 reg ^= SWIZZLE_8;
295 result.i8 = cvmx_read64_int8(__cvmx_fau_atomic_address(1, reg, value)); 311 result.i8 = cvmx_read64_int8(__cvmx_fau_atomic_address(1, reg, value));
296 return result.t; 312 return result.t;
297} 313}
@@ -521,6 +537,7 @@ static inline void cvmx_fau_atomic_add64(cvmx_fau_reg_64_t reg, int64_t value)
521 */ 537 */
522static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value) 538static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value)
523{ 539{
540 reg ^= SWIZZLE_32;
524 cvmx_write64_int32(__cvmx_fau_store_address(0, reg), value); 541 cvmx_write64_int32(__cvmx_fau_store_address(0, reg), value);
525} 542}
526 543
@@ -533,6 +550,7 @@ static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value)
533 */ 550 */
534static inline void cvmx_fau_atomic_add16(cvmx_fau_reg_16_t reg, int16_t value) 551static inline void cvmx_fau_atomic_add16(cvmx_fau_reg_16_t reg, int16_t value)
535{ 552{
553 reg ^= SWIZZLE_16;
536 cvmx_write64_int16(__cvmx_fau_store_address(0, reg), value); 554 cvmx_write64_int16(__cvmx_fau_store_address(0, reg), value);
537} 555}
538 556
@@ -544,6 +562,7 @@ static inline void cvmx_fau_atomic_add16(cvmx_fau_reg_16_t reg, int16_t value)
544 */ 562 */
545static inline void cvmx_fau_atomic_add8(cvmx_fau_reg_8_t reg, int8_t value) 563static inline void cvmx_fau_atomic_add8(cvmx_fau_reg_8_t reg, int8_t value)
546{ 564{
565 reg ^= SWIZZLE_8;
547 cvmx_write64_int8(__cvmx_fau_store_address(0, reg), value); 566 cvmx_write64_int8(__cvmx_fau_store_address(0, reg), value);
548} 567}
549 568
@@ -568,6 +587,7 @@ static inline void cvmx_fau_atomic_write64(cvmx_fau_reg_64_t reg, int64_t value)
568 */ 587 */
569static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value) 588static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value)
570{ 589{
590 reg ^= SWIZZLE_32;
571 cvmx_write64_int32(__cvmx_fau_store_address(1, reg), value); 591 cvmx_write64_int32(__cvmx_fau_store_address(1, reg), value);
572} 592}
573 593
@@ -580,6 +600,7 @@ static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value)
580 */ 600 */
581static inline void cvmx_fau_atomic_write16(cvmx_fau_reg_16_t reg, int16_t value) 601static inline void cvmx_fau_atomic_write16(cvmx_fau_reg_16_t reg, int16_t value)
582{ 602{
603 reg ^= SWIZZLE_16;
583 cvmx_write64_int16(__cvmx_fau_store_address(1, reg), value); 604 cvmx_write64_int16(__cvmx_fau_store_address(1, reg), value);
584} 605}
585 606
@@ -591,6 +612,7 @@ static inline void cvmx_fau_atomic_write16(cvmx_fau_reg_16_t reg, int16_t value)
591 */ 612 */
592static inline void cvmx_fau_atomic_write8(cvmx_fau_reg_8_t reg, int8_t value) 613static inline void cvmx_fau_atomic_write8(cvmx_fau_reg_8_t reg, int8_t value)
593{ 614{
615 reg ^= SWIZZLE_8;
594 cvmx_write64_int8(__cvmx_fau_store_address(1, reg), value); 616 cvmx_write64_int8(__cvmx_fau_store_address(1, reg), value);
595} 617}
596 618
diff --git a/arch/mips/include/asm/octeon/cvmx-fpa.h b/arch/mips/include/asm/octeon/cvmx-fpa.h
index aa26a2ce5a0e..c00501d0f7ae 100644
--- a/arch/mips/include/asm/octeon/cvmx-fpa.h
+++ b/arch/mips/include/asm/octeon/cvmx-fpa.h
@@ -49,6 +49,7 @@
49typedef union { 49typedef union {
50 uint64_t u64; 50 uint64_t u64;
51 struct { 51 struct {
52#ifdef __BIG_ENDIAN_BITFIELD
52 /* 53 /*
53 * the (64-bit word) location in scratchpad to write 54 * the (64-bit word) location in scratchpad to write
54 * to (if len != 0) 55 * to (if len != 0)
@@ -63,6 +64,12 @@ typedef union {
63 * the NCB bus. 64 * the NCB bus.
64 */ 65 */
65 uint64_t addr:40; 66 uint64_t addr:40;
67#else
68 uint64_t addr:40;
69 uint64_t did:8;
70 uint64_t len:8;
71 uint64_t scraddr:8;
72#endif
66 } s; 73 } s;
67} cvmx_fpa_iobdma_data_t; 74} cvmx_fpa_iobdma_data_t;
68 75
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c.h b/arch/mips/include/asm/octeon/cvmx-l2c.h
index 11c0a8fa8eb5..ddb429210a0e 100644
--- a/arch/mips/include/asm/octeon/cvmx-l2c.h
+++ b/arch/mips/include/asm/octeon/cvmx-l2c.h
@@ -53,12 +53,21 @@
53union cvmx_l2c_tag { 53union cvmx_l2c_tag {
54 uint64_t u64; 54 uint64_t u64;
55 struct { 55 struct {
56#ifdef __BIG_ENDIAN_BITFIELD
56 uint64_t reserved:28; 57 uint64_t reserved:28;
57 uint64_t V:1; /* Line valid */ 58 uint64_t V:1; /* Line valid */
58 uint64_t D:1; /* Line dirty */ 59 uint64_t D:1; /* Line dirty */
59 uint64_t L:1; /* Line locked */ 60 uint64_t L:1; /* Line locked */
60 uint64_t U:1; /* Use, LRU eviction */ 61 uint64_t U:1; /* Use, LRU eviction */
61 uint64_t addr:32; /* Phys mem (not all bits valid) */ 62 uint64_t addr:32; /* Phys mem (not all bits valid) */
63#else
64 uint64_t addr:32; /* Phys mem (not all bits valid) */
65 uint64_t U:1; /* Use, LRU eviction */
66 uint64_t L:1; /* Line locked */
67 uint64_t D:1; /* Line dirty */
68 uint64_t V:1; /* Line valid */
69 uint64_t reserved:28;
70#endif
62 } s; 71 } s;
63}; 72};
64 73
diff --git a/arch/mips/include/asm/octeon/cvmx-packet.h b/arch/mips/include/asm/octeon/cvmx-packet.h
index 38aefa1bab9d..895e93d682c2 100644
--- a/arch/mips/include/asm/octeon/cvmx-packet.h
+++ b/arch/mips/include/asm/octeon/cvmx-packet.h
@@ -39,6 +39,7 @@ union cvmx_buf_ptr {
39 void *ptr; 39 void *ptr;
40 uint64_t u64; 40 uint64_t u64;
41 struct { 41 struct {
42#ifdef __BIG_ENDIAN_BITFIELD
42 /* if set, invert the "free" pick of the overall 43 /* if set, invert the "free" pick of the overall
43 * packet. HW always sets this bit to 0 on inbound 44 * packet. HW always sets this bit to 0 on inbound
44 * packet */ 45 * packet */
@@ -55,6 +56,13 @@ union cvmx_buf_ptr {
55 uint64_t size:16; 56 uint64_t size:16;
56 /* Pointer to the first byte of the data, NOT buffer */ 57 /* Pointer to the first byte of the data, NOT buffer */
57 uint64_t addr:40; 58 uint64_t addr:40;
59#else
60 uint64_t addr:40;
61 uint64_t size:16;
62 uint64_t pool:3;
63 uint64_t back:4;
64 uint64_t i:1;
65#endif
58 } s; 66 } s;
59}; 67};
60 68
diff --git a/arch/mips/include/asm/octeon/cvmx-pko.h b/arch/mips/include/asm/octeon/cvmx-pko.h
index f7d2a6718849..3da59bb8ce24 100644
--- a/arch/mips/include/asm/octeon/cvmx-pko.h
+++ b/arch/mips/include/asm/octeon/cvmx-pko.h
@@ -127,6 +127,7 @@ typedef struct {
127typedef union { 127typedef union {
128 uint64_t u64; 128 uint64_t u64;
129 struct { 129 struct {
130#ifdef __BIG_ENDIAN_BITFIELD
130 /* Must CVMX_IO_SEG */ 131 /* Must CVMX_IO_SEG */
131 uint64_t mem_space:2; 132 uint64_t mem_space:2;
132 /* Must be zero */ 133 /* Must be zero */
@@ -151,6 +152,17 @@ typedef union {
151 uint64_t queue:9; 152 uint64_t queue:9;
152 /* Must be zero */ 153 /* Must be zero */
153 uint64_t reserved4:3; 154 uint64_t reserved4:3;
155#else
156 uint64_t reserved4:3;
157 uint64_t queue:9;
158 uint64_t port:9;
159 uint64_t reserved3:15;
160 uint64_t reserved2:4;
161 uint64_t did:8;
162 uint64_t is_io:1;
163 uint64_t reserved:13;
164 uint64_t mem_space:2;
165#endif
154 } s; 166 } s;
155} cvmx_pko_doorbell_address_t; 167} cvmx_pko_doorbell_address_t;
156 168
@@ -160,6 +172,7 @@ typedef union {
160typedef union { 172typedef union {
161 uint64_t u64; 173 uint64_t u64;
162 struct { 174 struct {
175#ifdef __BIG_ENDIAN_BITFIELD
163 /* 176 /*
164 * The size of the reg1 operation - could be 8, 16, 177 * The size of the reg1 operation - could be 8, 16,
165 * 32, or 64 bits. 178 * 32, or 64 bits.
@@ -229,6 +242,24 @@ typedef union {
229 uint64_t segs:6; 242 uint64_t segs:6;
230 /* Including L2, but no trailing CRC */ 243 /* Including L2, but no trailing CRC */
231 uint64_t total_bytes:16; 244 uint64_t total_bytes:16;
245#else
246 uint64_t total_bytes:16;
247 uint64_t segs:6;
248 uint64_t dontfree:1;
249 uint64_t ignore_i:1;
250 uint64_t ipoffp1:7;
251 uint64_t gather:1;
252 uint64_t rsp:1;
253 uint64_t wqp:1;
254 uint64_t n2:1;
255 uint64_t le:1;
256 uint64_t reg0:11;
257 uint64_t subone0:1;
258 uint64_t reg1:11;
259 uint64_t subone1:1;
260 uint64_t size0:2;
261 uint64_t size1:2;
262#endif
232 } s; 263 } s;
233} cvmx_pko_command_word0_t; 264} cvmx_pko_command_word0_t;
234 265
diff --git a/arch/mips/include/asm/octeon/cvmx-pow.h b/arch/mips/include/asm/octeon/cvmx-pow.h
index 2188e65afb86..d5565d758ddd 100644
--- a/arch/mips/include/asm/octeon/cvmx-pow.h
+++ b/arch/mips/include/asm/octeon/cvmx-pow.h
@@ -178,6 +178,7 @@ typedef enum {
178typedef union { 178typedef union {
179 uint64_t u64; 179 uint64_t u64;
180 struct { 180 struct {
181#ifdef __BIG_ENDIAN_BITFIELD
181 /* 182 /*
182 * Don't reschedule this entry. no_sched is used for 183 * Don't reschedule this entry. no_sched is used for
183 * CVMX_POW_TAG_OP_SWTAG_DESCH and 184 * CVMX_POW_TAG_OP_SWTAG_DESCH and
@@ -217,6 +218,17 @@ typedef union {
217 * CVMX_POW_TAG_OP_*_NSCHED 218 * CVMX_POW_TAG_OP_*_NSCHED
218 */ 219 */
219 uint64_t tag:32; 220 uint64_t tag:32;
221#else
222 uint64_t tag:32;
223 uint64_t type:3;
224 uint64_t grp:4;
225 uint64_t qos:3;
226 uint64_t unused2:2;
227 cvmx_pow_tag_op_t op:4;
228 uint64_t index:13;
229 uint64_t unused:2;
230 uint64_t no_sched:1;
231#endif
220 } s; 232 } s;
221} cvmx_pow_tag_req_t; 233} cvmx_pow_tag_req_t;
222 234
@@ -230,6 +242,7 @@ typedef union {
230 * Address for new work request loads (did<2:0> == 0) 242 * Address for new work request loads (did<2:0> == 0)
231 */ 243 */
232 struct { 244 struct {
245#ifdef __BIG_ENDIAN_BITFIELD
233 /* Mips64 address region. Should be CVMX_IO_SEG */ 246 /* Mips64 address region. Should be CVMX_IO_SEG */
234 uint64_t mem_region:2; 247 uint64_t mem_region:2;
235 /* Must be zero */ 248 /* Must be zero */
@@ -247,12 +260,22 @@ typedef union {
247 uint64_t wait:1; 260 uint64_t wait:1;
248 /* Must be zero */ 261 /* Must be zero */
249 uint64_t reserved_0_2:3; 262 uint64_t reserved_0_2:3;
263#else
264 uint64_t reserved_0_2:3;
265 uint64_t wait:1;
266 uint64_t reserved_4_39:36;
267 uint64_t did:8;
268 uint64_t is_io:1;
269 uint64_t reserved_49_61:13;
270 uint64_t mem_region:2;
271#endif
250 } swork; 272 } swork;
251 273
252 /** 274 /**
253 * Address for loads to get POW internal status 275 * Address for loads to get POW internal status
254 */ 276 */
255 struct { 277 struct {
278#ifdef __BIG_ENDIAN_BITFIELD
256 /* Mips64 address region. Should be CVMX_IO_SEG */ 279 /* Mips64 address region. Should be CVMX_IO_SEG */
257 uint64_t mem_region:2; 280 uint64_t mem_region:2;
258 /* Must be zero */ 281 /* Must be zero */
@@ -282,12 +305,25 @@ typedef union {
282 uint64_t get_wqp:1; 305 uint64_t get_wqp:1;
283 /* Must be zero */ 306 /* Must be zero */
284 uint64_t reserved_0_2:3; 307 uint64_t reserved_0_2:3;
308#else
309 uint64_t reserved_0_2:3;
310 uint64_t get_wqp:1;
311 uint64_t get_cur:1;
312 uint64_t get_rev:1;
313 uint64_t coreid:4;
314 uint64_t reserved_10_39:30;
315 uint64_t did:8;
316 uint64_t is_io:1;
317 uint64_t reserved_49_61:13;
318 uint64_t mem_region:2;
319#endif
285 } sstatus; 320 } sstatus;
286 321
287 /** 322 /**
288 * Address for memory loads to get POW internal state 323 * Address for memory loads to get POW internal state
289 */ 324 */
290 struct { 325 struct {
326#ifdef __BIG_ENDIAN_BITFIELD
291 /* Mips64 address region. Should be CVMX_IO_SEG */ 327 /* Mips64 address region. Should be CVMX_IO_SEG */
292 uint64_t mem_region:2; 328 uint64_t mem_region:2;
293 /* Must be zero */ 329 /* Must be zero */
@@ -314,12 +350,24 @@ typedef union {
314 uint64_t get_wqp:1; 350 uint64_t get_wqp:1;
315 /* Must be zero */ 351 /* Must be zero */
316 uint64_t reserved_0_2:3; 352 uint64_t reserved_0_2:3;
353#else
354 uint64_t reserved_0_2:3;
355 uint64_t get_wqp:1;
356 uint64_t get_des:1;
357 uint64_t index:11;
358 uint64_t reserved_16_39:24;
359 uint64_t did:8;
360 uint64_t is_io:1;
361 uint64_t reserved_49_61:13;
362 uint64_t mem_region:2;
363#endif
317 } smemload; 364 } smemload;
318 365
319 /** 366 /**
320 * Address for index/pointer loads 367 * Address for index/pointer loads
321 */ 368 */
322 struct { 369 struct {
370#ifdef __BIG_ENDIAN_BITFIELD
323 /* Mips64 address region. Should be CVMX_IO_SEG */ 371 /* Mips64 address region. Should be CVMX_IO_SEG */
324 uint64_t mem_region:2; 372 uint64_t mem_region:2;
325 /* Must be zero */ 373 /* Must be zero */
@@ -366,6 +414,17 @@ typedef union {
366 uint64_t get_rmt:1; 414 uint64_t get_rmt:1;
367 /* Must be zero */ 415 /* Must be zero */
368 uint64_t reserved_0_2:3; 416 uint64_t reserved_0_2:3;
417#else
418 uint64_t reserved_0_2:3;
419 uint64_t get_rmt:1;
420 uint64_t get_des_get_tail:1;
421 uint64_t qosgrp:4;
422 uint64_t reserved_9_39:31;
423 uint64_t did:8;
424 uint64_t is_io:1;
425 uint64_t reserved_49_61:13;
426 uint64_t mem_region:2;
427#endif
369 } sindexload; 428 } sindexload;
370 429
371 /** 430 /**
@@ -377,6 +436,7 @@ typedef union {
377 * available.) 436 * available.)
378 */ 437 */
379 struct { 438 struct {
439#ifdef __BIG_ENDIAN_BITFIELD
380 /* Mips64 address region. Should be CVMX_IO_SEG */ 440 /* Mips64 address region. Should be CVMX_IO_SEG */
381 uint64_t mem_region:2; 441 uint64_t mem_region:2;
382 /* Must be zero */ 442 /* Must be zero */
@@ -387,6 +447,13 @@ typedef union {
387 uint64_t did:8; 447 uint64_t did:8;
388 /* Must be zero */ 448 /* Must be zero */
389 uint64_t reserved_0_39:40; 449 uint64_t reserved_0_39:40;
450#else
451 uint64_t reserved_0_39:40;
452 uint64_t did:8;
453 uint64_t is_io:1;
454 uint64_t reserved_49_61:13;
455 uint64_t mem_region:2;
456#endif
390 } snull_rd; 457 } snull_rd;
391} cvmx_pow_load_addr_t; 458} cvmx_pow_load_addr_t;
392 459
@@ -401,6 +468,7 @@ typedef union {
401 * Response to new work request loads 468 * Response to new work request loads
402 */ 469 */
403 struct { 470 struct {
471#ifdef __BIG_ENDIAN_BITFIELD
404 /* 472 /*
405 * Set when no new work queue entry was returned. * 473 * Set when no new work queue entry was returned. *
406 * If there was de-scheduled work, the HW will 474 * If there was de-scheduled work, the HW will
@@ -419,12 +487,18 @@ typedef union {
419 uint64_t reserved_40_62:23; 487 uint64_t reserved_40_62:23;
420 /* 36 in O1 -- the work queue pointer */ 488 /* 36 in O1 -- the work queue pointer */
421 uint64_t addr:40; 489 uint64_t addr:40;
490#else
491 uint64_t addr:40;
492 uint64_t reserved_40_62:23;
493 uint64_t no_work:1;
494#endif
422 } s_work; 495 } s_work;
423 496
424 /** 497 /**
425 * Result for a POW Status Load (when get_cur==0 and get_wqp==0) 498 * Result for a POW Status Load (when get_cur==0 and get_wqp==0)
426 */ 499 */
427 struct { 500 struct {
501#ifdef __BIG_ENDIAN_BITFIELD
428 uint64_t reserved_62_63:2; 502 uint64_t reserved_62_63:2;
429 /* Set when there is a pending non-NULL SWTAG or 503 /* Set when there is a pending non-NULL SWTAG or
430 * SWTAG_FULL, and the POW entry has not left the list 504 * SWTAG_FULL, and the POW entry has not left the list
@@ -476,12 +550,32 @@ typedef union {
476 * AND pend_desched_switch) are set. 550 * AND pend_desched_switch) are set.
477 */ 551 */
478 uint64_t pend_tag:32; 552 uint64_t pend_tag:32;
553#else
554 uint64_t pend_tag:32;
555 uint64_t pend_type:2;
556 uint64_t reserved_34_35:2;
557 uint64_t pend_grp:4;
558 uint64_t pend_index:11;
559 uint64_t reserved_51:1;
560 uint64_t pend_nosched_clr:1;
561 uint64_t pend_null_rd:1;
562 uint64_t pend_new_work_wait:1;
563 uint64_t pend_new_work:1;
564 uint64_t pend_nosched:1;
565 uint64_t pend_desched_switch:1;
566 uint64_t pend_desched:1;
567 uint64_t pend_switch_null:1;
568 uint64_t pend_switch_full:1;
569 uint64_t pend_switch:1;
570 uint64_t reserved_62_63:2;
571#endif
479 } s_sstatus0; 572 } s_sstatus0;
480 573
481 /** 574 /**
482 * Result for a POW Status Load (when get_cur==0 and get_wqp==1) 575 * Result for a POW Status Load (when get_cur==0 and get_wqp==1)
483 */ 576 */
484 struct { 577 struct {
578#ifdef __BIG_ENDIAN_BITFIELD
485 uint64_t reserved_62_63:2; 579 uint64_t reserved_62_63:2;
486 /* 580 /*
487 * Set when there is a pending non-NULL SWTAG or 581 * Set when there is a pending non-NULL SWTAG or
@@ -529,6 +623,23 @@ typedef union {
529 uint64_t pend_grp:4; 623 uint64_t pend_grp:4;
530 /* This is the wqp when pend_nosched_clr is set. */ 624 /* This is the wqp when pend_nosched_clr is set. */
531 uint64_t pend_wqp:36; 625 uint64_t pend_wqp:36;
626#else
627 uint64_t pend_wqp:36;
628 uint64_t pend_grp:4;
629 uint64_t pend_index:11;
630 uint64_t reserved_51:1;
631 uint64_t pend_nosched_clr:1;
632 uint64_t pend_null_rd:1;
633 uint64_t pend_new_work_wait:1;
634 uint64_t pend_new_work:1;
635 uint64_t pend_nosched:1;
636 uint64_t pend_desched_switch:1;
637 uint64_t pend_desched:1;
638 uint64_t pend_switch_null:1;
639 uint64_t pend_switch_full:1;
640 uint64_t pend_switch:1;
641 uint64_t reserved_62_63:2;
642#endif
532 } s_sstatus1; 643 } s_sstatus1;
533 644
534 /** 645 /**
@@ -536,6 +647,7 @@ typedef union {
536 * get_rev==0) 647 * get_rev==0)
537 */ 648 */
538 struct { 649 struct {
650#ifdef __BIG_ENDIAN_BITFIELD
539 uint64_t reserved_62_63:2; 651 uint64_t reserved_62_63:2;
540 /* 652 /*
541 * Points to the next POW entry in the tag list when 653 * Points to the next POW entry in the tag list when
@@ -573,12 +685,23 @@ typedef union {
573 * SWTAG_DESCHED). 685 * SWTAG_DESCHED).
574 */ 686 */
575 uint64_t tag:32; 687 uint64_t tag:32;
688#else
689 uint64_t tag:32;
690 uint64_t tag_type:2;
691 uint64_t tail:1;
692 uint64_t head:1;
693 uint64_t grp:4;
694 uint64_t index:11;
695 uint64_t link_index:11;
696 uint64_t reserved_62_63:2;
697#endif
576 } s_sstatus2; 698 } s_sstatus2;
577 699
578 /** 700 /**
579 * Result for a POW Status Load (when get_cur==1, get_wqp==0, and get_rev==1) 701 * Result for a POW Status Load (when get_cur==1, get_wqp==0, and get_rev==1)
580 */ 702 */
581 struct { 703 struct {
704#ifdef __BIG_ENDIAN_BITFIELD
582 uint64_t reserved_62_63:2; 705 uint64_t reserved_62_63:2;
583 /* 706 /*
584 * Points to the prior POW entry in the tag list when 707 * Points to the prior POW entry in the tag list when
@@ -617,6 +740,16 @@ typedef union {
617 * SWTAG_DESCHED). 740 * SWTAG_DESCHED).
618 */ 741 */
619 uint64_t tag:32; 742 uint64_t tag:32;
743#else
744 uint64_t tag:32;
745 uint64_t tag_type:2;
746 uint64_t tail:1;
747 uint64_t head:1;
748 uint64_t grp:4;
749 uint64_t index:11;
750 uint64_t revlink_index:11;
751 uint64_t reserved_62_63:2;
752#endif
620 } s_sstatus3; 753 } s_sstatus3;
621 754
622 /** 755 /**
@@ -624,6 +757,7 @@ typedef union {
624 * get_rev==0) 757 * get_rev==0)
625 */ 758 */
626 struct { 759 struct {
760#ifdef __BIG_ENDIAN_BITFIELD
627 uint64_t reserved_62_63:2; 761 uint64_t reserved_62_63:2;
628 /* 762 /*
629 * Points to the next POW entry in the tag list when 763 * Points to the next POW entry in the tag list when
@@ -642,6 +776,13 @@ typedef union {
642 * list entered on SWTAG_FULL). 776 * list entered on SWTAG_FULL).
643 */ 777 */
644 uint64_t wqp:36; 778 uint64_t wqp:36;
779#else
780 uint64_t wqp:36;
781 uint64_t grp:4;
782 uint64_t index:11;
783 uint64_t link_index:11;
784 uint64_t reserved_62_63:2;
785#endif
645 } s_sstatus4; 786 } s_sstatus4;
646 787
647 /** 788 /**
@@ -649,6 +790,7 @@ typedef union {
649 * get_rev==1) 790 * get_rev==1)
650 */ 791 */
651 struct { 792 struct {
793#ifdef __BIG_ENDIAN_BITFIELD
652 uint64_t reserved_62_63:2; 794 uint64_t reserved_62_63:2;
653 /* 795 /*
654 * Points to the prior POW entry in the tag list when 796 * Points to the prior POW entry in the tag list when
@@ -669,12 +811,20 @@ typedef union {
669 * list entered on SWTAG_FULL). 811 * list entered on SWTAG_FULL).
670 */ 812 */
671 uint64_t wqp:36; 813 uint64_t wqp:36;
814#else
815 uint64_t wqp:36;
816 uint64_t grp:4;
817 uint64_t index:11;
818 uint64_t revlink_index:11;
819 uint64_t reserved_62_63:2;
820#endif
672 } s_sstatus5; 821 } s_sstatus5;
673 822
674 /** 823 /**
675 * Result For POW Memory Load (get_des == 0 and get_wqp == 0) 824 * Result For POW Memory Load (get_des == 0 and get_wqp == 0)
676 */ 825 */
677 struct { 826 struct {
827#ifdef __BIG_ENDIAN_BITFIELD
678 uint64_t reserved_51_63:13; 828 uint64_t reserved_51_63:13;
679 /* 829 /*
680 * The next entry in the input, free, descheduled_head 830 * The next entry in the input, free, descheduled_head
@@ -695,12 +845,22 @@ typedef union {
695 uint64_t tag_type:2; 845 uint64_t tag_type:2;
696 /* The tag of the POW entry. */ 846 /* The tag of the POW entry. */
697 uint64_t tag:32; 847 uint64_t tag:32;
848#else
849 uint64_t tag:32;
850 uint64_t tag_type:2;
851 uint64_t tail:1;
852 uint64_t reserved_35:1;
853 uint64_t grp:4;
854 uint64_t next_index:11;
855 uint64_t reserved_51_63:13;
856#endif
698 } s_smemload0; 857 } s_smemload0;
699 858
700 /** 859 /**
701 * Result For POW Memory Load (get_des == 0 and get_wqp == 1) 860 * Result For POW Memory Load (get_des == 0 and get_wqp == 1)
702 */ 861 */
703 struct { 862 struct {
863#ifdef __BIG_ENDIAN_BITFIELD
704 uint64_t reserved_51_63:13; 864 uint64_t reserved_51_63:13;
705 /* 865 /*
706 * The next entry in the input, free, descheduled_head 866 * The next entry in the input, free, descheduled_head
@@ -712,12 +872,19 @@ typedef union {
712 uint64_t grp:4; 872 uint64_t grp:4;
713 /* The WQP held in the POW entry. */ 873 /* The WQP held in the POW entry. */
714 uint64_t wqp:36; 874 uint64_t wqp:36;
875#else
876 uint64_t wqp:36;
877 uint64_t grp:4;
878 uint64_t next_index:11;
879 uint64_t reserved_51_63:13;
880#endif
715 } s_smemload1; 881 } s_smemload1;
716 882
717 /** 883 /**
718 * Result For POW Memory Load (get_des == 1) 884 * Result For POW Memory Load (get_des == 1)
719 */ 885 */
720 struct { 886 struct {
887#ifdef __BIG_ENDIAN_BITFIELD
721 uint64_t reserved_51_63:13; 888 uint64_t reserved_51_63:13;
722 /* 889 /*
723 * The next entry in the tag list connected to the 890 * The next entry in the tag list connected to the
@@ -740,12 +907,22 @@ typedef union {
740 * is set. 907 * is set.
741 */ 908 */
742 uint64_t pend_tag:32; 909 uint64_t pend_tag:32;
910#else
911 uint64_t pend_tag:32;
912 uint64_t pend_type:2;
913 uint64_t pend_switch:1;
914 uint64_t nosched:1;
915 uint64_t grp:4;
916 uint64_t fwd_index:11;
917 uint64_t reserved_51_63:13;
918#endif
743 } s_smemload2; 919 } s_smemload2;
744 920
745 /** 921 /**
746 * Result For POW Index/Pointer Load (get_rmt == 0/get_des_get_tail == 0) 922 * Result For POW Index/Pointer Load (get_rmt == 0/get_des_get_tail == 0)
747 */ 923 */
748 struct { 924 struct {
925#ifdef __BIG_ENDIAN_BITFIELD
749 uint64_t reserved_52_63:12; 926 uint64_t reserved_52_63:12;
750 /* 927 /*
751 * set when there is one or more POW entries on the 928 * set when there is one or more POW entries on the
@@ -791,12 +968,28 @@ typedef union {
791 * the input Q list selected by qosgrp. 968 * the input Q list selected by qosgrp.
792 */ 969 */
793 uint64_t loc_tail:11; 970 uint64_t loc_tail:11;
971#else
972 uint64_t loc_tail:11;
973 uint64_t reserved_11:1;
974 uint64_t loc_head:11;
975 uint64_t reserved_23:1;
976 uint64_t loc_one:1;
977 uint64_t loc_val:1;
978 uint64_t free_tail:11;
979 uint64_t reserved_37:1;
980 uint64_t free_head:11;
981 uint64_t reserved_49:1;
982 uint64_t free_one:1;
983 uint64_t free_val:1;
984 uint64_t reserved_52_63:12;
985#endif
794 } sindexload0; 986 } sindexload0;
795 987
796 /** 988 /**
797 * Result For POW Index/Pointer Load (get_rmt == 0/get_des_get_tail == 1) 989 * Result For POW Index/Pointer Load (get_rmt == 0/get_des_get_tail == 1)
798 */ 990 */
799 struct { 991 struct {
992#ifdef __BIG_ENDIAN_BITFIELD
800 uint64_t reserved_52_63:12; 993 uint64_t reserved_52_63:12;
801 /* 994 /*
802 * set when there is one or more POW entries on the 995 * set when there is one or more POW entries on the
@@ -843,12 +1036,28 @@ typedef union {
843 * head on the descheduled list selected by qosgrp. 1036 * head on the descheduled list selected by qosgrp.
844 */ 1037 */
845 uint64_t des_tail:11; 1038 uint64_t des_tail:11;
1039#else
1040 uint64_t des_tail:11;
1041 uint64_t reserved_11:1;
1042 uint64_t des_head:11;
1043 uint64_t reserved_23:1;
1044 uint64_t des_one:1;
1045 uint64_t des_val:1;
1046 uint64_t nosched_tail:11;
1047 uint64_t reserved_37:1;
1048 uint64_t nosched_head:11;
1049 uint64_t reserved_49:1;
1050 uint64_t nosched_one:1;
1051 uint64_t nosched_val:1;
1052 uint64_t reserved_52_63:12;
1053#endif
846 } sindexload1; 1054 } sindexload1;
847 1055
848 /** 1056 /**
849 * Result For POW Index/Pointer Load (get_rmt == 1/get_des_get_tail == 0) 1057 * Result For POW Index/Pointer Load (get_rmt == 1/get_des_get_tail == 0)
850 */ 1058 */
851 struct { 1059 struct {
1060#ifdef __BIG_ENDIAN_BITFIELD
852 uint64_t reserved_39_63:25; 1061 uint64_t reserved_39_63:25;
853 /* 1062 /*
854 * Set when this DRAM list is the current head 1063 * Set when this DRAM list is the current head
@@ -877,6 +1086,13 @@ typedef union {
877 * qosgrp. 1086 * qosgrp.
878 */ 1087 */
879 uint64_t rmt_head:36; 1088 uint64_t rmt_head:36;
1089#else
1090 uint64_t rmt_head:36;
1091 uint64_t rmt_one:1;
1092 uint64_t rmt_val:1;
1093 uint64_t rmt_is_head:1;
1094 uint64_t reserved_39_63:25;
1095#endif
880 } sindexload2; 1096 } sindexload2;
881 1097
882 /** 1098 /**
@@ -884,6 +1100,7 @@ typedef union {
884 * 1/get_des_get_tail == 1) 1100 * 1/get_des_get_tail == 1)
885 */ 1101 */
886 struct { 1102 struct {
1103#ifdef __BIG_ENDIAN_BITFIELD
887 uint64_t reserved_39_63:25; 1104 uint64_t reserved_39_63:25;
888 /* 1105 /*
889 * set when this DRAM list is the current head 1106 * set when this DRAM list is the current head
@@ -912,12 +1129,20 @@ typedef union {
912 * qosgrp. 1129 * qosgrp.
913 */ 1130 */
914 uint64_t rmt_tail:36; 1131 uint64_t rmt_tail:36;
1132#else
1133 uint64_t rmt_tail:36;
1134 uint64_t rmt_one:1;
1135 uint64_t rmt_val:1;
1136 uint64_t rmt_is_head:1;
1137 uint64_t reserved_39_63:25;
1138#endif
915 } sindexload3; 1139 } sindexload3;
916 1140
917 /** 1141 /**
918 * Response to NULL_RD request loads 1142 * Response to NULL_RD request loads
919 */ 1143 */
920 struct { 1144 struct {
1145#ifdef __BIG_ENDIAN_BITFIELD
921 uint64_t unused:62; 1146 uint64_t unused:62;
922 /* of type cvmx_pow_tag_type_t. state is one of the 1147 /* of type cvmx_pow_tag_type_t. state is one of the
923 * following: 1148 * following:
@@ -928,6 +1153,10 @@ typedef union {
928 * - CVMX_POW_TAG_TYPE_NULL_NULL 1153 * - CVMX_POW_TAG_TYPE_NULL_NULL
929 */ 1154 */
930 uint64_t state:2; 1155 uint64_t state:2;
1156#else
1157 uint64_t state:2;
1158 uint64_t unused:62;
1159#endif
931 } s_null_rd; 1160 } s_null_rd;
932 1161
933} cvmx_pow_tag_load_resp_t; 1162} cvmx_pow_tag_load_resp_t;
@@ -962,6 +1191,7 @@ typedef union {
962 uint64_t u64; 1191 uint64_t u64;
963 1192
964 struct { 1193 struct {
1194#ifdef __BIG_ENDIAN_BITFIELD
965 /* Memory region. Should be CVMX_IO_SEG in most cases */ 1195 /* Memory region. Should be CVMX_IO_SEG in most cases */
966 uint64_t mem_reg:2; 1196 uint64_t mem_reg:2;
967 uint64_t reserved_49_61:13; /* Must be zero */ 1197 uint64_t reserved_49_61:13; /* Must be zero */
@@ -971,6 +1201,14 @@ typedef union {
971 uint64_t reserved_36_39:4; /* Must be zero */ 1201 uint64_t reserved_36_39:4; /* Must be zero */
972 /* Address field. addr<2:0> must be zero */ 1202 /* Address field. addr<2:0> must be zero */
973 uint64_t addr:36; 1203 uint64_t addr:36;
1204#else
1205 uint64_t addr:36;
1206 uint64_t reserved_36_39:4;
1207 uint64_t did:8;
1208 uint64_t is_io:1;
1209 uint64_t reserved_49_61:13;
1210 uint64_t mem_reg:2;
1211#endif
974 } stag; 1212 } stag;
975} cvmx_pow_tag_store_addr_t; 1213} cvmx_pow_tag_store_addr_t;
976 1214
@@ -981,6 +1219,7 @@ typedef union {
981 uint64_t u64; 1219 uint64_t u64;
982 1220
983 struct { 1221 struct {
1222#ifdef __BIG_ENDIAN_BITFIELD
984 /* 1223 /*
985 * the (64-bit word) location in scratchpad to write 1224 * the (64-bit word) location in scratchpad to write
986 * to (if len != 0) 1225 * to (if len != 0)
@@ -994,6 +1233,14 @@ typedef union {
994 /* if set, don't return load response until work is available */ 1233 /* if set, don't return load response until work is available */
995 uint64_t wait:1; 1234 uint64_t wait:1;
996 uint64_t unused2:3; 1235 uint64_t unused2:3;
1236#else
1237 uint64_t unused2:3;
1238 uint64_t wait:1;
1239 uint64_t unused:36;
1240 uint64_t did:8;
1241 uint64_t len:8;
1242 uint64_t scraddr:8;
1243#endif
997 } s; 1244 } s;
998 1245
999} cvmx_pow_iobdma_store_t; 1246} cvmx_pow_iobdma_store_t;
diff --git a/arch/mips/include/asm/octeon/cvmx-wqe.h b/arch/mips/include/asm/octeon/cvmx-wqe.h
index aa0d3d0de75c..2d6d0c7127a7 100644
--- a/arch/mips/include/asm/octeon/cvmx-wqe.h
+++ b/arch/mips/include/asm/octeon/cvmx-wqe.h
@@ -57,6 +57,7 @@ typedef union {
57 57
58 /* Use this struct if the hardware determines that the packet is IP */ 58 /* Use this struct if the hardware determines that the packet is IP */
59 struct { 59 struct {
60#ifdef __BIG_ENDIAN_BITFIELD
60 /* HW sets this to the number of buffers used by this packet */ 61 /* HW sets this to the number of buffers used by this packet */
61 uint64_t bufs:8; 62 uint64_t bufs:8;
62 /* HW sets to the number of L2 bytes prior to the IP */ 63 /* HW sets to the number of L2 bytes prior to the IP */
@@ -166,13 +167,45 @@ typedef union {
166 * the slow path */ 167 * the slow path */
167 /* type is cvmx_pip_err_t */ 168 /* type is cvmx_pip_err_t */
168 uint64_t err_code:8; 169 uint64_t err_code:8;
170#else
171 uint64_t err_code:8;
172 uint64_t rcv_error:1;
173 uint64_t not_IP:1;
174 uint64_t is_mcast:1;
175 uint64_t is_bcast:1;
176 uint64_t IP_exc:1;
177 uint64_t is_frag:1;
178 uint64_t L4_error:1;
179 uint64_t software:1;
180 uint64_t is_v6:1;
181 uint64_t dec_ipsec:1;
182 uint64_t tcp_or_udp:1;
183 uint64_t dec_ipcomp:1;
184 uint64_t unassigned2:4;
185 uint64_t unassigned2a:4;
186 uint64_t pr:4;
187 uint64_t vlan_id:12;
188 uint64_t vlan_cfi:1;
189 uint64_t unassigned:1;
190 uint64_t vlan_stacked:1;
191 uint64_t vlan_valid:1;
192 uint64_t ip_offset:8;
193 uint64_t bufs:8;
194#endif
169 } s; 195 } s;
170 196
171 /* use this to get at the 16 vlan bits */ 197 /* use this to get at the 16 vlan bits */
172 struct { 198 struct {
199#ifdef __BIG_ENDIAN_BITFIELD
173 uint64_t unused1:16; 200 uint64_t unused1:16;
174 uint64_t vlan:16; 201 uint64_t vlan:16;
175 uint64_t unused2:32; 202 uint64_t unused2:32;
203#else
204 uint64_t unused2:32;
205 uint64_t vlan:16;
206 uint64_t unused1:16;
207
208#endif
176 } svlan; 209 } svlan;
177 210
178 /* 211 /*
@@ -180,6 +213,7 @@ typedef union {
180 * the packet is ip. 213 * the packet is ip.
181 */ 214 */
182 struct { 215 struct {
216#ifdef __BIG_ENDIAN_BITFIELD
183 /* 217 /*
184 * HW sets this to the number of buffers used by this 218 * HW sets this to the number of buffers used by this
185 * packet. 219 * packet.
@@ -296,6 +330,27 @@ typedef union {
296 */ 330 */
297 /* type is cvmx_pip_err_t (union, so can't use directly */ 331 /* type is cvmx_pip_err_t (union, so can't use directly */
298 uint64_t err_code:8; 332 uint64_t err_code:8;
333#else
334 uint64_t err_code:8;
335 uint64_t rcv_error:1;
336 uint64_t not_IP:1;
337 uint64_t is_mcast:1;
338 uint64_t is_bcast:1;
339 uint64_t is_arp:1;
340 uint64_t is_rarp:1;
341 uint64_t unassigned3:1;
342 uint64_t software:1;
343 uint64_t unassigned2:4;
344 uint64_t unassigned2a:8;
345 uint64_t pr:4;
346 uint64_t vlan_id:12;
347 uint64_t vlan_cfi:1;
348 uint64_t unassigned:1;
349 uint64_t vlan_stacked:1;
350 uint64_t vlan_valid:1;
351 uint64_t unused:8;
352 uint64_t bufs:8;
353#endif
299 } snoip; 354 } snoip;
300 355
301} cvmx_pip_wqe_word2; 356} cvmx_pip_wqe_word2;
@@ -312,6 +367,7 @@ typedef struct {
312 * HW WRITE: the following 64 bits are filled by HW when a packet arrives 367 * HW WRITE: the following 64 bits are filled by HW when a packet arrives
313 */ 368 */
314 369
370#ifdef __BIG_ENDIAN_BITFIELD
315 /** 371 /**
316 * raw chksum result generated by the HW 372 * raw chksum result generated by the HW
317 */ 373 */
@@ -327,12 +383,18 @@ typedef struct {
327 * (Only 36 bits used in Octeon 1) 383 * (Only 36 bits used in Octeon 1)
328 */ 384 */
329 uint64_t next_ptr:40; 385 uint64_t next_ptr:40;
386#else
387 uint64_t next_ptr:40;
388 uint8_t unused;
389 uint16_t hw_chksum;
390#endif
330 391
331 /***************************************************************** 392 /*****************************************************************
332 * WORD 1 393 * WORD 1
333 * HW WRITE: the following 64 bits are filled by HW when a packet arrives 394 * HW WRITE: the following 64 bits are filled by HW when a packet arrives
334 */ 395 */
335 396
397#ifdef __BIG_ENDIAN_BITFIELD
336 /** 398 /**
337 * HW sets to the total number of bytes in the packet 399 * HW sets to the total number of bytes in the packet
338 */ 400 */
@@ -359,6 +421,15 @@ typedef struct {
359 * the synchronization/ordering tag 421 * the synchronization/ordering tag
360 */ 422 */
361 uint64_t tag:32; 423 uint64_t tag:32;
424#else
425 uint64_t tag:32;
426 uint64_t tag_type:2;
427 uint64_t zero_2:1;
428 uint64_t grp:4;
429 uint64_t qos:3;
430 uint64_t ipprt:6;
431 uint64_t len:16;
432#endif
362 433
363 /** 434 /**
364 * WORD 2 HW WRITE: the following 64-bits are filled in by 435 * WORD 2 HW WRITE: the following 64-bits are filled in by
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h
index 33db1c806b01..774bb45834cb 100644
--- a/arch/mips/include/asm/octeon/cvmx.h
+++ b/arch/mips/include/asm/octeon/cvmx.h
@@ -436,14 +436,6 @@ static inline uint64_t cvmx_get_cycle_global(void)
436 436
437/***************************************************************************/ 437/***************************************************************************/
438 438
439static inline void cvmx_reset_octeon(void)
440{
441 union cvmx_ciu_soft_rst ciu_soft_rst;
442 ciu_soft_rst.u64 = 0;
443 ciu_soft_rst.s.soft_rst = 1;
444 cvmx_write_csr(CVMX_CIU_SOFT_RST, ciu_soft_rst.u64);
445}
446
447/* Return the number of cores available in the chip */ 439/* Return the number of cores available in the chip */
448static inline uint32_t cvmx_octeon_num_cores(void) 440static inline uint32_t cvmx_octeon_num_cores(void)
449{ 441{
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h
index 041596570856..de9f74ee5dd0 100644
--- a/arch/mips/include/asm/octeon/octeon.h
+++ b/arch/mips/include/asm/octeon/octeon.h
@@ -335,4 +335,6 @@ void octeon_irq_set_ip4_handler(octeon_irq_ip4_handler_t);
335 335
336extern void octeon_fixup_irqs(void); 336extern void octeon_fixup_irqs(void);
337 337
338extern struct semaphore octeon_bootbus_sem;
339
338#endif /* __ASM_OCTEON_OCTEON_H */ 340#endif /* __ASM_OCTEON_OCTEON_H */
diff --git a/arch/mips/include/asm/octeon/pci-octeon.h b/arch/mips/include/asm/octeon/pci-octeon.h
index 64ba56a02843..1884609741a8 100644
--- a/arch/mips/include/asm/octeon/pci-octeon.h
+++ b/arch/mips/include/asm/octeon/pci-octeon.h
@@ -11,9 +11,6 @@
11 11
12#include <linux/pci.h> 12#include <linux/pci.h>
13 13
14/* Some PCI cards require delays when accessing config space. */
15#define PCI_CONFIG_SPACE_DELAY 10000
16
17/* 14/*
18 * The physical memory base mapped by BAR1. 256MB at the end of the 15 * The physical memory base mapped by BAR1. 256MB at the end of the
19 * first 4GB. 16 * first 4GB.
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 154b70a10483..89dd7fed1a57 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -105,8 +105,6 @@ static inline void clear_user_page(void *addr, unsigned long vaddr,
105 flush_data_cache_page((unsigned long)addr); 105 flush_data_cache_page((unsigned long)addr);
106} 106}
107 107
108extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
109 struct page *to);
110struct vm_area_struct; 108struct vm_area_struct;
111extern void copy_user_highpage(struct page *to, struct page *from, 109extern void copy_user_highpage(struct page *to, struct page *from,
112 unsigned long vaddr, struct vm_area_struct *vma); 110 unsigned long vaddr, struct vm_area_struct *vma);
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 193b4c6b7541..d9692993fc83 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -35,6 +35,8 @@ struct pci_controller {
35 struct resource *io_resource; 35 struct resource *io_resource;
36 unsigned long io_offset; 36 unsigned long io_offset;
37 unsigned long io_map_base; 37 unsigned long io_map_base;
38 struct resource *busn_resource;
39 unsigned long busn_offset;
38 40
39 unsigned int index; 41 unsigned int index;
40 /* For compatibility with current (as of July 2003) pciutils 42 /* For compatibility with current (as of July 2003) pciutils
diff --git a/arch/mips/include/asm/pci/bridge.h b/arch/mips/include/asm/pci/bridge.h
index af2c8a351ca7..8d7a63b52ac7 100644
--- a/arch/mips/include/asm/pci/bridge.h
+++ b/arch/mips/include/asm/pci/bridge.h
@@ -835,6 +835,7 @@ struct bridge_controller {
835 struct pci_controller pc; 835 struct pci_controller pc;
836 struct resource mem; 836 struct resource mem;
837 struct resource io; 837 struct resource io;
838 struct resource busn;
838 bridge_t *base; 839 bridge_t *base;
839 nasid_t nasid; 840 nasid_t nasid;
840 unsigned int widget_id; 841 unsigned int widget_id;
diff --git a/arch/mips/include/asm/pgtable-32.h b/arch/mips/include/asm/pgtable-32.h
index a6be006b6f75..7d56686c0e62 100644
--- a/arch/mips/include/asm/pgtable-32.h
+++ b/arch/mips/include/asm/pgtable-32.h
@@ -105,13 +105,16 @@ static inline void pmd_clear(pmd_t *pmdp)
105 105
106#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) 106#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
107#define pte_page(x) pfn_to_page(pte_pfn(x)) 107#define pte_page(x) pfn_to_page(pte_pfn(x))
108#define pte_pfn(x) ((unsigned long)((x).pte_high >> 6)) 108#define pte_pfn(x) (((unsigned long)((x).pte_high >> _PFN_SHIFT)) | (unsigned long)((x).pte_low << _PAGE_PRESENT_SHIFT))
109static inline pte_t 109static inline pte_t
110pfn_pte(unsigned long pfn, pgprot_t prot) 110pfn_pte(unsigned long pfn, pgprot_t prot)
111{ 111{
112 pte_t pte; 112 pte_t pte;
113 pte.pte_high = (pfn << 6) | (pgprot_val(prot) & 0x3f); 113
114 pte.pte_low = pgprot_val(prot); 114 pte.pte_low = (pfn >> _PAGE_PRESENT_SHIFT) |
115 (pgprot_val(prot) & ~_PFNX_MASK);
116 pte.pte_high = (pfn << _PFN_SHIFT) |
117 (pgprot_val(prot) & ~_PFN_MASK);
115 return pte; 118 return pte;
116} 119}
117 120
@@ -166,9 +169,9 @@ pfn_pte(unsigned long pfn, pgprot_t prot)
166#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) 169#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
167 170
168/* Swap entries must have VALID and GLOBAL bits cleared. */ 171/* Swap entries must have VALID and GLOBAL bits cleared. */
169#define __swp_type(x) (((x).val >> 2) & 0x1f) 172#define __swp_type(x) (((x).val >> 4) & 0x1f)
170#define __swp_offset(x) ((x).val >> 7) 173#define __swp_offset(x) ((x).val >> 9)
171#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 7) }) 174#define __swp_entry(type,offset) ((swp_entry_t) { ((type) << 4) | ((offset) << 9) })
172#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high }) 175#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_high })
173#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val }) 176#define __swp_entry_to_pte(x) ((pte_t) { 0, (x).val })
174 177
diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h
index 1659bb91ae21..cf661a2fb141 100644
--- a/arch/mips/include/asm/pgtable-64.h
+++ b/arch/mips/include/asm/pgtable-64.h
@@ -279,14 +279,14 @@ extern void pgd_init(unsigned long page);
279extern void pmd_init(unsigned long page, unsigned long pagetable); 279extern void pmd_init(unsigned long page, unsigned long pagetable);
280 280
281/* 281/*
282 * Non-present pages: high 24 bits are offset, next 8 bits type, 282 * Non-present pages: high 40 bits are offset, next 8 bits type,
283 * low 32 bits zero. 283 * low 16 bits zero.
284 */ 284 */
285static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) 285static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
286{ pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; } 286{ pte_t pte; pte_val(pte) = (type << 16) | (offset << 24); return pte; }
287 287
288#define __swp_type(x) (((x).val >> 32) & 0xff) 288#define __swp_type(x) (((x).val >> 16) & 0xff)
289#define __swp_offset(x) ((x).val >> 40) 289#define __swp_offset(x) ((x).val >> 24)
290#define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) }) 290#define __swp_entry(type, offset) ((swp_entry_t) { pte_val(mk_swap_pte((type), (offset))) })
291#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 291#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
292#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 292#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index 91747c282bb3..18ae5ddef118 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -37,7 +37,11 @@
37/* 37/*
38 * The following bits are implemented by the TLB hardware 38 * The following bits are implemented by the TLB hardware
39 */ 39 */
40#define _PAGE_GLOBAL_SHIFT 0 40#define _PAGE_NO_EXEC_SHIFT 0
41#define _PAGE_NO_EXEC (1 << _PAGE_NO_EXEC_SHIFT)
42#define _PAGE_NO_READ_SHIFT (_PAGE_NO_EXEC_SHIFT + 1)
43#define _PAGE_NO_READ (1 << _PAGE_NO_READ_SHIFT)
44#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1)
41#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) 45#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
42#define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1) 46#define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1)
43#define _PAGE_VALID (1 << _PAGE_VALID_SHIFT) 47#define _PAGE_VALID (1 << _PAGE_VALID_SHIFT)
@@ -49,7 +53,7 @@
49/* 53/*
50 * The following bits are implemented in software 54 * The following bits are implemented in software
51 */ 55 */
52#define _PAGE_PRESENT_SHIFT (_CACHE_SHIFT + 3) 56#define _PAGE_PRESENT_SHIFT (24)
53#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 57#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
54#define _PAGE_READ_SHIFT (_PAGE_PRESENT_SHIFT + 1) 58#define _PAGE_READ_SHIFT (_PAGE_PRESENT_SHIFT + 1)
55#define _PAGE_READ (1 << _PAGE_READ_SHIFT) 59#define _PAGE_READ (1 << _PAGE_READ_SHIFT)
@@ -62,6 +66,11 @@
62 66
63#define _PFN_SHIFT (PAGE_SHIFT - 12 + _CACHE_SHIFT + 3) 67#define _PFN_SHIFT (PAGE_SHIFT - 12 + _CACHE_SHIFT + 3)
64 68
69/*
70 * Bits for extended EntryLo0/EntryLo1 registers
71 */
72#define _PFNX_MASK 0xffffff
73
65#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) 74#elif defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
66 75
67/* 76/*
@@ -95,11 +104,7 @@
95 104
96#else 105#else
97/* 106/*
98 * When using the RI/XI bit support, we have 13 bits of flags below 107 * Below are the "Normal" R4K cases
99 * the physical address. The RI/XI bits are placed such that a SRL 5
100 * can strip off the software bits, then a ROTR 2 can move the RI/XI
101 * into bits [63:62]. This also limits physical address to 56 bits,
102 * which is more than we need right now.
103 */ 108 */
104 109
105/* 110/*
@@ -107,38 +112,59 @@
107 */ 112 */
108#define _PAGE_PRESENT_SHIFT 0 113#define _PAGE_PRESENT_SHIFT 0
109#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 114#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
110#define _PAGE_READ_SHIFT (cpu_has_rixi ? _PAGE_PRESENT_SHIFT : _PAGE_PRESENT_SHIFT + 1) 115/* R2 or later cores check for RI/XI support to determine _PAGE_READ */
111#define _PAGE_READ ({BUG_ON(cpu_has_rixi); 1 << _PAGE_READ_SHIFT; }) 116#ifdef CONFIG_CPU_MIPSR2
117#define _PAGE_WRITE_SHIFT (_PAGE_PRESENT_SHIFT + 1)
118#define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT)
119#else
120#define _PAGE_READ_SHIFT (_PAGE_PRESENT_SHIFT + 1)
121#define _PAGE_READ (1 << _PAGE_READ_SHIFT)
112#define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1) 122#define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1)
113#define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT) 123#define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT)
124#endif
114#define _PAGE_ACCESSED_SHIFT (_PAGE_WRITE_SHIFT + 1) 125#define _PAGE_ACCESSED_SHIFT (_PAGE_WRITE_SHIFT + 1)
115#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT) 126#define _PAGE_ACCESSED (1 << _PAGE_ACCESSED_SHIFT)
116#define _PAGE_MODIFIED_SHIFT (_PAGE_ACCESSED_SHIFT + 1) 127#define _PAGE_MODIFIED_SHIFT (_PAGE_ACCESSED_SHIFT + 1)
117#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT) 128#define _PAGE_MODIFIED (1 << _PAGE_MODIFIED_SHIFT)
118 129
119#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT 130#if defined(CONFIG_64BIT) && defined(CONFIG_MIPS_HUGE_TLB_SUPPORT)
120/* huge tlb page */ 131/* Huge TLB page */
121#define _PAGE_HUGE_SHIFT (_PAGE_MODIFIED_SHIFT + 1) 132#define _PAGE_HUGE_SHIFT (_PAGE_MODIFIED_SHIFT + 1)
122#define _PAGE_HUGE (1 << _PAGE_HUGE_SHIFT) 133#define _PAGE_HUGE (1 << _PAGE_HUGE_SHIFT)
123#define _PAGE_SPLITTING_SHIFT (_PAGE_HUGE_SHIFT + 1) 134#define _PAGE_SPLITTING_SHIFT (_PAGE_HUGE_SHIFT + 1)
124#define _PAGE_SPLITTING (1 << _PAGE_SPLITTING_SHIFT) 135#define _PAGE_SPLITTING (1 << _PAGE_SPLITTING_SHIFT)
136
137/* Only R2 or newer cores have the XI bit */
138#ifdef CONFIG_CPU_MIPSR2
139#define _PAGE_NO_EXEC_SHIFT (_PAGE_SPLITTING_SHIFT + 1)
125#else 140#else
126#define _PAGE_HUGE_SHIFT (_PAGE_MODIFIED_SHIFT) 141#define _PAGE_GLOBAL_SHIFT (_PAGE_SPLITTING_SHIFT + 1)
127#define _PAGE_HUGE ({BUG(); 1; }) /* Dummy value */ 142#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
128#define _PAGE_SPLITTING_SHIFT (_PAGE_HUGE_SHIFT) 143#endif /* CONFIG_CPU_MIPSR2 */
129#define _PAGE_SPLITTING ({BUG(); 1; }) /* Dummy value */
130#endif
131 144
132/* Page cannot be executed */ 145#endif /* CONFIG_64BIT && CONFIG_MIPS_HUGE_TLB_SUPPORT */
133#define _PAGE_NO_EXEC_SHIFT (cpu_has_rixi ? _PAGE_SPLITTING_SHIFT + 1 : _PAGE_SPLITTING_SHIFT)
134#define _PAGE_NO_EXEC ({BUG_ON(!cpu_has_rixi); 1 << _PAGE_NO_EXEC_SHIFT; })
135 146
136/* Page cannot be read */ 147#ifdef CONFIG_CPU_MIPSR2
137#define _PAGE_NO_READ_SHIFT (cpu_has_rixi ? _PAGE_NO_EXEC_SHIFT + 1 : _PAGE_NO_EXEC_SHIFT) 148/* XI - page cannot be executed */
138#define _PAGE_NO_READ ({BUG_ON(!cpu_has_rixi); 1 << _PAGE_NO_READ_SHIFT; }) 149#ifndef _PAGE_NO_EXEC_SHIFT
150#define _PAGE_NO_EXEC_SHIFT (_PAGE_MODIFIED_SHIFT + 1)
151#endif
152#define _PAGE_NO_EXEC (cpu_has_rixi ? (1 << _PAGE_NO_EXEC_SHIFT) : 0)
153
154/* RI - page cannot be read */
155#define _PAGE_READ_SHIFT (_PAGE_NO_EXEC_SHIFT + 1)
156#define _PAGE_READ (cpu_has_rixi ? 0 : (1 << _PAGE_READ_SHIFT))
157#define _PAGE_NO_READ_SHIFT _PAGE_READ_SHIFT
158#define _PAGE_NO_READ (cpu_has_rixi ? (1 << _PAGE_READ_SHIFT) : 0)
139 159
140#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1) 160#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1)
141#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) 161#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
162
163#else /* !CONFIG_CPU_MIPSR2 */
164#define _PAGE_GLOBAL_SHIFT (_PAGE_MODIFIED_SHIFT + 1)
165#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
166#endif /* CONFIG_CPU_MIPSR2 */
167
142#define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1) 168#define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1)
143#define _PAGE_VALID (1 << _PAGE_VALID_SHIFT) 169#define _PAGE_VALID (1 << _PAGE_VALID_SHIFT)
144#define _PAGE_DIRTY_SHIFT (_PAGE_VALID_SHIFT + 1) 170#define _PAGE_DIRTY_SHIFT (_PAGE_VALID_SHIFT + 1)
@@ -150,18 +176,26 @@
150 176
151#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT && defined(CONFIG_CPU_MIPS32) */ 177#endif /* defined(CONFIG_PHYS_ADDR_T_64BIT && defined(CONFIG_CPU_MIPS32) */
152 178
179#ifndef _PAGE_NO_EXEC
180#define _PAGE_NO_EXEC 0
181#endif
182#ifndef _PAGE_NO_READ
183#define _PAGE_NO_READ 0
184#endif
185
153#define _PAGE_SILENT_READ _PAGE_VALID 186#define _PAGE_SILENT_READ _PAGE_VALID
154#define _PAGE_SILENT_WRITE _PAGE_DIRTY 187#define _PAGE_SILENT_WRITE _PAGE_DIRTY
155 188
156#define _PFN_MASK (~((1 << (_PFN_SHIFT)) - 1)) 189#define _PFN_MASK (~((1 << (_PFN_SHIFT)) - 1))
157 190
158#ifndef _PAGE_NO_READ 191/*
159#define _PAGE_NO_READ ({BUG(); 0; }) 192 * The final layouts of the PTE bits are:
160#define _PAGE_NO_READ_SHIFT ({BUG(); 0; }) 193 *
161#endif 194 * 64-bit, R1 or earlier: CCC D V G [S H] M A W R P
162#ifndef _PAGE_NO_EXEC 195 * 32-bit, R1 or earler: CCC D V G M A W R P
163#define _PAGE_NO_EXEC ({BUG(); 0; }) 196 * 64-bit, R2 or later: CCC D V G RI/R XI [S H] M A W P
164#endif 197 * 32-bit, R2 or later: CCC D V G RI/R XI M A W P
198 */
165 199
166 200
167#ifndef __ASSEMBLY__ 201#ifndef __ASSEMBLY__
@@ -171,6 +205,7 @@
171 */ 205 */
172static inline uint64_t pte_to_entrylo(unsigned long pte_val) 206static inline uint64_t pte_to_entrylo(unsigned long pte_val)
173{ 207{
208#ifdef CONFIG_CPU_MIPSR2
174 if (cpu_has_rixi) { 209 if (cpu_has_rixi) {
175 int sa; 210 int sa;
176#ifdef CONFIG_32BIT 211#ifdef CONFIG_32BIT
@@ -186,6 +221,7 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
186 return (pte_val >> _PAGE_GLOBAL_SHIFT) | 221 return (pte_val >> _PAGE_GLOBAL_SHIFT) |
187 ((pte_val & (_PAGE_NO_EXEC | _PAGE_NO_READ)) << sa); 222 ((pte_val & (_PAGE_NO_EXEC | _PAGE_NO_READ)) << sa);
188 } 223 }
224#endif
189 225
190 return pte_val >> _PAGE_GLOBAL_SHIFT; 226 return pte_val >> _PAGE_GLOBAL_SHIFT;
191} 227}
@@ -245,7 +281,7 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
245#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) 281#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
246#endif 282#endif
247 283
248#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ)) 284#define __READABLE (_PAGE_SILENT_READ | _PAGE_READ | _PAGE_ACCESSED)
249#define __WRITEABLE (_PAGE_SILENT_WRITE | _PAGE_WRITE | _PAGE_MODIFIED) 285#define __WRITEABLE (_PAGE_SILENT_WRITE | _PAGE_WRITE | _PAGE_MODIFIED)
250 286
251#define _PAGE_CHG_MASK (_PAGE_ACCESSED | _PAGE_MODIFIED | \ 287#define _PAGE_CHG_MASK (_PAGE_ACCESSED | _PAGE_MODIFIED | \
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index bef782c4a44b..819af9d057a8 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -24,17 +24,17 @@ struct mm_struct;
24struct vm_area_struct; 24struct vm_area_struct;
25 25
26#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) 26#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
27#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (cpu_has_rixi ? 0 : _PAGE_READ) | \ 27#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | _PAGE_READ | \
28 _page_cachable_default) 28 _page_cachable_default)
29#define PAGE_COPY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \ 29#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_NO_EXEC | \
30 (cpu_has_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default) 30 _page_cachable_default)
31#define PAGE_READONLY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \ 31#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | \
32 _page_cachable_default) 32 _page_cachable_default)
33#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ 33#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
34 _PAGE_GLOBAL | _page_cachable_default) 34 _PAGE_GLOBAL | _page_cachable_default)
35#define PAGE_KERNEL_NC __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ 35#define PAGE_KERNEL_NC __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
36 _PAGE_GLOBAL | _CACHE_CACHABLE_NONCOHERENT) 36 _PAGE_GLOBAL | _CACHE_CACHABLE_NONCOHERENT)
37#define PAGE_USERIO __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \ 37#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
38 _page_cachable_default) 38 _page_cachable_default)
39#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ 39#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
40 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) 40 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
@@ -127,13 +127,9 @@ do { \
127 } \ 127 } \
128} while(0) 128} while(0)
129 129
130
131extern void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep,
132 pte_t pteval);
133
134#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) 130#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
135 131
136#define pte_none(pte) (!(((pte).pte_low | (pte).pte_high) & ~_PAGE_GLOBAL)) 132#define pte_none(pte) (!(((pte).pte_high) & ~_PAGE_GLOBAL))
137#define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT) 133#define pte_present(pte) ((pte).pte_low & _PAGE_PRESENT)
138 134
139static inline void set_pte(pte_t *ptep, pte_t pte) 135static inline void set_pte(pte_t *ptep, pte_t pte)
@@ -142,18 +138,17 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
142 smp_wmb(); 138 smp_wmb();
143 ptep->pte_low = pte.pte_low; 139 ptep->pte_low = pte.pte_low;
144 140
145 if (pte.pte_low & _PAGE_GLOBAL) { 141 if (pte.pte_high & _PAGE_GLOBAL) {
146 pte_t *buddy = ptep_buddy(ptep); 142 pte_t *buddy = ptep_buddy(ptep);
147 /* 143 /*
148 * Make sure the buddy is global too (if it's !none, 144 * Make sure the buddy is global too (if it's !none,
149 * it better already be global) 145 * it better already be global)
150 */ 146 */
151 if (pte_none(*buddy)) { 147 if (pte_none(*buddy))
152 buddy->pte_low |= _PAGE_GLOBAL;
153 buddy->pte_high |= _PAGE_GLOBAL; 148 buddy->pte_high |= _PAGE_GLOBAL;
154 }
155 } 149 }
156} 150}
151#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
157 152
158static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 153static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
159{ 154{
@@ -161,8 +156,8 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt
161 156
162 htw_stop(); 157 htw_stop();
163 /* Preserve global status for the pair */ 158 /* Preserve global status for the pair */
164 if (ptep_buddy(ptep)->pte_low & _PAGE_GLOBAL) 159 if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL)
165 null.pte_low = null.pte_high = _PAGE_GLOBAL; 160 null.pte_high = _PAGE_GLOBAL;
166 161
167 set_pte_at(mm, addr, ptep, null); 162 set_pte_at(mm, addr, ptep, null);
168 htw_start(); 163 htw_start();
@@ -192,6 +187,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval)
192 } 187 }
193#endif 188#endif
194} 189}
190#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
195 191
196static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 192static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
197{ 193{
@@ -242,21 +238,21 @@ static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; }
242 238
243static inline pte_t pte_wrprotect(pte_t pte) 239static inline pte_t pte_wrprotect(pte_t pte)
244{ 240{
245 pte.pte_low &= ~(_PAGE_WRITE | _PAGE_SILENT_WRITE); 241 pte.pte_low &= ~_PAGE_WRITE;
246 pte.pte_high &= ~_PAGE_SILENT_WRITE; 242 pte.pte_high &= ~_PAGE_SILENT_WRITE;
247 return pte; 243 return pte;
248} 244}
249 245
250static inline pte_t pte_mkclean(pte_t pte) 246static inline pte_t pte_mkclean(pte_t pte)
251{ 247{
252 pte.pte_low &= ~(_PAGE_MODIFIED | _PAGE_SILENT_WRITE); 248 pte.pte_low &= ~_PAGE_MODIFIED;
253 pte.pte_high &= ~_PAGE_SILENT_WRITE; 249 pte.pte_high &= ~_PAGE_SILENT_WRITE;
254 return pte; 250 return pte;
255} 251}
256 252
257static inline pte_t pte_mkold(pte_t pte) 253static inline pte_t pte_mkold(pte_t pte)
258{ 254{
259 pte.pte_low &= ~(_PAGE_ACCESSED | _PAGE_SILENT_READ); 255 pte.pte_low &= ~_PAGE_ACCESSED;
260 pte.pte_high &= ~_PAGE_SILENT_READ; 256 pte.pte_high &= ~_PAGE_SILENT_READ;
261 return pte; 257 return pte;
262} 258}
@@ -264,30 +260,24 @@ static inline pte_t pte_mkold(pte_t pte)
264static inline pte_t pte_mkwrite(pte_t pte) 260static inline pte_t pte_mkwrite(pte_t pte)
265{ 261{
266 pte.pte_low |= _PAGE_WRITE; 262 pte.pte_low |= _PAGE_WRITE;
267 if (pte.pte_low & _PAGE_MODIFIED) { 263 if (pte.pte_low & _PAGE_MODIFIED)
268 pte.pte_low |= _PAGE_SILENT_WRITE;
269 pte.pte_high |= _PAGE_SILENT_WRITE; 264 pte.pte_high |= _PAGE_SILENT_WRITE;
270 }
271 return pte; 265 return pte;
272} 266}
273 267
274static inline pte_t pte_mkdirty(pte_t pte) 268static inline pte_t pte_mkdirty(pte_t pte)
275{ 269{
276 pte.pte_low |= _PAGE_MODIFIED; 270 pte.pte_low |= _PAGE_MODIFIED;
277 if (pte.pte_low & _PAGE_WRITE) { 271 if (pte.pte_low & _PAGE_WRITE)
278 pte.pte_low |= _PAGE_SILENT_WRITE;
279 pte.pte_high |= _PAGE_SILENT_WRITE; 272 pte.pte_high |= _PAGE_SILENT_WRITE;
280 }
281 return pte; 273 return pte;
282} 274}
283 275
284static inline pte_t pte_mkyoung(pte_t pte) 276static inline pte_t pte_mkyoung(pte_t pte)
285{ 277{
286 pte.pte_low |= _PAGE_ACCESSED; 278 pte.pte_low |= _PAGE_ACCESSED;
287 if (pte.pte_low & _PAGE_READ) { 279 if (pte.pte_low & _PAGE_READ)
288 pte.pte_low |= _PAGE_SILENT_READ;
289 pte.pte_high |= _PAGE_SILENT_READ; 280 pte.pte_high |= _PAGE_SILENT_READ;
290 }
291 return pte; 281 return pte;
292} 282}
293#else 283#else
@@ -332,13 +322,13 @@ static inline pte_t pte_mkdirty(pte_t pte)
332static inline pte_t pte_mkyoung(pte_t pte) 322static inline pte_t pte_mkyoung(pte_t pte)
333{ 323{
334 pte_val(pte) |= _PAGE_ACCESSED; 324 pte_val(pte) |= _PAGE_ACCESSED;
335 if (cpu_has_rixi) { 325#ifdef CONFIG_CPU_MIPSR2
336 if (!(pte_val(pte) & _PAGE_NO_READ)) 326 if (!(pte_val(pte) & _PAGE_NO_READ))
337 pte_val(pte) |= _PAGE_SILENT_READ; 327 pte_val(pte) |= _PAGE_SILENT_READ;
338 } else { 328 else
339 if (pte_val(pte) & _PAGE_READ) 329#endif
340 pte_val(pte) |= _PAGE_SILENT_READ; 330 if (pte_val(pte) & _PAGE_READ)
341 } 331 pte_val(pte) |= _PAGE_SILENT_READ;
342 return pte; 332 return pte;
343} 333}
344 334
@@ -391,10 +381,10 @@ static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
391#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) 381#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32)
392static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 382static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
393{ 383{
394 pte.pte_low &= _PAGE_CHG_MASK; 384 pte.pte_low &= (_PAGE_MODIFIED | _PAGE_ACCESSED | _PFNX_MASK);
395 pte.pte_high &= (_PFN_MASK | _CACHE_MASK); 385 pte.pte_high &= (_PFN_MASK | _CACHE_MASK);
396 pte.pte_low |= pgprot_val(newprot); 386 pte.pte_low |= pgprot_val(newprot) & ~_PFNX_MASK;
397 pte.pte_high |= pgprot_val(newprot) & ~(_PFN_MASK | _CACHE_MASK); 387 pte.pte_high |= pgprot_val(newprot) & ~_PFN_MASK;
398 return pte; 388 return pte;
399} 389}
400#else 390#else
@@ -407,12 +397,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
407 397
408extern void __update_tlb(struct vm_area_struct *vma, unsigned long address, 398extern void __update_tlb(struct vm_area_struct *vma, unsigned long address,
409 pte_t pte); 399 pte_t pte);
400extern void __update_cache(struct vm_area_struct *vma, unsigned long address,
401 pte_t pte);
410 402
411static inline void update_mmu_cache(struct vm_area_struct *vma, 403static inline void update_mmu_cache(struct vm_area_struct *vma,
412 unsigned long address, pte_t *ptep) 404 unsigned long address, pte_t *ptep)
413{ 405{
414 pte_t pte = *ptep; 406 pte_t pte = *ptep;
415 __update_tlb(vma, address, pte); 407 __update_tlb(vma, address, pte);
408 __update_cache(vma, address, pte);
416} 409}
417 410
418static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, 411static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
@@ -534,13 +527,13 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd)
534{ 527{
535 pmd_val(pmd) |= _PAGE_ACCESSED; 528 pmd_val(pmd) |= _PAGE_ACCESSED;
536 529
537 if (cpu_has_rixi) { 530#ifdef CONFIG_CPU_MIPSR2
538 if (!(pmd_val(pmd) & _PAGE_NO_READ)) 531 if (!(pmd_val(pmd) & _PAGE_NO_READ))
539 pmd_val(pmd) |= _PAGE_SILENT_READ; 532 pmd_val(pmd) |= _PAGE_SILENT_READ;
540 } else { 533 else
541 if (pmd_val(pmd) & _PAGE_READ) 534#endif
542 pmd_val(pmd) |= _PAGE_SILENT_READ; 535 if (pmd_val(pmd) & _PAGE_READ)
543 } 536 pmd_val(pmd) |= _PAGE_SILENT_READ;
544 537
545 return pmd; 538 return pmd;
546} 539}
diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
index 1b22d2da88a1..38902bf97adc 100644
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -12,6 +12,8 @@
12#ifndef _ASM_R4KCACHE_H 12#ifndef _ASM_R4KCACHE_H
13#define _ASM_R4KCACHE_H 13#define _ASM_R4KCACHE_H
14 14
15#include <linux/stringify.h>
16
15#include <asm/asm.h> 17#include <asm/asm.h>
16#include <asm/cacheops.h> 18#include <asm/cacheops.h>
17#include <asm/compiler.h> 19#include <asm/compiler.h>
@@ -344,7 +346,7 @@ static inline void invalidate_tcache_page(unsigned long addr)
344 " cache %1, 0x0a0(%0); cache %1, 0x0b0(%0)\n" \ 346 " cache %1, 0x0a0(%0); cache %1, 0x0b0(%0)\n" \
345 " cache %1, 0x0c0(%0); cache %1, 0x0d0(%0)\n" \ 347 " cache %1, 0x0c0(%0); cache %1, 0x0d0(%0)\n" \
346 " cache %1, 0x0e0(%0); cache %1, 0x0f0(%0)\n" \ 348 " cache %1, 0x0e0(%0); cache %1, 0x0f0(%0)\n" \
347 " addiu $1, $0, 0x100 \n" \ 349 " "__stringify(LONG_ADDIU)" $1, %0, 0x100 \n" \
348 " cache %1, 0x000($1); cache %1, 0x010($1)\n" \ 350 " cache %1, 0x000($1); cache %1, 0x010($1)\n" \
349 " cache %1, 0x020($1); cache %1, 0x030($1)\n" \ 351 " cache %1, 0x020($1); cache %1, 0x030($1)\n" \
350 " cache %1, 0x040($1); cache %1, 0x050($1)\n" \ 352 " cache %1, 0x040($1); cache %1, 0x050($1)\n" \
@@ -368,17 +370,17 @@ static inline void invalidate_tcache_page(unsigned long addr)
368 " cache %1, 0x040(%0); cache %1, 0x060(%0)\n" \ 370 " cache %1, 0x040(%0); cache %1, 0x060(%0)\n" \
369 " cache %1, 0x080(%0); cache %1, 0x0a0(%0)\n" \ 371 " cache %1, 0x080(%0); cache %1, 0x0a0(%0)\n" \
370 " cache %1, 0x0c0(%0); cache %1, 0x0e0(%0)\n" \ 372 " cache %1, 0x0c0(%0); cache %1, 0x0e0(%0)\n" \
371 " addiu $1, %0, 0x100\n" \ 373 " "__stringify(LONG_ADDIU)" $1, %0, 0x100 \n" \
372 " cache %1, 0x000($1); cache %1, 0x020($1)\n" \ 374 " cache %1, 0x000($1); cache %1, 0x020($1)\n" \
373 " cache %1, 0x040($1); cache %1, 0x060($1)\n" \ 375 " cache %1, 0x040($1); cache %1, 0x060($1)\n" \
374 " cache %1, 0x080($1); cache %1, 0x0a0($1)\n" \ 376 " cache %1, 0x080($1); cache %1, 0x0a0($1)\n" \
375 " cache %1, 0x0c0($1); cache %1, 0x0e0($1)\n" \ 377 " cache %1, 0x0c0($1); cache %1, 0x0e0($1)\n" \
376 " addiu $1, $1, 0x100\n" \ 378 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
377 " cache %1, 0x000($1); cache %1, 0x020($1)\n" \ 379 " cache %1, 0x000($1); cache %1, 0x020($1)\n" \
378 " cache %1, 0x040($1); cache %1, 0x060($1)\n" \ 380 " cache %1, 0x040($1); cache %1, 0x060($1)\n" \
379 " cache %1, 0x080($1); cache %1, 0x0a0($1)\n" \ 381 " cache %1, 0x080($1); cache %1, 0x0a0($1)\n" \
380 " cache %1, 0x0c0($1); cache %1, 0x0e0($1)\n" \ 382 " cache %1, 0x0c0($1); cache %1, 0x0e0($1)\n" \
381 " addiu $1, $1, 0x100\n" \ 383 " "__stringify(LONG_ADDIU)" $1, $1, 0x100\n" \
382 " cache %1, 0x000($1); cache %1, 0x020($1)\n" \ 384 " cache %1, 0x000($1); cache %1, 0x020($1)\n" \
383 " cache %1, 0x040($1); cache %1, 0x060($1)\n" \ 385 " cache %1, 0x040($1); cache %1, 0x060($1)\n" \
384 " cache %1, 0x080($1); cache %1, 0x0a0($1)\n" \ 386 " cache %1, 0x080($1); cache %1, 0x0a0($1)\n" \
@@ -396,25 +398,25 @@ static inline void invalidate_tcache_page(unsigned long addr)
396 " .set noat\n" \ 398 " .set noat\n" \
397 " cache %1, 0x000(%0); cache %1, 0x040(%0)\n" \ 399 " cache %1, 0x000(%0); cache %1, 0x040(%0)\n" \
398 " cache %1, 0x080(%0); cache %1, 0x0c0(%0)\n" \ 400 " cache %1, 0x080(%0); cache %1, 0x0c0(%0)\n" \
399 " addiu $1, %0, 0x100\n" \ 401 " "__stringify(LONG_ADDIU)" $1, %0, 0x100 \n" \
400 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 402 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
401 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 403 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
402 " addiu $1, %0, 0x100\n" \ 404 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
403 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 405 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
404 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 406 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
405 " addiu $1, %0, 0x100\n" \ 407 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
406 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 408 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
407 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 409 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
408 " addiu $1, %0, 0x100\n" \ 410 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
409 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 411 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
410 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 412 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
411 " addiu $1, %0, 0x100\n" \ 413 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
412 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 414 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
413 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 415 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
414 " addiu $1, %0, 0x100\n" \ 416 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
415 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 417 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
416 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 418 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
417 " addiu $1, %0, 0x100\n" \ 419 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
418 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \ 420 " cache %1, 0x000($1); cache %1, 0x040($1)\n" \
419 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \ 421 " cache %1, 0x080($1); cache %1, 0x0c0($1)\n" \
420 " .set pop\n" \ 422 " .set pop\n" \
@@ -429,39 +431,38 @@ static inline void invalidate_tcache_page(unsigned long addr)
429 " .set mips64r6\n" \ 431 " .set mips64r6\n" \
430 " .set noat\n" \ 432 " .set noat\n" \
431 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 433 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \
432 " addiu $1, %0, 0x100\n" \ 434 " "__stringify(LONG_ADDIU)" $1, %0, 0x100 \n" \
433 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 435 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
434 " addiu $1, %0, 0x100\n" \ 436 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
435 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 437 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
436 " addiu $1, %0, 0x100\n" \ 438 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
437 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 439 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
438 " addiu $1, %0, 0x100\n" \ 440 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
439 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 441 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
440 " addiu $1, %0, 0x100\n" \ 442 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
441 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 443 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
442 " addiu $1, %0, 0x100\n" \ 444 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
443 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 445 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
444 " addiu $1, %0, 0x100\n" \ 446 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
445 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 447 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
446 " addiu $1, %0, 0x100\n" \ 448 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
447 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 449 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
448 " addiu $1, %0, 0x100\n" \ 450 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
449 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 451 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
450 " addiu $1, %0, 0x100\n" \ 452 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
451 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 453 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
452 " addiu $1, %0, 0x100\n" \ 454 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
453 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 455 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
454 " addiu $1, %0, 0x100\n" \ 456 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
455 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 457 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
456 " addiu $1, %0, 0x100\n" \ 458 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
457 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 459 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
458 " addiu $1, %0, 0x100\n" \ 460 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
459 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 461 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
460 " addiu $1, %0, 0x100\n" \ 462 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
461 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 463 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
462 " addiu $1, %0, 0x100\n" \ 464 " "__stringify(LONG_ADDIU)" $1, $1, 0x100 \n" \
463 " cache %1, 0x000(%0); cache %1, 0x080(%0)\n" \ 465 " cache %1, 0x000($1); cache %1, 0x080($1)\n" \
464 " addiu $1, %0, 0x100\n" \
465 " .set pop\n" \ 466 " .set pop\n" \
466 : \ 467 : \
467 : "r" (base), \ 468 : "r" (base), \
diff --git a/arch/mips/include/asm/sgi/sgi.h b/arch/mips/include/asm/sgi/sgi.h
index 645cea7c0f8e..b61557151e3f 100644
--- a/arch/mips/include/asm/sgi/sgi.h
+++ b/arch/mips/include/asm/sgi/sgi.h
@@ -22,14 +22,15 @@ enum sgi_mach {
22 ip17, /* R4K UP */ 22 ip17, /* R4K UP */
23 ip19, /* R4K MP */ 23 ip19, /* R4K MP */
24 ip20, /* R4K UP, Indigo */ 24 ip20, /* R4K UP, Indigo */
25 ip21, /* TFP MP */ 25 ip21, /* R8k/TFP MP */
26 ip22, /* R4x00 UP, Indigo2 */ 26 ip22, /* R4x00 UP, Indy, Indigo2 */
27 ip25, /* R10k MP */ 27 ip25, /* R10k MP */
28 ip26, /* TFP UP, Indigo2 */ 28 ip26, /* R8k/TFP UP, Indigo2 */
29 ip27, /* R10k MP, R12k MP, Origin */ 29 ip27, /* R10k MP, R12k MP, R14k MP, Origin 200/2k, Onyx2 */
30 ip28, /* R10k UP, Indigo2 */ 30 ip28, /* R10k UP, Indigo2 Impact R10k */
31 ip30, /* Octane */ 31 ip30, /* R10k MP, R12k MP, R14k MP, Octane */
32 ip32, /* O2 */ 32 ip32, /* R5k UP, RM5200 UP, RM7k UP, R10k UP, R12k UP, O2 */
33 ip35, /* R14k MP, R16k MP, Origin 300/3k, Onyx3, Fuel, Tezro */
33}; 34};
34 35
35extern enum sgi_mach sgimach; 36extern enum sgi_mach sgimach;
diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
index b4548690ade9..1fca2e0793dc 100644
--- a/arch/mips/include/asm/spinlock.h
+++ b/arch/mips/include/asm/spinlock.h
@@ -263,7 +263,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
263 if (R10000_LLSC_WAR) { 263 if (R10000_LLSC_WAR) {
264 __asm__ __volatile__( 264 __asm__ __volatile__(
265 "1: ll %1, %2 # arch_read_unlock \n" 265 "1: ll %1, %2 # arch_read_unlock \n"
266 " addiu %1, 1 \n" 266 " addiu %1, -1 \n"
267 " sc %1, %0 \n" 267 " sc %1, %0 \n"
268 " beqzl %1, 1b \n" 268 " beqzl %1, 1b \n"
269 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp) 269 : "=" GCC_OFF_SMALL_ASM() (rw->lock), "=&r" (tmp)
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 8408a30c47f3..9c0014e87c17 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -53,10 +53,10 @@ struct thread_info {
53#define init_stack (init_thread_union.stack) 53#define init_stack (init_thread_union.stack)
54 54
55/* How to get the thread information struct from C. */ 55/* How to get the thread information struct from C. */
56register struct thread_info *__current_thread_info __asm__("$28");
57
56static inline struct thread_info *current_thread_info(void) 58static inline struct thread_info *current_thread_info(void)
57{ 59{
58 register struct thread_info *__current_thread_info __asm__("$28");
59
60 return __current_thread_info; 60 return __current_thread_info;
61} 61}
62 62