diff options
author | Tony Luck <tony.luck@intel.com> | 2005-10-31 13:51:57 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-10-31 13:51:57 -0500 |
commit | c7fb577e2a6cb04732541f2dc402bd46747f7558 (patch) | |
tree | df3b1a1922ed13bfbcc45d08650c38beeb1a7bd1 /include | |
parent | 9cec58dc138d6fcad9f447a19c8ff69f6540e667 (diff) | |
parent | 581c1b14394aee60aff46ea67d05483261ed6527 (diff) |
manual update from upstream:
Applied Al's change 06a544971fad0992fe8b92c5647538d573089dd4
to new location of swiotlb.c
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'include')
649 files changed, 18553 insertions, 9561 deletions
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h index 1b383e3cb68c..20ac3d95ecd9 100644 --- a/include/asm-alpha/atomic.h +++ b/include/asm-alpha/atomic.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ALPHA_ATOMIC_H | 1 | #ifndef _ALPHA_ATOMIC_H |
2 | #define _ALPHA_ATOMIC_H | 2 | #define _ALPHA_ATOMIC_H |
3 | 3 | ||
4 | #include <asm/barrier.h> | ||
5 | |||
4 | /* | 6 | /* |
5 | * Atomic operations that C can't guarantee us. Useful for | 7 | * Atomic operations that C can't guarantee us. Useful for |
6 | * resource counting etc... | 8 | * resource counting etc... |
@@ -100,18 +102,19 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
100 | static __inline__ long atomic_add_return(int i, atomic_t * v) | 102 | static __inline__ long atomic_add_return(int i, atomic_t * v) |
101 | { | 103 | { |
102 | long temp, result; | 104 | long temp, result; |
105 | smp_mb(); | ||
103 | __asm__ __volatile__( | 106 | __asm__ __volatile__( |
104 | "1: ldl_l %0,%1\n" | 107 | "1: ldl_l %0,%1\n" |
105 | " addl %0,%3,%2\n" | 108 | " addl %0,%3,%2\n" |
106 | " addl %0,%3,%0\n" | 109 | " addl %0,%3,%0\n" |
107 | " stl_c %0,%1\n" | 110 | " stl_c %0,%1\n" |
108 | " beq %0,2f\n" | 111 | " beq %0,2f\n" |
109 | " mb\n" | ||
110 | ".subsection 2\n" | 112 | ".subsection 2\n" |
111 | "2: br 1b\n" | 113 | "2: br 1b\n" |
112 | ".previous" | 114 | ".previous" |
113 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 115 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
114 | :"Ir" (i), "m" (v->counter) : "memory"); | 116 | :"Ir" (i), "m" (v->counter) : "memory"); |
117 | smp_mb(); | ||
115 | return result; | 118 | return result; |
116 | } | 119 | } |
117 | 120 | ||
@@ -120,54 +123,57 @@ static __inline__ long atomic_add_return(int i, atomic_t * v) | |||
120 | static __inline__ long atomic64_add_return(long i, atomic64_t * v) | 123 | static __inline__ long atomic64_add_return(long i, atomic64_t * v) |
121 | { | 124 | { |
122 | long temp, result; | 125 | long temp, result; |
126 | smp_mb(); | ||
123 | __asm__ __volatile__( | 127 | __asm__ __volatile__( |
124 | "1: ldq_l %0,%1\n" | 128 | "1: ldq_l %0,%1\n" |
125 | " addq %0,%3,%2\n" | 129 | " addq %0,%3,%2\n" |
126 | " addq %0,%3,%0\n" | 130 | " addq %0,%3,%0\n" |
127 | " stq_c %0,%1\n" | 131 | " stq_c %0,%1\n" |
128 | " beq %0,2f\n" | 132 | " beq %0,2f\n" |
129 | " mb\n" | ||
130 | ".subsection 2\n" | 133 | ".subsection 2\n" |
131 | "2: br 1b\n" | 134 | "2: br 1b\n" |
132 | ".previous" | 135 | ".previous" |
133 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 136 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
134 | :"Ir" (i), "m" (v->counter) : "memory"); | 137 | :"Ir" (i), "m" (v->counter) : "memory"); |
138 | smp_mb(); | ||
135 | return result; | 139 | return result; |
136 | } | 140 | } |
137 | 141 | ||
138 | static __inline__ long atomic_sub_return(int i, atomic_t * v) | 142 | static __inline__ long atomic_sub_return(int i, atomic_t * v) |
139 | { | 143 | { |
140 | long temp, result; | 144 | long temp, result; |
145 | smp_mb(); | ||
141 | __asm__ __volatile__( | 146 | __asm__ __volatile__( |
142 | "1: ldl_l %0,%1\n" | 147 | "1: ldl_l %0,%1\n" |
143 | " subl %0,%3,%2\n" | 148 | " subl %0,%3,%2\n" |
144 | " subl %0,%3,%0\n" | 149 | " subl %0,%3,%0\n" |
145 | " stl_c %0,%1\n" | 150 | " stl_c %0,%1\n" |
146 | " beq %0,2f\n" | 151 | " beq %0,2f\n" |
147 | " mb\n" | ||
148 | ".subsection 2\n" | 152 | ".subsection 2\n" |
149 | "2: br 1b\n" | 153 | "2: br 1b\n" |
150 | ".previous" | 154 | ".previous" |
151 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 155 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
152 | :"Ir" (i), "m" (v->counter) : "memory"); | 156 | :"Ir" (i), "m" (v->counter) : "memory"); |
157 | smp_mb(); | ||
153 | return result; | 158 | return result; |
154 | } | 159 | } |
155 | 160 | ||
156 | static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | 161 | static __inline__ long atomic64_sub_return(long i, atomic64_t * v) |
157 | { | 162 | { |
158 | long temp, result; | 163 | long temp, result; |
164 | smp_mb(); | ||
159 | __asm__ __volatile__( | 165 | __asm__ __volatile__( |
160 | "1: ldq_l %0,%1\n" | 166 | "1: ldq_l %0,%1\n" |
161 | " subq %0,%3,%2\n" | 167 | " subq %0,%3,%2\n" |
162 | " subq %0,%3,%0\n" | 168 | " subq %0,%3,%0\n" |
163 | " stq_c %0,%1\n" | 169 | " stq_c %0,%1\n" |
164 | " beq %0,2f\n" | 170 | " beq %0,2f\n" |
165 | " mb\n" | ||
166 | ".subsection 2\n" | 171 | ".subsection 2\n" |
167 | "2: br 1b\n" | 172 | "2: br 1b\n" |
168 | ".previous" | 173 | ".previous" |
169 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) | 174 | :"=&r" (temp), "=m" (v->counter), "=&r" (result) |
170 | :"Ir" (i), "m" (v->counter) : "memory"); | 175 | :"Ir" (i), "m" (v->counter) : "memory"); |
176 | smp_mb(); | ||
171 | return result; | 177 | return result; |
172 | } | 178 | } |
173 | 179 | ||
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h new file mode 100644 index 000000000000..681ff581afa5 --- /dev/null +++ b/include/asm-alpha/barrier.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef __BARRIER_H | ||
2 | #define __BARRIER_H | ||
3 | |||
4 | #include <asm/compiler.h> | ||
5 | |||
6 | #define mb() \ | ||
7 | __asm__ __volatile__("mb": : :"memory") | ||
8 | |||
9 | #define rmb() \ | ||
10 | __asm__ __volatile__("mb": : :"memory") | ||
11 | |||
12 | #define wmb() \ | ||
13 | __asm__ __volatile__("wmb": : :"memory") | ||
14 | |||
15 | #define read_barrier_depends() \ | ||
16 | __asm__ __volatile__("mb": : :"memory") | ||
17 | |||
18 | #ifdef CONFIG_SMP | ||
19 | #define smp_mb() mb() | ||
20 | #define smp_rmb() rmb() | ||
21 | #define smp_wmb() wmb() | ||
22 | #define smp_read_barrier_depends() read_barrier_depends() | ||
23 | #else | ||
24 | #define smp_mb() barrier() | ||
25 | #define smp_rmb() barrier() | ||
26 | #define smp_wmb() barrier() | ||
27 | #define smp_read_barrier_depends() barrier() | ||
28 | #endif | ||
29 | |||
30 | #define set_mb(var, value) \ | ||
31 | do { var = value; mb(); } while (0) | ||
32 | |||
33 | #define set_wmb(var, value) \ | ||
34 | do { var = value; wmb(); } while (0) | ||
35 | |||
36 | #endif /* __BARRIER_H */ | ||
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h index c675f282d6ad..680f7ecbb28f 100644 --- a/include/asm-alpha/dma-mapping.h +++ b/include/asm-alpha/dma-mapping.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #else /* no PCI - no IOMMU. */ | 31 | #else /* no PCI - no IOMMU. */ |
32 | 32 | ||
33 | void *dma_alloc_coherent(struct device *dev, size_t size, | 33 | void *dma_alloc_coherent(struct device *dev, size_t size, |
34 | dma_addr_t *dma_handle, int gfp); | 34 | dma_addr_t *dma_handle, gfp_t gfp); |
35 | int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 35 | int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, |
36 | enum dma_data_direction direction); | 36 | enum dma_data_direction direction); |
37 | 37 | ||
diff --git a/include/asm-alpha/rwsem.h b/include/asm-alpha/rwsem.h index 8e058a67c9a4..fafdd4f7010a 100644 --- a/include/asm-alpha/rwsem.h +++ b/include/asm-alpha/rwsem.h | |||
@@ -262,5 +262,10 @@ static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem) | |||
262 | #endif | 262 | #endif |
263 | } | 263 | } |
264 | 264 | ||
265 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
266 | { | ||
267 | return (sem->count != 0); | ||
268 | } | ||
269 | |||
265 | #endif /* __KERNEL__ */ | 270 | #endif /* __KERNEL__ */ |
266 | #endif /* _ALPHA_RWSEM_H */ | 271 | #endif /* _ALPHA_RWSEM_H */ |
diff --git a/include/asm-alpha/semaphore.h b/include/asm-alpha/semaphore.h index eb2cbd97d404..1a6295f2c2d4 100644 --- a/include/asm-alpha/semaphore.h +++ b/include/asm-alpha/semaphore.h | |||
@@ -26,9 +26,6 @@ struct semaphore { | |||
26 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ | 26 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ |
27 | } | 27 | } |
28 | 28 | ||
29 | #define __MUTEX_INITIALIZER(name) \ | ||
30 | __SEMAPHORE_INITIALIZER(name,1) | ||
31 | |||
32 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 29 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
33 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
34 | 31 | ||
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index bdb4d66418f1..050e86d12891 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <asm/pal.h> | 5 | #include <asm/pal.h> |
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | #include <asm/barrier.h> | ||
7 | 8 | ||
8 | /* | 9 | /* |
9 | * System defines.. Note that this is included both from .c and .S | 10 | * System defines.. Note that this is included both from .c and .S |
@@ -139,36 +140,6 @@ extern void halt(void) __attribute__((noreturn)); | |||
139 | struct task_struct; | 140 | struct task_struct; |
140 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); | 141 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); |
141 | 142 | ||
142 | #define mb() \ | ||
143 | __asm__ __volatile__("mb": : :"memory") | ||
144 | |||
145 | #define rmb() \ | ||
146 | __asm__ __volatile__("mb": : :"memory") | ||
147 | |||
148 | #define wmb() \ | ||
149 | __asm__ __volatile__("wmb": : :"memory") | ||
150 | |||
151 | #define read_barrier_depends() \ | ||
152 | __asm__ __volatile__("mb": : :"memory") | ||
153 | |||
154 | #ifdef CONFIG_SMP | ||
155 | #define smp_mb() mb() | ||
156 | #define smp_rmb() rmb() | ||
157 | #define smp_wmb() wmb() | ||
158 | #define smp_read_barrier_depends() read_barrier_depends() | ||
159 | #else | ||
160 | #define smp_mb() barrier() | ||
161 | #define smp_rmb() barrier() | ||
162 | #define smp_wmb() barrier() | ||
163 | #define smp_read_barrier_depends() barrier() | ||
164 | #endif | ||
165 | |||
166 | #define set_mb(var, value) \ | ||
167 | do { var = value; mb(); } while (0) | ||
168 | |||
169 | #define set_wmb(var, value) \ | ||
170 | do { var = value; wmb(); } while (0) | ||
171 | |||
172 | #define imb() \ | 143 | #define imb() \ |
173 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") | 144 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") |
174 | 145 | ||
diff --git a/include/asm-arm/arch-aaec2000/aaec2000.h b/include/asm-arm/arch-aaec2000/aaec2000.h index 0e9b7e18af05..002227924b9f 100644 --- a/include/asm-arm/arch-aaec2000/aaec2000.h +++ b/include/asm-arm/arch-aaec2000/aaec2000.h | |||
@@ -17,6 +17,16 @@ | |||
17 | #error You must include hardware.h not this file | 17 | #error You must include hardware.h not this file |
18 | #endif /* __ASM_ARCH_HARDWARE_H */ | 18 | #endif /* __ASM_ARCH_HARDWARE_H */ |
19 | 19 | ||
20 | /* Chip selects */ | ||
21 | #define AAEC_CS0 0x00000000 | ||
22 | #define AAEC_CS1 0x10000000 | ||
23 | #define AAEC_CS2 0x20000000 | ||
24 | #define AAEC_CS3 0x30000000 | ||
25 | |||
26 | /* Flash */ | ||
27 | #define AAEC_FLASH_BASE AAEC_CS0 | ||
28 | #define AAEC_FLASH_SIZE SZ_64M | ||
29 | |||
20 | /* Interrupt controller */ | 30 | /* Interrupt controller */ |
21 | #define IRQ_BASE __REG(0x80000500) | 31 | #define IRQ_BASE __REG(0x80000500) |
22 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ | 32 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ |
@@ -148,4 +158,50 @@ | |||
148 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ | 158 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ |
149 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ | 159 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ |
150 | 160 | ||
161 | /* GPIO Registers */ | ||
162 | #define AAEC_GPIO_PHYS 0x80000e00 | ||
163 | |||
164 | #define AAEC_GPIO_PADR __REG(AAEC_GPIO_PHYS + 0x00) | ||
165 | #define AAEC_GPIO_PBDR __REG(AAEC_GPIO_PHYS + 0x04) | ||
166 | #define AAEC_GPIO_PCDR __REG(AAEC_GPIO_PHYS + 0x08) | ||
167 | #define AAEC_GPIO_PDDR __REG(AAEC_GPIO_PHYS + 0x0c) | ||
168 | #define AAEC_GPIO_PADDR __REG(AAEC_GPIO_PHYS + 0x10) | ||
169 | #define AAEC_GPIO_PBDDR __REG(AAEC_GPIO_PHYS + 0x14) | ||
170 | #define AAEC_GPIO_PCDDR __REG(AAEC_GPIO_PHYS + 0x18) | ||
171 | #define AAEC_GPIO_PDDDR __REG(AAEC_GPIO_PHYS + 0x1c) | ||
172 | #define AAEC_GPIO_PEDR __REG(AAEC_GPIO_PHYS + 0x20) | ||
173 | #define AAEC_GPIO_PEDDR __REG(AAEC_GPIO_PHYS + 0x24) | ||
174 | #define AAEC_GPIO_KSCAN __REG(AAEC_GPIO_PHYS + 0x28) | ||
175 | #define AAEC_GPIO_PINMUX __REG(AAEC_GPIO_PHYS + 0x2c) | ||
176 | #define AAEC_GPIO_PFDR __REG(AAEC_GPIO_PHYS + 0x30) | ||
177 | #define AAEC_GPIO_PFDDR __REG(AAEC_GPIO_PHYS + 0x34) | ||
178 | #define AAEC_GPIO_PGDR __REG(AAEC_GPIO_PHYS + 0x38) | ||
179 | #define AAEC_GPIO_PGDDR __REG(AAEC_GPIO_PHYS + 0x3c) | ||
180 | #define AAEC_GPIO_PHDR __REG(AAEC_GPIO_PHYS + 0x40) | ||
181 | #define AAEC_GPIO_PHDDR __REG(AAEC_GPIO_PHYS + 0x44) | ||
182 | #define AAEC_GPIO_RAZ __REG(AAEC_GPIO_PHYS + 0x48) | ||
183 | #define AAEC_GPIO_INTTYPE1 __REG(AAEC_GPIO_PHYS + 0x4c) | ||
184 | #define AAEC_GPIO_INTTYPE2 __REG(AAEC_GPIO_PHYS + 0x50) | ||
185 | #define AAEC_GPIO_FEOI __REG(AAEC_GPIO_PHYS + 0x54) | ||
186 | #define AAEC_GPIO_INTEN __REG(AAEC_GPIO_PHYS + 0x58) | ||
187 | #define AAEC_GPIO_INTSTATUS __REG(AAEC_GPIO_PHYS + 0x5c) | ||
188 | #define AAEC_GPIO_RAWINTSTATUS __REG(AAEC_GPIO_PHYS + 0x60) | ||
189 | #define AAEC_GPIO_DB __REG(AAEC_GPIO_PHYS + 0x64) | ||
190 | #define AAEC_GPIO_PAPINDR __REG(AAEC_GPIO_PHYS + 0x68) | ||
191 | #define AAEC_GPIO_PBPINDR __REG(AAEC_GPIO_PHYS + 0x6c) | ||
192 | #define AAEC_GPIO_PCPINDR __REG(AAEC_GPIO_PHYS + 0x70) | ||
193 | #define AAEC_GPIO_PDPINDR __REG(AAEC_GPIO_PHYS + 0x74) | ||
194 | #define AAEC_GPIO_PEPINDR __REG(AAEC_GPIO_PHYS + 0x78) | ||
195 | #define AAEC_GPIO_PFPINDR __REG(AAEC_GPIO_PHYS + 0x7c) | ||
196 | #define AAEC_GPIO_PGPINDR __REG(AAEC_GPIO_PHYS + 0x80) | ||
197 | #define AAEC_GPIO_PHPINDR __REG(AAEC_GPIO_PHYS + 0x84) | ||
198 | |||
199 | #define AAEC_GPIO_PINMUX_PE0CON (1 << 0) | ||
200 | #define AAEC_GPIO_PINMUX_PD0CON (1 << 1) | ||
201 | #define AAEC_GPIO_PINMUX_CODECON (1 << 2) | ||
202 | #define AAEC_GPIO_PINMUX_UART3CON (1 << 3) | ||
203 | |||
204 | /* LCD Controller */ | ||
205 | #define AAEC_CLCD_PHYS 0x80003000 | ||
206 | |||
151 | #endif /* __ARM_ARCH_AAEC2000_H */ | 207 | #endif /* __ARM_ARCH_AAEC2000_H */ |
diff --git a/include/asm-arm/arch-aaec2000/aaed2000.h b/include/asm-arm/arch-aaec2000/aaed2000.h new file mode 100644 index 000000000000..bc76d2badb91 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/aaed2000.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/aaed2000.h | ||
3 | * | ||
4 | * AAED-2000 specific bits definition | ||
5 | * | ||
6 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_AAED2000_H | ||
14 | #define __ASM_ARCH_AAED2000_H | ||
15 | |||
16 | /* External GPIOs. */ | ||
17 | |||
18 | #define EXT_GPIO_PBASE AAEC_CS3 | ||
19 | #define EXT_GPIO_VBASE 0xf8100000 | ||
20 | #define EXT_GPIO_LENGTH 0x00001000 | ||
21 | |||
22 | #define __ext_gpio_p2v(x) ((x) - EXT_GPIO_PBASE + EXT_GPIO_VBASE) | ||
23 | #define __ext_gpio_v2p(x) ((x) + EXT_GPIO_PBASE - EXT_GPIO_VBASE) | ||
24 | |||
25 | #define __EXT_GPIO_REG(x) (*((volatile u32 *)__ext_gpio_p2v(x))) | ||
26 | #define __EXT_GPIO_PREG(x) (__ext_gpio_v2p((u32)&(x))) | ||
27 | |||
28 | #define AAED_EXT_GPIO __EXT_GPIO_REG(EXT_GPIO_PBASE) | ||
29 | |||
30 | #define AAED_EGPIO_KBD_SCAN 0x00003fff /* Keyboard scan data */ | ||
31 | #define AAED_EGPIO_PWR_INT 0x00008fff /* Smart battery charger interrupt */ | ||
32 | #define AAED_EGPIO_SWITCHED 0x000f0000 /* DIP Switches */ | ||
33 | #define AAED_EGPIO_USB_VBUS 0x00400000 /* USB Vbus sense */ | ||
34 | #define AAED_EGPIO_LCD_PWR_EN 0x02000000 /* LCD and backlight PWR enable */ | ||
35 | #define AAED_EGPIO_nLED0 0x20000000 /* LED 0 */ | ||
36 | #define AAED_EGPIO_nLED1 0x20000000 /* LED 1 */ | ||
37 | #define AAED_EGPIO_nLED2 0x20000000 /* LED 2 */ | ||
38 | |||
39 | |||
40 | #endif /* __ARM_ARCH_AAED2000_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/hardware.h b/include/asm-arm/arch-aaec2000/hardware.h index 4c37219e030e..153506fd06ed 100644 --- a/include/asm-arm/arch-aaec2000/hardware.h +++ b/include/asm-arm/arch-aaec2000/hardware.h | |||
@@ -11,7 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_HARDWARE_H | 11 | #ifndef __ASM_ARCH_HARDWARE_H |
12 | #define __ASM_ARCH_HARDWARE_H | 12 | #define __ASM_ARCH_HARDWARE_H |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <asm/sizes.h> |
15 | #include <asm/arch/aaec2000.h> | ||
15 | 16 | ||
16 | /* The kernel is loaded at physical address 0xf8000000. | 17 | /* The kernel is loaded at physical address 0xf8000000. |
17 | * We map the IO space a bit after | 18 | * We map the IO space a bit after |
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h index c58a8d10425a..8d67907fd4f0 100644 --- a/include/asm-arm/arch-aaec2000/io.h +++ b/include/asm-arm/arch-aaec2000/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <asm/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/include/asm-arm/arch-aaec2000/memory.h b/include/asm-arm/arch-aaec2000/memory.h index 79c90813bc3e..d8209f8911d6 100644 --- a/include/asm-arm/arch-aaec2000/memory.h +++ b/include/asm-arm/arch-aaec2000/memory.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | 15 | ||
16 | #define PHYS_OFFSET (0xf0000000UL) | 16 | #define PHYS_OFFSET UL(0xf0000000) |
17 | 17 | ||
18 | #define __virt_to_bus(x) __virt_to_phys(x) | 18 | #define __virt_to_bus(x) __virt_to_phys(x) |
19 | #define __bus_to_virt(x) __phys_to_virt(x) | 19 | #define __bus_to_virt(x) __phys_to_virt(x) |
diff --git a/include/asm-arm/arch-cl7500/io.h b/include/asm-arm/arch-cl7500/io.h index f0113bc75630..89a33287f4fe 100644 --- a/include/asm-arm/arch-cl7500/io.h +++ b/include/asm-arm/arch-cl7500/io.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/hardware.h> | ||
14 | |||
13 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
14 | 16 | ||
15 | /* | 17 | /* |
diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h index 9776bba8e585..34f40a6cec30 100644 --- a/include/asm-arm/arch-cl7500/memory.h +++ b/include/asm-arm/arch-cl7500/memory.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* | 17 | /* |
18 | * Physical DRAM offset. | 18 | * Physical DRAM offset. |
19 | */ | 19 | */ |
20 | #define PHYS_OFFSET (0x10000000UL) | 20 | #define PHYS_OFFSET UL(0x10000000) |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * These are exactly the same on the RiscPC as the | 23 | * These are exactly the same on the RiscPC as the |
diff --git a/include/asm-arm/arch-clps711x/hardware.h b/include/asm-arm/arch-clps711x/hardware.h index 1386871e1a5a..f864c367c934 100644 --- a/include/asm-arm/arch-clps711x/hardware.h +++ b/include/asm-arm/arch-clps711x/hardware.h | |||
@@ -235,4 +235,121 @@ | |||
235 | #define CEIVA_PB0_BLK_BTN (1<<0) | 235 | #define CEIVA_PB0_BLK_BTN (1<<0) |
236 | #endif // #if defined (CONFIG_ARCH_CEIVA) | 236 | #endif // #if defined (CONFIG_ARCH_CEIVA) |
237 | 237 | ||
238 | #if defined (CONFIG_MACH_MP1000) | ||
239 | /* NOR FLASH */ | ||
240 | #define MP1000_NIO_BASE 0xf9000000 /* virtual */ | ||
241 | #define MP1000_NIO_START CS0_PHYS_BASE /* physical */ | ||
242 | #define MP1000_NIO_SIZE 0x00400000 | ||
243 | |||
244 | /* DSP Interface */ | ||
245 | #define MP1000_DSP_BASE 0xfa000000 /* virtual */ | ||
246 | #define MP1000_DSP_START CS1_PHYS_BASE /* physical */ | ||
247 | #define MP1000_DSP_SIZE 0x00100000 | ||
248 | |||
249 | /* LCD, DAA/DSP, RTC, DAA RW Reg all in CS2 */ | ||
250 | #define MP1000_LIO_BASE 0xfb000000 /* virtual */ | ||
251 | #define MP1000_LIO_START CS2_PHYS_BASE /* physical */ | ||
252 | #define MP1000_LIO_SIZE 0x00100000 | ||
253 | |||
254 | /* NAND FLASH */ | ||
255 | #define MP1000_FIO_BASE 0xfc000000 /* virtual */ | ||
256 | #define MP1000_FIO_START CS3_PHYS_BASE /* physical */ | ||
257 | #define MP1000_FIO_SIZE 0x00800000 | ||
258 | |||
259 | /* Ethernet */ | ||
260 | #define MP1000_EIO_BASE 0xfd000000 /* virtual */ | ||
261 | #define MP1000_EIO_START CS4_PHYS_BASE /* physical */ | ||
262 | #define MP1000_EIO_SIZE 0x00100000 | ||
263 | |||
264 | #define MP1000_LCD_OFFSET 0x00000000 /* LCD offset in CS2 */ | ||
265 | #define MP1000_DDD_OFFSET 0x00001000 /* DAA/DAI/DSP sft reset offst*/ | ||
266 | #define MP1000_RTC_OFFSET 0x00002000 /* RTC offset in CS2 */ | ||
267 | #define MP1000_DAA_OFFSET 0x00003000 /* DAA RW reg offset in CS2 */ | ||
268 | |||
269 | /* IDE */ | ||
270 | #define MP1000_IDE_BASE 0xfe000000 /* virtual */ | ||
271 | #define MP1000_IDE_START CS5_PHYS_BASE /* physical */ | ||
272 | #define MP1000_IDE_SIZE 0x00100000 /* actually it's only 0x1000 */ | ||
273 | |||
274 | #define IRQ_HARDDISK IRQ_EINT2 | ||
275 | |||
276 | /* | ||
277 | * IDE registers definition | ||
278 | */ | ||
279 | |||
280 | #define IDE_CONTROL_BASE (MP1000_IDE_BASE + 0x1000) | ||
281 | #define IDE_BASE_OFF (MP1000_IDE_BASE) | ||
282 | |||
283 | #define IDE_WRITE_DEVICE_DATA (IDE_BASE_OFF + 0x0) | ||
284 | #define IDE_FEATURES_REGISTER (IDE_BASE_OFF + 0x2) | ||
285 | #define IDE_SECTOR_COUNT_REGISTER (IDE_BASE_OFF + 0x4) | ||
286 | #define IDE_SECTOR_NUMBER_REGISTER (IDE_BASE_OFF + 0x6) | ||
287 | #define IDE_CYLINDER_LOW_REGISTER (IDE_BASE_OFF + 0x8) | ||
288 | #define IDE_CYLINDER_HIGH_REGISTER (IDE_BASE_OFF + 0xa) | ||
289 | #define IDE_DEVICE_HEAD_REGISTER (IDE_BASE_OFF + 0xc) | ||
290 | #define IDE_COMMAND_DATA_REGISTER (IDE_BASE_OFF + 0xe) | ||
291 | #define IDE_DEVICE_CONTROL_REGISTER (IDE_CONTROL_BASE + 0xc) | ||
292 | |||
293 | #define IDE_IRQ IRQ_EINT2 | ||
294 | |||
295 | |||
296 | #define RTC_PORT(x) (MP1000_LIO_BASE+0x2000 + (x*2)) | ||
297 | #define RTC_ALWAYS_BCD 0 | ||
298 | |||
299 | /* | ||
300 | // Definitions of the bit fields in the HwPortA register for the | ||
301 | // MP1000 board. | ||
302 | */ | ||
303 | #define HwPortAKeyboardRow1 0x00000001 | ||
304 | #define HwPortAKeyboardRow2 0x00000002 | ||
305 | #define HwPortAKeyboardRow3 0x00000004 | ||
306 | #define HwPortAKeyboardRow4 0x00000008 | ||
307 | #define HwPortAKeyboardRow5 0x00000010 | ||
308 | #define HwPortAKeyboardRow6 0x00000020 | ||
309 | #define HwPortALCDEnable 0x00000040 | ||
310 | #define HwPortAOffhook 0x00000080 | ||
311 | |||
312 | /* | ||
313 | // Definitions of the bit fields in the HwPortB register for the | ||
314 | // MP1000 board. | ||
315 | */ | ||
316 | #define HwPortBL3Mode 0x00000001 | ||
317 | #define HwPortBL3Clk 0x00000002 | ||
318 | #define HwPortBSClk 0x00000001 | ||
319 | #define HwPortBSData 0x00000002 | ||
320 | #define HwPortBL3Data 0x00000004 | ||
321 | #define HwPortBMute 0x00000008 | ||
322 | #define HwPortBQD0 0x00000010 | ||
323 | #define HwPortBQD1 0x00000020 | ||
324 | #define HwPortBQD2 0x00000040 | ||
325 | #define HwPortBQD3 0x00000080 | ||
326 | |||
327 | /* | ||
328 | // Definitions of the bit fields in the HwPortD register for the | ||
329 | // MP1000 board. | ||
330 | */ | ||
331 | #define HwPortDLED1 0x00000001 | ||
332 | #define HwPortDLED2 0x00000002 | ||
333 | #define HwPortDLED3 0x00000004 | ||
334 | #define HwPortDLED4 0x00000008 | ||
335 | #define HwPortDLED5 0x00000010 | ||
336 | #define HwPortDEECS 0x00000020 | ||
337 | #define HwPortBRTS 0x00000040 | ||
338 | #define HwPortBRI 0x00000080 | ||
339 | |||
340 | |||
341 | /* | ||
342 | // Definitions of the bit fields in the HwPortE register for the | ||
343 | // MP1000 board. | ||
344 | */ | ||
345 | |||
346 | #define HwPortECLE 0x00000001 | ||
347 | #define HwPortESepromDOut 0x00000001 | ||
348 | #define HwPortEALE 0x00000002 | ||
349 | #define HwPortESepromDIn 0x00000002 | ||
350 | #define HwPortENANDCS 0x00000004 | ||
351 | #define HwPortESepromCLK 0x00000004 | ||
352 | |||
353 | #endif // #if defined (CONFIG_MACH_MP1000) | ||
354 | |||
238 | #endif | 355 | #endif |
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h index 14d7e8da5453..62613b0e2d96 100644 --- a/include/asm-arm/arch-clps711x/io.h +++ b/include/asm-arm/arch-clps711x/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | 25 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 26 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h index bd978947db42..61d8717406ce 100644 --- a/include/asm-arm/arch-clps711x/memory.h +++ b/include/asm-arm/arch-clps711x/memory.h | |||
@@ -25,7 +25,7 @@ | |||
25 | /* | 25 | /* |
26 | * Physical DRAM offset. | 26 | * Physical DRAM offset. |
27 | */ | 27 | */ |
28 | #define PHYS_OFFSET (0xc0000000UL) | 28 | #define PHYS_OFFSET UL(0xc0000000) |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * Virtual view <-> DMA view memory address translations | 31 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-clps711x/mp1000-seprom.h b/include/asm-arm/arch-clps711x/mp1000-seprom.h new file mode 100644 index 000000000000..3e5566cf9666 --- /dev/null +++ b/include/asm-arm/arch-clps711x/mp1000-seprom.h | |||
@@ -0,0 +1,77 @@ | |||
1 | #ifndef MP1000_SEPROM_H | ||
2 | #define MP1000_SEPROM_H | ||
3 | |||
4 | /* | ||
5 | * mp1000-seprom.h | ||
6 | * | ||
7 | * | ||
8 | * This file contains the Serial EEPROM definitions for the MP1000 board | ||
9 | * | ||
10 | * Copyright (C) 2005 Comdial Corporation | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | #define COMMAND_ERASE (0x1C0) | ||
29 | #define COMMAND_ERASE_ALL (0x120) | ||
30 | #define COMMAND_WRITE_DISABLE (0x100) | ||
31 | #define COMMAND_WRITE_ENABLE (0x130) | ||
32 | #define COMMAND_READ (0x180) | ||
33 | #define COMMAND_WRITE (0x140) | ||
34 | #define COMMAND_WRITE_ALL (0x110) | ||
35 | |||
36 | // | ||
37 | // Serial EEPROM data format | ||
38 | // | ||
39 | |||
40 | #define PACKED __attribute__ ((packed)) | ||
41 | |||
42 | typedef struct _EEPROM { | ||
43 | union { | ||
44 | unsigned char eprom_byte_data[128]; | ||
45 | unsigned short eprom_short_data[64]; | ||
46 | struct { | ||
47 | unsigned char version PACKED; // EEPROM Version "1" for now | ||
48 | unsigned char box_id PACKED; // Box ID (Standalone, SOHO, embedded, etc) | ||
49 | unsigned char major_hw_version PACKED; // Major Hardware version (Hex) | ||
50 | unsigned char minor_hw_version PACKED; // Minor Hardware Version (Hex) | ||
51 | unsigned char mfg_id[3] PACKED; // Manufacturer ID (3 character Alphabetic) | ||
52 | unsigned char mfg_serial_number[10] PACKED; // Manufacturer Serial number | ||
53 | unsigned char mfg_date[3] PACKED; // Date of Mfg (Formatted YY:MM:DD) | ||
54 | unsigned char country PACKED; // Country of deployment | ||
55 | unsigned char mac_Address[6] PACKED; // MAC Address | ||
56 | unsigned char oem_string[20] PACKED; // OEM ID string | ||
57 | unsigned short feature_bits1 PACKED; // Feature Bits 1 | ||
58 | unsigned short feature_bits2 PACKED; // Feature Bits 2 | ||
59 | unsigned char filler[75] PACKED; // Unused/Undefined “0” initialized | ||
60 | unsigned short checksum PACKED; // byte accumulated short checksum | ||
61 | } eprom_struct; | ||
62 | } variant; | ||
63 | } eeprom_struct; | ||
64 | |||
65 | /* These settings must be mutually exclusive */ | ||
66 | #define FEATURE_BITS1_DRAMSIZE_16MEG 0x0001 /* 0 signifies 4 MEG system */ | ||
67 | #define FEATURE_BITS1_DRAMSIZE_8MEG 0x0002 /* 1 in bit 1 = 8MEG system */ | ||
68 | #define FEATURE_BITS1_DRAMSIZE_64MEG 0x0004 /* 1 in bit 2 = 64MEG system */ | ||
69 | |||
70 | #define FEATURE_BITS1_CPUIS90MEG 0x0010 | ||
71 | |||
72 | extern void seprom_init(void); | ||
73 | extern eeprom_struct* get_seprom_ptr(void); | ||
74 | extern unsigned char* get_eeprom_mac_address(void); | ||
75 | |||
76 | #endif /* MP1000_SEPROM_H */ | ||
77 | |||
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h index 5a9493e12275..02f144520c10 100644 --- a/include/asm-arm/arch-ebsa110/memory.h +++ b/include/asm-arm/arch-ebsa110/memory.h | |||
@@ -19,7 +19,7 @@ | |||
19 | /* | 19 | /* |
20 | * Physical DRAM offset. | 20 | * Physical DRAM offset. |
21 | */ | 21 | */ |
22 | #define PHYS_OFFSET (0x00000000UL) | 22 | #define PHYS_OFFSET UL(0x00000000) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We keep this 1:1 so that we don't interfere | 25 | * We keep this 1:1 so that we don't interfere |
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h index 70576b17f922..776f9d377057 100644 --- a/include/asm-arm/arch-ebsa285/io.h +++ b/include/asm-arm/arch-ebsa285/io.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #include <asm/hardware.h> | ||
18 | |||
17 | #define IO_SPACE_LIMIT 0xffff | 19 | #define IO_SPACE_LIMIT 0xffff |
18 | 20 | ||
19 | /* | 21 | /* |
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h index d0466f9987d3..09e335cd687d 100644 --- a/include/asm-arm/arch-ebsa285/memory.h +++ b/include/asm-arm/arch-ebsa285/memory.h | |||
@@ -46,14 +46,14 @@ extern unsigned long __bus_to_virt(unsigned long); | |||
46 | #if defined(CONFIG_ARCH_FOOTBRIDGE) | 46 | #if defined(CONFIG_ARCH_FOOTBRIDGE) |
47 | 47 | ||
48 | /* Task size and page offset at 3GB */ | 48 | /* Task size and page offset at 3GB */ |
49 | #define TASK_SIZE (0xbf000000UL) | 49 | #define TASK_SIZE UL(0xbf000000) |
50 | #define PAGE_OFFSET (0xc0000000UL) | 50 | #define PAGE_OFFSET UL(0xc0000000) |
51 | 51 | ||
52 | #elif defined(CONFIG_ARCH_CO285) | 52 | #elif defined(CONFIG_ARCH_CO285) |
53 | 53 | ||
54 | /* Task size and page offset at 1.5GB */ | 54 | /* Task size and page offset at 1.5GB */ |
55 | #define TASK_SIZE (0x5f000000UL) | 55 | #define TASK_SIZE UL(0x5f000000) |
56 | #define PAGE_OFFSET (0x60000000UL) | 56 | #define PAGE_OFFSET UL(0x60000000) |
57 | 57 | ||
58 | #else | 58 | #else |
59 | 59 | ||
@@ -64,7 +64,7 @@ extern unsigned long __bus_to_virt(unsigned long); | |||
64 | /* | 64 | /* |
65 | * Physical DRAM offset. | 65 | * Physical DRAM offset. |
66 | */ | 66 | */ |
67 | #define PHYS_OFFSET (0x00000000UL) | 67 | #define PHYS_OFFSET UL(0x00000000) |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * This decides where the kernel will search for a free chunk of vm | 70 | * This decides where the kernel will search for a free chunk of vm |
diff --git a/include/asm-arm/arch-epxa10db/io.h b/include/asm-arm/arch-epxa10db/io.h index 1f0afa257621..9fe100c9d6be 100644 --- a/include/asm-arm/arch-epxa10db/io.h +++ b/include/asm-arm/arch-epxa10db/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffff | 25 | #define IO_SPACE_LIMIT 0xffff |
24 | 26 | ||
25 | 27 | ||
diff --git a/include/asm-arm/arch-epxa10db/memory.h b/include/asm-arm/arch-epxa10db/memory.h index 3f86bf7f67f0..999541b6a9f5 100644 --- a/include/asm-arm/arch-epxa10db/memory.h +++ b/include/asm-arm/arch-epxa10db/memory.h | |||
@@ -23,7 +23,7 @@ | |||
23 | /* | 23 | /* |
24 | * Physical DRAM offset. | 24 | * Physical DRAM offset. |
25 | */ | 25 | */ |
26 | #define PHYS_OFFSET (0x00000000UL) | 26 | #define PHYS_OFFSET UL(0x00000000) |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Virtual view <-> DMA view memory address translations | 29 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-h720x/io.h b/include/asm-arm/arch-h720x/io.h index 68814828c9a7..d3ccfd8172b7 100644 --- a/include/asm-arm/arch-h720x/io.h +++ b/include/asm-arm/arch-h720x/io.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #include <asm/arch/hardware.h> | 17 | #include <asm/hardware.h> |
18 | 18 | ||
19 | #define IO_SPACE_LIMIT 0xffffffff | 19 | #define IO_SPACE_LIMIT 0xffffffff |
20 | 20 | ||
diff --git a/include/asm-arm/arch-h720x/memory.h b/include/asm-arm/arch-h720x/memory.h index 5633447af268..4a1bfd78a0fe 100644 --- a/include/asm-arm/arch-h720x/memory.h +++ b/include/asm-arm/arch-h720x/memory.h | |||
@@ -11,7 +11,7 @@ | |||
11 | * Page offset: | 11 | * Page offset: |
12 | * ( 0xc0000000UL ) | 12 | * ( 0xc0000000UL ) |
13 | */ | 13 | */ |
14 | #define PHYS_OFFSET (0x40000000UL) | 14 | #define PHYS_OFFSET UL(0x40000000) |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Virtual view <-> DMA view memory address translations | 17 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-imx/io.h b/include/asm-arm/arch-imx/io.h index 28a4cca6a4cb..b191cdd05576 100644 --- a/include/asm-arm/arch-imx/io.h +++ b/include/asm-arm/arch-imx/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | 25 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 26 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
diff --git a/include/asm-arm/arch-imx/memory.h b/include/asm-arm/arch-imx/memory.h index 116a91fa14f1..d09ae32cd2f4 100644 --- a/include/asm-arm/arch-imx/memory.h +++ b/include/asm-arm/arch-imx/memory.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef __ASM_ARCH_MMU_H | 21 | #ifndef __ASM_ARCH_MMU_H |
22 | #define __ASM_ARCH_MMU_H | 22 | #define __ASM_ARCH_MMU_H |
23 | 23 | ||
24 | #define PHYS_OFFSET (0x08000000UL) | 24 | #define PHYS_OFFSET UL(0x08000000) |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Virtual view <-> DMA view memory address translations | 27 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-integrator/hardware.h b/include/asm-arm/arch-integrator/hardware.h index be2716eeaa02..6f0947bc500d 100644 --- a/include/asm-arm/arch-integrator/hardware.h +++ b/include/asm-arm/arch-integrator/hardware.h | |||
@@ -33,15 +33,6 @@ | |||
33 | #define IO_SIZE 0x0B000000 // How much? | 33 | #define IO_SIZE 0x0B000000 // How much? |
34 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO | 34 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO |
35 | 35 | ||
36 | /* | ||
37 | * Similar to above, but for PCI addresses (memory, IO, Config and the | ||
38 | * V3 chip itself). WARNING: this has to mirror definitions in platform.h | ||
39 | */ | ||
40 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
41 | #define PCI_CONFIG_VADDR 0xec000000 | ||
42 | #define PCI_V3_VADDR 0xed000000 | ||
43 | #define PCI_IO_VADDR 0xee000000 | ||
44 | |||
45 | #define PCIO_BASE PCI_IO_VADDR | 36 | #define PCIO_BASE PCI_IO_VADDR |
46 | #define PCIMEM_BASE PCI_MEMORY_VADDR | 37 | #define PCIMEM_BASE PCI_MEMORY_VADDR |
47 | 38 | ||
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h index fbea8be67d26..31f2deab51b0 100644 --- a/include/asm-arm/arch-integrator/io.h +++ b/include/asm-arm/arch-integrator/io.h | |||
@@ -22,6 +22,14 @@ | |||
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffff | 23 | #define IO_SPACE_LIMIT 0xffff |
24 | 24 | ||
25 | /* | ||
26 | * WARNING: this has to mirror definitions in platform.h | ||
27 | */ | ||
28 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
29 | #define PCI_CONFIG_VADDR 0xec000000 | ||
30 | #define PCI_V3_VADDR 0xed000000 | ||
31 | #define PCI_IO_VADDR 0xee000000 | ||
32 | |||
25 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) | 33 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) |
26 | #define __mem_pci(a) (a) | 34 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) | 35 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) |
diff --git a/include/asm-arm/arch-integrator/memory.h b/include/asm-arm/arch-integrator/memory.h index 2087ea7d28a9..1ab56d783e7c 100644 --- a/include/asm-arm/arch-integrator/memory.h +++ b/include/asm-arm/arch-integrator/memory.h | |||
@@ -23,8 +23,8 @@ | |||
23 | /* | 23 | /* |
24 | * Physical DRAM offset. | 24 | * Physical DRAM offset. |
25 | */ | 25 | */ |
26 | #define PHYS_OFFSET (0x00000000UL) | 26 | #define PHYS_OFFSET UL(0x00000000) |
27 | #define BUS_OFFSET (0x80000000UL) | 27 | #define BUS_OFFSET UL(0x80000000) |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Virtual view <-> DMA view memory address translations | 30 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h index 2761dfd8694d..f39046a6ab14 100644 --- a/include/asm-arm/arch-iop3xx/io.h +++ b/include/asm-arm/arch-iop3xx/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __ASM_ARM_ARCH_IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __ASM_ARM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | #define __io(p) ((void __iomem *)(p)) | 18 | #define __io(p) ((void __iomem *)(p)) |
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h index 45351f5cd904..bc62f4b13235 100644 --- a/include/asm-arm/arch-iop3xx/memory.h +++ b/include/asm-arm/arch-iop3xx/memory.h | |||
@@ -12,9 +12,9 @@ | |||
12 | * Physical DRAM offset. | 12 | * Physical DRAM offset. |
13 | */ | 13 | */ |
14 | #ifndef CONFIG_ARCH_IOP331 | 14 | #ifndef CONFIG_ARCH_IOP331 |
15 | #define PHYS_OFFSET (0xa0000000UL) | 15 | #define PHYS_OFFSET UL(0xa0000000) |
16 | #else | 16 | #else |
17 | #define PHYS_OFFSET (0x00000000UL) | 17 | #define PHYS_OFFSET UL(0x00000000) |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | /* | 20 | /* |
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h index 3241cd6f0778..7fbcdf9931ee 100644 --- a/include/asm-arm/arch-ixp2000/io.h +++ b/include/asm-arm/arch-ixp2000/io.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __ASM_ARM_ARCH_IO_H | 15 | #ifndef __ASM_ARM_ARCH_IO_H |
16 | #define __ASM_ARM_ARCH_IO_H | 16 | #define __ASM_ARM_ARCH_IO_H |
17 | 17 | ||
18 | #include <asm/hardware.h> | ||
19 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | 20 | #define IO_SPACE_LIMIT 0xffffffff |
19 | #define __mem_pci(a) (a) | 21 | #define __mem_pci(a) (a) |
20 | 22 | ||
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x01.h b/include/asm-arm/arch-ixp2000/ixdp2x01.h index b768009c3a51..c6d51426e98f 100644 --- a/include/asm-arm/arch-ixp2000/ixdp2x01.h +++ b/include/asm-arm/arch-ixp2000/ixdp2x01.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define IXDP2X01_CPLD_REGION_SIZE 0x00100000 | 22 | #define IXDP2X01_CPLD_REGION_SIZE 0x00100000 |
23 | 23 | ||
24 | #define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg) | 24 | #define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg) |
25 | #define IXDP2X01_CPLD_PHYS_REG(reg) (volatile u32*)(IXDP2X01_PHYS_CPLD_BASE | reg) | 25 | #define IXDP2X01_CPLD_PHYS_REG(reg) (IXDP2X01_PHYS_CPLD_BASE | reg) |
26 | 26 | ||
27 | #define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40) | 27 | #define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40) |
28 | #define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40) | 28 | #define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40) |
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h index 32aece069869..def089d693d2 100644 --- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h +++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h | |||
@@ -392,4 +392,47 @@ | |||
392 | #define WDT_RESET_ENABLE 0x01000000 | 392 | #define WDT_RESET_ENABLE 0x01000000 |
393 | 393 | ||
394 | 394 | ||
395 | /* | ||
396 | * MSF registers. The IXP2400 and IXP2800 have somewhat different MSF | ||
397 | * units, but the registers that differ between the two don't overlap, | ||
398 | * so we can have one register list for both. | ||
399 | */ | ||
400 | #define IXP2000_MSF_REG(x) ((volatile unsigned long*)(IXP2000_MSF_VIRT_BASE + (x))) | ||
401 | #define IXP2000_MSF_RX_CONTROL IXP2000_MSF_REG(0x0000) | ||
402 | #define IXP2000_MSF_TX_CONTROL IXP2000_MSF_REG(0x0004) | ||
403 | #define IXP2000_MSF_INTERRUPT_STATUS IXP2000_MSF_REG(0x0008) | ||
404 | #define IXP2000_MSF_INTERRUPT_ENABLE IXP2000_MSF_REG(0x000c) | ||
405 | #define IXP2000_MSF_CSIX_TYPE_MAP IXP2000_MSF_REG(0x0010) | ||
406 | #define IXP2000_MSF_FC_EGRESS_STATUS IXP2000_MSF_REG(0x0014) | ||
407 | #define IXP2000_MSF_FC_INGRESS_STATUS IXP2000_MSF_REG(0x0018) | ||
408 | #define IXP2000_MSF_HWM_CONTROL IXP2000_MSF_REG(0x0024) | ||
409 | #define IXP2000_MSF_FC_STATUS_OVERRIDE IXP2000_MSF_REG(0x0028) | ||
410 | #define IXP2000_MSF_CLOCK_CONTROL IXP2000_MSF_REG(0x002c) | ||
411 | #define IXP2000_MSF_RX_PORT_MAP IXP2000_MSF_REG(0x0040) | ||
412 | #define IXP2000_MSF_RBUF_ELEMENT_DONE IXP2000_MSF_REG(0x0044) | ||
413 | #define IXP2000_MSF_RX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0048) | ||
414 | #define IXP2000_MSF_RX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0048) | ||
415 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_0 IXP2000_MSF_REG(0x0050) | ||
416 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_1 IXP2000_MSF_REG(0x0054) | ||
417 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_2 IXP2000_MSF_REG(0x0058) | ||
418 | #define IXP2000_MSF_TX_SEQUENCE_0 IXP2000_MSF_REG(0x0060) | ||
419 | #define IXP2000_MSF_TX_SEQUENCE_1 IXP2000_MSF_REG(0x0064) | ||
420 | #define IXP2000_MSF_TX_SEQUENCE_2 IXP2000_MSF_REG(0x0068) | ||
421 | #define IXP2000_MSF_TX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0070) | ||
422 | #define IXP2000_MSF_TX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0070) | ||
423 | #define IXP2000_MSF_RX_UP_CONTROL_0 IXP2000_MSF_REG(0x0080) | ||
424 | #define IXP2000_MSF_RX_UP_CONTROL_1 IXP2000_MSF_REG(0x0084) | ||
425 | #define IXP2000_MSF_RX_UP_CONTROL_2 IXP2000_MSF_REG(0x0088) | ||
426 | #define IXP2000_MSF_RX_UP_CONTROL_3 IXP2000_MSF_REG(0x008c) | ||
427 | #define IXP2000_MSF_TX_UP_CONTROL_0 IXP2000_MSF_REG(0x0090) | ||
428 | #define IXP2000_MSF_TX_UP_CONTROL_1 IXP2000_MSF_REG(0x0094) | ||
429 | #define IXP2000_MSF_TX_UP_CONTROL_2 IXP2000_MSF_REG(0x0098) | ||
430 | #define IXP2000_MSF_TX_UP_CONTROL_3 IXP2000_MSF_REG(0x009c) | ||
431 | #define IXP2000_MSF_TRAIN_DATA IXP2000_MSF_REG(0x00a0) | ||
432 | #define IXP2000_MSF_TRAIN_CALENDAR IXP2000_MSF_REG(0x00a4) | ||
433 | #define IXP2000_MSF_TRAIN_FLOW_CONTROL IXP2000_MSF_REG(0x00a8) | ||
434 | #define IXP2000_MSF_TX_CALENDAR_0 IXP2000_MSF_REG(0x1000) | ||
435 | #define IXP2000_MSF_RX_PORT_CALENDAR_STATUS IXP2000_MSF_REG(0x1400) | ||
436 | |||
437 | |||
395 | #endif /* _IXP2000_H_ */ | 438 | #endif /* _IXP2000_H_ */ |
diff --git a/include/asm-arm/arch-ixp2000/memory.h b/include/asm-arm/arch-ixp2000/memory.h index d0f415c6dae9..21e1de51e3f6 100644 --- a/include/asm-arm/arch-ixp2000/memory.h +++ b/include/asm-arm/arch-ixp2000/memory.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_MEMORY_H | 13 | #ifndef __ASM_ARCH_MEMORY_H |
14 | #define __ASM_ARCH_MEMORY_H | 14 | #define __ASM_ARCH_MEMORY_H |
15 | 15 | ||
16 | #define PHYS_OFFSET (0x00000000UL) | 16 | #define PHYS_OFFSET UL(0x00000000) |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Virtual view <-> DMA view memory address translations | 19 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h index abdcf51bd283..a66317ab2071 100644 --- a/include/asm-arm/arch-ixp2000/platform.h +++ b/include/asm-arm/arch-ixp2000/platform.h | |||
@@ -15,40 +15,40 @@ | |||
15 | 15 | ||
16 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
17 | 17 | ||
18 | static inline unsigned long ixp2000_reg_read(volatile void *reg) | ||
19 | { | ||
20 | return *((volatile unsigned long *)reg); | ||
21 | } | ||
22 | |||
23 | static inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
24 | { | ||
25 | *((volatile unsigned long *)reg) = val; | ||
26 | } | ||
27 | |||
18 | /* | 28 | /* |
19 | * The IXP2400 B0 silicon contains an erratum (#66) that causes writes | 29 | * On the IXP2400, we can't use XCB=000 due to chip bugs. We use |
20 | * to on-chip I/O register to not complete fully. What this means is | 30 | * XCB=101 instead, but that makes all I/O accesses bufferable. This |
21 | * that if you have a write to on-chip I/O followed by a back-to-back | 31 | * is not a problem in general, but we do have to be slightly more |
22 | * read or write, the first write will happen twice. OR...if it's | 32 | * careful because I/O writes are no longer automatically flushed out |
23 | * not a back-to-back transaction, the read or write will generate | 33 | * of the write buffer. |
24 | * incorrect data. | ||
25 | * | ||
26 | * The official work around for this is to set the on-chip I/O regions | ||
27 | * as XCB=101 and then force a read-back from the register. | ||
28 | * | 34 | * |
35 | * In cases where we want to make sure that a write has been flushed | ||
36 | * out of the write buffer before we proceed, for example when masking | ||
37 | * a device interrupt before re-enabling IRQs in CPSR, we can use this | ||
38 | * function, ixp2000_reg_wrb, which performs a write, a readback, and | ||
39 | * issues a dummy instruction dependent on the value of the readback | ||
40 | * (mov rX, rX) to make sure that the readback has completed before we | ||
41 | * continue. | ||
29 | */ | 42 | */ |
30 | #if defined(CONFIG_ARCH_ENP2611) || defined(CONFIG_ARCH_IXDP2400) || defined(CONFIG_ARCH_IXDP2401) | 43 | static inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val) |
31 | |||
32 | #include <asm/system.h> /* Pickup local_irq_ functions */ | ||
33 | |||
34 | static inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
35 | { | 44 | { |
36 | unsigned long dummy; | 45 | unsigned long dummy; |
37 | unsigned long flags; | ||
38 | 46 | ||
39 | local_irq_save(flags); | ||
40 | *((volatile unsigned long *)reg) = val; | 47 | *((volatile unsigned long *)reg) = val; |
41 | barrier(); | 48 | |
42 | dummy = *((volatile unsigned long *)reg); | 49 | dummy = *((volatile unsigned long *)reg); |
43 | local_irq_restore(flags); | 50 | __asm__ __volatile__("mov %0, %0" : "+r" (dummy)); |
44 | } | ||
45 | #else | ||
46 | static inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
47 | { | ||
48 | *((volatile unsigned long *)reg) = val; | ||
49 | } | 51 | } |
50 | #endif /* IXDP2400 || IXDP2401 */ | ||
51 | #define ixp2000_reg_read(reg) (*((volatile unsigned long *)reg)) | ||
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Boards may multiplex different devices on the 2nd channel of | 54 | * Boards may multiplex different devices on the 2nd channel of |
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index e350dcb544e8..80d05ecad2f0 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h | |||
@@ -113,7 +113,7 @@ __ixp4xx_writeb(u8 value, u32 addr) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | static inline void | 115 | static inline void |
116 | __ixp4xx_writesb(u32 bus_addr, u8 *vaddr, int count) | 116 | __ixp4xx_writesb(u32 bus_addr, const u8 *vaddr, int count) |
117 | { | 117 | { |
118 | while (count--) | 118 | while (count--) |
119 | writeb(*vaddr++, bus_addr); | 119 | writeb(*vaddr++, bus_addr); |
@@ -136,7 +136,7 @@ __ixp4xx_writew(u16 value, u32 addr) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | static inline void | 138 | static inline void |
139 | __ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count) | 139 | __ixp4xx_writesw(u32 bus_addr, const u16 *vaddr, int count) |
140 | { | 140 | { |
141 | while (count--) | 141 | while (count--) |
142 | writew(*vaddr++, bus_addr); | 142 | writew(*vaddr++, bus_addr); |
@@ -154,7 +154,7 @@ __ixp4xx_writel(u32 value, u32 addr) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | static inline void | 156 | static inline void |
157 | __ixp4xx_writesl(u32 bus_addr, u32 *vaddr, int count) | 157 | __ixp4xx_writesl(u32 bus_addr, const u32 *vaddr, int count) |
158 | { | 158 | { |
159 | while (count--) | 159 | while (count--) |
160 | writel(*vaddr++, bus_addr); | 160 | writel(*vaddr++, bus_addr); |
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h index 004696a95bdb..2b149ed59149 100644 --- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h +++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | |||
@@ -36,11 +36,11 @@ | |||
36 | * | 36 | * |
37 | * 0x6000000 0x00004000 ioremap'd QMgr | 37 | * 0x6000000 0x00004000 ioremap'd QMgr |
38 | * | 38 | * |
39 | * 0xC0000000 0x00001000 0xffbfe000 PCI CFG | 39 | * 0xC0000000 0x00001000 0xffbff000 PCI CFG |
40 | * | 40 | * |
41 | * 0xC4000000 0x00001000 0xffbfd000 EXP CFG | 41 | * 0xC4000000 0x00001000 0xffbfe000 EXP CFG |
42 | * | 42 | * |
43 | * 0xC8000000 0x0000C000 0xffbf2000 On-Chip Peripherals | 43 | * 0xC8000000 0x00013000 0xffbeb000 On-Chip Peripherals |
44 | */ | 44 | */ |
45 | 45 | ||
46 | /* | 46 | /* |
@@ -52,22 +52,22 @@ | |||
52 | * Expansion BUS Configuration registers | 52 | * Expansion BUS Configuration registers |
53 | */ | 53 | */ |
54 | #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) | 54 | #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) |
55 | #define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFD000) | 55 | #define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFE000) |
56 | #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) | 56 | #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * PCI Config registers | 59 | * PCI Config registers |
60 | */ | 60 | */ |
61 | #define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) | 61 | #define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) |
62 | #define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFE000) | 62 | #define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFF000) |
63 | #define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) | 63 | #define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * Peripheral space | 66 | * Peripheral space |
67 | */ | 67 | */ |
68 | #define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) | 68 | #define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) |
69 | #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000) | 69 | #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBEB000) |
70 | #define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000) | 70 | #define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000) |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * Debug UART | 73 | * Debug UART |
@@ -115,25 +115,48 @@ | |||
115 | /* | 115 | /* |
116 | * Peripheral Space Register Region Base Addresses | 116 | * Peripheral Space Register Region Base Addresses |
117 | */ | 117 | */ |
118 | #define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000) | 118 | #define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000) |
119 | #define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000) | 119 | #define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000) |
120 | #define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000) | 120 | #define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000) |
121 | #define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000) | 121 | #define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000) |
122 | #define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000) | 122 | #define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000) |
123 | #define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000) | 123 | #define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000) |
124 | #define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000) | 124 | #define IXP4XX_NPEA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) |
125 | #define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000) | 125 | #define IXP4XX_NPEB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) |
126 | #define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000) | 126 | #define IXP4XX_NPEC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) |
127 | 127 | #define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000) | |
128 | #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) | 128 | #define IXP4XX_EthC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000) |
129 | #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) | 129 | #define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000) |
130 | #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) | 130 | /* ixp46X only */ |
131 | #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) | 131 | #define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xC000) |
132 | #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) | 132 | #define IXP4XX_EthB1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xD000) |
133 | #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) | 133 | #define IXP4XX_EthB2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xE000) |
134 | #define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) | 134 | #define IXP4XX_EthB3_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xF000) |
135 | #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) | 135 | #define IXP4XX_TIMESYNC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x10000) |
136 | #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) | 136 | #define IXP4XX_I2C_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x11000) |
137 | #define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000) | ||
138 | |||
139 | |||
140 | #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) | ||
141 | #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) | ||
142 | #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) | ||
143 | #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) | ||
144 | #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) | ||
145 | #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) | ||
146 | #define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) | ||
147 | #define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) | ||
148 | #define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) | ||
149 | #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) | ||
150 | #define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) | ||
151 | #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) | ||
152 | /* ixp46X only */ | ||
153 | #define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xC000) | ||
154 | #define IXP4XX_EthB1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xD000) | ||
155 | #define IXP4XX_EthB2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xE000) | ||
156 | #define IXP4XX_EthB3_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xF000) | ||
157 | #define IXP4XX_TIMESYNC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x10000) | ||
158 | #define IXP4XX_I2C_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x11000) | ||
159 | #define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000) | ||
137 | 160 | ||
138 | /* | 161 | /* |
139 | * Constants to make it easy to access Interrupt Controller registers | 162 | * Constants to make it easy to access Interrupt Controller registers |
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h index d348548b592b..e024d0a1a669 100644 --- a/include/asm-arm/arch-ixp4xx/memory.h +++ b/include/asm-arm/arch-ixp4xx/memory.h | |||
@@ -12,7 +12,7 @@ | |||
12 | /* | 12 | /* |
13 | * Physical DRAM offset. | 13 | * Physical DRAM offset. |
14 | */ | 14 | */ |
15 | #define PHYS_OFFSET (0x00000000UL) | 15 | #define PHYS_OFFSET UL(0x00000000) |
16 | 16 | ||
17 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
18 | 18 | ||
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h index fc012a39e2cb..cab8ad0adf09 100644 --- a/include/asm-arm/arch-l7200/io.h +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/arch/hardware.h> | 13 | #include <asm/hardware.h> |
14 | 14 | ||
15 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
16 | 16 | ||
diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h index c5b9608cb137..9e50a171f78a 100644 --- a/include/asm-arm/arch-l7200/memory.h +++ b/include/asm-arm/arch-l7200/memory.h | |||
@@ -15,7 +15,7 @@ | |||
15 | /* | 15 | /* |
16 | * Physical DRAM offset on the L7200 SDB. | 16 | * Physical DRAM offset on the L7200 SDB. |
17 | */ | 17 | */ |
18 | #define PHYS_OFFSET (0xf0000000UL) | 18 | #define PHYS_OFFSET UL(0xf0000000) |
19 | 19 | ||
20 | #define __virt_to_bus(x) __virt_to_phys(x) | 20 | #define __virt_to_bus(x) __virt_to_phys(x) |
21 | #define __bus_to_virt(x) __phys_to_virt(x) | 21 | #define __bus_to_virt(x) __phys_to_virt(x) |
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h index c13bdd9add92..bbcd4335f441 100644 --- a/include/asm-arm/arch-lh7a40x/io.h +++ b/include/asm-arm/arch-lh7a40x/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_IO_H | 11 | #ifndef __ASM_ARCH_IO_H |
12 | #define __ASM_ARCH_IO_H | 12 | #define __ASM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | /* No ISA or PCI bus on this machine. */ | 18 | /* No ISA or PCI bus on this machine. */ |
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h index c650e6feb9d5..c92bcb837629 100644 --- a/include/asm-arm/arch-lh7a40x/memory.h +++ b/include/asm-arm/arch-lh7a40x/memory.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* | 17 | /* |
18 | * Physical DRAM offset. | 18 | * Physical DRAM offset. |
19 | */ | 19 | */ |
20 | #define PHYS_OFFSET (0xc0000000UL) | 20 | #define PHYS_OFFSET UL(0xc0000000) |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Virtual view <-> DMA view memory address translations | 23 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index 11fbf629bf75..3d5bcd545082 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #ifndef __ASM_ARM_ARCH_IO_H | 34 | #ifndef __ASM_ARM_ARCH_IO_H |
35 | #define __ASM_ARM_ARCH_IO_H | 35 | #define __ASM_ARM_ARCH_IO_H |
36 | 36 | ||
37 | #include <asm/hardware.h> | ||
38 | |||
37 | #define IO_SPACE_LIMIT 0xffffffff | 39 | #define IO_SPACE_LIMIT 0xffffffff |
38 | 40 | ||
39 | /* | 41 | /* |
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h index ef32d61eec7a..bf545b6e0a26 100644 --- a/include/asm-arm/arch-omap/memory.h +++ b/include/asm-arm/arch-omap/memory.h | |||
@@ -37,9 +37,9 @@ | |||
37 | * Physical DRAM offset. | 37 | * Physical DRAM offset. |
38 | */ | 38 | */ |
39 | #if defined(CONFIG_ARCH_OMAP1) | 39 | #if defined(CONFIG_ARCH_OMAP1) |
40 | #define PHYS_OFFSET (0x10000000UL) | 40 | #define PHYS_OFFSET UL(0x10000000) |
41 | #elif defined(CONFIG_ARCH_OMAP2) | 41 | #elif defined(CONFIG_ARCH_OMAP2) |
42 | #define PHYS_OFFSET (0x80000000UL) | 42 | #define PHYS_OFFSET UL(0x80000000) |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | /* | 45 | /* |
@@ -66,7 +66,7 @@ | |||
66 | /* | 66 | /* |
67 | * OMAP-1510 Local Bus address offset | 67 | * OMAP-1510 Local Bus address offset |
68 | */ | 68 | */ |
69 | #define OMAP1510_LB_OFFSET (0x30000000UL) | 69 | #define OMAP1510_LB_OFFSET UL(0x30000000) |
70 | 70 | ||
71 | #define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) | 71 | #define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) |
72 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) | 72 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) |
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h index cf35721cfa45..3e70bd95472c 100644 --- a/include/asm-arm/arch-pxa/hardware.h +++ b/include/asm-arm/arch-pxa/hardware.h | |||
@@ -44,12 +44,12 @@ | |||
44 | 44 | ||
45 | #ifndef __ASSEMBLY__ | 45 | #ifndef __ASSEMBLY__ |
46 | 46 | ||
47 | # define __REG(x) (*((volatile unsigned long *)io_p2v(x))) | 47 | # define __REG(x) (*((volatile u32 *)io_p2v(x))) |
48 | 48 | ||
49 | /* With indexed regs we don't want to feed the index through io_p2v() | 49 | /* With indexed regs we don't want to feed the index through io_p2v() |
50 | especially if it is a variable, otherwise horrible code will result. */ | 50 | especially if it is a variable, otherwise horrible code will result. */ |
51 | # define __REG2(x,y) \ | 51 | # define __REG2(x,y) \ |
52 | (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) | 52 | (*(volatile u32 *)((u32)&__REG(x) + (y))) |
53 | 53 | ||
54 | # define __PREG(x) (io_v2p((u32)&(x))) | 54 | # define __PREG(x) (io_v2p((u32)&(x))) |
55 | 55 | ||
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h index c3bdbe44e21f..eb2dd58d397f 100644 --- a/include/asm-arm/arch-pxa/io.h +++ b/include/asm-arm/arch-pxa/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <asm/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h new file mode 100644 index 000000000000..748406f384c2 --- /dev/null +++ b/include/asm-arm/arch-pxa/irda.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef ASMARM_ARCH_IRDA_H | ||
2 | #define ASMARM_ARCH_IRDA_H | ||
3 | |||
4 | /* board specific transceiver capabilities */ | ||
5 | |||
6 | #define IR_OFF 1 | ||
7 | #define IR_SIRMODE 2 | ||
8 | #define IR_FIRMODE 4 | ||
9 | |||
10 | struct pxaficp_platform_data { | ||
11 | int transceiver_cap; | ||
12 | void (*transceiver_mode)(struct device *dev, int mode); | ||
13 | }; | ||
14 | |||
15 | extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h index 58bad9748b5c..eaf6d43939e9 100644 --- a/include/asm-arm/arch-pxa/memory.h +++ b/include/asm-arm/arch-pxa/memory.h | |||
@@ -15,7 +15,7 @@ | |||
15 | /* | 15 | /* |
16 | * Physical DRAM offset. | 16 | * Physical DRAM offset. |
17 | */ | 17 | */ |
18 | #define PHYS_OFFSET (0xa0000000UL) | 18 | #define PHYS_OFFSET UL(0xa0000000) |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Virtual view <-> DMA view memory address translations | 21 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 3af7165ab0d7..a75a2470f4f5 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -326,6 +326,25 @@ | |||
326 | #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ | 326 | #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ |
327 | #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ | 327 | #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ |
328 | 328 | ||
329 | /* Hardware UART (HWUART) */ | ||
330 | #define HWUART HWRBR | ||
331 | #define HWRBR __REG(0x41600000) /* Receive Buffer Register (read only) */ | ||
332 | #define HWTHR __REG(0x41600000) /* Transmit Holding Register (write only) */ | ||
333 | #define HWIER __REG(0x41600004) /* Interrupt Enable Register (read/write) */ | ||
334 | #define HWIIR __REG(0x41600008) /* Interrupt ID Register (read only) */ | ||
335 | #define HWFCR __REG(0x41600008) /* FIFO Control Register (write only) */ | ||
336 | #define HWLCR __REG(0x4160000C) /* Line Control Register (read/write) */ | ||
337 | #define HWMCR __REG(0x41600010) /* Modem Control Register (read/write) */ | ||
338 | #define HWLSR __REG(0x41600014) /* Line Status Register (read only) */ | ||
339 | #define HWMSR __REG(0x41600018) /* Modem Status Register (read only) */ | ||
340 | #define HWSPR __REG(0x4160001C) /* Scratch Pad Register (read/write) */ | ||
341 | #define HWISR __REG(0x41600020) /* Infrared Selection Register (read/write) */ | ||
342 | #define HWFOR __REG(0x41600024) /* Receive FIFO Occupancy Register (read only) */ | ||
343 | #define HWABR __REG(0x41600028) /* Auto-Baud Control Register (read/write) */ | ||
344 | #define HWACR __REG(0x4160002C) /* Auto-Baud Count Register (read only) */ | ||
345 | #define HWDLL __REG(0x41600000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ | ||
346 | #define HWDLH __REG(0x41600004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ | ||
347 | |||
329 | #define IER_DMAE (1 << 7) /* DMA Requests Enable */ | 348 | #define IER_DMAE (1 << 7) /* DMA Requests Enable */ |
330 | #define IER_UUE (1 << 6) /* UART Unit Enable */ | 349 | #define IER_UUE (1 << 6) /* UART Unit Enable */ |
331 | #define IER_NRZE (1 << 5) /* NRZ coding Enable */ | 350 | #define IER_NRZE (1 << 5) /* NRZ coding Enable */ |
@@ -1013,14 +1032,12 @@ | |||
1013 | #define ICCR0_LBM (1 << 1) /* Loopback mode */ | 1032 | #define ICCR0_LBM (1 << 1) /* Loopback mode */ |
1014 | #define ICCR0_ITR (1 << 0) /* IrDA transmission */ | 1033 | #define ICCR0_ITR (1 << 0) /* IrDA transmission */ |
1015 | 1034 | ||
1016 | #ifdef CONFIG_PXA27x | ||
1017 | #define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ | 1035 | #define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ |
1018 | #define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ | 1036 | #define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ |
1019 | #define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ | 1037 | #define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ |
1020 | #define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ | 1038 | #define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ |
1021 | #define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ | 1039 | #define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ |
1022 | #define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ | 1040 | #define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ |
1023 | #endif | ||
1024 | 1041 | ||
1025 | #ifdef CONFIG_PXA27x | 1042 | #ifdef CONFIG_PXA27x |
1026 | #define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ | 1043 | #define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ |
@@ -1250,9 +1267,13 @@ | |||
1250 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ | 1267 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ |
1251 | #define GPIO41_FFRTS 41 /* FFUART request to send */ | 1268 | #define GPIO41_FFRTS 41 /* FFUART request to send */ |
1252 | #define GPIO42_BTRXD 42 /* BTUART receive data */ | 1269 | #define GPIO42_BTRXD 42 /* BTUART receive data */ |
1270 | #define GPIO42_HWRXD 42 /* HWUART receive data */ | ||
1253 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ | 1271 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ |
1272 | #define GPIO43_HWTXD 43 /* HWUART transmit data */ | ||
1254 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ | 1273 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ |
1274 | #define GPIO44_HWCTS 44 /* HWUART clear to send */ | ||
1255 | #define GPIO45_BTRTS 45 /* BTUART request to send */ | 1275 | #define GPIO45_BTRTS 45 /* BTUART request to send */ |
1276 | #define GPIO45_HWRTS 45 /* HWUART request to send */ | ||
1256 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ | 1277 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ |
1257 | #define GPIO46_ICPRXD 46 /* ICP receive data */ | 1278 | #define GPIO46_ICPRXD 46 /* ICP receive data */ |
1258 | #define GPIO46_STRXD 46 /* STD_UART receive data */ | 1279 | #define GPIO46_STRXD 46 /* STD_UART receive data */ |
@@ -1378,17 +1399,26 @@ | |||
1378 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) | 1399 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) |
1379 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) | 1400 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) |
1380 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) | 1401 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) |
1402 | #define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN) | ||
1381 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) | 1403 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) |
1404 | #define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT) | ||
1382 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) | 1405 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) |
1406 | #define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN) | ||
1383 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) | 1407 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) |
1408 | #define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT) | ||
1384 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) | 1409 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) |
1385 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) | 1410 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) |
1386 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) | 1411 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) |
1387 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) | 1412 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) |
1388 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) | 1413 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) |
1389 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | 1414 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) |
1415 | #define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT) | ||
1416 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | ||
1417 | #define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN) | ||
1390 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) | 1418 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) |
1391 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) | 1419 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) |
1420 | #define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN) | ||
1421 | #define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT) | ||
1392 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) | 1422 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) |
1393 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) | 1423 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) |
1394 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) | 1424 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) |
@@ -1763,6 +1793,7 @@ | |||
1763 | #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ | 1793 | #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ |
1764 | #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ | 1794 | #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ |
1765 | #define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ | 1795 | #define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ |
1796 | #define CKEN4_HWUART (1 << 4) /* HWUART Unit Clock Enable */ | ||
1766 | #define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ | 1797 | #define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ |
1767 | #define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ | 1798 | #define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ |
1768 | #define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ | 1799 | #define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ |
@@ -2282,4 +2313,11 @@ | |||
2282 | 2313 | ||
2283 | #endif | 2314 | #endif |
2284 | 2315 | ||
2316 | /* PWRMODE register M field values */ | ||
2317 | |||
2318 | #define PWRMODE_IDLE 0x1 | ||
2319 | #define PWRMODE_STANDBY 0x2 | ||
2320 | #define PWRMODE_SLEEP 0x3 | ||
2321 | #define PWRMODE_DEEPSLEEP 0x7 | ||
2322 | |||
2285 | #endif | 2323 | #endif |
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h index 4428d3eb7432..fe38090444e0 100644 --- a/include/asm-arm/arch-pxa/uncompress.h +++ b/include/asm-arm/arch-pxa/uncompress.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define FFUART ((volatile unsigned long *)0x40100000) | 12 | #define FFUART ((volatile unsigned long *)0x40100000) |
13 | #define BTUART ((volatile unsigned long *)0x40200000) | 13 | #define BTUART ((volatile unsigned long *)0x40200000) |
14 | #define STUART ((volatile unsigned long *)0x40700000) | 14 | #define STUART ((volatile unsigned long *)0x40700000) |
15 | #define HWUART ((volatile unsigned long *)0x41600000) | ||
15 | 16 | ||
16 | #define UART FFUART | 17 | #define UART FFUART |
17 | 18 | ||
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h index 24453c405a87..b4da08d7a336 100644 --- a/include/asm-arm/arch-rpc/io.h +++ b/include/asm-arm/arch-rpc/io.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __ASM_ARM_ARCH_IO_H | 13 | #ifndef __ASM_ARM_ARCH_IO_H |
14 | #define __ASM_ARM_ARCH_IO_H | 14 | #define __ASM_ARM_ARCH_IO_H |
15 | 15 | ||
16 | #include <asm/hardware.h> | ||
17 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | 18 | #define IO_SPACE_LIMIT 0xffffffff |
17 | 19 | ||
18 | /* | 20 | /* |
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h index 33fc75cdead0..0592cb3f0c74 100644 --- a/include/asm-arm/arch-rpc/memory.h +++ b/include/asm-arm/arch-rpc/memory.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /* | 21 | /* |
22 | * Physical DRAM offset. | 22 | * Physical DRAM offset. |
23 | */ | 23 | */ |
24 | #define PHYS_OFFSET (0x10000000UL) | 24 | #define PHYS_OFFSET UL(0x10000000) |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * These are exactly the same on the RiscPC as the | 27 | * These are exactly the same on the RiscPC as the |
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h index ac57bc887d82..4790491ba9d0 100644 --- a/include/asm-arm/arch-s3c2410/fb.h +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -13,6 +13,7 @@ | |||
13 | * 07-Sep-2004 RTP Created file | 13 | * 07-Sep-2004 RTP Created file |
14 | * 03-Nov-2004 BJD Updated and minor cleanups | 14 | * 03-Nov-2004 BJD Updated and minor cleanups |
15 | * 03-Aug-2005 RTP Renamed to fb.h | 15 | * 03-Aug-2005 RTP Renamed to fb.h |
16 | * 26-Oct-2005 BJD Changed name of platdata init | ||
16 | */ | 17 | */ |
17 | 18 | ||
18 | #ifndef __ASM_ARM_FB_H | 19 | #ifndef __ASM_ARM_FB_H |
@@ -64,6 +65,6 @@ struct s3c2410fb_mach_info { | |||
64 | unsigned long lpcsel; | 65 | unsigned long lpcsel; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info); | 68 | extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *); |
68 | 69 | ||
69 | #endif /* __ASM_ARM_FB_H */ | 70 | #endif /* __ASM_ARM_FB_H */ |
diff --git a/include/asm-arm/arch-s3c2410/io.h b/include/asm-arm/arch-s3c2410/io.h index 4bf272ed9add..16fbc8afffd9 100644 --- a/include/asm-arm/arch-s3c2410/io.h +++ b/include/asm-arm/arch-s3c2410/io.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __ASM_ARM_ARCH_IO_H | 15 | #ifndef __ASM_ARM_ARCH_IO_H |
16 | #define __ASM_ARM_ARCH_IO_H | 16 | #define __ASM_ARM_ARCH_IO_H |
17 | 17 | ||
18 | #include <asm/hardware.h> | ||
19 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | 20 | #define IO_SPACE_LIMIT 0xffffffff |
19 | 21 | ||
20 | /* | 22 | /* |
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h index 3380ab1d0749..6ab834a14c8e 100644 --- a/include/asm-arm/arch-s3c2410/memory.h +++ b/include/asm-arm/arch-s3c2410/memory.h | |||
@@ -28,9 +28,9 @@ | |||
28 | * and at 0x0C000000 for S3C2400 | 28 | * and at 0x0C000000 for S3C2400 |
29 | */ | 29 | */ |
30 | #ifdef CONFIG_CPU_S3C2400 | 30 | #ifdef CONFIG_CPU_S3C2400 |
31 | #define PHYS_OFFSET (0x0C000000UL) | 31 | #define PHYS_OFFSET UL(0x0C000000) |
32 | #else | 32 | #else |
33 | #define PHYS_OFFSET (0x30000000UL) | 33 | #define PHYS_OFFSET UL(0x30000000) |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | /* | 36 | /* |
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h index 16f4c3cc1388..34360706e016 100644 --- a/include/asm-arm/arch-s3c2410/regs-clock.h +++ b/include/asm-arm/arch-s3c2410/regs-clock.h | |||
@@ -18,7 +18,9 @@ | |||
18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) | 18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) |
19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA | 19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA |
20 | * 27-Aug-2005 Ben Dooks Add clock-slow info | 20 | * 27-Aug-2005 Ben Dooks Add clock-slow info |
21 | */ | 21 | * 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat) |
22 | * 20-Oct-2005 Ben Dooks Add masks for DCLK (Guillaume Gourat) | ||
23 | */ | ||
22 | 24 | ||
23 | #ifndef __ASM_ARM_REGS_CLOCK | 25 | #ifndef __ASM_ARM_REGS_CLOCK |
24 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" | 26 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" |
@@ -66,11 +68,16 @@ | |||
66 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) | 68 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) |
67 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) | 69 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) |
68 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) | 70 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) |
71 | #define S3C2410_DCLKCON_DCLK0_DIV_MASK ((0xf)<<4) | ||
72 | #define S3C2410_DCLKCON_DCLK0_CMP_MASK ((0xf)<<8) | ||
69 | 73 | ||
70 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) | 74 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) |
71 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) | 75 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) |
72 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) | 76 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) |
73 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) | 77 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) |
78 | #define S3C2410_DCLKCON_DCLK1_CMP(x) (((x) - 1) <<24) | ||
79 | #define S3C2410_DCLKCON_DCLK1_DIV_MASK ((0xf) <<20) | ||
80 | #define S3C2410_DCLKCON_DCLK1_CMP_MASK ((0xf) <<24) | ||
74 | 81 | ||
75 | #define S3C2410_CLKDIVN_PDIVN (1<<0) | 82 | #define S3C2410_CLKDIVN_PDIVN (1<<0) |
76 | #define S3C2410_CLKDIVN_HDIVN (1<<1) | 83 | #define S3C2410_CLKDIVN_HDIVN (1<<1) |
@@ -83,10 +90,13 @@ | |||
83 | 90 | ||
84 | #ifndef __ASSEMBLY__ | 91 | #ifndef __ASSEMBLY__ |
85 | 92 | ||
93 | #include <asm/div64.h> | ||
94 | |||
86 | static inline unsigned int | 95 | static inline unsigned int |
87 | s3c2410_get_pll(int pllval, int baseclk) | 96 | s3c2410_get_pll(unsigned int pllval, unsigned int baseclk) |
88 | { | 97 | { |
89 | int mdiv, pdiv, sdiv; | 98 | unsigned int mdiv, pdiv, sdiv; |
99 | uint64_t fvco; | ||
90 | 100 | ||
91 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; | 101 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; |
92 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; | 102 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; |
@@ -96,7 +106,10 @@ s3c2410_get_pll(int pllval, int baseclk) | |||
96 | pdiv &= S3C2410_PLLCON_PDIVMASK; | 106 | pdiv &= S3C2410_PLLCON_PDIVMASK; |
97 | sdiv &= S3C2410_PLLCON_SDIVMASK; | 107 | sdiv &= S3C2410_PLLCON_SDIVMASK; |
98 | 108 | ||
99 | return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv); | 109 | fvco = (uint64_t)baseclk * (mdiv + 8); |
110 | do_div(fvco, (pdiv + 2) << sdiv); | ||
111 | |||
112 | return (unsigned int)fvco; | ||
100 | } | 113 | } |
101 | 114 | ||
102 | #endif /* __ASSEMBLY__ */ | 115 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index 2053cbacffc3..cb33d57c146c 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h | |||
@@ -20,6 +20,7 @@ | |||
20 | * 18-11-2004 BJD Added S3C2440 AC97 controls | 20 | * 18-11-2004 BJD Added S3C2440 AC97 controls |
21 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 21 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
22 | * 28-Mar-2005 LCVR Fixed definition of GPB10 | 22 | * 28-Mar-2005 LCVR Fixed definition of GPB10 |
23 | * 26-Oct-2005 BJD Added generic configuration types | ||
23 | */ | 24 | */ |
24 | 25 | ||
25 | 26 | ||
@@ -43,6 +44,11 @@ | |||
43 | /* general configuration options */ | 44 | /* general configuration options */ |
44 | 45 | ||
45 | #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) | 46 | #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) |
47 | #define S3C2410_GPIO_INPUT (0xFFFFFFF0) | ||
48 | #define S3C2410_GPIO_OUTPUT (0xFFFFFFF1) | ||
49 | #define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */ | ||
50 | #define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ | ||
51 | #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ | ||
46 | 52 | ||
47 | /* configure GPIO ports A..G */ | 53 | /* configure GPIO ports A..G */ |
48 | 54 | ||
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 19c3b1e186bb..28711aaa4968 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h | |||
@@ -22,13 +22,6 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for | ||
26 | * in*()/out*() macros to be usable for all cases. | ||
27 | */ | ||
28 | #define PCIO_BASE 0 | ||
29 | |||
30 | |||
31 | /* | ||
32 | * SA1100 internal I/O mappings | 25 | * SA1100 internal I/O mappings |
33 | * | 26 | * |
34 | * We have the following mapping: | 27 | * We have the following mapping: |
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h index 7d969ffbd3bb..9d4fe6cf205b 100644 --- a/include/asm-arm/arch-sa1100/io.h +++ b/include/asm-arm/arch-sa1100/io.h | |||
@@ -10,13 +10,19 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/hardware.h> | ||
14 | |||
13 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
14 | 16 | ||
15 | /* | 17 | /* |
16 | * We don't actually have real ISA nor PCI buses, but there is so many | 18 | * We don't actually have real ISA nor PCI buses, but there is so many |
17 | * drivers out there that might just work if we fake them... | 19 | * drivers out there that might just work if we fake them... |
18 | */ | 20 | */ |
19 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 21 | static inline void __iomem *__io(unsigned long addr) |
22 | { | ||
23 | return (void __iomem *)addr; | ||
24 | } | ||
25 | #define __io(a) __io(a) | ||
20 | #define __mem_pci(a) (a) | 26 | #define __mem_pci(a) (a) |
21 | #define __mem_isa(a) (a) | 27 | #define __mem_isa(a) (a) |
22 | 28 | ||
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 8743ff5c1b23..0fc555b4c912 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h | |||
@@ -13,7 +13,7 @@ | |||
13 | /* | 13 | /* |
14 | * Physical DRAM offset is 0xc0000000 on the SA1100 | 14 | * Physical DRAM offset is 0xc0000000 on the SA1100 |
15 | */ | 15 | */ |
16 | #define PHYS_OFFSET (0xc0000000UL) | 16 | #define PHYS_OFFSET UL(0xc0000000) |
17 | 17 | ||
18 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
19 | 19 | ||
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h index 6f52118ba1a4..0f0612f79b2b 100644 --- a/include/asm-arm/arch-sa1100/system.h +++ b/include/asm-arm/arch-sa1100/system.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> | 4 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> |
5 | */ | 5 | */ |
6 | #include <linux/config.h> | 6 | #include <linux/config.h> |
7 | #include <asm/hardware.h> | ||
7 | 8 | ||
8 | static inline void arch_idle(void) | 9 | static inline void arch_idle(void) |
9 | { | 10 | { |
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h index 5e6ed0038b2b..87ffa27f2962 100644 --- a/include/asm-arm/arch-shark/io.h +++ b/include/asm-arm/arch-shark/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __ASM_ARM_ARCH_IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __ASM_ARM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | /* | 18 | /* |
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h index 8ff956d25463..95a29b4bc5d0 100644 --- a/include/asm-arm/arch-shark/memory.h +++ b/include/asm-arm/arch-shark/memory.h | |||
@@ -15,7 +15,7 @@ | |||
15 | /* | 15 | /* |
16 | * Physical DRAM offset. | 16 | * Physical DRAM offset. |
17 | */ | 17 | */ |
18 | #define PHYS_OFFSET (0x08000000UL) | 18 | #define PHYS_OFFSET UL(0x08000000) |
19 | 19 | ||
20 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
21 | 21 | ||
diff --git a/include/asm-arm/arch-versatile/memory.h b/include/asm-arm/arch-versatile/memory.h index 7b8b7cc422fa..a9370976cc5e 100644 --- a/include/asm-arm/arch-versatile/memory.h +++ b/include/asm-arm/arch-versatile/memory.h | |||
@@ -23,7 +23,7 @@ | |||
23 | /* | 23 | /* |
24 | * Physical DRAM offset. | 24 | * Physical DRAM offset. |
25 | */ | 25 | */ |
26 | #define PHYS_OFFSET (0x00000000UL) | 26 | #define PHYS_OFFSET UL(0x00000000) |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Virtual view <-> DMA view memory address translations | 29 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index aad7aad026b3..e007dd990da5 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h | |||
@@ -347,7 +347,6 @@ static inline unsigned long __ffs(unsigned long word) | |||
347 | * the clz instruction for much better code efficiency. | 347 | * the clz instruction for much better code efficiency. |
348 | */ | 348 | */ |
349 | 349 | ||
350 | static __inline__ int generic_fls(int x); | ||
351 | #define fls(x) \ | 350 | #define fls(x) \ |
352 | ( __builtin_constant_p(x) ? generic_fls(x) : \ | 351 | ( __builtin_constant_p(x) ? generic_fls(x) : \ |
353 | ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) | 352 | ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) |
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index d62ade4e4cbb..e3e8541ee63b 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h | |||
@@ -70,7 +70,7 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) | |||
70 | * device-viewed address. | 70 | * device-viewed address. |
71 | */ | 71 | */ |
72 | extern void * | 72 | extern void * |
73 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp); | 73 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp); |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * dma_free_coherent - free memory allocated by dma_alloc_coherent | 76 | * dma_free_coherent - free memory allocated by dma_alloc_coherent |
@@ -117,7 +117,7 @@ int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, | |||
117 | * device-viewed address. | 117 | * device-viewed address. |
118 | */ | 118 | */ |
119 | extern void * | 119 | extern void * |
120 | dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int gfp); | 120 | dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp); |
121 | 121 | ||
122 | #define dma_free_writecombine(dev,size,cpu_addr,handle) \ | 122 | #define dma_free_writecombine(dev,size,cpu_addr,handle) \ |
123 | dma_free_coherent(dev,size,cpu_addr,handle) | 123 | dma_free_coherent(dev,size,cpu_addr,handle) |
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 5c4ae8f5dbb0..2e6799632f12 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
28 | #include <asm/memory.h> | 28 | #include <asm/memory.h> |
29 | #include <asm/arch/hardware.h> | ||
30 | 29 | ||
31 | /* | 30 | /* |
32 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 31 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h index 4fa95084a8c0..eb262e078c46 100644 --- a/include/asm-arm/mach/arch.h +++ b/include/asm-arm/mach/arch.h | |||
@@ -48,10 +48,11 @@ struct machine_desc { | |||
48 | * Set of macros to define architecture features. This is built into | 48 | * Set of macros to define architecture features. This is built into |
49 | * a table by the linker. | 49 | * a table by the linker. |
50 | */ | 50 | */ |
51 | #define MACHINE_START(_type,_name) \ | 51 | #define MACHINE_START(_type,_name) \ |
52 | const struct machine_desc __mach_desc_##_type \ | 52 | static const struct machine_desc __mach_desc_##_type \ |
53 | __attribute_used__ \ | ||
53 | __attribute__((__section__(".arch.info.init"))) = { \ | 54 | __attribute__((__section__(".arch.info.init"))) = { \ |
54 | .nr = MACH_TYPE_##_type, \ | 55 | .nr = MACH_TYPE_##_type, \ |
55 | .name = _name, | 56 | .name = _name, |
56 | 57 | ||
57 | #define MACHINE_END \ | 58 | #define MACHINE_END \ |
diff --git a/include/asm-arm/mach/flash.h b/include/asm-arm/mach/flash.h index a92887d4b2cb..cd57436d9874 100644 --- a/include/asm-arm/mach/flash.h +++ b/include/asm-arm/mach/flash.h | |||
@@ -14,6 +14,7 @@ struct mtd_partition; | |||
14 | 14 | ||
15 | /* | 15 | /* |
16 | * map_name: the map probe function name | 16 | * map_name: the map probe function name |
17 | * name: flash device name (eg, as used with mtdparts=) | ||
17 | * width: width of mapped device | 18 | * width: width of mapped device |
18 | * init: method called at driver/device initialisation | 19 | * init: method called at driver/device initialisation |
19 | * exit: method called at driver/device removal | 20 | * exit: method called at driver/device removal |
@@ -23,6 +24,7 @@ struct mtd_partition; | |||
23 | */ | 24 | */ |
24 | struct flash_platform_data { | 25 | struct flash_platform_data { |
25 | const char *map_name; | 26 | const char *map_name; |
27 | const char *name; | ||
26 | unsigned int width; | 28 | unsigned int width; |
27 | int (*init)(void); | 29 | int (*init)(void); |
28 | void (*exit)(void); | 30 | void (*exit)(void); |
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h index 9ac47cf8d2e4..b338936bde4f 100644 --- a/include/asm-arm/mach/map.h +++ b/include/asm-arm/mach/map.h | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | struct map_desc { | 12 | struct map_desc { |
13 | unsigned long virtual; | 13 | unsigned long virtual; |
14 | unsigned long physical; | 14 | unsigned long pfn; |
15 | unsigned long length; | 15 | unsigned long length; |
16 | unsigned int type; | 16 | unsigned int type; |
17 | }; | 17 | }; |
@@ -27,6 +27,9 @@ struct meminfo; | |||
27 | #define MT_ROM 6 | 27 | #define MT_ROM 6 |
28 | #define MT_IXP2000_DEVICE 7 | 28 | #define MT_IXP2000_DEVICE 7 |
29 | 29 | ||
30 | #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) | ||
31 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) | ||
32 | |||
30 | extern void create_memmap_holes(struct meminfo *); | 33 | extern void create_memmap_holes(struct meminfo *); |
31 | extern void memtable_init(struct meminfo *); | 34 | extern void memtable_init(struct meminfo *); |
32 | extern void iotable_init(struct map_desc *, int); | 35 | extern void iotable_init(struct map_desc *, int); |
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index a8a933a775db..a547ee598c6c 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h | |||
@@ -12,6 +12,16 @@ | |||
12 | #ifndef __ASM_ARM_MEMORY_H | 12 | #ifndef __ASM_ARM_MEMORY_H |
13 | #define __ASM_ARM_MEMORY_H | 13 | #define __ASM_ARM_MEMORY_H |
14 | 14 | ||
15 | /* | ||
16 | * Allow for constants defined here to be used from assembly code | ||
17 | * by prepending the UL suffix only with actual C code compilation. | ||
18 | */ | ||
19 | #ifndef __ASSEMBLY__ | ||
20 | #define UL(x) (x##UL) | ||
21 | #else | ||
22 | #define UL(x) (x) | ||
23 | #endif | ||
24 | |||
15 | #include <linux/config.h> | 25 | #include <linux/config.h> |
16 | #include <linux/compiler.h> | 26 | #include <linux/compiler.h> |
17 | #include <asm/arch/memory.h> | 27 | #include <asm/arch/memory.h> |
@@ -21,20 +31,20 @@ | |||
21 | * TASK_SIZE - the maximum size of a user space task. | 31 | * TASK_SIZE - the maximum size of a user space task. |
22 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area | 32 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area |
23 | */ | 33 | */ |
24 | #define TASK_SIZE (0xbf000000UL) | 34 | #define TASK_SIZE UL(0xbf000000) |
25 | #define TASK_UNMAPPED_BASE (0x40000000UL) | 35 | #define TASK_UNMAPPED_BASE UL(0x40000000) |
26 | #endif | 36 | #endif |
27 | 37 | ||
28 | /* | 38 | /* |
29 | * The maximum size of a 26-bit user space task. | 39 | * The maximum size of a 26-bit user space task. |
30 | */ | 40 | */ |
31 | #define TASK_SIZE_26 (0x04000000UL) | 41 | #define TASK_SIZE_26 UL(0x04000000) |
32 | 42 | ||
33 | /* | 43 | /* |
34 | * Page offset: 3GB | 44 | * Page offset: 3GB |
35 | */ | 45 | */ |
36 | #ifndef PAGE_OFFSET | 46 | #ifndef PAGE_OFFSET |
37 | #define PAGE_OFFSET (0xc0000000UL) | 47 | #define PAGE_OFFSET UL(0xc0000000) |
38 | #endif | 48 | #endif |
39 | 49 | ||
40 | /* | 50 | /* |
@@ -58,6 +68,13 @@ | |||
58 | #error Top of user space clashes with start of module space | 68 | #error Top of user space clashes with start of module space |
59 | #endif | 69 | #endif |
60 | 70 | ||
71 | /* | ||
72 | * The XIP kernel gets mapped at the bottom of the module vm area. | ||
73 | * Since we use sections to map it, this macro replaces the physical address | ||
74 | * with its virtual address while keeping offset from the base section. | ||
75 | */ | ||
76 | #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) | ||
77 | |||
61 | #ifndef __ASSEMBLY__ | 78 | #ifndef __ASSEMBLY__ |
62 | 79 | ||
63 | /* | 80 | /* |
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 366bafbdfbb1..5a0d19b466b0 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -397,9 +397,6 @@ static inline pte_t *pmd_page_kernel(pmd_t pmd) | |||
397 | #define pgd_clear(pgdp) do { } while (0) | 397 | #define pgd_clear(pgdp) do { } while (0) |
398 | #define set_pgd(pgd,pgdp) do { } while (0) | 398 | #define set_pgd(pgd,pgdp) do { } while (0) |
399 | 399 | ||
400 | #define page_pte_prot(page,prot) mk_pte(page, prot) | ||
401 | #define page_pte(page) mk_pte(page, __pgprot(0)) | ||
402 | |||
403 | /* to find an entry in a page-table-directory */ | 400 | /* to find an entry in a page-table-directory */ |
404 | #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) | 401 | #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) |
405 | 402 | ||
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h index 60f33e6eb800..71ca7d412687 100644 --- a/include/asm-arm/semaphore.h +++ b/include/asm-arm/semaphore.h | |||
@@ -24,8 +24,6 @@ struct semaphore { | |||
24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ | 24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ |
25 | } | 25 | } |
26 | 26 | ||
27 | #define __MUTEX_INITIALIZER(name) __SEMAPHORE_INIT(name,1) | ||
28 | |||
29 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 27 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
30 | struct semaphore name = __SEMAPHORE_INIT(name,count) | 28 | struct semaphore name = __SEMAPHORE_INIT(name,count) |
31 | 29 | ||
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h index 9bb325c54645..f49bfb78c221 100644 --- a/include/asm-arm/tlb.h +++ b/include/asm-arm/tlb.h | |||
@@ -27,11 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | struct mmu_gather { | 28 | struct mmu_gather { |
29 | struct mm_struct *mm; | 29 | struct mm_struct *mm; |
30 | unsigned int freed; | ||
31 | unsigned int fullmm; | 30 | unsigned int fullmm; |
32 | |||
33 | unsigned int flushes; | ||
34 | unsigned int avoided_flushes; | ||
35 | }; | 31 | }; |
36 | 32 | ||
37 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | 33 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); |
@@ -39,11 +35,9 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | |||
39 | static inline struct mmu_gather * | 35 | static inline struct mmu_gather * |
40 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 36 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) |
41 | { | 37 | { |
42 | int cpu = smp_processor_id(); | 38 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); |
43 | struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu); | ||
44 | 39 | ||
45 | tlb->mm = mm; | 40 | tlb->mm = mm; |
46 | tlb->freed = 0; | ||
47 | tlb->fullmm = full_mm_flush; | 41 | tlb->fullmm = full_mm_flush; |
48 | 42 | ||
49 | return tlb; | 43 | return tlb; |
@@ -52,24 +46,13 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | |||
52 | static inline void | 46 | static inline void |
53 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | 47 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) |
54 | { | 48 | { |
55 | struct mm_struct *mm = tlb->mm; | ||
56 | unsigned long freed = tlb->freed; | ||
57 | int rss = get_mm_counter(mm, rss); | ||
58 | |||
59 | if (rss < freed) | ||
60 | freed = rss; | ||
61 | add_mm_counter(mm, rss, -freed); | ||
62 | |||
63 | if (tlb->fullmm) | 49 | if (tlb->fullmm) |
64 | flush_tlb_mm(mm); | 50 | flush_tlb_mm(tlb->mm); |
65 | 51 | ||
66 | /* keep the page table cache within bounds */ | 52 | /* keep the page table cache within bounds */ |
67 | check_pgt_cache(); | 53 | check_pgt_cache(); |
68 | } | ||
69 | 54 | ||
70 | static inline unsigned int tlb_is_full_mm(struct mmu_gather *tlb) | 55 | put_cpu_var(mmu_gathers); |
71 | { | ||
72 | return tlb->fullmm; | ||
73 | } | 56 | } |
74 | 57 | ||
75 | #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) | 58 | #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) |
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index c49df635a80f..d626e70faded 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -544,7 +544,6 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
544 | asmlinkage int sys_fork(struct pt_regs *regs); | 544 | asmlinkage int sys_fork(struct pt_regs *regs); |
545 | asmlinkage int sys_vfork(struct pt_regs *regs); | 545 | asmlinkage int sys_vfork(struct pt_regs *regs); |
546 | asmlinkage int sys_pipe(unsigned long *fildes); | 546 | asmlinkage int sys_pipe(unsigned long *fildes); |
547 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
548 | struct sigaction; | 547 | struct sigaction; |
549 | asmlinkage long sys_rt_sigaction(int sig, | 548 | asmlinkage long sys_rt_sigaction(int sig, |
550 | const struct sigaction __user *act, | 549 | const struct sigaction __user *act, |
diff --git a/include/asm-arm26/pgtable.h b/include/asm-arm26/pgtable.h index f602cf572411..a590250277f8 100644 --- a/include/asm-arm26/pgtable.h +++ b/include/asm-arm26/pgtable.h | |||
@@ -98,8 +98,6 @@ extern struct page *empty_zero_page; | |||
98 | #define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) | 98 | #define pfn_pte(pfn,prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) |
99 | #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) | 99 | #define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) |
100 | #define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot) | 100 | #define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot) |
101 | #define page_pte_prot(page,prot) mk_pte(page, prot) | ||
102 | #define page_pte(page) mk_pte(page, __pgprot(0)) | ||
103 | 101 | ||
104 | /* | 102 | /* |
105 | * Terminology: PGD = Page Directory, PMD = Page Middle Directory, | 103 | * Terminology: PGD = Page Directory, PMD = Page Middle Directory, |
diff --git a/include/asm-arm26/semaphore.h b/include/asm-arm26/semaphore.h index c1b6a1edad92..ccf15e704109 100644 --- a/include/asm-arm26/semaphore.h +++ b/include/asm-arm26/semaphore.h | |||
@@ -25,9 +25,6 @@ struct semaphore { | |||
25 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ | 25 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ |
26 | } | 26 | } |
27 | 27 | ||
28 | #define __MUTEX_INITIALIZER(name) \ | ||
29 | __SEMAPHORE_INIT(name,1) | ||
30 | |||
31 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 28 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
32 | struct semaphore name = __SEMAPHORE_INIT(name,count) | 29 | struct semaphore name = __SEMAPHORE_INIT(name,count) |
33 | 30 | ||
diff --git a/include/asm-arm26/tlb.h b/include/asm-arm26/tlb.h index 1316352a58f3..08ddd85b8d35 100644 --- a/include/asm-arm26/tlb.h +++ b/include/asm-arm26/tlb.h | |||
@@ -10,24 +10,20 @@ | |||
10 | */ | 10 | */ |
11 | struct mmu_gather { | 11 | struct mmu_gather { |
12 | struct mm_struct *mm; | 12 | struct mm_struct *mm; |
13 | unsigned int freed; | 13 | unsigned int need_flush; |
14 | unsigned int fullmm; | 14 | unsigned int fullmm; |
15 | |||
16 | unsigned int flushes; | ||
17 | unsigned int avoided_flushes; | ||
18 | }; | 15 | }; |
19 | 16 | ||
20 | extern struct mmu_gather mmu_gathers[NR_CPUS]; | 17 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); |
21 | 18 | ||
22 | static inline struct mmu_gather * | 19 | static inline struct mmu_gather * |
23 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 20 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) |
24 | { | 21 | { |
25 | int cpu = smp_processor_id(); | 22 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); |
26 | struct mmu_gather *tlb = &mmu_gathers[cpu]; | ||
27 | 23 | ||
28 | tlb->mm = mm; | 24 | tlb->mm = mm; |
29 | tlb->freed = 0; | 25 | tlb->need_flush = 0; |
30 | tlb->fullmm = full_mm_flush; | 26 | tlb->fullmm = full_mm_flush; |
31 | 27 | ||
32 | return tlb; | 28 | return tlb; |
33 | } | 29 | } |
@@ -35,30 +31,13 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | |||
35 | static inline void | 31 | static inline void |
36 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | 32 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) |
37 | { | 33 | { |
38 | struct mm_struct *mm = tlb->mm; | 34 | if (tlb->need_flush) |
39 | unsigned long freed = tlb->freed; | 35 | flush_tlb_mm(tlb->mm); |
40 | int rss = get_mm_counter(mm, rss); | ||
41 | |||
42 | if (rss < freed) | ||
43 | freed = rss; | ||
44 | add_mm_counter(mm, rss, -freed); | ||
45 | |||
46 | if (freed) { | ||
47 | flush_tlb_mm(mm); | ||
48 | tlb->flushes++; | ||
49 | } else { | ||
50 | tlb->avoided_flushes++; | ||
51 | } | ||
52 | 36 | ||
53 | /* keep the page table cache within bounds */ | 37 | /* keep the page table cache within bounds */ |
54 | check_pgt_cache(); | 38 | check_pgt_cache(); |
55 | } | ||
56 | |||
57 | 39 | ||
58 | static inline unsigned int | 40 | put_cpu_var(mmu_gathers); |
59 | tlb_is_full_mm(struct mmu_gather *tlb) | ||
60 | { | ||
61 | return tlb->fullmm; | ||
62 | } | 41 | } |
63 | 42 | ||
64 | #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) | 43 | #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) |
@@ -71,7 +50,13 @@ tlb_is_full_mm(struct mmu_gather *tlb) | |||
71 | } while (0) | 50 | } while (0) |
72 | #define tlb_end_vma(tlb,vma) do { } while (0) | 51 | #define tlb_end_vma(tlb,vma) do { } while (0) |
73 | 52 | ||
74 | #define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) | 53 | static inline void |
54 | tlb_remove_page(struct mmu_gather *tlb, struct page *page) | ||
55 | { | ||
56 | tlb->need_flush = 1; | ||
57 | free_page_and_swap_cache(page); | ||
58 | } | ||
59 | |||
75 | #define pte_free_tlb(tlb,ptep) pte_free(ptep) | 60 | #define pte_free_tlb(tlb,ptep) pte_free(ptep) |
76 | #define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) | 61 | #define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) |
77 | 62 | ||
diff --git a/include/asm-arm26/unistd.h b/include/asm-arm26/unistd.h index dfa0b0c30aa3..be4c2fb9c049 100644 --- a/include/asm-arm26/unistd.h +++ b/include/asm-arm26/unistd.h | |||
@@ -480,7 +480,6 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
480 | asmlinkage int sys_fork(struct pt_regs *regs); | 480 | asmlinkage int sys_fork(struct pt_regs *regs); |
481 | asmlinkage int sys_vfork(struct pt_regs *regs); | 481 | asmlinkage int sys_vfork(struct pt_regs *regs); |
482 | asmlinkage int sys_pipe(unsigned long *fildes); | 482 | asmlinkage int sys_pipe(unsigned long *fildes); |
483 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
484 | struct sigaction; | 483 | struct sigaction; |
485 | asmlinkage long sys_rt_sigaction(int sig, | 484 | asmlinkage long sys_rt_sigaction(int sig, |
486 | const struct sigaction __user *act, | 485 | const struct sigaction __user *act, |
diff --git a/include/asm-cris/dma-mapping.h b/include/asm-cris/dma-mapping.h index 0b5c3fdaefe1..8eff51349ae7 100644 --- a/include/asm-cris/dma-mapping.h +++ b/include/asm-cris/dma-mapping.h | |||
@@ -15,14 +15,14 @@ | |||
15 | 15 | ||
16 | #ifdef CONFIG_PCI | 16 | #ifdef CONFIG_PCI |
17 | void *dma_alloc_coherent(struct device *dev, size_t size, | 17 | void *dma_alloc_coherent(struct device *dev, size_t size, |
18 | dma_addr_t *dma_handle, int flag); | 18 | dma_addr_t *dma_handle, gfp_t flag); |
19 | 19 | ||
20 | void dma_free_coherent(struct device *dev, size_t size, | 20 | void dma_free_coherent(struct device *dev, size_t size, |
21 | void *vaddr, dma_addr_t dma_handle); | 21 | void *vaddr, dma_addr_t dma_handle); |
22 | #else | 22 | #else |
23 | static inline void * | 23 | static inline void * |
24 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 24 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
25 | int flag) | 25 | gfp_t flag) |
26 | { | 26 | { |
27 | BUG(); | 27 | BUG(); |
28 | return NULL; | 28 | return NULL; |
diff --git a/include/asm-cris/semaphore.h b/include/asm-cris/semaphore.h index 8ed7636ab311..39faf69bcf76 100644 --- a/include/asm-cris/semaphore.h +++ b/include/asm-cris/semaphore.h | |||
@@ -33,9 +33,6 @@ struct semaphore { | |||
33 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 33 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
34 | } | 34 | } |
35 | 35 | ||
36 | #define __MUTEX_INITIALIZER(name) \ | ||
37 | __SEMAPHORE_INITIALIZER(name,1) | ||
38 | |||
39 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 36 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
40 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 37 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
41 | 38 | ||
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h index 28232ad2ff34..156a34bfc583 100644 --- a/include/asm-cris/unistd.h +++ b/include/asm-cris/unistd.h | |||
@@ -367,7 +367,6 @@ asmlinkage int sys_fork(long r10, long r11, long r12, long r13, | |||
367 | asmlinkage int sys_vfork(long r10, long r11, long r12, long r13, | 367 | asmlinkage int sys_vfork(long r10, long r11, long r12, long r13, |
368 | long mof, long srp, struct pt_regs *regs); | 368 | long mof, long srp, struct pt_regs *regs); |
369 | asmlinkage int sys_pipe(unsigned long __user *fildes); | 369 | asmlinkage int sys_pipe(unsigned long __user *fildes); |
370 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
371 | struct sigaction; | 370 | struct sigaction; |
372 | asmlinkage long sys_rt_sigaction(int sig, | 371 | asmlinkage long sys_rt_sigaction(int sig, |
373 | const struct sigaction __user *act, | 372 | const struct sigaction __user *act, |
diff --git a/include/asm-frv/dma-mapping.h b/include/asm-frv/dma-mapping.h index 0206ab35eae0..5003e017fd1e 100644 --- a/include/asm-frv/dma-mapping.h +++ b/include/asm-frv/dma-mapping.h | |||
@@ -13,7 +13,7 @@ | |||
13 | extern unsigned long __nongprelbss dma_coherent_mem_start; | 13 | extern unsigned long __nongprelbss dma_coherent_mem_start; |
14 | extern unsigned long __nongprelbss dma_coherent_mem_end; | 14 | extern unsigned long __nongprelbss dma_coherent_mem_end; |
15 | 15 | ||
16 | void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int gfp); | 16 | void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp); |
17 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); | 17 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); |
18 | 18 | ||
19 | /* | 19 | /* |
diff --git a/include/asm-frv/pci.h b/include/asm-frv/pci.h index b4efe5e3591a..1168451c275f 100644 --- a/include/asm-frv/pci.h +++ b/include/asm-frv/pci.h | |||
@@ -32,7 +32,7 @@ extern void pcibios_set_master(struct pci_dev *dev); | |||
32 | extern void pcibios_penalize_isa_irq(int irq); | 32 | extern void pcibios_penalize_isa_irq(int irq); |
33 | 33 | ||
34 | #ifdef CONFIG_MMU | 34 | #ifdef CONFIG_MMU |
35 | extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle); | 35 | extern void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle); |
36 | extern void consistent_free(void *vaddr); | 36 | extern void consistent_free(void *vaddr); |
37 | extern void consistent_sync(void *vaddr, size_t size, int direction); | 37 | extern void consistent_sync(void *vaddr, size_t size, int direction); |
38 | extern void consistent_sync_page(struct page *page, unsigned long offset, | 38 | extern void consistent_sync_page(struct page *page, unsigned long offset, |
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h index 473fb4bb6329..b247e99dff49 100644 --- a/include/asm-frv/pgtable.h +++ b/include/asm-frv/pgtable.h | |||
@@ -436,8 +436,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
436 | return pte; | 436 | return pte; |
437 | } | 437 | } |
438 | 438 | ||
439 | #define page_pte(page) page_pte_prot((page), __pgprot(0)) | ||
440 | |||
441 | /* to find an entry in a page-table-directory. */ | 439 | /* to find an entry in a page-table-directory. */ |
442 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) | 440 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) |
443 | #define pgd_index_k(addr) pgd_index(addr) | 441 | #define pgd_index_k(addr) pgd_index(addr) |
diff --git a/include/asm-frv/semaphore.h b/include/asm-frv/semaphore.h index 393545630806..b18396288df1 100644 --- a/include/asm-frv/semaphore.h +++ b/include/asm-frv/semaphore.h | |||
@@ -47,9 +47,6 @@ struct semaphore { | |||
47 | #define __SEMAPHORE_INITIALIZER(name,count) \ | 47 | #define __SEMAPHORE_INITIALIZER(name,count) \ |
48 | { count, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __SEM_DEBUG_INIT(name) } | 48 | { count, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __SEM_DEBUG_INIT(name) } |
49 | 49 | ||
50 | #define __MUTEX_INITIALIZER(name) \ | ||
51 | __SEMAPHORE_INITIALIZER(name,1) | ||
52 | |||
53 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 50 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
54 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 51 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
55 | 52 | ||
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index c20ec257ecc0..68c6fea994d9 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -10,14 +10,9 @@ | |||
10 | 10 | ||
11 | #define pud_t pgd_t | 11 | #define pud_t pgd_t |
12 | 12 | ||
13 | #define pmd_alloc(mm, pud, address) \ | 13 | #define pmd_alloc(mm, pud, address) \ |
14 | ({ pmd_t *ret; \ | 14 | ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \ |
15 | if (pgd_none(*pud)) \ | 15 | NULL: pmd_offset(pud, address)) |
16 | ret = __pmd_alloc(mm, pud, address); \ | ||
17 | else \ | ||
18 | ret = pmd_offset(pud, address); \ | ||
19 | ret; \ | ||
20 | }) | ||
21 | 16 | ||
22 | #define pud_alloc(mm, pgd, address) (pgd) | 17 | #define pud_alloc(mm, pgd, address) (pgd) |
23 | #define pud_offset(pgd, start) (pgd) | 18 | #define pud_offset(pgd, start) (pgd) |
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h index fd9de9502dff..a7f1a55ce6b0 100644 --- a/include/asm-generic/dma-mapping-broken.h +++ b/include/asm-generic/dma-mapping-broken.h | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | static inline void * | 7 | static inline void * |
8 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 8 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
9 | int flag) | 9 | gfp_t flag) |
10 | { | 10 | { |
11 | BUG(); | 11 | BUG(); |
12 | return NULL; | 12 | return NULL; |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index ff28c8b31f58..7dca30a26c53 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * - update the page tables | 8 | * - update the page tables |
9 | * - inform the TLB about the new one | 9 | * - inform the TLB about the new one |
10 | * | 10 | * |
11 | * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock. | 11 | * We hold the mm semaphore for reading, and the pte lock. |
12 | * | 12 | * |
13 | * Note: the old pte is known to not be writable, so we don't need to | 13 | * Note: the old pte is known to not be writable, so we don't need to |
14 | * worry about dirty bits etc getting lost. | 14 | * worry about dirty bits etc getting lost. |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 7d0298347ee7..cdd4145243cd 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
@@ -35,16 +35,13 @@ | |||
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | /* struct mmu_gather is an opaque type used by the mm code for passing around | 37 | /* struct mmu_gather is an opaque type used by the mm code for passing around |
38 | * any data needed by arch specific code for tlb_remove_page. This structure | 38 | * any data needed by arch specific code for tlb_remove_page. |
39 | * can be per-CPU or per-MM as the page table lock is held for the duration of | ||
40 | * TLB shootdown. | ||
41 | */ | 39 | */ |
42 | struct mmu_gather { | 40 | struct mmu_gather { |
43 | struct mm_struct *mm; | 41 | struct mm_struct *mm; |
44 | unsigned int nr; /* set to ~0U means fast mode */ | 42 | unsigned int nr; /* set to ~0U means fast mode */ |
45 | unsigned int need_flush;/* Really unmapped some ptes? */ | 43 | unsigned int need_flush;/* Really unmapped some ptes? */ |
46 | unsigned int fullmm; /* non-zero means full mm flush */ | 44 | unsigned int fullmm; /* non-zero means full mm flush */ |
47 | unsigned long freed; | ||
48 | struct page * pages[FREE_PTE_NR]; | 45 | struct page * pages[FREE_PTE_NR]; |
49 | }; | 46 | }; |
50 | 47 | ||
@@ -57,7 +54,7 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | |||
57 | static inline struct mmu_gather * | 54 | static inline struct mmu_gather * |
58 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 55 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) |
59 | { | 56 | { |
60 | struct mmu_gather *tlb = &per_cpu(mmu_gathers, smp_processor_id()); | 57 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); |
61 | 58 | ||
62 | tlb->mm = mm; | 59 | tlb->mm = mm; |
63 | 60 | ||
@@ -65,7 +62,6 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | |||
65 | tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; | 62 | tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; |
66 | 63 | ||
67 | tlb->fullmm = full_mm_flush; | 64 | tlb->fullmm = full_mm_flush; |
68 | tlb->freed = 0; | ||
69 | 65 | ||
70 | return tlb; | 66 | return tlb; |
71 | } | 67 | } |
@@ -85,28 +81,17 @@ tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | |||
85 | 81 | ||
86 | /* tlb_finish_mmu | 82 | /* tlb_finish_mmu |
87 | * Called at the end of the shootdown operation to free up any resources | 83 | * Called at the end of the shootdown operation to free up any resources |
88 | * that were required. The page table lock is still held at this point. | 84 | * that were required. |
89 | */ | 85 | */ |
90 | static inline void | 86 | static inline void |
91 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | 87 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) |
92 | { | 88 | { |
93 | int freed = tlb->freed; | ||
94 | struct mm_struct *mm = tlb->mm; | ||
95 | int rss = get_mm_counter(mm, rss); | ||
96 | |||
97 | if (rss < freed) | ||
98 | freed = rss; | ||
99 | add_mm_counter(mm, rss, -freed); | ||
100 | tlb_flush_mmu(tlb, start, end); | 89 | tlb_flush_mmu(tlb, start, end); |
101 | 90 | ||
102 | /* keep the page table cache within bounds */ | 91 | /* keep the page table cache within bounds */ |
103 | check_pgt_cache(); | 92 | check_pgt_cache(); |
104 | } | ||
105 | 93 | ||
106 | static inline unsigned int | 94 | put_cpu_var(mmu_gathers); |
107 | tlb_is_full_mm(struct mmu_gather *tlb) | ||
108 | { | ||
109 | return tlb->fullmm; | ||
110 | } | 95 | } |
111 | 96 | ||
112 | /* tlb_remove_page | 97 | /* tlb_remove_page |
diff --git a/include/asm-h8300/semaphore.h b/include/asm-h8300/semaphore.h index fe6ef3774297..81bae2a99192 100644 --- a/include/asm-h8300/semaphore.h +++ b/include/asm-h8300/semaphore.h | |||
@@ -35,9 +35,6 @@ struct semaphore { | |||
35 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 35 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
36 | } | 36 | } |
37 | 37 | ||
38 | #define __MUTEX_INITIALIZER(name) \ | ||
39 | __SEMAPHORE_INITIALIZER(name,1) | ||
40 | |||
41 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 38 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
42 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 39 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
43 | 40 | ||
diff --git a/include/asm-h8300/unistd.h b/include/asm-h8300/unistd.h index 56a6401886fa..56a4a5686c88 100644 --- a/include/asm-h8300/unistd.h +++ b/include/asm-h8300/unistd.h | |||
@@ -528,7 +528,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | |||
528 | asmlinkage int sys_execve(char *name, char **argv, char **envp, | 528 | asmlinkage int sys_execve(char *name, char **argv, char **envp, |
529 | int dummy, ...); | 529 | int dummy, ...); |
530 | asmlinkage int sys_pipe(unsigned long *fildes); | 530 | asmlinkage int sys_pipe(unsigned long *fildes); |
531 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
532 | struct sigaction; | 531 | struct sigaction; |
533 | asmlinkage long sys_rt_sigaction(int sig, | 532 | asmlinkage long sys_rt_sigaction(int sig, |
534 | const struct sigaction __user *act, | 533 | const struct sigaction __user *act, |
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 8c454aa58ac6..a515e2aed829 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h | |||
@@ -118,7 +118,8 @@ extern void release_lapic_nmi(void); | |||
118 | extern void disable_timer_nmi_watchdog(void); | 118 | extern void disable_timer_nmi_watchdog(void); |
119 | extern void enable_timer_nmi_watchdog(void); | 119 | extern void enable_timer_nmi_watchdog(void); |
120 | extern void nmi_watchdog_tick (struct pt_regs * regs); | 120 | extern void nmi_watchdog_tick (struct pt_regs * regs); |
121 | extern int APIC_init_uniprocessor (void); | 121 | extern int APIC_init(void); |
122 | extern void APIC_late_time_init(void); | ||
122 | extern void disable_APIC_timer(void); | 123 | extern void disable_APIC_timer(void); |
123 | extern void enable_APIC_timer(void); | 124 | extern void enable_APIC_timer(void); |
124 | 125 | ||
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index 6df1a53c190e..29b851a18c6e 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h | |||
@@ -17,6 +17,8 @@ | |||
17 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; | 17 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; |
18 | DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]); | 18 | DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]); |
19 | 19 | ||
20 | #define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table,_cpu)) | ||
21 | |||
20 | DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]); | 22 | DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]); |
21 | 23 | ||
22 | struct Xgt_desc_struct { | 24 | struct Xgt_desc_struct { |
@@ -60,7 +62,7 @@ __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ | |||
60 | 62 | ||
61 | static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr) | 63 | static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr) |
62 | { | 64 | { |
63 | _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[entry], (int)addr, | 65 | _set_tssldt_desc(&get_cpu_gdt_table(cpu)[entry], (int)addr, |
64 | offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); | 66 | offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89); |
65 | } | 67 | } |
66 | 68 | ||
@@ -68,7 +70,7 @@ static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *ad | |||
68 | 70 | ||
69 | static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) | 71 | static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) |
70 | { | 72 | { |
71 | _set_tssldt_desc(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); | 73 | _set_tssldt_desc(&get_cpu_gdt_table(cpu)[GDT_ENTRY_LDT], (int)addr, ((size << 3)-1), 0x82); |
72 | } | 74 | } |
73 | 75 | ||
74 | #define LDT_entry_a(info) \ | 76 | #define LDT_entry_a(info) \ |
@@ -109,7 +111,7 @@ static inline void write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 en | |||
109 | 111 | ||
110 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) | 112 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) |
111 | { | 113 | { |
112 | #define C(i) per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i] | 114 | #define C(i) get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i] |
113 | C(0); C(1); C(2); | 115 | C(0); C(1); C(2); |
114 | #undef C | 116 | #undef C |
115 | } | 117 | } |
diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 622815bf3243..9139b89497a1 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h | |||
@@ -55,6 +55,7 @@ void init_8259A(int aeoi); | |||
55 | void FASTCALL(send_IPI_self(int vector)); | 55 | void FASTCALL(send_IPI_self(int vector)); |
56 | void init_VISWS_APIC_irqs(void); | 56 | void init_VISWS_APIC_irqs(void); |
57 | void setup_IO_APIC(void); | 57 | void setup_IO_APIC(void); |
58 | void IO_APIC_late_time_init(void); | ||
58 | void disable_IO_APIC(void); | 59 | void disable_IO_APIC(void); |
59 | void print_IO_APIC(void); | 60 | void print_IO_APIC(void); |
60 | int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); | 61 | int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); |
diff --git a/include/asm-i386/mach-default/smpboot_hooks.h b/include/asm-i386/mach-default/smpboot_hooks.h index 7f45f6311059..d7c70c144f9f 100644 --- a/include/asm-i386/mach-default/smpboot_hooks.h +++ b/include/asm-i386/mach-default/smpboot_hooks.h | |||
@@ -1,11 +1,6 @@ | |||
1 | /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws | 1 | /* two abstractions specific to kernel/smpboot.c, mainly to cater to visws |
2 | * which needs to alter them. */ | 2 | * which needs to alter them. */ |
3 | 3 | ||
4 | static inline void smpboot_clear_io_apic_irqs(void) | ||
5 | { | ||
6 | io_apic_irqs = 0; | ||
7 | } | ||
8 | |||
9 | static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) | 4 | static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) |
10 | { | 5 | { |
11 | CMOS_WRITE(0xa, 0xf); | 6 | CMOS_WRITE(0xa, 0xf); |
@@ -32,13 +27,3 @@ static inline void smpboot_restore_warm_reset_vector(void) | |||
32 | 27 | ||
33 | *((volatile long *) phys_to_virt(0x467)) = 0; | 28 | *((volatile long *) phys_to_virt(0x467)) = 0; |
34 | } | 29 | } |
35 | |||
36 | static inline void smpboot_setup_io_apic(void) | ||
37 | { | ||
38 | /* | ||
39 | * Here we can be sure that there is an IO-APIC in the system. Let's | ||
40 | * go and set it up: | ||
41 | */ | ||
42 | if (!skip_ioapic_setup && nr_ioapics) | ||
43 | setup_IO_APIC(); | ||
44 | } | ||
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h index 28a84f6185a7..4a0637a3e208 100644 --- a/include/asm-i386/mach-es7000/mach_mpparse.h +++ b/include/asm-i386/mach-es7000/mach_mpparse.h | |||
@@ -16,7 +16,7 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, | |||
16 | 16 | ||
17 | extern int parse_unisys_oem (char *oemptr); | 17 | extern int parse_unisys_oem (char *oemptr); |
18 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); | 18 | extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); |
19 | extern void setup_unisys(); | 19 | extern void setup_unisys(void); |
20 | 20 | ||
21 | static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, | 21 | static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, |
22 | char *productid) | 22 | char *productid) |
diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-i386/mach-summit/mach_mpparse.h index 2b9e6d55bef1..1cce2b924a80 100644 --- a/include/asm-i386/mach-summit/mach_mpparse.h +++ b/include/asm-i386/mach-summit/mach_mpparse.h | |||
@@ -22,7 +22,6 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, | |||
22 | { | 22 | { |
23 | } | 23 | } |
24 | 24 | ||
25 | extern int usb_early_handoff; | ||
26 | static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, | 25 | static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, |
27 | char *productid) | 26 | char *productid) |
28 | { | 27 | { |
@@ -32,7 +31,6 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, | |||
32 | || !strncmp(productid, "RUTHLESS SMP", 12))){ | 31 | || !strncmp(productid, "RUTHLESS SMP", 12))){ |
33 | use_cyclone = 1; /*enable cyclone-timer*/ | 32 | use_cyclone = 1; /*enable cyclone-timer*/ |
34 | setup_summit(); | 33 | setup_summit(); |
35 | usb_early_handoff = 1; | ||
36 | return 1; | 34 | return 1; |
37 | } | 35 | } |
38 | return 0; | 36 | return 0; |
@@ -46,7 +44,6 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
46 | || !strncmp(oem_table_id, "EXA", 3))){ | 44 | || !strncmp(oem_table_id, "EXA", 3))){ |
47 | use_cyclone = 1; /*enable cyclone-timer*/ | 45 | use_cyclone = 1; /*enable cyclone-timer*/ |
48 | setup_summit(); | 46 | setup_summit(); |
49 | usb_early_handoff = 1; | ||
50 | return 1; | 47 | return 1; |
51 | } | 48 | } |
52 | return 0; | 49 | return 0; |
diff --git a/include/asm-i386/mach-visws/smpboot_hooks.h b/include/asm-i386/mach-visws/smpboot_hooks.h index d926471fa359..14d8e0375f7a 100644 --- a/include/asm-i386/mach-visws/smpboot_hooks.h +++ b/include/asm-i386/mach-visws/smpboot_hooks.h | |||
@@ -11,14 +11,7 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) | |||
11 | 11 | ||
12 | /* for visws do nothing for any of these */ | 12 | /* for visws do nothing for any of these */ |
13 | 13 | ||
14 | static inline void smpboot_clear_io_apic_irqs(void) | ||
15 | { | ||
16 | } | ||
17 | |||
18 | static inline void smpboot_restore_warm_reset_vector(void) | 14 | static inline void smpboot_restore_warm_reset_vector(void) |
19 | { | 15 | { |
20 | } | 16 | } |
21 | 17 | ||
22 | static inline void smpboot_setup_io_apic(void) | ||
23 | { | ||
24 | } | ||
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 348fe3a4879d..620a90641ea8 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h | |||
@@ -88,12 +88,6 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
88 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ | 88 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ |
89 | }) | 89 | }) |
90 | 90 | ||
91 | #define local_mapnr(kvaddr) \ | ||
92 | ({ \ | ||
93 | unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT; \ | ||
94 | (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \ | ||
95 | }) | ||
96 | |||
97 | /* XXX: FIXME -- wli */ | 91 | /* XXX: FIXME -- wli */ |
98 | #define kern_addr_valid(kaddr) (0) | 92 | #define kern_addr_valid(kaddr) (0) |
99 | 93 | ||
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h index fa07bd6c7529..74ef721b534d 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-i386/pgtable-2level.h | |||
@@ -26,11 +26,6 @@ | |||
26 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 26 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
27 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 27 | #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
28 | 28 | ||
29 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) | ||
30 | |||
31 | #define pmd_page_kernel(pmd) \ | ||
32 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
33 | |||
34 | /* | 29 | /* |
35 | * All present user pages are user-executable: | 30 | * All present user pages are user-executable: |
36 | */ | 31 | */ |
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index 2e3f4a344a2d..f1a8b454920a 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h | |||
@@ -74,11 +74,6 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
74 | */ | 74 | */ |
75 | static inline void pud_clear (pud_t * pud) { } | 75 | static inline void pud_clear (pud_t * pud) { } |
76 | 76 | ||
77 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) | ||
78 | |||
79 | #define pmd_page_kernel(pmd) \ | ||
80 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
81 | |||
82 | #define pud_page(pud) \ | 77 | #define pud_page(pud) \ |
83 | ((struct page *) __va(pud_val(pud) & PAGE_MASK)) | 78 | ((struct page *) __va(pud_val(pud) & PAGE_MASK)) |
84 | 79 | ||
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index d101ac414f07..03f3c8ac6383 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -203,7 +203,8 @@ extern unsigned long pg0[]; | |||
203 | #define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) | 203 | #define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE)) |
204 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) | 204 | #define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0) |
205 | 205 | ||
206 | #define pmd_none(x) (!pmd_val(x)) | 206 | /* To avoid harmful races, pmd_none(x) should check only the lower when PAE */ |
207 | #define pmd_none(x) (!(unsigned long)pmd_val(x)) | ||
207 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) | 208 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) |
208 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) | 209 | #define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0) |
209 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | 210 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) |
@@ -322,8 +323,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
322 | return pte; | 323 | return pte; |
323 | } | 324 | } |
324 | 325 | ||
325 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
326 | |||
327 | #define pmd_large(pmd) \ | 326 | #define pmd_large(pmd) \ |
328 | ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT)) | 327 | ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT)) |
329 | 328 | ||
@@ -368,6 +367,11 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
368 | #define pte_offset_kernel(dir, address) \ | 367 | #define pte_offset_kernel(dir, address) \ |
369 | ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address)) | 368 | ((pte_t *) pmd_page_kernel(*(dir)) + pte_index(address)) |
370 | 369 | ||
370 | #define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)) | ||
371 | |||
372 | #define pmd_page_kernel(pmd) \ | ||
373 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | ||
374 | |||
371 | /* | 375 | /* |
372 | * Helper function that returns the kernel pagetable entry controlling | 376 | * Helper function that returns the kernel pagetable entry controlling |
373 | * the virtual address 'address'. NULL means no pagetable entry present. | 377 | * the virtual address 'address'. NULL means no pagetable entry present. |
diff --git a/include/asm-i386/rwsem.h b/include/asm-i386/rwsem.h index 7625a675852f..be4ab859238e 100644 --- a/include/asm-i386/rwsem.h +++ b/include/asm-i386/rwsem.h | |||
@@ -284,5 +284,10 @@ LOCK_PREFIX "xadd %0,(%2)" | |||
284 | return tmp+delta; | 284 | return tmp+delta; |
285 | } | 285 | } |
286 | 286 | ||
287 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
288 | { | ||
289 | return (sem->count != 0); | ||
290 | } | ||
291 | |||
287 | #endif /* __KERNEL__ */ | 292 | #endif /* __KERNEL__ */ |
288 | #endif /* _I386_RWSEM_H */ | 293 | #endif /* _I386_RWSEM_H */ |
diff --git a/include/asm-i386/semaphore.h b/include/asm-i386/semaphore.h index ea563da63e24..6a42b2142fd6 100644 --- a/include/asm-i386/semaphore.h +++ b/include/asm-i386/semaphore.h | |||
@@ -55,9 +55,6 @@ struct semaphore { | |||
55 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 55 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
56 | } | 56 | } |
57 | 57 | ||
58 | #define __MUTEX_INITIALIZER(name) \ | ||
59 | __SEMAPHORE_INITIALIZER(name,1) | ||
60 | |||
61 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 58 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
62 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 59 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
63 | 60 | ||
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index acd5c26b69ba..97d52ac49e46 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -167,6 +167,8 @@ struct __xchg_dummy { unsigned long a[100]; }; | |||
167 | #define __xg(x) ((struct __xchg_dummy *)(x)) | 167 | #define __xg(x) ((struct __xchg_dummy *)(x)) |
168 | 168 | ||
169 | 169 | ||
170 | #ifdef CONFIG_X86_CMPXCHG64 | ||
171 | |||
170 | /* | 172 | /* |
171 | * The semantics of XCHGCMP8B are a bit strange, this is why | 173 | * The semantics of XCHGCMP8B are a bit strange, this is why |
172 | * there is a loop and the loading of %%eax and %%edx has to | 174 | * there is a loop and the loading of %%eax and %%edx has to |
@@ -221,6 +223,8 @@ static inline void __set_64bit_var (unsigned long long *ptr, | |||
221 | __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \ | 223 | __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) : \ |
222 | __set_64bit(ptr, ll_low(value), ll_high(value)) ) | 224 | __set_64bit(ptr, ll_low(value), ll_high(value)) ) |
223 | 225 | ||
226 | #endif | ||
227 | |||
224 | /* | 228 | /* |
225 | * Note: no "lock" prefix even on SMP: xchg always implies lock anyway | 229 | * Note: no "lock" prefix even on SMP: xchg always implies lock anyway |
226 | * Note 2: xchg has side effect, so that attribute volatile is necessary, | 230 | * Note 2: xchg has side effect, so that attribute volatile is necessary, |
@@ -259,7 +263,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz | |||
259 | 263 | ||
260 | #ifdef CONFIG_X86_CMPXCHG | 264 | #ifdef CONFIG_X86_CMPXCHG |
261 | #define __HAVE_ARCH_CMPXCHG 1 | 265 | #define __HAVE_ARCH_CMPXCHG 1 |
262 | #endif | ||
263 | 266 | ||
264 | static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | 267 | static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, |
265 | unsigned long new, int size) | 268 | unsigned long new, int size) |
@@ -275,13 +278,13 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
275 | case 2: | 278 | case 2: |
276 | __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2" | 279 | __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2" |
277 | : "=a"(prev) | 280 | : "=a"(prev) |
278 | : "q"(new), "m"(*__xg(ptr)), "0"(old) | 281 | : "r"(new), "m"(*__xg(ptr)), "0"(old) |
279 | : "memory"); | 282 | : "memory"); |
280 | return prev; | 283 | return prev; |
281 | case 4: | 284 | case 4: |
282 | __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2" | 285 | __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2" |
283 | : "=a"(prev) | 286 | : "=a"(prev) |
284 | : "q"(new), "m"(*__xg(ptr)), "0"(old) | 287 | : "r"(new), "m"(*__xg(ptr)), "0"(old) |
285 | : "memory"); | 288 | : "memory"); |
286 | return prev; | 289 | return prev; |
287 | } | 290 | } |
@@ -291,6 +294,30 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, | |||
291 | #define cmpxchg(ptr,o,n)\ | 294 | #define cmpxchg(ptr,o,n)\ |
292 | ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ | 295 | ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ |
293 | (unsigned long)(n),sizeof(*(ptr)))) | 296 | (unsigned long)(n),sizeof(*(ptr)))) |
297 | |||
298 | #endif | ||
299 | |||
300 | #ifdef CONFIG_X86_CMPXCHG64 | ||
301 | |||
302 | static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long long old, | ||
303 | unsigned long long new) | ||
304 | { | ||
305 | unsigned long long prev; | ||
306 | __asm__ __volatile__(LOCK_PREFIX "cmpxchg8b %3" | ||
307 | : "=A"(prev) | ||
308 | : "b"((unsigned long)new), | ||
309 | "c"((unsigned long)(new >> 32)), | ||
310 | "m"(*__xg(ptr)), | ||
311 | "0"(old) | ||
312 | : "memory"); | ||
313 | return prev; | ||
314 | } | ||
315 | |||
316 | #define cmpxchg64(ptr,o,n)\ | ||
317 | ((__typeof__(*(ptr)))__cmpxchg64((ptr),(unsigned long long)(o),\ | ||
318 | (unsigned long long)(n))) | ||
319 | |||
320 | #endif | ||
294 | 321 | ||
295 | #ifdef __KERNEL__ | 322 | #ifdef __KERNEL__ |
296 | struct alt_instr { | 323 | struct alt_instr { |
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index fbaf90a3968c..0f92e78dfea1 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -448,7 +448,6 @@ asmlinkage int sys_clone(struct pt_regs regs); | |||
448 | asmlinkage int sys_fork(struct pt_regs regs); | 448 | asmlinkage int sys_fork(struct pt_regs regs); |
449 | asmlinkage int sys_vfork(struct pt_regs regs); | 449 | asmlinkage int sys_vfork(struct pt_regs regs); |
450 | asmlinkage int sys_pipe(unsigned long __user *fildes); | 450 | asmlinkage int sys_pipe(unsigned long __user *fildes); |
451 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
452 | asmlinkage long sys_iopl(unsigned long unused); | 451 | asmlinkage long sys_iopl(unsigned long unused); |
453 | struct sigaction; | 452 | struct sigaction; |
454 | asmlinkage long sys_rt_sigaction(int sig, | 453 | asmlinkage long sys_rt_sigaction(int sig, |
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 79e89a7db566..ca5ea994d688 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -26,7 +26,7 @@ typedef void ia64_mv_cpu_init_t (void); | |||
26 | typedef void ia64_mv_irq_init_t (void); | 26 | typedef void ia64_mv_irq_init_t (void); |
27 | typedef void ia64_mv_send_ipi_t (int, int, int, int); | 27 | typedef void ia64_mv_send_ipi_t (int, int, int, int); |
28 | typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *); | 28 | typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *); |
29 | typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long); | 29 | typedef void ia64_mv_global_tlb_purge_t (struct mm_struct *, unsigned long, unsigned long, unsigned long); |
30 | typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); | 30 | typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); |
31 | typedef unsigned int ia64_mv_local_vector_to_irq (u8); | 31 | typedef unsigned int ia64_mv_local_vector_to_irq (u8); |
32 | typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *); | 32 | typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *); |
@@ -37,7 +37,7 @@ typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val, | |||
37 | 37 | ||
38 | /* DMA-mapping interface: */ | 38 | /* DMA-mapping interface: */ |
39 | typedef void ia64_mv_dma_init (void); | 39 | typedef void ia64_mv_dma_init (void); |
40 | typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, int); | 40 | typedef void *ia64_mv_dma_alloc_coherent (struct device *, size_t, dma_addr_t *, gfp_t); |
41 | typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t); | 41 | typedef void ia64_mv_dma_free_coherent (struct device *, size_t, void *, dma_addr_t); |
42 | typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int); | 42 | typedef dma_addr_t ia64_mv_dma_map_single (struct device *, void *, size_t, int); |
43 | typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int); | 43 | typedef void ia64_mv_dma_unmap_single (struct device *, dma_addr_t, size_t, int); |
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h index 1590dc65b30b..46501b01a5c5 100644 --- a/include/asm-ia64/meminit.h +++ b/include/asm-ia64/meminit.h | |||
@@ -16,10 +16,11 @@ | |||
16 | * - initrd (optional) | 16 | * - initrd (optional) |
17 | * - command line string | 17 | * - command line string |
18 | * - kernel code & data | 18 | * - kernel code & data |
19 | * - Kernel memory map built from EFI memory map | ||
19 | * | 20 | * |
20 | * More could be added if necessary | 21 | * More could be added if necessary |
21 | */ | 22 | */ |
22 | #define IA64_MAX_RSVD_REGIONS 5 | 23 | #define IA64_MAX_RSVD_REGIONS 6 |
23 | 24 | ||
24 | struct rsvd_region { | 25 | struct rsvd_region { |
25 | unsigned long start; /* virtual address of beginning of element */ | 26 | unsigned long start; /* virtual address of beginning of element */ |
@@ -33,6 +34,7 @@ extern void find_memory (void); | |||
33 | extern void reserve_memory (void); | 34 | extern void reserve_memory (void); |
34 | extern void find_initrd (void); | 35 | extern void find_initrd (void); |
35 | extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg); | 36 | extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg); |
37 | extern void efi_memmap_init(unsigned long *, unsigned long *); | ||
36 | 38 | ||
37 | /* | 39 | /* |
38 | * For rounding an address to the next IA64_GRANULE_SIZE or order | 40 | * For rounding an address to the next IA64_GRANULE_SIZE or order |
@@ -41,7 +43,7 @@ extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg | |||
41 | #define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1)) | 43 | #define GRANULEROUNDUP(n) (((n)+IA64_GRANULE_SIZE-1) & ~(IA64_GRANULE_SIZE-1)) |
42 | #define ORDERROUNDDOWN(n) ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1)) | 44 | #define ORDERROUNDDOWN(n) ((n) & ~((PAGE_SIZE<<MAX_ORDER)-1)) |
43 | 45 | ||
44 | #ifdef CONFIG_DISCONTIGMEM | 46 | #ifdef CONFIG_NUMA |
45 | extern void call_pernode_memory (unsigned long start, unsigned long len, void *func); | 47 | extern void call_pernode_memory (unsigned long start, unsigned long len, void *func); |
46 | #else | 48 | #else |
47 | # define call_pernode_memory(start, len, func) (*func)(start, len, 0) | 49 | # define call_pernode_memory(start, len, func) (*func)(start, len, 0) |
diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h index d32f51e3d6c2..34efe88eb849 100644 --- a/include/asm-ia64/mmzone.h +++ b/include/asm-ia64/mmzone.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | #include <asm/meminit.h> | 16 | #include <asm/meminit.h> |
17 | 17 | ||
18 | #ifdef CONFIG_DISCONTIGMEM | 18 | #ifdef CONFIG_NUMA |
19 | 19 | ||
20 | static inline int pfn_to_nid(unsigned long pfn) | 20 | static inline int pfn_to_nid(unsigned long pfn) |
21 | { | 21 | { |
@@ -31,6 +31,10 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
31 | #endif | 31 | #endif |
32 | } | 32 | } |
33 | 33 | ||
34 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | #endif | ||
37 | |||
34 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ | 38 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ |
35 | # define MAX_PHYSNODE_ID 8 | 39 | # define MAX_PHYSNODE_ID 8 |
36 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) | 40 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) |
@@ -39,8 +43,8 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
39 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 4) | 43 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 4) |
40 | #endif | 44 | #endif |
41 | 45 | ||
42 | #else /* CONFIG_DISCONTIGMEM */ | 46 | #else /* CONFIG_NUMA */ |
43 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 4) | 47 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 4) |
44 | #endif /* CONFIG_DISCONTIGMEM */ | 48 | #endif /* CONFIG_NUMA */ |
45 | 49 | ||
46 | #endif /* _ASM_IA64_MMZONE_H */ | 50 | #endif /* _ASM_IA64_MMZONE_H */ |
diff --git a/include/asm-ia64/nodedata.h b/include/asm-ia64/nodedata.h index 6b0f3ed89b7e..9978c7ce7549 100644 --- a/include/asm-ia64/nodedata.h +++ b/include/asm-ia64/nodedata.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <asm/percpu.h> | 17 | #include <asm/percpu.h> |
18 | #include <asm/mmzone.h> | 18 | #include <asm/mmzone.h> |
19 | 19 | ||
20 | #ifdef CONFIG_DISCONTIGMEM | 20 | #ifdef CONFIG_NUMA |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Node Data. One of these structures is located on each node of a NUMA system. | 23 | * Node Data. One of these structures is located on each node of a NUMA system. |
@@ -47,6 +47,6 @@ struct ia64_node_data { | |||
47 | */ | 47 | */ |
48 | #define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid]) | 48 | #define NODE_DATA(nid) (local_node_data->pg_data_ptrs[nid]) |
49 | 49 | ||
50 | #endif /* CONFIG_DISCONTIGMEM */ | 50 | #endif /* CONFIG_NUMA */ |
51 | 51 | ||
52 | #endif /* _ASM_IA64_NODEDATA_H */ | 52 | #endif /* _ASM_IA64_NODEDATA_H */ |
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 9edffad8c28b..ef436b9d06ad 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h | |||
@@ -102,15 +102,15 @@ do { \ | |||
102 | 102 | ||
103 | #ifdef CONFIG_VIRTUAL_MEM_MAP | 103 | #ifdef CONFIG_VIRTUAL_MEM_MAP |
104 | extern int ia64_pfn_valid (unsigned long pfn); | 104 | extern int ia64_pfn_valid (unsigned long pfn); |
105 | #else | 105 | #elif defined(CONFIG_FLATMEM) |
106 | # define ia64_pfn_valid(pfn) 1 | 106 | # define ia64_pfn_valid(pfn) 1 |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | #ifndef CONFIG_DISCONTIGMEM | 109 | #ifdef CONFIG_FLATMEM |
110 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) | 110 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) |
111 | # define page_to_pfn(page) ((unsigned long) (page - mem_map)) | 111 | # define page_to_pfn(page) ((unsigned long) (page - mem_map)) |
112 | # define pfn_to_page(pfn) (mem_map + (pfn)) | 112 | # define pfn_to_page(pfn) (mem_map + (pfn)) |
113 | #else | 113 | #elif defined(CONFIG_DISCONTIGMEM) |
114 | extern struct page *vmem_map; | 114 | extern struct page *vmem_map; |
115 | extern unsigned long max_low_pfn; | 115 | extern unsigned long max_low_pfn; |
116 | # define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) | 116 | # define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 3339c7b55a6f..21e32a06bc82 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -236,9 +236,6 @@ ia64_phys_addr_valid (unsigned long addr) | |||
236 | #define pte_modify(_pte, newprot) \ | 236 | #define pte_modify(_pte, newprot) \ |
237 | (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK))) | 237 | (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK))) |
238 | 238 | ||
239 | #define page_pte_prot(page,prot) mk_pte(page, prot) | ||
240 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
241 | |||
242 | #define pte_none(pte) (!pte_val(pte)) | 239 | #define pte_none(pte) (!pte_val(pte)) |
243 | #define pte_present(pte) (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE)) | 240 | #define pte_present(pte) (pte_val(pte) & (_PAGE_P | _PAGE_PROTNONE)) |
244 | #define pte_clear(mm,addr,pte) (pte_val(*(pte)) = 0UL) | 241 | #define pte_clear(mm,addr,pte) (pte_val(*(pte)) = 0UL) |
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h index e18b5ab0cb75..1327c91ea39c 100644 --- a/include/asm-ia64/rwsem.h +++ b/include/asm-ia64/rwsem.h | |||
@@ -186,4 +186,9 @@ __downgrade_write (struct rw_semaphore *sem) | |||
186 | #define rwsem_atomic_add(delta, sem) atomic64_add(delta, (atomic64_t *)(&(sem)->count)) | 186 | #define rwsem_atomic_add(delta, sem) atomic64_add(delta, (atomic64_t *)(&(sem)->count)) |
187 | #define rwsem_atomic_update(delta, sem) atomic64_add_return(delta, (atomic64_t *)(&(sem)->count)) | 187 | #define rwsem_atomic_update(delta, sem) atomic64_add_return(delta, (atomic64_t *)(&(sem)->count)) |
188 | 188 | ||
189 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
190 | { | ||
191 | return (sem->count != 0); | ||
192 | } | ||
193 | |||
189 | #endif /* _ASM_IA64_RWSEM_H */ | 194 | #endif /* _ASM_IA64_RWSEM_H */ |
diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h index 3a2f0f3f78f3..bb8906285fab 100644 --- a/include/asm-ia64/semaphore.h +++ b/include/asm-ia64/semaphore.h | |||
@@ -24,8 +24,6 @@ struct semaphore { | |||
24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
25 | } | 25 | } |
26 | 26 | ||
27 | #define __MUTEX_INITIALIZER(name) __SEMAPHORE_INITIALIZER(name,1) | ||
28 | |||
29 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 27 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
30 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) | 28 | struct semaphore name = __SEMAPHORE_INITIALIZER(name, count) |
31 | 29 | ||
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h index ab827d298569..1a3831c04af6 100644 --- a/include/asm-ia64/sn/arch.h +++ b/include/asm-ia64/sn/arch.h | |||
@@ -18,6 +18,32 @@ | |||
18 | #include <asm/sn/sn_cpuid.h> | 18 | #include <asm/sn/sn_cpuid.h> |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * This is the maximum number of NUMALINK nodes that can be part of a single | ||
22 | * SSI kernel. This number includes C-brick, M-bricks, and TIOs. Nodes in | ||
23 | * remote partitions are NOT included in this number. | ||
24 | * The number of compact nodes cannot exceed size of a coherency domain. | ||
25 | * The purpose of this define is to specify a node count that includes | ||
26 | * all C/M/TIO nodes in an SSI system. | ||
27 | * | ||
28 | * SGI system can currently support up to 256 C/M nodes plus additional TIO nodes. | ||
29 | * | ||
30 | * Note: ACPI20 has an architectural limit of 256 nodes. When we upgrade | ||
31 | * to ACPI3.0, this limit will be removed. The notion of "compact nodes" | ||
32 | * should be deleted and TIOs should be included in MAX_NUMNODES. | ||
33 | */ | ||
34 | #define MAX_COMPACT_NODES 512 | ||
35 | |||
36 | /* | ||
37 | * Maximum number of nodes in all partitions and in all coherency domains. | ||
38 | * This is the total number of nodes accessible in the numalink fabric. It | ||
39 | * includes all C & M bricks, plus all TIOs. | ||
40 | * | ||
41 | * This value is also the value of the maximum number of NASIDs in the numalink | ||
42 | * fabric. | ||
43 | */ | ||
44 | #define MAX_NUMALINK_NODES 16384 | ||
45 | |||
46 | /* | ||
21 | * The following defines attributes of the HUB chip. These attributes are | 47 | * The following defines attributes of the HUB chip. These attributes are |
22 | * frequently referenced. They are kept in the per-cpu data areas of each cpu. | 48 | * frequently referenced. They are kept in the per-cpu data areas of each cpu. |
23 | * They are kept together in a struct to minimize cache misses. | 49 | * They are kept together in a struct to minimize cache misses. |
@@ -41,15 +67,6 @@ DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); | |||
41 | 67 | ||
42 | 68 | ||
43 | /* | 69 | /* |
44 | * This is the maximum number of nodes that can be part of a kernel. | ||
45 | * Effectively, it's the maximum number of compact node ids (cnodeid_t). | ||
46 | * This is not necessarily the same as MAX_NASIDS. | ||
47 | */ | ||
48 | #define MAX_COMPACT_NODES 2048 | ||
49 | #define CPUS_PER_NODE 4 | ||
50 | |||
51 | |||
52 | /* | ||
53 | * Compact node ID to nasid mappings kept in the per-cpu data areas of each | 70 | * Compact node ID to nasid mappings kept in the per-cpu data areas of each |
54 | * cpu. | 71 | * cpu. |
55 | */ | 72 | */ |
@@ -57,7 +74,6 @@ DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); | |||
57 | #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0])) | 74 | #define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0])) |
58 | 75 | ||
59 | 76 | ||
60 | |||
61 | extern u8 sn_partition_id; | 77 | extern u8 sn_partition_id; |
62 | extern u8 sn_system_size; | 78 | extern u8 sn_system_size; |
63 | extern u8 sn_sharing_domain_size; | 79 | extern u8 sn_sharing_domain_size; |
diff --git a/include/asm-ia64/sn/io.h b/include/asm-ia64/sn/io.h index 42209733f6b1..41c73a735628 100644 --- a/include/asm-ia64/sn/io.h +++ b/include/asm-ia64/sn/io.h | |||
@@ -14,7 +14,7 @@ | |||
14 | extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */ | 14 | extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */ |
15 | extern void __sn_mmiowb(void); /* Forward definition */ | 15 | extern void __sn_mmiowb(void); /* Forward definition */ |
16 | 16 | ||
17 | extern int numionodes; | 17 | extern int num_cnodes; |
18 | 18 | ||
19 | #define __sn_mf_a() ia64_mfa() | 19 | #define __sn_mf_a() ia64_mfa() |
20 | 20 | ||
@@ -36,6 +36,15 @@ extern void sn_dma_flush(unsigned long); | |||
36 | #define __sn_readq_relaxed ___sn_readq_relaxed | 36 | #define __sn_readq_relaxed ___sn_readq_relaxed |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Convenience macros for setting/clearing bits using the above accessors | ||
40 | */ | ||
41 | |||
42 | #define __sn_setq_relaxed(addr, val) \ | ||
43 | writeq((__sn_readq_relaxed(addr) | (val)), (addr)) | ||
44 | #define __sn_clrq_relaxed(addr, val) \ | ||
45 | writeq((__sn_readq_relaxed(addr) & ~(val)), (addr)) | ||
46 | |||
47 | /* | ||
39 | * The following routines are SN Platform specific, called when | 48 | * The following routines are SN Platform specific, called when |
40 | * a reference is made to inX/outX set macros. SN Platform | 49 | * a reference is made to inX/outX set macros. SN Platform |
41 | * inX set of macros ensures that Posted DMA writes on the | 50 | * inX set of macros ensures that Posted DMA writes on the |
diff --git a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h index 9f920c70a62a..bcbf209d63be 100644 --- a/include/asm-ia64/sn/klconfig.h +++ b/include/asm-ia64/sn/klconfig.h | |||
@@ -208,19 +208,6 @@ typedef struct lboard_s { | |||
208 | klconf_off_t brd_next_same; /* Next BOARD with same nasid */ | 208 | klconf_off_t brd_next_same; /* Next BOARD with same nasid */ |
209 | } lboard_t; | 209 | } lboard_t; |
210 | 210 | ||
211 | #define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts) | ||
212 | #define NODE_OFFSET_TO_KLINFO(n,off) ((klinfo_t*) TO_NODE_CAC(n,off)) | ||
213 | #define KLCF_NEXT(_brd) \ | ||
214 | ((_brd)->brd_next_same ? \ | ||
215 | (NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL) | ||
216 | #define KLCF_NEXT_ANY(_brd) \ | ||
217 | ((_brd)->brd_next_any ? \ | ||
218 | (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL) | ||
219 | #define KLCF_COMP(_brd, _ndx) \ | ||
220 | ((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \ | ||
221 | (NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)]))) | ||
222 | |||
223 | |||
224 | /* | 211 | /* |
225 | * Generic info structure. This stores common info about a | 212 | * Generic info structure. This stores common info about a |
226 | * component. | 213 | * component. |
@@ -249,24 +236,11 @@ typedef struct klinfo_s { /* Generic info */ | |||
249 | } klinfo_t ; | 236 | } klinfo_t ; |
250 | 237 | ||
251 | 238 | ||
252 | static inline lboard_t *find_lboard_any(lboard_t * start, unsigned char brd_type) | 239 | static inline lboard_t *find_lboard_next(lboard_t * brd) |
253 | { | 240 | { |
254 | /* Search all boards stored on this node. */ | 241 | if (brd && brd->brd_next_any) |
255 | 242 | return NODE_OFFSET_TO_LBOARD(NASID_GET(brd), brd->brd_next_any); | |
256 | while (start) { | 243 | return NULL; |
257 | if (start->brd_type == brd_type) | ||
258 | return start; | ||
259 | start = KLCF_NEXT_ANY(start); | ||
260 | } | ||
261 | /* Didn't find it. */ | ||
262 | return (lboard_t *) NULL; | ||
263 | } | 244 | } |
264 | 245 | ||
265 | |||
266 | /* external declarations of Linux kernel functions. */ | ||
267 | |||
268 | extern lboard_t *root_lboard[]; | ||
269 | extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type); | ||
270 | extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type); | ||
271 | |||
272 | #endif /* _ASM_IA64_SN_KLCONFIG_H */ | 246 | #endif /* _ASM_IA64_SN_KLCONFIG_H */ |
diff --git a/include/asm-ia64/sn/l1.h b/include/asm-ia64/sn/l1.h index 2e5f0aa38889..e3b819110d47 100644 --- a/include/asm-ia64/sn/l1.h +++ b/include/asm-ia64/sn/l1.h | |||
@@ -35,4 +35,16 @@ | |||
35 | #define L1_BRICKTYPE_ATHENA 0x2b /* + */ | 35 | #define L1_BRICKTYPE_ATHENA 0x2b /* + */ |
36 | #define L1_BRICKTYPE_DAYTONA 0x7a /* z */ | 36 | #define L1_BRICKTYPE_DAYTONA 0x7a /* z */ |
37 | 37 | ||
38 | /* board type response codes */ | ||
39 | #define L1_BOARDTYPE_IP69 0x0100 /* CA */ | ||
40 | #define L1_BOARDTYPE_IP63 0x0200 /* CB */ | ||
41 | #define L1_BOARDTYPE_BASEIO 0x0300 /* IB */ | ||
42 | #define L1_BOARDTYPE_PCIE2SLOT 0x0400 /* IC */ | ||
43 | #define L1_BOARDTYPE_PCIX3SLOT 0x0500 /* ID */ | ||
44 | #define L1_BOARDTYPE_PCIXPCIE4SLOT 0x0600 /* IE */ | ||
45 | #define L1_BOARDTYPE_ABACUS 0x0700 /* AB */ | ||
46 | #define L1_BOARDTYPE_DAYTONA 0x0800 /* AD */ | ||
47 | #define L1_BOARDTYPE_INVAL (-1) /* invalid brick type */ | ||
48 | |||
49 | |||
38 | #endif /* _ASM_IA64_SN_L1_H */ | 50 | #endif /* _ASM_IA64_SN_L1_H */ |
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h index 47bb8100fd00..6f6d69e39ff5 100644 --- a/include/asm-ia64/sn/nodepda.h +++ b/include/asm-ia64/sn/nodepda.h | |||
@@ -55,7 +55,6 @@ struct nodepda_s { | |||
55 | */ | 55 | */ |
56 | struct phys_cpuid phys_cpuid[NR_CPUS]; | 56 | struct phys_cpuid phys_cpuid[NR_CPUS]; |
57 | spinlock_t ptc_lock ____cacheline_aligned_in_smp; | 57 | spinlock_t ptc_lock ____cacheline_aligned_in_smp; |
58 | spinlock_t bist_lock; | ||
59 | }; | 58 | }; |
60 | 59 | ||
61 | typedef struct nodepda_s nodepda_t; | 60 | typedef struct nodepda_s nodepda_t; |
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h index d2c1d34dcce4..749deb2ca6c1 100644 --- a/include/asm-ia64/sn/sn_cpuid.h +++ b/include/asm-ia64/sn/sn_cpuid.h | |||
@@ -105,7 +105,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */ | |||
105 | #define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid) | 105 | #define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid) |
106 | #define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode) | 106 | #define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode) |
107 | #define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice) | 107 | #define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice) |
108 | #define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)]) | ||
109 | 108 | ||
110 | 109 | ||
111 | /* | 110 | /* |
@@ -113,8 +112,6 @@ extern short physical_node_map[]; /* indexed by nasid to get cnode */ | |||
113 | * of potentially large tables. | 112 | * of potentially large tables. |
114 | */ | 113 | */ |
115 | extern int nasid_slice_to_cpuid(int, int); | 114 | extern int nasid_slice_to_cpuid(int, int); |
116 | #define nasid_slice_to_cpu_physical_id(nasid, slice) \ | ||
117 | cpu_physical_id(nasid_slice_to_cpuid(nasid, slice)) | ||
118 | 115 | ||
119 | /* | 116 | /* |
120 | * cnodeid_to_nasid - convert a cnodeid to a NASID | 117 | * cnodeid_to_nasid - convert a cnodeid to a NASID |
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h index fea35b33d4e4..3f7564dc0aa9 100644 --- a/include/asm-ia64/sn/sn_sal.h +++ b/include/asm-ia64/sn/sn_sal.h | |||
@@ -47,6 +47,7 @@ | |||
47 | #define SN_SAL_CONSOLE_PUTB 0x02000028 | 47 | #define SN_SAL_CONSOLE_PUTB 0x02000028 |
48 | #define SN_SAL_CONSOLE_XMIT_CHARS 0x0200002a | 48 | #define SN_SAL_CONSOLE_XMIT_CHARS 0x0200002a |
49 | #define SN_SAL_CONSOLE_READC 0x0200002b | 49 | #define SN_SAL_CONSOLE_READC 0x0200002b |
50 | #define SN_SAL_SYSCTL_OP 0x02000030 | ||
50 | #define SN_SAL_SYSCTL_MODID_GET 0x02000031 | 51 | #define SN_SAL_SYSCTL_MODID_GET 0x02000031 |
51 | #define SN_SAL_SYSCTL_GET 0x02000032 | 52 | #define SN_SAL_SYSCTL_GET 0x02000032 |
52 | #define SN_SAL_SYSCTL_IOBRICK_MODULE_GET 0x02000033 | 53 | #define SN_SAL_SYSCTL_IOBRICK_MODULE_GET 0x02000033 |
@@ -67,7 +68,7 @@ | |||
67 | #define SN_SAL_IOIF_INTERRUPT 0x0200004a | 68 | #define SN_SAL_IOIF_INTERRUPT 0x0200004a |
68 | #define SN_SAL_HWPERF_OP 0x02000050 // lock | 69 | #define SN_SAL_HWPERF_OP 0x02000050 // lock |
69 | #define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051 | 70 | #define SN_SAL_IOIF_ERROR_INTERRUPT 0x02000051 |
70 | 71 | #define SN_SAL_IOIF_PCI_SAFE 0x02000052 | |
71 | #define SN_SAL_IOIF_SLOT_ENABLE 0x02000053 | 72 | #define SN_SAL_IOIF_SLOT_ENABLE 0x02000053 |
72 | #define SN_SAL_IOIF_SLOT_DISABLE 0x02000054 | 73 | #define SN_SAL_IOIF_SLOT_DISABLE 0x02000054 |
73 | #define SN_SAL_IOIF_GET_HUBDEV_INFO 0x02000055 | 74 | #define SN_SAL_IOIF_GET_HUBDEV_INFO 0x02000055 |
@@ -101,6 +102,13 @@ | |||
101 | #define SAL_INTR_FREE 2 | 102 | #define SAL_INTR_FREE 2 |
102 | 103 | ||
103 | /* | 104 | /* |
105 | * operations available on the generic SN_SAL_SYSCTL_OP | ||
106 | * runtime service | ||
107 | */ | ||
108 | #define SAL_SYSCTL_OP_IOBOARD 0x0001 /* retrieve board type */ | ||
109 | #define SAL_SYSCTL_OP_TIO_JLCK_RST 0x0002 /* issue TIO clock reset */ | ||
110 | |||
111 | /* | ||
104 | * IRouter (i.e. generalized system controller) operations | 112 | * IRouter (i.e. generalized system controller) operations |
105 | */ | 113 | */ |
106 | #define SAL_IROUTER_OPEN 0 /* open a subchannel */ | 114 | #define SAL_IROUTER_OPEN 0 /* open a subchannel */ |
@@ -198,26 +206,16 @@ ia64_sn_get_master_baseio_nasid(void) | |||
198 | return ret_stuff.v0; | 206 | return ret_stuff.v0; |
199 | } | 207 | } |
200 | 208 | ||
201 | static inline char * | 209 | static inline void * |
202 | ia64_sn_get_klconfig_addr(nasid_t nasid) | 210 | ia64_sn_get_klconfig_addr(nasid_t nasid) |
203 | { | 211 | { |
204 | struct ia64_sal_retval ret_stuff; | 212 | struct ia64_sal_retval ret_stuff; |
205 | int cnodeid; | ||
206 | 213 | ||
207 | cnodeid = nasid_to_cnodeid(nasid); | ||
208 | ret_stuff.status = 0; | 214 | ret_stuff.status = 0; |
209 | ret_stuff.v0 = 0; | 215 | ret_stuff.v0 = 0; |
210 | ret_stuff.v1 = 0; | 216 | ret_stuff.v1 = 0; |
211 | ret_stuff.v2 = 0; | 217 | ret_stuff.v2 = 0; |
212 | SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0); | 218 | SAL_CALL(ret_stuff, SN_SAL_GET_KLCONFIG_ADDR, (u64)nasid, 0, 0, 0, 0, 0, 0); |
213 | |||
214 | /* | ||
215 | * We should panic if a valid cnode nasid does not produce | ||
216 | * a klconfig address. | ||
217 | */ | ||
218 | if (ret_stuff.status != 0) { | ||
219 | panic("ia64_sn_get_klconfig_addr: Returned error %lx\n", ret_stuff.status); | ||
220 | } | ||
221 | return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL; | 219 | return ret_stuff.v0 ? __va(ret_stuff.v0) : NULL; |
222 | } | 220 | } |
223 | 221 | ||
@@ -694,12 +692,10 @@ sn_change_memprotect(u64 paddr, u64 len, u64 perms, u64 *nasid_array) | |||
694 | unsigned long irq_flags; | 692 | unsigned long irq_flags; |
695 | 693 | ||
696 | cnodeid = nasid_to_cnodeid(get_node_number(paddr)); | 694 | cnodeid = nasid_to_cnodeid(get_node_number(paddr)); |
697 | // spin_lock(&NODEPDA(cnodeid)->bist_lock); | ||
698 | local_irq_save(irq_flags); | 695 | local_irq_save(irq_flags); |
699 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, | 696 | ia64_sal_oemcall_nolock(&ret_stuff, SN_SAL_MEMPROTECT, paddr, len, |
700 | (u64)nasid_array, perms, 0, 0, 0); | 697 | (u64)nasid_array, perms, 0, 0, 0); |
701 | local_irq_restore(irq_flags); | 698 | local_irq_restore(irq_flags); |
702 | // spin_unlock(&NODEPDA(cnodeid)->bist_lock); | ||
703 | return ret_stuff.status; | 699 | return ret_stuff.status; |
704 | } | 700 | } |
705 | #define SN_MEMPROT_ACCESS_CLASS_0 0x14a080 | 701 | #define SN_MEMPROT_ACCESS_CLASS_0 0x14a080 |
@@ -873,6 +869,41 @@ ia64_sn_sysctl_event_init(nasid_t nasid) | |||
873 | return (int) rv.v0; | 869 | return (int) rv.v0; |
874 | } | 870 | } |
875 | 871 | ||
872 | /* | ||
873 | * Ask the system controller on the specified nasid to reset | ||
874 | * the CX corelet clock. Only valid on TIO nodes. | ||
875 | */ | ||
876 | static inline int | ||
877 | ia64_sn_sysctl_tio_clock_reset(nasid_t nasid) | ||
878 | { | ||
879 | struct ia64_sal_retval rv; | ||
880 | SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_TIO_JLCK_RST, | ||
881 | nasid, 0, 0, 0, 0, 0); | ||
882 | if (rv.status != 0) | ||
883 | return (int)rv.status; | ||
884 | if (rv.v0 != 0) | ||
885 | return (int)rv.v0; | ||
886 | |||
887 | return 0; | ||
888 | } | ||
889 | |||
890 | /* | ||
891 | * Get the associated ioboard type for a given nasid. | ||
892 | */ | ||
893 | static inline int | ||
894 | ia64_sn_sysctl_ioboard_get(nasid_t nasid) | ||
895 | { | ||
896 | struct ia64_sal_retval rv; | ||
897 | SAL_CALL_REENTRANT(rv, SN_SAL_SYSCTL_OP, SAL_SYSCTL_OP_IOBOARD, | ||
898 | nasid, 0, 0, 0, 0, 0); | ||
899 | if (rv.v0 != 0) | ||
900 | return (int)rv.v0; | ||
901 | if (rv.v1 != 0) | ||
902 | return (int)rv.v1; | ||
903 | |||
904 | return 0; | ||
905 | } | ||
906 | |||
876 | /** | 907 | /** |
877 | * ia64_sn_get_fit_compt - read a FIT entry from the PROM header | 908 | * ia64_sn_get_fit_compt - read a FIT entry from the PROM header |
878 | * @nasid: NASID of node to read | 909 | * @nasid: NASID of node to read |
diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h index 5ccec608d325..b532ef6148ed 100644 --- a/include/asm-ia64/sn/tioca_provider.h +++ b/include/asm-ia64/sn/tioca_provider.h | |||
@@ -182,11 +182,11 @@ tioca_tlbflush(struct tioca_kernel *tioca_kernel) | |||
182 | * touch every CL aligned GART entry. | 182 | * touch every CL aligned GART entry. |
183 | */ | 183 | */ |
184 | 184 | ||
185 | ca_base->ca_control2 &= ~(CA_GART_MEM_PARAM); | 185 | __sn_clrq_relaxed(&ca_base->ca_control2, CA_GART_MEM_PARAM); |
186 | ca_base->ca_control2 |= CA_GART_FLUSH_TLB; | 186 | __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB); |
187 | ca_base->ca_control2 |= | 187 | __sn_setq_relaxed(&ca_base->ca_control2, |
188 | (0x2ull << CA_GART_MEM_PARAM_SHFT); | 188 | (0x2ull << CA_GART_MEM_PARAM_SHFT)); |
189 | tmp = ca_base->ca_control2; | 189 | tmp = __sn_readq_relaxed(&ca_base->ca_control2); |
190 | } | 190 | } |
191 | 191 | ||
192 | return; | 192 | return; |
@@ -196,8 +196,8 @@ tioca_tlbflush(struct tioca_kernel *tioca_kernel) | |||
196 | * Gart in uncached mode ... need an explicit flush. | 196 | * Gart in uncached mode ... need an explicit flush. |
197 | */ | 197 | */ |
198 | 198 | ||
199 | ca_base->ca_control2 |= CA_GART_FLUSH_TLB; | 199 | __sn_setq_relaxed(&ca_base->ca_control2, CA_GART_FLUSH_TLB); |
200 | tmp = ca_base->ca_control2; | 200 | tmp = __sn_readq_relaxed(&ca_base->ca_control2); |
201 | } | 201 | } |
202 | 202 | ||
203 | extern uint32_t tioca_gart_found; | 203 | extern uint32_t tioca_gart_found; |
diff --git a/include/asm-ia64/sn/tiocx.h b/include/asm-ia64/sn/tiocx.h index c5447a504509..5699e75e5024 100644 --- a/include/asm-ia64/sn/tiocx.h +++ b/include/asm-ia64/sn/tiocx.h | |||
@@ -19,6 +19,7 @@ struct cx_id_s { | |||
19 | 19 | ||
20 | struct cx_dev { | 20 | struct cx_dev { |
21 | struct cx_id_s cx_id; | 21 | struct cx_id_s cx_id; |
22 | int bt; /* board/blade type */ | ||
22 | void *soft; /* driver specific */ | 23 | void *soft; /* driver specific */ |
23 | struct hubdev_info *hubdev; | 24 | struct hubdev_info *hubdev; |
24 | struct device dev; | 25 | struct device dev; |
@@ -59,7 +60,7 @@ struct cx_drv { | |||
59 | extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int); | 60 | extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int); |
60 | extern void tiocx_irq_free(struct sn_irq_info *); | 61 | extern void tiocx_irq_free(struct sn_irq_info *); |
61 | extern int cx_device_unregister(struct cx_dev *); | 62 | extern int cx_device_unregister(struct cx_dev *); |
62 | extern int cx_device_register(nasid_t, int, int, struct hubdev_info *); | 63 | extern int cx_device_register(nasid_t, int, int, struct hubdev_info *, int); |
63 | extern int cx_driver_unregister(struct cx_drv *); | 64 | extern int cx_driver_unregister(struct cx_drv *); |
64 | extern int cx_driver_register(struct cx_drv *); | 65 | extern int cx_driver_register(struct cx_drv *); |
65 | extern uint64_t tiocx_dma_addr(uint64_t addr); | 66 | extern uint64_t tiocx_dma_addr(uint64_t addr); |
diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h index 1df1c9f61a65..49faf8f26430 100644 --- a/include/asm-ia64/sn/xp.h +++ b/include/asm-ia64/sn/xp.h | |||
@@ -49,7 +49,7 @@ | |||
49 | * C-brick nasids, thus the need for bitmaps which don't account for | 49 | * C-brick nasids, thus the need for bitmaps which don't account for |
50 | * odd-numbered (non C-brick) nasids. | 50 | * odd-numbered (non C-brick) nasids. |
51 | */ | 51 | */ |
52 | #define XP_MAX_PHYSNODE_ID (MAX_PHYSNODE_ID / 2) | 52 | #define XP_MAX_PHYSNODE_ID (MAX_NUMALINK_NODES / 2) |
53 | #define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8) | 53 | #define XP_NASID_MASK_BYTES ((XP_MAX_PHYSNODE_ID + 7) / 8) |
54 | #define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64) | 54 | #define XP_NASID_MASK_WORDS ((XP_MAX_PHYSNODE_ID + 63) / 64) |
55 | 55 | ||
@@ -217,7 +217,17 @@ enum xpc_retval { | |||
217 | xpcInvalidPartid, /* 42: invalid partition ID */ | 217 | xpcInvalidPartid, /* 42: invalid partition ID */ |
218 | xpcLocalPartid, /* 43: local partition ID */ | 218 | xpcLocalPartid, /* 43: local partition ID */ |
219 | 219 | ||
220 | xpcUnknownReason /* 44: unknown reason -- must be last in list */ | 220 | xpcOtherGoingDown, /* 44: other side going down, reason unknown */ |
221 | xpcSystemGoingDown, /* 45: system is going down, reason unknown */ | ||
222 | xpcSystemHalt, /* 46: system is being halted */ | ||
223 | xpcSystemReboot, /* 47: system is being rebooted */ | ||
224 | xpcSystemPoweroff, /* 48: system is being powered off */ | ||
225 | |||
226 | xpcDisconnecting, /* 49: channel disconnecting (closing) */ | ||
227 | |||
228 | xpcOpenCloseError, /* 50: channel open/close protocol error */ | ||
229 | |||
230 | xpcUnknownReason /* 51: unknown reason -- must be last in list */ | ||
221 | }; | 231 | }; |
222 | 232 | ||
223 | 233 | ||
@@ -342,7 +352,7 @@ typedef void (*xpc_notify_func)(enum xpc_retval reason, partid_t partid, | |||
342 | * | 352 | * |
343 | * The 'func' field points to the function to call when aynchronous | 353 | * The 'func' field points to the function to call when aynchronous |
344 | * notification is required for such events as: a connection established/lost, | 354 | * notification is required for such events as: a connection established/lost, |
345 | * or an incomming message received, or an error condition encountered. A | 355 | * or an incoming message received, or an error condition encountered. A |
346 | * non-NULL 'func' field indicates that there is an active registration for | 356 | * non-NULL 'func' field indicates that there is an active registration for |
347 | * the channel. | 357 | * the channel. |
348 | */ | 358 | */ |
diff --git a/include/asm-ia64/sparsemem.h b/include/asm-ia64/sparsemem.h new file mode 100644 index 000000000000..67a7c40ec27f --- /dev/null +++ b/include/asm-ia64/sparsemem.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _ASM_IA64_SPARSEMEM_H | ||
2 | #define _ASM_IA64_SPARSEMEM_H | ||
3 | |||
4 | #ifdef CONFIG_SPARSEMEM | ||
5 | /* | ||
6 | * SECTION_SIZE_BITS 2^N: how big each section will be | ||
7 | * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space | ||
8 | */ | ||
9 | |||
10 | #define SECTION_SIZE_BITS (30) | ||
11 | #define MAX_PHYSMEM_BITS (50) | ||
12 | #ifdef CONFIG_FORCE_MAX_ZONEORDER | ||
13 | #if ((CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS) | ||
14 | #undef SECTION_SIZE_BITS | ||
15 | #define SECTION_SIZE_BITS (CONFIG_FORCE_MAX_ZONEORDER - 1 + PAGE_SHIFT) | ||
16 | #endif | ||
17 | #endif | ||
18 | |||
19 | #endif /* CONFIG_SPARSEMEM */ | ||
20 | #endif /* _ASM_IA64_SPARSEMEM_H */ | ||
diff --git a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h index 3a9a6d1be75c..834370b9dea1 100644 --- a/include/asm-ia64/tlb.h +++ b/include/asm-ia64/tlb.h | |||
@@ -60,7 +60,6 @@ struct mmu_gather { | |||
60 | unsigned int nr; /* == ~0U => fast mode */ | 60 | unsigned int nr; /* == ~0U => fast mode */ |
61 | unsigned char fullmm; /* non-zero means full mm flush */ | 61 | unsigned char fullmm; /* non-zero means full mm flush */ |
62 | unsigned char need_flush; /* really unmapped some PTEs? */ | 62 | unsigned char need_flush; /* really unmapped some PTEs? */ |
63 | unsigned long freed; /* number of pages freed */ | ||
64 | unsigned long start_addr; | 63 | unsigned long start_addr; |
65 | unsigned long end_addr; | 64 | unsigned long end_addr; |
66 | struct page *pages[FREE_PTE_NR]; | 65 | struct page *pages[FREE_PTE_NR]; |
@@ -129,7 +128,7 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e | |||
129 | static inline struct mmu_gather * | 128 | static inline struct mmu_gather * |
130 | tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush) | 129 | tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush) |
131 | { | 130 | { |
132 | struct mmu_gather *tlb = &__get_cpu_var(mmu_gathers); | 131 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); |
133 | 132 | ||
134 | tlb->mm = mm; | 133 | tlb->mm = mm; |
135 | /* | 134 | /* |
@@ -147,25 +146,17 @@ tlb_gather_mmu (struct mm_struct *mm, unsigned int full_mm_flush) | |||
147 | */ | 146 | */ |
148 | tlb->nr = (num_online_cpus() == 1) ? ~0U : 0; | 147 | tlb->nr = (num_online_cpus() == 1) ? ~0U : 0; |
149 | tlb->fullmm = full_mm_flush; | 148 | tlb->fullmm = full_mm_flush; |
150 | tlb->freed = 0; | ||
151 | tlb->start_addr = ~0UL; | 149 | tlb->start_addr = ~0UL; |
152 | return tlb; | 150 | return tlb; |
153 | } | 151 | } |
154 | 152 | ||
155 | /* | 153 | /* |
156 | * Called at the end of the shootdown operation to free up any resources that were | 154 | * Called at the end of the shootdown operation to free up any resources that were |
157 | * collected. The page table lock is still held at this point. | 155 | * collected. |
158 | */ | 156 | */ |
159 | static inline void | 157 | static inline void |
160 | tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) | 158 | tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) |
161 | { | 159 | { |
162 | unsigned long freed = tlb->freed; | ||
163 | struct mm_struct *mm = tlb->mm; | ||
164 | unsigned long rss = get_mm_counter(mm, rss); | ||
165 | |||
166 | if (rss < freed) | ||
167 | freed = rss; | ||
168 | add_mm_counter(mm, rss, -freed); | ||
169 | /* | 160 | /* |
170 | * Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and | 161 | * Note: tlb->nr may be 0 at this point, so we can't rely on tlb->start_addr and |
171 | * tlb->end_addr. | 162 | * tlb->end_addr. |
@@ -174,12 +165,8 @@ tlb_finish_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) | |||
174 | 165 | ||
175 | /* keep the page table cache within bounds */ | 166 | /* keep the page table cache within bounds */ |
176 | check_pgt_cache(); | 167 | check_pgt_cache(); |
177 | } | ||
178 | 168 | ||
179 | static inline unsigned int | 169 | put_cpu_var(mmu_gathers); |
180 | tlb_is_full_mm(struct mmu_gather *tlb) | ||
181 | { | ||
182 | return tlb->fullmm; | ||
183 | } | 170 | } |
184 | 171 | ||
185 | /* | 172 | /* |
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h index 3a0c69524656..6d96a67439be 100644 --- a/include/asm-ia64/unistd.h +++ b/include/asm-ia64/unistd.h | |||
@@ -383,8 +383,6 @@ struct sigaction; | |||
383 | long sys_execve(char __user *filename, char __user * __user *argv, | 383 | long sys_execve(char __user *filename, char __user * __user *argv, |
384 | char __user * __user *envp, struct pt_regs *regs); | 384 | char __user * __user *envp, struct pt_regs *regs); |
385 | asmlinkage long sys_pipe(void); | 385 | asmlinkage long sys_pipe(void); |
386 | asmlinkage long sys_ptrace(long request, pid_t pid, | ||
387 | unsigned long addr, unsigned long data); | ||
388 | asmlinkage long sys_rt_sigaction(int sig, | 386 | asmlinkage long sys_rt_sigaction(int sig, |
389 | const struct sigaction __user *act, | 387 | const struct sigaction __user *act, |
390 | struct sigaction __user *oact, | 388 | struct sigaction __user *oact, |
diff --git a/include/asm-m32r/dma-mapping.h b/include/asm-m32r/dma-mapping.h index 3a2db28834b6..a7fa0302bda7 100644 --- a/include/asm-m32r/dma-mapping.h +++ b/include/asm-m32r/dma-mapping.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | static inline void * | 9 | static inline void * |
10 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 10 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
11 | int flag) | 11 | gfp_t flag) |
12 | { | 12 | { |
13 | return (void *)NULL; | 13 | return (void *)NULL; |
14 | } | 14 | } |
diff --git a/include/asm-m32r/mmzone.h b/include/asm-m32r/mmzone.h index d58878ec899e..adc7970a77ec 100644 --- a/include/asm-m32r/mmzone.h +++ b/include/asm-m32r/mmzone.h | |||
@@ -21,12 +21,6 @@ extern struct pglist_data *node_data[]; | |||
21 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages - 1; \ | 21 | __pgdat->node_start_pfn + __pgdat->node_spanned_pages - 1; \ |
22 | }) | 22 | }) |
23 | 23 | ||
24 | #define local_mapnr(kvaddr) \ | ||
25 | ({ \ | ||
26 | unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT; \ | ||
27 | (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \ | ||
28 | }) | ||
29 | |||
30 | #define pfn_to_page(pfn) \ | 24 | #define pfn_to_page(pfn) \ |
31 | ({ \ | 25 | ({ \ |
32 | unsigned long __pfn = pfn; \ | 26 | unsigned long __pfn = pfn; \ |
diff --git a/include/asm-m32r/pgtable.h b/include/asm-m32r/pgtable.h index 388e5ee9fa27..1cd5fd4a5b2c 100644 --- a/include/asm-m32r/pgtable.h +++ b/include/asm-m32r/pgtable.h | |||
@@ -324,8 +324,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
324 | return pte; | 324 | return pte; |
325 | } | 325 | } |
326 | 326 | ||
327 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
328 | |||
329 | /* | 327 | /* |
330 | * Conversion functions: convert a page and protection to a page entry, | 328 | * Conversion functions: convert a page and protection to a page entry, |
331 | * and a page entry and page directory to the page they refer to. | 329 | * and a page entry and page directory to the page they refer to. |
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h index 53e3c60f21ec..bf447c52a0a1 100644 --- a/include/asm-m32r/semaphore.h +++ b/include/asm-m32r/semaphore.h | |||
@@ -32,9 +32,6 @@ struct semaphore { | |||
32 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 32 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
33 | } | 33 | } |
34 | 34 | ||
35 | #define __MUTEX_INITIALIZER(name) \ | ||
36 | __SEMAPHORE_INITIALIZER(name,1) | ||
37 | |||
38 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 35 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
39 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 36 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
40 | 37 | ||
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h index 7a6be7727a92..0f589363f619 100644 --- a/include/asm-m32r/thread_info.h +++ b/include/asm-m32r/thread_info.h | |||
@@ -95,7 +95,7 @@ static inline struct thread_info *current_thread_info(void) | |||
95 | } | 95 | } |
96 | 96 | ||
97 | /* thread information allocation */ | 97 | /* thread information allocation */ |
98 | #if CONFIG_DEBUG_STACK_USAGE | 98 | #ifdef CONFIG_DEBUG_STACK_USAGE |
99 | #define alloc_thread_info(tsk) \ | 99 | #define alloc_thread_info(tsk) \ |
100 | ({ \ | 100 | ({ \ |
101 | struct thread_info *ret; \ | 101 | struct thread_info *ret; \ |
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h index 8552d8f45ab1..ac399e1f7bc0 100644 --- a/include/asm-m32r/unistd.h +++ b/include/asm-m32r/unistd.h | |||
@@ -452,7 +452,6 @@ asmlinkage int sys_clone(struct pt_regs regs); | |||
452 | asmlinkage int sys_fork(struct pt_regs regs); | 452 | asmlinkage int sys_fork(struct pt_regs regs); |
453 | asmlinkage int sys_vfork(struct pt_regs regs); | 453 | asmlinkage int sys_vfork(struct pt_regs regs); |
454 | asmlinkage int sys_pipe(unsigned long __user *fildes); | 454 | asmlinkage int sys_pipe(unsigned long __user *fildes); |
455 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
456 | struct sigaction; | 455 | struct sigaction; |
457 | asmlinkage long sys_rt_sigaction(int sig, | 456 | asmlinkage long sys_rt_sigaction(int sig, |
458 | const struct sigaction __user *act, | 457 | const struct sigaction __user *act, |
diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h index ab94cf3ed447..fd4c7cc3d3be 100644 --- a/include/asm-m68k/semaphore.h +++ b/include/asm-m68k/semaphore.h | |||
@@ -36,9 +36,6 @@ struct semaphore { | |||
36 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 36 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
37 | } | 37 | } |
38 | 38 | ||
39 | #define __MUTEX_INITIALIZER(name) \ | ||
40 | __SEMAPHORE_INITIALIZER(name,1) | ||
41 | |||
42 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 39 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
43 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 40 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
44 | 41 | ||
diff --git a/include/asm-m68k/sun3xflop.h b/include/asm-m68k/sun3xflop.h index 1ed3b787ee05..fda1eccf10aa 100644 --- a/include/asm-m68k/sun3xflop.h +++ b/include/asm-m68k/sun3xflop.h | |||
@@ -27,10 +27,8 @@ | |||
27 | 27 | ||
28 | /* We don't need no stinkin' I/O port allocation crap. */ | 28 | /* We don't need no stinkin' I/O port allocation crap. */ |
29 | #undef release_region | 29 | #undef release_region |
30 | #undef check_region | ||
31 | #undef request_region | 30 | #undef request_region |
32 | #define release_region(X, Y) do { } while(0) | 31 | #define release_region(X, Y) do { } while(0) |
33 | #define check_region(X, Y) (0) | ||
34 | #define request_region(X, Y, Z) (1) | 32 | #define request_region(X, Y, Z) (1) |
35 | 33 | ||
36 | struct sun3xflop_private { | 34 | struct sun3xflop_private { |
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index cbabde4f8a45..c2554bcd1747 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h | |||
@@ -444,7 +444,6 @@ asmlinkage long sys_mmap2( | |||
444 | unsigned long fd, unsigned long pgoff); | 444 | unsigned long fd, unsigned long pgoff); |
445 | asmlinkage int sys_execve(char *name, char **argv, char **envp); | 445 | asmlinkage int sys_execve(char *name, char **argv, char **envp); |
446 | asmlinkage int sys_pipe(unsigned long *fildes); | 446 | asmlinkage int sys_pipe(unsigned long *fildes); |
447 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
448 | struct pt_regs; | 447 | struct pt_regs; |
449 | struct sigaction; | 448 | struct sigaction; |
450 | asmlinkage long sys_rt_sigaction(int sig, | 449 | asmlinkage long sys_rt_sigaction(int sig, |
diff --git a/include/asm-m68knommu/ide.h b/include/asm-m68knommu/ide.h index b1cbf8bb9232..836f0721ecf9 100644 --- a/include/asm-m68knommu/ide.h +++ b/include/asm-m68knommu/ide.h | |||
@@ -163,13 +163,6 @@ ide_free_irq(unsigned int irq, void *dev_id) | |||
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
166 | static IDE_INLINE int | ||
167 | ide_check_region(ide_ioreg_t from, unsigned int extent) | ||
168 | { | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | |||
173 | static IDE_INLINE void | 166 | static IDE_INLINE void |
174 | ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) | 167 | ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) |
175 | { | 168 | { |
diff --git a/include/asm-m68knommu/semaphore.h b/include/asm-m68knommu/semaphore.h index febe85add509..17aee15906a6 100644 --- a/include/asm-m68knommu/semaphore.h +++ b/include/asm-m68knommu/semaphore.h | |||
@@ -35,9 +35,6 @@ struct semaphore { | |||
35 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 35 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
36 | } | 36 | } |
37 | 37 | ||
38 | #define __MUTEX_INITIALIZER(name) \ | ||
39 | __SEMAPHORE_INITIALIZER(name,1) | ||
40 | |||
41 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 38 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
42 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 39 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
43 | 40 | ||
diff --git a/include/asm-m68knommu/unistd.h b/include/asm-m68knommu/unistd.h index 84b6fa14459f..5373988a7e51 100644 --- a/include/asm-m68knommu/unistd.h +++ b/include/asm-m68knommu/unistd.h | |||
@@ -504,7 +504,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | |||
504 | unsigned long fd, unsigned long pgoff); | 504 | unsigned long fd, unsigned long pgoff); |
505 | asmlinkage int sys_execve(char *name, char **argv, char **envp); | 505 | asmlinkage int sys_execve(char *name, char **argv, char **envp); |
506 | asmlinkage int sys_pipe(unsigned long *fildes); | 506 | asmlinkage int sys_pipe(unsigned long *fildes); |
507 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
508 | struct pt_regs; | 507 | struct pt_regs; |
509 | int sys_request_irq(unsigned int, | 508 | int sys_request_irq(unsigned int, |
510 | irqreturn_t (*)(int, void *, struct pt_regs *), | 509 | irqreturn_t (*)(int, void *, struct pt_regs *), |
diff --git a/include/asm-mips/abi.h b/include/asm-mips/abi.h new file mode 100644 index 000000000000..2e7e651c3e3f --- /dev/null +++ b/include/asm-mips/abi.h | |||
@@ -0,0 +1,25 @@ | |||
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) 2005 by Ralf Baechle | ||
7 | * Copyright (C) 2005 MIPS Technologies, Inc. | ||
8 | */ | ||
9 | #ifndef _ASM_ABI_H | ||
10 | #define _ASM_ABI_H | ||
11 | |||
12 | #include <asm/signal.h> | ||
13 | #include <asm/siginfo.h> | ||
14 | |||
15 | struct mips_abi { | ||
16 | int (* const do_signal)(sigset_t *oldset, struct pt_regs *regs); | ||
17 | int (* const setup_frame)(struct k_sigaction * ka, | ||
18 | struct pt_regs *regs, int signr, | ||
19 | sigset_t *set); | ||
20 | int (* const setup_rt_frame)(struct k_sigaction * ka, | ||
21 | struct pt_regs *regs, int signr, | ||
22 | sigset_t *set, siginfo_t *info); | ||
23 | }; | ||
24 | |||
25 | #endif /* _ASM_ABI_H */ | ||
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 7dc2619f5006..42520cc84b0f 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h | |||
@@ -20,10 +20,12 @@ | |||
20 | #define _ATYPE_ | 20 | #define _ATYPE_ |
21 | #define _ATYPE32_ | 21 | #define _ATYPE32_ |
22 | #define _ATYPE64_ | 22 | #define _ATYPE64_ |
23 | #define _LLCONST_(x) x | ||
23 | #else | 24 | #else |
24 | #define _ATYPE_ __PTRDIFF_TYPE__ | 25 | #define _ATYPE_ __PTRDIFF_TYPE__ |
25 | #define _ATYPE32_ int | 26 | #define _ATYPE32_ int |
26 | #define _ATYPE64_ long long | 27 | #define _ATYPE64_ long long |
28 | #define _LLCONST_(x) x ## LL | ||
27 | #endif | 29 | #endif |
28 | 30 | ||
29 | /* | 31 | /* |
@@ -45,8 +47,9 @@ | |||
45 | /* | 47 | /* |
46 | * Returns the physical address of a CKSEGx / XKPHYS address | 48 | * Returns the physical address of a CKSEGx / XKPHYS address |
47 | */ | 49 | */ |
48 | #define CPHYSADDR(a) ((_ACAST32_ (a)) & 0x1fffffff) | 50 | #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) |
49 | #define XPHYSADDR(a) ((_ACAST64_ (a)) & 0x000000ffffffffff) | 51 | #define XPHYSADDR(a) ((_ACAST64_(a)) & \ |
52 | _LLCONST_(0x000000ffffffffff)) | ||
50 | 53 | ||
51 | #ifdef CONFIG_64BIT | 54 | #ifdef CONFIG_64BIT |
52 | 55 | ||
@@ -55,14 +58,14 @@ | |||
55 | * The compatibility segments use the full 64-bit sign extended value. Note | 58 | * The compatibility segments use the full 64-bit sign extended value. Note |
56 | * the R8000 doesn't have them so don't reference these in generic MIPS code. | 59 | * the R8000 doesn't have them so don't reference these in generic MIPS code. |
57 | */ | 60 | */ |
58 | #define XKUSEG 0x0000000000000000 | 61 | #define XKUSEG _LLCONST_(0x0000000000000000) |
59 | #define XKSSEG 0x4000000000000000 | 62 | #define XKSSEG _LLCONST_(0x4000000000000000) |
60 | #define XKPHYS 0x8000000000000000 | 63 | #define XKPHYS _LLCONST_(0x8000000000000000) |
61 | #define XKSEG 0xc000000000000000 | 64 | #define XKSEG _LLCONST_(0xc000000000000000) |
62 | #define CKSEG0 0xffffffff80000000 | 65 | #define CKSEG0 _LLCONST_(0xffffffff80000000) |
63 | #define CKSEG1 0xffffffffa0000000 | 66 | #define CKSEG1 _LLCONST_(0xffffffffa0000000) |
64 | #define CKSSEG 0xffffffffc0000000 | 67 | #define CKSSEG _LLCONST_(0xffffffffc0000000) |
65 | #define CKSEG3 0xffffffffe0000000 | 68 | #define CKSEG3 _LLCONST_(0xffffffffe0000000) |
66 | 69 | ||
67 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) | 70 | #define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0) |
68 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) | 71 | #define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1) |
@@ -120,7 +123,8 @@ | |||
120 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) | 123 | #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) |
121 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) | 124 | #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) |
122 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) | 125 | #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) |
123 | #define PHYS_TO_XKPHYS(cm,a) (0x8000000000000000 | ((cm)<<59) | (a)) | 126 | #define PHYS_TO_XKPHYS(cm,a) (_LLCONST_(0x8000000000000000) | \ |
127 | ((cm)<<59) | (a)) | ||
124 | 128 | ||
125 | #if defined (CONFIG_CPU_R4300) \ | 129 | #if defined (CONFIG_CPU_R4300) \ |
126 | || defined (CONFIG_CPU_R4X00) \ | 130 | || defined (CONFIG_CPU_R4X00) \ |
@@ -128,46 +132,56 @@ | |||
128 | || defined (CONFIG_CPU_NEVADA) \ | 132 | || defined (CONFIG_CPU_NEVADA) \ |
129 | || defined (CONFIG_CPU_TX49XX) \ | 133 | || defined (CONFIG_CPU_TX49XX) \ |
130 | || defined (CONFIG_CPU_MIPS64) | 134 | || defined (CONFIG_CPU_MIPS64) |
131 | #define KUSIZE 0x0000010000000000 /* 2^^40 */ | 135 | #define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
132 | #define KUSIZE_64 0x0000010000000000 /* 2^^40 */ | 136 | #define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */ |
133 | #define K0SIZE 0x0000001000000000 /* 2^^36 */ | 137 | #define K0SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */ |
134 | #define K1SIZE 0x0000001000000000 /* 2^^36 */ | 138 | #define K1SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */ |
135 | #define K2SIZE 0x000000ff80000000 | 139 | #define K2SIZE _LLCONST_(0x000000ff80000000) |
136 | #define KSEGSIZE 0x000000ff80000000 /* max syssegsz */ | 140 | #define KSEGSIZE _LLCONST_(0x000000ff80000000) /* max syssegsz */ |
137 | #define TO_PHYS_MASK 0x0000000fffffffff /* 2^^36 - 1 */ | 141 | #define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */ |
138 | #endif | 142 | #endif |
139 | 143 | ||
140 | #if defined (CONFIG_CPU_R8000) | 144 | #if defined (CONFIG_CPU_R8000) |
141 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ | 145 | /* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ |
142 | #define KUSIZE 0x0000010000000000 /* 2^^40 */ | 146 | #define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
143 | #define KUSIZE_64 0x0000010000000000 /* 2^^40 */ | 147 | #define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */ |
144 | #define K0SIZE 0x0000010000000000 /* 2^^40 */ | 148 | #define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
145 | #define K1SIZE 0x0000010000000000 /* 2^^40 */ | 149 | #define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
146 | #define K2SIZE 0x0001000000000000 | 150 | #define K2SIZE _LLCONST_(0x0001000000000000) |
147 | #define KSEGSIZE 0x0000010000000000 /* max syssegsz */ | 151 | #define KSEGSIZE _LLCONST_(0x0000010000000000) /* max syssegsz */ |
148 | #define TO_PHYS_MASK 0x000000ffffffffff /* 2^^40 - 1 */ | 152 | #define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ |
149 | #endif | 153 | #endif |
150 | 154 | ||
151 | #if defined (CONFIG_CPU_R10000) | 155 | #if defined (CONFIG_CPU_R10000) |
152 | #define KUSIZE 0x0000010000000000 /* 2^^40 */ | 156 | #define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
153 | #define KUSIZE_64 0x0000010000000000 /* 2^^40 */ | 157 | #define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */ |
154 | #define K0SIZE 0x0000010000000000 /* 2^^40 */ | 158 | #define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
155 | #define K1SIZE 0x0000010000000000 /* 2^^40 */ | 159 | #define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */ |
156 | #define K2SIZE 0x00000fff80000000 | 160 | #define K2SIZE _LLCONST_(0x00000fff80000000) |
157 | #define KSEGSIZE 0x00000fff80000000 /* max syssegsz */ | 161 | #define KSEGSIZE _LLCONST_(0x00000fff80000000) /* max syssegsz */ |
158 | #define TO_PHYS_MASK 0x000000ffffffffff /* 2^^40 - 1 */ | 162 | #define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ |
163 | #endif | ||
164 | |||
165 | #if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) | ||
166 | #define KUSIZE _LLCONST_(0x0000100000000000) /* 2^^44 */ | ||
167 | #define KUSIZE_64 _LLCONST_(0x0000100000000000) /* 2^^44 */ | ||
168 | #define K0SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */ | ||
169 | #define K1SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */ | ||
170 | #define K2SIZE _LLCONST_(0x0000ffff80000000) | ||
171 | #define KSEGSIZE _LLCONST_(0x0000ffff80000000) /* max syssegsz */ | ||
172 | #define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */ | ||
159 | #endif | 173 | #endif |
160 | 174 | ||
161 | /* | 175 | /* |
162 | * Further names for SGI source compatibility. These are stolen from | 176 | * Further names for SGI source compatibility. These are stolen from |
163 | * IRIX's <sys/mips_addrspace.h>. | 177 | * IRIX's <sys/mips_addrspace.h>. |
164 | */ | 178 | */ |
165 | #define KUBASE 0 | 179 | #define KUBASE _LLCONST_(0) |
166 | #define KUSIZE_32 0x0000000080000000 /* KUSIZE | 180 | #define KUSIZE_32 _LLCONST_(0x0000000080000000) /* KUSIZE |
167 | for a 32 bit proc */ | 181 | for a 32 bit proc */ |
168 | #define K0BASE_EXL_WR 0xa800000000000000 /* exclusive on write */ | 182 | #define K0BASE_EXL_WR _LLCONST_(0xa800000000000000) /* exclusive on write */ |
169 | #define K0BASE_NONCOH 0x9800000000000000 /* noncoherent */ | 183 | #define K0BASE_NONCOH _LLCONST_(0x9800000000000000) /* noncoherent */ |
170 | #define K0BASE_EXL 0xa000000000000000 /* exclusive */ | 184 | #define K0BASE_EXL _LLCONST_(0xa000000000000000) /* exclusive */ |
171 | 185 | ||
172 | #ifndef CONFIG_CPU_R8000 | 186 | #ifndef CONFIG_CPU_R8000 |
173 | 187 | ||
@@ -176,7 +190,7 @@ | |||
176 | * in order to catch bugs in the source code. | 190 | * in order to catch bugs in the source code. |
177 | */ | 191 | */ |
178 | 192 | ||
179 | #define COMPAT_K1BASE32 0xffffffffa0000000 | 193 | #define COMPAT_K1BASE32 _LLCONST_(0xffffffffa0000000) |
180 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ | 194 | #define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */ |
181 | 195 | ||
182 | #endif | 196 | #endif |
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h index f53237772985..4b090f3142e0 100644 --- a/include/asm-mips/asm.h +++ b/include/asm-mips/asm.h | |||
@@ -107,6 +107,7 @@ symbol = value | |||
107 | /* | 107 | /* |
108 | * Print formatted string | 108 | * Print formatted string |
109 | */ | 109 | */ |
110 | #ifdef CONFIG_PRINTK | ||
110 | #define PRINT(string) \ | 111 | #define PRINT(string) \ |
111 | .set push; \ | 112 | .set push; \ |
112 | .set reorder; \ | 113 | .set reorder; \ |
@@ -114,6 +115,9 @@ symbol = value | |||
114 | jal printk; \ | 115 | jal printk; \ |
115 | .set pop; \ | 116 | .set pop; \ |
116 | TEXT(string) | 117 | TEXT(string) |
118 | #else | ||
119 | #define PRINT(string) | ||
120 | #endif | ||
117 | 121 | ||
118 | #define TEXT(msg) \ | 122 | #define TEXT(msg) \ |
119 | .pushsection .data; \ | 123 | .pushsection .data; \ |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index c0bd8d014e14..6202eb8a14b7 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -62,20 +62,24 @@ static __inline__ void atomic_add(int i, atomic_t * v) | |||
62 | unsigned long temp; | 62 | unsigned long temp; |
63 | 63 | ||
64 | __asm__ __volatile__( | 64 | __asm__ __volatile__( |
65 | " .set mips3 \n" | ||
65 | "1: ll %0, %1 # atomic_add \n" | 66 | "1: ll %0, %1 # atomic_add \n" |
66 | " addu %0, %2 \n" | 67 | " addu %0, %2 \n" |
67 | " sc %0, %1 \n" | 68 | " sc %0, %1 \n" |
68 | " beqzl %0, 1b \n" | 69 | " beqzl %0, 1b \n" |
70 | " .set mips0 \n" | ||
69 | : "=&r" (temp), "=m" (v->counter) | 71 | : "=&r" (temp), "=m" (v->counter) |
70 | : "Ir" (i), "m" (v->counter)); | 72 | : "Ir" (i), "m" (v->counter)); |
71 | } else if (cpu_has_llsc) { | 73 | } else if (cpu_has_llsc) { |
72 | unsigned long temp; | 74 | unsigned long temp; |
73 | 75 | ||
74 | __asm__ __volatile__( | 76 | __asm__ __volatile__( |
77 | " .set mips3 \n" | ||
75 | "1: ll %0, %1 # atomic_add \n" | 78 | "1: ll %0, %1 # atomic_add \n" |
76 | " addu %0, %2 \n" | 79 | " addu %0, %2 \n" |
77 | " sc %0, %1 \n" | 80 | " sc %0, %1 \n" |
78 | " beqz %0, 1b \n" | 81 | " beqz %0, 1b \n" |
82 | " .set mips0 \n" | ||
79 | : "=&r" (temp), "=m" (v->counter) | 83 | : "=&r" (temp), "=m" (v->counter) |
80 | : "Ir" (i), "m" (v->counter)); | 84 | : "Ir" (i), "m" (v->counter)); |
81 | } else { | 85 | } else { |
@@ -100,20 +104,24 @@ static __inline__ void atomic_sub(int i, atomic_t * v) | |||
100 | unsigned long temp; | 104 | unsigned long temp; |
101 | 105 | ||
102 | __asm__ __volatile__( | 106 | __asm__ __volatile__( |
107 | " .set mips3 \n" | ||
103 | "1: ll %0, %1 # atomic_sub \n" | 108 | "1: ll %0, %1 # atomic_sub \n" |
104 | " subu %0, %2 \n" | 109 | " subu %0, %2 \n" |
105 | " sc %0, %1 \n" | 110 | " sc %0, %1 \n" |
106 | " beqzl %0, 1b \n" | 111 | " beqzl %0, 1b \n" |
112 | " .set mips0 \n" | ||
107 | : "=&r" (temp), "=m" (v->counter) | 113 | : "=&r" (temp), "=m" (v->counter) |
108 | : "Ir" (i), "m" (v->counter)); | 114 | : "Ir" (i), "m" (v->counter)); |
109 | } else if (cpu_has_llsc) { | 115 | } else if (cpu_has_llsc) { |
110 | unsigned long temp; | 116 | unsigned long temp; |
111 | 117 | ||
112 | __asm__ __volatile__( | 118 | __asm__ __volatile__( |
119 | " .set mips3 \n" | ||
113 | "1: ll %0, %1 # atomic_sub \n" | 120 | "1: ll %0, %1 # atomic_sub \n" |
114 | " subu %0, %2 \n" | 121 | " subu %0, %2 \n" |
115 | " sc %0, %1 \n" | 122 | " sc %0, %1 \n" |
116 | " beqz %0, 1b \n" | 123 | " beqz %0, 1b \n" |
124 | " .set mips0 \n" | ||
117 | : "=&r" (temp), "=m" (v->counter) | 125 | : "=&r" (temp), "=m" (v->counter) |
118 | : "Ir" (i), "m" (v->counter)); | 126 | : "Ir" (i), "m" (v->counter)); |
119 | } else { | 127 | } else { |
@@ -136,12 +144,14 @@ static __inline__ int atomic_add_return(int i, atomic_t * v) | |||
136 | unsigned long temp; | 144 | unsigned long temp; |
137 | 145 | ||
138 | __asm__ __volatile__( | 146 | __asm__ __volatile__( |
147 | " .set mips3 \n" | ||
139 | "1: ll %1, %2 # atomic_add_return \n" | 148 | "1: ll %1, %2 # atomic_add_return \n" |
140 | " addu %0, %1, %3 \n" | 149 | " addu %0, %1, %3 \n" |
141 | " sc %0, %2 \n" | 150 | " sc %0, %2 \n" |
142 | " beqzl %0, 1b \n" | 151 | " beqzl %0, 1b \n" |
143 | " addu %0, %1, %3 \n" | 152 | " addu %0, %1, %3 \n" |
144 | " sync \n" | 153 | " sync \n" |
154 | " .set mips0 \n" | ||
145 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 155 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
146 | : "Ir" (i), "m" (v->counter) | 156 | : "Ir" (i), "m" (v->counter) |
147 | : "memory"); | 157 | : "memory"); |
@@ -149,12 +159,14 @@ static __inline__ int atomic_add_return(int i, atomic_t * v) | |||
149 | unsigned long temp; | 159 | unsigned long temp; |
150 | 160 | ||
151 | __asm__ __volatile__( | 161 | __asm__ __volatile__( |
162 | " .set mips3 \n" | ||
152 | "1: ll %1, %2 # atomic_add_return \n" | 163 | "1: ll %1, %2 # atomic_add_return \n" |
153 | " addu %0, %1, %3 \n" | 164 | " addu %0, %1, %3 \n" |
154 | " sc %0, %2 \n" | 165 | " sc %0, %2 \n" |
155 | " beqz %0, 1b \n" | 166 | " beqz %0, 1b \n" |
156 | " addu %0, %1, %3 \n" | 167 | " addu %0, %1, %3 \n" |
157 | " sync \n" | 168 | " sync \n" |
169 | " .set mips0 \n" | ||
158 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 170 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
159 | : "Ir" (i), "m" (v->counter) | 171 | : "Ir" (i), "m" (v->counter) |
160 | : "memory"); | 172 | : "memory"); |
@@ -179,12 +191,14 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) | |||
179 | unsigned long temp; | 191 | unsigned long temp; |
180 | 192 | ||
181 | __asm__ __volatile__( | 193 | __asm__ __volatile__( |
194 | " .set mips3 \n" | ||
182 | "1: ll %1, %2 # atomic_sub_return \n" | 195 | "1: ll %1, %2 # atomic_sub_return \n" |
183 | " subu %0, %1, %3 \n" | 196 | " subu %0, %1, %3 \n" |
184 | " sc %0, %2 \n" | 197 | " sc %0, %2 \n" |
185 | " beqzl %0, 1b \n" | 198 | " beqzl %0, 1b \n" |
186 | " subu %0, %1, %3 \n" | 199 | " subu %0, %1, %3 \n" |
187 | " sync \n" | 200 | " sync \n" |
201 | " .set mips0 \n" | ||
188 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 202 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
189 | : "Ir" (i), "m" (v->counter) | 203 | : "Ir" (i), "m" (v->counter) |
190 | : "memory"); | 204 | : "memory"); |
@@ -192,12 +206,14 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) | |||
192 | unsigned long temp; | 206 | unsigned long temp; |
193 | 207 | ||
194 | __asm__ __volatile__( | 208 | __asm__ __volatile__( |
209 | " .set mips3 \n" | ||
195 | "1: ll %1, %2 # atomic_sub_return \n" | 210 | "1: ll %1, %2 # atomic_sub_return \n" |
196 | " subu %0, %1, %3 \n" | 211 | " subu %0, %1, %3 \n" |
197 | " sc %0, %2 \n" | 212 | " sc %0, %2 \n" |
198 | " beqz %0, 1b \n" | 213 | " beqz %0, 1b \n" |
199 | " subu %0, %1, %3 \n" | 214 | " subu %0, %1, %3 \n" |
200 | " sync \n" | 215 | " sync \n" |
216 | " .set mips0 \n" | ||
201 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 217 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
202 | : "Ir" (i), "m" (v->counter) | 218 | : "Ir" (i), "m" (v->counter) |
203 | : "memory"); | 219 | : "memory"); |
@@ -229,6 +245,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
229 | unsigned long temp; | 245 | unsigned long temp; |
230 | 246 | ||
231 | __asm__ __volatile__( | 247 | __asm__ __volatile__( |
248 | " .set mips3 \n" | ||
232 | "1: ll %1, %2 # atomic_sub_if_positive\n" | 249 | "1: ll %1, %2 # atomic_sub_if_positive\n" |
233 | " subu %0, %1, %3 \n" | 250 | " subu %0, %1, %3 \n" |
234 | " bltz %0, 1f \n" | 251 | " bltz %0, 1f \n" |
@@ -236,6 +253,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
236 | " beqzl %0, 1b \n" | 253 | " beqzl %0, 1b \n" |
237 | " sync \n" | 254 | " sync \n" |
238 | "1: \n" | 255 | "1: \n" |
256 | " .set mips0 \n" | ||
239 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 257 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
240 | : "Ir" (i), "m" (v->counter) | 258 | : "Ir" (i), "m" (v->counter) |
241 | : "memory"); | 259 | : "memory"); |
@@ -243,6 +261,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
243 | unsigned long temp; | 261 | unsigned long temp; |
244 | 262 | ||
245 | __asm__ __volatile__( | 263 | __asm__ __volatile__( |
264 | " .set mips3 \n" | ||
246 | "1: ll %1, %2 # atomic_sub_if_positive\n" | 265 | "1: ll %1, %2 # atomic_sub_if_positive\n" |
247 | " subu %0, %1, %3 \n" | 266 | " subu %0, %1, %3 \n" |
248 | " bltz %0, 1f \n" | 267 | " bltz %0, 1f \n" |
@@ -250,6 +269,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
250 | " beqz %0, 1b \n" | 269 | " beqz %0, 1b \n" |
251 | " sync \n" | 270 | " sync \n" |
252 | "1: \n" | 271 | "1: \n" |
272 | " .set mips0 \n" | ||
253 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 273 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
254 | : "Ir" (i), "m" (v->counter) | 274 | : "Ir" (i), "m" (v->counter) |
255 | : "memory"); | 275 | : "memory"); |
@@ -367,20 +387,24 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
367 | unsigned long temp; | 387 | unsigned long temp; |
368 | 388 | ||
369 | __asm__ __volatile__( | 389 | __asm__ __volatile__( |
390 | " .set mips3 \n" | ||
370 | "1: lld %0, %1 # atomic64_add \n" | 391 | "1: lld %0, %1 # atomic64_add \n" |
371 | " addu %0, %2 \n" | 392 | " addu %0, %2 \n" |
372 | " scd %0, %1 \n" | 393 | " scd %0, %1 \n" |
373 | " beqzl %0, 1b \n" | 394 | " beqzl %0, 1b \n" |
395 | " .set mips0 \n" | ||
374 | : "=&r" (temp), "=m" (v->counter) | 396 | : "=&r" (temp), "=m" (v->counter) |
375 | : "Ir" (i), "m" (v->counter)); | 397 | : "Ir" (i), "m" (v->counter)); |
376 | } else if (cpu_has_llsc) { | 398 | } else if (cpu_has_llsc) { |
377 | unsigned long temp; | 399 | unsigned long temp; |
378 | 400 | ||
379 | __asm__ __volatile__( | 401 | __asm__ __volatile__( |
402 | " .set mips3 \n" | ||
380 | "1: lld %0, %1 # atomic64_add \n" | 403 | "1: lld %0, %1 # atomic64_add \n" |
381 | " addu %0, %2 \n" | 404 | " addu %0, %2 \n" |
382 | " scd %0, %1 \n" | 405 | " scd %0, %1 \n" |
383 | " beqz %0, 1b \n" | 406 | " beqz %0, 1b \n" |
407 | " .set mips0 \n" | ||
384 | : "=&r" (temp), "=m" (v->counter) | 408 | : "=&r" (temp), "=m" (v->counter) |
385 | : "Ir" (i), "m" (v->counter)); | 409 | : "Ir" (i), "m" (v->counter)); |
386 | } else { | 410 | } else { |
@@ -405,20 +429,24 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
405 | unsigned long temp; | 429 | unsigned long temp; |
406 | 430 | ||
407 | __asm__ __volatile__( | 431 | __asm__ __volatile__( |
432 | " .set mips3 \n" | ||
408 | "1: lld %0, %1 # atomic64_sub \n" | 433 | "1: lld %0, %1 # atomic64_sub \n" |
409 | " subu %0, %2 \n" | 434 | " subu %0, %2 \n" |
410 | " scd %0, %1 \n" | 435 | " scd %0, %1 \n" |
411 | " beqzl %0, 1b \n" | 436 | " beqzl %0, 1b \n" |
437 | " .set mips0 \n" | ||
412 | : "=&r" (temp), "=m" (v->counter) | 438 | : "=&r" (temp), "=m" (v->counter) |
413 | : "Ir" (i), "m" (v->counter)); | 439 | : "Ir" (i), "m" (v->counter)); |
414 | } else if (cpu_has_llsc) { | 440 | } else if (cpu_has_llsc) { |
415 | unsigned long temp; | 441 | unsigned long temp; |
416 | 442 | ||
417 | __asm__ __volatile__( | 443 | __asm__ __volatile__( |
444 | " .set mips3 \n" | ||
418 | "1: lld %0, %1 # atomic64_sub \n" | 445 | "1: lld %0, %1 # atomic64_sub \n" |
419 | " subu %0, %2 \n" | 446 | " subu %0, %2 \n" |
420 | " scd %0, %1 \n" | 447 | " scd %0, %1 \n" |
421 | " beqz %0, 1b \n" | 448 | " beqz %0, 1b \n" |
449 | " .set mips0 \n" | ||
422 | : "=&r" (temp), "=m" (v->counter) | 450 | : "=&r" (temp), "=m" (v->counter) |
423 | : "Ir" (i), "m" (v->counter)); | 451 | : "Ir" (i), "m" (v->counter)); |
424 | } else { | 452 | } else { |
@@ -441,12 +469,14 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
441 | unsigned long temp; | 469 | unsigned long temp; |
442 | 470 | ||
443 | __asm__ __volatile__( | 471 | __asm__ __volatile__( |
472 | " .set mips3 \n" | ||
444 | "1: lld %1, %2 # atomic64_add_return \n" | 473 | "1: lld %1, %2 # atomic64_add_return \n" |
445 | " addu %0, %1, %3 \n" | 474 | " addu %0, %1, %3 \n" |
446 | " scd %0, %2 \n" | 475 | " scd %0, %2 \n" |
447 | " beqzl %0, 1b \n" | 476 | " beqzl %0, 1b \n" |
448 | " addu %0, %1, %3 \n" | 477 | " addu %0, %1, %3 \n" |
449 | " sync \n" | 478 | " sync \n" |
479 | " .set mips0 \n" | ||
450 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 480 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
451 | : "Ir" (i), "m" (v->counter) | 481 | : "Ir" (i), "m" (v->counter) |
452 | : "memory"); | 482 | : "memory"); |
@@ -454,12 +484,14 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
454 | unsigned long temp; | 484 | unsigned long temp; |
455 | 485 | ||
456 | __asm__ __volatile__( | 486 | __asm__ __volatile__( |
487 | " .set mips3 \n" | ||
457 | "1: lld %1, %2 # atomic64_add_return \n" | 488 | "1: lld %1, %2 # atomic64_add_return \n" |
458 | " addu %0, %1, %3 \n" | 489 | " addu %0, %1, %3 \n" |
459 | " scd %0, %2 \n" | 490 | " scd %0, %2 \n" |
460 | " beqz %0, 1b \n" | 491 | " beqz %0, 1b \n" |
461 | " addu %0, %1, %3 \n" | 492 | " addu %0, %1, %3 \n" |
462 | " sync \n" | 493 | " sync \n" |
494 | " .set mips0 \n" | ||
463 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 495 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
464 | : "Ir" (i), "m" (v->counter) | 496 | : "Ir" (i), "m" (v->counter) |
465 | : "memory"); | 497 | : "memory"); |
@@ -484,12 +516,14 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
484 | unsigned long temp; | 516 | unsigned long temp; |
485 | 517 | ||
486 | __asm__ __volatile__( | 518 | __asm__ __volatile__( |
519 | " .set mips3 \n" | ||
487 | "1: lld %1, %2 # atomic64_sub_return \n" | 520 | "1: lld %1, %2 # atomic64_sub_return \n" |
488 | " subu %0, %1, %3 \n" | 521 | " subu %0, %1, %3 \n" |
489 | " scd %0, %2 \n" | 522 | " scd %0, %2 \n" |
490 | " beqzl %0, 1b \n" | 523 | " beqzl %0, 1b \n" |
491 | " subu %0, %1, %3 \n" | 524 | " subu %0, %1, %3 \n" |
492 | " sync \n" | 525 | " sync \n" |
526 | " .set mips0 \n" | ||
493 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 527 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
494 | : "Ir" (i), "m" (v->counter) | 528 | : "Ir" (i), "m" (v->counter) |
495 | : "memory"); | 529 | : "memory"); |
@@ -497,12 +531,14 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
497 | unsigned long temp; | 531 | unsigned long temp; |
498 | 532 | ||
499 | __asm__ __volatile__( | 533 | __asm__ __volatile__( |
534 | " .set mips3 \n" | ||
500 | "1: lld %1, %2 # atomic64_sub_return \n" | 535 | "1: lld %1, %2 # atomic64_sub_return \n" |
501 | " subu %0, %1, %3 \n" | 536 | " subu %0, %1, %3 \n" |
502 | " scd %0, %2 \n" | 537 | " scd %0, %2 \n" |
503 | " beqz %0, 1b \n" | 538 | " beqz %0, 1b \n" |
504 | " subu %0, %1, %3 \n" | 539 | " subu %0, %1, %3 \n" |
505 | " sync \n" | 540 | " sync \n" |
541 | " .set mips0 \n" | ||
506 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 542 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
507 | : "Ir" (i), "m" (v->counter) | 543 | : "Ir" (i), "m" (v->counter) |
508 | : "memory"); | 544 | : "memory"); |
@@ -534,6 +570,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
534 | unsigned long temp; | 570 | unsigned long temp; |
535 | 571 | ||
536 | __asm__ __volatile__( | 572 | __asm__ __volatile__( |
573 | " .set mips3 \n" | ||
537 | "1: lld %1, %2 # atomic64_sub_if_positive\n" | 574 | "1: lld %1, %2 # atomic64_sub_if_positive\n" |
538 | " dsubu %0, %1, %3 \n" | 575 | " dsubu %0, %1, %3 \n" |
539 | " bltz %0, 1f \n" | 576 | " bltz %0, 1f \n" |
@@ -541,6 +578,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
541 | " beqzl %0, 1b \n" | 578 | " beqzl %0, 1b \n" |
542 | " sync \n" | 579 | " sync \n" |
543 | "1: \n" | 580 | "1: \n" |
581 | " .set mips0 \n" | ||
544 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 582 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
545 | : "Ir" (i), "m" (v->counter) | 583 | : "Ir" (i), "m" (v->counter) |
546 | : "memory"); | 584 | : "memory"); |
@@ -548,6 +586,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
548 | unsigned long temp; | 586 | unsigned long temp; |
549 | 587 | ||
550 | __asm__ __volatile__( | 588 | __asm__ __volatile__( |
589 | " .set mips3 \n" | ||
551 | "1: lld %1, %2 # atomic64_sub_if_positive\n" | 590 | "1: lld %1, %2 # atomic64_sub_if_positive\n" |
552 | " dsubu %0, %1, %3 \n" | 591 | " dsubu %0, %1, %3 \n" |
553 | " bltz %0, 1f \n" | 592 | " bltz %0, 1f \n" |
@@ -555,6 +594,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
555 | " beqz %0, 1b \n" | 594 | " beqz %0, 1b \n" |
556 | " sync \n" | 595 | " sync \n" |
557 | "1: \n" | 596 | "1: \n" |
597 | " .set mips0 \n" | ||
558 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 598 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
559 | : "Ir" (i), "m" (v->counter) | 599 | : "Ir" (i), "m" (v->counter) |
560 | : "memory"); | 600 | : "memory"); |
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index eb8d79dba11c..5496f9064a6a 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -12,20 +12,21 @@ | |||
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | #include <linux/compiler.h> | 13 | #include <linux/compiler.h> |
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <asm/bug.h> | ||
15 | #include <asm/byteorder.h> /* sigh ... */ | 16 | #include <asm/byteorder.h> /* sigh ... */ |
16 | #include <asm/cpu-features.h> | 17 | #include <asm/cpu-features.h> |
17 | 18 | ||
18 | #if (_MIPS_SZLONG == 32) | 19 | #if (_MIPS_SZLONG == 32) |
19 | #define SZLONG_LOG 5 | 20 | #define SZLONG_LOG 5 |
20 | #define SZLONG_MASK 31UL | 21 | #define SZLONG_MASK 31UL |
21 | #define __LL "ll " | 22 | #define __LL "ll " |
22 | #define __SC "sc " | 23 | #define __SC "sc " |
23 | #define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) | 24 | #define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) |
24 | #elif (_MIPS_SZLONG == 64) | 25 | #elif (_MIPS_SZLONG == 64) |
25 | #define SZLONG_LOG 6 | 26 | #define SZLONG_LOG 6 |
26 | #define SZLONG_MASK 63UL | 27 | #define SZLONG_MASK 63UL |
27 | #define __LL "lld " | 28 | #define __LL "lld " |
28 | #define __SC "scd " | 29 | #define __SC "scd " |
29 | #define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) | 30 | #define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) |
30 | #endif | 31 | #endif |
31 | 32 | ||
@@ -72,18 +73,22 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
72 | 73 | ||
73 | if (cpu_has_llsc && R10000_LLSC_WAR) { | 74 | if (cpu_has_llsc && R10000_LLSC_WAR) { |
74 | __asm__ __volatile__( | 75 | __asm__ __volatile__( |
76 | " .set mips3 \n" | ||
75 | "1: " __LL "%0, %1 # set_bit \n" | 77 | "1: " __LL "%0, %1 # set_bit \n" |
76 | " or %0, %2 \n" | 78 | " or %0, %2 \n" |
77 | " "__SC "%0, %1 \n" | 79 | " " __SC "%0, %1 \n" |
78 | " beqzl %0, 1b \n" | 80 | " beqzl %0, 1b \n" |
81 | " .set mips0 \n" | ||
79 | : "=&r" (temp), "=m" (*m) | 82 | : "=&r" (temp), "=m" (*m) |
80 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); | 83 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); |
81 | } else if (cpu_has_llsc) { | 84 | } else if (cpu_has_llsc) { |
82 | __asm__ __volatile__( | 85 | __asm__ __volatile__( |
86 | " .set mips3 \n" | ||
83 | "1: " __LL "%0, %1 # set_bit \n" | 87 | "1: " __LL "%0, %1 # set_bit \n" |
84 | " or %0, %2 \n" | 88 | " or %0, %2 \n" |
85 | " "__SC "%0, %1 \n" | 89 | " " __SC "%0, %1 \n" |
86 | " beqz %0, 1b \n" | 90 | " beqz %0, 1b \n" |
91 | " .set mips0 \n" | ||
87 | : "=&r" (temp), "=m" (*m) | 92 | : "=&r" (temp), "=m" (*m) |
88 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); | 93 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); |
89 | } else { | 94 | } else { |
@@ -132,18 +137,22 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
132 | 137 | ||
133 | if (cpu_has_llsc && R10000_LLSC_WAR) { | 138 | if (cpu_has_llsc && R10000_LLSC_WAR) { |
134 | __asm__ __volatile__( | 139 | __asm__ __volatile__( |
140 | " .set mips3 \n" | ||
135 | "1: " __LL "%0, %1 # clear_bit \n" | 141 | "1: " __LL "%0, %1 # clear_bit \n" |
136 | " and %0, %2 \n" | 142 | " and %0, %2 \n" |
137 | " " __SC "%0, %1 \n" | 143 | " " __SC "%0, %1 \n" |
138 | " beqzl %0, 1b \n" | 144 | " beqzl %0, 1b \n" |
145 | " .set mips0 \n" | ||
139 | : "=&r" (temp), "=m" (*m) | 146 | : "=&r" (temp), "=m" (*m) |
140 | : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); | 147 | : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); |
141 | } else if (cpu_has_llsc) { | 148 | } else if (cpu_has_llsc) { |
142 | __asm__ __volatile__( | 149 | __asm__ __volatile__( |
150 | " .set mips3 \n" | ||
143 | "1: " __LL "%0, %1 # clear_bit \n" | 151 | "1: " __LL "%0, %1 # clear_bit \n" |
144 | " and %0, %2 \n" | 152 | " and %0, %2 \n" |
145 | " " __SC "%0, %1 \n" | 153 | " " __SC "%0, %1 \n" |
146 | " beqz %0, 1b \n" | 154 | " beqz %0, 1b \n" |
155 | " .set mips0 \n" | ||
147 | : "=&r" (temp), "=m" (*m) | 156 | : "=&r" (temp), "=m" (*m) |
148 | : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); | 157 | : "ir" (~(1UL << (nr & SZLONG_MASK))), "m" (*m)); |
149 | } else { | 158 | } else { |
@@ -191,10 +200,12 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
191 | unsigned long temp; | 200 | unsigned long temp; |
192 | 201 | ||
193 | __asm__ __volatile__( | 202 | __asm__ __volatile__( |
203 | " .set mips3 \n" | ||
194 | "1: " __LL "%0, %1 # change_bit \n" | 204 | "1: " __LL "%0, %1 # change_bit \n" |
195 | " xor %0, %2 \n" | 205 | " xor %0, %2 \n" |
196 | " "__SC "%0, %1 \n" | 206 | " " __SC "%0, %1 \n" |
197 | " beqzl %0, 1b \n" | 207 | " beqzl %0, 1b \n" |
208 | " .set mips0 \n" | ||
198 | : "=&r" (temp), "=m" (*m) | 209 | : "=&r" (temp), "=m" (*m) |
199 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); | 210 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); |
200 | } else if (cpu_has_llsc) { | 211 | } else if (cpu_has_llsc) { |
@@ -202,10 +213,12 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
202 | unsigned long temp; | 213 | unsigned long temp; |
203 | 214 | ||
204 | __asm__ __volatile__( | 215 | __asm__ __volatile__( |
216 | " .set mips3 \n" | ||
205 | "1: " __LL "%0, %1 # change_bit \n" | 217 | "1: " __LL "%0, %1 # change_bit \n" |
206 | " xor %0, %2 \n" | 218 | " xor %0, %2 \n" |
207 | " "__SC "%0, %1 \n" | 219 | " " __SC "%0, %1 \n" |
208 | " beqz %0, 1b \n" | 220 | " beqz %0, 1b \n" |
221 | " .set mips0 \n" | ||
209 | : "=&r" (temp), "=m" (*m) | 222 | : "=&r" (temp), "=m" (*m) |
210 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); | 223 | : "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m)); |
211 | } else { | 224 | } else { |
@@ -253,14 +266,16 @@ static inline int test_and_set_bit(unsigned long nr, | |||
253 | unsigned long temp, res; | 266 | unsigned long temp, res; |
254 | 267 | ||
255 | __asm__ __volatile__( | 268 | __asm__ __volatile__( |
269 | " .set mips3 \n" | ||
256 | "1: " __LL "%0, %1 # test_and_set_bit \n" | 270 | "1: " __LL "%0, %1 # test_and_set_bit \n" |
257 | " or %2, %0, %3 \n" | 271 | " or %2, %0, %3 \n" |
258 | " " __SC "%2, %1 \n" | 272 | " " __SC "%2, %1 \n" |
259 | " beqzl %2, 1b \n" | 273 | " beqzl %2, 1b \n" |
260 | " and %2, %0, %3 \n" | 274 | " and %2, %0, %3 \n" |
261 | #ifdef CONFIG_SMP | 275 | #ifdef CONFIG_SMP |
262 | "sync \n" | 276 | " sync \n" |
263 | #endif | 277 | #endif |
278 | " .set mips0 \n" | ||
264 | : "=&r" (temp), "=m" (*m), "=&r" (res) | 279 | : "=&r" (temp), "=m" (*m), "=&r" (res) |
265 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) | 280 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) |
266 | : "memory"); | 281 | : "memory"); |
@@ -271,16 +286,18 @@ static inline int test_and_set_bit(unsigned long nr, | |||
271 | unsigned long temp, res; | 286 | unsigned long temp, res; |
272 | 287 | ||
273 | __asm__ __volatile__( | 288 | __asm__ __volatile__( |
274 | " .set noreorder # test_and_set_bit \n" | 289 | " .set push \n" |
275 | "1: " __LL "%0, %1 \n" | 290 | " .set noreorder \n" |
291 | " .set mips3 \n" | ||
292 | "1: " __LL "%0, %1 # test_and_set_bit \n" | ||
276 | " or %2, %0, %3 \n" | 293 | " or %2, %0, %3 \n" |
277 | " " __SC "%2, %1 \n" | 294 | " " __SC "%2, %1 \n" |
278 | " beqz %2, 1b \n" | 295 | " beqz %2, 1b \n" |
279 | " and %2, %0, %3 \n" | 296 | " and %2, %0, %3 \n" |
280 | #ifdef CONFIG_SMP | 297 | #ifdef CONFIG_SMP |
281 | "sync \n" | 298 | " sync \n" |
282 | #endif | 299 | #endif |
283 | ".set\treorder" | 300 | " .set pop \n" |
284 | : "=&r" (temp), "=m" (*m), "=&r" (res) | 301 | : "=&r" (temp), "=m" (*m), "=&r" (res) |
285 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) | 302 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) |
286 | : "memory"); | 303 | : "memory"); |
@@ -343,15 +360,17 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
343 | unsigned long temp, res; | 360 | unsigned long temp, res; |
344 | 361 | ||
345 | __asm__ __volatile__( | 362 | __asm__ __volatile__( |
363 | " .set mips3 \n" | ||
346 | "1: " __LL "%0, %1 # test_and_clear_bit \n" | 364 | "1: " __LL "%0, %1 # test_and_clear_bit \n" |
347 | " or %2, %0, %3 \n" | 365 | " or %2, %0, %3 \n" |
348 | " xor %2, %3 \n" | 366 | " xor %2, %3 \n" |
349 | __SC "%2, %1 \n" | 367 | " " __SC "%2, %1 \n" |
350 | " beqzl %2, 1b \n" | 368 | " beqzl %2, 1b \n" |
351 | " and %2, %0, %3 \n" | 369 | " and %2, %0, %3 \n" |
352 | #ifdef CONFIG_SMP | 370 | #ifdef CONFIG_SMP |
353 | " sync \n" | 371 | " sync \n" |
354 | #endif | 372 | #endif |
373 | " .set mips0 \n" | ||
355 | : "=&r" (temp), "=m" (*m), "=&r" (res) | 374 | : "=&r" (temp), "=m" (*m), "=&r" (res) |
356 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) | 375 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) |
357 | : "memory"); | 376 | : "memory"); |
@@ -362,17 +381,19 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
362 | unsigned long temp, res; | 381 | unsigned long temp, res; |
363 | 382 | ||
364 | __asm__ __volatile__( | 383 | __asm__ __volatile__( |
365 | " .set noreorder # test_and_clear_bit \n" | 384 | " .set push \n" |
366 | "1: " __LL "%0, %1 \n" | 385 | " .set noreorder \n" |
386 | " .set mips3 \n" | ||
387 | "1: " __LL "%0, %1 # test_and_clear_bit \n" | ||
367 | " or %2, %0, %3 \n" | 388 | " or %2, %0, %3 \n" |
368 | " xor %2, %3 \n" | 389 | " xor %2, %3 \n" |
369 | __SC "%2, %1 \n" | 390 | " " __SC "%2, %1 \n" |
370 | " beqz %2, 1b \n" | 391 | " beqz %2, 1b \n" |
371 | " and %2, %0, %3 \n" | 392 | " and %2, %0, %3 \n" |
372 | #ifdef CONFIG_SMP | 393 | #ifdef CONFIG_SMP |
373 | " sync \n" | 394 | " sync \n" |
374 | #endif | 395 | #endif |
375 | " .set reorder \n" | 396 | " .set pop \n" |
376 | : "=&r" (temp), "=m" (*m), "=&r" (res) | 397 | : "=&r" (temp), "=m" (*m), "=&r" (res) |
377 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) | 398 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) |
378 | : "memory"); | 399 | : "memory"); |
@@ -435,14 +456,16 @@ static inline int test_and_change_bit(unsigned long nr, | |||
435 | unsigned long temp, res; | 456 | unsigned long temp, res; |
436 | 457 | ||
437 | __asm__ __volatile__( | 458 | __asm__ __volatile__( |
438 | "1: " __LL " %0, %1 # test_and_change_bit \n" | 459 | " .set mips3 \n" |
460 | "1: " __LL "%0, %1 # test_and_change_bit \n" | ||
439 | " xor %2, %0, %3 \n" | 461 | " xor %2, %0, %3 \n" |
440 | " "__SC "%2, %1 \n" | 462 | " " __SC "%2, %1 \n" |
441 | " beqzl %2, 1b \n" | 463 | " beqzl %2, 1b \n" |
442 | " and %2, %0, %3 \n" | 464 | " and %2, %0, %3 \n" |
443 | #ifdef CONFIG_SMP | 465 | #ifdef CONFIG_SMP |
444 | " sync \n" | 466 | " sync \n" |
445 | #endif | 467 | #endif |
468 | " .set mips0 \n" | ||
446 | : "=&r" (temp), "=m" (*m), "=&r" (res) | 469 | : "=&r" (temp), "=m" (*m), "=&r" (res) |
447 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) | 470 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) |
448 | : "memory"); | 471 | : "memory"); |
@@ -453,16 +476,18 @@ static inline int test_and_change_bit(unsigned long nr, | |||
453 | unsigned long temp, res; | 476 | unsigned long temp, res; |
454 | 477 | ||
455 | __asm__ __volatile__( | 478 | __asm__ __volatile__( |
456 | " .set noreorder # test_and_change_bit \n" | 479 | " .set push \n" |
457 | "1: " __LL " %0, %1 \n" | 480 | " .set noreorder \n" |
481 | " .set mips3 \n" | ||
482 | "1: " __LL "%0, %1 # test_and_change_bit \n" | ||
458 | " xor %2, %0, %3 \n" | 483 | " xor %2, %0, %3 \n" |
459 | " "__SC "\t%2, %1 \n" | 484 | " " __SC "\t%2, %1 \n" |
460 | " beqz %2, 1b \n" | 485 | " beqz %2, 1b \n" |
461 | " and %2, %0, %3 \n" | 486 | " and %2, %0, %3 \n" |
462 | #ifdef CONFIG_SMP | 487 | #ifdef CONFIG_SMP |
463 | " sync \n" | 488 | " sync \n" |
464 | #endif | 489 | #endif |
465 | " .set reorder \n" | 490 | " .set pop \n" |
466 | : "=&r" (temp), "=m" (*m), "=&r" (res) | 491 | : "=&r" (temp), "=m" (*m), "=&r" (res) |
467 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) | 492 | : "r" (1UL << (nr & SZLONG_MASK)), "m" (*m) |
468 | : "memory"); | 493 | : "memory"); |
@@ -523,22 +548,60 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *addr) | |||
523 | } | 548 | } |
524 | 549 | ||
525 | /* | 550 | /* |
526 | * ffz - find first zero in word. | 551 | * Return the bit position (0..63) of the most significant 1 bit in a word |
552 | * Returns -1 if no 1 bit exists | ||
553 | */ | ||
554 | static inline int __ilog2(unsigned long x) | ||
555 | { | ||
556 | int lz; | ||
557 | |||
558 | if (sizeof(x) == 4) { | ||
559 | __asm__ ( | ||
560 | " .set push \n" | ||
561 | " .set mips32 \n" | ||
562 | " clz %0, %1 \n" | ||
563 | " .set pop \n" | ||
564 | : "=r" (lz) | ||
565 | : "r" (x)); | ||
566 | |||
567 | return 31 - lz; | ||
568 | } | ||
569 | |||
570 | BUG_ON(sizeof(x) != 8); | ||
571 | |||
572 | __asm__ ( | ||
573 | " .set push \n" | ||
574 | " .set mips64 \n" | ||
575 | " dclz %0, %1 \n" | ||
576 | " .set pop \n" | ||
577 | : "=r" (lz) | ||
578 | : "r" (x)); | ||
579 | |||
580 | return 63 - lz; | ||
581 | } | ||
582 | |||
583 | /* | ||
584 | * __ffs - find first bit in word. | ||
527 | * @word: The word to search | 585 | * @word: The word to search |
528 | * | 586 | * |
529 | * Undefined if no zero exists, so code should check against ~0UL first. | 587 | * Returns 0..SZLONG-1 |
588 | * Undefined if no bit exists, so code should check against 0 first. | ||
530 | */ | 589 | */ |
531 | static inline unsigned long ffz(unsigned long word) | 590 | static inline unsigned long __ffs(unsigned long word) |
532 | { | 591 | { |
592 | #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) | ||
593 | return __ilog2(word & -word); | ||
594 | #else | ||
533 | int b = 0, s; | 595 | int b = 0, s; |
534 | 596 | ||
535 | word = ~word; | ||
536 | #ifdef CONFIG_32BIT | 597 | #ifdef CONFIG_32BIT |
537 | s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s; | 598 | s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s; |
538 | s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s; | 599 | s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s; |
539 | s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s; | 600 | s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s; |
540 | s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s; | 601 | s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s; |
541 | s = 1; if (word << 31 != 0) s = 0; b += s; | 602 | s = 1; if (word << 31 != 0) s = 0; b += s; |
603 | |||
604 | return b; | ||
542 | #endif | 605 | #endif |
543 | #ifdef CONFIG_64BIT | 606 | #ifdef CONFIG_64BIT |
544 | s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s; | 607 | s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s; |
@@ -547,27 +610,92 @@ static inline unsigned long ffz(unsigned long word) | |||
547 | s = 4; if (word << 60 != 0) s = 0; b += s; word >>= s; | 610 | s = 4; if (word << 60 != 0) s = 0; b += s; word >>= s; |
548 | s = 2; if (word << 62 != 0) s = 0; b += s; word >>= s; | 611 | s = 2; if (word << 62 != 0) s = 0; b += s; word >>= s; |
549 | s = 1; if (word << 63 != 0) s = 0; b += s; | 612 | s = 1; if (word << 63 != 0) s = 0; b += s; |
550 | #endif | ||
551 | 613 | ||
552 | return b; | 614 | return b; |
615 | #endif | ||
616 | #endif | ||
553 | } | 617 | } |
554 | 618 | ||
555 | /* | 619 | /* |
556 | * __ffs - find first bit in word. | 620 | * ffs - find first bit set. |
557 | * @word: The word to search | 621 | * @word: The word to search |
558 | * | 622 | * |
559 | * Undefined if no bit exists, so code should check against 0 first. | 623 | * Returns 1..SZLONG |
624 | * Returns 0 if no bit exists | ||
560 | */ | 625 | */ |
561 | static inline unsigned long __ffs(unsigned long word) | 626 | |
627 | static inline unsigned long ffs(unsigned long word) | ||
562 | { | 628 | { |
563 | return ffz(~word); | 629 | if (!word) |
630 | return 0; | ||
631 | |||
632 | return __ffs(word) + 1; | ||
564 | } | 633 | } |
565 | 634 | ||
566 | /* | 635 | /* |
567 | * fls: find last bit set. | 636 | * ffz - find first zero in word. |
637 | * @word: The word to search | ||
638 | * | ||
639 | * Undefined if no zero exists, so code should check against ~0UL first. | ||
640 | */ | ||
641 | static inline unsigned long ffz(unsigned long word) | ||
642 | { | ||
643 | return __ffs (~word); | ||
644 | } | ||
645 | |||
646 | /* | ||
647 | * flz - find last zero in word. | ||
648 | * @word: The word to search | ||
649 | * | ||
650 | * Returns 0..SZLONG-1 | ||
651 | * Undefined if no zero exists, so code should check against ~0UL first. | ||
652 | */ | ||
653 | static inline unsigned long flz(unsigned long word) | ||
654 | { | ||
655 | #if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64) | ||
656 | return __ilog2(~word); | ||
657 | #else | ||
658 | #ifdef CONFIG_32BIT | ||
659 | int r = 31, s; | ||
660 | word = ~word; | ||
661 | s = 16; if ((word & 0xffff0000)) s = 0; r -= s; word <<= s; | ||
662 | s = 8; if ((word & 0xff000000)) s = 0; r -= s; word <<= s; | ||
663 | s = 4; if ((word & 0xf0000000)) s = 0; r -= s; word <<= s; | ||
664 | s = 2; if ((word & 0xc0000000)) s = 0; r -= s; word <<= s; | ||
665 | s = 1; if ((word & 0x80000000)) s = 0; r -= s; | ||
666 | |||
667 | return r; | ||
668 | #endif | ||
669 | #ifdef CONFIG_64BIT | ||
670 | int r = 63, s; | ||
671 | word = ~word; | ||
672 | s = 32; if ((word & 0xffffffff00000000UL)) s = 0; r -= s; word <<= s; | ||
673 | s = 16; if ((word & 0xffff000000000000UL)) s = 0; r -= s; word <<= s; | ||
674 | s = 8; if ((word & 0xff00000000000000UL)) s = 0; r -= s; word <<= s; | ||
675 | s = 4; if ((word & 0xf000000000000000UL)) s = 0; r -= s; word <<= s; | ||
676 | s = 2; if ((word & 0xc000000000000000UL)) s = 0; r -= s; word <<= s; | ||
677 | s = 1; if ((word & 0x8000000000000000UL)) s = 0; r -= s; | ||
678 | |||
679 | return r; | ||
680 | #endif | ||
681 | #endif | ||
682 | } | ||
683 | |||
684 | /* | ||
685 | * fls - find last bit set. | ||
686 | * @word: The word to search | ||
687 | * | ||
688 | * Returns 1..SZLONG | ||
689 | * Returns 0 if no bit exists | ||
568 | */ | 690 | */ |
691 | static inline unsigned long fls(unsigned long word) | ||
692 | { | ||
693 | if (word == 0) | ||
694 | return 0; | ||
695 | |||
696 | return flz(~word) + 1; | ||
697 | } | ||
569 | 698 | ||
570 | #define fls(x) generic_fls(x) | ||
571 | 699 | ||
572 | /* | 700 | /* |
573 | * find_next_zero_bit - find the first zero bit in a memory region | 701 | * find_next_zero_bit - find the first zero bit in a memory region |
@@ -704,17 +832,6 @@ static inline int sched_find_first_bit(const unsigned long *b) | |||
704 | } | 832 | } |
705 | 833 | ||
706 | /* | 834 | /* |
707 | * ffs - find first bit set | ||
708 | * @x: the word to search | ||
709 | * | ||
710 | * This is defined the same way as | ||
711 | * the libc and compiler builtin ffs routines, therefore | ||
712 | * differs in spirit from the above ffz (man ffs). | ||
713 | */ | ||
714 | |||
715 | #define ffs(x) generic_ffs(x) | ||
716 | |||
717 | /* | ||
718 | * hweightN - returns the hamming weight of a N-bit word | 835 | * hweightN - returns the hamming weight of a N-bit word |
719 | * @x: the word to weigh | 836 | * @x: the word to weigh |
720 | * | 837 | * |
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h index b1e57d783604..14fc88f27226 100644 --- a/include/asm-mips/bootinfo.h +++ b/include/asm-mips/bootinfo.h | |||
@@ -77,6 +77,7 @@ | |||
77 | #define MACH_SGI_IP27 1 /* Origin 200, Origin 2000, Onyx 2 */ | 77 | #define MACH_SGI_IP27 1 /* Origin 200, Origin 2000, Onyx 2 */ |
78 | #define MACH_SGI_IP28 2 /* Indigo2 Impact */ | 78 | #define MACH_SGI_IP28 2 /* Indigo2 Impact */ |
79 | #define MACH_SGI_IP32 3 /* O2 */ | 79 | #define MACH_SGI_IP32 3 /* O2 */ |
80 | #define MACH_SGI_IP30 4 /* Octane, Octane2 */ | ||
80 | 81 | ||
81 | /* | 82 | /* |
82 | * Valid machtype for group COBALT | 83 | * Valid machtype for group COBALT |
@@ -136,6 +137,7 @@ | |||
136 | #define MACH_GROUP_PHILIPS 14 | 137 | #define MACH_GROUP_PHILIPS 14 |
137 | #define MACH_PHILIPS_NINO 0 /* Nino */ | 138 | #define MACH_PHILIPS_NINO 0 /* Nino */ |
138 | #define MACH_PHILIPS_VELO 1 /* Velo */ | 139 | #define MACH_PHILIPS_VELO 1 /* Velo */ |
140 | #define MACH_PHILIPS_JBS 2 /* JBS */ | ||
139 | 141 | ||
140 | /* | 142 | /* |
141 | * Valid machtype for group Globespan | 143 | * Valid machtype for group Globespan |
@@ -159,6 +161,7 @@ | |||
159 | #define MACH_TOSHIBA_JMR3927 3 /* JMR-TX3927 CPU/IO board */ | 161 | #define MACH_TOSHIBA_JMR3927 3 /* JMR-TX3927 CPU/IO board */ |
160 | #define MACH_TOSHIBA_RBTX4927 4 | 162 | #define MACH_TOSHIBA_RBTX4927 4 |
161 | #define MACH_TOSHIBA_RBTX4937 5 | 163 | #define MACH_TOSHIBA_RBTX4937 5 |
164 | #define MACH_TOSHIBA_RBTX4938 6 | ||
162 | 165 | ||
163 | #define GROUP_TOSHIBA_NAMES { "Pallas", "TopasCE", "JMR", "JMR TX3927", \ | 166 | #define GROUP_TOSHIBA_NAMES { "Pallas", "TopasCE", "JMR", "JMR TX3927", \ |
164 | "RBTX4927", "RBTX4937" } | 167 | "RBTX4927", "RBTX4937" } |
@@ -177,6 +180,8 @@ | |||
177 | #define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */ | 180 | #define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */ |
178 | #define MACH_PB1550 8 /* Au1550-based eval board */ | 181 | #define MACH_PB1550 8 /* Au1550-based eval board */ |
179 | #define MACH_DB1550 9 /* Au1550-based eval board */ | 182 | #define MACH_DB1550 9 /* Au1550-based eval board */ |
183 | #define MACH_PB1200 10 /* Au1200-based eval board */ | ||
184 | #define MACH_DB1200 11 /* Au1200-based eval board */ | ||
180 | 185 | ||
181 | /* | 186 | /* |
182 | * Valid machtype for group NEC_VR41XX | 187 | * Valid machtype for group NEC_VR41XX |
diff --git a/include/asm-mips/break.h b/include/asm-mips/break.h index 2e6de788f207..25b980c91e7e 100644 --- a/include/asm-mips/break.h +++ b/include/asm-mips/break.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ | 28 | #define BRK_NORLD 10 /* No rld found - not used by Linux/MIPS */ |
29 | #define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ | 29 | #define _BRK_THREADBP 11 /* For threads, user bp (used by debuggers) */ |
30 | #define BRK_BUG 512 /* Used by BUG() */ | 30 | #define BRK_BUG 512 /* Used by BUG() */ |
31 | #define BRK_KDB 513 /* Used in KDB_ENTER() */ | ||
31 | #define BRK_MULOVF 1023 /* Multiply overflow */ | 32 | #define BRK_MULOVF 1023 /* Multiply overflow */ |
32 | 33 | ||
33 | #endif /* __ASM_BREAK_H */ | 34 | #endif /* __ASM_BREAK_H */ |
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h index 3f594b440abc..87d49a5bdc63 100644 --- a/include/asm-mips/bug.h +++ b/include/asm-mips/bug.h | |||
@@ -1,16 +1,21 @@ | |||
1 | #ifndef __ASM_BUG_H | 1 | #ifndef __ASM_BUG_H |
2 | #define __ASM_BUG_H | 2 | #define __ASM_BUG_H |
3 | 3 | ||
4 | #include <asm/break.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | #ifdef CONFIG_BUG | 6 | #ifdef CONFIG_BUG |
7 | #define HAVE_ARCH_BUG | 7 | |
8 | #include <asm/break.h> | ||
9 | |||
8 | #define BUG() \ | 10 | #define BUG() \ |
9 | do { \ | 11 | do { \ |
10 | __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \ | 12 | __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \ |
11 | } while (0) | 13 | } while (0) |
14 | |||
15 | #define HAVE_ARCH_BUG | ||
16 | |||
12 | #endif | 17 | #endif |
13 | 18 | ||
14 | #include <asm-generic/bug.h> | 19 | #include <asm-generic/bug.h> |
15 | 20 | ||
16 | #endif | 21 | #endif /* __ASM_BUG_H */ |
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h index b14b961c2100..cb2ea7c15c7a 100644 --- a/include/asm-mips/bugs.h +++ b/include/asm-mips/bugs.h | |||
@@ -8,12 +8,18 @@ | |||
8 | #define _ASM_BUGS_H | 8 | #define _ASM_BUGS_H |
9 | 9 | ||
10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
11 | #include <linux/delay.h> | ||
12 | #include <asm/cpu.h> | ||
13 | #include <asm/cpu-info.h> | ||
11 | 14 | ||
12 | extern void check_bugs32(void); | 15 | extern void check_bugs32(void); |
13 | extern void check_bugs64(void); | 16 | extern void check_bugs64(void); |
14 | 17 | ||
15 | static inline void check_bugs(void) | 18 | static inline void check_bugs(void) |
16 | { | 19 | { |
20 | unsigned int cpu = smp_processor_id(); | ||
21 | |||
22 | cpu_data[cpu].udelay_val = loops_per_jiffy; | ||
17 | check_bugs32(); | 23 | check_bugs32(); |
18 | #ifdef CONFIG_64BIT | 24 | #ifdef CONFIG_64BIT |
19 | check_bugs64(); | 25 | check_bugs64(); |
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h index 4517bdf20953..1a5d1a669db3 100644 --- a/include/asm-mips/cache.h +++ b/include/asm-mips/cache.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define _ASM_CACHE_H | 10 | #define _ASM_CACHE_H |
11 | 11 | ||
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | #include <kmalloc.h> | ||
13 | 14 | ||
14 | #define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT | 15 | #define L1_CACHE_SHIFT CONFIG_MIPS_L1_CACHE_SHIFT |
15 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | 16 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
@@ -18,6 +19,4 @@ | |||
18 | #define SMP_CACHE_SHIFT L1_CACHE_SHIFT | 19 | #define SMP_CACHE_SHIFT L1_CACHE_SHIFT |
19 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 20 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
20 | 21 | ||
21 | #define ARCH_KMALLOC_MINALIGN 8 | ||
22 | |||
23 | #endif /* _ASM_CACHE_H */ | 22 | #endif /* _ASM_CACHE_H */ |
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 635f1bfb403e..a18ba2edc0b6 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -49,17 +49,29 @@ static inline void flush_dcache_page(struct page *page) | |||
49 | 49 | ||
50 | extern void (*flush_icache_page)(struct vm_area_struct *vma, | 50 | extern void (*flush_icache_page)(struct vm_area_struct *vma, |
51 | struct page *page); | 51 | struct page *page); |
52 | extern void (*flush_icache_range)(unsigned long start, unsigned long end); | 52 | extern void (*flush_icache_range)(unsigned long __user start, |
53 | unsigned long __user end); | ||
53 | #define flush_cache_vmap(start, end) flush_cache_all() | 54 | #define flush_cache_vmap(start, end) flush_cache_all() |
54 | #define flush_cache_vunmap(start, end) flush_cache_all() | 55 | #define flush_cache_vunmap(start, end) flush_cache_all() |
55 | 56 | ||
56 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 57 | static inline void copy_to_user_page(struct vm_area_struct *vma, |
57 | do { \ | 58 | struct page *page, unsigned long vaddr, void *dst, const void *src, |
58 | memcpy(dst, (void *) src, len); \ | 59 | unsigned long len) |
59 | flush_icache_page(vma, page); \ | 60 | { |
60 | } while (0) | 61 | if (cpu_has_dc_aliases) |
61 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 62 | flush_cache_page(vma, vaddr, page_to_pfn(page)); |
62 | memcpy(dst, src, len) | 63 | memcpy(dst, src, len); |
64 | flush_icache_page(vma, page); | ||
65 | } | ||
66 | |||
67 | static inline void copy_from_user_page(struct vm_area_struct *vma, | ||
68 | struct page *page, unsigned long vaddr, void *dst, const void *src, | ||
69 | unsigned long len) | ||
70 | { | ||
71 | if (cpu_has_dc_aliases) | ||
72 | flush_cache_page(vma, vaddr, page_to_pfn(page)); | ||
73 | memcpy(dst, src, len); | ||
74 | } | ||
63 | 75 | ||
64 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 76 | extern void (*flush_cache_sigtramp)(unsigned long addr); |
65 | extern void (*flush_icache_all)(void); | 77 | extern void (*flush_icache_all)(void); |
@@ -78,4 +90,7 @@ extern void (*flush_data_cache_page)(unsigned long addr); | |||
78 | #define ClearPageDcacheDirty(page) \ | 90 | #define ClearPageDcacheDirty(page) \ |
79 | clear_bit(PG_dcache_dirty, &(page)->flags) | 91 | clear_bit(PG_dcache_dirty, &(page)->flags) |
80 | 92 | ||
93 | /* Run kernel code uncached, useful for cache probing functions. */ | ||
94 | unsigned long __init run_uncached(void *func); | ||
95 | |||
81 | #endif /* _ASM_CACHEFLUSH_H */ | 96 | #endif /* _ASM_CACHEFLUSH_H */ |
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h index c1ea5a8714f3..b09f8971e95d 100644 --- a/include/asm-mips/checksum.h +++ b/include/asm-mips/checksum.h | |||
@@ -34,8 +34,9 @@ unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum); | |||
34 | * this is a new version of the above that records errors it finds in *errp, | 34 | * this is a new version of the above that records errors it finds in *errp, |
35 | * but continues and zeros the rest of the buffer. | 35 | * but continues and zeros the rest of the buffer. |
36 | */ | 36 | */ |
37 | unsigned int csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, int len, | 37 | unsigned int csum_partial_copy_from_user(const unsigned char __user *src, |
38 | unsigned int sum, int *errp); | 38 | unsigned char *dst, int len, |
39 | unsigned int sum, int *errp); | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * Copy and checksum to user | 42 | * Copy and checksum to user |
@@ -70,14 +71,15 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char * | |||
70 | static inline unsigned short int csum_fold(unsigned int sum) | 71 | static inline unsigned short int csum_fold(unsigned int sum) |
71 | { | 72 | { |
72 | __asm__( | 73 | __asm__( |
73 | ".set\tnoat\t\t\t# csum_fold\n\t" | 74 | " .set push # csum_fold\n" |
74 | "sll\t$1,%0,16\n\t" | 75 | " .set noat \n" |
75 | "addu\t%0,$1\n\t" | 76 | " sll $1, %0, 16 \n" |
76 | "sltu\t$1,%0,$1\n\t" | 77 | " addu %0, $1 \n" |
77 | "srl\t%0,%0,16\n\t" | 78 | " sltu $1, %0, $1 \n" |
78 | "addu\t%0,$1\n\t" | 79 | " srl %0, %0, 16 \n" |
79 | "xori\t%0,0xffff\n\t" | 80 | " addu %0, $1 \n" |
80 | ".set\tat" | 81 | " xori %0, 0xffff \n" |
82 | " .set pop" | ||
81 | : "=r" (sum) | 83 | : "=r" (sum) |
82 | : "0" (sum)); | 84 | : "0" (sum)); |
83 | 85 | ||
@@ -127,29 +129,30 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, | |||
127 | unsigned int sum) | 129 | unsigned int sum) |
128 | { | 130 | { |
129 | __asm__( | 131 | __asm__( |
130 | ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t" | 132 | " .set push # csum_tcpudp_nofold\n" |
133 | " .set noat \n" | ||
131 | #ifdef CONFIG_32BIT | 134 | #ifdef CONFIG_32BIT |
132 | "addu\t%0, %2\n\t" | 135 | " addu %0, %2 \n" |
133 | "sltu\t$1, %0, %2\n\t" | 136 | " sltu $1, %0, %2 \n" |
134 | "addu\t%0, $1\n\t" | 137 | " addu %0, $1 \n" |
135 | 138 | ||
136 | "addu\t%0, %3\n\t" | 139 | " addu %0, %3 \n" |
137 | "sltu\t$1, %0, %3\n\t" | 140 | " sltu $1, %0, %3 \n" |
138 | "addu\t%0, $1\n\t" | 141 | " addu %0, $1 \n" |
139 | 142 | ||
140 | "addu\t%0, %4\n\t" | 143 | " addu %0, %4 \n" |
141 | "sltu\t$1, %0, %4\n\t" | 144 | " sltu $1, %0, %4 \n" |
142 | "addu\t%0, $1\n\t" | 145 | " addu %0, $1 \n" |
143 | #endif | 146 | #endif |
144 | #ifdef CONFIG_64BIT | 147 | #ifdef CONFIG_64BIT |
145 | "daddu\t%0, %2\n\t" | 148 | " daddu %0, %2 \n" |
146 | "daddu\t%0, %3\n\t" | 149 | " daddu %0, %3 \n" |
147 | "daddu\t%0, %4\n\t" | 150 | " daddu %0, %4 \n" |
148 | "dsll32\t$1, %0, 0\n\t" | 151 | " dsll32 $1, %0, 0 \n" |
149 | "daddu\t%0, $1\n\t" | 152 | " daddu %0, $1 \n" |
150 | "dsrl32\t%0, %0, 0\n\t" | 153 | " dsra32 %0, %0, 0 \n" |
151 | #endif | 154 | #endif |
152 | ".set\tat" | 155 | " .set pop" |
153 | : "=r" (sum) | 156 | : "=r" (sum) |
154 | : "0" (daddr), "r"(saddr), | 157 | : "0" (daddr), "r"(saddr), |
155 | #ifdef __MIPSEL__ | 158 | #ifdef __MIPSEL__ |
@@ -192,57 +195,57 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, | |||
192 | unsigned int sum) | 195 | unsigned int sum) |
193 | { | 196 | { |
194 | __asm__( | 197 | __asm__( |
195 | ".set\tpush\t\t\t# csum_ipv6_magic\n\t" | 198 | " .set push # csum_ipv6_magic\n" |
196 | ".set\tnoreorder\n\t" | 199 | " .set noreorder \n" |
197 | ".set\tnoat\n\t" | 200 | " .set noat \n" |
198 | "addu\t%0, %5\t\t\t# proto (long in network byte order)\n\t" | 201 | " addu %0, %5 # proto (long in network byte order)\n" |
199 | "sltu\t$1, %0, %5\n\t" | 202 | " sltu $1, %0, %5 \n" |
200 | "addu\t%0, $1\n\t" | 203 | " addu %0, $1 \n" |
201 | 204 | ||
202 | "addu\t%0, %6\t\t\t# csum\n\t" | 205 | " addu %0, %6 # csum\n" |
203 | "sltu\t$1, %0, %6\n\t" | 206 | " sltu $1, %0, %6 \n" |
204 | "lw\t%1, 0(%2)\t\t\t# four words source address\n\t" | 207 | " lw %1, 0(%2) # four words source address\n" |
205 | "addu\t%0, $1\n\t" | 208 | " addu %0, $1 \n" |
206 | "addu\t%0, %1\n\t" | 209 | " addu %0, %1 \n" |
207 | "sltu\t$1, %0, %1\n\t" | 210 | " sltu $1, %0, %1 \n" |
208 | 211 | ||
209 | "lw\t%1, 4(%2)\n\t" | 212 | " lw %1, 4(%2) \n" |
210 | "addu\t%0, $1\n\t" | 213 | " addu %0, $1 \n" |
211 | "addu\t%0, %1\n\t" | 214 | " addu %0, %1 \n" |
212 | "sltu\t$1, %0, %1\n\t" | 215 | " sltu $1, %0, %1 \n" |
213 | 216 | ||
214 | "lw\t%1, 8(%2)\n\t" | 217 | " lw %1, 8(%2) \n" |
215 | "addu\t%0, $1\n\t" | 218 | " addu %0, $1 \n" |
216 | "addu\t%0, %1\n\t" | 219 | " addu %0, %1 \n" |
217 | "sltu\t$1, %0, %1\n\t" | 220 | " sltu $1, %0, %1 \n" |
218 | 221 | ||
219 | "lw\t%1, 12(%2)\n\t" | 222 | " lw %1, 12(%2) \n" |
220 | "addu\t%0, $1\n\t" | 223 | " addu %0, $1 \n" |
221 | "addu\t%0, %1\n\t" | 224 | " addu %0, %1 \n" |
222 | "sltu\t$1, %0, %1\n\t" | 225 | " sltu $1, %0, %1 \n" |
223 | 226 | ||
224 | "lw\t%1, 0(%3)\n\t" | 227 | " lw %1, 0(%3) \n" |
225 | "addu\t%0, $1\n\t" | 228 | " addu %0, $1 \n" |
226 | "addu\t%0, %1\n\t" | 229 | " addu %0, %1 \n" |
227 | "sltu\t$1, %0, %1\n\t" | 230 | " sltu $1, %0, %1 \n" |
228 | 231 | ||
229 | "lw\t%1, 4(%3)\n\t" | 232 | " lw %1, 4(%3) \n" |
230 | "addu\t%0, $1\n\t" | 233 | " addu %0, $1 \n" |
231 | "addu\t%0, %1\n\t" | 234 | " addu %0, %1 \n" |
232 | "sltu\t$1, %0, %1\n\t" | 235 | " sltu $1, %0, %1 \n" |
233 | 236 | ||
234 | "lw\t%1, 8(%3)\n\t" | 237 | " lw %1, 8(%3) \n" |
235 | "addu\t%0, $1\n\t" | 238 | " addu %0, $1 \n" |
236 | "addu\t%0, %1\n\t" | 239 | " addu %0, %1 \n" |
237 | "sltu\t$1, %0, %1\n\t" | 240 | " sltu $1, %0, %1 \n" |
238 | 241 | ||
239 | "lw\t%1, 12(%3)\n\t" | 242 | " lw %1, 12(%3) \n" |
240 | "addu\t%0, $1\n\t" | 243 | " addu %0, $1 \n" |
241 | "addu\t%0, %1\n\t" | 244 | " addu %0, %1 \n" |
242 | "sltu\t$1, %0, %1\n\t" | 245 | " sltu $1, %0, %1 \n" |
243 | 246 | ||
244 | "addu\t%0, $1\t\t\t# Add final carry\n\t" | 247 | " addu %0, $1 # Add final carry\n" |
245 | ".set\tpop" | 248 | " .set pop" |
246 | : "=r" (sum), "=r" (proto) | 249 | : "=r" (sum), "=r" (proto) |
247 | : "r" (saddr), "r" (daddr), | 250 | : "r" (saddr), "r" (daddr), |
248 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); | 251 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); |
diff --git a/include/asm-mips/cobalt/cobalt.h b/include/asm-mips/cobalt/cobalt.h index ca1fbc0579fe..78e1df2095fb 100644 --- a/include/asm-mips/cobalt/cobalt.h +++ b/include/asm-mips/cobalt/cobalt.h | |||
@@ -19,18 +19,23 @@ | |||
19 | * 9 - PCI | 19 | * 9 - PCI |
20 | * 14 - IDE0 | 20 | * 14 - IDE0 |
21 | * 15 - IDE1 | 21 | * 15 - IDE1 |
22 | * | 22 | */ |
23 | #define COBALT_QUBE_SLOT_IRQ 9 | ||
24 | |||
25 | /* | ||
23 | * CPU IRQs are 16 ... 23 | 26 | * CPU IRQs are 16 ... 23 |
24 | */ | 27 | */ |
25 | #define COBALT_TIMER_IRQ 18 | 28 | #define COBALT_CPU_IRQ 16 |
26 | #define COBALT_SCC_IRQ 19 /* pre-production has 85C30 */ | 29 | |
27 | #define COBALT_RAQ_SCSI_IRQ 19 | 30 | #define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2) |
28 | #define COBALT_ETH0_IRQ 19 | 31 | #define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */ |
29 | #define COBALT_ETH1_IRQ 20 | 32 | #define COBALT_RAQ_SCSI_IRQ (COBALT_CPU_IRQ + 3) |
30 | #define COBALT_SERIAL_IRQ 21 | 33 | #define COBALT_ETH0_IRQ (COBALT_CPU_IRQ + 3) |
31 | #define COBALT_SCSI_IRQ 21 | 34 | #define COBALT_QUBE1_ETH0_IRQ (COBALT_CPU_IRQ + 4) |
32 | #define COBALT_VIA_IRQ 22 /* Chained to VIA ISA bridge */ | 35 | #define COBALT_ETH1_IRQ (COBALT_CPU_IRQ + 4) |
33 | #define COBALT_QUBE_SLOT_IRQ 23 | 36 | #define COBALT_SERIAL_IRQ (COBALT_CPU_IRQ + 5) |
37 | #define COBALT_SCSI_IRQ (COBALT_CPU_IRQ + 5) | ||
38 | #define COBALT_VIA_IRQ (COBALT_CPU_IRQ + 6) /* Chained to VIA ISA bridge */ | ||
34 | 39 | ||
35 | /* | 40 | /* |
36 | * PCI configuration space manifest constants. These are wired into | 41 | * PCI configuration space manifest constants. These are wired into |
@@ -69,16 +74,21 @@ | |||
69 | * Most of this really should go into a separate GT64111 header file. | 74 | * Most of this really should go into a separate GT64111 header file. |
70 | */ | 75 | */ |
71 | #define GT64111_IO_BASE 0x10000000UL | 76 | #define GT64111_IO_BASE 0x10000000UL |
77 | #define GT64111_IO_END 0x11ffffffUL | ||
78 | #define GT64111_MEM_BASE 0x12000000UL | ||
79 | #define GT64111_MEM_END 0x13ffffffUL | ||
72 | #define GT64111_BASE 0x14000000UL | 80 | #define GT64111_BASE 0x14000000UL |
73 | #define GALILEO_REG(ofs) (KSEG0 + GT64111_BASE + (unsigned long)(ofs)) | 81 | #define GALILEO_REG(ofs) CKSEG1ADDR(GT64111_BASE + (unsigned long)(ofs)) |
74 | 82 | ||
75 | #define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port)) | 83 | #define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port)) |
76 | #define GALILEO_OUTL(val, port) \ | 84 | #define GALILEO_OUTL(val, port) \ |
77 | do { \ | 85 | do { \ |
78 | *(volatile unsigned int *) GALILEO_REG(port) = (port); \ | 86 | *(volatile unsigned int *) GALILEO_REG(port) = (val); \ |
79 | } while (0) | 87 | } while (0) |
80 | 88 | ||
81 | #define GALILEO_T0EXP 0x0100 | 89 | #define GALILEO_INTR_T0EXP (1 << 8) |
90 | #define GALILEO_INTR_RETRY_CTR (1 << 20) | ||
91 | |||
82 | #define GALILEO_ENTC0 0x01 | 92 | #define GALILEO_ENTC0 0x01 |
83 | #define GALILEO_SELTC0 0x02 | 93 | #define GALILEO_SELTC0 0x02 |
84 | 94 | ||
@@ -86,5 +96,21 @@ do { \ | |||
86 | GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \ | 96 | GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \ |
87 | (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS) | 97 | (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS) |
88 | 98 | ||
99 | #define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) | ||
100 | # define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ | ||
101 | # define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */ | ||
102 | # define COBALT_LED_WEB (1 << 2) /* RaQ */ | ||
103 | # define COBALT_LED_POWER_OFF (1 << 3) /* RaQ */ | ||
104 | # define COBALT_LED_RESET 0x0f | ||
105 | |||
106 | #define COBALT_KEY_PORT ((~*(volatile unsigned int *) CKSEG1ADDR(0x1d000000) >> 24) & COBALT_KEY_MASK) | ||
107 | # define COBALT_KEY_CLEAR (1 << 1) | ||
108 | # define COBALT_KEY_LEFT (1 << 2) | ||
109 | # define COBALT_KEY_UP (1 << 3) | ||
110 | # define COBALT_KEY_DOWN (1 << 4) | ||
111 | # define COBALT_KEY_RIGHT (1 << 5) | ||
112 | # define COBALT_KEY_ENTER (1 << 6) | ||
113 | # define COBALT_KEY_SELECT (1 << 7) | ||
114 | # define COBALT_KEY_MASK 0xfe | ||
89 | 115 | ||
90 | #endif /* __ASM_COBALT_H */ | 116 | #endif /* __ASM_COBALT_H */ |
diff --git a/include/asm-mips/cobalt/mach-gt64120.h b/include/asm-mips/cobalt/mach-gt64120.h new file mode 100644 index 000000000000..587fc4378f44 --- /dev/null +++ b/include/asm-mips/cobalt/mach-gt64120.h | |||
@@ -0,0 +1 @@ | |||
/* there's something here ... in the dark */ | |||
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index 2c084cd4bc0a..35d2604fe69c 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h | |||
@@ -15,10 +15,10 @@ typedef s32 compat_clock_t; | |||
15 | typedef s32 compat_suseconds_t; | 15 | typedef s32 compat_suseconds_t; |
16 | 16 | ||
17 | typedef s32 compat_pid_t; | 17 | typedef s32 compat_pid_t; |
18 | typedef u32 __compat_uid_t; | 18 | typedef s32 __compat_uid_t; |
19 | typedef u32 __compat_gid_t; | 19 | typedef s32 __compat_gid_t; |
20 | typedef u32 __compat_uid32_t; | 20 | typedef __compat_uid_t __compat_uid32_t; |
21 | typedef u32 __compat_gid32_t; | 21 | typedef __compat_gid_t __compat_gid32_t; |
22 | typedef u32 compat_mode_t; | 22 | typedef u32 compat_mode_t; |
23 | typedef u32 compat_ino_t; | 23 | typedef u32 compat_ino_t; |
24 | typedef u32 compat_dev_t; | 24 | typedef u32 compat_dev_t; |
@@ -54,8 +54,8 @@ struct compat_stat { | |||
54 | compat_ino_t st_ino; | 54 | compat_ino_t st_ino; |
55 | compat_mode_t st_mode; | 55 | compat_mode_t st_mode; |
56 | compat_nlink_t st_nlink; | 56 | compat_nlink_t st_nlink; |
57 | __compat_uid32_t st_uid; | 57 | __compat_uid_t st_uid; |
58 | __compat_gid32_t st_gid; | 58 | __compat_gid_t st_gid; |
59 | compat_dev_t st_rdev; | 59 | compat_dev_t st_rdev; |
60 | s32 st_pad2[2]; | 60 | s32 st_pad2[2]; |
61 | compat_off_t st_size; | 61 | compat_off_t st_size; |
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 9a2de642eee6..03627cfb3e45 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2003, 2004 Ralf Baechle | 6 | * Copyright (C) 2003, 2004 Ralf Baechle |
7 | * Copyright (C) 2004 Maciej W. Rozycki | ||
7 | */ | 8 | */ |
8 | #ifndef __ASM_CPU_FEATURES_H | 9 | #ifndef __ASM_CPU_FEATURES_H |
9 | #define __ASM_CPU_FEATURES_H | 10 | #define __ASM_CPU_FEATURES_H |
@@ -24,8 +25,19 @@ | |||
24 | #ifndef cpu_has_4kex | 25 | #ifndef cpu_has_4kex |
25 | #define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX) | 26 | #define cpu_has_4kex (cpu_data[0].options & MIPS_CPU_4KEX) |
26 | #endif | 27 | #endif |
27 | #ifndef cpu_has_4ktlb | 28 | #ifndef cpu_has_3k_cache |
28 | #define cpu_has_4ktlb (cpu_data[0].options & MIPS_CPU_4KTLB) | 29 | #define cpu_has_3k_cache (cpu_data[0].options & MIPS_CPU_3K_CACHE) |
30 | #endif | ||
31 | #define cpu_has_6k_cache 0 | ||
32 | #define cpu_has_8k_cache 0 | ||
33 | #ifndef cpu_has_4k_cache | ||
34 | #define cpu_has_4k_cache (cpu_data[0].options & MIPS_CPU_4K_CACHE) | ||
35 | #endif | ||
36 | #ifndef cpu_has_tx39_cache | ||
37 | #define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE) | ||
38 | #endif | ||
39 | #ifndef cpu_has_sb1_cache | ||
40 | #define cpu_has_sb1_cache (cpu_data[0].options & MIPS_CPU_SB1_CACHE) | ||
29 | #endif | 41 | #endif |
30 | #ifndef cpu_has_fpu | 42 | #ifndef cpu_has_fpu |
31 | #define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) | 43 | #define cpu_has_fpu (cpu_data[0].options & MIPS_CPU_FPU) |
@@ -39,9 +51,6 @@ | |||
39 | #ifndef cpu_has_watch | 51 | #ifndef cpu_has_watch |
40 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) | 52 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) |
41 | #endif | 53 | #endif |
42 | #ifndef cpu_has_mips16 | ||
43 | #define cpu_has_mips16 (cpu_data[0].options & MIPS_CPU_MIPS16) | ||
44 | #endif | ||
45 | #ifndef cpu_has_divec | 54 | #ifndef cpu_has_divec |
46 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) | 55 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) |
47 | #endif | 56 | #endif |
@@ -66,6 +75,18 @@ | |||
66 | #ifndef cpu_has_llsc | 75 | #ifndef cpu_has_llsc |
67 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) | 76 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) |
68 | #endif | 77 | #endif |
78 | #ifndef cpu_has_mips16 | ||
79 | #define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16) | ||
80 | #endif | ||
81 | #ifndef cpu_has_mdmx | ||
82 | #define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX) | ||
83 | #endif | ||
84 | #ifndef cpu_has_mips3d | ||
85 | #define cpu_has_mips3d (cpu_data[0].ases & MIPS_ASE_MIPS3D) | ||
86 | #endif | ||
87 | #ifndef cpu_has_smartmips | ||
88 | #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) | ||
89 | #endif | ||
69 | #ifndef cpu_has_vtag_icache | 90 | #ifndef cpu_has_vtag_icache |
70 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) | 91 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) |
71 | #endif | 92 | #endif |
@@ -95,15 +116,16 @@ | |||
95 | #endif | 116 | #endif |
96 | #endif | 117 | #endif |
97 | 118 | ||
98 | /* | 119 | #ifndef cpu_has_dsp |
99 | * Certain CPUs may throw bizarre exceptions if not the whole cacheline | 120 | #define cpu_has_dsp (cpu_data[0].ases & MIPS_ASE_DSP) |
100 | * contains valid instructions. For these we ensure proper alignment of | 121 | #endif |
101 | * signal trampolines and pad them to the size of a full cache lines with | 122 | |
102 | * nops. This is also used in structure definitions so can't be a test macro | 123 | #ifdef CONFIG_MIPS_MT |
103 | * like the others. | 124 | #ifndef cpu_has_mipsmt |
104 | */ | 125 | # define cpu_has_mipsmt (cpu_data[0].ases & MIPS_ASE_MIPSMT) |
105 | #ifndef PLAT_TRAMPOLINE_STUFF_LINE | 126 | #endif |
106 | #define PLAT_TRAMPOLINE_STUFF_LINE 0UL | 127 | #else |
128 | # define cpu_has_mipsmt 0 | ||
107 | #endif | 129 | #endif |
108 | 130 | ||
109 | #ifdef CONFIG_32BIT | 131 | #ifdef CONFIG_32BIT |
@@ -142,6 +164,22 @@ | |||
142 | # endif | 164 | # endif |
143 | #endif | 165 | #endif |
144 | 166 | ||
167 | #ifdef CONFIG_CPU_MIPSR2 | ||
168 | # if defined(CONFIG_CPU_MIPSR2_IRQ_VI) && !defined(cpu_has_vint) | ||
169 | # define cpu_has_vint (cpu_data[0].options & MIPS_CPU_VINT) | ||
170 | # else | ||
171 | # define cpu_has_vint 0 | ||
172 | # endif | ||
173 | # if defined(CONFIG_CPU_MIPSR2_IRQ_EI) && !defined(cpu_has_veic) | ||
174 | # define cpu_has_veic (cpu_data[0].options & MIPS_CPU_VEIC) | ||
175 | # else | ||
176 | # define cpu_has_veic 0 | ||
177 | # endif | ||
178 | #else | ||
179 | # define cpu_has_vint 0 | ||
180 | # define cpu_has_veic 0 | ||
181 | #endif | ||
182 | |||
145 | #ifndef cpu_has_subset_pcaches | 183 | #ifndef cpu_has_subset_pcaches |
146 | #define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) | 184 | #define cpu_has_subset_pcaches (cpu_data[0].options & MIPS_CPU_SUBSET_CACHES) |
147 | #endif | 185 | #endif |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index 20a35b15a31d..d5cf519f8fcc 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
@@ -7,6 +7,7 @@ | |||
7 | * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle | 7 | * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle |
8 | * Copyright (C) 1996 Paul M. Antoine | 8 | * Copyright (C) 1996 Paul M. Antoine |
9 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 9 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
10 | * Copyright (C) 2004 Maciej W. Rozycki | ||
10 | */ | 11 | */ |
11 | #ifndef __ASM_CPU_INFO_H | 12 | #ifndef __ASM_CPU_INFO_H |
12 | #define __ASM_CPU_INFO_H | 13 | #define __ASM_CPU_INFO_H |
@@ -61,6 +62,7 @@ struct cpuinfo_mips { | |||
61 | * Capability and feature descriptor structure for MIPS CPU | 62 | * Capability and feature descriptor structure for MIPS CPU |
62 | */ | 63 | */ |
63 | unsigned long options; | 64 | unsigned long options; |
65 | unsigned long ases; | ||
64 | unsigned int processor_id; | 66 | unsigned int processor_id; |
65 | unsigned int fpu_id; | 67 | unsigned int fpu_id; |
66 | unsigned int cputype; | 68 | unsigned int cputype; |
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index dec060b49556..48eac296060f 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * various MIPS cpu types. | 3 | * various MIPS cpu types. |
4 | * | 4 | * |
5 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | 5 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) |
6 | * Copyright (C) 2004 Maciej W. Rozycki | ||
6 | */ | 7 | */ |
7 | #ifndef _ASM_CPU_H | 8 | #ifndef _ASM_CPU_H |
8 | #define _ASM_CPU_H | 9 | #define _ASM_CPU_H |
@@ -22,12 +23,17 @@ | |||
22 | spec. | 23 | spec. |
23 | */ | 24 | */ |
24 | 25 | ||
25 | #define PRID_COMP_LEGACY 0x000000 | 26 | #define PRID_COMP_LEGACY 0x000000 |
26 | #define PRID_COMP_MIPS 0x010000 | 27 | #define PRID_COMP_MIPS 0x010000 |
27 | #define PRID_COMP_BROADCOM 0x020000 | 28 | #define PRID_COMP_BROADCOM 0x020000 |
28 | #define PRID_COMP_ALCHEMY 0x030000 | 29 | #define PRID_COMP_ALCHEMY 0x030000 |
29 | #define PRID_COMP_SIBYTE 0x040000 | 30 | #define PRID_COMP_SIBYTE 0x040000 |
30 | #define PRID_COMP_SANDCRAFT 0x050000 | 31 | #define PRID_COMP_SANDCRAFT 0x050000 |
32 | #define PRID_COMP_PHILIPS 0x060000 | ||
33 | #define PRID_COMP_TOSHIBA 0x070000 | ||
34 | #define PRID_COMP_LSI 0x080000 | ||
35 | #define PRID_COMP_LEXRA 0x0b0000 | ||
36 | |||
31 | 37 | ||
32 | /* | 38 | /* |
33 | * Assigned values for the product ID register. In order to detect a | 39 | * Assigned values for the product ID register. In order to detect a |
@@ -46,6 +52,7 @@ | |||
46 | #define PRID_IMP_VR41XX 0x0c00 | 52 | #define PRID_IMP_VR41XX 0x0c00 |
47 | #define PRID_IMP_R12000 0x0e00 | 53 | #define PRID_IMP_R12000 0x0e00 |
48 | #define PRID_IMP_R8000 0x1000 | 54 | #define PRID_IMP_R8000 0x1000 |
55 | #define PRID_IMP_PR4450 0x1200 | ||
49 | #define PRID_IMP_R4600 0x2000 | 56 | #define PRID_IMP_R4600 0x2000 |
50 | #define PRID_IMP_R4700 0x2100 | 57 | #define PRID_IMP_R4700 0x2100 |
51 | #define PRID_IMP_TX39 0x2200 | 58 | #define PRID_IMP_TX39 0x2200 |
@@ -60,6 +67,13 @@ | |||
60 | #define PRID_IMP_RM9000 0x3400 | 67 | #define PRID_IMP_RM9000 0x3400 |
61 | #define PRID_IMP_R5432 0x5400 | 68 | #define PRID_IMP_R5432 0x5400 |
62 | #define PRID_IMP_R5500 0x5500 | 69 | #define PRID_IMP_R5500 0x5500 |
70 | |||
71 | #define PRID_IMP_UNKNOWN 0xff00 | ||
72 | |||
73 | /* | ||
74 | * These are the PRID's for when 23:16 == PRID_COMP_MIPS | ||
75 | */ | ||
76 | |||
63 | #define PRID_IMP_4KC 0x8000 | 77 | #define PRID_IMP_4KC 0x8000 |
64 | #define PRID_IMP_5KC 0x8100 | 78 | #define PRID_IMP_5KC 0x8100 |
65 | #define PRID_IMP_20KC 0x8200 | 79 | #define PRID_IMP_20KC 0x8200 |
@@ -71,14 +85,15 @@ | |||
71 | #define PRID_IMP_4KEMPR2 0x9100 | 85 | #define PRID_IMP_4KEMPR2 0x9100 |
72 | #define PRID_IMP_4KSD 0x9200 | 86 | #define PRID_IMP_4KSD 0x9200 |
73 | #define PRID_IMP_24K 0x9300 | 87 | #define PRID_IMP_24K 0x9300 |
74 | 88 | #define PRID_IMP_34K 0x9500 | |
75 | #define PRID_IMP_UNKNOWN 0xff00 | 89 | #define PRID_IMP_24KE 0x9600 |
76 | 90 | ||
77 | /* | 91 | /* |
78 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE | 92 | * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE |
79 | */ | 93 | */ |
80 | 94 | ||
81 | #define PRID_IMP_SB1 0x0100 | 95 | #define PRID_IMP_SB1 0x0100 |
96 | #define PRID_IMP_SB1A 0x1100 | ||
82 | 97 | ||
83 | /* | 98 | /* |
84 | * These are the PRID's for when 23:16 == PRID_COMP_SANDCRAFT | 99 | * These are the PRID's for when 23:16 == PRID_COMP_SANDCRAFT |
@@ -177,7 +192,11 @@ | |||
177 | #define CPU_VR4133 56 | 192 | #define CPU_VR4133 56 |
178 | #define CPU_AU1550 57 | 193 | #define CPU_AU1550 57 |
179 | #define CPU_24K 58 | 194 | #define CPU_24K 58 |
180 | #define CPU_LAST 58 | 195 | #define CPU_AU1200 59 |
196 | #define CPU_34K 60 | ||
197 | #define CPU_PR4450 61 | ||
198 | #define CPU_SB1A 62 | ||
199 | #define CPU_LAST 62 | ||
181 | 200 | ||
182 | /* | 201 | /* |
183 | * ISA Level encodings | 202 | * ISA Level encodings |
@@ -200,23 +219,37 @@ | |||
200 | * CPU Option encodings | 219 | * CPU Option encodings |
201 | */ | 220 | */ |
202 | #define MIPS_CPU_TLB 0x00000001 /* CPU has TLB */ | 221 | #define MIPS_CPU_TLB 0x00000001 /* CPU has TLB */ |
203 | /* Leave a spare bit for variant MMU types... */ | 222 | #define MIPS_CPU_4KEX 0x00000002 /* "R4K" exception model */ |
204 | #define MIPS_CPU_4KEX 0x00000004 /* "R4K" exception model */ | 223 | #define MIPS_CPU_3K_CACHE 0x00000004 /* R3000-style caches */ |
205 | #define MIPS_CPU_4KTLB 0x00000008 /* "R4K" TLB handler */ | 224 | #define MIPS_CPU_4K_CACHE 0x00000008 /* R4000-style caches */ |
206 | #define MIPS_CPU_FPU 0x00000010 /* CPU has FPU */ | 225 | #define MIPS_CPU_TX39_CACHE 0x00000010 /* TX3900-style caches */ |
207 | #define MIPS_CPU_32FPR 0x00000020 /* 32 dbl. prec. FP registers */ | 226 | #define MIPS_CPU_SB1_CACHE 0x00000020 /* SB1-style caches */ |
208 | #define MIPS_CPU_COUNTER 0x00000040 /* Cycle count/compare */ | 227 | #define MIPS_CPU_FPU 0x00000040 /* CPU has FPU */ |
209 | #define MIPS_CPU_WATCH 0x00000080 /* watchpoint registers */ | 228 | #define MIPS_CPU_32FPR 0x00000080 /* 32 dbl. prec. FP registers */ |
210 | #define MIPS_CPU_MIPS16 0x00000100 /* code compression */ | 229 | #define MIPS_CPU_COUNTER 0x00000100 /* Cycle count/compare */ |
211 | #define MIPS_CPU_DIVEC 0x00000200 /* dedicated interrupt vector */ | 230 | #define MIPS_CPU_WATCH 0x00000200 /* watchpoint registers */ |
212 | #define MIPS_CPU_VCE 0x00000400 /* virt. coherence conflict possible */ | 231 | #define MIPS_CPU_DIVEC 0x00000400 /* dedicated interrupt vector */ |
213 | #define MIPS_CPU_CACHE_CDEX_P 0x00000800 /* Create_Dirty_Exclusive CACHE op */ | 232 | #define MIPS_CPU_VCE 0x00000800 /* virt. coherence conflict possible */ |
214 | #define MIPS_CPU_CACHE_CDEX_S 0x00001000 /* ... same for seconary cache ... */ | 233 | #define MIPS_CPU_CACHE_CDEX_P 0x00001000 /* Create_Dirty_Exclusive CACHE op */ |
215 | #define MIPS_CPU_MCHECK 0x00002000 /* Machine check exception */ | 234 | #define MIPS_CPU_CACHE_CDEX_S 0x00002000 /* ... same for seconary cache ... */ |
216 | #define MIPS_CPU_EJTAG 0x00004000 /* EJTAG exception */ | 235 | #define MIPS_CPU_MCHECK 0x00004000 /* Machine check exception */ |
217 | #define MIPS_CPU_NOFPUEX 0x00008000 /* no FPU exception */ | 236 | #define MIPS_CPU_EJTAG 0x00008000 /* EJTAG exception */ |
218 | #define MIPS_CPU_LLSC 0x00010000 /* CPU has ll/sc instructions */ | 237 | #define MIPS_CPU_NOFPUEX 0x00010000 /* no FPU exception */ |
219 | #define MIPS_CPU_SUBSET_CACHES 0x00020000 /* P-cache subset enforced */ | 238 | #define MIPS_CPU_LLSC 0x00020000 /* CPU has ll/sc instructions */ |
220 | #define MIPS_CPU_PREFETCH 0x00040000 /* CPU has usable prefetch */ | 239 | #define MIPS_CPU_SUBSET_CACHES 0x00040000 /* P-cache subset enforced */ |
240 | #define MIPS_CPU_PREFETCH 0x00080000 /* CPU has usable prefetch */ | ||
241 | #define MIPS_CPU_VINT 0x00100000 /* CPU supports MIPSR2 vectored interrupts */ | ||
242 | #define MIPS_CPU_VEIC 0x00200000 /* CPU supports MIPSR2 external interrupt controller mode */ | ||
243 | |||
244 | /* | ||
245 | * CPU ASE encodings | ||
246 | */ | ||
247 | #define MIPS_ASE_MIPS16 0x00000001 /* code compression */ | ||
248 | #define MIPS_ASE_MDMX 0x00000002 /* MIPS digital media extension */ | ||
249 | #define MIPS_ASE_MIPS3D 0x00000004 /* MIPS-3D */ | ||
250 | #define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */ | ||
251 | #define MIPS_ASE_DSP 0x00000010 /* Signal Processing ASE */ | ||
252 | #define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */ | ||
253 | |||
221 | 254 | ||
222 | #endif /* _ASM_CPU_H */ | 255 | #endif /* _ASM_CPU_H */ |
diff --git a/include/asm-mips/dec/ecc.h b/include/asm-mips/dec/ecc.h index 724908b0bf13..19495a490e72 100644 --- a/include/asm-mips/dec/ecc.h +++ b/include/asm-mips/dec/ecc.h | |||
@@ -49,7 +49,8 @@ struct pt_regs; | |||
49 | 49 | ||
50 | extern void dec_ecc_be_init(void); | 50 | extern void dec_ecc_be_init(void); |
51 | extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup); | 51 | extern int dec_ecc_be_handler(struct pt_regs *regs, int is_fixup); |
52 | extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 52 | extern irqreturn_t dec_ecc_be_interrupt(int irq, void *dev_id, |
53 | struct pt_regs *regs); | ||
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | #endif /* __ASM_MIPS_DEC_ECC_H */ | 56 | #endif /* __ASM_MIPS_DEC_ECC_H */ |
diff --git a/include/asm-mips/dec/ioasic_addrs.h b/include/asm-mips/dec/ioasic_addrs.h index 5e18a7510592..4cbc1f8a1129 100644 --- a/include/asm-mips/dec/ioasic_addrs.h +++ b/include/asm-mips/dec/ioasic_addrs.h | |||
@@ -45,7 +45,8 @@ | |||
45 | 45 | ||
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Offsets for I/O ASIC registers (relative to (system_base + IOASIC_IOCTL)). | 48 | * Offsets for I/O ASIC registers |
49 | * (relative to (dec_kn_slot_base + IOASIC_IOCTL)). | ||
49 | */ | 50 | */ |
50 | /* all systems */ | 51 | /* all systems */ |
51 | #define IO_REG_SCSI_DMA_P 0x00 /* SCSI DMA Pointer */ | 52 | #define IO_REG_SCSI_DMA_P 0x00 /* SCSI DMA Pointer */ |
diff --git a/include/asm-mips/dec/kn01.h b/include/asm-mips/dec/kn01.h index 946943502f83..eb522aa1e226 100644 --- a/include/asm-mips/dec/kn01.h +++ b/include/asm-mips/dec/kn01.h | |||
@@ -8,14 +8,12 @@ | |||
8 | * | 8 | * |
9 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | 9 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions |
10 | * are by courtesy of Chris Fraser. | 10 | * are by courtesy of Chris Fraser. |
11 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | 11 | * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki |
12 | */ | 12 | */ |
13 | #ifndef __ASM_MIPS_DEC_KN01_H | 13 | #ifndef __ASM_MIPS_DEC_KN01_H |
14 | #define __ASM_MIPS_DEC_KN01_H | 14 | #define __ASM_MIPS_DEC_KN01_H |
15 | 15 | ||
16 | #include <asm/addrspace.h> | 16 | #define KN01_SLOT_BASE 0x10000000 |
17 | |||
18 | #define KN01_SLOT_BASE KSEG1ADDR(0x10000000) | ||
19 | #define KN01_SLOT_SIZE 0x01000000 | 17 | #define KN01_SLOT_SIZE 0x01000000 |
20 | 18 | ||
21 | /* | 19 | /* |
@@ -41,17 +39,9 @@ | |||
41 | 39 | ||
42 | 40 | ||
43 | /* | 41 | /* |
44 | * Some port addresses... | ||
45 | */ | ||
46 | #define KN01_LANCE_BASE (KN01_SLOT_BASE + KN01_LANCE) /* 0xB8000000 */ | ||
47 | #define KN01_DZ11_BASE (KN01_SLOT_BASE + KN01_DZ11) /* 0xBC000000 */ | ||
48 | #define KN01_RTC_BASE (KN01_SLOT_BASE + KN01_RTC) /* 0xBD000000 */ | ||
49 | |||
50 | |||
51 | /* | ||
52 | * Frame buffer memory address. | 42 | * Frame buffer memory address. |
53 | */ | 43 | */ |
54 | #define KN01_VFB_MEM KSEG1ADDR(0x0fc00000) | 44 | #define KN01_VFB_MEM 0x0fc00000 |
55 | 45 | ||
56 | /* | 46 | /* |
57 | * CPU interrupt bits. | 47 | * CPU interrupt bits. |
@@ -80,4 +70,22 @@ | |||
80 | #define KN01_CSR_VRGTRB (1<<0) /* red DAC voltage over blue (r/o) */ | 70 | #define KN01_CSR_VRGTRB (1<<0) /* red DAC voltage over blue (r/o) */ |
81 | #define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ | 71 | #define KN01_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ |
82 | 72 | ||
73 | |||
74 | #ifndef __ASSEMBLY__ | ||
75 | |||
76 | #include <linux/interrupt.h> | ||
77 | #include <linux/spinlock.h> | ||
78 | #include <linux/types.h> | ||
79 | |||
80 | struct pt_regs; | ||
81 | |||
82 | extern u16 cached_kn01_csr; | ||
83 | extern spinlock_t kn01_lock; | ||
84 | |||
85 | extern void dec_kn01_be_init(void); | ||
86 | extern int dec_kn01_be_handler(struct pt_regs *regs, int is_fixup); | ||
87 | extern irqreturn_t dec_kn01_be_interrupt(int irq, void *dev_id, | ||
88 | struct pt_regs *regs); | ||
89 | #endif | ||
90 | |||
83 | #endif /* __ASM_MIPS_DEC_KN01_H */ | 91 | #endif /* __ASM_MIPS_DEC_KN01_H */ |
diff --git a/include/asm-mips/dec/kn02.h b/include/asm-mips/dec/kn02.h index f797f7045920..8319ad77b250 100644 --- a/include/asm-mips/dec/kn02.h +++ b/include/asm-mips/dec/kn02.h | |||
@@ -8,21 +8,12 @@ | |||
8 | * | 8 | * |
9 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | 9 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions |
10 | * are by courtesy of Chris Fraser. | 10 | * are by courtesy of Chris Fraser. |
11 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | 11 | * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki |
12 | */ | 12 | */ |
13 | #ifndef __ASM_MIPS_DEC_KN02_H | 13 | #ifndef __ASM_MIPS_DEC_KN02_H |
14 | #define __ASM_MIPS_DEC_KN02_H | 14 | #define __ASM_MIPS_DEC_KN02_H |
15 | 15 | ||
16 | #ifndef __ASSEMBLY__ | 16 | #define KN02_SLOT_BASE 0x1fc00000 |
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/types.h> | ||
19 | #endif | ||
20 | |||
21 | #include <asm/addrspace.h> | ||
22 | #include <asm/dec/ecc.h> | ||
23 | |||
24 | |||
25 | #define KN02_SLOT_BASE KSEG1ADDR(0x1fc00000) | ||
26 | #define KN02_SLOT_SIZE 0x00080000 | 17 | #define KN02_SLOT_SIZE 0x00080000 |
27 | 18 | ||
28 | /* | 19 | /* |
@@ -39,22 +30,14 @@ | |||
39 | 30 | ||
40 | 31 | ||
41 | /* | 32 | /* |
42 | * Some port addresses... | ||
43 | */ | ||
44 | #define KN02_DZ11_BASE (KN02_SLOT_BASE + KN02_DZ11) /* DZ11 */ | ||
45 | #define KN02_RTC_BASE (KN02_SLOT_BASE + KN02_RTC) /* RTC */ | ||
46 | #define KN02_CSR_BASE (KN02_SLOT_BASE + KN02_CSR) /* CSR */ | ||
47 | |||
48 | |||
49 | /* | ||
50 | * System Control & Status Register bits. | 33 | * System Control & Status Register bits. |
51 | */ | 34 | */ |
52 | #define KN02_CSR_RES_28 (0xf<<28) /* unused */ | 35 | #define KN02_CSR_RES_28 (0xf<<28) /* unused */ |
53 | #define KN02_CSR_PSU (1<<27) /* power supply unit warning */ | 36 | #define KN02_CSR_PSU (1<<27) /* power supply unit warning */ |
54 | #define KN02_CSR_NVRAM (1<<26) /* ~NVRAM clear jumper */ | 37 | #define KN02_CSR_NVRAM (1<<26) /* ~NVRAM clear jumper */ |
55 | #define KN02_CSR_REFEVEN (1<<25) /* mem refresh bank toggle */ | 38 | #define KN02_CSR_REFEVEN (1<<25) /* mem refresh bank toggle */ |
56 | #define KN03_CSR_NRMOD (1<<24) /* ~NRMOD manufact. jumper */ | 39 | #define KN02_CSR_NRMOD (1<<24) /* ~NRMOD manufact. jumper */ |
57 | #define KN03_CSR_IOINTEN (0xff<<16) /* IRQ mask bits */ | 40 | #define KN02_CSR_IOINTEN (0xff<<16) /* IRQ mask bits */ |
58 | #define KN02_CSR_DIAGCHK (1<<15) /* diagn/norml ECC reads */ | 41 | #define KN02_CSR_DIAGCHK (1<<15) /* diagn/norml ECC reads */ |
59 | #define KN02_CSR_DIAGGEN (1<<14) /* diagn/norml ECC writes */ | 42 | #define KN02_CSR_DIAGGEN (1<<14) /* diagn/norml ECC writes */ |
60 | #define KN02_CSR_CORRECT (1<<13) /* ECC correct/check */ | 43 | #define KN02_CSR_CORRECT (1<<13) /* ECC correct/check */ |
@@ -63,8 +46,8 @@ | |||
63 | #define KN02_CSR_BNK32M (1<<10) /* 32M/8M stride */ | 46 | #define KN02_CSR_BNK32M (1<<10) /* 32M/8M stride */ |
64 | #define KN02_CSR_DIAGDN (1<<9) /* DIAGDN manufact. jumper */ | 47 | #define KN02_CSR_DIAGDN (1<<9) /* DIAGDN manufact. jumper */ |
65 | #define KN02_CSR_BAUD38 (1<<8) /* DZ11 38/19kbps ext. rate */ | 48 | #define KN02_CSR_BAUD38 (1<<8) /* DZ11 38/19kbps ext. rate */ |
66 | #define KN03_CSR_IOINT (0xff<<0) /* IRQ status bits (r/o) */ | 49 | #define KN02_CSR_IOINT (0xff<<0) /* IRQ status bits (r/o) */ |
67 | #define KN03_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ | 50 | #define KN02_CSR_LEDS (0xff<<0) /* ~diagnostic LEDs (w/o) */ |
68 | 51 | ||
69 | 52 | ||
70 | /* | 53 | /* |
@@ -98,6 +81,10 @@ | |||
98 | 81 | ||
99 | 82 | ||
100 | #ifndef __ASSEMBLY__ | 83 | #ifndef __ASSEMBLY__ |
84 | |||
85 | #include <linux/spinlock.h> | ||
86 | #include <linux/types.h> | ||
87 | |||
101 | extern u32 cached_kn02_csr; | 88 | extern u32 cached_kn02_csr; |
102 | extern spinlock_t kn02_lock; | 89 | extern spinlock_t kn02_lock; |
103 | extern void init_kn02_irqs(int base); | 90 | extern void init_kn02_irqs(int base); |
diff --git a/include/asm-mips/dec/kn02xa.h b/include/asm-mips/dec/kn02xa.h index 648c4dcbba1d..a25f3d7da7f7 100644 --- a/include/asm-mips/dec/kn02xa.h +++ b/include/asm-mips/dec/kn02xa.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | 10 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions |
11 | * are by courtesy of Chris Fraser. | 11 | * are by courtesy of Chris Fraser. |
12 | * Copyright (C) 2000, 2002, 2003 Maciej W. Rozycki | 12 | * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki |
13 | * | 13 | * |
14 | * These are addresses which have to be known early in the boot process. | 14 | * These are addresses which have to be known early in the boot process. |
15 | * For other addresses refer to tc.h, ioasic_addrs.h and friends. | 15 | * For other addresses refer to tc.h, ioasic_addrs.h and friends. |
@@ -17,31 +17,23 @@ | |||
17 | #ifndef __ASM_MIPS_DEC_KN02XA_H | 17 | #ifndef __ASM_MIPS_DEC_KN02XA_H |
18 | #define __ASM_MIPS_DEC_KN02XA_H | 18 | #define __ASM_MIPS_DEC_KN02XA_H |
19 | 19 | ||
20 | #include <asm/addrspace.h> | ||
21 | #include <asm/dec/ioasic_addrs.h> | 20 | #include <asm/dec/ioasic_addrs.h> |
22 | 21 | ||
23 | #define KN02XA_SLOT_BASE KSEG1ADDR(0x1c000000) | 22 | #define KN02XA_SLOT_BASE 0x1c000000 |
24 | |||
25 | /* | ||
26 | * Some port addresses... | ||
27 | */ | ||
28 | #define KN02XA_IOASIC_BASE (KN02XA_SLOT_BASE + IOASIC_IOCTL) /* I/O ASIC */ | ||
29 | #define KN02XA_RTC_BASE (KN02XA_SLOT_BASE + IOASIC_TOY) /* RTC */ | ||
30 | |||
31 | 23 | ||
32 | /* | 24 | /* |
33 | * Memory control ASIC registers. | 25 | * Memory control ASIC registers. |
34 | */ | 26 | */ |
35 | #define KN02XA_MER KSEG1ADDR(0x0c400000) /* memory error register */ | 27 | #define KN02XA_MER 0x0c400000 /* memory error register */ |
36 | #define KN02XA_MSR KSEG1ADDR(0x0c800000) /* memory size register */ | 28 | #define KN02XA_MSR 0x0c800000 /* memory size register */ |
37 | 29 | ||
38 | /* | 30 | /* |
39 | * CPU control ASIC registers. | 31 | * CPU control ASIC registers. |
40 | */ | 32 | */ |
41 | #define KN02XA_MEM_CONF KSEG1ADDR(0x0e000000) /* write timeout config */ | 33 | #define KN02XA_MEM_CONF 0x0e000000 /* write timeout config */ |
42 | #define KN02XA_EAR KSEG1ADDR(0x0e000004) /* error address register */ | 34 | #define KN02XA_EAR 0x0e000004 /* error address register */ |
43 | #define KN02XA_BOOT0 KSEG1ADDR(0x0e000008) /* boot 0 register */ | 35 | #define KN02XA_BOOT0 0x0e000008 /* boot 0 register */ |
44 | #define KN02XA_MEM_INTR KSEG1ADDR(0x0e00000c) /* write err IRQ stat & ack */ | 36 | #define KN02XA_MEM_INTR 0x0e00000c /* write err IRQ stat & ack */ |
45 | 37 | ||
46 | /* | 38 | /* |
47 | * Memory Error Register bits, common definitions. | 39 | * Memory Error Register bits, common definitions. |
@@ -52,8 +44,13 @@ | |||
52 | #define KN02XA_MER_PAGERR (1<<16) /* 2k page boundary error */ | 44 | #define KN02XA_MER_PAGERR (1<<16) /* 2k page boundary error */ |
53 | #define KN02XA_MER_TRANSERR (1<<15) /* transfer length error */ | 45 | #define KN02XA_MER_TRANSERR (1<<15) /* transfer length error */ |
54 | #define KN02XA_MER_PARDIS (1<<14) /* parity error disable */ | 46 | #define KN02XA_MER_PARDIS (1<<14) /* parity error disable */ |
55 | #define KN02XA_MER_RES_12 (0x3<<12) /* unused */ | 47 | #define KN02XA_MER_SIZE (1<<13) /* r/o mirror of MSR_SIZE */ |
56 | #define KN02XA_MER_BYTERR (0xf<<8) /* byte lane error bitmask */ | 48 | #define KN02XA_MER_RES_12 (1<<12) /* unused */ |
49 | #define KN02XA_MER_BYTERR (0xf<<8) /* byte lane error bitmask: */ | ||
50 | #define KN02XA_MER_BYTERR_3 (0x8<<8) /* byte lane #3 */ | ||
51 | #define KN02XA_MER_BYTERR_2 (0x4<<8) /* byte lane #2 */ | ||
52 | #define KN02XA_MER_BYTERR_1 (0x2<<8) /* byte lane #1 */ | ||
53 | #define KN02XA_MER_BYTERR_0 (0x1<<8) /* byte lane #0 */ | ||
57 | #define KN02XA_MER_RES_0 (0xff<<0) /* unused */ | 54 | #define KN02XA_MER_RES_0 (0xff<<0) /* unused */ |
58 | 55 | ||
59 | /* | 56 | /* |
@@ -72,4 +69,17 @@ | |||
72 | #define KN02XA_EAR_ADDRESS (0x7ffffff<<2) /* address involved */ | 69 | #define KN02XA_EAR_ADDRESS (0x7ffffff<<2) /* address involved */ |
73 | #define KN02XA_EAR_RES_0 (0x3<<0) /* unused */ | 70 | #define KN02XA_EAR_RES_0 (0x3<<0) /* unused */ |
74 | 71 | ||
72 | |||
73 | #ifndef __ASSEMBLY__ | ||
74 | |||
75 | #include <linux/interrupt.h> | ||
76 | |||
77 | struct pt_regs; | ||
78 | |||
79 | extern void dec_kn02xa_be_init(void); | ||
80 | extern int dec_kn02xa_be_handler(struct pt_regs *regs, int is_fixup); | ||
81 | extern irqreturn_t dec_kn02xa_be_interrupt(int irq, void *dev_id, | ||
82 | struct pt_regs *regs); | ||
83 | #endif | ||
84 | |||
75 | #endif /* __ASM_MIPS_DEC_KN02XA_H */ | 85 | #endif /* __ASM_MIPS_DEC_KN02XA_H */ |
diff --git a/include/asm-mips/dec/kn03.h b/include/asm-mips/dec/kn03.h index 676abd17c6a4..edede923ffb8 100644 --- a/include/asm-mips/dec/kn03.h +++ b/include/asm-mips/dec/kn03.h | |||
@@ -10,24 +10,15 @@ | |||
10 | * | 10 | * |
11 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions | 11 | * Copyright (C) 1995,1996 by Paul M. Antoine, some code and definitions |
12 | * are by courtesy of Chris Fraser. | 12 | * are by courtesy of Chris Fraser. |
13 | * Copyright (C) 2000, 2002, 2003 Maciej W. Rozycki | 13 | * Copyright (C) 2000, 2002, 2003, 2005 Maciej W. Rozycki |
14 | */ | 14 | */ |
15 | #ifndef __ASM_MIPS_DEC_KN03_H | 15 | #ifndef __ASM_MIPS_DEC_KN03_H |
16 | #define __ASM_MIPS_DEC_KN03_H | 16 | #define __ASM_MIPS_DEC_KN03_H |
17 | 17 | ||
18 | #include <asm/addrspace.h> | ||
19 | #include <asm/dec/ecc.h> | 18 | #include <asm/dec/ecc.h> |
20 | #include <asm/dec/ioasic_addrs.h> | 19 | #include <asm/dec/ioasic_addrs.h> |
21 | 20 | ||
22 | #define KN03_SLOT_BASE KSEG1ADDR(0x1f800000) | 21 | #define KN03_SLOT_BASE 0x1f800000 |
23 | |||
24 | /* | ||
25 | * Some port addresses... | ||
26 | */ | ||
27 | #define KN03_IOASIC_BASE (KN03_SLOT_BASE + IOASIC_IOCTL) /* I/O ASIC */ | ||
28 | #define KN03_RTC_BASE (KN03_SLOT_BASE + IOASIC_TOY) /* RTC */ | ||
29 | #define KN03_MCR_BASE (KN03_SLOT_BASE + IOASIC_MCR) /* MCR */ | ||
30 | |||
31 | 22 | ||
32 | /* | 23 | /* |
33 | * CPU interrupt bits. | 24 | * CPU interrupt bits. |
diff --git a/include/asm-mips/dec/kn05.h b/include/asm-mips/dec/kn05.h index b120362b8f13..15fe8f881e60 100644 --- a/include/asm-mips/dec/kn05.h +++ b/include/asm-mips/dec/kn05.h | |||
@@ -1,10 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-mips/dec/kn05.h | 2 | * include/asm-mips/dec/kn05.h |
3 | * | 3 | * |
4 | * DECstation 5000/260 (4max+ or KN05) and DECsystem 5900/260 | 4 | * DECstation/DECsystem 5000/260 (4max+ or KN05), 5000/150 (4min |
5 | * or KN04-BA), Personal DECstation/DECsystem 5000/50 (4maxine or | ||
6 | * KN04-CA) and DECsystem 5900/260 (KN05) R4k CPU card MB ASIC | ||
5 | * definitions. | 7 | * definitions. |
6 | * | 8 | * |
7 | * Copyright (C) 2002, 2003 Maciej W. Rozycki | 9 | * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki |
8 | * | 10 | * |
9 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
@@ -13,8 +15,8 @@ | |||
13 | * | 15 | * |
14 | * WARNING! All this information is pure guesswork based on the | 16 | * WARNING! All this information is pure guesswork based on the |
15 | * ROM. It is provided here in hope it will give someone some | 17 | * ROM. It is provided here in hope it will give someone some |
16 | * food for thought. No documentation for the KN05 module has | 18 | * food for thought. No documentation for the KN05 nor the KN04 |
17 | * been located so far. | 19 | * module has been located so far. |
18 | */ | 20 | */ |
19 | #ifndef __ASM_MIPS_DEC_KN05_H | 21 | #ifndef __ASM_MIPS_DEC_KN05_H |
20 | #define __ASM_MIPS_DEC_KN05_H | 22 | #define __ASM_MIPS_DEC_KN05_H |
@@ -24,48 +26,50 @@ | |||
24 | /* | 26 | /* |
25 | * The oncard MB (Memory Buffer) ASIC provides an additional address | 27 | * The oncard MB (Memory Buffer) ASIC provides an additional address |
26 | * decoder. Certain address ranges within the "high" 16 slots are | 28 | * decoder. Certain address ranges within the "high" 16 slots are |
27 | * passed to the I/O ASIC's decoder like with the KN03. Others are | 29 | * passed to the I/O ASIC's decoder like with the KN03 or KN02-BA/CA. |
28 | * handled locally. "Low" slots are always passed. | 30 | * Others are handled locally. "Low" slots are always passed. |
29 | */ | 31 | */ |
30 | #define KN05_MB_ROM (16*IOASIC_SLOT_SIZE) /* KN05 card ROM */ | 32 | #define KN4K_SLOT_BASE 0x1fc00000 |
31 | #define KN05_IOCTL (17*IOASIC_SLOT_SIZE) /* I/O ASIC */ | 33 | |
32 | #define KN05_ESAR (18*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */ | 34 | #define KN4K_MB_ROM (0*IOASIC_SLOT_SIZE) /* KN05/KN04 card ROM */ |
33 | #define KN05_LANCE (19*IOASIC_SLOT_SIZE) /* LANCE Ethernet */ | 35 | #define KN4K_IOCTL (1*IOASIC_SLOT_SIZE) /* I/O ASIC */ |
34 | #define KN05_MB_INT (20*IOASIC_SLOT_SIZE) /* MB interrupt register */ | 36 | #define KN4K_ESAR (2*IOASIC_SLOT_SIZE) /* LANCE MAC address chip */ |
35 | #define KN05_MB_EA (21*IOASIC_SLOT_SIZE) /* MB error address? */ | 37 | #define KN4K_LANCE (3*IOASIC_SLOT_SIZE) /* LANCE Ethernet */ |
36 | #define KN05_MB_EC (22*IOASIC_SLOT_SIZE) /* MB error ??? */ | 38 | #define KN4K_MB_INT (4*IOASIC_SLOT_SIZE) /* MB interrupt register */ |
37 | #define KN05_MB_CSR (23*IOASIC_SLOT_SIZE) /* MB control & status */ | 39 | #define KN4K_MB_EA (5*IOASIC_SLOT_SIZE) /* MB error address? */ |
38 | #define KN05_RES_24 (24*IOASIC_SLOT_SIZE) /* unused? */ | 40 | #define KN4K_MB_EC (6*IOASIC_SLOT_SIZE) /* MB error ??? */ |
39 | #define KN05_RES_25 (25*IOASIC_SLOT_SIZE) /* unused? */ | 41 | #define KN4K_MB_CSR (7*IOASIC_SLOT_SIZE) /* MB control & status */ |
40 | #define KN05_RES_26 (26*IOASIC_SLOT_SIZE) /* unused? */ | 42 | #define KN4K_RES_08 (8*IOASIC_SLOT_SIZE) /* unused? */ |
41 | #define KN05_RES_27 (27*IOASIC_SLOT_SIZE) /* unused? */ | 43 | #define KN4K_RES_09 (9*IOASIC_SLOT_SIZE) /* unused? */ |
42 | #define KN05_SCSI (28*IOASIC_SLOT_SIZE) /* ASC SCSI */ | 44 | #define KN4K_RES_10 (10*IOASIC_SLOT_SIZE) /* unused? */ |
43 | #define KN05_RES_29 (29*IOASIC_SLOT_SIZE) /* unused? */ | 45 | #define KN4K_RES_11 (11*IOASIC_SLOT_SIZE) /* unused? */ |
44 | #define KN05_RES_30 (30*IOASIC_SLOT_SIZE) /* unused? */ | 46 | #define KN4K_SCSI (12*IOASIC_SLOT_SIZE) /* ASC SCSI */ |
45 | #define KN05_RES_31 (31*IOASIC_SLOT_SIZE) /* unused? */ | 47 | #define KN4K_RES_13 (13*IOASIC_SLOT_SIZE) /* unused? */ |
48 | #define KN4K_RES_14 (14*IOASIC_SLOT_SIZE) /* unused? */ | ||
49 | #define KN4K_RES_15 (15*IOASIC_SLOT_SIZE) /* unused? */ | ||
46 | 50 | ||
47 | /* | 51 | /* |
48 | * Bits for the MB interrupt register. | 52 | * Bits for the MB interrupt register. |
49 | * The register appears read-only. | 53 | * The register appears read-only. |
50 | */ | 54 | */ |
51 | #define KN05_MB_INT_TC (1<<0) /* TURBOchannel? */ | 55 | #define KN4K_MB_INT_TC (1<<0) /* TURBOchannel? */ |
52 | #define KN05_MB_INT_RTC (1<<1) /* RTC? */ | 56 | #define KN4K_MB_INT_RTC (1<<1) /* RTC? */ |
53 | #define KN05_MB_INT_MT (1<<3) /* ??? */ | 57 | #define KN4K_MB_INT_MT (1<<3) /* ??? */ |
54 | 58 | ||
55 | /* | 59 | /* |
56 | * Bits for the MB control & status register. | 60 | * Bits for the MB control & status register. |
57 | * Set to 0x00bf8001 on my system by the ROM. | 61 | * Set to 0x00bf8001 on my system by the ROM. |
58 | */ | 62 | */ |
59 | #define KN05_MB_CSR_PF (1<<0) /* PreFetching enable? */ | 63 | #define KN4K_MB_CSR_PF (1<<0) /* PreFetching enable? */ |
60 | #define KN05_MB_CSR_F (1<<1) /* ??? */ | 64 | #define KN4K_MB_CSR_F (1<<1) /* ??? */ |
61 | #define KN05_MB_CSR_ECC (0xff<<2) /* ??? */ | 65 | #define KN4K_MB_CSR_ECC (0xff<<2) /* ??? */ |
62 | #define KN05_MB_CSR_OD (1<<10) /* ??? */ | 66 | #define KN4K_MB_CSR_OD (1<<10) /* ??? */ |
63 | #define KN05_MB_CSR_CP (1<<11) /* ??? */ | 67 | #define KN4K_MB_CSR_CP (1<<11) /* ??? */ |
64 | #define KN05_MB_CSR_UNC (1<<12) /* ??? */ | 68 | #define KN4K_MB_CSR_UNC (1<<12) /* ??? */ |
65 | #define KN05_MB_CSR_IM (1<<13) /* ??? */ | 69 | #define KN4K_MB_CSR_IM (1<<13) /* ??? */ |
66 | #define KN05_MB_CSR_NC (1<<14) /* ??? */ | 70 | #define KN4K_MB_CSR_NC (1<<14) /* ??? */ |
67 | #define KN05_MB_CSR_EE (1<<15) /* (bus) Exception Enable? */ | 71 | #define KN4K_MB_CSR_EE (1<<15) /* (bus) Exception Enable? */ |
68 | #define KN05_MB_CSR_MSK (0x1f<<16) /* ??? */ | 72 | #define KN4K_MB_CSR_MSK (0x1f<<16) /* ??? */ |
69 | #define KN05_MB_CSR_FW (1<<21) /* ??? */ | 73 | #define KN4K_MB_CSR_FW (1<<21) /* ??? */ |
70 | 74 | ||
71 | #endif /* __ASM_MIPS_DEC_KN05_H */ | 75 | #endif /* __ASM_MIPS_DEC_KN05_H */ |
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h index a05d6d3395fe..1384dd0964b9 100644 --- a/include/asm-mips/dec/prom.h +++ b/include/asm-mips/dec/prom.h | |||
@@ -24,7 +24,7 @@ | |||
24 | * PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's. | 24 | * PMAX/3MAX PROM entry points for DS2100/3100's and DS5000/2xx's. |
25 | * Many of these will work for MIPSen as well! | 25 | * Many of these will work for MIPSen as well! |
26 | */ | 26 | */ |
27 | #define VEC_RESET (u64 *)KSEG1ADDR(0x1fc00000) | 27 | #define VEC_RESET (u64 *)CKSEG1ADDR(0x1fc00000) |
28 | /* Prom base address */ | 28 | /* Prom base address */ |
29 | 29 | ||
30 | #define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */ | 30 | #define PMAX_PROM_ENTRY(x) (VEC_RESET + (x)) /* Prom jump table */ |
@@ -111,19 +111,21 @@ extern int (*__pmax_close)(int); | |||
111 | * On MIPS64 we have to call PROM functions via a helper | 111 | * On MIPS64 we have to call PROM functions via a helper |
112 | * dispatcher to accomodate ABI incompatibilities. | 112 | * dispatcher to accomodate ABI incompatibilities. |
113 | */ | 113 | */ |
114 | #define __DEC_PROM_O32 __attribute__((alias("call_o32"))) | 114 | #define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \ |
115 | 115 | __asm__(#fun " = call_o32") | |
116 | int _rex_bootinit(int (*)(void)) __DEC_PROM_O32; | 116 | |
117 | int _rex_bootread(int (*)(void)) __DEC_PROM_O32; | 117 | int __DEC_PROM_O32(_rex_bootinit, (int (*)(void))); |
118 | int _rex_getbitmap(int (*)(memmap *), memmap *) __DEC_PROM_O32; | 118 | int __DEC_PROM_O32(_rex_bootread, (int (*)(void))); |
119 | unsigned long *_rex_slot_address(unsigned long *(*)(int), int) __DEC_PROM_O32; | 119 | int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *)); |
120 | void *_rex_gettcinfo(void *(*)(void)) __DEC_PROM_O32; | 120 | unsigned long *__DEC_PROM_O32(_rex_slot_address, |
121 | int _rex_getsysid(int (*)(void)) __DEC_PROM_O32; | 121 | (unsigned long *(*)(int), int)); |
122 | void _rex_clear_cache(void (*)(void)) __DEC_PROM_O32; | 122 | void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void))); |
123 | 123 | int __DEC_PROM_O32(_rex_getsysid, (int (*)(void))); | |
124 | int _prom_getchar(int (*)(void)) __DEC_PROM_O32; | 124 | void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void))); |
125 | char *_prom_getenv(char *(*)(char *), char *) __DEC_PROM_O32; | 125 | |
126 | int _prom_printf(int (*)(char *, ...), char *, ...) __DEC_PROM_O32; | 126 | int __DEC_PROM_O32(_prom_getchar, (int (*)(void))); |
127 | char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *)); | ||
128 | int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...)); | ||
127 | 129 | ||
128 | 130 | ||
129 | #define rex_bootinit() _rex_bootinit(__rex_bootinit) | 131 | #define rex_bootinit() _rex_bootinit(__rex_bootinit) |
diff --git a/include/asm-mips/dec/system.h b/include/asm-mips/dec/system.h new file mode 100644 index 000000000000..78af51fbc797 --- /dev/null +++ b/include/asm-mips/dec/system.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * include/asm-mips/dec/system.h | ||
3 | * | ||
4 | * Generic DECstation/DECsystem bits. | ||
5 | * | ||
6 | * Copyright (C) 2005 Maciej W. Rozycki | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | #ifndef __ASM_DEC_SYSTEM_H | ||
14 | #define __ASM_DEC_SYSTEM_H | ||
15 | |||
16 | extern unsigned long dec_kn_slot_base, dec_kn_slot_size; | ||
17 | |||
18 | #endif /* __ASM_DEC_SYSTEM_H */ | ||
diff --git a/include/asm-mips/dec/tc.h b/include/asm-mips/dec/tc.h index d7bba43f863a..9cb51f24d42c 100644 --- a/include/asm-mips/dec/tc.h +++ b/include/asm-mips/dec/tc.h | |||
@@ -7,10 +7,8 @@ | |||
7 | * | 7 | * |
8 | * Copyright (c) 1998 Harald Koerfgen | 8 | * Copyright (c) 1998 Harald Koerfgen |
9 | */ | 9 | */ |
10 | #ifndef ASM_TC_H | 10 | #ifndef __ASM_DEC_TC_H |
11 | #define ASM_TC_H | 11 | #define __ASM_DEC_TC_H |
12 | |||
13 | extern unsigned long system_base; | ||
14 | 12 | ||
15 | /* | 13 | /* |
16 | * Search for a TURBOchannel Option Module | 14 | * Search for a TURBOchannel Option Module |
@@ -36,8 +34,8 @@ extern unsigned long get_tc_base_addr(int); | |||
36 | */ | 34 | */ |
37 | extern unsigned long get_tc_irq_nr(int); | 35 | extern unsigned long get_tc_irq_nr(int); |
38 | /* | 36 | /* |
39 | * Return TURBOchannel clock frequency in hz | 37 | * Return TURBOchannel clock frequency in Hz |
40 | */ | 38 | */ |
41 | extern unsigned long get_tc_speed(void); | 39 | extern unsigned long get_tc_speed(void); |
42 | 40 | ||
43 | #endif | 41 | #endif /* __ASM_DEC_TC_H */ |
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index a606dbee0412..85435a8d4e52 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h | |||
@@ -12,11 +12,9 @@ | |||
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
14 | #include <linux/param.h> | 14 | #include <linux/param.h> |
15 | 15 | #include <linux/smp.h> | |
16 | #include <asm/compiler.h> | 16 | #include <asm/compiler.h> |
17 | 17 | ||
18 | extern unsigned long loops_per_jiffy; | ||
19 | |||
20 | static inline void __delay(unsigned long loops) | 18 | static inline void __delay(unsigned long loops) |
21 | { | 19 | { |
22 | if (sizeof(long) == 4) | 20 | if (sizeof(long) == 4) |
@@ -82,11 +80,7 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj) | |||
82 | __delay(usecs); | 80 | __delay(usecs); |
83 | } | 81 | } |
84 | 82 | ||
85 | #ifdef CONFIG_SMP | ||
86 | #define __udelay_val cpu_data[smp_processor_id()].udelay_val | 83 | #define __udelay_val cpu_data[smp_processor_id()].udelay_val |
87 | #else | ||
88 | #define __udelay_val loops_per_jiffy | ||
89 | #endif | ||
90 | 84 | ||
91 | #define udelay(usecs) __udelay((usecs),__udelay_val) | 85 | #define udelay(usecs) __udelay((usecs),__udelay_val) |
92 | 86 | ||
diff --git a/include/asm-mips/dma-mapping.h b/include/asm-mips/dma-mapping.h index af28dc88930b..43288634c38a 100644 --- a/include/asm-mips/dma-mapping.h +++ b/include/asm-mips/dma-mapping.h | |||
@@ -5,13 +5,13 @@ | |||
5 | #include <asm/cache.h> | 5 | #include <asm/cache.h> |
6 | 6 | ||
7 | void *dma_alloc_noncoherent(struct device *dev, size_t size, | 7 | void *dma_alloc_noncoherent(struct device *dev, size_t size, |
8 | dma_addr_t *dma_handle, int flag); | 8 | dma_addr_t *dma_handle, gfp_t flag); |
9 | 9 | ||
10 | void dma_free_noncoherent(struct device *dev, size_t size, | 10 | void dma_free_noncoherent(struct device *dev, size_t size, |
11 | void *vaddr, dma_addr_t dma_handle); | 11 | void *vaddr, dma_addr_t dma_handle); |
12 | 12 | ||
13 | void *dma_alloc_coherent(struct device *dev, size_t size, | 13 | void *dma_alloc_coherent(struct device *dev, size_t size, |
14 | dma_addr_t *dma_handle, int flag); | 14 | dma_addr_t *dma_handle, gfp_t flag); |
15 | 15 | ||
16 | void dma_free_coherent(struct device *dev, size_t size, | 16 | void dma_free_coherent(struct device *dev, size_t size, |
17 | void *vaddr, dma_addr_t dma_handle); | 17 | void *vaddr, dma_addr_t dma_handle); |
diff --git a/include/asm-mips/dsp.h b/include/asm-mips/dsp.h new file mode 100644 index 000000000000..50f556bb4978 --- /dev/null +++ b/include/asm-mips/dsp.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Mips Technologies | ||
3 | * Author: Chris Dearman, chris@mips.com derived from fpu.h | ||
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 | #ifndef _ASM_DSP_H | ||
11 | #define _ASM_DSP_H | ||
12 | |||
13 | #include <asm/cpu.h> | ||
14 | #include <asm/cpu-features.h> | ||
15 | #include <asm/hazards.h> | ||
16 | #include <asm/mipsregs.h> | ||
17 | |||
18 | #define DSP_DEFAULT 0x00000000 | ||
19 | #define DSP_MASK 0x1f | ||
20 | |||
21 | #define __enable_dsp_hazard() \ | ||
22 | do { \ | ||
23 | asm("_ehb"); \ | ||
24 | } while (0) | ||
25 | |||
26 | static inline void __init_dsp(void) | ||
27 | { | ||
28 | mthi1(0); | ||
29 | mtlo1(0); | ||
30 | mthi2(0); | ||
31 | mtlo2(0); | ||
32 | mthi3(0); | ||
33 | mtlo3(0); | ||
34 | wrdsp(DSP_DEFAULT, DSP_MASK); | ||
35 | } | ||
36 | |||
37 | static inline void init_dsp(void) | ||
38 | { | ||
39 | if (cpu_has_dsp) | ||
40 | __init_dsp(); | ||
41 | } | ||
42 | |||
43 | #define __save_dsp(tsk) \ | ||
44 | do { \ | ||
45 | tsk->thread.dsp.dspr[0] = mfhi1(); \ | ||
46 | tsk->thread.dsp.dspr[1] = mflo1(); \ | ||
47 | tsk->thread.dsp.dspr[2] = mfhi2(); \ | ||
48 | tsk->thread.dsp.dspr[3] = mflo2(); \ | ||
49 | tsk->thread.dsp.dspr[4] = mfhi3(); \ | ||
50 | tsk->thread.dsp.dspr[5] = mflo3(); \ | ||
51 | } while (0) | ||
52 | |||
53 | #define save_dsp(tsk) \ | ||
54 | do { \ | ||
55 | if (cpu_has_dsp) \ | ||
56 | __save_dsp(tsk); \ | ||
57 | } while (0) | ||
58 | |||
59 | #define __restore_dsp(tsk) \ | ||
60 | do { \ | ||
61 | mthi1(tsk->thread.dsp.dspr[0]); \ | ||
62 | mtlo1(tsk->thread.dsp.dspr[1]); \ | ||
63 | mthi2(tsk->thread.dsp.dspr[2]); \ | ||
64 | mtlo2(tsk->thread.dsp.dspr[3]); \ | ||
65 | mthi3(tsk->thread.dsp.dspr[4]); \ | ||
66 | mtlo3(tsk->thread.dsp.dspr[5]); \ | ||
67 | } while (0) | ||
68 | |||
69 | #define restore_dsp(tsk) \ | ||
70 | do { \ | ||
71 | if (cpu_has_dsp) \ | ||
72 | __restore_dsp(tsk); \ | ||
73 | } while (0) | ||
74 | |||
75 | #define __get_dsp_regs(tsk) \ | ||
76 | ({ \ | ||
77 | if (tsk == current) \ | ||
78 | __save_dsp(current); \ | ||
79 | \ | ||
80 | tsk->thread.dsp.dspr; \ | ||
81 | }) | ||
82 | |||
83 | #endif /* _ASM_DSP_H */ | ||
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index e48811440015..7420f12742bb 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h | |||
@@ -2,6 +2,8 @@ | |||
2 | * This file is subject to the terms and conditions of the GNU General Public | 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 | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | ||
6 | * Much of this is taken from binutils and GNU libc ... | ||
5 | */ | 7 | */ |
6 | #ifndef _ASM_ELF_H | 8 | #ifndef _ASM_ELF_H |
7 | #define _ASM_ELF_H | 9 | #define _ASM_ELF_H |
@@ -17,6 +19,8 @@ | |||
17 | #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ | 19 | #define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ |
18 | #define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ | 20 | #define EF_MIPS_ARCH_32 0x50000000 /* MIPS32 code. */ |
19 | #define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ | 21 | #define EF_MIPS_ARCH_64 0x60000000 /* MIPS64 code. */ |
22 | #define EF_MIPS_ARCH_32R2 0x70000000 /* MIPS32 R2 code. */ | ||
23 | #define EF_MIPS_ARCH_64R2 0x80000000 /* MIPS64 R2 code. */ | ||
20 | 24 | ||
21 | /* The ABI of a file. */ | 25 | /* The ABI of a file. */ |
22 | #define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ | 26 | #define EF_MIPS_ABI_O32 0x00001000 /* O32 ABI. */ |
@@ -105,7 +109,11 @@ | |||
105 | #define R_MIPS_LOVENDOR 100 | 109 | #define R_MIPS_LOVENDOR 100 |
106 | #define R_MIPS_HIVENDOR 127 | 110 | #define R_MIPS_HIVENDOR 127 |
107 | 111 | ||
108 | #define SHN_MIPS_ACCOMON 0xff00 | 112 | #define SHN_MIPS_ACCOMON 0xff00 /* Allocated common symbols */ |
113 | #define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ | ||
114 | #define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ | ||
115 | #define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ | ||
116 | #define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ | ||
109 | 117 | ||
110 | #define SHT_MIPS_LIST 0x70000000 | 118 | #define SHT_MIPS_LIST 0x70000000 |
111 | #define SHT_MIPS_CONFLICT 0x70000002 | 119 | #define SHT_MIPS_CONFLICT 0x70000002 |
@@ -193,50 +201,92 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |||
193 | 201 | ||
194 | #ifdef __KERNEL__ | 202 | #ifdef __KERNEL__ |
195 | 203 | ||
204 | struct mips_abi; | ||
205 | |||
206 | extern struct mips_abi mips_abi; | ||
207 | extern struct mips_abi mips_abi_32; | ||
208 | extern struct mips_abi mips_abi_n32; | ||
209 | |||
196 | #ifdef CONFIG_32BIT | 210 | #ifdef CONFIG_32BIT |
197 | 211 | ||
198 | #define SET_PERSONALITY(ex, ibcs2) \ | 212 | #define SET_PERSONALITY(ex, ibcs2) \ |
199 | do { \ | 213 | do { \ |
200 | if (ibcs2) \ | 214 | if (ibcs2) \ |
201 | set_personality(PER_SVR4); \ | 215 | set_personality(PER_SVR4); \ |
202 | set_personality(PER_LINUX); \ | 216 | set_personality(PER_LINUX); \ |
217 | \ | ||
218 | current->thread.abi = &mips_abi; \ | ||
203 | } while (0) | 219 | } while (0) |
204 | 220 | ||
205 | #endif /* CONFIG_32BIT */ | 221 | #endif /* CONFIG_32BIT */ |
206 | 222 | ||
207 | #ifdef CONFIG_64BIT | 223 | #ifdef CONFIG_64BIT |
208 | 224 | ||
209 | #define SET_PERSONALITY(ex, ibcs2) \ | 225 | #ifdef CONFIG_MIPS32_N32 |
210 | do { current->thread.mflags &= ~MF_ABI_MASK; \ | 226 | #define __SET_PERSONALITY32_N32() \ |
211 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) { \ | 227 | do { \ |
212 | if ((((ex).e_flags & EF_MIPS_ABI2) != 0) && \ | 228 | current->thread.mflags |= MF_N32; \ |
213 | ((ex).e_flags & EF_MIPS_ABI) == 0) \ | 229 | current->thread.abi = &mips_abi_n32; \ |
214 | current->thread.mflags |= MF_N32; \ | 230 | } while (0) |
215 | else \ | 231 | #else |
216 | current->thread.mflags |= MF_O32; \ | 232 | #define __SET_PERSONALITY32_N32() \ |
217 | } else \ | 233 | do { } while (0) |
218 | current->thread.mflags |= MF_N64; \ | 234 | #endif |
219 | if (ibcs2) \ | 235 | |
220 | set_personality(PER_SVR4); \ | 236 | #ifdef CONFIG_MIPS32_O32 |
221 | else if (current->personality != PER_LINUX32) \ | 237 | #define __SET_PERSONALITY32_O32() \ |
222 | set_personality(PER_LINUX); \ | 238 | do { \ |
239 | current->thread.mflags |= MF_O32; \ | ||
240 | current->thread.abi = &mips_abi_32; \ | ||
241 | } while (0) | ||
242 | #else | ||
243 | #define __SET_PERSONALITY32_O32() \ | ||
244 | do { } while (0) | ||
245 | #endif | ||
246 | |||
247 | #ifdef CONFIG_MIPS32_COMPAT | ||
248 | #define __SET_PERSONALITY32(ex) \ | ||
249 | do { \ | ||
250 | if ((((ex).e_flags & EF_MIPS_ABI2) != 0) && \ | ||
251 | ((ex).e_flags & EF_MIPS_ABI) == 0) \ | ||
252 | __SET_PERSONALITY32_N32(); \ | ||
253 | else \ | ||
254 | __SET_PERSONALITY32_O32(); \ | ||
255 | } while (0) | ||
256 | #else | ||
257 | #define __SET_PERSONALITY32(ex) do { } while (0) | ||
258 | #endif | ||
259 | |||
260 | #define SET_PERSONALITY(ex, ibcs2) \ | ||
261 | do { \ | ||
262 | current->thread.mflags &= ~MF_ABI_MASK; \ | ||
263 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ | ||
264 | __SET_PERSONALITY32(ex); \ | ||
265 | else { \ | ||
266 | current->thread.mflags |= MF_N64; \ | ||
267 | current->thread.abi = &mips_abi; \ | ||
268 | } \ | ||
269 | \ | ||
270 | if (ibcs2) \ | ||
271 | set_personality(PER_SVR4); \ | ||
272 | else if (current->personality != PER_LINUX32) \ | ||
273 | set_personality(PER_LINUX); \ | ||
223 | } while (0) | 274 | } while (0) |
224 | 275 | ||
225 | #endif /* CONFIG_64BIT */ | 276 | #endif /* CONFIG_64BIT */ |
226 | 277 | ||
227 | extern void dump_regs(elf_greg_t *, struct pt_regs *regs); | 278 | extern void dump_regs(elf_greg_t *, struct pt_regs *regs); |
279 | extern int dump_task_regs (struct task_struct *, elf_gregset_t *); | ||
228 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | 280 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); |
229 | 281 | ||
230 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ | 282 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ |
231 | dump_regs((elf_greg_t *)&(elf_regs), regs); | 283 | dump_regs((elf_greg_t *)&(elf_regs), regs); |
284 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) | ||
232 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ | 285 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ |
233 | dump_task_fpu(tsk, elf_fpregs) | 286 | dump_task_fpu(tsk, elf_fpregs) |
234 | 287 | ||
235 | #endif /* __KERNEL__ */ | 288 | #endif /* __KERNEL__ */ |
236 | 289 | ||
237 | /* This one accepts IRIX binaries. */ | ||
238 | #define irix_elf_check_arch(hdr) ((hdr)->e_flags & RHF_SGI_ONLY) | ||
239 | |||
240 | #define USE_ELF_CORE_DUMP | 290 | #define USE_ELF_CORE_DUMP |
241 | #define ELF_EXEC_PAGESIZE PAGE_SIZE | 291 | #define ELF_EXEC_PAGESIZE PAGE_SIZE |
242 | 292 | ||
diff --git a/include/asm-mips/errno.h b/include/asm-mips/errno.h index 3c0d840e4577..9d3e6e7cdb92 100644 --- a/include/asm-mips/errno.h +++ b/include/asm-mips/errno.h | |||
@@ -119,6 +119,10 @@ | |||
119 | #define EOWNERDEAD 165 /* Owner died */ | 119 | #define EOWNERDEAD 165 /* Owner died */ |
120 | #define ENOTRECOVERABLE 166 /* State not recoverable */ | 120 | #define ENOTRECOVERABLE 166 /* State not recoverable */ |
121 | 121 | ||
122 | /* for robust mutexes */ | ||
123 | #define EOWNERDEAD 165 /* Owner died */ | ||
124 | #define ENOTRECOVERABLE 166 /* State not recoverable */ | ||
125 | |||
122 | #define EDQUOT 1133 /* Quota exceeded */ | 126 | #define EDQUOT 1133 /* Quota exceeded */ |
123 | 127 | ||
124 | #ifdef __KERNEL__ | 128 | #ifdef __KERNEL__ |
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index 06c5d13faf66..43d047a9a6af 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h | |||
@@ -3,11 +3,13 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1995, 96, 97, 98, 99, 2003 Ralf Baechle | 6 | * Copyright (C) 1995, 96, 97, 98, 99, 2003, 05 Ralf Baechle |
7 | */ | 7 | */ |
8 | #ifndef _ASM_FCNTL_H | 8 | #ifndef _ASM_FCNTL_H |
9 | #define _ASM_FCNTL_H | 9 | #define _ASM_FCNTL_H |
10 | 10 | ||
11 | #include <linux/config.h> | ||
12 | |||
11 | #define O_APPEND 0x0008 | 13 | #define O_APPEND 0x0008 |
12 | #define O_SYNC 0x0010 | 14 | #define O_SYNC 0x0010 |
13 | #define O_NONBLOCK 0x0080 | 15 | #define O_NONBLOCK 0x0080 |
@@ -40,13 +42,13 @@ | |||
40 | * contain all the same fields as struct flock. | 42 | * contain all the same fields as struct flock. |
41 | */ | 43 | */ |
42 | 44 | ||
43 | #ifndef __mips64 | 45 | #ifdef CONFIG_32BIT |
44 | 46 | ||
45 | struct flock { | 47 | struct flock { |
46 | short l_type; | 48 | short l_type; |
47 | short l_whence; | 49 | short l_whence; |
48 | __kernel_off_t l_start; | 50 | off_t l_start; |
49 | __kernel_off_t l_len; | 51 | off_t l_len; |
50 | long l_sysid; | 52 | long l_sysid; |
51 | __kernel_pid_t l_pid; | 53 | __kernel_pid_t l_pid; |
52 | long pad[4]; | 54 | long pad[4]; |
@@ -54,13 +56,8 @@ struct flock { | |||
54 | 56 | ||
55 | #define HAVE_ARCH_STRUCT_FLOCK | 57 | #define HAVE_ARCH_STRUCT_FLOCK |
56 | 58 | ||
57 | #endif | 59 | #endif /* CONFIG_32BIT */ |
58 | 60 | ||
59 | #include <asm-generic/fcntl.h> | 61 | #include <asm-generic/fcntl.h> |
60 | 62 | ||
61 | typedef struct flock flock_t; | ||
62 | #ifndef __mips64 | ||
63 | typedef struct flock64 flock64_t; | ||
64 | #endif | ||
65 | |||
66 | #endif /* _ASM_FCNTL_H */ | 63 | #endif /* _ASM_FCNTL_H */ |
diff --git a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h index 26b6a90a690b..73a3028dd9f9 100644 --- a/include/asm-mips/fixmap.h +++ b/include/asm-mips/fixmap.h | |||
@@ -107,4 +107,11 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr) | |||
107 | return __virt_to_fix(vaddr); | 107 | return __virt_to_fix(vaddr); |
108 | } | 108 | } |
109 | 109 | ||
110 | /* | ||
111 | * Called from pgtable_init() | ||
112 | */ | ||
113 | extern void fixrange_init(unsigned long start, unsigned long end, | ||
114 | pgd_t *pgd_base); | ||
115 | |||
116 | |||
110 | #endif | 117 | #endif |
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index ea24e733b1bc..9c828b1f8218 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h | |||
@@ -80,9 +80,14 @@ do { \ | |||
80 | 80 | ||
81 | #define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU) | 81 | #define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU) |
82 | 82 | ||
83 | static inline int __is_fpu_owner(void) | ||
84 | { | ||
85 | return test_thread_flag(TIF_USEDFPU); | ||
86 | } | ||
87 | |||
83 | static inline int is_fpu_owner(void) | 88 | static inline int is_fpu_owner(void) |
84 | { | 89 | { |
85 | return cpu_has_fpu && test_thread_flag(TIF_USEDFPU); | 90 | return cpu_has_fpu && __is_fpu_owner(); |
86 | } | 91 | } |
87 | 92 | ||
88 | static inline void own_fpu(void) | 93 | static inline void own_fpu(void) |
@@ -127,7 +132,7 @@ static inline void restore_fp(struct task_struct *tsk) | |||
127 | static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) | 132 | static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) |
128 | { | 133 | { |
129 | if (cpu_has_fpu) { | 134 | if (cpu_has_fpu) { |
130 | if ((tsk == current) && is_fpu_owner()) | 135 | if ((tsk == current) && __is_fpu_owner()) |
131 | _save_fp(current); | 136 | _save_fp(current); |
132 | return tsk->thread.fpu.hard.fpr; | 137 | return tsk->thread.fpu.hard.fpr; |
133 | } | 138 | } |
diff --git a/include/asm-mips/fpu_emulator.h b/include/asm-mips/fpu_emulator.h index 46972ae2b95d..16cb4d11dd0b 100644 --- a/include/asm-mips/fpu_emulator.h +++ b/include/asm-mips/fpu_emulator.h | |||
@@ -23,16 +23,15 @@ | |||
23 | #ifndef _ASM_FPU_EMULATOR_H | 23 | #ifndef _ASM_FPU_EMULATOR_H |
24 | #define _ASM_FPU_EMULATOR_H | 24 | #define _ASM_FPU_EMULATOR_H |
25 | 25 | ||
26 | struct mips_fpu_emulator_private { | 26 | struct mips_fpu_emulator_stats { |
27 | unsigned int eir; | 27 | unsigned int emulated; |
28 | struct { | 28 | unsigned int loads; |
29 | unsigned int emulated; | 29 | unsigned int stores; |
30 | unsigned int loads; | 30 | unsigned int cp1ops; |
31 | unsigned int stores; | 31 | unsigned int cp1xops; |
32 | unsigned int cp1ops; | 32 | unsigned int errors; |
33 | unsigned int cp1xops; | ||
34 | unsigned int errors; | ||
35 | } stats; | ||
36 | }; | 33 | }; |
37 | 34 | ||
35 | extern struct mips_fpu_emulator_stats fpuemustats; | ||
36 | |||
38 | #endif /* _ASM_FPU_EMULATOR_H */ | 37 | #endif /* _ASM_FPU_EMULATOR_H */ |
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h index 9feff4ce1424..2454c44a8f54 100644 --- a/include/asm-mips/futex.h +++ b/include/asm-mips/futex.h | |||
@@ -3,10 +3,45 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <linux/config.h> | ||
6 | #include <linux/futex.h> | 7 | #include <linux/futex.h> |
7 | #include <asm/errno.h> | 8 | #include <asm/errno.h> |
8 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
9 | 10 | ||
11 | #ifdef CONFIG_SMP | ||
12 | #define __FUTEX_SMP_SYNC " sync \n" | ||
13 | #else | ||
14 | #define __FUTEX_SMP_SYNC | ||
15 | #endif | ||
16 | |||
17 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | ||
18 | { \ | ||
19 | __asm__ __volatile__( \ | ||
20 | " .set push \n" \ | ||
21 | " .set noat \n" \ | ||
22 | " .set mips3 \n" \ | ||
23 | "1: ll %1, (%3) # __futex_atomic_op1 \n" \ | ||
24 | " .set mips0 \n" \ | ||
25 | " " insn " \n" \ | ||
26 | " .set mips3 \n" \ | ||
27 | "2: sc $1, (%3) \n" \ | ||
28 | " beqzl $1, 1b \n" \ | ||
29 | __FUTEX_SMP_SYNC \ | ||
30 | "3: \n" \ | ||
31 | " .set pop \n" \ | ||
32 | " .set mips0 \n" \ | ||
33 | " .section .fixup,\"ax\" \n" \ | ||
34 | "4: li %0, %5 \n" \ | ||
35 | " j 2b \n" \ | ||
36 | " .previous \n" \ | ||
37 | " .section __ex_table,\"a\" \n" \ | ||
38 | " "__UA_ADDR "\t1b, 4b \n" \ | ||
39 | " "__UA_ADDR "\t2b, 4b \n" \ | ||
40 | " .previous \n" \ | ||
41 | : "=r" (ret), "=r" (oldval) \ | ||
42 | : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ | ||
43 | } | ||
44 | |||
10 | static inline int | 45 | static inline int |
11 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 46 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) |
12 | { | 47 | { |
@@ -25,10 +60,25 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
25 | 60 | ||
26 | switch (op) { | 61 | switch (op) { |
27 | case FUTEX_OP_SET: | 62 | case FUTEX_OP_SET: |
63 | __futex_atomic_op("move $1, %z4", ret, oldval, uaddr, oparg); | ||
64 | break; | ||
65 | |||
28 | case FUTEX_OP_ADD: | 66 | case FUTEX_OP_ADD: |
67 | __futex_atomic_op("addu $1, %1, %z4", | ||
68 | ret, oldval, uaddr, oparg); | ||
69 | break; | ||
29 | case FUTEX_OP_OR: | 70 | case FUTEX_OP_OR: |
71 | __futex_atomic_op("or $1, %1, %z4", | ||
72 | ret, oldval, uaddr, oparg); | ||
73 | break; | ||
30 | case FUTEX_OP_ANDN: | 74 | case FUTEX_OP_ANDN: |
75 | __futex_atomic_op("and $1, %1, %z4", | ||
76 | ret, oldval, uaddr, ~oparg); | ||
77 | break; | ||
31 | case FUTEX_OP_XOR: | 78 | case FUTEX_OP_XOR: |
79 | __futex_atomic_op("xor $1, %1, %z4", | ||
80 | ret, oldval, uaddr, oparg); | ||
81 | break; | ||
32 | default: | 82 | default: |
33 | ret = -ENOSYS; | 83 | ret = -ENOSYS; |
34 | } | 84 | } |
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h index f524eaccd5f1..7517189e469f 100644 --- a/include/asm-mips/hazards.h +++ b/include/asm-mips/hazards.h | |||
@@ -74,7 +74,8 @@ | |||
74 | #define irq_disable_hazard | 74 | #define irq_disable_hazard |
75 | _ehb | 75 | _ehb |
76 | 76 | ||
77 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) | 77 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \ |
78 | defined(CONFIG_CPU_SB1) | ||
78 | 79 | ||
79 | /* | 80 | /* |
80 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. | 81 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. |
@@ -107,6 +108,7 @@ __asm__( | |||
107 | " .endm \n\t"); | 108 | " .endm \n\t"); |
108 | 109 | ||
109 | #ifdef CONFIG_CPU_RM9000 | 110 | #ifdef CONFIG_CPU_RM9000 |
111 | |||
110 | /* | 112 | /* |
111 | * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent | 113 | * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent |
112 | * use of the JTLB for instructions should not occur for 4 cpu cycles and use | 114 | * use of the JTLB for instructions should not occur for 4 cpu cycles and use |
@@ -124,6 +126,9 @@ __asm__( | |||
124 | ".set\tmips32\n\t" \ | 126 | ".set\tmips32\n\t" \ |
125 | "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \ | 127 | "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \ |
126 | ".set\tmips0") | 128 | ".set\tmips0") |
129 | |||
130 | #define back_to_back_c0_hazard() do { } while (0) | ||
131 | |||
127 | #else | 132 | #else |
128 | 133 | ||
129 | /* | 134 | /* |
@@ -144,15 +149,13 @@ __asm__( | |||
144 | #endif | 149 | #endif |
145 | 150 | ||
146 | /* | 151 | /* |
147 | * mtc0->mfc0 hazard | 152 | * Interrupt enable/disable hazards |
148 | * The 24K has a 2 cycle mtc0/mfc0 execution hazard. | 153 | * Some processors have hazards when modifying |
149 | * It is a MIPS32R2 processor so ehb will clear the hazard. | 154 | * the status register to change the interrupt state |
150 | */ | 155 | */ |
151 | 156 | ||
152 | #ifdef CONFIG_CPU_MIPSR2 | 157 | #ifdef CONFIG_CPU_MIPSR2 |
153 | /* | 158 | |
154 | * Use a macro for ehb unless explicit support for MIPSR2 is enabled | ||
155 | */ | ||
156 | __asm__( | 159 | __asm__( |
157 | " .macro\tirq_enable_hazard \n\t" | 160 | " .macro\tirq_enable_hazard \n\t" |
158 | " _ehb \n\t" | 161 | " _ehb \n\t" |
@@ -160,17 +163,26 @@ __asm__( | |||
160 | " \n\t" | 163 | " \n\t" |
161 | " .macro\tirq_disable_hazard \n\t" | 164 | " .macro\tirq_disable_hazard \n\t" |
162 | " _ehb \n\t" | 165 | " _ehb \n\t" |
166 | " .endm \n\t" | ||
167 | " \n\t" | ||
168 | " .macro\tback_to_back_c0_hazard \n\t" | ||
169 | " _ehb \n\t" | ||
163 | " .endm"); | 170 | " .endm"); |
164 | 171 | ||
165 | #define irq_enable_hazard() \ | 172 | #define irq_enable_hazard() \ |
166 | __asm__ __volatile__( \ | 173 | __asm__ __volatile__( \ |
167 | "_ehb\t\t\t\t# irq_enable_hazard") | 174 | "irq_enable_hazard") |
168 | 175 | ||
169 | #define irq_disable_hazard() \ | 176 | #define irq_disable_hazard() \ |
170 | __asm__ __volatile__( \ | 177 | __asm__ __volatile__( \ |
171 | "_ehb\t\t\t\t# irq_disable_hazard") | 178 | "irq_disable_hazard") |
179 | |||
180 | #define back_to_back_c0_hazard() \ | ||
181 | __asm__ __volatile__( \ | ||
182 | "back_to_back_c0_hazard") | ||
172 | 183 | ||
173 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) | 184 | #elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000) || \ |
185 | defined(CONFIG_CPU_SB1) | ||
174 | 186 | ||
175 | /* | 187 | /* |
176 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. | 188 | * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. |
@@ -186,6 +198,8 @@ __asm__( | |||
186 | #define irq_enable_hazard() do { } while (0) | 198 | #define irq_enable_hazard() do { } while (0) |
187 | #define irq_disable_hazard() do { } while (0) | 199 | #define irq_disable_hazard() do { } while (0) |
188 | 200 | ||
201 | #define back_to_back_c0_hazard() do { } while (0) | ||
202 | |||
189 | #else | 203 | #else |
190 | 204 | ||
191 | /* | 205 | /* |
@@ -208,10 +222,32 @@ __asm__( | |||
208 | #define irq_enable_hazard() do { } while (0) | 222 | #define irq_enable_hazard() do { } while (0) |
209 | #define irq_disable_hazard() \ | 223 | #define irq_disable_hazard() \ |
210 | __asm__ __volatile__( \ | 224 | __asm__ __volatile__( \ |
211 | "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard") | 225 | "irq_disable_hazard") |
226 | |||
227 | #define back_to_back_c0_hazard() \ | ||
228 | __asm__ __volatile__( \ | ||
229 | " .set noreorder \n" \ | ||
230 | " nop; nop; nop \n" \ | ||
231 | " .set reorder \n") | ||
212 | 232 | ||
213 | #endif | 233 | #endif |
214 | 234 | ||
235 | #ifdef CONFIG_CPU_MIPSR2 | ||
236 | #define instruction_hazard() \ | ||
237 | do { \ | ||
238 | __label__ __next; \ | ||
239 | __asm__ __volatile__( \ | ||
240 | " jr.hb %0 \n" \ | ||
241 | : \ | ||
242 | : "r" (&&__next)); \ | ||
243 | __next: \ | ||
244 | ; \ | ||
245 | } while (0) | ||
246 | |||
247 | #else | ||
248 | #define instruction_hazard() do { } while (0) | ||
249 | #endif | ||
250 | |||
215 | #endif /* __ASSEMBLY__ */ | 251 | #endif /* __ASSEMBLY__ */ |
216 | 252 | ||
217 | #endif /* _ASM_HAZARDS_H */ | 253 | #endif /* _ASM_HAZARDS_H */ |
diff --git a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h index f49930d947d4..8cf598402492 100644 --- a/include/asm-mips/highmem.h +++ b/include/asm-mips/highmem.h | |||
@@ -75,6 +75,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static inline void kunmap_atomic(void *kvaddr, enum km_type type) { } | 77 | static inline void kunmap_atomic(void *kvaddr, enum km_type type) { } |
78 | #define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) | ||
78 | 79 | ||
79 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 80 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
80 | 81 | ||
@@ -86,6 +87,7 @@ extern void *__kmap(struct page *page); | |||
86 | extern void __kunmap(struct page *page); | 87 | extern void __kunmap(struct page *page); |
87 | extern void *__kmap_atomic(struct page *page, enum km_type type); | 88 | extern void *__kmap_atomic(struct page *page, enum km_type type); |
88 | extern void __kunmap_atomic(void *kvaddr, enum km_type type); | 89 | extern void __kunmap_atomic(void *kvaddr, enum km_type type); |
90 | extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type); | ||
89 | extern struct page *__kmap_atomic_to_page(void *ptr); | 91 | extern struct page *__kmap_atomic_to_page(void *ptr); |
90 | 92 | ||
91 | #define kmap __kmap | 93 | #define kmap __kmap |
diff --git a/include/asm-mips/inst.h b/include/asm-mips/inst.h index 6ad517241768..e0745f4ff624 100644 --- a/include/asm-mips/inst.h +++ b/include/asm-mips/inst.h | |||
@@ -28,7 +28,7 @@ enum major_op { | |||
28 | sdl_op, sdr_op, swr_op, cache_op, | 28 | sdl_op, sdr_op, swr_op, cache_op, |
29 | ll_op, lwc1_op, lwc2_op, pref_op, | 29 | ll_op, lwc1_op, lwc2_op, pref_op, |
30 | lld_op, ldc1_op, ldc2_op, ld_op, | 30 | lld_op, ldc1_op, ldc2_op, ld_op, |
31 | sc_op, swc1_op, swc2_op, major_3b_op, /* Opcode 0x3b is unused */ | 31 | sc_op, swc1_op, swc2_op, rdhwr_op, |
32 | scd_op, sdc1_op, sdc2_op, sd_op | 32 | scd_op, sdc1_op, sdc2_op, sd_op |
33 | }; | 33 | }; |
34 | 34 | ||
@@ -62,10 +62,10 @@ enum rt_op { | |||
62 | spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07, | 62 | spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07, |
63 | tgei_op, tgeiu_op, tlti_op, tltiu_op, | 63 | tgei_op, tgeiu_op, tlti_op, tltiu_op, |
64 | teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op, | 64 | teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op, |
65 | bltzal_op, bgezal_op, bltzall_op, bgezall_op | 65 | bltzal_op, bgezal_op, bltzall_op, bgezall_op, |
66 | /* | 66 | rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17, |
67 | * The others (0x14 - 0x1f) are unused. | 67 | rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b, |
68 | */ | 68 | bposge32_op, rt_op_0x1d, rt_op_0x1e, rt_op_0x1f |
69 | }; | 69 | }; |
70 | 70 | ||
71 | /* | 71 | /* |
diff --git a/include/asm-mips/interrupt.h b/include/asm-mips/interrupt.h index e8357f5379fa..a5735761f5e5 100644 --- a/include/asm-mips/interrupt.h +++ b/include/asm-mips/interrupt.h | |||
@@ -11,20 +11,25 @@ | |||
11 | #ifndef _ASM_INTERRUPT_H | 11 | #ifndef _ASM_INTERRUPT_H |
12 | #define _ASM_INTERRUPT_H | 12 | #define _ASM_INTERRUPT_H |
13 | 13 | ||
14 | #include <linux/config.h> | ||
14 | #include <asm/hazards.h> | 15 | #include <asm/hazards.h> |
15 | 16 | ||
16 | __asm__ ( | 17 | __asm__ ( |
17 | ".macro\tlocal_irq_enable\n\t" | 18 | " .macro local_irq_enable \n" |
18 | ".set\tpush\n\t" | 19 | " .set push \n" |
19 | ".set\treorder\n\t" | 20 | " .set reorder \n" |
20 | ".set\tnoat\n\t" | 21 | " .set noat \n" |
21 | "mfc0\t$1,$12\n\t" | 22 | #ifdef CONFIG_CPU_MIPSR2 |
22 | "ori\t$1,0x1f\n\t" | 23 | " ei \n" |
23 | "xori\t$1,0x1e\n\t" | 24 | #else |
24 | "mtc0\t$1,$12\n\t" | 25 | " mfc0 $1,$12 \n" |
25 | "irq_enable_hazard\n\t" | 26 | " ori $1,0x1f \n" |
26 | ".set\tpop\n\t" | 27 | " xori $1,0x1e \n" |
27 | ".endm"); | 28 | " mtc0 $1,$12 \n" |
29 | #endif | ||
30 | " irq_enable_hazard \n" | ||
31 | " .set pop \n" | ||
32 | " .endm"); | ||
28 | 33 | ||
29 | static inline void local_irq_enable(void) | 34 | static inline void local_irq_enable(void) |
30 | { | 35 | { |
@@ -43,17 +48,21 @@ static inline void local_irq_enable(void) | |||
43 | * no nops at all. | 48 | * no nops at all. |
44 | */ | 49 | */ |
45 | __asm__ ( | 50 | __asm__ ( |
46 | ".macro\tlocal_irq_disable\n\t" | 51 | " .macro local_irq_disable\n" |
47 | ".set\tpush\n\t" | 52 | " .set push \n" |
48 | ".set\tnoat\n\t" | 53 | " .set noat \n" |
49 | "mfc0\t$1,$12\n\t" | 54 | #ifdef CONFIG_CPU_MIPSR2 |
50 | "ori\t$1,1\n\t" | 55 | " di \n" |
51 | "xori\t$1,1\n\t" | 56 | #else |
52 | ".set\tnoreorder\n\t" | 57 | " mfc0 $1,$12 \n" |
53 | "mtc0\t$1,$12\n\t" | 58 | " ori $1,1 \n" |
54 | "irq_disable_hazard\n\t" | 59 | " xori $1,1 \n" |
55 | ".set\tpop\n\t" | 60 | " .set noreorder \n" |
56 | ".endm"); | 61 | " mtc0 $1,$12 \n" |
62 | #endif | ||
63 | " irq_disable_hazard \n" | ||
64 | " .set pop \n" | ||
65 | " .endm \n"); | ||
57 | 66 | ||
58 | static inline void local_irq_disable(void) | 67 | static inline void local_irq_disable(void) |
59 | { | 68 | { |
@@ -65,12 +74,12 @@ static inline void local_irq_disable(void) | |||
65 | } | 74 | } |
66 | 75 | ||
67 | __asm__ ( | 76 | __asm__ ( |
68 | ".macro\tlocal_save_flags flags\n\t" | 77 | " .macro local_save_flags flags \n" |
69 | ".set\tpush\n\t" | 78 | " .set push \n" |
70 | ".set\treorder\n\t" | 79 | " .set reorder \n" |
71 | "mfc0\t\\flags, $12\n\t" | 80 | " mfc0 \\flags, $12 \n" |
72 | ".set\tpop\n\t" | 81 | " .set pop \n" |
73 | ".endm"); | 82 | " .endm \n"); |
74 | 83 | ||
75 | #define local_save_flags(x) \ | 84 | #define local_save_flags(x) \ |
76 | __asm__ __volatile__( \ | 85 | __asm__ __volatile__( \ |
@@ -78,18 +87,22 @@ __asm__ __volatile__( \ | |||
78 | : "=r" (x)) | 87 | : "=r" (x)) |
79 | 88 | ||
80 | __asm__ ( | 89 | __asm__ ( |
81 | ".macro\tlocal_irq_save result\n\t" | 90 | " .macro local_irq_save result \n" |
82 | ".set\tpush\n\t" | 91 | " .set push \n" |
83 | ".set\treorder\n\t" | 92 | " .set reorder \n" |
84 | ".set\tnoat\n\t" | 93 | " .set noat \n" |
85 | "mfc0\t\\result, $12\n\t" | 94 | #ifdef CONFIG_CPU_MIPSR2 |
86 | "ori\t$1, \\result, 1\n\t" | 95 | " di \\result \n" |
87 | "xori\t$1, 1\n\t" | 96 | #else |
88 | ".set\tnoreorder\n\t" | 97 | " mfc0 \\result, $12 \n" |
89 | "mtc0\t$1, $12\n\t" | 98 | " ori $1, \\result, 1 \n" |
90 | "irq_disable_hazard\n\t" | 99 | " xori $1, 1 \n" |
91 | ".set\tpop\n\t" | 100 | " .set noreorder \n" |
92 | ".endm"); | 101 | " mtc0 $1, $12 \n" |
102 | #endif | ||
103 | " irq_disable_hazard \n" | ||
104 | " .set pop \n" | ||
105 | " .endm \n"); | ||
93 | 106 | ||
94 | #define local_irq_save(x) \ | 107 | #define local_irq_save(x) \ |
95 | __asm__ __volatile__( \ | 108 | __asm__ __volatile__( \ |
@@ -99,19 +112,37 @@ __asm__ __volatile__( \ | |||
99 | : "memory") | 112 | : "memory") |
100 | 113 | ||
101 | __asm__ ( | 114 | __asm__ ( |
102 | ".macro\tlocal_irq_restore flags\n\t" | 115 | " .macro local_irq_restore flags \n" |
103 | ".set\tnoreorder\n\t" | 116 | " .set noreorder \n" |
104 | ".set\tnoat\n\t" | 117 | " .set noat \n" |
105 | "mfc0\t$1, $12\n\t" | 118 | #if defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) |
106 | "andi\t\\flags, 1\n\t" | 119 | /* |
107 | "ori\t$1, 1\n\t" | 120 | * Slow, but doesn't suffer from a relativly unlikely race |
108 | "xori\t$1, 1\n\t" | 121 | * condition we're having since days 1. |
109 | "or\t\\flags, $1\n\t" | 122 | */ |
110 | "mtc0\t\\flags, $12\n\t" | 123 | " beqz \\flags, 1f \n" |
111 | "irq_disable_hazard\n\t" | 124 | " di \n" |
112 | ".set\tat\n\t" | 125 | " ei \n" |
113 | ".set\treorder\n\t" | 126 | "1: \n" |
114 | ".endm"); | 127 | #elif defined(CONFIG_CPU_MIPSR2) |
128 | /* | ||
129 | * Fast, dangerous. Life is fun, life is good. | ||
130 | */ | ||
131 | " mfc0 $1, $12 \n" | ||
132 | " ins $1, \\flags, 0, 1 \n" | ||
133 | " mtc0 $1, $12 \n" | ||
134 | #else | ||
135 | " mfc0 $1, $12 \n" | ||
136 | " andi \\flags, 1 \n" | ||
137 | " ori $1, 1 \n" | ||
138 | " xori $1, 1 \n" | ||
139 | " or \\flags, $1 \n" | ||
140 | " mtc0 \\flags, $12 \n" | ||
141 | #endif | ||
142 | " irq_disable_hazard \n" | ||
143 | " .set at \n" | ||
144 | " .set reorder \n" | ||
145 | " .endm \n"); | ||
115 | 146 | ||
116 | #define local_irq_restore(flags) \ | 147 | #define local_irq_restore(flags) \ |
117 | do { \ | 148 | do { \ |
diff --git a/include/asm-mips/inventory.h b/include/asm-mips/inventory.h index 4cd36fe98173..92d90f75a636 100644 --- a/include/asm-mips/inventory.h +++ b/include/asm-mips/inventory.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #ifndef __ASM_INVENTORY_H | 4 | #ifndef __ASM_INVENTORY_H |
5 | #define __ASM_INVENTORY_H | 5 | #define __ASM_INVENTORY_H |
6 | 6 | ||
7 | #include <linux/compiler.h> | ||
8 | |||
7 | typedef struct inventory_s { | 9 | typedef struct inventory_s { |
8 | struct inventory_s *inv_next; | 10 | struct inventory_s *inv_next; |
9 | int inv_class; | 11 | int inv_class; |
@@ -14,7 +16,9 @@ typedef struct inventory_s { | |||
14 | } inventory_t; | 16 | } inventory_t; |
15 | 17 | ||
16 | extern int inventory_items; | 18 | extern int inventory_items; |
17 | void add_to_inventory (int class, int type, int controller, int unit, int state); | 19 | |
18 | int dump_inventory_to_user (void *userbuf, int size); | 20 | extern void add_to_inventory (int class, int type, int controller, int unit, int state); |
21 | extern int dump_inventory_to_user (void __user *userbuf, int size); | ||
22 | extern int __init init_inventory(void); | ||
19 | 23 | ||
20 | #endif /* __ASM_INVENTORY_H */ | 24 | #endif /* __ASM_INVENTORY_H */ |
diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index 039845f2e6b0..3061870b7f6c 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h | |||
@@ -25,7 +25,9 @@ | |||
25 | #include <asm/page.h> | 25 | #include <asm/page.h> |
26 | #include <asm/pgtable-bits.h> | 26 | #include <asm/pgtable-bits.h> |
27 | #include <asm/processor.h> | 27 | #include <asm/processor.h> |
28 | #include <asm/string.h> | ||
28 | 29 | ||
30 | #include <ioremap.h> | ||
29 | #include <mangle-port.h> | 31 | #include <mangle-port.h> |
30 | 32 | ||
31 | /* | 33 | /* |
@@ -34,7 +36,7 @@ | |||
34 | #undef CONF_SLOWDOWN_IO | 36 | #undef CONF_SLOWDOWN_IO |
35 | 37 | ||
36 | /* | 38 | /* |
37 | * Raw operations are never swapped in software. Otoh values that raw | 39 | * Raw operations are never swapped in software. OTOH values that raw |
38 | * operations are working on may or may not have been swapped by the bus | 40 | * operations are working on may or may not have been swapped by the bus |
39 | * hardware. An example use would be for flash memory that's used for | 41 | * hardware. An example use would be for flash memory that's used for |
40 | * execute in place. | 42 | * execute in place. |
@@ -43,45 +45,53 @@ | |||
43 | # define __raw_ioswabw(x) (x) | 45 | # define __raw_ioswabw(x) (x) |
44 | # define __raw_ioswabl(x) (x) | 46 | # define __raw_ioswabl(x) (x) |
45 | # define __raw_ioswabq(x) (x) | 47 | # define __raw_ioswabq(x) (x) |
48 | # define ____raw_ioswabq(x) (x) | ||
46 | 49 | ||
47 | /* | 50 | /* |
48 | * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; | 51 | * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; |
49 | * less sane hardware forces software to fiddle with this... | 52 | * less sane hardware forces software to fiddle with this... |
53 | * | ||
54 | * Regardless, if the host bus endianness mismatches that of PCI/ISA, then | ||
55 | * you can't have the numerical value of data and byte addresses within | ||
56 | * multibyte quantities both preserved at the same time. Hence two | ||
57 | * variations of functions: non-prefixed ones that preserve the value | ||
58 | * and prefixed ones that preserve byte addresses. The latters are | ||
59 | * typically used for moving raw data between a peripheral and memory (cf. | ||
60 | * string I/O functions), hence the "mem_" prefix. | ||
50 | */ | 61 | */ |
51 | #if defined(CONFIG_SWAP_IO_SPACE) | 62 | #if defined(CONFIG_SWAP_IO_SPACE) |
52 | 63 | ||
53 | # define ioswabb(x) (x) | 64 | # define ioswabb(x) (x) |
65 | # define mem_ioswabb(x) (x) | ||
54 | # ifdef CONFIG_SGI_IP22 | 66 | # ifdef CONFIG_SGI_IP22 |
55 | /* | 67 | /* |
56 | * IP22 seems braindead enough to swap 16bits values in hardware, but | 68 | * IP22 seems braindead enough to swap 16bits values in hardware, but |
57 | * not 32bits. Go figure... Can't tell without documentation. | 69 | * not 32bits. Go figure... Can't tell without documentation. |
58 | */ | 70 | */ |
59 | # define ioswabw(x) (x) | 71 | # define ioswabw(x) (x) |
72 | # define mem_ioswabw(x) le16_to_cpu(x) | ||
60 | # else | 73 | # else |
61 | # define ioswabw(x) le16_to_cpu(x) | 74 | # define ioswabw(x) le16_to_cpu(x) |
75 | # define mem_ioswabw(x) (x) | ||
62 | # endif | 76 | # endif |
63 | # define ioswabl(x) le32_to_cpu(x) | 77 | # define ioswabl(x) le32_to_cpu(x) |
78 | # define mem_ioswabl(x) (x) | ||
64 | # define ioswabq(x) le64_to_cpu(x) | 79 | # define ioswabq(x) le64_to_cpu(x) |
80 | # define mem_ioswabq(x) (x) | ||
65 | 81 | ||
66 | #else | 82 | #else |
67 | 83 | ||
68 | # define ioswabb(x) (x) | 84 | # define ioswabb(x) (x) |
85 | # define mem_ioswabb(x) (x) | ||
69 | # define ioswabw(x) (x) | 86 | # define ioswabw(x) (x) |
87 | # define mem_ioswabw(x) cpu_to_le16(x) | ||
70 | # define ioswabl(x) (x) | 88 | # define ioswabl(x) (x) |
89 | # define mem_ioswabl(x) cpu_to_le32(x) | ||
71 | # define ioswabq(x) (x) | 90 | # define ioswabq(x) (x) |
91 | # define mem_ioswabq(x) cpu_to_le32(x) | ||
72 | 92 | ||
73 | #endif | 93 | #endif |
74 | 94 | ||
75 | /* | ||
76 | * Native bus accesses never swapped. | ||
77 | */ | ||
78 | #define bus_ioswabb(x) (x) | ||
79 | #define bus_ioswabw(x) (x) | ||
80 | #define bus_ioswabl(x) (x) | ||
81 | #define bus_ioswabq(x) (x) | ||
82 | |||
83 | #define __bus_ioswabq bus_ioswabq | ||
84 | |||
85 | #define IO_SPACE_LIMIT 0xffff | 95 | #define IO_SPACE_LIMIT 0xffff |
86 | 96 | ||
87 | /* | 97 | /* |
@@ -194,12 +204,14 @@ extern unsigned long isa_slot_offset; | |||
194 | */ | 204 | */ |
195 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) | 205 | #define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) |
196 | 206 | ||
197 | extern void * __ioremap(phys_t offset, phys_t size, unsigned long flags); | 207 | extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags); |
198 | extern void __iounmap(volatile void __iomem *addr); | 208 | extern void __iounmap(volatile void __iomem *addr); |
199 | 209 | ||
200 | static inline void * __ioremap_mode(phys_t offset, unsigned long size, | 210 | static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size, |
201 | unsigned long flags) | 211 | unsigned long flags) |
202 | { | 212 | { |
213 | #define __IS_LOW512(addr) (!((phys_t)(addr) & (phys_t) ~0x1fffffffULL)) | ||
214 | |||
203 | if (cpu_has_64bit_addresses) { | 215 | if (cpu_has_64bit_addresses) { |
204 | u64 base = UNCAC_BASE; | 216 | u64 base = UNCAC_BASE; |
205 | 217 | ||
@@ -209,10 +221,30 @@ static inline void * __ioremap_mode(phys_t offset, unsigned long size, | |||
209 | */ | 221 | */ |
210 | if (flags == _CACHE_UNCACHED) | 222 | if (flags == _CACHE_UNCACHED) |
211 | base = (u64) IO_BASE; | 223 | base = (u64) IO_BASE; |
212 | return (void *) (unsigned long) (base + offset); | 224 | return (void __iomem *) (unsigned long) (base + offset); |
225 | } else if (__builtin_constant_p(offset) && | ||
226 | __builtin_constant_p(size) && __builtin_constant_p(flags)) { | ||
227 | phys_t phys_addr, last_addr; | ||
228 | |||
229 | phys_addr = fixup_bigphys_addr(offset, size); | ||
230 | |||
231 | /* Don't allow wraparound or zero size. */ | ||
232 | last_addr = phys_addr + size - 1; | ||
233 | if (!size || last_addr < phys_addr) | ||
234 | return NULL; | ||
235 | |||
236 | /* | ||
237 | * Map uncached objects in the low 512MB of address | ||
238 | * space using KSEG1. | ||
239 | */ | ||
240 | if (__IS_LOW512(phys_addr) && __IS_LOW512(last_addr) && | ||
241 | flags == _CACHE_UNCACHED) | ||
242 | return (void __iomem *)CKSEG1ADDR(phys_addr); | ||
213 | } | 243 | } |
214 | 244 | ||
215 | return __ioremap(offset, size, flags); | 245 | return __ioremap(offset, size, flags); |
246 | |||
247 | #undef __IS_LOW512 | ||
216 | } | 248 | } |
217 | 249 | ||
218 | /* | 250 | /* |
@@ -264,12 +296,16 @@ static inline void * __ioremap_mode(phys_t offset, unsigned long size, | |||
264 | 296 | ||
265 | static inline void iounmap(volatile void __iomem *addr) | 297 | static inline void iounmap(volatile void __iomem *addr) |
266 | { | 298 | { |
267 | if (cpu_has_64bit_addresses) | 299 | #define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) |
300 | |||
301 | if (cpu_has_64bit_addresses || | ||
302 | (__builtin_constant_p(addr) && __IS_KSEG1(addr))) | ||
268 | return; | 303 | return; |
269 | 304 | ||
270 | __iounmap(addr); | 305 | __iounmap(addr); |
271 | } | ||
272 | 306 | ||
307 | #undef __IS_KSEG1 | ||
308 | } | ||
273 | 309 | ||
274 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ | 310 | #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ |
275 | \ | 311 | \ |
@@ -319,7 +355,8 @@ static inline type pfx##read##bwlq(volatile void __iomem *mem) \ | |||
319 | else if (cpu_has_64bits) { \ | 355 | else if (cpu_has_64bits) { \ |
320 | unsigned long __flags; \ | 356 | unsigned long __flags; \ |
321 | \ | 357 | \ |
322 | local_irq_save(__flags); \ | 358 | if (irq) \ |
359 | local_irq_save(__flags); \ | ||
323 | __asm__ __volatile__( \ | 360 | __asm__ __volatile__( \ |
324 | ".set mips3" "\t\t# __readq" "\n\t" \ | 361 | ".set mips3" "\t\t# __readq" "\n\t" \ |
325 | "ld %L0, %1" "\n\t" \ | 362 | "ld %L0, %1" "\n\t" \ |
@@ -328,7 +365,8 @@ static inline type pfx##read##bwlq(volatile void __iomem *mem) \ | |||
328 | ".set mips0" "\n" \ | 365 | ".set mips0" "\n" \ |
329 | : "=r" (__val) \ | 366 | : "=r" (__val) \ |
330 | : "m" (*__mem)); \ | 367 | : "m" (*__mem)); \ |
331 | local_irq_restore(__flags); \ | 368 | if (irq) \ |
369 | local_irq_restore(__flags); \ | ||
332 | } else { \ | 370 | } else { \ |
333 | __val = 0; \ | 371 | __val = 0; \ |
334 | BUG(); \ | 372 | BUG(); \ |
@@ -349,11 +387,11 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ | |||
349 | \ | 387 | \ |
350 | __val = pfx##ioswab##bwlq(val); \ | 388 | __val = pfx##ioswab##bwlq(val); \ |
351 | \ | 389 | \ |
352 | if (sizeof(type) != sizeof(u64)) { \ | 390 | /* Really, we want this to be atomic */ \ |
353 | *__addr = __val; \ | 391 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ |
354 | slow; \ | 392 | \ |
355 | } else \ | 393 | *__addr = __val; \ |
356 | BUILD_BUG(); \ | 394 | slow; \ |
357 | } \ | 395 | } \ |
358 | \ | 396 | \ |
359 | static inline type pfx##in##bwlq##p(unsigned long port) \ | 397 | static inline type pfx##in##bwlq##p(unsigned long port) \ |
@@ -364,13 +402,10 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ | |||
364 | port = __swizzle_addr_##bwlq(port); \ | 402 | port = __swizzle_addr_##bwlq(port); \ |
365 | __addr = (void *)(mips_io_port_base + port); \ | 403 | __addr = (void *)(mips_io_port_base + port); \ |
366 | \ | 404 | \ |
367 | if (sizeof(type) != sizeof(u64)) { \ | 405 | BUILD_BUG_ON(sizeof(type) > sizeof(unsigned long)); \ |
368 | __val = *__addr; \ | 406 | \ |
369 | slow; \ | 407 | __val = *__addr; \ |
370 | } else { \ | 408 | slow; \ |
371 | __val = 0; \ | ||
372 | BUILD_BUG(); \ | ||
373 | } \ | ||
374 | \ | 409 | \ |
375 | return pfx##ioswab##bwlq(__val); \ | 410 | return pfx##ioswab##bwlq(__val); \ |
376 | } | 411 | } |
@@ -379,27 +414,35 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ | |||
379 | \ | 414 | \ |
380 | __BUILD_MEMORY_SINGLE(bus, bwlq, type, 1) | 415 | __BUILD_MEMORY_SINGLE(bus, bwlq, type, 1) |
381 | 416 | ||
382 | #define __BUILD_IOPORT_PFX(bus, bwlq, type) \ | 417 | #define BUILDIO_MEM(bwlq, type) \ |
383 | \ | ||
384 | __BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \ | ||
385 | __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO) | ||
386 | |||
387 | #define BUILDIO(bwlq, type) \ | ||
388 | \ | 418 | \ |
389 | __BUILD_MEMORY_PFX(, bwlq, type) \ | ||
390 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ | 419 | __BUILD_MEMORY_PFX(__raw_, bwlq, type) \ |
391 | __BUILD_MEMORY_PFX(bus_, bwlq, type) \ | 420 | __BUILD_MEMORY_PFX(, bwlq, type) \ |
392 | __BUILD_IOPORT_PFX(, bwlq, type) \ | 421 | __BUILD_MEMORY_PFX(mem_, bwlq, type) \ |
393 | __BUILD_IOPORT_PFX(__raw_, bwlq, type) | 422 | |
423 | BUILDIO_MEM(b, u8) | ||
424 | BUILDIO_MEM(w, u16) | ||
425 | BUILDIO_MEM(l, u32) | ||
426 | BUILDIO_MEM(q, u64) | ||
427 | |||
428 | #define __BUILD_IOPORT_PFX(bus, bwlq, type) \ | ||
429 | __BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \ | ||
430 | __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO) | ||
431 | |||
432 | #define BUILDIO_IOPORT(bwlq, type) \ | ||
433 | __BUILD_IOPORT_PFX(, bwlq, type) \ | ||
434 | __BUILD_IOPORT_PFX(mem_, bwlq, type) | ||
435 | |||
436 | BUILDIO_IOPORT(b, u8) | ||
437 | BUILDIO_IOPORT(w, u16) | ||
438 | BUILDIO_IOPORT(l, u32) | ||
439 | #ifdef CONFIG_64BIT | ||
440 | BUILDIO_IOPORT(q, u64) | ||
441 | #endif | ||
394 | 442 | ||
395 | #define __BUILDIO(bwlq, type) \ | 443 | #define __BUILDIO(bwlq, type) \ |
396 | \ | 444 | \ |
397 | __BUILD_MEMORY_SINGLE(__bus_, bwlq, type, 0) | 445 | __BUILD_MEMORY_SINGLE(____raw_, bwlq, type, 0) |
398 | |||
399 | BUILDIO(b, u8) | ||
400 | BUILDIO(w, u16) | ||
401 | BUILDIO(l, u32) | ||
402 | BUILDIO(q, u64) | ||
403 | 446 | ||
404 | __BUILDIO(q, u64) | 447 | __BUILDIO(q, u64) |
405 | 448 | ||
@@ -422,7 +465,7 @@ static inline void writes##bwlq(volatile void __iomem *mem, void *addr, \ | |||
422 | volatile type *__addr = addr; \ | 465 | volatile type *__addr = addr; \ |
423 | \ | 466 | \ |
424 | while (count--) { \ | 467 | while (count--) { \ |
425 | __raw_write##bwlq(*__addr, mem); \ | 468 | mem_write##bwlq(*__addr, mem); \ |
426 | __addr++; \ | 469 | __addr++; \ |
427 | } \ | 470 | } \ |
428 | } \ | 471 | } \ |
@@ -433,20 +476,20 @@ static inline void reads##bwlq(volatile void __iomem *mem, void *addr, \ | |||
433 | volatile type *__addr = addr; \ | 476 | volatile type *__addr = addr; \ |
434 | \ | 477 | \ |
435 | while (count--) { \ | 478 | while (count--) { \ |
436 | *__addr = __raw_read##bwlq(mem); \ | 479 | *__addr = mem_read##bwlq(mem); \ |
437 | __addr++; \ | 480 | __addr++; \ |
438 | } \ | 481 | } \ |
439 | } | 482 | } |
440 | 483 | ||
441 | #define __BUILD_IOPORT_STRING(bwlq, type) \ | 484 | #define __BUILD_IOPORT_STRING(bwlq, type) \ |
442 | \ | 485 | \ |
443 | static inline void outs##bwlq(unsigned long port, void *addr, \ | 486 | static inline void outs##bwlq(unsigned long port, const void *addr, \ |
444 | unsigned int count) \ | 487 | unsigned int count) \ |
445 | { \ | 488 | { \ |
446 | volatile type *__addr = addr; \ | 489 | const volatile type *__addr = addr; \ |
447 | \ | 490 | \ |
448 | while (count--) { \ | 491 | while (count--) { \ |
449 | __raw_out##bwlq(*__addr, port); \ | 492 | mem_out##bwlq(*__addr, port); \ |
450 | __addr++; \ | 493 | __addr++; \ |
451 | } \ | 494 | } \ |
452 | } \ | 495 | } \ |
@@ -457,7 +500,7 @@ static inline void ins##bwlq(unsigned long port, void *addr, \ | |||
457 | volatile type *__addr = addr; \ | 500 | volatile type *__addr = addr; \ |
458 | \ | 501 | \ |
459 | while (count--) { \ | 502 | while (count--) { \ |
460 | *__addr = __raw_in##bwlq(port); \ | 503 | *__addr = mem_in##bwlq(port); \ |
461 | __addr++; \ | 504 | __addr++; \ |
462 | } \ | 505 | } \ |
463 | } | 506 | } |
@@ -470,15 +513,26 @@ __BUILD_IOPORT_STRING(bwlq, type) | |||
470 | BUILDSTRING(b, u8) | 513 | BUILDSTRING(b, u8) |
471 | BUILDSTRING(w, u16) | 514 | BUILDSTRING(w, u16) |
472 | BUILDSTRING(l, u32) | 515 | BUILDSTRING(l, u32) |
516 | #ifdef CONFIG_64BIT | ||
473 | BUILDSTRING(q, u64) | 517 | BUILDSTRING(q, u64) |
518 | #endif | ||
474 | 519 | ||
475 | 520 | ||
476 | /* Depends on MIPS II instruction set */ | 521 | /* Depends on MIPS II instruction set */ |
477 | #define mmiowb() asm volatile ("sync" ::: "memory") | 522 | #define mmiowb() asm volatile ("sync" ::: "memory") |
478 | 523 | ||
479 | #define memset_io(a,b,c) memset((void *)(a),(b),(c)) | 524 | static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) |
480 | #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) | 525 | { |
481 | #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) | 526 | memset((void __force *) addr, val, count); |
527 | } | ||
528 | static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) | ||
529 | { | ||
530 | memcpy(dst, (void __force *) src, count); | ||
531 | } | ||
532 | static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) | ||
533 | { | ||
534 | memcpy((void __force *) dst, src, count); | ||
535 | } | ||
482 | 536 | ||
483 | /* | 537 | /* |
484 | * Memory Mapped I/O | 538 | * Memory Mapped I/O |
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index 3f2470e9e678..8a342ccb34a8 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h | |||
@@ -24,11 +24,9 @@ static inline int irq_canonicalize(int irq) | |||
24 | 24 | ||
25 | struct pt_regs; | 25 | struct pt_regs; |
26 | 26 | ||
27 | #ifdef CONFIG_PREEMPT | ||
28 | |||
29 | extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); | 27 | extern asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs); |
30 | 28 | ||
31 | #else | 29 | #ifdef CONFIG_PREEMPT |
32 | 30 | ||
33 | /* | 31 | /* |
34 | * do_IRQ handles all normal device IRQ's (the special | 32 | * do_IRQ handles all normal device IRQ's (the special |
diff --git a/include/asm-mips/jmr3927/jmr3927.h b/include/asm-mips/jmr3927/jmr3927.h index 86df317b4078..baf412967afa 100644 --- a/include/asm-mips/jmr3927/jmr3927.h +++ b/include/asm-mips/jmr3927/jmr3927.h | |||
@@ -202,20 +202,6 @@ static inline int jmr3927_have_isac(void) | |||
202 | #endif /* !__ASSEMBLY__ */ | 202 | #endif /* !__ASSEMBLY__ */ |
203 | 203 | ||
204 | /* | 204 | /* |
205 | * UART defines for serial.h | ||
206 | */ | ||
207 | |||
208 | /* use Pre-scaler T0 (1/2) */ | ||
209 | #define JMR3927_BASE_BAUD (JMR3927_IMCLK / 2 / 16) | ||
210 | |||
211 | #define UART0_ADDR 0xfffef300 | ||
212 | #define UART1_ADDR 0xfffef400 | ||
213 | #define UART0_INT JMR3927_IRQ_IRC_SIO0 | ||
214 | #define UART1_INT JMR3927_IRQ_IRC_SIO1 | ||
215 | #define UART0_FLAGS ASYNC_BOOT_AUTOCONF | ||
216 | #define UART1_FLAGS 0 | ||
217 | |||
218 | /* | ||
219 | * IRQ mappings | 205 | * IRQ mappings |
220 | */ | 206 | */ |
221 | 207 | ||
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h index 148bae2fa7d3..8327ec341c18 100644 --- a/include/asm-mips/mach-au1x00/au1000.h +++ b/include/asm-mips/mach-au1x00/au1000.h | |||
@@ -60,59 +60,36 @@ void static inline au_sync_delay(int ms) | |||
60 | mdelay(ms); | 60 | mdelay(ms); |
61 | } | 61 | } |
62 | 62 | ||
63 | void static inline au_writeb(u8 val, int reg) | 63 | void static inline au_writeb(u8 val, unsigned long reg) |
64 | { | 64 | { |
65 | *(volatile u8 *)(reg) = val; | 65 | *(volatile u8 *)(reg) = val; |
66 | } | 66 | } |
67 | 67 | ||
68 | void static inline au_writew(u16 val, int reg) | 68 | void static inline au_writew(u16 val, unsigned long reg) |
69 | { | 69 | { |
70 | *(volatile u16 *)(reg) = val; | 70 | *(volatile u16 *)(reg) = val; |
71 | } | 71 | } |
72 | 72 | ||
73 | void static inline au_writel(u32 val, int reg) | 73 | void static inline au_writel(u32 val, unsigned long reg) |
74 | { | 74 | { |
75 | *(volatile u32 *)(reg) = val; | 75 | *(volatile u32 *)(reg) = val; |
76 | } | 76 | } |
77 | 77 | ||
78 | static inline u8 au_readb(unsigned long port) | 78 | static inline u8 au_readb(unsigned long reg) |
79 | { | 79 | { |
80 | return (*(volatile u8 *)port); | 80 | return (*(volatile u8 *)reg); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline u16 au_readw(unsigned long port) | 83 | static inline u16 au_readw(unsigned long reg) |
84 | { | 84 | { |
85 | return (*(volatile u16 *)port); | 85 | return (*(volatile u16 *)reg); |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline u32 au_readl(unsigned long port) | 88 | static inline u32 au_readl(unsigned long reg) |
89 | { | 89 | { |
90 | return (*(volatile u32 *)port); | 90 | return (*(volatile u32 *)reg); |
91 | } | 91 | } |
92 | 92 | ||
93 | /* These next three functions should be a generic part of the MIPS | ||
94 | * kernel (with the 'au_' removed from the name) and selected for | ||
95 | * processors that support the instructions. | ||
96 | * Taken from PPC tree. -- Dan | ||
97 | */ | ||
98 | /* Return the bit position of the most significant 1 bit in a word */ | ||
99 | static __inline__ int __ilog2(unsigned int x) | ||
100 | { | ||
101 | int lz; | ||
102 | |||
103 | asm volatile ( | ||
104 | ".set\tnoreorder\n\t" | ||
105 | ".set\tnoat\n\t" | ||
106 | ".set\tmips32\n\t" | ||
107 | "clz\t%0,%1\n\t" | ||
108 | ".set\tmips0\n\t" | ||
109 | ".set\tat\n\t" | ||
110 | ".set\treorder" | ||
111 | : "=r" (lz) | ||
112 | : "r" (x)); | ||
113 | |||
114 | return 31 - lz; | ||
115 | } | ||
116 | 93 | ||
117 | static __inline__ int au_ffz(unsigned int x) | 94 | static __inline__ int au_ffz(unsigned int x) |
118 | { | 95 | { |
@@ -162,28 +139,293 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
162 | #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) | 139 | #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5) |
163 | #endif | 140 | #endif |
164 | 141 | ||
165 | /* SDRAM Controller */ | 142 | /* |
143 | * SDRAM Register Offsets | ||
144 | */ | ||
166 | #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100) | 145 | #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100) |
167 | #define MEM_SDMODE0 0xB4000000 | 146 | #define MEM_SDMODE0 (0x0000) |
168 | #define MEM_SDMODE1 0xB4000004 | 147 | #define MEM_SDMODE1 (0x0004) |
169 | #define MEM_SDMODE2 0xB4000008 | 148 | #define MEM_SDMODE2 (0x0008) |
149 | #define MEM_SDADDR0 (0x000C) | ||
150 | #define MEM_SDADDR1 (0x0010) | ||
151 | #define MEM_SDADDR2 (0x0014) | ||
152 | #define MEM_SDREFCFG (0x0018) | ||
153 | #define MEM_SDPRECMD (0x001C) | ||
154 | #define MEM_SDAUTOREF (0x0020) | ||
155 | #define MEM_SDWRMD0 (0x0024) | ||
156 | #define MEM_SDWRMD1 (0x0028) | ||
157 | #define MEM_SDWRMD2 (0x002C) | ||
158 | #define MEM_SDSLEEP (0x0030) | ||
159 | #define MEM_SDSMCKE (0x0034) | ||
170 | 160 | ||
171 | #define MEM_SDADDR0 0xB400000C | 161 | /* |
172 | #define MEM_SDADDR1 0xB4000010 | 162 | * MEM_SDMODE register content definitions |
173 | #define MEM_SDADDR2 0xB4000014 | 163 | */ |
164 | #define MEM_SDMODE_F (1<<22) | ||
165 | #define MEM_SDMODE_SR (1<<21) | ||
166 | #define MEM_SDMODE_BS (1<<20) | ||
167 | #define MEM_SDMODE_RS (3<<18) | ||
168 | #define MEM_SDMODE_CS (7<<15) | ||
169 | #define MEM_SDMODE_TRAS (15<<11) | ||
170 | #define MEM_SDMODE_TMRD (3<<9) | ||
171 | #define MEM_SDMODE_TWR (3<<7) | ||
172 | #define MEM_SDMODE_TRP (3<<5) | ||
173 | #define MEM_SDMODE_TRCD (3<<3) | ||
174 | #define MEM_SDMODE_TCL (7<<0) | ||
175 | |||
176 | #define MEM_SDMODE_BS_2Bank (0<<20) | ||
177 | #define MEM_SDMODE_BS_4Bank (1<<20) | ||
178 | #define MEM_SDMODE_RS_11Row (0<<18) | ||
179 | #define MEM_SDMODE_RS_12Row (1<<18) | ||
180 | #define MEM_SDMODE_RS_13Row (2<<18) | ||
181 | #define MEM_SDMODE_RS_N(N) ((N)<<18) | ||
182 | #define MEM_SDMODE_CS_7Col (0<<15) | ||
183 | #define MEM_SDMODE_CS_8Col (1<<15) | ||
184 | #define MEM_SDMODE_CS_9Col (2<<15) | ||
185 | #define MEM_SDMODE_CS_10Col (3<<15) | ||
186 | #define MEM_SDMODE_CS_11Col (4<<15) | ||
187 | #define MEM_SDMODE_CS_N(N) ((N)<<15) | ||
188 | #define MEM_SDMODE_TRAS_N(N) ((N)<<11) | ||
189 | #define MEM_SDMODE_TMRD_N(N) ((N)<<9) | ||
190 | #define MEM_SDMODE_TWR_N(N) ((N)<<7) | ||
191 | #define MEM_SDMODE_TRP_N(N) ((N)<<5) | ||
192 | #define MEM_SDMODE_TRCD_N(N) ((N)<<3) | ||
193 | #define MEM_SDMODE_TCL_N(N) ((N)<<0) | ||
174 | 194 | ||
175 | #define MEM_SDREFCFG 0xB4000018 | 195 | /* |
176 | #define MEM_SDPRECMD 0xB400001C | 196 | * MEM_SDADDR register contents definitions |
177 | #define MEM_SDAUTOREF 0xB4000020 | 197 | */ |
198 | #define MEM_SDADDR_E (1<<20) | ||
199 | #define MEM_SDADDR_CSBA (0x03FF<<10) | ||
200 | #define MEM_SDADDR_CSMASK (0x03FF<<0) | ||
201 | #define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12) | ||
202 | #define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22) | ||
203 | |||
204 | /* | ||
205 | * MEM_SDREFCFG register content definitions | ||
206 | */ | ||
207 | #define MEM_SDREFCFG_TRC (15<<28) | ||
208 | #define MEM_SDREFCFG_TRPM (3<<26) | ||
209 | #define MEM_SDREFCFG_E (1<<25) | ||
210 | #define MEM_SDREFCFG_RE (0x1ffffff<<0) | ||
211 | #define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC) | ||
212 | #define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM) | ||
213 | #define MEM_SDREFCFG_REF_N(N) (N) | ||
214 | #endif | ||
178 | 215 | ||
179 | #define MEM_SDWRMD0 0xB4000024 | 216 | /***********************************************************************/ |
180 | #define MEM_SDWRMD1 0xB4000028 | ||
181 | #define MEM_SDWRMD2 0xB400002C | ||
182 | 217 | ||
183 | #define MEM_SDSLEEP 0xB4000030 | 218 | /* |
184 | #define MEM_SDSMCKE 0xB4000034 | 219 | * Au1550 SDRAM Register Offsets |
220 | */ | ||
221 | |||
222 | /***********************************************************************/ | ||
223 | |||
224 | #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) | ||
225 | #define MEM_SDMODE0 (0x0800) | ||
226 | #define MEM_SDMODE1 (0x0808) | ||
227 | #define MEM_SDMODE2 (0x0810) | ||
228 | #define MEM_SDADDR0 (0x0820) | ||
229 | #define MEM_SDADDR1 (0x0828) | ||
230 | #define MEM_SDADDR2 (0x0830) | ||
231 | #define MEM_SDCONFIGA (0x0840) | ||
232 | #define MEM_SDCONFIGB (0x0848) | ||
233 | #define MEM_SDSTAT (0x0850) | ||
234 | #define MEM_SDERRADDR (0x0858) | ||
235 | #define MEM_SDSTRIDE0 (0x0860) | ||
236 | #define MEM_SDSTRIDE1 (0x0868) | ||
237 | #define MEM_SDSTRIDE2 (0x0870) | ||
238 | #define MEM_SDWRMD0 (0x0880) | ||
239 | #define MEM_SDWRMD1 (0x0888) | ||
240 | #define MEM_SDWRMD2 (0x0890) | ||
241 | #define MEM_SDPRECMD (0x08C0) | ||
242 | #define MEM_SDAUTOREF (0x08C8) | ||
243 | #define MEM_SDSREF (0x08D0) | ||
244 | #define MEM_SDSLEEP MEM_SDSREF | ||
245 | |||
246 | #endif | ||
247 | |||
248 | /* | ||
249 | * Physical base addresses for integrated peripherals | ||
250 | */ | ||
251 | |||
252 | #ifdef CONFIG_SOC_AU1000 | ||
253 | #define MEM_PHYS_ADDR 0x14000000 | ||
254 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
255 | #define DMA0_PHYS_ADDR 0x14002000 | ||
256 | #define DMA1_PHYS_ADDR 0x14002100 | ||
257 | #define DMA2_PHYS_ADDR 0x14002200 | ||
258 | #define DMA3_PHYS_ADDR 0x14002300 | ||
259 | #define DMA4_PHYS_ADDR 0x14002400 | ||
260 | #define DMA5_PHYS_ADDR 0x14002500 | ||
261 | #define DMA6_PHYS_ADDR 0x14002600 | ||
262 | #define DMA7_PHYS_ADDR 0x14002700 | ||
263 | #define IC0_PHYS_ADDR 0x10400000 | ||
264 | #define IC1_PHYS_ADDR 0x11800000 | ||
265 | #define AC97_PHYS_ADDR 0x10000000 | ||
266 | #define USBH_PHYS_ADDR 0x10100000 | ||
267 | #define USBD_PHYS_ADDR 0x10200000 | ||
268 | #define IRDA_PHYS_ADDR 0x10300000 | ||
269 | #define MAC0_PHYS_ADDR 0x10500000 | ||
270 | #define MAC1_PHYS_ADDR 0x10510000 | ||
271 | #define MACEN_PHYS_ADDR 0x10520000 | ||
272 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
273 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
274 | #define I2S_PHYS_ADDR 0x11000000 | ||
275 | #define UART0_PHYS_ADDR 0x11100000 | ||
276 | #define UART1_PHYS_ADDR 0x11200000 | ||
277 | #define UART2_PHYS_ADDR 0x11300000 | ||
278 | #define UART3_PHYS_ADDR 0x11400000 | ||
279 | #define SSI0_PHYS_ADDR 0x11600000 | ||
280 | #define SSI1_PHYS_ADDR 0x11680000 | ||
281 | #define SYS_PHYS_ADDR 0x11900000 | ||
282 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
283 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
284 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
185 | #endif | 285 | #endif |
186 | 286 | ||
287 | /********************************************************************/ | ||
288 | |||
289 | #ifdef CONFIG_SOC_AU1500 | ||
290 | #define MEM_PHYS_ADDR 0x14000000 | ||
291 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
292 | #define DMA0_PHYS_ADDR 0x14002000 | ||
293 | #define DMA1_PHYS_ADDR 0x14002100 | ||
294 | #define DMA2_PHYS_ADDR 0x14002200 | ||
295 | #define DMA3_PHYS_ADDR 0x14002300 | ||
296 | #define DMA4_PHYS_ADDR 0x14002400 | ||
297 | #define DMA5_PHYS_ADDR 0x14002500 | ||
298 | #define DMA6_PHYS_ADDR 0x14002600 | ||
299 | #define DMA7_PHYS_ADDR 0x14002700 | ||
300 | #define IC0_PHYS_ADDR 0x10400000 | ||
301 | #define IC1_PHYS_ADDR 0x11800000 | ||
302 | #define AC97_PHYS_ADDR 0x10000000 | ||
303 | #define USBH_PHYS_ADDR 0x10100000 | ||
304 | #define USBD_PHYS_ADDR 0x10200000 | ||
305 | #define PCI_PHYS_ADDR 0x14005000 | ||
306 | #define MAC0_PHYS_ADDR 0x11500000 | ||
307 | #define MAC1_PHYS_ADDR 0x11510000 | ||
308 | #define MACEN_PHYS_ADDR 0x11520000 | ||
309 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
310 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
311 | #define I2S_PHYS_ADDR 0x11000000 | ||
312 | #define UART0_PHYS_ADDR 0x11100000 | ||
313 | #define UART3_PHYS_ADDR 0x11400000 | ||
314 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
315 | #define SYS_PHYS_ADDR 0x11900000 | ||
316 | #define PCI_MEM_PHYS_ADDR 0x400000000ULL | ||
317 | #define PCI_IO_PHYS_ADDR 0x500000000ULL | ||
318 | #define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL | ||
319 | #define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL | ||
320 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
321 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
322 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
323 | #endif | ||
324 | |||
325 | /********************************************************************/ | ||
326 | |||
327 | #ifdef CONFIG_SOC_AU1100 | ||
328 | #define MEM_PHYS_ADDR 0x14000000 | ||
329 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
330 | #define DMA0_PHYS_ADDR 0x14002000 | ||
331 | #define DMA1_PHYS_ADDR 0x14002100 | ||
332 | #define DMA2_PHYS_ADDR 0x14002200 | ||
333 | #define DMA3_PHYS_ADDR 0x14002300 | ||
334 | #define DMA4_PHYS_ADDR 0x14002400 | ||
335 | #define DMA5_PHYS_ADDR 0x14002500 | ||
336 | #define DMA6_PHYS_ADDR 0x14002600 | ||
337 | #define DMA7_PHYS_ADDR 0x14002700 | ||
338 | #define IC0_PHYS_ADDR 0x10400000 | ||
339 | #define SD0_PHYS_ADDR 0x10600000 | ||
340 | #define SD1_PHYS_ADDR 0x10680000 | ||
341 | #define IC1_PHYS_ADDR 0x11800000 | ||
342 | #define AC97_PHYS_ADDR 0x10000000 | ||
343 | #define USBH_PHYS_ADDR 0x10100000 | ||
344 | #define USBD_PHYS_ADDR 0x10200000 | ||
345 | #define IRDA_PHYS_ADDR 0x10300000 | ||
346 | #define MAC0_PHYS_ADDR 0x10500000 | ||
347 | #define MACEN_PHYS_ADDR 0x10520000 | ||
348 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
349 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
350 | #define I2S_PHYS_ADDR 0x11000000 | ||
351 | #define UART0_PHYS_ADDR 0x11100000 | ||
352 | #define UART1_PHYS_ADDR 0x11200000 | ||
353 | #define UART3_PHYS_ADDR 0x11400000 | ||
354 | #define SSI0_PHYS_ADDR 0x11600000 | ||
355 | #define SSI1_PHYS_ADDR 0x11680000 | ||
356 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
357 | #define SYS_PHYS_ADDR 0x11900000 | ||
358 | #define LCD_PHYS_ADDR 0x15000000 | ||
359 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
360 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
361 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
362 | #endif | ||
363 | |||
364 | /***********************************************************************/ | ||
365 | |||
366 | #ifdef CONFIG_SOC_AU1550 | ||
367 | #define MEM_PHYS_ADDR 0x14000000 | ||
368 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
369 | #define IC0_PHYS_ADDR 0x10400000 | ||
370 | #define IC1_PHYS_ADDR 0x11800000 | ||
371 | #define USBH_PHYS_ADDR 0x14020000 | ||
372 | #define USBD_PHYS_ADDR 0x10200000 | ||
373 | #define PCI_PHYS_ADDR 0x14005000 | ||
374 | #define MAC0_PHYS_ADDR 0x10500000 | ||
375 | #define MAC1_PHYS_ADDR 0x10510000 | ||
376 | #define MACEN_PHYS_ADDR 0x10520000 | ||
377 | #define MACDMA0_PHYS_ADDR 0x14004000 | ||
378 | #define MACDMA1_PHYS_ADDR 0x14004200 | ||
379 | #define UART0_PHYS_ADDR 0x11100000 | ||
380 | #define UART1_PHYS_ADDR 0x11200000 | ||
381 | #define UART3_PHYS_ADDR 0x11400000 | ||
382 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
383 | #define SYS_PHYS_ADDR 0x11900000 | ||
384 | #define DDMA_PHYS_ADDR 0x14002000 | ||
385 | #define PE_PHYS_ADDR 0x14008000 | ||
386 | #define PSC0_PHYS_ADDR 0x11A00000 | ||
387 | #define PSC1_PHYS_ADDR 0x11B00000 | ||
388 | #define PSC2_PHYS_ADDR 0x10A00000 | ||
389 | #define PSC3_PHYS_ADDR 0x10B00000 | ||
390 | #define PCI_MEM_PHYS_ADDR 0x400000000ULL | ||
391 | #define PCI_IO_PHYS_ADDR 0x500000000ULL | ||
392 | #define PCI_CONFIG0_PHYS_ADDR 0x600000000ULL | ||
393 | #define PCI_CONFIG1_PHYS_ADDR 0x680000000ULL | ||
394 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
395 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
396 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
397 | #endif | ||
398 | |||
399 | /***********************************************************************/ | ||
400 | |||
401 | #ifdef CONFIG_SOC_AU1200 | ||
402 | #define MEM_PHYS_ADDR 0x14000000 | ||
403 | #define STATIC_MEM_PHYS_ADDR 0x14001000 | ||
404 | #define AES_PHYS_ADDR 0x10300000 | ||
405 | #define CIM_PHYS_ADDR 0x14004000 | ||
406 | #define IC0_PHYS_ADDR 0x10400000 | ||
407 | #define IC1_PHYS_ADDR 0x11800000 | ||
408 | #define USBM_PHYS_ADDR 0x14020000 | ||
409 | #define USBH_PHYS_ADDR 0x14020100 | ||
410 | #define UART0_PHYS_ADDR 0x11100000 | ||
411 | #define UART1_PHYS_ADDR 0x11200000 | ||
412 | #define GPIO2_PHYS_ADDR 0x11700000 | ||
413 | #define SYS_PHYS_ADDR 0x11900000 | ||
414 | #define DDMA_PHYS_ADDR 0x14002000 | ||
415 | #define PSC0_PHYS_ADDR 0x11A00000 | ||
416 | #define PSC1_PHYS_ADDR 0x11B00000 | ||
417 | #define SD0_PHYS_ADDR 0x10600000 | ||
418 | #define SD1_PHYS_ADDR 0x10680000 | ||
419 | #define LCD_PHYS_ADDR 0x15000000 | ||
420 | #define SWCNT_PHYS_ADDR 0x1110010C | ||
421 | #define MAEFE_PHYS_ADDR 0x14012000 | ||
422 | #define MAEBE_PHYS_ADDR 0x14010000 | ||
423 | #define PCMCIA_IO_PHYS_ADDR 0xF00000000ULL | ||
424 | #define PCMCIA_ATTR_PHYS_ADDR 0xF40000000ULL | ||
425 | #define PCMCIA_MEM_PHYS_ADDR 0xF80000000ULL | ||
426 | #endif | ||
427 | |||
428 | |||
187 | /* Static Bus Controller */ | 429 | /* Static Bus Controller */ |
188 | #define MEM_STCFG0 0xB4001000 | 430 | #define MEM_STCFG0 0xB4001000 |
189 | #define MEM_STTIME0 0xB4001004 | 431 | #define MEM_STTIME0 0xB4001004 |
@@ -369,7 +611,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
369 | #define AU1000_MAC0_ENABLE 0xB0520000 | 611 | #define AU1000_MAC0_ENABLE 0xB0520000 |
370 | #define AU1000_MAC1_ENABLE 0xB0520004 | 612 | #define AU1000_MAC1_ENABLE 0xB0520004 |
371 | #define NUM_ETH_INTERFACES 2 | 613 | #define NUM_ETH_INTERFACES 2 |
372 | #endif // CONFIG_SOC_AU1000 | 614 | #endif /* CONFIG_SOC_AU1000 */ |
373 | 615 | ||
374 | /* Au1500 */ | 616 | /* Au1500 */ |
375 | #ifdef CONFIG_SOC_AU1500 | 617 | #ifdef CONFIG_SOC_AU1500 |
@@ -429,6 +671,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
429 | #define AU1500_GPIO_207 62 | 671 | #define AU1500_GPIO_207 62 |
430 | #define AU1500_GPIO_208_215 63 | 672 | #define AU1500_GPIO_208_215 63 |
431 | 673 | ||
674 | /* shortcuts */ | ||
675 | #define INTA AU1000_PCI_INTA | ||
676 | #define INTB AU1000_PCI_INTB | ||
677 | #define INTC AU1000_PCI_INTC | ||
678 | #define INTD AU1000_PCI_INTD | ||
679 | |||
432 | #define UART0_ADDR 0xB1100000 | 680 | #define UART0_ADDR 0xB1100000 |
433 | #define UART3_ADDR 0xB1400000 | 681 | #define UART3_ADDR 0xB1400000 |
434 | 682 | ||
@@ -440,7 +688,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
440 | #define AU1500_MAC0_ENABLE 0xB1520000 | 688 | #define AU1500_MAC0_ENABLE 0xB1520000 |
441 | #define AU1500_MAC1_ENABLE 0xB1520004 | 689 | #define AU1500_MAC1_ENABLE 0xB1520004 |
442 | #define NUM_ETH_INTERFACES 2 | 690 | #define NUM_ETH_INTERFACES 2 |
443 | #endif // CONFIG_SOC_AU1500 | 691 | #endif /* CONFIG_SOC_AU1500 */ |
444 | 692 | ||
445 | /* Au1100 */ | 693 | /* Au1100 */ |
446 | #ifdef CONFIG_SOC_AU1100 | 694 | #ifdef CONFIG_SOC_AU1100 |
@@ -485,6 +733,22 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
485 | #define AU1000_GPIO_13 45 | 733 | #define AU1000_GPIO_13 45 |
486 | #define AU1000_GPIO_14 46 | 734 | #define AU1000_GPIO_14 46 |
487 | #define AU1000_GPIO_15 47 | 735 | #define AU1000_GPIO_15 47 |
736 | #define AU1000_GPIO_16 48 | ||
737 | #define AU1000_GPIO_17 49 | ||
738 | #define AU1000_GPIO_18 50 | ||
739 | #define AU1000_GPIO_19 51 | ||
740 | #define AU1000_GPIO_20 52 | ||
741 | #define AU1000_GPIO_21 53 | ||
742 | #define AU1000_GPIO_22 54 | ||
743 | #define AU1000_GPIO_23 55 | ||
744 | #define AU1000_GPIO_24 56 | ||
745 | #define AU1000_GPIO_25 57 | ||
746 | #define AU1000_GPIO_26 58 | ||
747 | #define AU1000_GPIO_27 59 | ||
748 | #define AU1000_GPIO_28 60 | ||
749 | #define AU1000_GPIO_29 61 | ||
750 | #define AU1000_GPIO_30 62 | ||
751 | #define AU1000_GPIO_31 63 | ||
488 | 752 | ||
489 | #define UART0_ADDR 0xB1100000 | 753 | #define UART0_ADDR 0xB1100000 |
490 | #define UART1_ADDR 0xB1200000 | 754 | #define UART1_ADDR 0xB1200000 |
@@ -496,7 +760,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
496 | #define AU1100_ETH0_BASE 0xB0500000 | 760 | #define AU1100_ETH0_BASE 0xB0500000 |
497 | #define AU1100_MAC0_ENABLE 0xB0520000 | 761 | #define AU1100_MAC0_ENABLE 0xB0520000 |
498 | #define NUM_ETH_INTERFACES 1 | 762 | #define NUM_ETH_INTERFACES 1 |
499 | #endif // CONFIG_SOC_AU1100 | 763 | #endif /* CONFIG_SOC_AU1100 */ |
500 | 764 | ||
501 | #ifdef CONFIG_SOC_AU1550 | 765 | #ifdef CONFIG_SOC_AU1550 |
502 | #define AU1550_UART0_INT 0 | 766 | #define AU1550_UART0_INT 0 |
@@ -513,14 +777,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
513 | #define AU1550_PSC1_INT 11 | 777 | #define AU1550_PSC1_INT 11 |
514 | #define AU1550_PSC2_INT 12 | 778 | #define AU1550_PSC2_INT 12 |
515 | #define AU1550_PSC3_INT 13 | 779 | #define AU1550_PSC3_INT 13 |
516 | #define AU1550_TOY_INT 14 | 780 | #define AU1000_TOY_INT 14 |
517 | #define AU1550_TOY_MATCH0_INT 15 | 781 | #define AU1000_TOY_MATCH0_INT 15 |
518 | #define AU1550_TOY_MATCH1_INT 16 | 782 | #define AU1000_TOY_MATCH1_INT 16 |
519 | #define AU1550_TOY_MATCH2_INT 17 | 783 | #define AU1000_TOY_MATCH2_INT 17 |
520 | #define AU1550_RTC_INT 18 | 784 | #define AU1000_RTC_INT 18 |
521 | #define AU1550_RTC_MATCH0_INT 19 | 785 | #define AU1000_RTC_MATCH0_INT 19 |
522 | #define AU1550_RTC_MATCH1_INT 20 | 786 | #define AU1000_RTC_MATCH1_INT 20 |
523 | #define AU1550_RTC_MATCH2_INT 21 | 787 | #define AU1000_RTC_MATCH2_INT 21 |
524 | #define AU1550_NAND_INT 23 | 788 | #define AU1550_NAND_INT 23 |
525 | #define AU1550_USB_DEV_REQ_INT 24 | 789 | #define AU1550_USB_DEV_REQ_INT 24 |
526 | #define AU1550_USB_DEV_SUS_INT 25 | 790 | #define AU1550_USB_DEV_SUS_INT 25 |
@@ -563,6 +827,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
563 | #define AU1500_GPIO_207 62 | 827 | #define AU1500_GPIO_207 62 |
564 | #define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218 | 828 | #define AU1500_GPIO_208_218 63 // Logical or of GPIO208:218 |
565 | 829 | ||
830 | /* shortcuts */ | ||
831 | #define INTA AU1550_PCI_INTA | ||
832 | #define INTB AU1550_PCI_INTB | ||
833 | #define INTC AU1550_PCI_INTC | ||
834 | #define INTD AU1550_PCI_INTD | ||
835 | |||
566 | #define UART0_ADDR 0xB1100000 | 836 | #define UART0_ADDR 0xB1100000 |
567 | #define UART1_ADDR 0xB1200000 | 837 | #define UART1_ADDR 0xB1200000 |
568 | #define UART3_ADDR 0xB1400000 | 838 | #define UART3_ADDR 0xB1400000 |
@@ -575,7 +845,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
575 | #define AU1550_MAC0_ENABLE 0xB0520000 | 845 | #define AU1550_MAC0_ENABLE 0xB0520000 |
576 | #define AU1550_MAC1_ENABLE 0xB0520004 | 846 | #define AU1550_MAC1_ENABLE 0xB0520004 |
577 | #define NUM_ETH_INTERFACES 2 | 847 | #define NUM_ETH_INTERFACES 2 |
578 | #endif // CONFIG_SOC_AU1550 | 848 | #endif /* CONFIG_SOC_AU1550 */ |
579 | 849 | ||
580 | #ifdef CONFIG_SOC_AU1200 | 850 | #ifdef CONFIG_SOC_AU1200 |
581 | #define AU1200_UART0_INT 0 | 851 | #define AU1200_UART0_INT 0 |
@@ -592,14 +862,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
592 | #define AU1200_PSC1_INT 11 | 862 | #define AU1200_PSC1_INT 11 |
593 | #define AU1200_AES_INT 12 | 863 | #define AU1200_AES_INT 12 |
594 | #define AU1200_CAMERA_INT 13 | 864 | #define AU1200_CAMERA_INT 13 |
595 | #define AU1200_TOY_INT 14 | 865 | #define AU1000_TOY_INT 14 |
596 | #define AU1200_TOY_MATCH0_INT 15 | 866 | #define AU1000_TOY_MATCH0_INT 15 |
597 | #define AU1200_TOY_MATCH1_INT 16 | 867 | #define AU1000_TOY_MATCH1_INT 16 |
598 | #define AU1200_TOY_MATCH2_INT 17 | 868 | #define AU1000_TOY_MATCH2_INT 17 |
599 | #define AU1200_RTC_INT 18 | 869 | #define AU1000_RTC_INT 18 |
600 | #define AU1200_RTC_MATCH0_INT 19 | 870 | #define AU1000_RTC_MATCH0_INT 19 |
601 | #define AU1200_RTC_MATCH1_INT 20 | 871 | #define AU1000_RTC_MATCH1_INT 20 |
602 | #define AU1200_RTC_MATCH2_INT 21 | 872 | #define AU1000_RTC_MATCH2_INT 21 |
603 | #define AU1200_NAND_INT 23 | 873 | #define AU1200_NAND_INT 23 |
604 | #define AU1200_GPIO_204 24 | 874 | #define AU1200_GPIO_204 24 |
605 | #define AU1200_GPIO_205 25 | 875 | #define AU1200_GPIO_205 25 |
@@ -607,6 +877,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
607 | #define AU1200_GPIO_207 27 | 877 | #define AU1200_GPIO_207 27 |
608 | #define AU1200_GPIO_208_215 28 // Logical OR of 208:215 | 878 | #define AU1200_GPIO_208_215 28 // Logical OR of 208:215 |
609 | #define AU1200_USB_INT 29 | 879 | #define AU1200_USB_INT 29 |
880 | #define AU1000_USB_HOST_INT AU1200_USB_INT | ||
610 | #define AU1200_LCD_INT 30 | 881 | #define AU1200_LCD_INT 30 |
611 | #define AU1200_MAE_BOTH_INT 31 | 882 | #define AU1200_MAE_BOTH_INT 31 |
612 | #define AU1000_GPIO_0 32 | 883 | #define AU1000_GPIO_0 32 |
@@ -645,20 +916,36 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
645 | #define UART0_ADDR 0xB1100000 | 916 | #define UART0_ADDR 0xB1100000 |
646 | #define UART1_ADDR 0xB1200000 | 917 | #define UART1_ADDR 0xB1200000 |
647 | 918 | ||
648 | #define USB_OHCI_BASE 0x14020000 // phys addr for ioremap | 919 | #define USB_UOC_BASE 0x14020020 |
649 | #define USB_HOST_CONFIG 0xB4027ffc | 920 | #define USB_UOC_LEN 0x20 |
650 | 921 | #define USB_OHCI_BASE 0x14020100 | |
651 | // these are here for prototyping on au1550 (do not exist on au1200) | 922 | #define USB_OHCI_LEN 0x100 |
652 | #define AU1200_ETH0_BASE 0xB0500000 | 923 | #define USB_EHCI_BASE 0x14020200 |
653 | #define AU1200_ETH1_BASE 0xB0510000 | 924 | #define USB_EHCI_LEN 0x100 |
654 | #define AU1200_MAC0_ENABLE 0xB0520000 | 925 | #define USB_UDC_BASE 0x14022000 |
655 | #define AU1200_MAC1_ENABLE 0xB0520004 | 926 | #define USB_UDC_LEN 0x2000 |
656 | #define NUM_ETH_INTERFACES 2 | 927 | #define USB_MSR_BASE 0xB4020000 |
657 | #endif // CONFIG_SOC_AU1200 | 928 | #define USB_MSR_MCFG 4 |
929 | #define USBMSRMCFG_OMEMEN 0 | ||
930 | #define USBMSRMCFG_OBMEN 1 | ||
931 | #define USBMSRMCFG_EMEMEN 2 | ||
932 | #define USBMSRMCFG_EBMEN 3 | ||
933 | #define USBMSRMCFG_DMEMEN 4 | ||
934 | #define USBMSRMCFG_DBMEN 5 | ||
935 | #define USBMSRMCFG_GMEMEN 6 | ||
936 | #define USBMSRMCFG_OHCCLKEN 16 | ||
937 | #define USBMSRMCFG_EHCCLKEN 17 | ||
938 | #define USBMSRMCFG_UDCCLKEN 18 | ||
939 | #define USBMSRMCFG_PHYPLLEN 19 | ||
940 | #define USBMSRMCFG_RDCOMB 30 | ||
941 | #define USBMSRMCFG_PFEN 31 | ||
942 | |||
943 | #endif /* CONFIG_SOC_AU1200 */ | ||
658 | 944 | ||
659 | #define AU1000_LAST_INTC0_INT 31 | 945 | #define AU1000_LAST_INTC0_INT 31 |
946 | #define AU1000_LAST_INTC1_INT 63 | ||
660 | #define AU1000_MAX_INTR 63 | 947 | #define AU1000_MAX_INTR 63 |
661 | 948 | #define INTX 0xFF /* not valid */ | |
662 | 949 | ||
663 | /* Programmable Counters 0 and 1 */ | 950 | /* Programmable Counters 0 and 1 */ |
664 | #define SYS_BASE 0xB1900000 | 951 | #define SYS_BASE 0xB1900000 |
@@ -730,6 +1017,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
730 | #define I2S_CONTROL_D (1<<1) | 1017 | #define I2S_CONTROL_D (1<<1) |
731 | #define I2S_CONTROL_CE (1<<0) | 1018 | #define I2S_CONTROL_CE (1<<0) |
732 | 1019 | ||
1020 | #ifndef CONFIG_SOC_AU1200 | ||
1021 | |||
733 | /* USB Host Controller */ | 1022 | /* USB Host Controller */ |
734 | #define USB_OHCI_LEN 0x00100000 | 1023 | #define USB_OHCI_LEN 0x00100000 |
735 | 1024 | ||
@@ -775,6 +1064,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
775 | #define USBDEV_ENABLE (1<<1) | 1064 | #define USBDEV_ENABLE (1<<1) |
776 | #define USBDEV_CE (1<<0) | 1065 | #define USBDEV_CE (1<<0) |
777 | 1066 | ||
1067 | #endif /* !CONFIG_SOC_AU1200 */ | ||
1068 | |||
778 | /* Ethernet Controllers */ | 1069 | /* Ethernet Controllers */ |
779 | 1070 | ||
780 | /* 4 byte offsets from AU1000_ETH_BASE */ | 1071 | /* 4 byte offsets from AU1000_ETH_BASE */ |
@@ -1173,6 +1464,37 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
1173 | #define SYS_PF_PSC1_S1 (1 << 1) | 1464 | #define SYS_PF_PSC1_S1 (1 << 1) |
1174 | #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2)) | 1465 | #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2)) |
1175 | 1466 | ||
1467 | /* Au1200 Only */ | ||
1468 | #ifdef CONFIG_SOC_AU1200 | ||
1469 | #define SYS_PINFUNC_DMA (1<<31) | ||
1470 | #define SYS_PINFUNC_S0A (1<<30) | ||
1471 | #define SYS_PINFUNC_S1A (1<<29) | ||
1472 | #define SYS_PINFUNC_LP0 (1<<28) | ||
1473 | #define SYS_PINFUNC_LP1 (1<<27) | ||
1474 | #define SYS_PINFUNC_LD16 (1<<26) | ||
1475 | #define SYS_PINFUNC_LD8 (1<<25) | ||
1476 | #define SYS_PINFUNC_LD1 (1<<24) | ||
1477 | #define SYS_PINFUNC_LD0 (1<<23) | ||
1478 | #define SYS_PINFUNC_P1A (3<<21) | ||
1479 | #define SYS_PINFUNC_P1B (1<<20) | ||
1480 | #define SYS_PINFUNC_FS3 (1<<19) | ||
1481 | #define SYS_PINFUNC_P0A (3<<17) | ||
1482 | #define SYS_PINFUNC_CS (1<<16) | ||
1483 | #define SYS_PINFUNC_CIM (1<<15) | ||
1484 | #define SYS_PINFUNC_P1C (1<<14) | ||
1485 | #define SYS_PINFUNC_U1T (1<<12) | ||
1486 | #define SYS_PINFUNC_U1R (1<<11) | ||
1487 | #define SYS_PINFUNC_EX1 (1<<10) | ||
1488 | #define SYS_PINFUNC_EX0 (1<<9) | ||
1489 | #define SYS_PINFUNC_U0R (1<<8) | ||
1490 | #define SYS_PINFUNC_MC (1<<7) | ||
1491 | #define SYS_PINFUNC_S0B (1<<6) | ||
1492 | #define SYS_PINFUNC_S0C (1<<5) | ||
1493 | #define SYS_PINFUNC_P0B (1<<4) | ||
1494 | #define SYS_PINFUNC_U0T (1<<3) | ||
1495 | #define SYS_PINFUNC_S1B (1<<2) | ||
1496 | #endif | ||
1497 | |||
1176 | #define SYS_TRIOUTRD 0xB1900100 | 1498 | #define SYS_TRIOUTRD 0xB1900100 |
1177 | #define SYS_TRIOUTCLR 0xB1900100 | 1499 | #define SYS_TRIOUTCLR 0xB1900100 |
1178 | #define SYS_OUTPUTRD 0xB1900108 | 1500 | #define SYS_OUTPUTRD 0xB1900108 |
@@ -1239,6 +1561,12 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
1239 | #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT) | 1561 | #define SYS_CS_MI2_MASK (0x7<<SYS_CS_MI2_BIT) |
1240 | #define SYS_CS_DI2 (1<<16) | 1562 | #define SYS_CS_DI2 (1<<16) |
1241 | #define SYS_CS_CI2 (1<<15) | 1563 | #define SYS_CS_CI2 (1<<15) |
1564 | #ifdef CONFIG_SOC_AU1100 | ||
1565 | #define SYS_CS_ML_BIT 7 | ||
1566 | #define SYS_CS_ML_MASK (0x7<<SYS_CS_ML_BIT) | ||
1567 | #define SYS_CS_DL (1<<6) | ||
1568 | #define SYS_CS_CL (1<<5) | ||
1569 | #else | ||
1242 | #define SYS_CS_MUH_BIT 12 | 1570 | #define SYS_CS_MUH_BIT 12 |
1243 | #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT) | 1571 | #define SYS_CS_MUH_MASK (0x7<<SYS_CS_MUH_BIT) |
1244 | #define SYS_CS_DUH (1<<11) | 1572 | #define SYS_CS_DUH (1<<11) |
@@ -1247,6 +1575,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
1247 | #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT) | 1575 | #define SYS_CS_MUD_MASK (0x7<<SYS_CS_MUD_BIT) |
1248 | #define SYS_CS_DUD (1<<6) | 1576 | #define SYS_CS_DUD (1<<6) |
1249 | #define SYS_CS_CUD (1<<5) | 1577 | #define SYS_CS_CUD (1<<5) |
1578 | #endif | ||
1250 | #define SYS_CS_MIR_BIT 2 | 1579 | #define SYS_CS_MIR_BIT 2 |
1251 | #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT) | 1580 | #define SYS_CS_MIR_MASK (0x7<<SYS_CS_MIR_BIT) |
1252 | #define SYS_CS_DIR (1<<1) | 1581 | #define SYS_CS_DIR (1<<1) |
@@ -1300,7 +1629,6 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
1300 | #define SD1_XMIT_FIFO 0xB0680000 | 1629 | #define SD1_XMIT_FIFO 0xB0680000 |
1301 | #define SD1_RECV_FIFO 0xB0680004 | 1630 | #define SD1_RECV_FIFO 0xB0680004 |
1302 | 1631 | ||
1303 | |||
1304 | #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) | 1632 | #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) |
1305 | /* Au1500 PCI Controller */ | 1633 | /* Au1500 PCI Controller */ |
1306 | #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr | 1634 | #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr |
@@ -1363,36 +1691,77 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; | |||
1363 | _ctl_; }) | 1691 | _ctl_; }) |
1364 | 1692 | ||
1365 | 1693 | ||
1366 | #else /* Au1000 and Au1100 */ | 1694 | #else /* Au1000 and Au1100 and Au1200 */ |
1367 | 1695 | ||
1368 | /* don't allow any legacy ports probing */ | 1696 | /* don't allow any legacy ports probing */ |
1369 | #define IOPORT_RESOURCE_START 0x10000000; | 1697 | #define IOPORT_RESOURCE_START 0x10000000 |
1370 | #define IOPORT_RESOURCE_END 0xffffffff | 1698 | #define IOPORT_RESOURCE_END 0xffffffff |
1371 | #define IOMEM_RESOURCE_START 0x10000000 | 1699 | #define IOMEM_RESOURCE_START 0x10000000 |
1372 | #define IOMEM_RESOURCE_END 0xffffffff | 1700 | #define IOMEM_RESOURCE_END 0xffffffff |
1373 | 1701 | ||
1374 | #ifdef CONFIG_MIPS_PB1000 | ||
1375 | #define PCI_IO_START 0x10000000 | ||
1376 | #define PCI_IO_END 0x1000ffff | ||
1377 | #define PCI_MEM_START 0x18000000 | ||
1378 | #define PCI_MEM_END 0x18ffffff | ||
1379 | #define PCI_FIRST_DEVFN 0 | ||
1380 | #define PCI_LAST_DEVFN 1 | ||
1381 | #else | ||
1382 | /* no PCI bus controller */ | ||
1383 | #define PCI_IO_START 0 | 1702 | #define PCI_IO_START 0 |
1384 | #define PCI_IO_END 0 | 1703 | #define PCI_IO_END 0 |
1385 | #define PCI_MEM_START 0 | 1704 | #define PCI_MEM_START 0 |
1386 | #define PCI_MEM_END 0 | 1705 | #define PCI_MEM_END 0 |
1387 | #define PCI_FIRST_DEVFN 0 | 1706 | #define PCI_FIRST_DEVFN 0 |
1388 | #define PCI_LAST_DEVFN 0 | 1707 | #define PCI_LAST_DEVFN 0 |
1389 | #endif | ||
1390 | 1708 | ||
1391 | #endif | 1709 | #endif |
1392 | 1710 | ||
1711 | #ifndef _LANGUAGE_ASSEMBLY | ||
1712 | typedef volatile struct | ||
1713 | { | ||
1714 | /* 0x0000 */ u32 toytrim; | ||
1715 | /* 0x0004 */ u32 toywrite; | ||
1716 | /* 0x0008 */ u32 toymatch0; | ||
1717 | /* 0x000C */ u32 toymatch1; | ||
1718 | /* 0x0010 */ u32 toymatch2; | ||
1719 | /* 0x0014 */ u32 cntrctrl; | ||
1720 | /* 0x0018 */ u32 scratch0; | ||
1721 | /* 0x001C */ u32 scratch1; | ||
1722 | /* 0x0020 */ u32 freqctrl0; | ||
1723 | /* 0x0024 */ u32 freqctrl1; | ||
1724 | /* 0x0028 */ u32 clksrc; | ||
1725 | /* 0x002C */ u32 pinfunc; | ||
1726 | /* 0x0030 */ u32 reserved0; | ||
1727 | /* 0x0034 */ u32 wakemsk; | ||
1728 | /* 0x0038 */ u32 endian; | ||
1729 | /* 0x003C */ u32 powerctrl; | ||
1730 | /* 0x0040 */ u32 toyread; | ||
1731 | /* 0x0044 */ u32 rtctrim; | ||
1732 | /* 0x0048 */ u32 rtcwrite; | ||
1733 | /* 0x004C */ u32 rtcmatch0; | ||
1734 | /* 0x0050 */ u32 rtcmatch1; | ||
1735 | /* 0x0054 */ u32 rtcmatch2; | ||
1736 | /* 0x0058 */ u32 rtcread; | ||
1737 | /* 0x005C */ u32 wakesrc; | ||
1738 | /* 0x0060 */ u32 cpupll; | ||
1739 | /* 0x0064 */ u32 auxpll; | ||
1740 | /* 0x0068 */ u32 reserved1; | ||
1741 | /* 0x006C */ u32 reserved2; | ||
1742 | /* 0x0070 */ u32 reserved3; | ||
1743 | /* 0x0074 */ u32 reserved4; | ||
1744 | /* 0x0078 */ u32 slppwr; | ||
1745 | /* 0x007C */ u32 sleep; | ||
1746 | /* 0x0080 */ u32 reserved5[32]; | ||
1747 | /* 0x0100 */ u32 trioutrd; | ||
1748 | #define trioutclr trioutrd | ||
1749 | /* 0x0104 */ u32 reserved6; | ||
1750 | /* 0x0108 */ u32 outputrd; | ||
1751 | #define outputset outputrd | ||
1752 | /* 0x010C */ u32 outputclr; | ||
1753 | /* 0x0110 */ u32 pinstaterd; | ||
1754 | #define pininputen pinstaterd | ||
1755 | |||
1756 | } AU1X00_SYS; | ||
1757 | |||
1758 | static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE; | ||
1759 | |||
1760 | #endif | ||
1393 | /* Processor information base on prid. | 1761 | /* Processor information base on prid. |
1394 | * Copied from PowerPC. | 1762 | * Copied from PowerPC. |
1395 | */ | 1763 | */ |
1764 | #ifndef _LANGUAGE_ASSEMBLY | ||
1396 | struct cpu_spec { | 1765 | struct cpu_spec { |
1397 | /* CPU is matched via (PRID & prid_mask) == prid_value */ | 1766 | /* CPU is matched via (PRID & prid_mask) == prid_value */ |
1398 | unsigned int prid_mask; | 1767 | unsigned int prid_mask; |
@@ -1406,3 +1775,6 @@ struct cpu_spec { | |||
1406 | extern struct cpu_spec cpu_specs[]; | 1775 | extern struct cpu_spec cpu_specs[]; |
1407 | extern struct cpu_spec *cur_cpu_spec[]; | 1776 | extern struct cpu_spec *cur_cpu_spec[]; |
1408 | #endif | 1777 | #endif |
1778 | |||
1779 | #endif | ||
1780 | |||
diff --git a/include/asm-mips/mach-au1x00/au1xxx.h b/include/asm-mips/mach-au1x00/au1xxx.h new file mode 100644 index 000000000000..b7b46dd9b929 --- /dev/null +++ b/include/asm-mips/mach-au1x00/au1xxx.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License as published by the | ||
4 | * Free Software Foundation; either version 2 of the License, or (at your | ||
5 | * option) any later version. | ||
6 | * | ||
7 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
8 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
9 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
10 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
11 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
12 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
13 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
14 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
15 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
16 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | #ifndef _AU1XXX_H_ | ||
24 | #define _AU1XXX_H_ | ||
25 | |||
26 | #include <linux/config.h> | ||
27 | |||
28 | #include <asm/mach-au1x00/au1000.h> | ||
29 | |||
30 | #if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_DB1550) | ||
31 | #include <asm/mach-db1x00/db1x00.h> | ||
32 | |||
33 | #elif defined(CONFIG_MIPS_PB1550) | ||
34 | #include <asm/mach-pb1x00/pb1550.h> | ||
35 | |||
36 | #elif defined(CONFIG_MIPS_PB1200) | ||
37 | #include <asm/mach-pb1x00/pb1200.h> | ||
38 | |||
39 | #elif defined(CONFIG_MIPS_DB1200) | ||
40 | #include <asm/mach-db1x00/db1200.h> | ||
41 | |||
42 | #endif | ||
43 | |||
44 | #endif /* _AU1XXX_H_ */ | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h index d5eb88cd7d51..b327bcd3fee1 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_dbdma.h +++ b/include/asm-mips/mach-au1x00/au1xxx_dbdma.h | |||
@@ -45,7 +45,7 @@ | |||
45 | #define DDMA_GLOBAL_BASE 0xb4003000 | 45 | #define DDMA_GLOBAL_BASE 0xb4003000 |
46 | #define DDMA_CHANNEL_BASE 0xb4002000 | 46 | #define DDMA_CHANNEL_BASE 0xb4002000 |
47 | 47 | ||
48 | typedef struct dbdma_global { | 48 | typedef volatile struct dbdma_global { |
49 | u32 ddma_config; | 49 | u32 ddma_config; |
50 | u32 ddma_intstat; | 50 | u32 ddma_intstat; |
51 | u32 ddma_throttle; | 51 | u32 ddma_throttle; |
@@ -62,7 +62,7 @@ typedef struct dbdma_global { | |||
62 | 62 | ||
63 | /* The structure of a DMA Channel. | 63 | /* The structure of a DMA Channel. |
64 | */ | 64 | */ |
65 | typedef struct au1xxx_dma_channel { | 65 | typedef volatile struct au1xxx_dma_channel { |
66 | u32 ddma_cfg; /* See below */ | 66 | u32 ddma_cfg; /* See below */ |
67 | u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */ | 67 | u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */ |
68 | u32 ddma_statptr; /* word aligned pointer to status word */ | 68 | u32 ddma_statptr; /* word aligned pointer to status word */ |
@@ -98,7 +98,7 @@ typedef struct au1xxx_dma_channel { | |||
98 | /* "Standard" DDMA Descriptor. | 98 | /* "Standard" DDMA Descriptor. |
99 | * Must be 32-byte aligned. | 99 | * Must be 32-byte aligned. |
100 | */ | 100 | */ |
101 | typedef struct au1xxx_ddma_desc { | 101 | typedef volatile struct au1xxx_ddma_desc { |
102 | u32 dscr_cmd0; /* See below */ | 102 | u32 dscr_cmd0; /* See below */ |
103 | u32 dscr_cmd1; /* See below */ | 103 | u32 dscr_cmd1; /* See below */ |
104 | u32 dscr_source0; /* source phys address */ | 104 | u32 dscr_source0; /* source phys address */ |
@@ -107,6 +107,12 @@ typedef struct au1xxx_ddma_desc { | |||
107 | u32 dscr_dest1; /* See below */ | 107 | u32 dscr_dest1; /* See below */ |
108 | u32 dscr_stat; /* completion status */ | 108 | u32 dscr_stat; /* completion status */ |
109 | u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */ | 109 | u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */ |
110 | /* First 32bytes are HW specific!!! | ||
111 | Lets have some SW data following.. make sure its 32bytes | ||
112 | */ | ||
113 | u32 sw_status; | ||
114 | u32 sw_context; | ||
115 | u32 sw_reserved[6]; | ||
110 | } au1x_ddma_desc_t; | 116 | } au1x_ddma_desc_t; |
111 | 117 | ||
112 | #define DSCR_CMD0_V (1 << 31) /* Descriptor valid */ | 118 | #define DSCR_CMD0_V (1 << 31) /* Descriptor valid */ |
@@ -125,8 +131,11 @@ typedef struct au1xxx_ddma_desc { | |||
125 | #define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */ | 131 | #define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */ |
126 | #define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */ | 132 | #define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */ |
127 | 133 | ||
134 | #define SW_STATUS_INUSE (1<<0) | ||
135 | |||
128 | /* Command 0 device IDs. | 136 | /* Command 0 device IDs. |
129 | */ | 137 | */ |
138 | #ifdef CONFIG_SOC_AU1550 | ||
130 | #define DSCR_CMD0_UART0_TX 0 | 139 | #define DSCR_CMD0_UART0_TX 0 |
131 | #define DSCR_CMD0_UART0_RX 1 | 140 | #define DSCR_CMD0_UART0_RX 1 |
132 | #define DSCR_CMD0_UART3_TX 2 | 141 | #define DSCR_CMD0_UART3_TX 2 |
@@ -155,9 +164,45 @@ typedef struct au1xxx_ddma_desc { | |||
155 | #define DSCR_CMD0_MAC0_TX 25 | 164 | #define DSCR_CMD0_MAC0_TX 25 |
156 | #define DSCR_CMD0_MAC1_RX 26 | 165 | #define DSCR_CMD0_MAC1_RX 26 |
157 | #define DSCR_CMD0_MAC1_TX 27 | 166 | #define DSCR_CMD0_MAC1_TX 27 |
167 | #endif /* CONFIG_SOC_AU1550 */ | ||
168 | |||
169 | #ifdef CONFIG_SOC_AU1200 | ||
170 | #define DSCR_CMD0_UART0_TX 0 | ||
171 | #define DSCR_CMD0_UART0_RX 1 | ||
172 | #define DSCR_CMD0_UART1_TX 2 | ||
173 | #define DSCR_CMD0_UART1_RX 3 | ||
174 | #define DSCR_CMD0_DMA_REQ0 4 | ||
175 | #define DSCR_CMD0_DMA_REQ1 5 | ||
176 | #define DSCR_CMD0_MAE_BE 6 | ||
177 | #define DSCR_CMD0_MAE_FE 7 | ||
178 | #define DSCR_CMD0_SDMS_TX0 8 | ||
179 | #define DSCR_CMD0_SDMS_RX0 9 | ||
180 | #define DSCR_CMD0_SDMS_TX1 10 | ||
181 | #define DSCR_CMD0_SDMS_RX1 11 | ||
182 | #define DSCR_CMD0_AES_TX 13 | ||
183 | #define DSCR_CMD0_AES_RX 12 | ||
184 | #define DSCR_CMD0_PSC0_TX 14 | ||
185 | #define DSCR_CMD0_PSC0_RX 15 | ||
186 | #define DSCR_CMD0_PSC1_TX 16 | ||
187 | #define DSCR_CMD0_PSC1_RX 17 | ||
188 | #define DSCR_CMD0_CIM_RXA 18 | ||
189 | #define DSCR_CMD0_CIM_RXB 19 | ||
190 | #define DSCR_CMD0_CIM_RXC 20 | ||
191 | #define DSCR_CMD0_MAE_BOTH 21 | ||
192 | #define DSCR_CMD0_LCD 22 | ||
193 | #define DSCR_CMD0_NAND_FLASH 23 | ||
194 | #define DSCR_CMD0_PSC0_SYNC 24 | ||
195 | #define DSCR_CMD0_PSC1_SYNC 25 | ||
196 | #define DSCR_CMD0_CIM_SYNC 26 | ||
197 | #endif /* CONFIG_SOC_AU1200 */ | ||
198 | |||
158 | #define DSCR_CMD0_THROTTLE 30 | 199 | #define DSCR_CMD0_THROTTLE 30 |
159 | #define DSCR_CMD0_ALWAYS 31 | 200 | #define DSCR_CMD0_ALWAYS 31 |
160 | #define DSCR_NDEV_IDS 32 | 201 | #define DSCR_NDEV_IDS 32 |
202 | /* THis macro is used to find/create custom device types */ | ||
203 | #define DSCR_DEV2CUSTOM_ID(x,d) (((((x)&0xFFFF)<<8)|0x32000000)|((d)&0xFF)) | ||
204 | #define DSCR_CUSTOM2DEV_ID(x) ((x)&0xFF) | ||
205 | |||
161 | 206 | ||
162 | #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25) | 207 | #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25) |
163 | #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20) | 208 | #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20) |
@@ -246,6 +291,43 @@ typedef struct au1xxx_ddma_desc { | |||
246 | */ | 291 | */ |
247 | #define NUM_DBDMA_CHANS 16 | 292 | #define NUM_DBDMA_CHANS 16 |
248 | 293 | ||
294 | /* | ||
295 | * Ddma API definitions | ||
296 | * FIXME: may not fit to this header file | ||
297 | */ | ||
298 | typedef struct dbdma_device_table { | ||
299 | u32 dev_id; | ||
300 | u32 dev_flags; | ||
301 | u32 dev_tsize; | ||
302 | u32 dev_devwidth; | ||
303 | u32 dev_physaddr; /* If FIFO */ | ||
304 | u32 dev_intlevel; | ||
305 | u32 dev_intpolarity; | ||
306 | } dbdev_tab_t; | ||
307 | |||
308 | |||
309 | typedef struct dbdma_chan_config { | ||
310 | spinlock_t lock; | ||
311 | |||
312 | u32 chan_flags; | ||
313 | u32 chan_index; | ||
314 | dbdev_tab_t *chan_src; | ||
315 | dbdev_tab_t *chan_dest; | ||
316 | au1x_dma_chan_t *chan_ptr; | ||
317 | au1x_ddma_desc_t *chan_desc_base; | ||
318 | au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr; | ||
319 | void *chan_callparam; | ||
320 | void (*chan_callback)(int, void *, struct pt_regs *); | ||
321 | } chan_tab_t; | ||
322 | |||
323 | #define DEV_FLAGS_INUSE (1 << 0) | ||
324 | #define DEV_FLAGS_ANYUSE (1 << 1) | ||
325 | #define DEV_FLAGS_OUT (1 << 2) | ||
326 | #define DEV_FLAGS_IN (1 << 3) | ||
327 | #define DEV_FLAGS_BURSTABLE (1 << 4) | ||
328 | #define DEV_FLAGS_SYNC (1 << 5) | ||
329 | /* end Ddma API definitions */ | ||
330 | |||
249 | /* External functions for drivers to use. | 331 | /* External functions for drivers to use. |
250 | */ | 332 | */ |
251 | /* Use this to allocate a dbdma channel. The device ids are one of the | 333 | /* Use this to allocate a dbdma channel. The device ids are one of the |
@@ -258,18 +340,6 @@ u32 au1xxx_dbdma_chan_alloc(u32 srcid, u32 destid, | |||
258 | 340 | ||
259 | #define DBDMA_MEM_CHAN DSCR_CMD0_ALWAYS | 341 | #define DBDMA_MEM_CHAN DSCR_CMD0_ALWAYS |
260 | 342 | ||
261 | /* ACK! These should be in a board specific description file. | ||
262 | */ | ||
263 | #ifdef CONFIG_MIPS_PB1550 | ||
264 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
265 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
266 | #endif | ||
267 | #ifdef CONFIG_MIPS_DB1550 | ||
268 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
269 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
270 | #endif | ||
271 | |||
272 | |||
273 | /* Set the device width of a in/out fifo. | 343 | /* Set the device width of a in/out fifo. |
274 | */ | 344 | */ |
275 | u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits); | 345 | u32 au1xxx_dbdma_set_devwidth(u32 chanid, int bits); |
@@ -280,8 +350,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid, int entries); | |||
280 | 350 | ||
281 | /* Put buffers on source/destination descriptors. | 351 | /* Put buffers on source/destination descriptors. |
282 | */ | 352 | */ |
283 | u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes); | 353 | u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags); |
284 | u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes); | 354 | u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags); |
285 | 355 | ||
286 | /* Get a buffer from the destination descriptor. | 356 | /* Get a buffer from the destination descriptor. |
287 | */ | 357 | */ |
@@ -295,5 +365,29 @@ u32 au1xxx_get_dma_residue(u32 chanid); | |||
295 | void au1xxx_dbdma_chan_free(u32 chanid); | 365 | void au1xxx_dbdma_chan_free(u32 chanid); |
296 | void au1xxx_dbdma_dump(u32 chanid); | 366 | void au1xxx_dbdma_dump(u32 chanid); |
297 | 367 | ||
368 | u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr ); | ||
369 | |||
370 | u32 au1xxx_ddma_add_device( dbdev_tab_t *dev ); | ||
371 | void * au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp); | ||
372 | |||
373 | /* | ||
374 | Some compatibilty macros -- | ||
375 | Needed to make changes to API without breaking existing drivers | ||
376 | */ | ||
377 | #define au1xxx_dbdma_put_source(chanid,buf,nbytes)_au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE) | ||
378 | #define au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags) | ||
379 | #define put_source_flags(chanid,buf,nbytes,flags) au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags) | ||
380 | |||
381 | |||
382 | #define au1xxx_dbdma_put_dest(chanid,buf,nbytes) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE) | ||
383 | #define au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags) | ||
384 | #define put_dest_flags(chanid,buf,nbytes,flags) au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags) | ||
385 | |||
386 | /* | ||
387 | * Flags for the put_source/put_dest functions. | ||
388 | */ | ||
389 | #define DDMA_FLAGS_IE (1<<0) | ||
390 | #define DDMA_FLAGS_NOIE (1<<1) | ||
391 | |||
298 | #endif /* _LANGUAGE_ASSEMBLY */ | 392 | #endif /* _LANGUAGE_ASSEMBLY */ |
299 | #endif /* _AU1000_DBDMA_H_ */ | 393 | #endif /* _AU1000_DBDMA_H_ */ |
diff --git a/include/asm-mips/mach-au1x00/au1xxx_gpio.h b/include/asm-mips/mach-au1x00/au1xxx_gpio.h new file mode 100644 index 000000000000..27911e054ffc --- /dev/null +++ b/include/asm-mips/mach-au1x00/au1xxx_gpio.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __AU1XXX_GPIO_H | ||
2 | #define __AU1XXX_GPIO_H | ||
3 | |||
4 | void au1xxx_gpio1_set_inputs(void); | ||
5 | void au1xxx_gpio_tristate(int signal); | ||
6 | void au1xxx_gpio_write(int signal, int value); | ||
7 | int au1xxx_gpio_read(int signal); | ||
8 | |||
9 | typedef volatile struct | ||
10 | { | ||
11 | u32 dir; | ||
12 | u32 reserved; | ||
13 | u32 output; | ||
14 | u32 pinstate; | ||
15 | u32 inten; | ||
16 | u32 enable; | ||
17 | |||
18 | } AU1X00_GPIO2; | ||
19 | |||
20 | #endif //__AU1XXX_GPIO_H | ||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h new file mode 100644 index 000000000000..33d275c3b84c --- /dev/null +++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h | |||
@@ -0,0 +1,301 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-au1x00/au1xxx_ide.h version 01.30.00 Aug. 02 2005 | ||
3 | * | ||
4 | * BRIEF MODULE DESCRIPTION | ||
5 | * AMD Alchemy Au1xxx IDE interface routines over the Static Bus | ||
6 | * | ||
7 | * Copyright (c) 2003-2005 AMD, Personal Connectivity Solutions | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it under | ||
10 | * the terms of the GNU General Public License as published by the Free Software | ||
11 | * Foundation; either version 2 of the License, or (at your option) any later | ||
12 | * version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
15 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR | ||
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
23 | * POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along with | ||
26 | * this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | * | ||
29 | * Note: for more information, please refer "AMD Alchemy Au1200/Au1550 IDE | ||
30 | * Interface and Linux Device Driver" Application Note. | ||
31 | */ | ||
32 | #include <linux/config.h> | ||
33 | |||
34 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
35 | #define DMA_WAIT_TIMEOUT 100 | ||
36 | #define NUM_DESCRIPTORS PRD_ENTRIES | ||
37 | #else /* CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA */ | ||
38 | #define NUM_DESCRIPTORS 2 | ||
39 | #endif | ||
40 | |||
41 | #ifndef AU1XXX_ATA_RQSIZE | ||
42 | #define AU1XXX_ATA_RQSIZE 128 | ||
43 | #endif | ||
44 | |||
45 | /* Disable Burstable-Support for DBDMA */ | ||
46 | #ifndef CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON | ||
47 | #define CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON 0 | ||
48 | #endif | ||
49 | |||
50 | #ifdef CONFIG_PM | ||
51 | /* | ||
52 | * This will enable the device to be powered up when write() or read() | ||
53 | * is called. If this is not defined, the driver will return -EBUSY. | ||
54 | */ | ||
55 | #define WAKE_ON_ACCESS 1 | ||
56 | |||
57 | typedef struct | ||
58 | { | ||
59 | spinlock_t lock; /* Used to block on state transitions */ | ||
60 | au1xxx_power_dev_t *dev; /* Power Managers device structure */ | ||
61 | unsigned stopped; /* USed to signaling device is stopped */ | ||
62 | } pm_state; | ||
63 | #endif | ||
64 | |||
65 | |||
66 | typedef struct | ||
67 | { | ||
68 | u32 tx_dev_id, rx_dev_id, target_dev_id; | ||
69 | u32 tx_chan, rx_chan; | ||
70 | void *tx_desc_head, *rx_desc_head; | ||
71 | ide_hwif_t *hwif; | ||
72 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
73 | ide_drive_t *drive; | ||
74 | u8 white_list, black_list; | ||
75 | struct dbdma_cmd *dma_table_cpu; | ||
76 | dma_addr_t dma_table_dma; | ||
77 | struct scatterlist *sg_table; | ||
78 | int sg_nents; | ||
79 | int sg_dma_direction; | ||
80 | #endif | ||
81 | struct device *dev; | ||
82 | int irq; | ||
83 | u32 regbase; | ||
84 | #ifdef CONFIG_PM | ||
85 | pm_state pm; | ||
86 | #endif | ||
87 | } _auide_hwif; | ||
88 | |||
89 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
90 | struct drive_list_entry { | ||
91 | const char * id_model; | ||
92 | const char * id_firmware; | ||
93 | }; | ||
94 | |||
95 | /* HD white list */ | ||
96 | static const struct drive_list_entry dma_white_list [] = { | ||
97 | /* | ||
98 | * Hitachi | ||
99 | */ | ||
100 | { "HITACHI_DK14FA-20" , "ALL" }, | ||
101 | { "HTS726060M9AT00" , "ALL" }, | ||
102 | /* | ||
103 | * Maxtor | ||
104 | */ | ||
105 | { "Maxtor 6E040L0" , "ALL" }, | ||
106 | { "Maxtor 6Y080P0" , "ALL" }, | ||
107 | { "Maxtor 6Y160P0" , "ALL" }, | ||
108 | /* | ||
109 | * Seagate | ||
110 | */ | ||
111 | { "ST3120026A" , "ALL" }, | ||
112 | { "ST320014A" , "ALL" }, | ||
113 | { "ST94011A" , "ALL" }, | ||
114 | { "ST340016A" , "ALL" }, | ||
115 | /* | ||
116 | * Western Digital | ||
117 | */ | ||
118 | { "WDC WD400UE-00HCT0" , "ALL" }, | ||
119 | { "WDC WD400JB-00JJC0" , "ALL" }, | ||
120 | { NULL , NULL } | ||
121 | }; | ||
122 | |||
123 | /* HD black list */ | ||
124 | static const struct drive_list_entry dma_black_list [] = { | ||
125 | /* | ||
126 | * Western Digital | ||
127 | */ | ||
128 | { "WDC WD100EB-00CGH0" , "ALL" }, | ||
129 | { "WDC WD200BB-00AUA1" , "ALL" }, | ||
130 | { "WDC AC24300L" , "ALL" }, | ||
131 | { NULL , NULL } | ||
132 | }; | ||
133 | #endif | ||
134 | |||
135 | /* function prototyping */ | ||
136 | u8 auide_inb(unsigned long port); | ||
137 | u16 auide_inw(unsigned long port); | ||
138 | u32 auide_inl(unsigned long port); | ||
139 | void auide_insw(unsigned long port, void *addr, u32 count); | ||
140 | void auide_insl(unsigned long port, void *addr, u32 count); | ||
141 | void auide_outb(u8 addr, unsigned long port); | ||
142 | void auide_outbsync(ide_drive_t *drive, u8 addr, unsigned long port); | ||
143 | void auide_outw(u16 addr, unsigned long port); | ||
144 | void auide_outl(u32 addr, unsigned long port); | ||
145 | void auide_outsw(unsigned long port, void *addr, u32 count); | ||
146 | void auide_outsl(unsigned long port, void *addr, u32 count); | ||
147 | static void auide_tune_drive(ide_drive_t *drive, byte pio); | ||
148 | static int auide_tune_chipset (ide_drive_t *drive, u8 speed); | ||
149 | static int auide_ddma_init( _auide_hwif *auide ); | ||
150 | static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif); | ||
151 | int __init auide_probe(void); | ||
152 | |||
153 | #ifdef CONFIG_PM | ||
154 | int au1200ide_pm_callback( au1xxx_power_dev_t *dev, | ||
155 | au1xxx_request_t request, void *data); | ||
156 | static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev ); | ||
157 | static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev ); | ||
158 | static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev ); | ||
159 | static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev ); | ||
160 | static int au1xxxide_pm_access( au1xxx_power_dev_t *dev ); | ||
161 | static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev ); | ||
162 | static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev ); | ||
163 | #endif | ||
164 | |||
165 | |||
166 | /* | ||
167 | * Multi-Word DMA + DbDMA functions | ||
168 | */ | ||
169 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
170 | |||
171 | static int in_drive_list(struct hd_driveid *id, | ||
172 | const struct drive_list_entry *drive_table); | ||
173 | static int auide_build_sglist(ide_drive_t *drive, struct request *rq); | ||
174 | static int auide_build_dmatable(ide_drive_t *drive); | ||
175 | static int auide_dma_end(ide_drive_t *drive); | ||
176 | static void auide_dma_start(ide_drive_t *drive ); | ||
177 | ide_startstop_t auide_dma_intr (ide_drive_t *drive); | ||
178 | static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command); | ||
179 | static int auide_dma_setup(ide_drive_t *drive); | ||
180 | static int auide_dma_check(ide_drive_t *drive); | ||
181 | static int auide_dma_test_irq(ide_drive_t *drive); | ||
182 | static int auide_dma_host_off(ide_drive_t *drive); | ||
183 | static int auide_dma_host_on(ide_drive_t *drive); | ||
184 | static int auide_dma_lostirq(ide_drive_t *drive); | ||
185 | static int auide_dma_on(ide_drive_t *drive); | ||
186 | static void auide_ddma_tx_callback(int irq, void *param, | ||
187 | struct pt_regs *regs); | ||
188 | static void auide_ddma_rx_callback(int irq, void *param, | ||
189 | struct pt_regs *regs); | ||
190 | static int auide_dma_off_quietly(ide_drive_t *drive); | ||
191 | static int auide_dma_timeout(ide_drive_t *drive); | ||
192 | |||
193 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ | ||
194 | |||
195 | /******************************************************************************* | ||
196 | * PIO Mode timing calculation : * | ||
197 | * * | ||
198 | * Static Bus Spec ATA Spec * | ||
199 | * Tcsoe = t1 * | ||
200 | * Toecs = t9 * | ||
201 | * Twcs = t9 * | ||
202 | * Tcsh = t2i | t2 * | ||
203 | * Tcsoff = t2i | t2 * | ||
204 | * Twp = t2 * | ||
205 | * Tcsw = t1 * | ||
206 | * Tpm = 0 * | ||
207 | * Ta = t1+t2 * | ||
208 | *******************************************************************************/ | ||
209 | |||
210 | #define TCSOE_MASK (0x07<<29) | ||
211 | #define TOECS_MASK (0x07<<26) | ||
212 | #define TWCS_MASK (0x07<<28) | ||
213 | #define TCSH_MASK (0x0F<<24) | ||
214 | #define TCSOFF_MASK (0x07<<20) | ||
215 | #define TWP_MASK (0x3F<<14) | ||
216 | #define TCSW_MASK (0x0F<<10) | ||
217 | #define TPM_MASK (0x0F<<6) | ||
218 | #define TA_MASK (0x3F<<0) | ||
219 | #define TS_MASK (1<<8) | ||
220 | |||
221 | /* Timing parameters PIO mode 0 */ | ||
222 | #define SBC_IDE_PIO0_TCSOE (0x04<<29) | ||
223 | #define SBC_IDE_PIO0_TOECS (0x01<<26) | ||
224 | #define SBC_IDE_PIO0_TWCS (0x02<<28) | ||
225 | #define SBC_IDE_PIO0_TCSH (0x08<<24) | ||
226 | #define SBC_IDE_PIO0_TCSOFF (0x07<<20) | ||
227 | #define SBC_IDE_PIO0_TWP (0x10<<14) | ||
228 | #define SBC_IDE_PIO0_TCSW (0x04<<10) | ||
229 | #define SBC_IDE_PIO0_TPM (0x0<<6) | ||
230 | #define SBC_IDE_PIO0_TA (0x15<<0) | ||
231 | /* Timing parameters PIO mode 1 */ | ||
232 | #define SBC_IDE_PIO1_TCSOE (0x03<<29) | ||
233 | #define SBC_IDE_PIO1_TOECS (0x01<<26) | ||
234 | #define SBC_IDE_PIO1_TWCS (0x01<<28) | ||
235 | #define SBC_IDE_PIO1_TCSH (0x06<<24) | ||
236 | #define SBC_IDE_PIO1_TCSOFF (0x06<<20) | ||
237 | #define SBC_IDE_PIO1_TWP (0x08<<14) | ||
238 | #define SBC_IDE_PIO1_TCSW (0x03<<10) | ||
239 | #define SBC_IDE_PIO1_TPM (0x00<<6) | ||
240 | #define SBC_IDE_PIO1_TA (0x0B<<0) | ||
241 | /* Timing parameters PIO mode 2 */ | ||
242 | #define SBC_IDE_PIO2_TCSOE (0x05<<29) | ||
243 | #define SBC_IDE_PIO2_TOECS (0x01<<26) | ||
244 | #define SBC_IDE_PIO2_TWCS (0x01<<28) | ||
245 | #define SBC_IDE_PIO2_TCSH (0x07<<24) | ||
246 | #define SBC_IDE_PIO2_TCSOFF (0x07<<20) | ||
247 | #define SBC_IDE_PIO2_TWP (0x1F<<14) | ||
248 | #define SBC_IDE_PIO2_TCSW (0x05<<10) | ||
249 | #define SBC_IDE_PIO2_TPM (0x00<<6) | ||
250 | #define SBC_IDE_PIO2_TA (0x22<<0) | ||
251 | /* Timing parameters PIO mode 3 */ | ||
252 | #define SBC_IDE_PIO3_TCSOE (0x05<<29) | ||
253 | #define SBC_IDE_PIO3_TOECS (0x01<<26) | ||
254 | #define SBC_IDE_PIO3_TWCS (0x01<<28) | ||
255 | #define SBC_IDE_PIO3_TCSH (0x0D<<24) | ||
256 | #define SBC_IDE_PIO3_TCSOFF (0x0D<<20) | ||
257 | #define SBC_IDE_PIO3_TWP (0x15<<14) | ||
258 | #define SBC_IDE_PIO3_TCSW (0x05<<10) | ||
259 | #define SBC_IDE_PIO3_TPM (0x00<<6) | ||
260 | #define SBC_IDE_PIO3_TA (0x1A<<0) | ||
261 | /* Timing parameters PIO mode 4 */ | ||
262 | #define SBC_IDE_PIO4_TCSOE (0x04<<29) | ||
263 | #define SBC_IDE_PIO4_TOECS (0x01<<26) | ||
264 | #define SBC_IDE_PIO4_TWCS (0x01<<28) | ||
265 | #define SBC_IDE_PIO4_TCSH (0x04<<24) | ||
266 | #define SBC_IDE_PIO4_TCSOFF (0x04<<20) | ||
267 | #define SBC_IDE_PIO4_TWP (0x0D<<14) | ||
268 | #define SBC_IDE_PIO4_TCSW (0x03<<10) | ||
269 | #define SBC_IDE_PIO4_TPM (0x00<<6) | ||
270 | #define SBC_IDE_PIO4_TA (0x12<<0) | ||
271 | /* Timing parameters MDMA mode 0 */ | ||
272 | #define SBC_IDE_MDMA0_TCSOE (0x03<<29) | ||
273 | #define SBC_IDE_MDMA0_TOECS (0x01<<26) | ||
274 | #define SBC_IDE_MDMA0_TWCS (0x01<<28) | ||
275 | #define SBC_IDE_MDMA0_TCSH (0x07<<24) | ||
276 | #define SBC_IDE_MDMA0_TCSOFF (0x07<<20) | ||
277 | #define SBC_IDE_MDMA0_TWP (0x0C<<14) | ||
278 | #define SBC_IDE_MDMA0_TCSW (0x03<<10) | ||
279 | #define SBC_IDE_MDMA0_TPM (0x00<<6) | ||
280 | #define SBC_IDE_MDMA0_TA (0x0F<<0) | ||
281 | /* Timing parameters MDMA mode 1 */ | ||
282 | #define SBC_IDE_MDMA1_TCSOE (0x05<<29) | ||
283 | #define SBC_IDE_MDMA1_TOECS (0x01<<26) | ||
284 | #define SBC_IDE_MDMA1_TWCS (0x01<<28) | ||
285 | #define SBC_IDE_MDMA1_TCSH (0x05<<24) | ||
286 | #define SBC_IDE_MDMA1_TCSOFF (0x05<<20) | ||
287 | #define SBC_IDE_MDMA1_TWP (0x0F<<14) | ||
288 | #define SBC_IDE_MDMA1_TCSW (0x05<<10) | ||
289 | #define SBC_IDE_MDMA1_TPM (0x00<<6) | ||
290 | #define SBC_IDE_MDMA1_TA (0x15<<0) | ||
291 | /* Timing parameters MDMA mode 2 */ | ||
292 | #define SBC_IDE_MDMA2_TCSOE (0x04<<29) | ||
293 | #define SBC_IDE_MDMA2_TOECS (0x01<<26) | ||
294 | #define SBC_IDE_MDMA2_TWCS (0x01<<28) | ||
295 | #define SBC_IDE_MDMA2_TCSH (0x04<<24) | ||
296 | #define SBC_IDE_MDMA2_TCSOFF (0x04<<20) | ||
297 | #define SBC_IDE_MDMA2_TWP (0x0D<<14) | ||
298 | #define SBC_IDE_MDMA2_TCSW (0x04<<10) | ||
299 | #define SBC_IDE_MDMA2_TPM (0x00<<6) | ||
300 | #define SBC_IDE_MDMA2_TA (0x12<<0) | ||
301 | |||
diff --git a/include/asm-mips/mach-au1x00/au1xxx_psc.h b/include/asm-mips/mach-au1x00/au1xxx_psc.h index 283519dfdec4..8e5fb3c7da4d 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_psc.h +++ b/include/asm-mips/mach-au1x00/au1xxx_psc.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #ifndef _AU1000_PSC_H_ | 33 | #ifndef _AU1000_PSC_H_ |
34 | #define _AU1000_PSC_H_ | 34 | #define _AU1000_PSC_H_ |
35 | 35 | ||
36 | #include <linux/config.h> | ||
37 | |||
36 | /* The PSC base addresses. */ | 38 | /* The PSC base addresses. */ |
37 | #ifdef CONFIG_SOC_AU1550 | 39 | #ifdef CONFIG_SOC_AU1550 |
38 | #define PSC0_BASE_ADDR 0xb1a00000 | 40 | #define PSC0_BASE_ADDR 0xb1a00000 |
diff --git a/include/asm-mips/mach-au1x00/ioremap.h b/include/asm-mips/mach-au1x00/ioremap.h new file mode 100644 index 000000000000..d3ec6274575a --- /dev/null +++ b/include/asm-mips/mach-au1x00/ioremap.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-au1x00/ioremap.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_AU1X00_IOREMAP_H | ||
10 | #define __ASM_MACH_AU1X00_IOREMAP_H | ||
11 | |||
12 | #include <linux/config.h> | ||
13 | #include <linux/types.h> | ||
14 | |||
15 | #ifdef CONFIG_64BIT_PHYS_ADDR | ||
16 | extern phys_t __fixup_bigphys_addr(phys_t, phys_t); | ||
17 | #else | ||
18 | static inline phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | #endif | ||
23 | |||
24 | /* | ||
25 | * Allow physical addresses to be fixed up to help 36-bit peripherals. | ||
26 | */ | ||
27 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
28 | { | ||
29 | return __fixup_bigphys_addr(phys_addr, size); | ||
30 | } | ||
31 | |||
32 | #endif /* __ASM_MACH_AU1X00_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-db1x00/db1200.h b/include/asm-mips/mach-db1x00/db1200.h new file mode 100644 index 000000000000..5d894376fc1a --- /dev/null +++ b/include/asm-mips/mach-db1x00/db1200.h | |||
@@ -0,0 +1,224 @@ | |||
1 | /* | ||
2 | * AMD Alchemy DB1200 Referrence Board | ||
3 | * Board Registers defines. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * | ||
23 | */ | ||
24 | #ifndef __ASM_DB1200_H | ||
25 | #define __ASM_DB1200_H | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | |||
29 | // This is defined in au1000.h with bogus value | ||
30 | #undef AU1X00_EXTERNAL_INT | ||
31 | |||
32 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
33 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
34 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX | ||
35 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX | ||
36 | |||
37 | /* SPI and SMB are muxed on the Pb1200 board. | ||
38 | Refer to board documentation. | ||
39 | */ | ||
40 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
41 | #define SMBUS_PSC_BASE PSC0_BASE_ADDR | ||
42 | /* AC97 and I2S are muxed on the Pb1200 board. | ||
43 | Refer to board documentation. | ||
44 | */ | ||
45 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
46 | #define I2S_PSC_BASE PSC1_BASE_ADDR | ||
47 | |||
48 | #define BCSR_KSEG1_ADDR 0xB9800000 | ||
49 | |||
50 | typedef volatile struct | ||
51 | { | ||
52 | /*00*/ u16 whoami; | ||
53 | u16 reserved0; | ||
54 | /*04*/ u16 status; | ||
55 | u16 reserved1; | ||
56 | /*08*/ u16 switches; | ||
57 | u16 reserved2; | ||
58 | /*0C*/ u16 resets; | ||
59 | u16 reserved3; | ||
60 | |||
61 | /*10*/ u16 pcmcia; | ||
62 | u16 reserved4; | ||
63 | /*14*/ u16 board; | ||
64 | u16 reserved5; | ||
65 | /*18*/ u16 disk_leds; | ||
66 | u16 reserved6; | ||
67 | /*1C*/ u16 system; | ||
68 | u16 reserved7; | ||
69 | |||
70 | /*20*/ u16 intclr; | ||
71 | u16 reserved8; | ||
72 | /*24*/ u16 intset; | ||
73 | u16 reserved9; | ||
74 | /*28*/ u16 intclr_mask; | ||
75 | u16 reserved10; | ||
76 | /*2C*/ u16 intset_mask; | ||
77 | u16 reserved11; | ||
78 | |||
79 | /*30*/ u16 sig_status; | ||
80 | u16 reserved12; | ||
81 | /*34*/ u16 int_status; | ||
82 | u16 reserved13; | ||
83 | /*38*/ u16 reserved14; | ||
84 | u16 reserved15; | ||
85 | /*3C*/ u16 reserved16; | ||
86 | u16 reserved17; | ||
87 | |||
88 | } BCSR; | ||
89 | |||
90 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | ||
91 | |||
92 | /* | ||
93 | * Register bit definitions for the BCSRs | ||
94 | */ | ||
95 | #define BCSR_WHOAMI_DCID 0x000F | ||
96 | #define BCSR_WHOAMI_CPLD 0x00F0 | ||
97 | #define BCSR_WHOAMI_BOARD 0x0F00 | ||
98 | |||
99 | #define BCSR_STATUS_PCMCIA0VS 0x0003 | ||
100 | #define BCSR_STATUS_PCMCIA1VS 0x000C | ||
101 | #define BCSR_STATUS_SWAPBOOT 0x0040 | ||
102 | #define BCSR_STATUS_FLASHBUSY 0x0100 | ||
103 | #define BCSR_STATUS_IDECBLID 0x0200 | ||
104 | #define BCSR_STATUS_SD0WP 0x0400 | ||
105 | #define BCSR_STATUS_U0RXD 0x1000 | ||
106 | #define BCSR_STATUS_U1RXD 0x2000 | ||
107 | |||
108 | #define BCSR_SWITCHES_OCTAL 0x00FF | ||
109 | #define BCSR_SWITCHES_DIP_1 0x0080 | ||
110 | #define BCSR_SWITCHES_DIP_2 0x0040 | ||
111 | #define BCSR_SWITCHES_DIP_3 0x0020 | ||
112 | #define BCSR_SWITCHES_DIP_4 0x0010 | ||
113 | #define BCSR_SWITCHES_DIP_5 0x0008 | ||
114 | #define BCSR_SWITCHES_DIP_6 0x0004 | ||
115 | #define BCSR_SWITCHES_DIP_7 0x0002 | ||
116 | #define BCSR_SWITCHES_DIP_8 0x0001 | ||
117 | #define BCSR_SWITCHES_ROTARY 0x0F00 | ||
118 | |||
119 | #define BCSR_RESETS_ETH 0x0001 | ||
120 | #define BCSR_RESETS_CAMERA 0x0002 | ||
121 | #define BCSR_RESETS_DC 0x0004 | ||
122 | #define BCSR_RESETS_IDE 0x0008 | ||
123 | #define BCSR_RESETS_TV 0x0010 | ||
124 | /* not resets but in the same register */ | ||
125 | #define BCSR_RESETS_PWMR1mUX 0x0800 | ||
126 | #define BCSR_RESETS_PCS0MUX 0x1000 | ||
127 | #define BCSR_RESETS_PCS1MUX 0x2000 | ||
128 | #define BCSR_RESETS_SPISEL 0x4000 | ||
129 | |||
130 | #define BCSR_PCMCIA_PC0VPP 0x0003 | ||
131 | #define BCSR_PCMCIA_PC0VCC 0x000C | ||
132 | #define BCSR_PCMCIA_PC0DRVEN 0x0010 | ||
133 | #define BCSR_PCMCIA_PC0RST 0x0080 | ||
134 | #define BCSR_PCMCIA_PC1VPP 0x0300 | ||
135 | #define BCSR_PCMCIA_PC1VCC 0x0C00 | ||
136 | #define BCSR_PCMCIA_PC1DRVEN 0x1000 | ||
137 | #define BCSR_PCMCIA_PC1RST 0x8000 | ||
138 | |||
139 | #define BCSR_BOARD_LCDVEE 0x0001 | ||
140 | #define BCSR_BOARD_LCDVDD 0x0002 | ||
141 | #define BCSR_BOARD_LCDBL 0x0004 | ||
142 | #define BCSR_BOARD_CAMSNAP 0x0010 | ||
143 | #define BCSR_BOARD_CAMPWR 0x0020 | ||
144 | #define BCSR_BOARD_SD0PWR 0x0040 | ||
145 | |||
146 | #define BCSR_LEDS_DECIMALS 0x0003 | ||
147 | #define BCSR_LEDS_LED0 0x0100 | ||
148 | #define BCSR_LEDS_LED1 0x0200 | ||
149 | #define BCSR_LEDS_LED2 0x0400 | ||
150 | #define BCSR_LEDS_LED3 0x0800 | ||
151 | |||
152 | #define BCSR_SYSTEM_POWEROFF 0x4000 | ||
153 | #define BCSR_SYSTEM_RESET 0x8000 | ||
154 | |||
155 | /* Bit positions for the different interrupt sources */ | ||
156 | #define BCSR_INT_IDE 0x0001 | ||
157 | #define BCSR_INT_ETH 0x0002 | ||
158 | #define BCSR_INT_PC0 0x0004 | ||
159 | #define BCSR_INT_PC0STSCHG 0x0008 | ||
160 | #define BCSR_INT_PC1 0x0010 | ||
161 | #define BCSR_INT_PC1STSCHG 0x0020 | ||
162 | #define BCSR_INT_DC 0x0040 | ||
163 | #define BCSR_INT_FLASHBUSY 0x0080 | ||
164 | #define BCSR_INT_PC0INSERT 0x0100 | ||
165 | #define BCSR_INT_PC0EJECT 0x0200 | ||
166 | #define BCSR_INT_PC1INSERT 0x0400 | ||
167 | #define BCSR_INT_PC1EJECT 0x0800 | ||
168 | #define BCSR_INT_SD0INSERT 0x1000 | ||
169 | #define BCSR_INT_SD0EJECT 0x2000 | ||
170 | |||
171 | #define AU1XXX_SMC91111_PHYS_ADDR (0x19000300) | ||
172 | #define AU1XXX_SMC91111_IRQ DB1200_ETH_INT | ||
173 | |||
174 | #define AU1XXX_ATA_PHYS_ADDR (0x18800000) | ||
175 | #define AU1XXX_ATA_PHYS_LEN (0x100) | ||
176 | #define AU1XXX_ATA_REG_OFFSET (5) | ||
177 | #define AU1XXX_ATA_INT DB1200_IDE_INT | ||
178 | #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; | ||
179 | #define AU1XXX_ATA_RQSIZE 128 | ||
180 | |||
181 | #define NAND_PHYS_ADDR 0x20000000 | ||
182 | |||
183 | /* | ||
184 | * External Interrupts for Pb1200 as of 8/6/2004. | ||
185 | * Bit positions in the CPLD registers can be calculated by taking | ||
186 | * the interrupt define and subtracting the DB1200_INT_BEGIN value. | ||
187 | * *example: IDE bis pos is = 64 - 64 | ||
188 | ETH bit pos is = 65 - 64 | ||
189 | */ | ||
190 | #define DB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1) | ||
191 | #define DB1200_IDE_INT (DB1200_INT_BEGIN + 0) | ||
192 | #define DB1200_ETH_INT (DB1200_INT_BEGIN + 1) | ||
193 | #define DB1200_PC0_INT (DB1200_INT_BEGIN + 2) | ||
194 | #define DB1200_PC0_STSCHG_INT (DB1200_INT_BEGIN + 3) | ||
195 | #define DB1200_PC1_INT (DB1200_INT_BEGIN + 4) | ||
196 | #define DB1200_PC1_STSCHG_INT (DB1200_INT_BEGIN + 5) | ||
197 | #define DB1200_DC_INT (DB1200_INT_BEGIN + 6) | ||
198 | #define DB1200_FLASHBUSY_INT (DB1200_INT_BEGIN + 7) | ||
199 | #define DB1200_PC0_INSERT_INT (DB1200_INT_BEGIN + 8) | ||
200 | #define DB1200_PC0_EJECT_INT (DB1200_INT_BEGIN + 9) | ||
201 | #define DB1200_PC1_INSERT_INT (DB1200_INT_BEGIN + 10) | ||
202 | #define DB1200_PC1_EJECT_INT (DB1200_INT_BEGIN + 11) | ||
203 | #define DB1200_SD0_INSERT_INT (DB1200_INT_BEGIN + 12) | ||
204 | #define DB1200_SD0_EJECT_INT (DB1200_INT_BEGIN + 13) | ||
205 | |||
206 | #define DB1200_INT_END (DB1200_INT_BEGIN + 15) | ||
207 | |||
208 | /* For drivers/pcmcia/au1000_db1x00.c */ | ||
209 | |||
210 | /* PCMCIA Db1x00 specific defines */ | ||
211 | |||
212 | #define PCMCIA_MAX_SOCK 1 | ||
213 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1) | ||
214 | |||
215 | /* VPP/VCC */ | ||
216 | #define SET_VCC_VPP(VCC, VPP, SLOT)\ | ||
217 | ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8)) | ||
218 | |||
219 | #define BOARD_PC0_INT DB1200_PC0_INT | ||
220 | #define BOARD_PC1_INT DB1200_PC1_INT | ||
221 | #define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET))) | ||
222 | |||
223 | #endif /* __ASM_DB1200_H */ | ||
224 | |||
diff --git a/include/asm-mips/mach-dec/mc146818rtc.h b/include/asm-mips/mach-dec/mc146818rtc.h index a326f451253b..6d37a5675803 100644 --- a/include/asm-mips/mach-dec/mc146818rtc.h +++ b/include/asm-mips/mach-dec/mc146818rtc.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1998, 2001 by Ralf Baechle | 4 | * Copyright (C) 1998, 2001 by Ralf Baechle |
5 | * Copyright (C) 1998 by Harald Koerfgen | 5 | * Copyright (C) 1998 by Harald Koerfgen |
6 | * Copyright (C) 2002 Maciej W. Rozycki | 6 | * Copyright (C) 2002, 2005 Maciej W. Rozycki |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or | 8 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License | 9 | * modify it under the terms of the GNU General Public License |
@@ -14,23 +14,18 @@ | |||
14 | #define __ASM_MIPS_DEC_RTC_DEC_H | 14 | #define __ASM_MIPS_DEC_RTC_DEC_H |
15 | 15 | ||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | |||
18 | #include <asm/addrspace.h> | 17 | #include <asm/addrspace.h> |
18 | #include <asm/dec/system.h> | ||
19 | 19 | ||
20 | extern volatile u8 *dec_rtc_base; | 20 | extern volatile u8 *dec_rtc_base; |
21 | extern unsigned long dec_kn_slot_size; | ||
22 | 21 | ||
23 | #define RTC_PORT(x) CPHYSADDR(dec_rtc_base) | 22 | #define RTC_PORT(x) CPHYSADDR((long)dec_rtc_base) |
24 | #define RTC_IO_EXTENT dec_kn_slot_size | 23 | #define RTC_IO_EXTENT dec_kn_slot_size |
25 | #define RTC_IOMAPPED 0 | 24 | #define RTC_IOMAPPED 0 |
26 | #undef RTC_IRQ | 25 | #undef RTC_IRQ |
27 | 26 | ||
28 | #define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */ | 27 | #define RTC_DEC_YEAR 0x3f /* Where we store the real year on DECs. */ |
29 | 28 | ||
30 | #include <linux/mc146818rtc.h> | ||
31 | #include <linux/module.h> | ||
32 | #include <linux/types.h> | ||
33 | |||
34 | static inline unsigned char CMOS_READ(unsigned long addr) | 29 | static inline unsigned char CMOS_READ(unsigned long addr) |
35 | { | 30 | { |
36 | return dec_rtc_base[addr * 4]; | 31 | return dec_rtc_base[addr * 4]; |
diff --git a/include/asm-mips/mach-generic/cpu-feature-overrides.h b/include/asm-mips/mach-generic/cpu-feature-overrides.h index 0aecfd08e39a..7c185bb06f13 100644 --- a/include/asm-mips/mach-generic/cpu-feature-overrides.h +++ b/include/asm-mips/mach-generic/cpu-feature-overrides.h | |||
@@ -8,6 +8,6 @@ | |||
8 | #ifndef __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H | 8 | #ifndef __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H |
9 | #define __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H | 9 | #define __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H |
10 | 10 | ||
11 | /* Intensionally empty file ... */ | 11 | /* Intentionally empty file ... */ |
12 | 12 | ||
13 | #endif /* __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H */ | 13 | #endif /* __ASM_MACH_GENERIC_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index cb2edd018ad6..961006948c7c 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/config.h> | 18 | #include <linux/config.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/stddef.h> | 20 | #include <linux/stddef.h> |
21 | #include <asm/processor.h> | ||
21 | 22 | ||
22 | #ifndef MAX_HWIFS | 23 | #ifndef MAX_HWIFS |
23 | # ifdef CONFIG_BLK_DEV_IDEPCI | 24 | # ifdef CONFIG_BLK_DEV_IDEPCI |
@@ -104,15 +105,71 @@ static __inline__ unsigned long ide_default_io_base(int index) | |||
104 | 105 | ||
105 | /* MIPS port and memory-mapped I/O string operations. */ | 106 | /* MIPS port and memory-mapped I/O string operations. */ |
106 | 107 | ||
107 | #define __ide_insw insw | 108 | static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size) |
108 | #define __ide_insl insl | 109 | { |
109 | #define __ide_outsw outsw | 110 | if (cpu_has_dc_aliases) { |
110 | #define __ide_outsl outsl | 111 | unsigned long end = addr + size; |
112 | for (; addr < end; addr += PAGE_SIZE) | ||
113 | flush_dcache_page(virt_to_page(addr)); | ||
114 | } | ||
115 | } | ||
116 | |||
117 | static inline void __ide_insw(unsigned long port, void *addr, | ||
118 | unsigned int count) | ||
119 | { | ||
120 | insw(port, addr, count); | ||
121 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
122 | } | ||
123 | |||
124 | static inline void __ide_insl(unsigned long port, void *addr, unsigned int count) | ||
125 | { | ||
126 | insl(port, addr, count); | ||
127 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
128 | } | ||
129 | |||
130 | static inline void __ide_outsw(unsigned long port, const void *addr, | ||
131 | unsigned long count) | ||
132 | { | ||
133 | outsw(port, addr, count); | ||
134 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
135 | } | ||
136 | |||
137 | static inline void __ide_outsl(unsigned long port, const void *addr, | ||
138 | unsigned long count) | ||
139 | { | ||
140 | outsl(port, addr, count); | ||
141 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
142 | } | ||
143 | |||
144 | static inline void __ide_mm_insw(void __iomem *port, void *addr, u32 count) | ||
145 | { | ||
146 | readsw(port, addr, count); | ||
147 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
148 | } | ||
149 | |||
150 | static inline void __ide_mm_insl(void __iomem *port, void *addr, u32 count) | ||
151 | { | ||
152 | readsl(port, addr, count); | ||
153 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
154 | } | ||
155 | |||
156 | static inline void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) | ||
157 | { | ||
158 | writesw(port, addr, count); | ||
159 | __ide_flush_dcache_range((unsigned long)addr, count * 2); | ||
160 | } | ||
161 | |||
162 | static inline void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) | ||
163 | { | ||
164 | writesl(port, addr, count); | ||
165 | __ide_flush_dcache_range((unsigned long)addr, count * 4); | ||
166 | } | ||
111 | 167 | ||
112 | #define __ide_mm_insw readsw | 168 | /* ide_insw calls insw, not __ide_insw. Why? */ |
113 | #define __ide_mm_insl readsl | 169 | #undef insw |
114 | #define __ide_mm_outsw writesw | 170 | #undef insl |
115 | #define __ide_mm_outsl writesl | 171 | #define insw(port, addr, count) __ide_insw(port, addr, count) |
172 | #define insl(port, addr, count) __ide_insl(port, addr, count) | ||
116 | 173 | ||
117 | #endif /* __KERNEL__ */ | 174 | #endif /* __KERNEL__ */ |
118 | 175 | ||
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h new file mode 100644 index 000000000000..9b64ff6e485d --- /dev/null +++ b/include/asm-mips/mach-generic/ioremap.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * include/asm-mips/mach-generic/ioremap.h | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_GENERIC_IOREMAP_H | ||
10 | #define __ASM_MACH_GENERIC_IOREMAP_H | ||
11 | |||
12 | #include <linux/types.h> | ||
13 | |||
14 | /* | ||
15 | * Allow physical addresses to be fixed up to help peripherals located | ||
16 | * outside the low 32-bit range -- generic pass-through version. | ||
17 | */ | ||
18 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
19 | { | ||
20 | return phys_addr; | ||
21 | } | ||
22 | |||
23 | #endif /* __ASM_MACH_GENERIC_IOREMAP_H */ | ||
diff --git a/include/asm-mips/mach-generic/kernel-entry-init.h b/include/asm-mips/mach-generic/kernel-entry-init.h new file mode 100644 index 000000000000..7e66505fa574 --- /dev/null +++ b/include/asm-mips/mach-generic/kernel-entry-init.h | |||
@@ -0,0 +1,25 @@ | |||
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) 2005 Embedded Alley Solutions, Inc | ||
7 | * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_GENERIC_KERNEL_ENTRY_H | ||
10 | #define __ASM_MACH_GENERIC_KERNEL_ENTRY_H | ||
11 | |||
12 | /* Intentionally empty macro, used in head.S. Override in | ||
13 | * arch/mips/mach-xxx/kernel-entry-init.h when necessary. | ||
14 | */ | ||
15 | .macro kernel_entry_setup | ||
16 | .endm | ||
17 | |||
18 | /* | ||
19 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
20 | */ | ||
21 | .macro smp_slave_setup | ||
22 | .endm | ||
23 | |||
24 | |||
25 | #endif /* __ASM_MACH_GENERIC_KERNEL_ENTRY_H */ | ||
diff --git a/include/asm-mips/mach-generic/kmalloc.h b/include/asm-mips/mach-generic/kmalloc.h new file mode 100644 index 000000000000..373d66dee9d7 --- /dev/null +++ b/include/asm-mips/mach-generic/kmalloc.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __ASM_MACH_GENERIC_KMALLOC_H | ||
2 | #define __ASM_MACH_GENERIC_KMALLOC_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifndef CONFIG_DMA_COHERENT | ||
7 | /* | ||
8 | * Total overkill for most systems but need as a safe default. | ||
9 | */ | ||
10 | #define ARCH_KMALLOC_MINALIGN 128 | ||
11 | #endif | ||
12 | |||
13 | #endif /* __ASM_MACH_GENERIC_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h index 5a2c1efb4eb7..b849d8dd7e78 100644 --- a/include/asm-mips/mach-generic/spaces.h +++ b/include/asm-mips/mach-generic/spaces.h | |||
@@ -55,13 +55,13 @@ | |||
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #ifdef CONFIG_DMA_NONCOHERENT | 57 | #ifdef CONFIG_DMA_NONCOHERENT |
58 | #define CAC_BASE 0x9800000000000000 | 58 | #define CAC_BASE 0x9800000000000000UL |
59 | #else | 59 | #else |
60 | #define CAC_BASE 0xa800000000000000 | 60 | #define CAC_BASE 0xa800000000000000UL |
61 | #endif | 61 | #endif |
62 | #define IO_BASE 0x9000000000000000 | 62 | #define IO_BASE 0x9000000000000000UL |
63 | #define UNCAC_BASE 0x9000000000000000 | 63 | #define UNCAC_BASE 0x9000000000000000UL |
64 | #define MAP_BASE 0xc000000000000000 | 64 | #define MAP_BASE 0xc000000000000000UL |
65 | 65 | ||
66 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | 66 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
67 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | 67 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h index 3c8896d9b133..ab9714668177 100644 --- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h | |||
@@ -11,6 +11,12 @@ | |||
11 | /* | 11 | /* |
12 | * IP22 with a variety of processors so we can't use defaults for everything. | 12 | * IP22 with a variety of processors so we can't use defaults for everything. |
13 | */ | 13 | */ |
14 | #define cpu_has_tlb 1 | ||
15 | #define cpu_has_4kex 1 | ||
16 | #define cpu_has_4kcache 1 | ||
17 | #define cpu_has_fpu 1 | ||
18 | #define cpu_has_32fpr 1 | ||
19 | #define cpu_has_counter 1 | ||
14 | #define cpu_has_mips16 0 | 20 | #define cpu_has_mips16 0 |
15 | #define cpu_has_divec 0 | 21 | #define cpu_has_divec 0 |
16 | #define cpu_has_cache_cdex_p 1 | 22 | #define cpu_has_cache_cdex_p 1 |
@@ -23,6 +29,8 @@ | |||
23 | #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) | 29 | #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) |
24 | #define cpu_has_ic_fills_f_dc 0 | 30 | #define cpu_has_ic_fills_f_dc 0 |
25 | 31 | ||
32 | #define cpu_has_dsp 0 | ||
33 | |||
26 | #define cpu_has_nofpuex 0 | 34 | #define cpu_has_nofpuex 0 |
27 | #define cpu_has_64bits 1 | 35 | #define cpu_has_64bits 1 |
28 | 36 | ||
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h index e96166f27c49..8385f716798d 100644 --- a/include/asm-mips/mach-ip22/spaces.h +++ b/include/asm-mips/mach-ip22/spaces.h | |||
@@ -44,7 +44,7 @@ | |||
44 | #define CAC_BASE 0xffffffff80000000 | 44 | #define CAC_BASE 0xffffffff80000000 |
45 | #define IO_BASE 0xffffffffa0000000 | 45 | #define IO_BASE 0xffffffffa0000000 |
46 | #define UNCAC_BASE 0xffffffffa0000000 | 46 | #define UNCAC_BASE 0xffffffffa0000000 |
47 | #define MAP_BASE 0xffffffffc0000000 | 47 | #define MAP_BASE 0xc000000000000000 |
48 | 48 | ||
49 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | 49 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
50 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | 50 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h index fe96d7358517..4c8a90051fd0 100644 --- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define cpu_has_vtag_icache 0 | 25 | #define cpu_has_vtag_icache 0 |
26 | #define cpu_has_dc_aliases 0 | 26 | #define cpu_has_dc_aliases 0 |
27 | #define cpu_has_ic_fills_f_dc 0 | 27 | #define cpu_has_ic_fills_f_dc 0 |
28 | #define cpu_has_dsp 0 | ||
28 | #define cpu_icache_snoops_remote_store 1 | 29 | #define cpu_icache_snoops_remote_store 1 |
29 | 30 | ||
30 | #define cpu_has_nofpuex 0 | 31 | #define cpu_has_nofpuex 0 |
diff --git a/include/asm-mips/mach-ip27/kernel-entry-init.h b/include/asm-mips/mach-ip27/kernel-entry-init.h new file mode 100644 index 000000000000..c1a10314b317 --- /dev/null +++ b/include/asm-mips/mach-ip27/kernel-entry-init.h | |||
@@ -0,0 +1,52 @@ | |||
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) 2000 Silicon Graphics, Inc. | ||
7 | * Copyright (C) 2005 Ralf Baechle <ralf@linux-mips.org> | ||
8 | */ | ||
9 | #ifndef __ASM_MACH_IP27_KERNEL_ENTRY_H | ||
10 | #define __ASM_MACH_IP27_KERNEL_ENTRY_H | ||
11 | |||
12 | #include <asm/sn/addrs.h> | ||
13 | #include <asm/sn/sn0/hubni.h> | ||
14 | #include <asm/sn/klkernvars.h> | ||
15 | |||
16 | /* | ||
17 | * Returns the local nasid into res. | ||
18 | */ | ||
19 | .macro GET_NASID_ASM res | ||
20 | dli \res, LOCAL_HUB_ADDR(NI_STATUS_REV_ID) | ||
21 | ld \res, (\res) | ||
22 | and \res, NSRI_NODEID_MASK | ||
23 | dsrl \res, NSRI_NODEID_SHFT | ||
24 | .endm | ||
25 | |||
26 | /* | ||
27 | * Intentionally empty macro, used in head.S. Override in | ||
28 | * arch/mips/mach-xxx/kernel-entry-init.h when necessary. | ||
29 | */ | ||
30 | .macro kernel_entry_setup | ||
31 | GET_NASID_ASM t1 | ||
32 | move t2, t1 # text and data are here | ||
33 | MAPPED_KERNEL_SETUP_TLB | ||
34 | .endm | ||
35 | |||
36 | /* | ||
37 | * Do SMP slave processor setup necessary before we can savely execute C code. | ||
38 | */ | ||
39 | .macro smp_slave_setup | ||
40 | GET_NASID_ASM t1 | ||
41 | dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \ | ||
42 | KLDIR_OFF_POINTER + CAC_BASE | ||
43 | dsll t1, NASID_SHFT | ||
44 | or t0, t0, t1 | ||
45 | ld t0, 0(t0) # t0 points to kern_vars struct | ||
46 | lh t1, KV_RO_NASID_OFFSET(t0) | ||
47 | lh t2, KV_RW_NASID_OFFSET(t0) | ||
48 | MAPPED_KERNEL_SETUP_TLB | ||
49 | ARC64_TWIDDLE_PC | ||
50 | .endm | ||
51 | |||
52 | #endif /* __ASM_MACH_IP27_KERNEL_ENTRY_H */ | ||
diff --git a/include/asm-mips/mach-ip27/kmalloc.h b/include/asm-mips/mach-ip27/kmalloc.h new file mode 100644 index 000000000000..426bd049b2d7 --- /dev/null +++ b/include/asm-mips/mach-ip27/kmalloc.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASM_MACH_IP27_KMALLOC_H | ||
2 | #define __ASM_MACH_IP27_KMALLOC_H | ||
3 | |||
4 | /* | ||
5 | * All happy, no need to define ARCH_KMALLOC_MINALIGN | ||
6 | */ | ||
7 | |||
8 | #endif /* __ASM_MACH_IP27_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-ip27/mmzone.h b/include/asm-mips/mach-ip27/mmzone.h index d3f566362e9d..986a3b9b59a7 100644 --- a/include/asm-mips/mach-ip27/mmzone.h +++ b/include/asm-mips/mach-ip27/mmzone.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #define LEVELS_PER_SLICE 128 | 10 | #define LEVELS_PER_SLICE 128 |
11 | 11 | ||
12 | struct slice_data { | 12 | struct slice_data { |
13 | unsigned long irq_alloc_mask[2]; | ||
14 | unsigned long irq_enable_mask[2]; | 13 | unsigned long irq_enable_mask[2]; |
15 | int level_to_irq[LEVELS_PER_SLICE]; | 14 | int level_to_irq[LEVELS_PER_SLICE]; |
16 | }; | 15 | }; |
@@ -20,6 +19,7 @@ struct hub_data { | |||
20 | DECLARE_BITMAP(h_bigwin_used, HUB_NUM_BIG_WINDOW); | 19 | DECLARE_BITMAP(h_bigwin_used, HUB_NUM_BIG_WINDOW); |
21 | cpumask_t h_cpus; | 20 | cpumask_t h_cpus; |
22 | unsigned long slice_map; | 21 | unsigned long slice_map; |
22 | unsigned long irq_alloc_mask[2]; | ||
23 | struct slice_data slice[2]; | 23 | struct slice_data slice[2]; |
24 | }; | 24 | }; |
25 | 25 | ||
diff --git a/include/asm-mips/mach-ip27/spaces.h b/include/asm-mips/mach-ip27/spaces.h index e3b3fe32eeb1..45e61785ef42 100644 --- a/include/asm-mips/mach-ip27/spaces.h +++ b/include/asm-mips/mach-ip27/spaces.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define IO_BASE 0x9200000000000000 | 20 | #define IO_BASE 0x9200000000000000 |
21 | #define MSPEC_BASE 0x9400000000000000 | 21 | #define MSPEC_BASE 0x9400000000000000 |
22 | #define UNCAC_BASE 0x9600000000000000 | 22 | #define UNCAC_BASE 0x9600000000000000 |
23 | #define MAP_BASE 0xc000000000000000 | ||
23 | 24 | ||
24 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | 25 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
25 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | 26 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
diff --git a/include/asm-mips/mach-ip27/topology.h b/include/asm-mips/mach-ip27/topology.h index a70a81257c3d..82141c711c33 100644 --- a/include/asm-mips/mach-ip27/topology.h +++ b/include/asm-mips/mach-ip27/topology.h | |||
@@ -9,6 +9,9 @@ | |||
9 | #define parent_node(node) (node) | 9 | #define parent_node(node) (node) |
10 | #define node_to_cpumask(node) (hub_data(node)->h_cpus) | 10 | #define node_to_cpumask(node) (hub_data(node)->h_cpus) |
11 | #define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) | 11 | #define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) |
12 | struct pci_bus; | ||
13 | extern int pcibus_to_node(struct pci_bus *); | ||
14 | |||
12 | #define pcibus_to_cpumask(bus) (cpu_online_map) | 15 | #define pcibus_to_cpumask(bus) (cpu_online_map) |
13 | 16 | ||
14 | extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; | 17 | extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; |
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h index 04713973c6c3..ab37fc1842ba 100644 --- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h | |||
@@ -37,5 +37,6 @@ | |||
37 | #define cpu_has_ejtag 0 | 37 | #define cpu_has_ejtag 0 |
38 | #define cpu_has_vtag_icache 0 | 38 | #define cpu_has_vtag_icache 0 |
39 | #define cpu_has_ic_fills_f_dc 0 | 39 | #define cpu_has_ic_fills_f_dc 0 |
40 | #define cpu_has_dsp 0 | ||
40 | 41 | ||
41 | #endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */ | 42 | #endif /* __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-ip32/kmalloc.h b/include/asm-mips/mach-ip32/kmalloc.h new file mode 100644 index 000000000000..9d2d4d9ac036 --- /dev/null +++ b/include/asm-mips/mach-ip32/kmalloc.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __ASM_MACH_IP32_KMALLOC_H | ||
2 | #define __ASM_MACH_IP32_KMALLOC_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #if defined(CONFIG_CPU_R5000) || defined (CONFIG_CPU_RM7000) | ||
7 | #define ARCH_KMALLOC_MINALIGN 32 | ||
8 | #else | ||
9 | #define ARCH_KMALLOC_MINALIGN 128 | ||
10 | #endif | ||
11 | |||
12 | #endif /* __ASM_MACH_IP32_KMALLOC_H */ | ||
diff --git a/include/asm-mips/mach-ip32/spaces.h b/include/asm-mips/mach-ip32/spaces.h index c7839f85c68d..44abe5c02389 100644 --- a/include/asm-mips/mach-ip32/spaces.h +++ b/include/asm-mips/mach-ip32/spaces.h | |||
@@ -19,10 +19,10 @@ | |||
19 | #define HIGHMEM_START (1UL << 59UL) | 19 | #define HIGHMEM_START (1UL << 59UL) |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #define CAC_BASE 0x9800000000000000 | 22 | #define CAC_BASE 0x9800000000000000UL |
23 | #define IO_BASE 0x9000000000000000 | 23 | #define IO_BASE 0x9000000000000000UL |
24 | #define UNCAC_BASE 0x9000000000000000 | 24 | #define UNCAC_BASE 0x9000000000000000UL |
25 | #define MAP_BASE 0xc000000000000000 | 25 | #define MAP_BASE 0xc000000000000000UL |
26 | 26 | ||
27 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | 27 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
28 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | 28 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
diff --git a/include/asm-mips/mach-ja/cpu-feature-overrides.h b/include/asm-mips/mach-ja/cpu-feature-overrides.h index ca57e7db98bb..a0fde405d4c4 100644 --- a/include/asm-mips/mach-ja/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ja/cpu-feature-overrides.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define cpu_has_vtag_icache 0 | 25 | #define cpu_has_vtag_icache 0 |
26 | #define cpu_has_dc_aliases 0 | 26 | #define cpu_has_dc_aliases 0 |
27 | #define cpu_has_ic_fills_f_dc 0 | 27 | #define cpu_has_ic_fills_f_dc 0 |
28 | #define cpu_has_dsp 0 | ||
28 | #define cpu_icache_snoops_remote_store 0 | 29 | #define cpu_icache_snoops_remote_store 0 |
29 | 30 | ||
30 | #define cpu_has_nofpuex 0 | 31 | #define cpu_has_nofpuex 0 |
@@ -36,10 +37,4 @@ | |||
36 | #define cpu_icache_line_size() 32 | 37 | #define cpu_icache_line_size() 32 |
37 | #define cpu_scache_line_size() 32 | 38 | #define cpu_scache_line_size() 32 |
38 | 39 | ||
39 | /* | ||
40 | * On the RM9000 we need to ensure that I-cache lines being fetches only | ||
41 | * contain valid instructions are funny things will happen. | ||
42 | */ | ||
43 | #define PLAT_TRAMPOLINE_STUFF_LINE 32UL | ||
44 | |||
45 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ | 40 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h index 6f51be571bf0..9f92aed17754 100644 --- a/include/asm-mips/mach-mips/cpu-feature-overrides.h +++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #ifdef CONFIG_CPU_MIPS32 | 17 | #ifdef CONFIG_CPU_MIPS32 |
18 | #define cpu_has_tlb 1 | 18 | #define cpu_has_tlb 1 |
19 | #define cpu_has_4kex 1 | 19 | #define cpu_has_4kex 1 |
20 | #define cpu_has_4ktlb 1 | 20 | #define cpu_has_4kcache 1 |
21 | /* #define cpu_has_fpu ? */ | 21 | /* #define cpu_has_fpu ? */ |
22 | /* #define cpu_has_32fpr ? */ | 22 | /* #define cpu_has_32fpr ? */ |
23 | #define cpu_has_counter 1 | 23 | #define cpu_has_counter 1 |
@@ -37,12 +37,13 @@ | |||
37 | /* #define cpu_has_64bits ? */ | 37 | /* #define cpu_has_64bits ? */ |
38 | /* #define cpu_has_64bit_zero_reg ? */ | 38 | /* #define cpu_has_64bit_zero_reg ? */ |
39 | /* #define cpu_has_subset_pcaches ? */ | 39 | /* #define cpu_has_subset_pcaches ? */ |
40 | #define cpu_icache_snoops_remote_store 1 | ||
40 | #endif | 41 | #endif |
41 | 42 | ||
42 | #ifdef CONFIG_CPU_MIPS64 | 43 | #ifdef CONFIG_CPU_MIPS64 |
43 | #define cpu_has_tlb 1 | 44 | #define cpu_has_tlb 1 |
44 | #define cpu_has_4kex 1 | 45 | #define cpu_has_4kex 1 |
45 | #define cpu_has_4ktlb 1 | 46 | #define cpu_has_4kcache 1 |
46 | /* #define cpu_has_fpu ? */ | 47 | /* #define cpu_has_fpu ? */ |
47 | /* #define cpu_has_32fpr ? */ | 48 | /* #define cpu_has_32fpr ? */ |
48 | #define cpu_has_counter 1 | 49 | #define cpu_has_counter 1 |
@@ -62,6 +63,7 @@ | |||
62 | /* #define cpu_has_64bits ? */ | 63 | /* #define cpu_has_64bits ? */ |
63 | /* #define cpu_has_64bit_zero_reg ? */ | 64 | /* #define cpu_has_64bit_zero_reg ? */ |
64 | /* #define cpu_has_subset_pcaches ? */ | 65 | /* #define cpu_has_subset_pcaches ? */ |
66 | #define cpu_icache_snoops_remote_store 1 | ||
65 | #endif | 67 | #endif |
66 | 68 | ||
67 | #endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ | 69 | #endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-mips/irq.h b/include/asm-mips/mach-mips/irq.h new file mode 100644 index 000000000000..f8579696ca54 --- /dev/null +++ b/include/asm-mips/mach-mips/irq.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __ASM_MACH_MIPS_IRQ_H | ||
2 | #define __ASM_MACH_MIPS_IRQ_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #define NR_IRQS 256 | ||
7 | |||
8 | #ifdef CONFIG_SMP | ||
9 | |||
10 | #define ARCH_HAS_IRQ_PER_CPU | ||
11 | |||
12 | #endif | ||
13 | |||
14 | #endif /* __ASM_MACH_MIPS_IRQ_H */ | ||
diff --git a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h index 7473512384bc..825c5f674dfc 100644 --- a/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ocelot3/cpu-feature-overrides.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define cpu_has_vtag_icache 0 | 28 | #define cpu_has_vtag_icache 0 |
29 | #define cpu_has_dc_aliases 0 | 29 | #define cpu_has_dc_aliases 0 |
30 | #define cpu_has_ic_fills_f_dc 0 | 30 | #define cpu_has_ic_fills_f_dc 0 |
31 | #define cpu_has_dsp 0 | ||
31 | #define cpu_icache_snoops_remote_store 0 | 32 | #define cpu_icache_snoops_remote_store 0 |
32 | 33 | ||
33 | #define cpu_has_nofpuex 0 | 34 | #define cpu_has_nofpuex 0 |
@@ -39,10 +40,4 @@ | |||
39 | #define cpu_icache_line_size() 32 | 40 | #define cpu_icache_line_size() 32 |
40 | #define cpu_scache_line_size() 32 | 41 | #define cpu_scache_line_size() 32 |
41 | 42 | ||
42 | /* | ||
43 | * On the RM9000 we need to ensure that I-cache lines being fetches only | ||
44 | * contain valid instructions are funny things will happen. | ||
45 | */ | ||
46 | #define PLAT_TRAMPOLINE_STUFF_LINE 32UL | ||
47 | |||
48 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ | 43 | #endif /* __ASM_MACH_JA_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h b/include/asm-mips/mach-pb1x00/pb1200.h new file mode 100644 index 000000000000..9a3088b19bf3 --- /dev/null +++ b/include/asm-mips/mach-pb1x00/pb1200.h | |||
@@ -0,0 +1,252 @@ | |||
1 | /* | ||
2 | * AMD Alchemy PB1200 Referrence Board | ||
3 | * Board Registers defines. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * | ||
23 | */ | ||
24 | #ifndef __ASM_PB1200_H | ||
25 | #define __ASM_PB1200_H | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | |||
29 | // This is defined in au1000.h with bogus value | ||
30 | #undef AU1X00_EXTERNAL_INT | ||
31 | |||
32 | #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX | ||
33 | #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX | ||
34 | #define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX | ||
35 | #define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX | ||
36 | |||
37 | /* SPI and SMB are muxed on the Pb1200 board. | ||
38 | Refer to board documentation. | ||
39 | */ | ||
40 | #define SPI_PSC_BASE PSC0_BASE_ADDR | ||
41 | #define SMBUS_PSC_BASE PSC0_BASE_ADDR | ||
42 | /* AC97 and I2S are muxed on the Pb1200 board. | ||
43 | Refer to board documentation. | ||
44 | */ | ||
45 | #define AC97_PSC_BASE PSC1_BASE_ADDR | ||
46 | #define I2S_PSC_BASE PSC1_BASE_ADDR | ||
47 | |||
48 | #define BCSR_KSEG1_ADDR 0xAD800000 | ||
49 | |||
50 | typedef volatile struct | ||
51 | { | ||
52 | /*00*/ u16 whoami; | ||
53 | u16 reserved0; | ||
54 | /*04*/ u16 status; | ||
55 | u16 reserved1; | ||
56 | /*08*/ u16 switches; | ||
57 | u16 reserved2; | ||
58 | /*0C*/ u16 resets; | ||
59 | u16 reserved3; | ||
60 | |||
61 | /*10*/ u16 pcmcia; | ||
62 | u16 reserved4; | ||
63 | /*14*/ u16 board; | ||
64 | u16 reserved5; | ||
65 | /*18*/ u16 disk_leds; | ||
66 | u16 reserved6; | ||
67 | /*1C*/ u16 system; | ||
68 | u16 reserved7; | ||
69 | |||
70 | /*20*/ u16 intclr; | ||
71 | u16 reserved8; | ||
72 | /*24*/ u16 intset; | ||
73 | u16 reserved9; | ||
74 | /*28*/ u16 intclr_mask; | ||
75 | u16 reserved10; | ||
76 | /*2C*/ u16 intset_mask; | ||
77 | u16 reserved11; | ||
78 | |||
79 | /*30*/ u16 sig_status; | ||
80 | u16 reserved12; | ||
81 | /*34*/ u16 int_status; | ||
82 | u16 reserved13; | ||
83 | /*38*/ u16 reserved14; | ||
84 | u16 reserved15; | ||
85 | /*3C*/ u16 reserved16; | ||
86 | u16 reserved17; | ||
87 | |||
88 | } BCSR; | ||
89 | |||
90 | static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; | ||
91 | |||
92 | /* | ||
93 | * Register bit definitions for the BCSRs | ||
94 | */ | ||
95 | #define BCSR_WHOAMI_DCID 0x000F | ||
96 | #define BCSR_WHOAMI_CPLD 0x00F0 | ||
97 | #define BCSR_WHOAMI_BOARD 0x0F00 | ||
98 | |||
99 | #define BCSR_STATUS_PCMCIA0VS 0x0003 | ||
100 | #define BCSR_STATUS_PCMCIA1VS 0x000C | ||
101 | #define BCSR_STATUS_SWAPBOOT 0x0040 | ||
102 | #define BCSR_STATUS_FLASHBUSY 0x0100 | ||
103 | #define BCSR_STATUS_IDECBLID 0x0200 | ||
104 | #define BCSR_STATUS_SD0WP 0x0400 | ||
105 | #define BCSR_STATUS_SD1WP 0x0800 | ||
106 | #define BCSR_STATUS_U0RXD 0x1000 | ||
107 | #define BCSR_STATUS_U1RXD 0x2000 | ||
108 | |||
109 | #define BCSR_SWITCHES_OCTAL 0x00FF | ||
110 | #define BCSR_SWITCHES_DIP_1 0x0080 | ||
111 | #define BCSR_SWITCHES_DIP_2 0x0040 | ||
112 | #define BCSR_SWITCHES_DIP_3 0x0020 | ||
113 | #define BCSR_SWITCHES_DIP_4 0x0010 | ||
114 | #define BCSR_SWITCHES_DIP_5 0x0008 | ||
115 | #define BCSR_SWITCHES_DIP_6 0x0004 | ||
116 | #define BCSR_SWITCHES_DIP_7 0x0002 | ||
117 | #define BCSR_SWITCHES_DIP_8 0x0001 | ||
118 | #define BCSR_SWITCHES_ROTARY 0x0F00 | ||
119 | |||
120 | #define BCSR_RESETS_ETH 0x0001 | ||
121 | #define BCSR_RESETS_CAMERA 0x0002 | ||
122 | #define BCSR_RESETS_DC 0x0004 | ||
123 | #define BCSR_RESETS_IDE 0x0008 | ||
124 | /* not resets but in the same register */ | ||
125 | #define BCSR_RESETS_WSCFSM 0x0800 | ||
126 | #define BCSR_RESETS_PCS0MUX 0x1000 | ||
127 | #define BCSR_RESETS_PCS1MUX 0x2000 | ||
128 | #define BCSR_RESETS_SPISEL 0x4000 | ||
129 | #define BCSR_RESETS_SD1MUX 0x8000 | ||
130 | |||
131 | #define BCSR_PCMCIA_PC0VPP 0x0003 | ||
132 | #define BCSR_PCMCIA_PC0VCC 0x000C | ||
133 | #define BCSR_PCMCIA_PC0DRVEN 0x0010 | ||
134 | #define BCSR_PCMCIA_PC0RST 0x0080 | ||
135 | #define BCSR_PCMCIA_PC1VPP 0x0300 | ||
136 | #define BCSR_PCMCIA_PC1VCC 0x0C00 | ||
137 | #define BCSR_PCMCIA_PC1DRVEN 0x1000 | ||
138 | #define BCSR_PCMCIA_PC1RST 0x8000 | ||
139 | |||
140 | #define BCSR_BOARD_LCDVEE 0x0001 | ||
141 | #define BCSR_BOARD_LCDVDD 0x0002 | ||
142 | #define BCSR_BOARD_LCDBL 0x0004 | ||
143 | #define BCSR_BOARD_CAMSNAP 0x0010 | ||
144 | #define BCSR_BOARD_CAMPWR 0x0020 | ||
145 | #define BCSR_BOARD_SD0PWR 0x0040 | ||
146 | #define BCSR_BOARD_SD1PWR 0x0080 | ||
147 | |||
148 | #define BCSR_LEDS_DECIMALS 0x00FF | ||
149 | #define BCSR_LEDS_LED0 0x0100 | ||
150 | #define BCSR_LEDS_LED1 0x0200 | ||
151 | #define BCSR_LEDS_LED2 0x0400 | ||
152 | #define BCSR_LEDS_LED3 0x0800 | ||
153 | |||
154 | #define BCSR_SYSTEM_VDDI 0x001F | ||
155 | #define BCSR_SYSTEM_POWEROFF 0x4000 | ||
156 | #define BCSR_SYSTEM_RESET 0x8000 | ||
157 | |||
158 | /* Bit positions for the different interrupt sources */ | ||
159 | #define BCSR_INT_IDE 0x0001 | ||
160 | #define BCSR_INT_ETH 0x0002 | ||
161 | #define BCSR_INT_PC0 0x0004 | ||
162 | #define BCSR_INT_PC0STSCHG 0x0008 | ||
163 | #define BCSR_INT_PC1 0x0010 | ||
164 | #define BCSR_INT_PC1STSCHG 0x0020 | ||
165 | #define BCSR_INT_DC 0x0040 | ||
166 | #define BCSR_INT_FLASHBUSY 0x0080 | ||
167 | #define BCSR_INT_PC0INSERT 0x0100 | ||
168 | #define BCSR_INT_PC0EJECT 0x0200 | ||
169 | #define BCSR_INT_PC1INSERT 0x0400 | ||
170 | #define BCSR_INT_PC1EJECT 0x0800 | ||
171 | #define BCSR_INT_SD0INSERT 0x1000 | ||
172 | #define BCSR_INT_SD0EJECT 0x2000 | ||
173 | #define BCSR_INT_SD1INSERT 0x4000 | ||
174 | #define BCSR_INT_SD1EJECT 0x8000 | ||
175 | |||
176 | /* PCMCIA Db1x00 specific defines */ | ||
177 | #define PCMCIA_MAX_SOCK 1 | ||
178 | #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1) | ||
179 | |||
180 | /* VPP/VCC */ | ||
181 | #define SET_VCC_VPP(VCC, VPP, SLOT)\ | ||
182 | ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8)) | ||
183 | |||
184 | #define AU1XXX_SMC91111_PHYS_ADDR (0x0D000300) | ||
185 | #define AU1XXX_SMC91111_IRQ PB1200_ETH_INT | ||
186 | |||
187 | #define AU1XXX_ATA_PHYS_ADDR (0x0C800000) | ||
188 | #define AU1XXX_ATA_PHYS_LEN (0x100) | ||
189 | #define AU1XXX_ATA_REG_OFFSET (5) | ||
190 | #define AU1XXX_ATA_INT PB1200_IDE_INT | ||
191 | #define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1; | ||
192 | #define AU1XXX_ATA_RQSIZE 128 | ||
193 | |||
194 | #define NAND_PHYS_ADDR 0x1C000000 | ||
195 | |||
196 | /* Timing values as described in databook, * ns value stripped of | ||
197 | * lower 2 bits. | ||
198 | * These defines are here rather than an SOC1200 generic file because | ||
199 | * the parts chosen on another board may be different and may require | ||
200 | * different timings. | ||
201 | */ | ||
202 | #define NAND_T_H (18 >> 2) | ||
203 | #define NAND_T_PUL (30 >> 2) | ||
204 | #define NAND_T_SU (30 >> 2) | ||
205 | #define NAND_T_WH (30 >> 2) | ||
206 | |||
207 | /* Bitfield shift amounts */ | ||
208 | #define NAND_T_H_SHIFT 0 | ||
209 | #define NAND_T_PUL_SHIFT 4 | ||
210 | #define NAND_T_SU_SHIFT 8 | ||
211 | #define NAND_T_WH_SHIFT 12 | ||
212 | |||
213 | #define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \ | ||
214 | ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \ | ||
215 | ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \ | ||
216 | ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT) | ||
217 | |||
218 | |||
219 | /* | ||
220 | * External Interrupts for Pb1200 as of 8/6/2004. | ||
221 | * Bit positions in the CPLD registers can be calculated by taking | ||
222 | * the interrupt define and subtracting the PB1200_INT_BEGIN value. | ||
223 | * *example: IDE bis pos is = 64 - 64 | ||
224 | ETH bit pos is = 65 - 64 | ||
225 | */ | ||
226 | #define PB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1) | ||
227 | #define PB1200_IDE_INT (PB1200_INT_BEGIN + 0) | ||
228 | #define PB1200_ETH_INT (PB1200_INT_BEGIN + 1) | ||
229 | #define PB1200_PC0_INT (PB1200_INT_BEGIN + 2) | ||
230 | #define PB1200_PC0_STSCHG_INT (PB1200_INT_BEGIN + 3) | ||
231 | #define PB1200_PC1_INT (PB1200_INT_BEGIN + 4) | ||
232 | #define PB1200_PC1_STSCHG_INT (PB1200_INT_BEGIN + 5) | ||
233 | #define PB1200_DC_INT (PB1200_INT_BEGIN + 6) | ||
234 | #define PB1200_FLASHBUSY_INT (PB1200_INT_BEGIN + 7) | ||
235 | #define PB1200_PC0_INSERT_INT (PB1200_INT_BEGIN + 8) | ||
236 | #define PB1200_PC0_EJECT_INT (PB1200_INT_BEGIN + 9) | ||
237 | #define PB1200_PC1_INSERT_INT (PB1200_INT_BEGIN + 10) | ||
238 | #define PB1200_PC1_EJECT_INT (PB1200_INT_BEGIN + 11) | ||
239 | #define PB1200_SD0_INSERT_INT (PB1200_INT_BEGIN + 12) | ||
240 | #define PB1200_SD0_EJECT_INT (PB1200_INT_BEGIN + 13) | ||
241 | #define PB1200_SD1_INSERT_INT (PB1200_INT_BEGIN + 14) | ||
242 | #define PB1200_SD1_EJECT_INT (PB1200_INT_BEGIN + 15) | ||
243 | |||
244 | #define PB1200_INT_END (PB1200_INT_BEGIN + 15) | ||
245 | |||
246 | /* For drivers/pcmcia/au1000_db1x00.c */ | ||
247 | #define BOARD_PC0_INT PB1200_PC0_INT | ||
248 | #define BOARD_PC1_INT PB1200_PC1_INT | ||
249 | #define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET))) | ||
250 | |||
251 | #endif /* __ASM_PB1200_H */ | ||
252 | |||
diff --git a/include/asm-mips/mach-pnx8550/cm.h b/include/asm-mips/mach-pnx8550/cm.h new file mode 100644 index 000000000000..bb0a56c7d011 --- /dev/null +++ b/include/asm-mips/mach-pnx8550/cm.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Clock module specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_CM_H | ||
23 | #define __PNX8550_CM_H | ||
24 | |||
25 | #define PNX8550_CM_BASE 0xBBE47000 | ||
26 | |||
27 | #define PNX8550_CM_PLL0_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x000) | ||
28 | #define PNX8550_CM_PLL1_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x004) | ||
29 | #define PNX8550_CM_PLL2_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x008) | ||
30 | #define PNX8550_CM_PLL3_CTL *(volatile unsigned long *)(PNX8550_CM_BASE + 0x00C) | ||
31 | |||
32 | // Table not complete..... | ||
33 | |||
34 | #define PNX8550_CM_PLL_BLOCKED_MASK 0x80000000 | ||
35 | #define PNX8550_CM_PLL_LOCK_MASK 0x40000000 | ||
36 | #define PNX8550_CM_PLL_CURRENT_ADJ_MASK 0x3c000000 | ||
37 | #define PNX8550_CM_PLL_N_MASK 0x01ff0000 | ||
38 | #define PNX8550_CM_PLL_M_MASK 0x00003f00 | ||
39 | #define PNX8550_CM_PLL_P_MASK 0x0000000c | ||
40 | #define PNX8550_CM_PLL_PD_MASK 0x00000002 | ||
41 | |||
42 | |||
43 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/glb.h b/include/asm-mips/mach-pnx8550/glb.h new file mode 100644 index 000000000000..07aa85e609bc --- /dev/null +++ b/include/asm-mips/mach-pnx8550/glb.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * PNX8550 global definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_GLB_H | ||
23 | #define __PNX8550_GLB_H | ||
24 | |||
25 | #define PNX8550_GLB1_BASE 0xBBE63000 | ||
26 | #define PNX8550_GLB2_BASE 0xBBE4d000 | ||
27 | #define PNX8550_RESET_BASE 0xBBE60000 | ||
28 | |||
29 | /* PCI Inta Output Enable Registers */ | ||
30 | #define PNX8550_GLB2_ENAB_INTA_O *(volatile unsigned long *)(PNX8550_GLB2_BASE + 0x050) | ||
31 | |||
32 | /* Bit 1:Enable DAC Powerdown | ||
33 | 0:DACs are enabled and are working normally | ||
34 | 1:DACs are powerdown | ||
35 | */ | ||
36 | #define PNX8550_GLB_DAC_PD 0x2 | ||
37 | /* Bit 0:Enable of PCI inta output | ||
38 | 0 = Disable PCI inta output | ||
39 | 1 = Enable PCI inta output | ||
40 | */ | ||
41 | #define PNX8550_GLB_ENABLE_INTA_O 0x1 | ||
42 | |||
43 | /* PCI Direct Mappings */ | ||
44 | #define PNX8550_PCIMEM 0x12000000 | ||
45 | #define PNX8550_PCIMEM_SIZE 0x08000000 | ||
46 | #define PNX8550_PCIIO 0x1c000000 | ||
47 | #define PNX8550_PCIIO_SIZE 0x02000000 /* 32M */ | ||
48 | |||
49 | #define PNX8550_PORT_BASE KSEG1 | ||
50 | |||
51 | // GPIO def | ||
52 | #define PNX8550_GPIO_BASE 0x1Be00000 | ||
53 | |||
54 | #define PNX8550_GPIO_DIRQ0 (PNX8550_GPIO_BASE + 0x104500) | ||
55 | #define PNX8550_GPIO_MC1 (PNX8550_GPIO_BASE + 0x104004) | ||
56 | #define PNX8550_GPIO_MC_31_BIT 30 | ||
57 | #define PNX8550_GPIO_MC_30_BIT 28 | ||
58 | #define PNX8550_GPIO_MC_29_BIT 26 | ||
59 | #define PNX8550_GPIO_MC_28_BIT 24 | ||
60 | #define PNX8550_GPIO_MC_27_BIT 22 | ||
61 | #define PNX8550_GPIO_MC_26_BIT 20 | ||
62 | #define PNX8550_GPIO_MC_25_BIT 18 | ||
63 | #define PNX8550_GPIO_MC_24_BIT 16 | ||
64 | #define PNX8550_GPIO_MC_23_BIT 14 | ||
65 | #define PNX8550_GPIO_MC_22_BIT 12 | ||
66 | #define PNX8550_GPIO_MC_21_BIT 10 | ||
67 | #define PNX8550_GPIO_MC_20_BIT 8 | ||
68 | #define PNX8550_GPIO_MC_19_BIT 6 | ||
69 | #define PNX8550_GPIO_MC_18_BIT 4 | ||
70 | #define PNX8550_GPIO_MC_17_BIT 2 | ||
71 | #define PNX8550_GPIO_MC_16_BIT 0 | ||
72 | |||
73 | #define PNX8550_GPIO_MODE_PRIMOP 0x1 | ||
74 | #define PNX8550_GPIO_MODE_NO_OPENDR 0x2 | ||
75 | #define PNX8550_GPIO_MODE_OPENDR 0x3 | ||
76 | |||
77 | // RESET module | ||
78 | #define PNX8550_RST_CTL *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x0) | ||
79 | #define PNX8550_RST_CAUSE *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x4) | ||
80 | #define PNX8550_RST_EN_WATCHDOG *(volatile unsigned long *)(PNX8550_RESET_BASE + 0x8) | ||
81 | |||
82 | #define PNX8550_RST_REL_MIPS_RST_N 0x8 | ||
83 | #define PNX8550_RST_DO_SW_RST 0x4 | ||
84 | #define PNX8550_RST_REL_SYS_RST_OUT 0x2 | ||
85 | #define PNX8550_RST_ASSERT_SYS_RST_OUT 0x1 | ||
86 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/int.h b/include/asm-mips/mach-pnx8550/int.h new file mode 100644 index 000000000000..0e0668b524f4 --- /dev/null +++ b/include/asm-mips/mach-pnx8550/int.h | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * Interrupt specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_INT_H | ||
23 | #define __PNX8550_INT_H | ||
24 | |||
25 | #define PNX8550_GIC_BASE 0xBBE3E000 | ||
26 | |||
27 | #define PNX8550_GIC_PRIMASK_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x000) | ||
28 | #define PNX8550_GIC_PRIMASK_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x004) | ||
29 | #define PNX8550_GIC_VECTOR_0 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x100) | ||
30 | #define PNX8550_GIC_VECTOR_1 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x104) | ||
31 | #define PNX8550_GIC_PEND_1_31 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x200) | ||
32 | #define PNX8550_GIC_PEND_32_63 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x204) | ||
33 | #define PNX8550_GIC_PEND_64_70 *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x208) | ||
34 | #define PNX8550_GIC_FEATURES *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x300) | ||
35 | #define PNX8550_GIC_REQ(x) *(volatile unsigned long *)(PNX8550_GIC_BASE + 0x400 + (x)*4) | ||
36 | #define PNX8550_GIC_MOD_ID *(volatile unsigned long *)(PNX8550_GIC_BASE + 0xFFC) | ||
37 | |||
38 | // cp0 is two software + six hw exceptions | ||
39 | #define PNX8550_INT_CP0_TOTINT 8 | ||
40 | #define PNX8550_INT_CP0_MIN 0 | ||
41 | #define PNX8550_INT_CP0_MAX (PNX8550_INT_CP0_MIN + PNX8550_INT_CP0_TOTINT - 1) | ||
42 | |||
43 | #define MIPS_CPU_GIC_IRQ 2 | ||
44 | #define MIPS_CPU_TIMER_IRQ 7 | ||
45 | |||
46 | // GIC are 71 exceptions connected to cp0's first hardware exception | ||
47 | #define PNX8550_INT_GIC_TOTINT 71 | ||
48 | #define PNX8550_INT_GIC_MIN (PNX8550_INT_CP0_MAX+1) | ||
49 | #define PNX8550_INT_GIC_MAX (PNX8550_INT_GIC_MIN + PNX8550_INT_GIC_TOTINT - 1) | ||
50 | |||
51 | #define PNX8550_INT_UNDEF (PNX8550_INT_GIC_MIN+0) | ||
52 | #define PNX8550_INT_IPC_TARGET0_MIPS (PNX8550_INT_GIC_MIN+1) | ||
53 | #define PNX8550_INT_IPC_TARGET1_TM32_1 (PNX8550_INT_GIC_MIN+2) | ||
54 | #define PNX8550_INT_IPC_TARGET1_TM32_2 (PNX8550_INT_GIC_MIN+3) | ||
55 | #define PNX8550_INT_RESERVED_4 (PNX8550_INT_GIC_MIN+4) | ||
56 | #define PNX8550_INT_USB (PNX8550_INT_GIC_MIN+5) | ||
57 | #define PNX8550_INT_GPIO_EQ1 (PNX8550_INT_GIC_MIN+6) | ||
58 | #define PNX8550_INT_GPIO_EQ2 (PNX8550_INT_GIC_MIN+7) | ||
59 | #define PNX8550_INT_GPIO_EQ3 (PNX8550_INT_GIC_MIN+8) | ||
60 | #define PNX8550_INT_GPIO_EQ4 (PNX8550_INT_GIC_MIN+9) | ||
61 | |||
62 | #define PNX8550_INT_GPIO_EQ5 (PNX8550_INT_GIC_MIN+10) | ||
63 | #define PNX8550_INT_GPIO_EQ6 (PNX8550_INT_GIC_MIN+11) | ||
64 | #define PNX8550_INT_RESERVED_12 (PNX8550_INT_GIC_MIN+12) | ||
65 | #define PNX8550_INT_QVCP1 (PNX8550_INT_GIC_MIN+13) | ||
66 | #define PNX8550_INT_QVCP2 (PNX8550_INT_GIC_MIN+14) | ||
67 | #define PNX8550_INT_I2C1 (PNX8550_INT_GIC_MIN+15) | ||
68 | #define PNX8550_INT_I2C2 (PNX8550_INT_GIC_MIN+16) | ||
69 | #define PNX8550_INT_ISO_UART1 (PNX8550_INT_GIC_MIN+17) | ||
70 | #define PNX8550_INT_ISO_UART2 (PNX8550_INT_GIC_MIN+18) | ||
71 | #define PNX8550_INT_UART1 (PNX8550_INT_GIC_MIN+19) | ||
72 | |||
73 | #define PNX8550_INT_UART2 (PNX8550_INT_GIC_MIN+20) | ||
74 | #define PNX8550_INT_QNTR (PNX8550_INT_GIC_MIN+21) | ||
75 | #define PNX8550_INT_RESERVED22 (PNX8550_INT_GIC_MIN+22) | ||
76 | #define PNX8550_INT_T_DSC (PNX8550_INT_GIC_MIN+23) | ||
77 | #define PNX8550_INT_M_DSC (PNX8550_INT_GIC_MIN+24) | ||
78 | #define PNX8550_INT_RESERVED25 (PNX8550_INT_GIC_MIN+25) | ||
79 | #define PNX8550_INT_2D_DRAW_ENG (PNX8550_INT_GIC_MIN+26) | ||
80 | #define PNX8550_INT_MEM_BASED_SCALAR1 (PNX8550_INT_GIC_MIN+27) | ||
81 | #define PNX8550_INT_VIDEO_MPEG (PNX8550_INT_GIC_MIN+28) | ||
82 | #define PNX8550_INT_VIDEO_INPUT_P1 (PNX8550_INT_GIC_MIN+29) | ||
83 | |||
84 | #define PNX8550_INT_VIDEO_INPUT_P2 (PNX8550_INT_GIC_MIN+30) | ||
85 | #define PNX8550_INT_SPDI1 (PNX8550_INT_GIC_MIN+31) | ||
86 | #define PNX8550_INT_SPDO (PNX8550_INT_GIC_MIN+32) | ||
87 | #define PNX8550_INT_AUDIO_INPUT1 (PNX8550_INT_GIC_MIN+33) | ||
88 | #define PNX8550_INT_AUDIO_OUTPUT1 (PNX8550_INT_GIC_MIN+34) | ||
89 | #define PNX8550_INT_AUDIO_INPUT2 (PNX8550_INT_GIC_MIN+35) | ||
90 | #define PNX8550_INT_AUDIO_OUTPUT2 (PNX8550_INT_GIC_MIN+36) | ||
91 | #define PNX8550_INT_MEMBASED_SCALAR2 (PNX8550_INT_GIC_MIN+37) | ||
92 | #define PNX8550_INT_VPK (PNX8550_INT_GIC_MIN+38) | ||
93 | #define PNX8550_INT_MPEG1_MIPS (PNX8550_INT_GIC_MIN+39) | ||
94 | |||
95 | #define PNX8550_INT_MPEG1_TM (PNX8550_INT_GIC_MIN+40) | ||
96 | #define PNX8550_INT_MPEG2_MIPS (PNX8550_INT_GIC_MIN+41) | ||
97 | #define PNX8550_INT_MPEG2_TM (PNX8550_INT_GIC_MIN+42) | ||
98 | #define PNX8550_INT_TS_DMA (PNX8550_INT_GIC_MIN+43) | ||
99 | #define PNX8550_INT_EDMA (PNX8550_INT_GIC_MIN+44) | ||
100 | #define PNX8550_INT_TM_DEBUG1 (PNX8550_INT_GIC_MIN+45) | ||
101 | #define PNX8550_INT_TM_DEBUG2 (PNX8550_INT_GIC_MIN+46) | ||
102 | #define PNX8550_INT_PCI_INTA (PNX8550_INT_GIC_MIN+47) | ||
103 | #define PNX8550_INT_CLOCK_MODULE (PNX8550_INT_GIC_MIN+48) | ||
104 | #define PNX8550_INT_PCI_XIO_INTA_PCI (PNX8550_INT_GIC_MIN+49) | ||
105 | |||
106 | #define PNX8550_INT_PCI_XIO_INTB_DMA (PNX8550_INT_GIC_MIN+50) | ||
107 | #define PNX8550_INT_PCI_XIO_INTC_GPPM (PNX8550_INT_GIC_MIN+51) | ||
108 | #define PNX8550_INT_PCI_XIO_INTD_GPXIO (PNX8550_INT_GIC_MIN+52) | ||
109 | #define PNX8550_INT_DVD_CSS (PNX8550_INT_GIC_MIN+53) | ||
110 | #define PNX8550_INT_VLD (PNX8550_INT_GIC_MIN+54) | ||
111 | #define PNX8550_INT_GPIO_TSU_7_0 (PNX8550_INT_GIC_MIN+55) | ||
112 | #define PNX8550_INT_GPIO_TSU_15_8 (PNX8550_INT_GIC_MIN+56) | ||
113 | #define PNX8550_INT_GPIO_CTU_IR (PNX8550_INT_GIC_MIN+57) | ||
114 | #define PNX8550_INT_GPIO0 (PNX8550_INT_GIC_MIN+58) | ||
115 | #define PNX8550_INT_GPIO1 (PNX8550_INT_GIC_MIN+59) | ||
116 | |||
117 | #define PNX8550_INT_GPIO2 (PNX8550_INT_GIC_MIN+60) | ||
118 | #define PNX8550_INT_GPIO3 (PNX8550_INT_GIC_MIN+61) | ||
119 | #define PNX8550_INT_GPIO4 (PNX8550_INT_GIC_MIN+62) | ||
120 | #define PNX8550_INT_GPIO5 (PNX8550_INT_GIC_MIN+63) | ||
121 | #define PNX8550_INT_GPIO6 (PNX8550_INT_GIC_MIN+64) | ||
122 | #define PNX8550_INT_GPIO7 (PNX8550_INT_GIC_MIN+65) | ||
123 | #define PNX8550_INT_PMAN_SECURITY (PNX8550_INT_GIC_MIN+66) | ||
124 | #define PNX8550_INT_I2C3 (PNX8550_INT_GIC_MIN+67) | ||
125 | #define PNX8550_INT_RESERVED_68 (PNX8550_INT_GIC_MIN+68) | ||
126 | #define PNX8550_INT_SPDI2 (PNX8550_INT_GIC_MIN+69) | ||
127 | |||
128 | #define PNX8550_INT_I2C4 (PNX8550_INT_GIC_MIN+70) | ||
129 | |||
130 | // Timer are 3 exceptions connected to cp0's 7th hardware exception | ||
131 | #define PNX8550_INT_TIMER_TOTINT 3 | ||
132 | #define PNX8550_INT_TIMER_MIN (PNX8550_INT_GIC_MAX+1) | ||
133 | #define PNX8550_INT_TIMER_MAX (PNX8550_INT_TIMER_MIN + PNX8550_INT_TIMER_TOTINT - 1) | ||
134 | |||
135 | #define PNX8550_INT_TIMER1 (PNX8550_INT_TIMER_MIN+0) | ||
136 | #define PNX8550_INT_TIMER2 (PNX8550_INT_TIMER_MIN+1) | ||
137 | #define PNX8550_INT_TIMER3 (PNX8550_INT_TIMER_MIN+2) | ||
138 | #define PNX8550_INT_WATCHDOG PNX8550_INT_TIMER3 | ||
139 | |||
140 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/kernel-entry-init.h b/include/asm-mips/mach-pnx8550/kernel-entry-init.h new file mode 100644 index 000000000000..57102fa9da51 --- /dev/null +++ b/include/asm-mips/mach-pnx8550/kernel-entry-init.h | |||
@@ -0,0 +1,262 @@ | |||
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) 2005 Embedded Alley Solutions, Inc | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_KERNEL_ENTRY_INIT_H | ||
9 | #define __ASM_MACH_KERNEL_ENTRY_INIT_H | ||
10 | |||
11 | #include <asm/cacheops.h> | ||
12 | #include <asm/addrspace.h> | ||
13 | |||
14 | #define CO_CONFIGPR_VALID 0x3F1F41FF /* valid bits to write to ConfigPR */ | ||
15 | #define HAZARD_CP0 nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; nop; | ||
16 | #define CACHE_OPC 0xBC000000 /* MIPS cache instruction opcode */ | ||
17 | #define ICACHE_LINE_SIZE 32 /* Instruction cache line size bytes */ | ||
18 | #define DCACHE_LINE_SIZE 32 /* Data cache line size in bytes */ | ||
19 | |||
20 | #define ICACHE_SET_COUNT 256 /* Instruction cache set count */ | ||
21 | #define DCACHE_SET_COUNT 128 /* Data cache set count */ | ||
22 | |||
23 | #define ICACHE_SET_SIZE (ICACHE_SET_COUNT * ICACHE_LINE_SIZE) | ||
24 | #define DCACHE_SET_SIZE (DCACHE_SET_COUNT * DCACHE_LINE_SIZE) | ||
25 | |||
26 | .macro kernel_entry_setup | ||
27 | .set push | ||
28 | .set noreorder | ||
29 | /* | ||
30 | * PNX8550 entry point, when running a non compressed | ||
31 | * kernel. When loading a zImage, the head.S code in | ||
32 | * arch/mips/zboot/pnx8550 will init the caches and, | ||
33 | * decompress the kernel, and branch to kernel_entry. | ||
34 | */ | ||
35 | cache_begin: li t0, (1<<28) | ||
36 | mtc0 t0, CP0_STATUS /* cp0 usable */ | ||
37 | HAZARD_CP0 | ||
38 | |||
39 | mtc0 zero, CP0_CAUSE | ||
40 | HAZARD_CP0 | ||
41 | |||
42 | |||
43 | /* Set static virtual to phys address translation and TLB disabled */ | ||
44 | mfc0 t0, CP0_CONFIG, 7 | ||
45 | HAZARD_CP0 | ||
46 | |||
47 | and t0,~((1<<19) | (1<<20)) /* TLB/MAP cleared */ | ||
48 | mtc0 t0, CP0_CONFIG, 7 | ||
49 | HAZARD_CP0 | ||
50 | |||
51 | /* CPU boots with kseg0 cache algo set to 0x2 -- uncached */ | ||
52 | |||
53 | init_icache | ||
54 | nop | ||
55 | init_dcache | ||
56 | nop | ||
57 | |||
58 | cachePr4450ICReset | ||
59 | nop | ||
60 | |||
61 | cachePr4450DCReset | ||
62 | nop | ||
63 | |||
64 | /* read ConfigPR into t0 */ | ||
65 | mfc0 t0, CP0_CONFIG, 7 | ||
66 | HAZARD_CP0 | ||
67 | |||
68 | /* enable the TLB */ | ||
69 | or t0, (1<<19) | ||
70 | |||
71 | /* disable the ICACHE: at least 10x slower */ | ||
72 | /* or t0, (1<<26) */ | ||
73 | |||
74 | /* disable the DCACHE; CONFIG_CPU_HAS_LLSC should not be set */ | ||
75 | /* or t0, (1<<27) */ | ||
76 | |||
77 | and t0, CO_CONFIGPR_VALID | ||
78 | |||
79 | /* enable TLB. */ | ||
80 | mtc0 t0, CP0_CONFIG, 7 | ||
81 | HAZARD_CP0 | ||
82 | cache_end: | ||
83 | /* Setup CMEM_0 to MMIO address space, 2MB */ | ||
84 | lui t0, 0x1BE0 | ||
85 | addi t0, t0, 0x3 | ||
86 | mtc0 $8, $22, 4 | ||
87 | nop | ||
88 | |||
89 | /* Setup CMEM_1, 128MB */ | ||
90 | lui t0, 0x1000 | ||
91 | addi t0, t0, 0xf | ||
92 | mtc0 $8, $22, 5 | ||
93 | nop | ||
94 | |||
95 | |||
96 | /* Setup CMEM_2, 32MB */ | ||
97 | lui t0, 0x1C00 | ||
98 | addi t0, t0, 0xb | ||
99 | mtc0 $8, $22, 6 | ||
100 | nop | ||
101 | |||
102 | /* Setup CMEM_3, 0MB */ | ||
103 | lui t0, 0x0 | ||
104 | addi t0, t0, 0x0 | ||
105 | mtc0 $8, $22, 7 | ||
106 | nop | ||
107 | |||
108 | /* Enable cache */ | ||
109 | mfc0 t0, CP0_CONFIG | ||
110 | HAZARD_CP0 | ||
111 | and t0, t0, 0xFFFFFFF8 | ||
112 | or t0, t0, 3 | ||
113 | mtc0 t0, CP0_CONFIG | ||
114 | HAZARD_CP0 | ||
115 | .set pop | ||
116 | .endm | ||
117 | |||
118 | .macro init_icache | ||
119 | .set push | ||
120 | .set noreorder | ||
121 | |||
122 | /* Get Cache Configuration */ | ||
123 | mfc0 t3, CP0_CONFIG, 1 | ||
124 | HAZARD_CP0 | ||
125 | |||
126 | /* get cache Line size */ | ||
127 | |||
128 | srl t1, t3, 19 /* C0_CONFIGPR_IL_SHIFT */ | ||
129 | andi t1, t1, 0x7 /* C0_CONFIGPR_IL_MASK */ | ||
130 | beq t1, zero, pr4450_instr_cache_invalidated /* if zero instruction cache is absent */ | ||
131 | nop | ||
132 | addiu t0, t1, 1 | ||
133 | ori t1, zero, 1 | ||
134 | sllv t1, t1, t0 | ||
135 | |||
136 | /* get max cache Index */ | ||
137 | srl t2, t3, 22 /* C0_CONFIGPR_IS_SHIFT */ | ||
138 | andi t2, t2, 0x7 /* C0_CONFIGPR_IS_MASK */ | ||
139 | addiu t0, t2, 6 | ||
140 | ori t2, zero, 1 | ||
141 | sllv t2, t2, t0 | ||
142 | |||
143 | /* get max cache way */ | ||
144 | srl t3, t3, 16 /* C0_CONFIGPR_IA_SHIFT */ | ||
145 | andi t3, t3, 0x7 /* C0_CONFIGPR_IA_MASK */ | ||
146 | addiu t3, t3, 1 | ||
147 | |||
148 | /* total no of cache lines */ | ||
149 | multu t2, t3 /* max index * max way */ | ||
150 | mflo t2 | ||
151 | addiu t2, t2, -1 | ||
152 | |||
153 | move t0, zero | ||
154 | pr4450_next_instruction_cache_set: | ||
155 | cache Index_Invalidate_I, 0(t0) | ||
156 | addu t0, t0, t1 /* add bytes in a line */ | ||
157 | bne t2, zero, pr4450_next_instruction_cache_set | ||
158 | addiu t2, t2, -1 /* reduce no of lines to invalidate by one */ | ||
159 | pr4450_instr_cache_invalidated: | ||
160 | .set pop | ||
161 | .endm | ||
162 | |||
163 | .macro init_dcache | ||
164 | .set push | ||
165 | .set noreorder | ||
166 | move t1, zero | ||
167 | |||
168 | /* Store Tag Information */ | ||
169 | mtc0 zero, CP0_TAGLO, 0 | ||
170 | HAZARD_CP0 | ||
171 | |||
172 | mtc0 zero, CP0_TAGHI, 0 | ||
173 | HAZARD_CP0 | ||
174 | |||
175 | /* Cache size is 16384 = 512 lines x 32 bytes per line */ | ||
176 | or t2, zero, (128*4)-1 /* 512 lines */ | ||
177 | /* Invalidate all lines */ | ||
178 | 2: | ||
179 | cache Index_Store_Tag_D, 0(t1) | ||
180 | addiu t2, t2, -1 | ||
181 | bne t2, zero, 2b | ||
182 | addiu t1, t1, 32 /* 32 bytes in a line */ | ||
183 | .set pop | ||
184 | .endm | ||
185 | |||
186 | .macro cachePr4450ICReset | ||
187 | .set push | ||
188 | .set noreorder | ||
189 | |||
190 | /* Save CP0 status reg on entry; */ | ||
191 | /* disable interrupts during cache reset */ | ||
192 | mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */ | ||
193 | HAZARD_CP0 | ||
194 | |||
195 | mtc0 zero, CP0_STATUS /* disable CPU interrupts */ | ||
196 | HAZARD_CP0 | ||
197 | |||
198 | or t1, zero, zero /* T1 = starting cache index (0) */ | ||
199 | ori t2, zero, (256 - 1) /* T2 = inst cache set cnt - 1 */ | ||
200 | |||
201 | icache_invd_loop: | ||
202 | /* 9 == register t1 */ | ||
203 | .word (CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \ | ||
204 | (0 * ICACHE_SET_SIZE)) /* invalidate inst cache WAY0 */ | ||
205 | .word (CACHE_OPC | (9 << 21) | (Index_Invalidate_I << 16) | \ | ||
206 | (1 * ICACHE_SET_SIZE)) /* invalidate inst cache WAY1 */ | ||
207 | |||
208 | addiu t1, t1, ICACHE_LINE_SIZE /* T1 = next cache line index */ | ||
209 | bne t2, zero, icache_invd_loop /* T2 = 0 if all sets invalidated */ | ||
210 | addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */ | ||
211 | |||
212 | /* Initialize the latches in the instruction cache tag */ | ||
213 | /* that drive the way selection tri-state bus drivers, by doing a */ | ||
214 | /* dummy load while the instruction cache is still disabled. */ | ||
215 | /* TODO: Is this needed ? */ | ||
216 | la t1, KSEG0 /* T1 = cached memory base address */ | ||
217 | lw zero, 0x0000(t1) /* (dummy read of first memory word) */ | ||
218 | |||
219 | mtc0 t0, CP0_STATUS /* restore interrupt status on entry */ | ||
220 | HAZARD_CP0 | ||
221 | .set pop | ||
222 | .endm | ||
223 | |||
224 | .macro cachePr4450DCReset | ||
225 | .set push | ||
226 | .set noreorder | ||
227 | mfc0 t0, CP0_STATUS /* T0 = interrupt status on entry */ | ||
228 | HAZARD_CP0 | ||
229 | mtc0 zero, CP0_STATUS /* disable CPU interrupts */ | ||
230 | HAZARD_CP0 | ||
231 | |||
232 | /* Writeback/invalidate entire data cache sets/ways/lines */ | ||
233 | or t1, zero, zero /* T1 = starting cache index (0) */ | ||
234 | ori t2, zero, (DCACHE_SET_COUNT - 1) /* T2 = data cache set cnt - 1 */ | ||
235 | |||
236 | dcache_wbinvd_loop: | ||
237 | /* 9 == register t1 */ | ||
238 | .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
239 | (0 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY0 */ | ||
240 | .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
241 | (1 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY1 */ | ||
242 | .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
243 | (2 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY2 */ | ||
244 | .word (CACHE_OPC | (9 << 21) | (Index_Writeback_Inv_D << 16) | \ | ||
245 | (3 * DCACHE_SET_SIZE)) /* writeback/invalidate WAY3 */ | ||
246 | |||
247 | addiu t1, t1, DCACHE_LINE_SIZE /* T1 = next data cache line index */ | ||
248 | bne t2, zero, dcache_wbinvd_loop /* T2 = 0 when wbinvd entire cache */ | ||
249 | addiu t2, t2, -1 /* decrement T2 set cnt (delay slot) */ | ||
250 | |||
251 | /* Initialize the latches in the data cache tag that drive the way | ||
252 | selection tri-state bus drivers, by doing a dummy load while the | ||
253 | data cache is still in the disabled mode. TODO: Is this needed ? */ | ||
254 | la t1, KSEG0 /* T1 = cached memory base address */ | ||
255 | lw zero, 0x0000(t1) /* (dummy read of first memory word) */ | ||
256 | |||
257 | mtc0 t0, CP0_STATUS /* restore interrupt status on entry */ | ||
258 | HAZARD_CP0 | ||
259 | .set pop | ||
260 | .endm | ||
261 | |||
262 | #endif /* __ASM_MACH_KERNEL_ENTRY_INIT_H */ | ||
diff --git a/include/asm-mips/mach-pnx8550/nand.h b/include/asm-mips/mach-pnx8550/nand.h new file mode 100644 index 000000000000..aefbc514ab09 --- /dev/null +++ b/include/asm-mips/mach-pnx8550/nand.h | |||
@@ -0,0 +1,121 @@ | |||
1 | #ifndef __PNX8550_NAND_H | ||
2 | #define __PNX8550_NAND_H | ||
3 | |||
4 | #define PNX8550_NAND_BASE_ADDR 0x10000000 | ||
5 | #define PNX8550_PCIXIO_BASE 0xBBE40000 | ||
6 | |||
7 | #define PNX8550_DMA_EXT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x800) | ||
8 | #define PNX8550_DMA_INT_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x804) | ||
9 | #define PNX8550_DMA_TRANS_SIZE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x808) | ||
10 | #define PNX8550_DMA_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x80c) | ||
11 | #define PNX8550_XIO_SEL0 *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x814) | ||
12 | #define PNX8550_GPXIO_ADDR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x820) | ||
13 | #define PNX8550_GPXIO_WR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x824) | ||
14 | #define PNX8550_GPXIO_RD *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x828) | ||
15 | #define PNX8550_GPXIO_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x82C) | ||
16 | #define PNX8550_XIO_FLASH_CTRL *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0x830) | ||
17 | #define PNX8550_GPXIO_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb0) | ||
18 | #define PNX8550_GPXIO_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb4) | ||
19 | #define PNX8550_GPXIO_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfb8) | ||
20 | #define PNX8550_DMA_INT_STATUS *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd0) | ||
21 | #define PNX8550_DMA_INT_ENABLE *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd4) | ||
22 | #define PNX8550_DMA_INT_CLEAR *(volatile unsigned long *)(PNX8550_PCIXIO_BASE + 0xfd8) | ||
23 | |||
24 | #define PNX8550_XIO_SEL0_EN_16BIT 0x00800000 | ||
25 | #define PNX8550_XIO_SEL0_USE_ACK 0x00400000 | ||
26 | #define PNX8550_XIO_SEL0_REN_HIGH 0x00100000 | ||
27 | #define PNX8550_XIO_SEL0_REN_LOW 0x00040000 | ||
28 | #define PNX8550_XIO_SEL0_WEN_HIGH 0x00010000 | ||
29 | #define PNX8550_XIO_SEL0_WEN_LOW 0x00004000 | ||
30 | #define PNX8550_XIO_SEL0_WAIT 0x00000200 | ||
31 | #define PNX8550_XIO_SEL0_OFFSET 0x00000020 | ||
32 | #define PNX8550_XIO_SEL0_TYPE_68360 0x00000000 | ||
33 | #define PNX8550_XIO_SEL0_TYPE_NOR 0x00000008 | ||
34 | #define PNX8550_XIO_SEL0_TYPE_NAND 0x00000010 | ||
35 | #define PNX8550_XIO_SEL0_TYPE_IDE 0x00000018 | ||
36 | #define PNX8550_XIO_SEL0_SIZE_8MB 0x00000000 | ||
37 | #define PNX8550_XIO_SEL0_SIZE_16MB 0x00000002 | ||
38 | #define PNX8550_XIO_SEL0_SIZE_32MB 0x00000004 | ||
39 | #define PNX8550_XIO_SEL0_SIZE_64MB 0x00000006 | ||
40 | #define PNX8550_XIO_SEL0_ENAB 0x00000001 | ||
41 | |||
42 | #define PNX8550_SEL0_DEFAULT ((PNX8550_XIO_SEL0_EN_16BIT) | \ | ||
43 | (PNX8550_XIO_SEL0_REN_HIGH*0)| \ | ||
44 | (PNX8550_XIO_SEL0_REN_LOW*2) | \ | ||
45 | (PNX8550_XIO_SEL0_WEN_HIGH*0)| \ | ||
46 | (PNX8550_XIO_SEL0_WEN_LOW*2) | \ | ||
47 | (PNX8550_XIO_SEL0_WAIT*4) | \ | ||
48 | (PNX8550_XIO_SEL0_OFFSET*0) | \ | ||
49 | (PNX8550_XIO_SEL0_TYPE_NAND) | \ | ||
50 | (PNX8550_XIO_SEL0_SIZE_32MB) | \ | ||
51 | (PNX8550_XIO_SEL0_ENAB)) | ||
52 | |||
53 | #define PNX8550_GPXIO_PENDING 0x00000200 | ||
54 | #define PNX8550_GPXIO_DONE 0x00000100 | ||
55 | #define PNX8550_GPXIO_CLR_DONE 0x00000080 | ||
56 | #define PNX8550_GPXIO_INIT 0x00000040 | ||
57 | #define PNX8550_GPXIO_READ_CMD 0x00000010 | ||
58 | #define PNX8550_GPXIO_BEN 0x0000000F | ||
59 | |||
60 | #define PNX8550_XIO_FLASH_64MB 0x00200000 | ||
61 | #define PNX8550_XIO_FLASH_INC_DATA 0x00100000 | ||
62 | #define PNX8550_XIO_FLASH_CMD_PH 0x000C0000 | ||
63 | #define PNX8550_XIO_FLASH_CMD_PH2 0x00080000 | ||
64 | #define PNX8550_XIO_FLASH_CMD_PH1 0x00040000 | ||
65 | #define PNX8550_XIO_FLASH_CMD_PH0 0x00000000 | ||
66 | #define PNX8550_XIO_FLASH_ADR_PH 0x00030000 | ||
67 | #define PNX8550_XIO_FLASH_ADR_PH3 0x00030000 | ||
68 | #define PNX8550_XIO_FLASH_ADR_PH2 0x00020000 | ||
69 | #define PNX8550_XIO_FLASH_ADR_PH1 0x00010000 | ||
70 | #define PNX8550_XIO_FLASH_ADR_PH0 0x00000000 | ||
71 | #define PNX8550_XIO_FLASH_CMD_B(x) ((x<<8) & 0x0000FF00) | ||
72 | #define PNX8550_XIO_FLASH_CMD_A(x) (x & 0x000000FF) | ||
73 | |||
74 | #define PNX8550_XIO_INT_ACK 0x00004000 | ||
75 | #define PNX8550_XIO_INT_COMPL 0x00002000 | ||
76 | #define PNX8550_XIO_INT_NONSUP 0x00000200 | ||
77 | #define PNX8550_XIO_INT_ABORT 0x00000004 | ||
78 | |||
79 | #define PNX8550_DMA_CTRL_SINGLE_DATA 0x00000400 | ||
80 | #define PNX8550_DMA_CTRL_SND2XIO 0x00000200 | ||
81 | #define PNX8550_DMA_CTRL_FIX_ADDR 0x00000100 | ||
82 | #define PNX8550_DMA_CTRL_BURST_8 0x00000000 | ||
83 | #define PNX8550_DMA_CTRL_BURST_16 0x00000020 | ||
84 | #define PNX8550_DMA_CTRL_BURST_32 0x00000040 | ||
85 | #define PNX8550_DMA_CTRL_BURST_64 0x00000060 | ||
86 | #define PNX8550_DMA_CTRL_BURST_128 0x00000080 | ||
87 | #define PNX8550_DMA_CTRL_BURST_256 0x000000A0 | ||
88 | #define PNX8550_DMA_CTRL_BURST_512 0x000000C0 | ||
89 | #define PNX8550_DMA_CTRL_BURST_NORES 0x000000E0 | ||
90 | #define PNX8550_DMA_CTRL_INIT_DMA 0x00000010 | ||
91 | #define PNX8550_DMA_CTRL_CMD_TYPE 0x0000000F | ||
92 | |||
93 | /* see PCI system arch, page 100 for the full list: */ | ||
94 | #define PNX8550_DMA_CTRL_PCI_CMD_READ 0x00000006 | ||
95 | #define PNX8550_DMA_CTRL_PCI_CMD_WRITE 0x00000007 | ||
96 | |||
97 | #define PNX8550_DMA_INT_STAT_ACK_DONE (1<<14) | ||
98 | #define PNX8550_DMA_INT_STAT_DMA_DONE (1<<12) | ||
99 | #define PNX8550_DMA_INT_STAT_DMA_ERR (1<<9) | ||
100 | #define PNX8550_DMA_INT_STAT_PERR5 (1<<5) | ||
101 | #define PNX8550_DMA_INT_STAT_PERR4 (1<<4) | ||
102 | #define PNX8550_DMA_INT_STAT_M_ABORT (1<<2) | ||
103 | #define PNX8550_DMA_INT_STAT_T_ABORT (1<<1) | ||
104 | |||
105 | #define PNX8550_DMA_INT_EN_ACK_DONE (1<<14) | ||
106 | #define PNX8550_DMA_INT_EN_DMA_DONE (1<<12) | ||
107 | #define PNX8550_DMA_INT_EN_DMA_ERR (1<<9) | ||
108 | #define PNX8550_DMA_INT_EN_PERR5 (1<<5) | ||
109 | #define PNX8550_DMA_INT_EN_PERR4 (1<<4) | ||
110 | #define PNX8550_DMA_INT_EN_M_ABORT (1<<2) | ||
111 | #define PNX8550_DMA_INT_EN_T_ABORT (1<<1) | ||
112 | |||
113 | #define PNX8550_DMA_INT_CLR_ACK_DONE (1<<14) | ||
114 | #define PNX8550_DMA_INT_CLR_DMA_DONE (1<<12) | ||
115 | #define PNX8550_DMA_INT_CLR_DMA_ERR (1<<9) | ||
116 | #define PNX8550_DMA_INT_CLR_PERR5 (1<<5) | ||
117 | #define PNX8550_DMA_INT_CLR_PERR4 (1<<4) | ||
118 | #define PNX8550_DMA_INT_CLR_M_ABORT (1<<2) | ||
119 | #define PNX8550_DMA_INT_CLR_T_ABORT (1<<1) | ||
120 | |||
121 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/pci.h b/include/asm-mips/mach-pnx8550/pci.h new file mode 100644 index 000000000000..b921508d701b --- /dev/null +++ b/include/asm-mips/mach-pnx8550/pci.h | |||
@@ -0,0 +1,185 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * PCI specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_PCI_H | ||
23 | #define __PNX8550_PCI_H | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | #include <linux/pci.h> | ||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/init.h> | ||
29 | |||
30 | #define PCI_ACCESS_READ 0 | ||
31 | #define PCI_ACCESS_WRITE 1 | ||
32 | |||
33 | #define PCI_CMD_IOR 0x20 | ||
34 | #define PCI_CMD_IOW 0x30 | ||
35 | #define PCI_CMD_CONFIG_READ 0xa0 | ||
36 | #define PCI_CMD_CONFIG_WRITE 0xb0 | ||
37 | |||
38 | #define PCI_IO_TIMEOUT 1000 | ||
39 | #define PCI_IO_RETRY 5 | ||
40 | /* Timeout for IO and CFG accesses. | ||
41 | This is in 1/1024 th of a jiffie(=10ms) | ||
42 | i.e. approx 10us */ | ||
43 | #define PCI_IO_JIFFIES_TIMEOUT 40 | ||
44 | #define PCI_IO_JIFFIES_SHIFT 10 | ||
45 | |||
46 | #define PCI_BYTE_ENABLE_MASK 0x0000000f | ||
47 | #define PCI_CFG_BUS_SHIFT 16 | ||
48 | #define PCI_CFG_FUNC_SHIFT 8 | ||
49 | #define PCI_CFG_REG_SHIFT 2 | ||
50 | |||
51 | #define PCI_BASE 0x1be00000 | ||
52 | #define PCI_SETUP 0x00040010 | ||
53 | #define PCI_DIS_REQGNT (1<<30) | ||
54 | #define PCI_DIS_REQGNTA (1<<29) | ||
55 | #define PCI_DIS_REQGNTB (1<<28) | ||
56 | #define PCI_D2_SUPPORT (1<<27) | ||
57 | #define PCI_D1_SUPPORT (1<<26) | ||
58 | #define PCI_EN_TA (1<<24) | ||
59 | #define PCI_EN_PCI2MMI (1<<23) | ||
60 | #define PCI_EN_XIO (1<<22) | ||
61 | #define PCI_BASE18_PREF (1<<21) | ||
62 | #define SIZE_16M 0x3 | ||
63 | #define SIZE_32M 0x4 | ||
64 | #define SIZE_64M 0x5 | ||
65 | #define SIZE_128M 0x6 | ||
66 | #define PCI_SETUP_BASE18_SIZE(X) (X<<18) | ||
67 | #define PCI_SETUP_BASE18_EN (1<<17) | ||
68 | #define PCI_SETUP_BASE14_PREF (1<<16) | ||
69 | #define PCI_SETUP_BASE14_SIZE(X) (X<<12) | ||
70 | #define PCI_SETUP_BASE14_EN (1<<11) | ||
71 | #define PCI_SETUP_BASE10_PREF (1<<10) | ||
72 | #define PCI_SETUP_BASE10_SIZE(X) (X<<7) | ||
73 | #define PCI_SETUP_CFGMANAGE_EN (1<<1) | ||
74 | #define PCI_SETUP_PCIARB_EN (1<<0) | ||
75 | |||
76 | #define PCI_CTRL 0x040014 | ||
77 | #define PCI_SWPB_DCS_PCI (1<<16) | ||
78 | #define PCI_SWPB_PCI_PCI (1<<15) | ||
79 | #define PCI_SWPB_PCI_DCS (1<<14) | ||
80 | #define PCI_REG_WR_POST (1<<13) | ||
81 | #define PCI_XIO_WR_POST (1<<12) | ||
82 | #define PCI_PCI2_WR_POST (1<<13) | ||
83 | #define PCI_PCI1_WR_POST (1<<12) | ||
84 | #define PCI_SERR_SEEN (1<<11) | ||
85 | #define PCI_B10_SPEC_RD (1<<6) | ||
86 | #define PCI_B14_SPEC_RD (1<<5) | ||
87 | #define PCI_B18_SPEC_RD (1<<4) | ||
88 | #define PCI_B10_NOSUBWORD (1<<3) | ||
89 | #define PCI_B14_NOSUBWORD (1<<2) | ||
90 | #define PCI_B18_NOSUBWORD (1<<1) | ||
91 | #define PCI_RETRY_TMREN (1<<0) | ||
92 | |||
93 | #define PCI_BASE1_LO 0x040018 | ||
94 | #define PCI_BASE1_HI 0x04001C | ||
95 | #define PCI_BASE2_LO 0x040020 | ||
96 | #define PCI_BASE2_HI 0x040024 | ||
97 | #define PCI_RDLIFETIM 0x040028 | ||
98 | #define PCI_GPPM_ADDR 0x04002C | ||
99 | #define PCI_GPPM_WDAT 0x040030 | ||
100 | #define PCI_GPPM_RDAT 0x040034 | ||
101 | #define PCI_GPPM_CTRL 0x040038 | ||
102 | #define GPPM_DONE (1<<10) | ||
103 | #define INIT_PCI_CYCLE (1<<9) | ||
104 | #define GPPM_CMD(X) (((X)&0xf)<<4) | ||
105 | #define GPPM_BYTEEN(X) ((X)&0xf) | ||
106 | #define PCI_UNLOCKREG 0x04003C | ||
107 | #define UNLOCK_SSID(X) (((X)&0xff)<<8) | ||
108 | #define UNLOCK_SETUP(X) (((X)&0xff)<<0) | ||
109 | #define UNLOCK_MAGIC 0xCA | ||
110 | #define PCI_DEV_VEND_ID 0x040040 | ||
111 | #define DEVICE_ID(X) (((X)>>16)&0xffff) | ||
112 | #define VENDOR_ID(X) (((X)&0xffff)) | ||
113 | #define PCI_CFG_CMDSTAT 0x040044 | ||
114 | #define PCI_CFG_STATUS(X) (((X)>>16)&0xffff) | ||
115 | #define PCI_CFG_COMMAND(X) ((X)&0xffff) | ||
116 | #define PCI_CLASS_REV 0x040048 | ||
117 | #define PCI_CLASSCODE(X) (((X)>>8)&0xffffff) | ||
118 | #define PCI_REVID(X) ((X)&0xff) | ||
119 | #define PCI_LAT_TMR 0x04004c | ||
120 | #define PCI_BASE10 0x040050 | ||
121 | #define PCI_BASE14 0x040054 | ||
122 | #define PCI_BASE18 0x040058 | ||
123 | #define PCI_SUBSYS_ID 0x04006c | ||
124 | #define PCI_CAP_PTR 0x040074 | ||
125 | #define PCI_CFG_MISC 0x04007c | ||
126 | #define PCI_PMC 0x040080 | ||
127 | #define PCI_PWR_STATE 0x040084 | ||
128 | #define PCI_IO 0x040088 | ||
129 | #define PCI_SLVTUNING 0x04008C | ||
130 | #define PCI_DMATUNING 0x040090 | ||
131 | #define PCI_DMAEADDR 0x040800 | ||
132 | #define PCI_DMAIADDR 0x040804 | ||
133 | #define PCI_DMALEN 0x040808 | ||
134 | #define PCI_DMACTRL 0x04080C | ||
135 | #define PCI_XIOCTRL 0x040810 | ||
136 | #define PCI_SEL0PROF 0x040814 | ||
137 | #define PCI_SEL1PROF 0x040818 | ||
138 | #define PCI_SEL2PROF 0x04081C | ||
139 | #define PCI_GPXIOADDR 0x040820 | ||
140 | #define PCI_NANDCTRLS 0x400830 | ||
141 | #define PCI_SEL3PROF 0x040834 | ||
142 | #define PCI_SEL4PROF 0x040838 | ||
143 | #define PCI_GPXIO_STAT 0x040FB0 | ||
144 | #define PCI_GPXIO_IMASK 0x040FB4 | ||
145 | #define PCI_GPXIO_ICLR 0x040FB8 | ||
146 | #define PCI_GPXIO_ISET 0x040FBC | ||
147 | #define PCI_GPPM_STATUS 0x040FC0 | ||
148 | #define GPPM_DONE (1<<10) | ||
149 | #define GPPM_ERR (1<<9) | ||
150 | #define GPPM_MPAR_ERR (1<<8) | ||
151 | #define GPPM_PAR_ERR (1<<7) | ||
152 | #define GPPM_R_MABORT (1<<2) | ||
153 | #define GPPM_R_TABORT (1<<1) | ||
154 | #define PCI_GPPM_IMASK 0x040FC4 | ||
155 | #define PCI_GPPM_ICLR 0x040FC8 | ||
156 | #define PCI_GPPM_ISET 0x040FCC | ||
157 | #define PCI_DMA_STATUS 0x040FD0 | ||
158 | #define PCI_DMA_IMASK 0x040FD4 | ||
159 | #define PCI_DMA_ICLR 0x040FD8 | ||
160 | #define PCI_DMA_ISET 0x040FDC | ||
161 | #define PCI_ISTATUS 0x040FE0 | ||
162 | #define PCI_IMASK 0x040FE4 | ||
163 | #define PCI_ICLR 0x040FE8 | ||
164 | #define PCI_ISET 0x040FEC | ||
165 | #define PCI_MOD_ID 0x040FFC | ||
166 | |||
167 | /* | ||
168 | * PCI configuration cycle AD bus definition | ||
169 | */ | ||
170 | /* Type 0 */ | ||
171 | #define PCI_CFG_TYPE0_REG_SHF 0 | ||
172 | #define PCI_CFG_TYPE0_FUNC_SHF 8 | ||
173 | |||
174 | /* Type 1 */ | ||
175 | #define PCI_CFG_TYPE1_REG_SHF 0 | ||
176 | #define PCI_CFG_TYPE1_FUNC_SHF 8 | ||
177 | #define PCI_CFG_TYPE1_DEV_SHF 11 | ||
178 | #define PCI_CFG_TYPE1_BUS_SHF 16 | ||
179 | |||
180 | /* | ||
181 | * Ethernet device DP83816 definition | ||
182 | */ | ||
183 | #define DP83816_IRQ_ETHER 66 | ||
184 | |||
185 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/uart.h b/include/asm-mips/mach-pnx8550/uart.h new file mode 100644 index 000000000000..e32b9a23d70e --- /dev/null +++ b/include/asm-mips/mach-pnx8550/uart.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __IP3106_UART_H | ||
2 | #define __IP3106_UART_H | ||
3 | |||
4 | #include <int.h> | ||
5 | |||
6 | /* early macros for kgdb use. fixme: clean this up */ | ||
7 | |||
8 | #define UART_BASE 0xbbe4a000 /* PNX8550 */ | ||
9 | |||
10 | #define PNX8550_UART_PORT0 (UART_BASE) | ||
11 | #define PNX8550_UART_PORT1 (UART_BASE + 0x1000) | ||
12 | |||
13 | #define PNX8550_UART_INT(x) (PNX8550_INT_GIC_MIN+19+x) | ||
14 | #define IRQ_TO_UART(x) (x-PNX8550_INT_GIC_MIN-19) | ||
15 | |||
16 | #endif | ||
diff --git a/include/asm-mips/mach-pnx8550/usb.h b/include/asm-mips/mach-pnx8550/usb.h new file mode 100644 index 000000000000..483b7fc65d41 --- /dev/null +++ b/include/asm-mips/mach-pnx8550/usb.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * | ||
3 | * BRIEF MODULE DESCRIPTION | ||
4 | * USB specific definitions | ||
5 | * | ||
6 | * Author: source@mvista.com | ||
7 | * | ||
8 | * This program is free software; you can distribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (Version 2) as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
15 | * for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef __PNX8550_USB_H | ||
23 | #define __PNX8550_USB_H | ||
24 | |||
25 | /* | ||
26 | * USB Host controller | ||
27 | */ | ||
28 | |||
29 | #define PNX8550_USB_OHCI_OP_BASE 0x1be48000 | ||
30 | #define PNX8550_USB_OHCI_OP_LEN 0x1000 | ||
31 | |||
32 | #endif | ||
diff --git a/include/asm-mips/mach-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm200/cpu-feature-overrides.h index f48736032b2a..79f9b064c864 100644 --- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h +++ b/include/asm-mips/mach-rm200/cpu-feature-overrides.h | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
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_4ktlb 1 | 17 | #define cpu_has_4kcache 1 |
18 | #define cpu_has_fpu 1 | 18 | #define cpu_has_fpu 1 |
19 | #define cpu_has_32fpr 1 | 19 | #define cpu_has_32fpr 1 |
20 | #define cpu_has_counter 1 | 20 | #define cpu_has_counter 1 |
@@ -31,6 +31,7 @@ | |||
31 | #define cpu_has_vtag_icache 0 | 31 | #define cpu_has_vtag_icache 0 |
32 | #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) | 32 | #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) |
33 | #define cpu_has_ic_fills_f_dc 0 | 33 | #define cpu_has_ic_fills_f_dc 0 |
34 | #define cpu_has_dsp 0 | ||
34 | #define cpu_has_nofpuex 0 | 35 | #define cpu_has_nofpuex 0 |
35 | #define cpu_has_64bits 1 | 36 | #define cpu_has_64bits 1 |
36 | 37 | ||
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h index a3a2cc6014b2..193a666cd131 100644 --- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h +++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define cpu_has_vtag_icache 1 | 25 | #define cpu_has_vtag_icache 1 |
26 | #define cpu_has_dc_aliases 0 | 26 | #define cpu_has_dc_aliases 0 |
27 | #define cpu_has_ic_fills_f_dc 0 | 27 | #define cpu_has_ic_fills_f_dc 0 |
28 | #define cpu_has_dsp 0 | ||
28 | #define cpu_icache_snoops_remote_store 0 | 29 | #define cpu_icache_snoops_remote_store 0 |
29 | 30 | ||
30 | #define cpu_has_nofpuex 0 | 31 | #define cpu_has_nofpuex 0 |
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h new file mode 100644 index 000000000000..cadbe8eda79c --- /dev/null +++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h | |||
@@ -0,0 +1,66 @@ | |||
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 Chris Dearman | ||
7 | */ | ||
8 | #ifndef __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H | ||
9 | #define __ASM_MACH_SIM_CPU_FEATURE_OVERRIDES_H | ||
10 | |||
11 | #include <linux/config.h> | ||
12 | |||
13 | /* | ||
14 | * CPU feature overrides for MIPS boards | ||
15 | */ | ||
16 | #ifdef CONFIG_CPU_MIPS32 | ||
17 | #define cpu_has_tlb 1 | ||
18 | #define cpu_has_4kex 1 | ||
19 | #define cpu_has_4kcache 1 | ||
20 | #define cpu_has_fpu 0 | ||
21 | /* #define cpu_has_32fpr ? */ | ||
22 | #define cpu_has_counter 1 | ||
23 | /* #define cpu_has_watch ? */ | ||
24 | #define cpu_has_divec 1 | ||
25 | #define cpu_has_vce 0 | ||
26 | /* #define cpu_has_cache_cdex_p ? */ | ||
27 | /* #define cpu_has_cache_cdex_s ? */ | ||
28 | /* #define cpu_has_prefetch ? */ | ||
29 | #define cpu_has_mcheck 1 | ||
30 | /* #define cpu_has_ejtag ? */ | ||
31 | #define cpu_has_llsc 1 | ||
32 | /* #define cpu_has_vtag_icache ? */ | ||
33 | /* #define cpu_has_dc_aliases ? */ | ||
34 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
35 | #define cpu_has_nofpuex 0 | ||
36 | /* #define cpu_has_64bits ? */ | ||
37 | /* #define cpu_has_64bit_zero_reg ? */ | ||
38 | /* #define cpu_has_subset_pcaches ? */ | ||
39 | #endif | ||
40 | |||
41 | #ifdef CONFIG_CPU_MIPS64 | ||
42 | #define cpu_has_tlb 1 | ||
43 | #define cpu_has_4kex 1 | ||
44 | #define cpu_has_4kcache 1 | ||
45 | /* #define cpu_has_fpu ? */ | ||
46 | /* #define cpu_has_32fpr ? */ | ||
47 | #define cpu_has_counter 1 | ||
48 | /* #define cpu_has_watch ? */ | ||
49 | #define cpu_has_divec 1 | ||
50 | #define cpu_has_vce 0 | ||
51 | /* #define cpu_has_cache_cdex_p ? */ | ||
52 | /* #define cpu_has_cache_cdex_s ? */ | ||
53 | /* #define cpu_has_prefetch ? */ | ||
54 | #define cpu_has_mcheck 1 | ||
55 | /* #define cpu_has_ejtag ? */ | ||
56 | #define cpu_has_llsc 1 | ||
57 | /* #define cpu_has_vtag_icache ? */ | ||
58 | /* #define cpu_has_dc_aliases ? */ | ||
59 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
60 | #define cpu_has_nofpuex 0 | ||
61 | /* #define cpu_has_64bits ? */ | ||
62 | /* #define cpu_has_64bit_zero_reg ? */ | ||
63 | /* #define cpu_has_subset_pcaches ? */ | ||
64 | #endif | ||
65 | |||
66 | #endif /* __ASM_MACH_MIPS_CPU_FEATURE_OVERRIDES_H */ | ||
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h index 58603e3daca6..463d051f4683 100644 --- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h +++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define cpu_has_vtag_icache 0 | 25 | #define cpu_has_vtag_icache 0 |
26 | #define cpu_has_dc_aliases 0 | 26 | #define cpu_has_dc_aliases 0 |
27 | #define cpu_has_ic_fills_f_dc 0 | 27 | #define cpu_has_ic_fills_f_dc 0 |
28 | #define cpu_has_dsp 0 | ||
28 | #define cpu_icache_snoops_remote_store 0 | 29 | #define cpu_icache_snoops_remote_store 0 |
29 | 30 | ||
30 | #define cpu_has_nofpuex 0 | 31 | #define cpu_has_nofpuex 0 |
@@ -36,10 +37,4 @@ | |||
36 | #define cpu_icache_line_size() 32 | 37 | #define cpu_icache_line_size() 32 |
37 | #define cpu_scache_line_size() 32 | 38 | #define cpu_scache_line_size() 32 |
38 | 39 | ||
39 | /* | ||
40 | * On the RM9000 we need to ensure that I-cache lines being fetches only | ||
41 | * contain valid instructions are funny things will happen. | ||
42 | */ | ||
43 | #define PLAT_TRAMPOLINE_STUFF_LINE 32UL | ||
44 | |||
45 | #endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */ | 40 | #endif /* __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H */ |
diff --git a/include/asm-mips/mips-boards/generic.h b/include/asm-mips/mips-boards/generic.h index 65d1d16eab16..25b6ffc26623 100644 --- a/include/asm-mips/mips-boards/generic.h +++ b/include/asm-mips/mips-boards/generic.h | |||
@@ -66,6 +66,7 @@ | |||
66 | #define MIPS_REVISION_CORID_CORE_EMUL 6 | 66 | #define MIPS_REVISION_CORID_CORE_EMUL 6 |
67 | #define MIPS_REVISION_CORID_CORE_FPGA2 7 | 67 | #define MIPS_REVISION_CORID_CORE_FPGA2 7 |
68 | #define MIPS_REVISION_CORID_CORE_FPGAR2 8 | 68 | #define MIPS_REVISION_CORID_CORE_FPGAR2 8 |
69 | #define MIPS_REVISION_CORID_CORE_FPGA3 9 | ||
69 | 70 | ||
70 | /**** Artificial corid defines ****/ | 71 | /**** Artificial corid defines ****/ |
71 | /* | 72 | /* |
@@ -79,4 +80,10 @@ | |||
79 | 80 | ||
80 | extern unsigned int mips_revision_corid; | 81 | extern unsigned int mips_revision_corid; |
81 | 82 | ||
83 | #ifdef CONFIG_PCI | ||
84 | extern void mips_pcibios_init(void); | ||
85 | #else | ||
86 | #define mips_pcibios_init() do { } while (0) | ||
87 | #endif | ||
88 | |||
82 | #endif /* __ASM_MIPS_BOARDS_GENERIC_H */ | 89 | #endif /* __ASM_MIPS_BOARDS_GENERIC_H */ |
diff --git a/include/asm-mips/mips-boards/maltaint.h b/include/asm-mips/mips-boards/maltaint.h index 376181882e81..da6cc2fbbc78 100644 --- a/include/asm-mips/mips-boards/maltaint.h +++ b/include/asm-mips/mips-boards/maltaint.h | |||
@@ -25,9 +25,63 @@ | |||
25 | #ifndef _MIPS_MALTAINT_H | 25 | #ifndef _MIPS_MALTAINT_H |
26 | #define _MIPS_MALTAINT_H | 26 | #define _MIPS_MALTAINT_H |
27 | 27 | ||
28 | /* Number of IRQ supported on hw interrupt 0. */ | 28 | /* |
29 | #define MALTAINT_END 16 | 29 | * Interrupts 0..15 are used for Malta ISA compatible interrupts |
30 | */ | ||
31 | #define MALTA_INT_BASE 0 | ||
32 | |||
33 | /* | ||
34 | * Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode) | ||
35 | */ | ||
36 | #define MIPSCPU_INT_BASE 16 | ||
37 | |||
38 | /* CPU interrupt offsets */ | ||
39 | #define MIPSCPU_INT_SW0 0 | ||
40 | #define MIPSCPU_INT_SW1 1 | ||
41 | #define MIPSCPU_INT_MB0 2 | ||
42 | #define MIPSCPU_INT_I8259A MIPSCPU_INT_MB0 | ||
43 | #define MIPSCPU_INT_MB1 3 | ||
44 | #define MIPSCPU_INT_SMI MIPSCPU_INT_MB1 | ||
45 | #define MIPSCPU_INT_MB2 4 | ||
46 | #define MIPSCPU_INT_MB3 5 | ||
47 | #define MIPSCPU_INT_COREHI MIPSCPU_INT_MB3 | ||
48 | #define MIPSCPU_INT_MB4 6 | ||
49 | #define MIPSCPU_INT_CORELO MIPSCPU_INT_MB4 | ||
50 | #define MIPSCPU_INT_CPUCTR 7 | ||
51 | |||
52 | /* | ||
53 | * Interrupts 64..127 are used for Soc-it Classic interrupts | ||
54 | */ | ||
55 | #define MSC01C_INT_BASE 64 | ||
56 | |||
57 | /* SOC-it Classic interrupt offsets */ | ||
58 | #define MSC01C_INT_TMR 0 | ||
59 | #define MSC01C_INT_PCI 1 | ||
60 | |||
61 | /* | ||
62 | * Interrupts 64..127 are used for Soc-it EIC interrupts | ||
63 | */ | ||
64 | #define MSC01E_INT_BASE 64 | ||
65 | |||
66 | /* SOC-it EIC interrupt offsets */ | ||
67 | #define MSC01E_INT_SW0 1 | ||
68 | #define MSC01E_INT_SW1 2 | ||
69 | #define MSC01E_INT_MB0 3 | ||
70 | #define MSC01E_INT_I8259A MSC01E_INT_MB0 | ||
71 | #define MSC01E_INT_MB1 4 | ||
72 | #define MSC01E_INT_SMI MSC01E_INT_MB1 | ||
73 | #define MSC01E_INT_MB2 5 | ||
74 | #define MSC01E_INT_MB3 6 | ||
75 | #define MSC01E_INT_COREHI MSC01E_INT_MB3 | ||
76 | #define MSC01E_INT_MB4 7 | ||
77 | #define MSC01E_INT_CORELO MSC01E_INT_MB4 | ||
78 | #define MSC01E_INT_TMR 8 | ||
79 | #define MSC01E_INT_PCI 9 | ||
80 | #define MSC01E_INT_PERFCTR 10 | ||
81 | #define MSC01E_INT_CPUCTR 11 | ||
30 | 82 | ||
83 | #ifndef __ASSEMBLY__ | ||
31 | extern void maltaint_init(void); | 84 | extern void maltaint_init(void); |
85 | #endif | ||
32 | 86 | ||
33 | #endif /* !(_MIPS_MALTAINT_H) */ | 87 | #endif /* !(_MIPS_MALTAINT_H) */ |
diff --git a/include/asm-mips/mips-boards/msc01_pci.h b/include/asm-mips/mips-boards/msc01_pci.h index 6b2a87a38f4b..8eaefb837b9d 100644 --- a/include/asm-mips/mips-boards/msc01_pci.h +++ b/include/asm-mips/mips-boards/msc01_pci.h | |||
@@ -1,8 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * PCI Register definitions for the MIPS System Controller. | 2 | * PCI Register definitions for the MIPS System Controller. |
3 | * | 3 | * |
4 | * Carsten Langgaard, carstenl@mips.com | 4 | * Copyright (C) 2002, 2005 MIPS Technologies, Inc. All rights reserved. |
5 | * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved. | 5 | * Authors: Carsten Langgaard <carstenl@mips.com> |
6 | * Maciej W. Rozycki <macro@mips.com> | ||
6 | * | 7 | * |
7 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
@@ -29,22 +30,22 @@ | |||
29 | #define MSC01_PCI_CFGADDR_OFS 0x0610 | 30 | #define MSC01_PCI_CFGADDR_OFS 0x0610 |
30 | #define MSC01_PCI_CFGDATA_OFS 0x0618 | 31 | #define MSC01_PCI_CFGDATA_OFS 0x0618 |
31 | #define MSC01_PCI_IACK_OFS 0x0620 | 32 | #define MSC01_PCI_IACK_OFS 0x0620 |
32 | #define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */ | 33 | #define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */ |
33 | #define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */ | 34 | #define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */ |
34 | #define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */ | 35 | #define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */ |
35 | #define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */ | 36 | #define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */ |
36 | #define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */ | 37 | #define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */ |
37 | #define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */ | 38 | #define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */ |
38 | #define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */ | 39 | #define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */ |
39 | #define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */ | 40 | #define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */ |
40 | #define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */ | 41 | #define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */ |
41 | #define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */ | 42 | #define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */ |
42 | #define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */ | 43 | #define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */ |
43 | #define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */ | 44 | #define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */ |
44 | #define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */ | 45 | #define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */ |
45 | #define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */ | 46 | #define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */ |
46 | #define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */ | 47 | #define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */ |
47 | #define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */ | 48 | #define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */ |
48 | #define MSC01_PCI_BAR0_OFS 0x2220 | 49 | #define MSC01_PCI_BAR0_OFS 0x2220 |
49 | #define MSC01_PCI_CFG_OFS 0x2380 | 50 | #define MSC01_PCI_CFG_OFS 0x2380 |
50 | #define MSC01_PCI_SWAP_OFS 0x2388 | 51 | #define MSC01_PCI_SWAP_OFS 0x2388 |
@@ -86,73 +87,73 @@ | |||
86 | #define MSC01_PCI_P2SCMAPL_MAP_SHF 24 | 87 | #define MSC01_PCI_P2SCMAPL_MAP_SHF 24 |
87 | #define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000 | 88 | #define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000 |
88 | 89 | ||
89 | #define MSC01_PCI_INTCFG_RST_SHF 10 | 90 | #define MSC01_PCI_INTCFG_RST_SHF 10 |
90 | #define MSC01_PCI_INTCFG_RST_MSK 0x00000400 | 91 | #define MSC01_PCI_INTCFG_RST_MSK 0x00000400 |
91 | #define MSC01_PCI_INTCFG_RST_BIT 0x00000400 | 92 | #define MSC01_PCI_INTCFG_RST_BIT 0x00000400 |
92 | #define MSC01_PCI_INTCFG_MWE_SHF 9 | 93 | #define MSC01_PCI_INTCFG_MWE_SHF 9 |
93 | #define MSC01_PCI_INTCFG_MWE_MSK 0x00000200 | 94 | #define MSC01_PCI_INTCFG_MWE_MSK 0x00000200 |
94 | #define MSC01_PCI_INTCFG_MWE_BIT 0x00000200 | 95 | #define MSC01_PCI_INTCFG_MWE_BIT 0x00000200 |
95 | #define MSC01_PCI_INTCFG_DTO_SHF 8 | 96 | #define MSC01_PCI_INTCFG_DTO_SHF 8 |
96 | #define MSC01_PCI_INTCFG_DTO_MSK 0x00000100 | 97 | #define MSC01_PCI_INTCFG_DTO_MSK 0x00000100 |
97 | #define MSC01_PCI_INTCFG_DTO_BIT 0x00000100 | 98 | #define MSC01_PCI_INTCFG_DTO_BIT 0x00000100 |
98 | #define MSC01_PCI_INTCFG_MA_SHF 7 | 99 | #define MSC01_PCI_INTCFG_MA_SHF 7 |
99 | #define MSC01_PCI_INTCFG_MA_MSK 0x00000080 | 100 | #define MSC01_PCI_INTCFG_MA_MSK 0x00000080 |
100 | #define MSC01_PCI_INTCFG_MA_BIT 0x00000080 | 101 | #define MSC01_PCI_INTCFG_MA_BIT 0x00000080 |
101 | #define MSC01_PCI_INTCFG_TA_SHF 6 | 102 | #define MSC01_PCI_INTCFG_TA_SHF 6 |
102 | #define MSC01_PCI_INTCFG_TA_MSK 0x00000040 | 103 | #define MSC01_PCI_INTCFG_TA_MSK 0x00000040 |
103 | #define MSC01_PCI_INTCFG_TA_BIT 0x00000040 | 104 | #define MSC01_PCI_INTCFG_TA_BIT 0x00000040 |
104 | #define MSC01_PCI_INTCFG_RTY_SHF 5 | 105 | #define MSC01_PCI_INTCFG_RTY_SHF 5 |
105 | #define MSC01_PCI_INTCFG_RTY_MSK 0x00000020 | 106 | #define MSC01_PCI_INTCFG_RTY_MSK 0x00000020 |
106 | #define MSC01_PCI_INTCFG_RTY_BIT 0x00000020 | 107 | #define MSC01_PCI_INTCFG_RTY_BIT 0x00000020 |
107 | #define MSC01_PCI_INTCFG_MWP_SHF 4 | 108 | #define MSC01_PCI_INTCFG_MWP_SHF 4 |
108 | #define MSC01_PCI_INTCFG_MWP_MSK 0x00000010 | 109 | #define MSC01_PCI_INTCFG_MWP_MSK 0x00000010 |
109 | #define MSC01_PCI_INTCFG_MWP_BIT 0x00000010 | 110 | #define MSC01_PCI_INTCFG_MWP_BIT 0x00000010 |
110 | #define MSC01_PCI_INTCFG_MRP_SHF 3 | 111 | #define MSC01_PCI_INTCFG_MRP_SHF 3 |
111 | #define MSC01_PCI_INTCFG_MRP_MSK 0x00000008 | 112 | #define MSC01_PCI_INTCFG_MRP_MSK 0x00000008 |
112 | #define MSC01_PCI_INTCFG_MRP_BIT 0x00000008 | 113 | #define MSC01_PCI_INTCFG_MRP_BIT 0x00000008 |
113 | #define MSC01_PCI_INTCFG_SWP_SHF 2 | 114 | #define MSC01_PCI_INTCFG_SWP_SHF 2 |
114 | #define MSC01_PCI_INTCFG_SWP_MSK 0x00000004 | 115 | #define MSC01_PCI_INTCFG_SWP_MSK 0x00000004 |
115 | #define MSC01_PCI_INTCFG_SWP_BIT 0x00000004 | 116 | #define MSC01_PCI_INTCFG_SWP_BIT 0x00000004 |
116 | #define MSC01_PCI_INTCFG_SRP_SHF 1 | 117 | #define MSC01_PCI_INTCFG_SRP_SHF 1 |
117 | #define MSC01_PCI_INTCFG_SRP_MSK 0x00000002 | 118 | #define MSC01_PCI_INTCFG_SRP_MSK 0x00000002 |
118 | #define MSC01_PCI_INTCFG_SRP_BIT 0x00000002 | 119 | #define MSC01_PCI_INTCFG_SRP_BIT 0x00000002 |
119 | #define MSC01_PCI_INTCFG_SE_SHF 0 | 120 | #define MSC01_PCI_INTCFG_SE_SHF 0 |
120 | #define MSC01_PCI_INTCFG_SE_MSK 0x00000001 | 121 | #define MSC01_PCI_INTCFG_SE_MSK 0x00000001 |
121 | #define MSC01_PCI_INTCFG_SE_BIT 0x00000001 | 122 | #define MSC01_PCI_INTCFG_SE_BIT 0x00000001 |
122 | 123 | ||
123 | #define MSC01_PCI_INTSTAT_RST_SHF 10 | 124 | #define MSC01_PCI_INTSTAT_RST_SHF 10 |
124 | #define MSC01_PCI_INTSTAT_RST_MSK 0x00000400 | 125 | #define MSC01_PCI_INTSTAT_RST_MSK 0x00000400 |
125 | #define MSC01_PCI_INTSTAT_RST_BIT 0x00000400 | 126 | #define MSC01_PCI_INTSTAT_RST_BIT 0x00000400 |
126 | #define MSC01_PCI_INTSTAT_MWE_SHF 9 | 127 | #define MSC01_PCI_INTSTAT_MWE_SHF 9 |
127 | #define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200 | 128 | #define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200 |
128 | #define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200 | 129 | #define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200 |
129 | #define MSC01_PCI_INTSTAT_DTO_SHF 8 | 130 | #define MSC01_PCI_INTSTAT_DTO_SHF 8 |
130 | #define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100 | 131 | #define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100 |
131 | #define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100 | 132 | #define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100 |
132 | #define MSC01_PCI_INTSTAT_MA_SHF 7 | 133 | #define MSC01_PCI_INTSTAT_MA_SHF 7 |
133 | #define MSC01_PCI_INTSTAT_MA_MSK 0x00000080 | 134 | #define MSC01_PCI_INTSTAT_MA_MSK 0x00000080 |
134 | #define MSC01_PCI_INTSTAT_MA_BIT 0x00000080 | 135 | #define MSC01_PCI_INTSTAT_MA_BIT 0x00000080 |
135 | #define MSC01_PCI_INTSTAT_TA_SHF 6 | 136 | #define MSC01_PCI_INTSTAT_TA_SHF 6 |
136 | #define MSC01_PCI_INTSTAT_TA_MSK 0x00000040 | 137 | #define MSC01_PCI_INTSTAT_TA_MSK 0x00000040 |
137 | #define MSC01_PCI_INTSTAT_TA_BIT 0x00000040 | 138 | #define MSC01_PCI_INTSTAT_TA_BIT 0x00000040 |
138 | #define MSC01_PCI_INTSTAT_RTY_SHF 5 | 139 | #define MSC01_PCI_INTSTAT_RTY_SHF 5 |
139 | #define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020 | 140 | #define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020 |
140 | #define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020 | 141 | #define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020 |
141 | #define MSC01_PCI_INTSTAT_MWP_SHF 4 | 142 | #define MSC01_PCI_INTSTAT_MWP_SHF 4 |
142 | #define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010 | 143 | #define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010 |
143 | #define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010 | 144 | #define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010 |
144 | #define MSC01_PCI_INTSTAT_MRP_SHF 3 | 145 | #define MSC01_PCI_INTSTAT_MRP_SHF 3 |
145 | #define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008 | 146 | #define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008 |
146 | #define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008 | 147 | #define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008 |
147 | #define MSC01_PCI_INTSTAT_SWP_SHF 2 | 148 | #define MSC01_PCI_INTSTAT_SWP_SHF 2 |
148 | #define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004 | 149 | #define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004 |
149 | #define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004 | 150 | #define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004 |
150 | #define MSC01_PCI_INTSTAT_SRP_SHF 1 | 151 | #define MSC01_PCI_INTSTAT_SRP_SHF 1 |
151 | #define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002 | 152 | #define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002 |
152 | #define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002 | 153 | #define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002 |
153 | #define MSC01_PCI_INTSTAT_SE_SHF 0 | 154 | #define MSC01_PCI_INTSTAT_SE_SHF 0 |
154 | #define MSC01_PCI_INTSTAT_SE_MSK 0x00000001 | 155 | #define MSC01_PCI_INTSTAT_SE_MSK 0x00000001 |
155 | #define MSC01_PCI_INTSTAT_SE_BIT 0x00000001 | 156 | #define MSC01_PCI_INTSTAT_SE_BIT 0x00000001 |
156 | 157 | ||
157 | #define MSC01_PCI_CFGADDR_BNUM_SHF 16 | 158 | #define MSC01_PCI_CFGADDR_BNUM_SHF 16 |
158 | #define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000 | 159 | #define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000 |
@@ -167,29 +168,29 @@ | |||
167 | #define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff | 168 | #define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff |
168 | 169 | ||
169 | /* The defines below are ONLY valid for a MEM bar! */ | 170 | /* The defines below are ONLY valid for a MEM bar! */ |
170 | #define MSC01_PCI_BAR0_SIZE_SHF 4 | 171 | #define MSC01_PCI_BAR0_SIZE_SHF 4 |
171 | #define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0 | 172 | #define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0 |
172 | #define MSC01_PCI_BAR0_P_SHF 3 | 173 | #define MSC01_PCI_BAR0_P_SHF 3 |
173 | #define MSC01_PCI_BAR0_P_MSK 0x00000008 | 174 | #define MSC01_PCI_BAR0_P_MSK 0x00000008 |
174 | #define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK | 175 | #define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK |
175 | #define MSC01_PCI_BAR0_D_SHF 1 | 176 | #define MSC01_PCI_BAR0_D_SHF 1 |
176 | #define MSC01_PCI_BAR0_D_MSK 0x00000006 | 177 | #define MSC01_PCI_BAR0_D_MSK 0x00000006 |
177 | #define MSC01_PCI_BAR0_T_SHF 0 | 178 | #define MSC01_PCI_BAR0_T_SHF 0 |
178 | #define MSC01_PCI_BAR0_T_MSK 0x00000001 | 179 | #define MSC01_PCI_BAR0_T_MSK 0x00000001 |
179 | #define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK | 180 | #define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK |
180 | 181 | ||
181 | 182 | ||
182 | #define MSC01_PCI_CFG_RA_SHF 17 | 183 | #define MSC01_PCI_CFG_RA_SHF 17 |
183 | #define MSC01_PCI_CFG_RA_MSK 0x00020000 | 184 | #define MSC01_PCI_CFG_RA_MSK 0x00020000 |
184 | #define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK | 185 | #define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK |
185 | #define MSC01_PCI_CFG_G_SHF 16 | 186 | #define MSC01_PCI_CFG_G_SHF 16 |
186 | #define MSC01_PCI_CFG_G_MSK 0x00010000 | 187 | #define MSC01_PCI_CFG_G_MSK 0x00010000 |
187 | #define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK | 188 | #define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK |
188 | #define MSC01_PCI_CFG_EN_SHF 15 | 189 | #define MSC01_PCI_CFG_EN_SHF 15 |
189 | #define MSC01_PCI_CFG_EN_MSK 0x00008000 | 190 | #define MSC01_PCI_CFG_EN_MSK 0x00008000 |
190 | #define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK | 191 | #define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK |
191 | #define MSC01_PCI_CFG_MAXRTRY_SHF 0 | 192 | #define MSC01_PCI_CFG_MAXRTRY_SHF 0 |
192 | #define MSC01_PCI_CFG_MAXRTRY_MSK 0x000000ff | 193 | #define MSC01_PCI_CFG_MAXRTRY_MSK 0x00000fff |
193 | 194 | ||
194 | #define MSC01_PCI_SWAP_IO_SHF 18 | 195 | #define MSC01_PCI_SWAP_IO_SHF 18 |
195 | #define MSC01_PCI_SWAP_IO_MSK 0x000c0000 | 196 | #define MSC01_PCI_SWAP_IO_MSK 0x000c0000 |
@@ -206,7 +207,7 @@ | |||
206 | * FIXME - are these macros specific to Malta and co or to the MSC? If the | 207 | * FIXME - are these macros specific to Malta and co or to the MSC? If the |
207 | * latter, they should be moved elsewhere. | 208 | * latter, they should be moved elsewhere. |
208 | */ | 209 | */ |
209 | #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 | 210 | #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 |
210 | 211 | ||
211 | extern unsigned long _pcictrl_msc; | 212 | extern unsigned long _pcictrl_msc; |
212 | 213 | ||
@@ -219,19 +220,19 @@ extern unsigned long _pcictrl_msc; | |||
219 | * Registers absolute addresses | 220 | * Registers absolute addresses |
220 | */ | 221 | */ |
221 | 222 | ||
222 | #define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS) | 223 | #define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS) |
223 | #define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS) | 224 | #define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS) |
224 | #define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS) | 225 | #define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS) |
225 | #define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS) | 226 | #define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS) |
226 | #define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS) | 227 | #define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS) |
227 | #define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS) | 228 | #define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS) |
228 | #define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS) | 229 | #define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS) |
229 | #define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS) | 230 | #define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS) |
230 | #define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS) | 231 | #define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS) |
231 | #define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS) | 232 | #define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS) |
232 | #define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS) | 233 | #define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS) |
233 | #define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS) | 234 | #define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS) |
234 | #define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS) | 235 | #define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS) |
235 | #define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS) | 236 | #define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS) |
236 | #define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS) | 237 | #define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS) |
237 | #define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS) | 238 | #define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS) |
@@ -248,7 +249,7 @@ extern unsigned long _pcictrl_msc; | |||
248 | #define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | 249 | #define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) |
249 | #define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | 250 | #define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) |
250 | #define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | 251 | #define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) |
251 | #define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) | 252 | #define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) |
252 | #define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS) | 253 | #define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS) |
253 | #define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS) | 254 | #define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS) |
254 | #define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS) | 255 | #define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS) |
diff --git a/include/asm-mips/mips-boards/sim.h b/include/asm-mips/mips-boards/sim.h new file mode 100644 index 000000000000..acb7c2331d98 --- /dev/null +++ b/include/asm-mips/mips-boards/sim.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_MIPS_BOARDS_SIM_H | ||
20 | #define _ASM_MIPS_BOARDS_SIM_H | ||
21 | |||
22 | #define STATS_ON 1 | ||
23 | #define STATS_OFF 2 | ||
24 | #define STATS_CLEAR 3 | ||
25 | #define STATS_DUMP 4 | ||
26 | #define TRACE_ON 5 | ||
27 | #define TRACE_OFF 6 | ||
28 | |||
29 | |||
30 | #define simcfg(code) \ | ||
31 | ({ \ | ||
32 | __asm__ __volatile__( \ | ||
33 | "sltiu $0,$0, %0" \ | ||
34 | ::"i"(code) \ | ||
35 | ); \ | ||
36 | }) | ||
37 | |||
38 | |||
39 | |||
40 | #endif | ||
diff --git a/include/asm-mips/mips-boards/simint.h b/include/asm-mips/mips-boards/simint.h new file mode 100644 index 000000000000..4952e0b3bf11 --- /dev/null +++ b/include/asm-mips/mips-boards/simint.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can distribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License (Version 2) as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
11 | * for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
16 | */ | ||
17 | #ifndef _MIPS_SIMINT_H | ||
18 | #define _MIPS_SIMINT_H | ||
19 | |||
20 | |||
21 | #define SIM_INT_BASE 0 | ||
22 | #define MIPSCPU_INT_MB0 2 | ||
23 | #define MIPSCPU_INT_BASE 16 | ||
24 | #define MIPS_CPU_TIMER_IRQ 7 | ||
25 | |||
26 | |||
27 | #define MIPSCPU_INT_CPUCTR 7 | ||
28 | |||
29 | #define MSC01E_INT_BASE 64 | ||
30 | |||
31 | #define MIPSCPU_INT_CPUCTR 7 | ||
32 | #define MSC01E_INT_CPUCTR 11 | ||
33 | |||
34 | #endif | ||
diff --git a/include/asm-mips/mipsmtregs.h b/include/asm-mips/mipsmtregs.h new file mode 100644 index 000000000000..a669c0702c66 --- /dev/null +++ b/include/asm-mips/mipsmtregs.h | |||
@@ -0,0 +1,391 @@ | |||
1 | /* | ||
2 | * MT regs definitions, follows on from mipsregs.h | ||
3 | * Copyright (C) 2004 - 2005 MIPS Technologies, Inc. All rights reserved. | ||
4 | * Elizabeth Clarke et. al. | ||
5 | * | ||
6 | */ | ||
7 | #ifndef _ASM_MIPSMTREGS_H | ||
8 | #define _ASM_MIPSMTREGS_H | ||
9 | |||
10 | #include <asm/mipsregs.h> | ||
11 | #include <asm/war.h> | ||
12 | |||
13 | #ifndef __ASSEMBLY__ | ||
14 | |||
15 | /* | ||
16 | * C macros | ||
17 | */ | ||
18 | |||
19 | #define read_c0_mvpcontrol() __read_32bit_c0_register($0, 1) | ||
20 | #define write_c0_mvpcontrol(val) __write_32bit_c0_register($0, 1, val) | ||
21 | |||
22 | #define read_c0_mvpconf0() __read_32bit_c0_register($0, 2) | ||
23 | #define read_c0_mvpconf1() __read_32bit_c0_register($0, 3) | ||
24 | |||
25 | #define read_c0_vpecontrol() __read_32bit_c0_register($1, 1) | ||
26 | #define write_c0_vpecontrol(val) __write_32bit_c0_register($1, 1, val) | ||
27 | |||
28 | #define read_c0_vpeconf0() __read_32bit_c0_register($1, 2) | ||
29 | #define write_c0_vpeconf0(val) __write_32bit_c0_register($1, 2, val) | ||
30 | |||
31 | #define read_c0_tcstatus() __read_32bit_c0_register($2, 1) | ||
32 | #define write_c0_tcstatus(val) __write_32bit_c0_register($2, 1, val) | ||
33 | |||
34 | #define read_c0_tcbind() __read_32bit_c0_register($2, 2) | ||
35 | |||
36 | #define read_c0_tccontext() __read_32bit_c0_register($2, 5) | ||
37 | #define write_c0_tccontext(val) __write_32bit_c0_register($2, 5, val) | ||
38 | |||
39 | #else /* Assembly */ | ||
40 | /* | ||
41 | * Macros for use in assembly language code | ||
42 | */ | ||
43 | |||
44 | #define CP0_MVPCONTROL $0,1 | ||
45 | #define CP0_MVPCONF0 $0,2 | ||
46 | #define CP0_MVPCONF1 $0,3 | ||
47 | #define CP0_VPECONTROL $1,1 | ||
48 | #define CP0_VPECONF0 $1,2 | ||
49 | #define CP0_VPECONF1 $1,3 | ||
50 | #define CP0_YQMASK $1,4 | ||
51 | #define CP0_VPESCHEDULE $1,5 | ||
52 | #define CP0_VPESCHEFBK $1,6 | ||
53 | #define CP0_TCSTATUS $2,1 | ||
54 | #define CP0_TCBIND $2,2 | ||
55 | #define CP0_TCRESTART $2,3 | ||
56 | #define CP0_TCHALT $2,4 | ||
57 | #define CP0_TCCONTEXT $2,5 | ||
58 | #define CP0_TCSCHEDULE $2,6 | ||
59 | #define CP0_TCSCHEFBK $2,7 | ||
60 | #define CP0_SRSCONF0 $6,1 | ||
61 | #define CP0_SRSCONF1 $6,2 | ||
62 | #define CP0_SRSCONF2 $6,3 | ||
63 | #define CP0_SRSCONF3 $6,4 | ||
64 | #define CP0_SRSCONF4 $6,5 | ||
65 | |||
66 | #endif | ||
67 | |||
68 | /* MVPControl fields */ | ||
69 | #define MVPCONTROL_EVP (_ULCAST_(1)) | ||
70 | |||
71 | #define MVPCONTROL_VPC_SHIFT 1 | ||
72 | #define MVPCONTROL_VPC (_ULCAST_(1) << MVPCONTROL_VPC_SHIFT) | ||
73 | |||
74 | #define MVPCONTROL_STLB_SHIFT 2 | ||
75 | #define MVPCONTROL_STLB (_ULCAST_(1) << MVPCONTROL_STLB_SHIFT) | ||
76 | |||
77 | |||
78 | /* MVPConf0 fields */ | ||
79 | #define MVPCONF0_PTC_SHIFT 0 | ||
80 | #define MVPCONF0_PTC ( _ULCAST_(0xff)) | ||
81 | #define MVPCONF0_PVPE_SHIFT 10 | ||
82 | #define MVPCONF0_PVPE ( _ULCAST_(0xf) << MVPCONF0_PVPE_SHIFT) | ||
83 | #define MVPCONF0_TCA_SHIFT 15 | ||
84 | #define MVPCONF0_TCA ( _ULCAST_(1) << MVPCONF0_TCA_SHIFT) | ||
85 | #define MVPCONF0_PTLBE_SHIFT 16 | ||
86 | #define MVPCONF0_PTLBE (_ULCAST_(0x3ff) << MVPCONF0_PTLBE_SHIFT) | ||
87 | #define MVPCONF0_TLBS_SHIFT 29 | ||
88 | #define MVPCONF0_TLBS (_ULCAST_(1) << MVPCONF0_TLBS_SHIFT) | ||
89 | #define MVPCONF0_M_SHIFT 31 | ||
90 | #define MVPCONF0_M (_ULCAST_(0x1) << MVPCONF0_M_SHIFT) | ||
91 | |||
92 | |||
93 | /* config3 fields */ | ||
94 | #define CONFIG3_MT_SHIFT 2 | ||
95 | #define CONFIG3_MT (_ULCAST_(1) << CONFIG3_MT_SHIFT) | ||
96 | |||
97 | |||
98 | /* VPEControl fields (per VPE) */ | ||
99 | #define VPECONTROL_TARGTC (_ULCAST_(0xff)) | ||
100 | |||
101 | #define VPECONTROL_TE_SHIFT 15 | ||
102 | #define VPECONTROL_TE (_ULCAST_(1) << VPECONTROL_TE_SHIFT) | ||
103 | #define VPECONTROL_EXCPT_SHIFT 16 | ||
104 | #define VPECONTROL_EXCPT (_ULCAST_(0x7) << VPECONTROL_EXCPT_SHIFT) | ||
105 | |||
106 | /* Thread Exception Codes for EXCPT field */ | ||
107 | #define THREX_TU 0 | ||
108 | #define THREX_TO 1 | ||
109 | #define THREX_IYQ 2 | ||
110 | #define THREX_GSX 3 | ||
111 | #define THREX_YSCH 4 | ||
112 | #define THREX_GSSCH 5 | ||
113 | |||
114 | #define VPECONTROL_GSI_SHIFT 20 | ||
115 | #define VPECONTROL_GSI (_ULCAST_(1) << VPECONTROL_GSI_SHIFT) | ||
116 | #define VPECONTROL_YSI_SHIFT 21 | ||
117 | #define VPECONTROL_YSI (_ULCAST_(1) << VPECONTROL_YSI_SHIFT) | ||
118 | |||
119 | /* VPEConf0 fields (per VPE) */ | ||
120 | #define VPECONF0_VPA_SHIFT 0 | ||
121 | #define VPECONF0_VPA (_ULCAST_(1) << VPECONF0_VPA_SHIFT) | ||
122 | #define VPECONF0_MVP_SHIFT 1 | ||
123 | #define VPECONF0_MVP (_ULCAST_(1) << VPECONF0_MVP_SHIFT) | ||
124 | #define VPECONF0_XTC_SHIFT 21 | ||
125 | #define VPECONF0_XTC (_ULCAST_(0xff) << VPECONF0_XTC_SHIFT) | ||
126 | |||
127 | /* TCStatus fields (per TC) */ | ||
128 | #define TCSTATUS_TASID (_ULCAST_(0xff)) | ||
129 | #define TCSTATUS_IXMT_SHIFT 10 | ||
130 | #define TCSTATUS_IXMT (_ULCAST_(1) << TCSTATUS_IXMT_SHIFT) | ||
131 | #define TCSTATUS_TKSU_SHIFT 11 | ||
132 | #define TCSTATUS_TKSU (_ULCAST_(3) << TCSTATUS_TKSU_SHIFT) | ||
133 | #define TCSTATUS_A_SHIFT 13 | ||
134 | #define TCSTATUS_A (_ULCAST_(1) << TCSTATUS_A_SHIFT) | ||
135 | #define TCSTATUS_DA_SHIFT 15 | ||
136 | #define TCSTATUS_DA (_ULCAST_(1) << TCSTATUS_DA_SHIFT) | ||
137 | #define TCSTATUS_DT_SHIFT 20 | ||
138 | #define TCSTATUS_DT (_ULCAST_(1) << TCSTATUS_DT_SHIFT) | ||
139 | #define TCSTATUS_TDS_SHIFT 21 | ||
140 | #define TCSTATUS_TDS (_ULCAST_(1) << TCSTATUS_TDS_SHIFT) | ||
141 | #define TCSTATUS_TSST_SHIFT 22 | ||
142 | #define TCSTATUS_TSST (_ULCAST_(1) << TCSTATUS_TSST_SHIFT) | ||
143 | #define TCSTATUS_RNST_SHIFT 23 | ||
144 | #define TCSTATUS_RNST (_ULCAST_(3) << TCSTATUS_RNST_SHIFT) | ||
145 | /* Codes for RNST */ | ||
146 | #define TC_RUNNING 0 | ||
147 | #define TC_WAITING 1 | ||
148 | #define TC_YIELDING 2 | ||
149 | #define TC_GATED 3 | ||
150 | |||
151 | #define TCSTATUS_TMX_SHIFT 27 | ||
152 | #define TCSTATUS_TMX (_ULCAST_(1) << TCSTATUS_TMX_SHIFT) | ||
153 | /* TCStatus TCU bits can use same definitions/offsets as CU bits in Status */ | ||
154 | |||
155 | /* TCBind */ | ||
156 | #define TCBIND_CURVPE_SHIFT 0 | ||
157 | #define TCBIND_CURVPE (_ULCAST_(0xf)) | ||
158 | |||
159 | #define TCBIND_CURTC_SHIFT 21 | ||
160 | |||
161 | #define TCBIND_CURTC (_ULCAST_(0xff) << TCBIND_CURTC_SHIFT) | ||
162 | |||
163 | /* TCHalt */ | ||
164 | #define TCHALT_H (_ULCAST_(1)) | ||
165 | |||
166 | #ifndef __ASSEMBLY__ | ||
167 | |||
168 | extern void mips_mt_regdump(void); | ||
169 | |||
170 | static inline unsigned int dvpe(void) | ||
171 | { | ||
172 | int res = 0; | ||
173 | |||
174 | __asm__ __volatile__( | ||
175 | " .set push \n" | ||
176 | " .set noreorder \n" | ||
177 | " .set noat \n" | ||
178 | " .set mips32r2 \n" | ||
179 | " .word 0x41610001 # dvpe $1 \n" | ||
180 | " move %0, $1 \n" | ||
181 | " ehb \n" | ||
182 | " .set pop \n" | ||
183 | : "=r" (res)); | ||
184 | |||
185 | instruction_hazard(); | ||
186 | |||
187 | return res; | ||
188 | } | ||
189 | |||
190 | static inline void __raw_evpe(void) | ||
191 | { | ||
192 | __asm__ __volatile__( | ||
193 | " .set push \n" | ||
194 | " .set noreorder \n" | ||
195 | " .set noat \n" | ||
196 | " .set mips32r2 \n" | ||
197 | " .word 0x41600021 # evpe \n" | ||
198 | " ehb \n" | ||
199 | " .set pop \n"); | ||
200 | } | ||
201 | |||
202 | /* Enable multiMT if previous suggested it should be. | ||
203 | EMT_ENABLE to force */ | ||
204 | |||
205 | #define EVPE_ENABLE MVPCONTROL_EVP | ||
206 | |||
207 | static inline void evpe(int previous) | ||
208 | { | ||
209 | if ((previous & MVPCONTROL_EVP)) | ||
210 | __raw_evpe(); | ||
211 | } | ||
212 | |||
213 | static inline unsigned int dmt(void) | ||
214 | { | ||
215 | int res; | ||
216 | |||
217 | __asm__ __volatile__( | ||
218 | " .set push \n" | ||
219 | " .set mips32r2 \n" | ||
220 | " .set noat \n" | ||
221 | " .word 0x41610BC1 # dmt $1 \n" | ||
222 | " ehb \n" | ||
223 | " move %0, $1 \n" | ||
224 | " .set pop \n" | ||
225 | : "=r" (res)); | ||
226 | |||
227 | instruction_hazard(); | ||
228 | |||
229 | return res; | ||
230 | } | ||
231 | |||
232 | static inline void __raw_emt(void) | ||
233 | { | ||
234 | __asm__ __volatile__( | ||
235 | " .set noreorder \n" | ||
236 | " .set mips32r2 \n" | ||
237 | " emt \n" | ||
238 | " ehb \n" | ||
239 | " .set mips0 \n" | ||
240 | " .set reorder"); | ||
241 | } | ||
242 | |||
243 | /* enable multiVPE if previous suggested it should be. | ||
244 | EVPE_ENABLE to force */ | ||
245 | |||
246 | #define EMT_ENABLE VPECONTROL_TE | ||
247 | |||
248 | static inline void emt(int previous) | ||
249 | { | ||
250 | if ((previous & EMT_ENABLE)) | ||
251 | __raw_emt(); | ||
252 | } | ||
253 | |||
254 | static inline void ehb(void) | ||
255 | { | ||
256 | __asm__ __volatile__( | ||
257 | " .set mips32r2 \n" | ||
258 | " ehb \n" | ||
259 | " .set mips0 \n"); | ||
260 | } | ||
261 | |||
262 | #define mftc0(rt,sel) \ | ||
263 | ({ \ | ||
264 | unsigned long __res; \ | ||
265 | \ | ||
266 | __asm__ __volatile__( \ | ||
267 | " .set push \n" \ | ||
268 | " .set mips32r2 \n" \ | ||
269 | " .set noat \n" \ | ||
270 | " # mftc0 $1, $" #rt ", " #sel " \n" \ | ||
271 | " .word 0x41000800 | (" #rt " << 16) | " #sel " \n" \ | ||
272 | " move %0, $1 \n" \ | ||
273 | " .set pop \n" \ | ||
274 | : "=r" (__res)); \ | ||
275 | \ | ||
276 | __res; \ | ||
277 | }) | ||
278 | |||
279 | #define mftgpr(rt) \ | ||
280 | ({ \ | ||
281 | unsigned long __res; \ | ||
282 | \ | ||
283 | __asm__ __volatile__( \ | ||
284 | " .set push \n" \ | ||
285 | " .set mips32r2 \n" \ | ||
286 | " mftgpr %0," #rt " \n" \ | ||
287 | " .set pop \n" \ | ||
288 | : "=r" (__res)); \ | ||
289 | \ | ||
290 | __res; \ | ||
291 | }) | ||
292 | |||
293 | #define mftr(rt,u,sel) \ | ||
294 | ({ \ | ||
295 | unsigned long __res; \ | ||
296 | \ | ||
297 | __asm__ __volatile__( \ | ||
298 | ".set noat\n\t" \ | ||
299 | "mftr\t%0, " #rt ", " #u ", " #sel "\n\t" \ | ||
300 | ".set at\n\t" \ | ||
301 | : "=r" (__res)); \ | ||
302 | \ | ||
303 | __res; \ | ||
304 | }) | ||
305 | |||
306 | #define mttgpr(rd,v) \ | ||
307 | do { \ | ||
308 | __asm__ __volatile__( \ | ||
309 | " .set push \n" \ | ||
310 | " .set mips32r2 \n" \ | ||
311 | " .set noat \n" \ | ||
312 | " move $1, %0 \n" \ | ||
313 | " # mttgpr $1, " #rd " \n" \ | ||
314 | " .word 0x41810020 | (" #rd " << 11) \n" \ | ||
315 | " .set pop \n" \ | ||
316 | : : "r" (v)); \ | ||
317 | } while (0) | ||
318 | |||
319 | #define mttc0(rd,sel,v) \ | ||
320 | ({ \ | ||
321 | __asm__ __volatile__( \ | ||
322 | " .set push \n" \ | ||
323 | " .set mips32r2 \n" \ | ||
324 | " .set noat \n" \ | ||
325 | " move $1, %0 \n" \ | ||
326 | " # mttc0 %0," #rd ", " #sel " \n" \ | ||
327 | " .word 0x41810000 | (" #rd " << 11) | " #sel " \n" \ | ||
328 | " .set pop \n" \ | ||
329 | : \ | ||
330 | : "r" (v)); \ | ||
331 | }) | ||
332 | |||
333 | |||
334 | #define mttr(rd,u,sel,v) \ | ||
335 | ({ \ | ||
336 | __asm__ __volatile__( \ | ||
337 | "mttr %0," #rd ", " #u ", " #sel \ | ||
338 | : : "r" (v)); \ | ||
339 | }) | ||
340 | |||
341 | |||
342 | #define settc(tc) \ | ||
343 | do { \ | ||
344 | write_c0_vpecontrol((read_c0_vpecontrol()&~VPECONTROL_TARGTC) | (tc)); \ | ||
345 | ehb(); \ | ||
346 | } while (0) | ||
347 | |||
348 | |||
349 | /* you *must* set the target tc (settc) before trying to use these */ | ||
350 | #define read_vpe_c0_vpecontrol() mftc0(1, 1) | ||
351 | #define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val) | ||
352 | #define read_vpe_c0_vpeconf0() mftc0(1, 2) | ||
353 | #define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val) | ||
354 | #define read_vpe_c0_status() mftc0(12, 0) | ||
355 | #define write_vpe_c0_status(val) mttc0(12, 0, val) | ||
356 | #define read_vpe_c0_cause() mftc0(13, 0) | ||
357 | #define write_vpe_c0_cause(val) mttc0(13, 0, val) | ||
358 | #define read_vpe_c0_config() mftc0(16, 0) | ||
359 | #define write_vpe_c0_config(val) mttc0(16, 0, val) | ||
360 | #define read_vpe_c0_config1() mftc0(16, 1) | ||
361 | #define write_vpe_c0_config1(val) mttc0(16, 1, val) | ||
362 | #define read_vpe_c0_config7() mftc0(16, 7) | ||
363 | #define write_vpe_c0_config7(val) mttc0(16, 7, val) | ||
364 | #define read_vpe_c0_ebase() mftc0(15,1) | ||
365 | #define write_vpe_c0_ebase(val) mttc0(15, 1, val) | ||
366 | #define write_vpe_c0_compare(val) mttc0(11, 0, val) | ||
367 | |||
368 | |||
369 | /* TC */ | ||
370 | #define read_tc_c0_tcstatus() mftc0(2, 1) | ||
371 | #define write_tc_c0_tcstatus(val) mttc0(2,1,val) | ||
372 | #define read_tc_c0_tcbind() mftc0(2, 2) | ||
373 | #define write_tc_c0_tcbind(val) mttc0(2,2,val) | ||
374 | #define read_tc_c0_tcrestart() mftc0(2, 3) | ||
375 | #define write_tc_c0_tcrestart(val) mttc0(2,3,val) | ||
376 | #define read_tc_c0_tchalt() mftc0(2, 4) | ||
377 | #define write_tc_c0_tchalt(val) mttc0(2,4,val) | ||
378 | #define read_tc_c0_tccontext() mftc0(2, 5) | ||
379 | #define write_tc_c0_tccontext(val) mttc0(2,5,val) | ||
380 | |||
381 | /* GPR */ | ||
382 | #define read_tc_gpr_sp() mftgpr(29) | ||
383 | #define write_tc_gpr_sp(val) mttgpr(29, val) | ||
384 | #define read_tc_gpr_gp() mftgpr(28) | ||
385 | #define write_tc_gpr_gp(val) mttgpr(28, val) | ||
386 | |||
387 | __BUILD_SET_C0(mvpcontrol) | ||
388 | |||
389 | #endif /* Not __ASSEMBLY__ */ | ||
390 | |||
391 | #endif | ||
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index 2197aa4ce456..80370e0a5589 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. | 8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. |
9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com | 9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com |
10 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | 10 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. |
11 | * Copyright (C) 2003 Maciej W. Rozycki | 11 | * Copyright (C) 2003, 2004 Maciej W. Rozycki |
12 | */ | 12 | */ |
13 | #ifndef _ASM_MIPSREGS_H | 13 | #ifndef _ASM_MIPSREGS_H |
14 | #define _ASM_MIPSREGS_H | 14 | #define _ASM_MIPSREGS_H |
@@ -96,6 +96,16 @@ | |||
96 | #define CP0_S1_INTCONTROL $20 | 96 | #define CP0_S1_INTCONTROL $20 |
97 | 97 | ||
98 | /* | 98 | /* |
99 | * Coprocessor 0 Set 2 register names | ||
100 | */ | ||
101 | #define CP0_S2_SRSCTL $12 /* MIPSR2 */ | ||
102 | |||
103 | /* | ||
104 | * Coprocessor 0 Set 3 register names | ||
105 | */ | ||
106 | #define CP0_S3_SRSMAP $12 /* MIPSR2 */ | ||
107 | |||
108 | /* | ||
99 | * TX39 Series | 109 | * TX39 Series |
100 | */ | 110 | */ |
101 | #define CP0_TX39_CACHE $7 | 111 | #define CP0_TX39_CACHE $7 |
@@ -281,6 +291,11 @@ | |||
281 | #define ST0_DL (_ULCAST_(1) << 24) | 291 | #define ST0_DL (_ULCAST_(1) << 24) |
282 | 292 | ||
283 | /* | 293 | /* |
294 | * Enable the MIPS DSP ASE | ||
295 | */ | ||
296 | #define ST0_MX 0x01000000 | ||
297 | |||
298 | /* | ||
284 | * Bitfields in the TX39 family CP0 Configuration Register 3 | 299 | * Bitfields in the TX39 family CP0 Configuration Register 3 |
285 | */ | 300 | */ |
286 | #define TX39_CONF_ICS_SHIFT 19 | 301 | #define TX39_CONF_ICS_SHIFT 19 |
@@ -433,6 +448,14 @@ | |||
433 | #define R5K_CONF_SE (_ULCAST_(1) << 12) | 448 | #define R5K_CONF_SE (_ULCAST_(1) << 12) |
434 | #define R5K_CONF_SS (_ULCAST_(3) << 20) | 449 | #define R5K_CONF_SS (_ULCAST_(3) << 20) |
435 | 450 | ||
451 | /* Bits specific to the RM7000. */ | ||
452 | #define RM7K_CONF_SE (_ULCAST_(1) << 3) | ||
453 | #define RM7K_CONF_TE (_ULCAST_(1) << 12) | ||
454 | #define RM7K_CONF_CLK (_ULCAST_(1) << 16) | ||
455 | #define RM7K_CONF_TC (_ULCAST_(1) << 17) | ||
456 | #define RM7K_CONF_SI (_ULCAST_(3) << 20) | ||
457 | #define RM7K_CONF_SC (_ULCAST_(1) << 31) | ||
458 | |||
436 | /* Bits specific to the R10000. */ | 459 | /* Bits specific to the R10000. */ |
437 | #define R10K_CONF_DN (_ULCAST_(3) << 3) | 460 | #define R10K_CONF_DN (_ULCAST_(3) << 3) |
438 | #define R10K_CONF_CT (_ULCAST_(1) << 5) | 461 | #define R10K_CONF_CT (_ULCAST_(1) << 5) |
@@ -475,6 +498,53 @@ | |||
475 | #define MIPS_CONF_M (_ULCAST_(1) << 31) | 498 | #define MIPS_CONF_M (_ULCAST_(1) << 31) |
476 | 499 | ||
477 | /* | 500 | /* |
501 | * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above. | ||
502 | */ | ||
503 | #define MIPS_CONF1_FP (_ULCAST_(1) << 0) | ||
504 | #define MIPS_CONF1_EP (_ULCAST_(1) << 1) | ||
505 | #define MIPS_CONF1_CA (_ULCAST_(1) << 2) | ||
506 | #define MIPS_CONF1_WR (_ULCAST_(1) << 3) | ||
507 | #define MIPS_CONF1_PC (_ULCAST_(1) << 4) | ||
508 | #define MIPS_CONF1_MD (_ULCAST_(1) << 5) | ||
509 | #define MIPS_CONF1_C2 (_ULCAST_(1) << 6) | ||
510 | #define MIPS_CONF1_DA (_ULCAST_(7) << 7) | ||
511 | #define MIPS_CONF1_DL (_ULCAST_(7) << 10) | ||
512 | #define MIPS_CONF1_DS (_ULCAST_(7) << 13) | ||
513 | #define MIPS_CONF1_IA (_ULCAST_(7) << 16) | ||
514 | #define MIPS_CONF1_IL (_ULCAST_(7) << 19) | ||
515 | #define MIPS_CONF1_IS (_ULCAST_(7) << 22) | ||
516 | #define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25) | ||
517 | |||
518 | #define MIPS_CONF2_SA (_ULCAST_(15)<< 0) | ||
519 | #define MIPS_CONF2_SL (_ULCAST_(15)<< 4) | ||
520 | #define MIPS_CONF2_SS (_ULCAST_(15)<< 8) | ||
521 | #define MIPS_CONF2_SU (_ULCAST_(15)<< 12) | ||
522 | #define MIPS_CONF2_TA (_ULCAST_(15)<< 16) | ||
523 | #define MIPS_CONF2_TL (_ULCAST_(15)<< 20) | ||
524 | #define MIPS_CONF2_TS (_ULCAST_(15)<< 24) | ||
525 | #define MIPS_CONF2_TU (_ULCAST_(7) << 28) | ||
526 | |||
527 | #define MIPS_CONF3_TL (_ULCAST_(1) << 0) | ||
528 | #define MIPS_CONF3_SM (_ULCAST_(1) << 1) | ||
529 | #define MIPS_CONF3_MT (_ULCAST_(1) << 2) | ||
530 | #define MIPS_CONF3_SP (_ULCAST_(1) << 4) | ||
531 | #define MIPS_CONF3_VINT (_ULCAST_(1) << 5) | ||
532 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) | ||
533 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) | ||
534 | #define MIPS_CONF3_DSP (_ULCAST_(1) << 10) | ||
535 | |||
536 | /* | ||
537 | * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. | ||
538 | */ | ||
539 | #define MIPS_FPIR_S (_ULCAST_(1) << 16) | ||
540 | #define MIPS_FPIR_D (_ULCAST_(1) << 17) | ||
541 | #define MIPS_FPIR_PS (_ULCAST_(1) << 18) | ||
542 | #define MIPS_FPIR_3D (_ULCAST_(1) << 19) | ||
543 | #define MIPS_FPIR_W (_ULCAST_(1) << 20) | ||
544 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) | ||
545 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) | ||
546 | |||
547 | /* | ||
478 | * R10000 performance counter definitions. | 548 | * R10000 performance counter definitions. |
479 | * | 549 | * |
480 | * FIXME: The R10000 performance counter opens a nice way to implement CPU | 550 | * FIXME: The R10000 performance counter opens a nice way to implement CPU |
@@ -621,13 +691,13 @@ do { \ | |||
621 | if (sel == 0) \ | 691 | if (sel == 0) \ |
622 | __asm__ __volatile__( \ | 692 | __asm__ __volatile__( \ |
623 | "mtc0\t%z0, " #register "\n\t" \ | 693 | "mtc0\t%z0, " #register "\n\t" \ |
624 | : : "Jr" ((unsigned int)value)); \ | 694 | : : "Jr" ((unsigned int)(value))); \ |
625 | else \ | 695 | else \ |
626 | __asm__ __volatile__( \ | 696 | __asm__ __volatile__( \ |
627 | ".set\tmips32\n\t" \ | 697 | ".set\tmips32\n\t" \ |
628 | "mtc0\t%z0, " #register ", " #sel "\n\t" \ | 698 | "mtc0\t%z0, " #register ", " #sel "\n\t" \ |
629 | ".set\tmips0" \ | 699 | ".set\tmips0" \ |
630 | : : "Jr" ((unsigned int)value)); \ | 700 | : : "Jr" ((unsigned int)(value))); \ |
631 | } while (0) | 701 | } while (0) |
632 | 702 | ||
633 | #define __write_64bit_c0_register(register, sel, value) \ | 703 | #define __write_64bit_c0_register(register, sel, value) \ |
@@ -676,7 +746,7 @@ do { \ | |||
676 | do { \ | 746 | do { \ |
677 | __asm__ __volatile__( \ | 747 | __asm__ __volatile__( \ |
678 | "ctc0\t%z0, " #register "\n\t" \ | 748 | "ctc0\t%z0, " #register "\n\t" \ |
679 | : : "Jr" ((unsigned int)value)); \ | 749 | : : "Jr" ((unsigned int)(value))); \ |
680 | } while (0) | 750 | } while (0) |
681 | 751 | ||
682 | /* | 752 | /* |
@@ -769,12 +839,24 @@ do { \ | |||
769 | #define read_c0_count() __read_32bit_c0_register($9, 0) | 839 | #define read_c0_count() __read_32bit_c0_register($9, 0) |
770 | #define write_c0_count(val) __write_32bit_c0_register($9, 0, val) | 840 | #define write_c0_count(val) __write_32bit_c0_register($9, 0, val) |
771 | 841 | ||
842 | #define read_c0_count2() __read_32bit_c0_register($9, 6) /* pnx8550 */ | ||
843 | #define write_c0_count2(val) __write_32bit_c0_register($9, 6, val) | ||
844 | |||
845 | #define read_c0_count3() __read_32bit_c0_register($9, 7) /* pnx8550 */ | ||
846 | #define write_c0_count3(val) __write_32bit_c0_register($9, 7, val) | ||
847 | |||
772 | #define read_c0_entryhi() __read_ulong_c0_register($10, 0) | 848 | #define read_c0_entryhi() __read_ulong_c0_register($10, 0) |
773 | #define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) | 849 | #define write_c0_entryhi(val) __write_ulong_c0_register($10, 0, val) |
774 | 850 | ||
775 | #define read_c0_compare() __read_32bit_c0_register($11, 0) | 851 | #define read_c0_compare() __read_32bit_c0_register($11, 0) |
776 | #define write_c0_compare(val) __write_32bit_c0_register($11, 0, val) | 852 | #define write_c0_compare(val) __write_32bit_c0_register($11, 0, val) |
777 | 853 | ||
854 | #define read_c0_compare2() __read_32bit_c0_register($11, 6) /* pnx8550 */ | ||
855 | #define write_c0_compare2(val) __write_32bit_c0_register($11, 6, val) | ||
856 | |||
857 | #define read_c0_compare3() __read_32bit_c0_register($11, 7) /* pnx8550 */ | ||
858 | #define write_c0_compare3(val) __write_32bit_c0_register($11, 7, val) | ||
859 | |||
778 | #define read_c0_status() __read_32bit_c0_register($12, 0) | 860 | #define read_c0_status() __read_32bit_c0_register($12, 0) |
779 | #define write_c0_status(val) __write_32bit_c0_register($12, 0, val) | 861 | #define write_c0_status(val) __write_32bit_c0_register($12, 0, val) |
780 | 862 | ||
@@ -790,10 +872,18 @@ do { \ | |||
790 | #define read_c0_config1() __read_32bit_c0_register($16, 1) | 872 | #define read_c0_config1() __read_32bit_c0_register($16, 1) |
791 | #define read_c0_config2() __read_32bit_c0_register($16, 2) | 873 | #define read_c0_config2() __read_32bit_c0_register($16, 2) |
792 | #define read_c0_config3() __read_32bit_c0_register($16, 3) | 874 | #define read_c0_config3() __read_32bit_c0_register($16, 3) |
875 | #define read_c0_config4() __read_32bit_c0_register($16, 4) | ||
876 | #define read_c0_config5() __read_32bit_c0_register($16, 5) | ||
877 | #define read_c0_config6() __read_32bit_c0_register($16, 6) | ||
878 | #define read_c0_config7() __read_32bit_c0_register($16, 7) | ||
793 | #define write_c0_config(val) __write_32bit_c0_register($16, 0, val) | 879 | #define write_c0_config(val) __write_32bit_c0_register($16, 0, val) |
794 | #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val) | 880 | #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val) |
795 | #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val) | 881 | #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val) |
796 | #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val) | 882 | #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val) |
883 | #define write_c0_config4(val) __write_32bit_c0_register($16, 4, val) | ||
884 | #define write_c0_config5(val) __write_32bit_c0_register($16, 5, val) | ||
885 | #define write_c0_config6(val) __write_32bit_c0_register($16, 6, val) | ||
886 | #define write_c0_config7(val) __write_32bit_c0_register($16, 7, val) | ||
797 | 887 | ||
798 | /* | 888 | /* |
799 | * The WatchLo register. There may be upto 8 of them. | 889 | * The WatchLo register. There may be upto 8 of them. |
@@ -917,6 +1007,22 @@ do { \ | |||
917 | #define read_c0_errorepc() __read_ulong_c0_register($30, 0) | 1007 | #define read_c0_errorepc() __read_ulong_c0_register($30, 0) |
918 | #define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val) | 1008 | #define write_c0_errorepc(val) __write_ulong_c0_register($30, 0, val) |
919 | 1009 | ||
1010 | /* MIPSR2 */ | ||
1011 | #define read_c0_hwrena() __read_32bit_c0_register($7,0) | ||
1012 | #define write_c0_hwrena(val) __write_32bit_c0_register($7, 0, val) | ||
1013 | |||
1014 | #define read_c0_intctl() __read_32bit_c0_register($12, 1) | ||
1015 | #define write_c0_intctl(val) __write_32bit_c0_register($12, 1, val) | ||
1016 | |||
1017 | #define read_c0_srsctl() __read_32bit_c0_register($12, 2) | ||
1018 | #define write_c0_srsctl(val) __write_32bit_c0_register($12, 2, val) | ||
1019 | |||
1020 | #define read_c0_srsmap() __read_32bit_c0_register($12, 3) | ||
1021 | #define write_c0_srsmap(val) __write_32bit_c0_register($12, 3, val) | ||
1022 | |||
1023 | #define read_c0_ebase() __read_32bit_c0_register($15,1) | ||
1024 | #define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) | ||
1025 | |||
920 | /* | 1026 | /* |
921 | * Macros to access the floating point coprocessor control registers | 1027 | * Macros to access the floating point coprocessor control registers |
922 | */ | 1028 | */ |
@@ -930,6 +1036,284 @@ do { \ | |||
930 | : "=r" (__res)); \ | 1036 | : "=r" (__res)); \ |
931 | __res;}) | 1037 | __res;}) |
932 | 1038 | ||
1039 | #define rddsp(mask) \ | ||
1040 | ({ \ | ||
1041 | unsigned int __res; \ | ||
1042 | \ | ||
1043 | __asm__ __volatile__( \ | ||
1044 | " .set push \n" \ | ||
1045 | " .set noat \n" \ | ||
1046 | " # rddsp $1, %x1 \n" \ | ||
1047 | " .word 0x7c000cb8 | (%x1 << 16) \n" \ | ||
1048 | " move %0, $1 \n" \ | ||
1049 | " .set pop \n" \ | ||
1050 | : "=r" (__res) \ | ||
1051 | : "i" (mask)); \ | ||
1052 | __res; \ | ||
1053 | }) | ||
1054 | |||
1055 | #define wrdsp(val, mask) \ | ||
1056 | do { \ | ||
1057 | __asm__ __volatile__( \ | ||
1058 | " .set push \n" \ | ||
1059 | " .set noat \n" \ | ||
1060 | " move $1, %0 \n" \ | ||
1061 | " # wrdsp $1, %x1 \n" \ | ||
1062 | " .word 0x7c2004f8 | (%x1 << 15) \n" \ | ||
1063 | " .set pop \n" \ | ||
1064 | : \ | ||
1065 | : "r" (val), "i" (mask)); \ | ||
1066 | } while (0) | ||
1067 | |||
1068 | #if 0 /* Need DSP ASE capable assembler ... */ | ||
1069 | #define mflo0() ({ long mflo0; __asm__("mflo %0, $ac0" : "=r" (mflo0)); mflo0;}) | ||
1070 | #define mflo1() ({ long mflo1; __asm__("mflo %0, $ac1" : "=r" (mflo1)); mflo1;}) | ||
1071 | #define mflo2() ({ long mflo2; __asm__("mflo %0, $ac2" : "=r" (mflo2)); mflo2;}) | ||
1072 | #define mflo3() ({ long mflo3; __asm__("mflo %0, $ac3" : "=r" (mflo3)); mflo3;}) | ||
1073 | |||
1074 | #define mfhi0() ({ long mfhi0; __asm__("mfhi %0, $ac0" : "=r" (mfhi0)); mfhi0;}) | ||
1075 | #define mfhi1() ({ long mfhi1; __asm__("mfhi %0, $ac1" : "=r" (mfhi1)); mfhi1;}) | ||
1076 | #define mfhi2() ({ long mfhi2; __asm__("mfhi %0, $ac2" : "=r" (mfhi2)); mfhi2;}) | ||
1077 | #define mfhi3() ({ long mfhi3; __asm__("mfhi %0, $ac3" : "=r" (mfhi3)); mfhi3;}) | ||
1078 | |||
1079 | #define mtlo0(x) __asm__("mtlo %0, $ac0" ::"r" (x)) | ||
1080 | #define mtlo1(x) __asm__("mtlo %0, $ac1" ::"r" (x)) | ||
1081 | #define mtlo2(x) __asm__("mtlo %0, $ac2" ::"r" (x)) | ||
1082 | #define mtlo3(x) __asm__("mtlo %0, $ac3" ::"r" (x)) | ||
1083 | |||
1084 | #define mthi0(x) __asm__("mthi %0, $ac0" ::"r" (x)) | ||
1085 | #define mthi1(x) __asm__("mthi %0, $ac1" ::"r" (x)) | ||
1086 | #define mthi2(x) __asm__("mthi %0, $ac2" ::"r" (x)) | ||
1087 | #define mthi3(x) __asm__("mthi %0, $ac3" ::"r" (x)) | ||
1088 | |||
1089 | #else | ||
1090 | |||
1091 | #define mfhi0() \ | ||
1092 | ({ \ | ||
1093 | unsigned long __treg; \ | ||
1094 | \ | ||
1095 | __asm__ __volatile__( \ | ||
1096 | " .set push \n" \ | ||
1097 | " .set noat \n" \ | ||
1098 | " # mfhi %0, $ac0 \n" \ | ||
1099 | " .word 0x00000810 \n" \ | ||
1100 | " move %0, $1 \n" \ | ||
1101 | " .set pop \n" \ | ||
1102 | : "=r" (__treg)); \ | ||
1103 | __treg; \ | ||
1104 | }) | ||
1105 | |||
1106 | #define mfhi1() \ | ||
1107 | ({ \ | ||
1108 | unsigned long __treg; \ | ||
1109 | \ | ||
1110 | __asm__ __volatile__( \ | ||
1111 | " .set push \n" \ | ||
1112 | " .set noat \n" \ | ||
1113 | " # mfhi %0, $ac1 \n" \ | ||
1114 | " .word 0x00200810 \n" \ | ||
1115 | " move %0, $1 \n" \ | ||
1116 | " .set pop \n" \ | ||
1117 | : "=r" (__treg)); \ | ||
1118 | __treg; \ | ||
1119 | }) | ||
1120 | |||
1121 | #define mfhi2() \ | ||
1122 | ({ \ | ||
1123 | unsigned long __treg; \ | ||
1124 | \ | ||
1125 | __asm__ __volatile__( \ | ||
1126 | " .set push \n" \ | ||
1127 | " .set noat \n" \ | ||
1128 | " # mfhi %0, $ac2 \n" \ | ||
1129 | " .word 0x00400810 \n" \ | ||
1130 | " move %0, $1 \n" \ | ||
1131 | " .set pop \n" \ | ||
1132 | : "=r" (__treg)); \ | ||
1133 | __treg; \ | ||
1134 | }) | ||
1135 | |||
1136 | #define mfhi3() \ | ||
1137 | ({ \ | ||
1138 | unsigned long __treg; \ | ||
1139 | \ | ||
1140 | __asm__ __volatile__( \ | ||
1141 | " .set push \n" \ | ||
1142 | " .set noat \n" \ | ||
1143 | " # mfhi %0, $ac3 \n" \ | ||
1144 | " .word 0x00600810 \n" \ | ||
1145 | " move %0, $1 \n" \ | ||
1146 | " .set pop \n" \ | ||
1147 | : "=r" (__treg)); \ | ||
1148 | __treg; \ | ||
1149 | }) | ||
1150 | |||
1151 | #define mflo0() \ | ||
1152 | ({ \ | ||
1153 | unsigned long __treg; \ | ||
1154 | \ | ||
1155 | __asm__ __volatile__( \ | ||
1156 | " .set push \n" \ | ||
1157 | " .set noat \n" \ | ||
1158 | " # mflo %0, $ac0 \n" \ | ||
1159 | " .word 0x00000812 \n" \ | ||
1160 | " move %0, $1 \n" \ | ||
1161 | " .set pop \n" \ | ||
1162 | : "=r" (__treg)); \ | ||
1163 | __treg; \ | ||
1164 | }) | ||
1165 | |||
1166 | #define mflo1() \ | ||
1167 | ({ \ | ||
1168 | unsigned long __treg; \ | ||
1169 | \ | ||
1170 | __asm__ __volatile__( \ | ||
1171 | " .set push \n" \ | ||
1172 | " .set noat \n" \ | ||
1173 | " # mflo %0, $ac1 \n" \ | ||
1174 | " .word 0x00200812 \n" \ | ||
1175 | " move %0, $1 \n" \ | ||
1176 | " .set pop \n" \ | ||
1177 | : "=r" (__treg)); \ | ||
1178 | __treg; \ | ||
1179 | }) | ||
1180 | |||
1181 | #define mflo2() \ | ||
1182 | ({ \ | ||
1183 | unsigned long __treg; \ | ||
1184 | \ | ||
1185 | __asm__ __volatile__( \ | ||
1186 | " .set push \n" \ | ||
1187 | " .set noat \n" \ | ||
1188 | " # mflo %0, $ac2 \n" \ | ||
1189 | " .word 0x00400812 \n" \ | ||
1190 | " move %0, $1 \n" \ | ||
1191 | " .set pop \n" \ | ||
1192 | : "=r" (__treg)); \ | ||
1193 | __treg; \ | ||
1194 | }) | ||
1195 | |||
1196 | #define mflo3() \ | ||
1197 | ({ \ | ||
1198 | unsigned long __treg; \ | ||
1199 | \ | ||
1200 | __asm__ __volatile__( \ | ||
1201 | " .set push \n" \ | ||
1202 | " .set noat \n" \ | ||
1203 | " # mflo %0, $ac3 \n" \ | ||
1204 | " .word 0x00600812 \n" \ | ||
1205 | " move %0, $1 \n" \ | ||
1206 | " .set pop \n" \ | ||
1207 | : "=r" (__treg)); \ | ||
1208 | __treg; \ | ||
1209 | }) | ||
1210 | |||
1211 | #define mthi0(x) \ | ||
1212 | do { \ | ||
1213 | __asm__ __volatile__( \ | ||
1214 | " .set push \n" \ | ||
1215 | " .set noat \n" \ | ||
1216 | " move $1, %0 \n" \ | ||
1217 | " # mthi $1, $ac0 \n" \ | ||
1218 | " .word 0x00200011 \n" \ | ||
1219 | " .set pop \n" \ | ||
1220 | : \ | ||
1221 | : "r" (x)); \ | ||
1222 | } while (0) | ||
1223 | |||
1224 | #define mthi1(x) \ | ||
1225 | do { \ | ||
1226 | __asm__ __volatile__( \ | ||
1227 | " .set push \n" \ | ||
1228 | " .set noat \n" \ | ||
1229 | " move $1, %0 \n" \ | ||
1230 | " # mthi $1, $ac1 \n" \ | ||
1231 | " .word 0x00200811 \n" \ | ||
1232 | " .set pop \n" \ | ||
1233 | : \ | ||
1234 | : "r" (x)); \ | ||
1235 | } while (0) | ||
1236 | |||
1237 | #define mthi2(x) \ | ||
1238 | do { \ | ||
1239 | __asm__ __volatile__( \ | ||
1240 | " .set push \n" \ | ||
1241 | " .set noat \n" \ | ||
1242 | " move $1, %0 \n" \ | ||
1243 | " # mthi $1, $ac2 \n" \ | ||
1244 | " .word 0x00201011 \n" \ | ||
1245 | " .set pop \n" \ | ||
1246 | : \ | ||
1247 | : "r" (x)); \ | ||
1248 | } while (0) | ||
1249 | |||
1250 | #define mthi3(x) \ | ||
1251 | do { \ | ||
1252 | __asm__ __volatile__( \ | ||
1253 | " .set push \n" \ | ||
1254 | " .set noat \n" \ | ||
1255 | " move $1, %0 \n" \ | ||
1256 | " # mthi $1, $ac3 \n" \ | ||
1257 | " .word 0x00201811 \n" \ | ||
1258 | " .set pop \n" \ | ||
1259 | : \ | ||
1260 | : "r" (x)); \ | ||
1261 | } while (0) | ||
1262 | |||
1263 | #define mtlo0(x) \ | ||
1264 | do { \ | ||
1265 | __asm__ __volatile__( \ | ||
1266 | " .set push \n" \ | ||
1267 | " .set noat \n" \ | ||
1268 | " move $1, %0 \n" \ | ||
1269 | " # mtlo $1, $ac0 \n" \ | ||
1270 | " .word 0x00200013 \n" \ | ||
1271 | " .set pop \n" \ | ||
1272 | : \ | ||
1273 | : "r" (x)); \ | ||
1274 | } while (0) | ||
1275 | |||
1276 | #define mtlo1(x) \ | ||
1277 | do { \ | ||
1278 | __asm__ __volatile__( \ | ||
1279 | " .set push \n" \ | ||
1280 | " .set noat \n" \ | ||
1281 | " move $1, %0 \n" \ | ||
1282 | " # mtlo $1, $ac1 \n" \ | ||
1283 | " .word 0x00200813 \n" \ | ||
1284 | " .set pop \n" \ | ||
1285 | : \ | ||
1286 | : "r" (x)); \ | ||
1287 | } while (0) | ||
1288 | |||
1289 | #define mtlo2(x) \ | ||
1290 | do { \ | ||
1291 | __asm__ __volatile__( \ | ||
1292 | " .set push \n" \ | ||
1293 | " .set noat \n" \ | ||
1294 | " move $1, %0 \n" \ | ||
1295 | " # mtlo $1, $ac2 \n" \ | ||
1296 | " .word 0x00201013 \n" \ | ||
1297 | " .set pop \n" \ | ||
1298 | : \ | ||
1299 | : "r" (x)); \ | ||
1300 | } while (0) | ||
1301 | |||
1302 | #define mtlo3(x) \ | ||
1303 | do { \ | ||
1304 | __asm__ __volatile__( \ | ||
1305 | " .set push \n" \ | ||
1306 | " .set noat \n" \ | ||
1307 | " move $1, %0 \n" \ | ||
1308 | " # mtlo $1, $ac3 \n" \ | ||
1309 | " .word 0x00201813 \n" \ | ||
1310 | " .set pop \n" \ | ||
1311 | : \ | ||
1312 | : "r" (x)); \ | ||
1313 | } while (0) | ||
1314 | |||
1315 | #endif | ||
1316 | |||
933 | /* | 1317 | /* |
934 | * TLB operations. | 1318 | * TLB operations. |
935 | * | 1319 | * |
@@ -1012,6 +1396,8 @@ __BUILD_SET_C0(status) | |||
1012 | __BUILD_SET_C0(cause) | 1396 | __BUILD_SET_C0(cause) |
1013 | __BUILD_SET_C0(config) | 1397 | __BUILD_SET_C0(config) |
1014 | __BUILD_SET_C0(intcontrol) | 1398 | __BUILD_SET_C0(intcontrol) |
1399 | __BUILD_SET_C0(intctl) | ||
1400 | __BUILD_SET_C0(srsmap) | ||
1015 | 1401 | ||
1016 | #endif /* !__ASSEMBLY__ */ | 1402 | #endif /* !__ASSEMBLY__ */ |
1017 | 1403 | ||
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h index 45cd72d172e8..19cdf7642e66 100644 --- a/include/asm-mips/mmu_context.h +++ b/include/asm-mips/mmu_context.h | |||
@@ -30,7 +30,7 @@ extern unsigned long pgd_current[]; | |||
30 | 30 | ||
31 | #ifdef CONFIG_32BIT | 31 | #ifdef CONFIG_32BIT |
32 | #define TLBMISS_HANDLER_SETUP() \ | 32 | #define TLBMISS_HANDLER_SETUP() \ |
33 | write_c0_context((unsigned long) smp_processor_id() << 23); \ | 33 | write_c0_context((unsigned long) smp_processor_id() << 25); \ |
34 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | 34 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) |
35 | #endif | 35 | #endif |
36 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 36 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
@@ -40,7 +40,7 @@ extern unsigned long pgd_current[]; | |||
40 | #endif | 40 | #endif |
41 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | 41 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) |
42 | #define TLBMISS_HANDLER_SETUP() \ | 42 | #define TLBMISS_HANDLER_SETUP() \ |
43 | write_c0_context((unsigned long) smp_processor_id() << 23); \ | 43 | write_c0_context((unsigned long) smp_processor_id() << 26); \ |
44 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) | 44 | TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) |
45 | #endif | 45 | #endif |
46 | 46 | ||
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h index d721143dbd47..011caebac369 100644 --- a/include/asm-mips/mmzone.h +++ b/include/asm-mips/mmzone.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #ifndef _ASM_MMZONE_H_ | 5 | #ifndef _ASM_MMZONE_H_ |
6 | #define _ASM_MMZONE_H_ | 6 | #define _ASM_MMZONE_H_ |
7 | 7 | ||
8 | #include <linux/config.h> | ||
8 | #include <asm/page.h> | 9 | #include <asm/page.h> |
9 | #include <mmzone.h> | 10 | #include <mmzone.h> |
10 | 11 | ||
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h index 0be58b2aeb9f..2be399311eec 100644 --- a/include/asm-mips/module.h +++ b/include/asm-mips/module.h | |||
@@ -14,15 +14,23 @@ struct mod_arch_specific { | |||
14 | 14 | ||
15 | typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ | 15 | typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ |
16 | 16 | ||
17 | typedef struct | 17 | typedef struct { |
18 | { | 18 | Elf64_Addr r_offset; /* Address of relocation. */ |
19 | Elf64_Addr r_offset; /* Address of relocation. */ | 19 | Elf64_Word r_sym; /* Symbol index. */ |
20 | Elf64_Word r_sym; /* Symbol index. */ | 20 | Elf64_Byte r_ssym; /* Special symbol. */ |
21 | Elf64_Byte r_ssym; /* Special symbol. */ | 21 | Elf64_Byte r_type3; /* Third relocation. */ |
22 | Elf64_Byte r_type3; /* Third relocation. */ | 22 | Elf64_Byte r_type2; /* Second relocation. */ |
23 | Elf64_Byte r_type2; /* Second relocation. */ | 23 | Elf64_Byte r_type; /* First relocation. */ |
24 | Elf64_Byte r_type; /* First relocation. */ | 24 | } Elf64_Mips_Rel; |
25 | Elf64_Sxword r_addend; /* Addend. */ | 25 | |
26 | typedef struct { | ||
27 | Elf64_Addr r_offset; /* Address of relocation. */ | ||
28 | Elf64_Word r_sym; /* Symbol index. */ | ||
29 | Elf64_Byte r_ssym; /* Special symbol. */ | ||
30 | Elf64_Byte r_type3; /* Third relocation. */ | ||
31 | Elf64_Byte r_type2; /* Second relocation. */ | ||
32 | Elf64_Byte r_type; /* First relocation. */ | ||
33 | Elf64_Sxword r_addend; /* Addend. */ | ||
26 | } Elf64_Mips_Rela; | 34 | } Elf64_Mips_Rela; |
27 | 35 | ||
28 | #ifdef CONFIG_32BIT | 36 | #ifdef CONFIG_32BIT |
@@ -30,6 +38,13 @@ typedef struct | |||
30 | #define Elf_Shdr Elf32_Shdr | 38 | #define Elf_Shdr Elf32_Shdr |
31 | #define Elf_Sym Elf32_Sym | 39 | #define Elf_Sym Elf32_Sym |
32 | #define Elf_Ehdr Elf32_Ehdr | 40 | #define Elf_Ehdr Elf32_Ehdr |
41 | #define Elf_Addr Elf32_Addr | ||
42 | |||
43 | #define Elf_Mips_Rel Elf32_Rel | ||
44 | #define Elf_Mips_Rela Elf32_Rela | ||
45 | |||
46 | #define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info) | ||
47 | #define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info) | ||
33 | 48 | ||
34 | #endif | 49 | #endif |
35 | 50 | ||
@@ -38,6 +53,13 @@ typedef struct | |||
38 | #define Elf_Shdr Elf64_Shdr | 53 | #define Elf_Shdr Elf64_Shdr |
39 | #define Elf_Sym Elf64_Sym | 54 | #define Elf_Sym Elf64_Sym |
40 | #define Elf_Ehdr Elf64_Ehdr | 55 | #define Elf_Ehdr Elf64_Ehdr |
56 | #define Elf_Addr Elf64_Addr | ||
57 | |||
58 | #define Elf_Mips_Rel Elf64_Mips_Rel | ||
59 | #define Elf_Mips_Rela Elf64_Mips_Rela | ||
60 | |||
61 | #define ELF_MIPS_R_SYM(rel) (rel.r_sym) | ||
62 | #define ELF_MIPS_R_TYPE(rel) (rel.r_type) | ||
41 | 63 | ||
42 | #endif | 64 | #endif |
43 | 65 | ||
@@ -53,4 +75,54 @@ search_module_dbetables(unsigned long addr) | |||
53 | } | 75 | } |
54 | #endif | 76 | #endif |
55 | 77 | ||
78 | #ifdef CONFIG_CPU_MIPS32_R1 | ||
79 | #define MODULE_PROC_FAMILY "MIPS32_R1" | ||
80 | #elif defined CONFIG_CPU_MIPS32_R2 | ||
81 | #define MODULE_PROC_FAMILY "MIPS32_R2" | ||
82 | #elif defined CONFIG_CPU_MIPS64_R1 | ||
83 | #define MODULE_PROC_FAMILY "MIPS64_R1" | ||
84 | #elif defined CONFIG_CPU_MIPS64_R2 | ||
85 | #define MODULE_PROC_FAMILY "MIPS64_R2" | ||
86 | #elif defined CONFIG_CPU_R3000 | ||
87 | #define MODULE_PROC_FAMILY "R3000" | ||
88 | #elif defined CONFIG_CPU_TX39XX | ||
89 | #define MODULE_PROC_FAMILY "TX39XX" | ||
90 | #elif defined CONFIG_CPU_VR41XX | ||
91 | #define MODULE_PROC_FAMILY "VR41XX" | ||
92 | #elif defined CONFIG_CPU_R4300 | ||
93 | #define MODULE_PROC_FAMILY "R4300" | ||
94 | #elif defined CONFIG_CPU_R4X00 | ||
95 | #define MODULE_PROC_FAMILY "R4X00" | ||
96 | #elif defined CONFIG_CPU_TX49XX | ||
97 | #define MODULE_PROC_FAMILY "TX49XX" | ||
98 | #elif defined CONFIG_CPU_R5000 | ||
99 | #define MODULE_PROC_FAMILY "R5000" | ||
100 | #elif defined CONFIG_CPU_R5432 | ||
101 | #define MODULE_PROC_FAMILY "R5432" | ||
102 | #elif defined CONFIG_CPU_R6000 | ||
103 | #define MODULE_PROC_FAMILY "R6000" | ||
104 | #elif defined CONFIG_CPU_NEVADA | ||
105 | #define MODULE_PROC_FAMILY "NEVADA" | ||
106 | #elif defined CONFIG_CPU_R8000 | ||
107 | #define MODULE_PROC_FAMILY "R8000" | ||
108 | #elif defined CONFIG_CPU_R10000 | ||
109 | #define MODULE_PROC_FAMILY "R10000" | ||
110 | #elif defined CONFIG_CPU_RM7000 | ||
111 | #define MODULE_PROC_FAMILY "RM7000" | ||
112 | #elif defined CONFIG_CPU_RM9000 | ||
113 | #define MODULE_PROC_FAMILY "RM9000" | ||
114 | #elif defined CONFIG_CPU_SB1 | ||
115 | #define MODULE_PROC_FAMILY "SB1" | ||
116 | #else | ||
117 | #error MODULE_PROC_FAMILY undefined for your processor configuration | ||
118 | #endif | ||
119 | |||
120 | #ifdef CONFIG_32BIT | ||
121 | #define MODULE_KERNEL_TYPE "32BIT " | ||
122 | #elif defined CONFIG_64BIT | ||
123 | #define MODULE_KERNEL_TYPE "64BIT " | ||
124 | #endif | ||
125 | |||
126 | #define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_KERNEL_TYPE | ||
127 | |||
56 | #endif /* _ASM_MODULE_H */ | 128 | #endif /* _ASM_MODULE_H */ |
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h index 309bc3099f68..46f2d23d2697 100644 --- a/include/asm-mips/paccess.h +++ b/include/asm-mips/paccess.h | |||
@@ -52,7 +52,7 @@ struct __large_pstruct { unsigned long buf[100]; }; | |||
52 | }) | 52 | }) |
53 | 53 | ||
54 | #define __get_dbe_asm(insn) \ | 54 | #define __get_dbe_asm(insn) \ |
55 | ({ \ | 55 | { \ |
56 | __asm__ __volatile__( \ | 56 | __asm__ __volatile__( \ |
57 | "1:\t" insn "\t%1,%2\n\t" \ | 57 | "1:\t" insn "\t%1,%2\n\t" \ |
58 | "move\t%0,$0\n" \ | 58 | "move\t%0,$0\n" \ |
@@ -67,7 +67,7 @@ struct __large_pstruct { unsigned long buf[100]; }; | |||
67 | ".previous" \ | 67 | ".previous" \ |
68 | :"=r" (__gu_err), "=r" (__gu_val) \ | 68 | :"=r" (__gu_err), "=r" (__gu_val) \ |
69 | :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \ | 69 | :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \ |
70 | }) | 70 | } |
71 | 71 | ||
72 | extern void __get_dbe_unknown(void); | 72 | extern void __get_dbe_unknown(void); |
73 | 73 | ||
@@ -90,7 +90,7 @@ extern void __get_dbe_unknown(void); | |||
90 | }) | 90 | }) |
91 | 91 | ||
92 | #define __put_dbe_asm(insn) \ | 92 | #define __put_dbe_asm(insn) \ |
93 | ({ \ | 93 | { \ |
94 | __asm__ __volatile__( \ | 94 | __asm__ __volatile__( \ |
95 | "1:\t" insn "\t%1,%2\n\t" \ | 95 | "1:\t" insn "\t%1,%2\n\t" \ |
96 | "move\t%0,$0\n" \ | 96 | "move\t%0,$0\n" \ |
@@ -104,7 +104,7 @@ extern void __get_dbe_unknown(void); | |||
104 | ".previous" \ | 104 | ".previous" \ |
105 | : "=r" (__pu_err) \ | 105 | : "=r" (__pu_err) \ |
106 | : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \ | 106 | : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \ |
107 | }) | 107 | } |
108 | 108 | ||
109 | extern void __put_dbe_unknown(void); | 109 | extern void __put_dbe_unknown(void); |
110 | 110 | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 652b6d67a571..ee25a779bf49 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -87,22 +87,48 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | |||
87 | typedef struct { unsigned long pte; } pte_t; | 87 | typedef struct { unsigned long pte; } pte_t; |
88 | #define pte_val(x) ((x).pte) | 88 | #define pte_val(x) ((x).pte) |
89 | #endif | 89 | #endif |
90 | #define __pte(x) ((pte_t) { (x) } ) | ||
90 | 91 | ||
91 | typedef struct { unsigned long pmd; } pmd_t; | 92 | /* |
92 | typedef struct { unsigned long pgd; } pgd_t; | 93 | * For 3-level pagetables we defines these ourselves, for 2-level the |
93 | typedef struct { unsigned long pgprot; } pgprot_t; | 94 | * definitions are supplied by <asm-generic/pgtable-nopmd.h>. |
95 | */ | ||
96 | #ifdef CONFIG_64BIT | ||
94 | 97 | ||
98 | typedef struct { unsigned long pmd; } pmd_t; | ||
95 | #define pmd_val(x) ((x).pmd) | 99 | #define pmd_val(x) ((x).pmd) |
96 | #define pgd_val(x) ((x).pgd) | 100 | #define __pmd(x) ((pmd_t) { (x) } ) |
97 | #define pgprot_val(x) ((x).pgprot) | ||
98 | 101 | ||
99 | #define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) | 102 | #endif |
100 | 103 | ||
101 | #define __pte(x) ((pte_t) { (x) } ) | 104 | /* |
102 | #define __pmd(x) ((pmd_t) { (x) } ) | 105 | * Right now we don't support 4-level pagetables, so all pud-related |
106 | * definitions come from <asm-generic/pgtable-nopud.h>. | ||
107 | */ | ||
108 | |||
109 | /* | ||
110 | * Finall the top of the hierarchy, the pgd | ||
111 | */ | ||
112 | typedef struct { unsigned long pgd; } pgd_t; | ||
113 | #define pgd_val(x) ((x).pgd) | ||
103 | #define __pgd(x) ((pgd_t) { (x) } ) | 114 | #define __pgd(x) ((pgd_t) { (x) } ) |
115 | |||
116 | /* | ||
117 | * Manipulate page protection bits | ||
118 | */ | ||
119 | typedef struct { unsigned long pgprot; } pgprot_t; | ||
120 | #define pgprot_val(x) ((x).pgprot) | ||
104 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 121 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
105 | 122 | ||
123 | /* | ||
124 | * On R4000-style MMUs where a TLB entry is mapping a adjacent even / odd | ||
125 | * pair of pages we only have a single global bit per pair of pages. When | ||
126 | * writing to the TLB make sure we always have the bit set for both pages | ||
127 | * or none. This macro is used to access the `buddy' of the pte we're just | ||
128 | * working on. | ||
129 | */ | ||
130 | #define ptep_buddy(x) ((pte_t *)((unsigned long)(x) ^ sizeof(pte_t))) | ||
131 | |||
106 | #endif /* !__ASSEMBLY__ */ | 132 | #endif /* !__ASSEMBLY__ */ |
107 | 133 | ||
108 | /* to align the pointer to the (next) page boundary */ | 134 | /* to align the pointer to the (next) page boundary */ |
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index c9a00ca1c012..6c9ad8171a77 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h | |||
@@ -40,6 +40,11 @@ struct pci_controller { | |||
40 | unsigned int need_domain_info; | 40 | unsigned int need_domain_info; |
41 | 41 | ||
42 | int iommu; | 42 | int iommu; |
43 | |||
44 | /* Optional access methods for reading/writing the bus number | ||
45 | of the PCI controller */ | ||
46 | int (*get_busno)(void); | ||
47 | void (*set_busno)(int busno); | ||
43 | }; | 48 | }; |
44 | 49 | ||
45 | /* | 50 | /* |
@@ -142,8 +147,22 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, | |||
142 | 147 | ||
143 | extern void pcibios_resource_to_bus(struct pci_dev *dev, | 148 | extern void pcibios_resource_to_bus(struct pci_dev *dev, |
144 | struct pci_bus_region *region, struct resource *res); | 149 | struct pci_bus_region *region, struct resource *res); |
145 | extern void pcibios_bus_to_resource(struct pci_dev *dev, | 150 | |
146 | struct resource *res, struct pci_bus_region *region); | 151 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |
152 | struct pci_bus_region *region); | ||
153 | |||
154 | static inline struct resource * | ||
155 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | ||
156 | { | ||
157 | struct resource *root = NULL; | ||
158 | |||
159 | if (res->flags & IORESOURCE_IO) | ||
160 | root = &ioport_resource; | ||
161 | if (res->flags & IORESOURCE_MEM) | ||
162 | root = &iomem_resource; | ||
163 | |||
164 | return root; | ||
165 | } | ||
147 | 166 | ||
148 | #ifdef CONFIG_PCI_DOMAINS | 167 | #ifdef CONFIG_PCI_DOMAINS |
149 | 168 | ||
@@ -169,17 +188,4 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) | |||
169 | /* Do platform specific device initialization at pci_enable_device() time */ | 188 | /* Do platform specific device initialization at pci_enable_device() time */ |
170 | extern int pcibios_plat_dev_init(struct pci_dev *dev); | 189 | extern int pcibios_plat_dev_init(struct pci_dev *dev); |
171 | 190 | ||
172 | static inline struct resource * | ||
173 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | ||
174 | { | ||
175 | struct resource *root = NULL; | ||
176 | |||
177 | if (res->flags & IORESOURCE_IO) | ||
178 | root = &ioport_resource; | ||
179 | if (res->flags & IORESOURCE_MEM) | ||
180 | root = &iomem_resource; | ||
181 | |||
182 | return root; | ||
183 | } | ||
184 | |||
185 | #endif /* _ASM_PCI_H */ | 191 | #endif /* _ASM_PCI_H */ |
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index ce57288d43bd..fe1df572318b 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h | |||
@@ -26,10 +26,22 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
26 | } | 26 | } |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Initialize a new pmd table with invalid pointers. | ||
30 | */ | ||
31 | extern void pmd_init(unsigned long page, unsigned long pagetable); | ||
32 | |||
33 | #ifdef CONFIG_64BIT | ||
34 | |||
35 | static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | ||
36 | { | ||
37 | set_pud(pud, __pud((unsigned long)pmd)); | ||
38 | } | ||
39 | #endif | ||
40 | |||
41 | /* | ||
29 | * Initialize a new pgd / pmd table with invalid pointers. | 42 | * Initialize a new pgd / pmd table with invalid pointers. |
30 | */ | 43 | */ |
31 | extern void pgd_init(unsigned long page); | 44 | extern void pgd_init(unsigned long page); |
32 | extern void pmd_init(unsigned long page, unsigned long pagetable); | ||
33 | 45 | ||
34 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 46 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
35 | { | 47 | { |
@@ -86,21 +98,18 @@ static inline void pte_free(struct page *pte) | |||
86 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) | 98 | #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) |
87 | 99 | ||
88 | #ifdef CONFIG_32BIT | 100 | #ifdef CONFIG_32BIT |
89 | #define pgd_populate(mm, pmd, pte) BUG() | ||
90 | 101 | ||
91 | /* | 102 | /* |
92 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | 103 | * allocating and freeing a pmd is trivial: the 1-entry pmd is |
93 | * inside the pgd, so has no extra memory associated with it. | 104 | * inside the pgd, so has no extra memory associated with it. |
94 | */ | 105 | */ |
95 | #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) | ||
96 | #define pmd_free(x) do { } while (0) | 106 | #define pmd_free(x) do { } while (0) |
97 | #define __pmd_free_tlb(tlb,x) do { } while (0) | 107 | #define __pmd_free_tlb(tlb,x) do { } while (0) |
108 | |||
98 | #endif | 109 | #endif |
99 | 110 | ||
100 | #ifdef CONFIG_64BIT | 111 | #ifdef CONFIG_64BIT |
101 | 112 | ||
102 | #define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd)) | ||
103 | |||
104 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 113 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
105 | { | 114 | { |
106 | pmd_t *pmd; | 115 | pmd_t *pmd; |
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h index 7fec93b76da9..0cff64ce0fb8 100644 --- a/include/asm-mips/pgtable-32.h +++ b/include/asm-mips/pgtable-32.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <asm/cachectl.h> | 17 | #include <asm/cachectl.h> |
18 | #include <asm/fixmap.h> | 18 | #include <asm/fixmap.h> |
19 | 19 | ||
20 | #include <asm-generic/pgtable-nopmd.h> | ||
21 | |||
20 | /* | 22 | /* |
21 | * - add_wired_entry() add a fixed TLB entry, and move wired register | 23 | * - add_wired_entry() add a fixed TLB entry, and move wired register |
22 | */ | 24 | */ |
@@ -41,42 +43,38 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
41 | * works even with the cache aliasing problem the R4k and above have. | 43 | * works even with the cache aliasing problem the R4k and above have. |
42 | */ | 44 | */ |
43 | 45 | ||
44 | /* PMD_SHIFT determines the size of the area a second-level page table can map */ | 46 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
45 | #ifdef CONFIG_64BIT_PHYS_ADDR | 47 | #ifdef CONFIG_64BIT_PHYS_ADDR |
46 | #define PMD_SHIFT 21 | 48 | #define PGDIR_SHIFT 21 |
47 | #else | 49 | #else |
48 | #define PMD_SHIFT 22 | 50 | #define PGDIR_SHIFT 22 |
49 | #endif | 51 | #endif |
50 | #define PMD_SIZE (1UL << PMD_SHIFT) | ||
51 | #define PMD_MASK (~(PMD_SIZE-1)) | ||
52 | |||
53 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | ||
54 | #define PGDIR_SHIFT PMD_SHIFT | ||
55 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 52 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
56 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 53 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
57 | 54 | ||
58 | /* | 55 | /* |
59 | * Entries per page directory level: we use two-level, so | 56 | * Entries per page directory level: we use two-level, so |
60 | * we don't really have any PMD directory physically. | 57 | * we don't really have any PUD/PMD directory physically. |
61 | */ | 58 | */ |
62 | #ifdef CONFIG_64BIT_PHYS_ADDR | 59 | #ifdef CONFIG_64BIT_PHYS_ADDR |
63 | #define PGD_ORDER 1 | 60 | #define PGD_ORDER 1 |
64 | #define PMD_ORDER 0 | 61 | #define PUD_ORDER aieeee_attempt_to_allocate_pud |
62 | #define PMD_ORDER 1 | ||
65 | #define PTE_ORDER 0 | 63 | #define PTE_ORDER 0 |
66 | #else | 64 | #else |
67 | #define PGD_ORDER 0 | 65 | #define PGD_ORDER 0 |
68 | #define PMD_ORDER 0 | 66 | #define PUD_ORDER aieeee_attempt_to_allocate_pud |
67 | #define PMD_ORDER 1 | ||
69 | #define PTE_ORDER 0 | 68 | #define PTE_ORDER 0 |
70 | #endif | 69 | #endif |
71 | 70 | ||
72 | #define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) | 71 | #define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) |
73 | #define PTRS_PER_PMD 1 | ||
74 | #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) | 72 | #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) |
75 | 73 | ||
76 | #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) | 74 | #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) |
77 | #define FIRST_USER_ADDRESS 0 | 75 | #define FIRST_USER_ADDRESS 0 |
78 | 76 | ||
79 | #define VMALLOC_START KSEG2 | 77 | #define VMALLOC_START MAP_BASE |
80 | 78 | ||
81 | #ifdef CONFIG_HIGHMEM | 79 | #ifdef CONFIG_HIGHMEM |
82 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) | 80 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) |
@@ -91,8 +89,6 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
91 | #define pte_ERROR(e) \ | 89 | #define pte_ERROR(e) \ |
92 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) | 90 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) |
93 | #endif | 91 | #endif |
94 | #define pmd_ERROR(e) \ | ||
95 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) | ||
96 | #define pgd_ERROR(e) \ | 92 | #define pgd_ERROR(e) \ |
97 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | 93 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) |
98 | 94 | ||
@@ -120,17 +116,7 @@ static inline void pmd_clear(pmd_t *pmdp) | |||
120 | pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); | 116 | pmd_val(*pmdp) = ((unsigned long) invalid_pte_table); |
121 | } | 117 | } |
122 | 118 | ||
123 | /* | 119 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
124 | * The "pgd_xxx()" functions here are trivial for a folded two-level | ||
125 | * setup: the pgd is never bad, and a pmd always exists (as it's folded | ||
126 | * into the pgd entry) | ||
127 | */ | ||
128 | static inline int pgd_none(pgd_t pgd) { return 0; } | ||
129 | static inline int pgd_bad(pgd_t pgd) { return 0; } | ||
130 | static inline int pgd_present(pgd_t pgd) { return 1; } | ||
131 | static inline void pgd_clear(pgd_t *pgdp) { } | ||
132 | |||
133 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | ||
134 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 120 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
135 | #define pte_pfn(x) ((unsigned long)((x).pte_high >> 6)) | 121 | #define pte_pfn(x) ((unsigned long)((x).pte_high >> 6)) |
136 | static inline pte_t | 122 | static inline pte_t |
@@ -151,27 +137,22 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
151 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) | 137 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) |
152 | #else | 138 | #else |
153 | #define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) | 139 | #define pte_pfn(x) ((unsigned long)((x).pte >> PAGE_SHIFT)) |
154 | #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) | 140 | #define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << PAGE_SHIFT) | pgprot_val(prot)) |
155 | #endif | 141 | #endif |
156 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | 142 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) */ |
157 | 143 | ||
158 | #define __pgd_offset(address) pgd_index(address) | 144 | #define __pgd_offset(address) pgd_index(address) |
145 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | ||
159 | #define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 146 | #define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |
160 | 147 | ||
161 | /* to find an entry in a kernel page-table-directory */ | 148 | /* to find an entry in a kernel page-table-directory */ |
162 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | 149 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) |
163 | 150 | ||
164 | #define pgd_index(address) ((address) >> PGDIR_SHIFT) | 151 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
165 | 152 | ||
166 | /* to find an entry in a page-table-directory */ | 153 | /* to find an entry in a page-table-directory */ |
167 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) | 154 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) |
168 | 155 | ||
169 | /* Find an entry in the second-level page table.. */ | ||
170 | static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address) | ||
171 | { | ||
172 | return (pmd_t *) dir; | ||
173 | } | ||
174 | |||
175 | /* Find an entry in the third-level page table.. */ | 156 | /* Find an entry in the third-level page table.. */ |
176 | #define __pte_offset(address) \ | 157 | #define __pte_offset(address) \ |
177 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) | 158 | (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) |
@@ -221,7 +202,7 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address) | |||
221 | */ | 202 | */ |
222 | #define PTE_FILE_MAX_BITS 27 | 203 | #define PTE_FILE_MAX_BITS 27 |
223 | 204 | ||
224 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | 205 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
225 | /* fixme */ | 206 | /* fixme */ |
226 | #define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) | 207 | #define pte_to_pgoff(_pte) (((_pte).pte_high >> 6) + ((_pte).pte_high & 0x3f)) |
227 | #define pgoff_to_pte(off) \ | 208 | #define pgoff_to_pte(off) \ |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index 1011e0635f56..82166b254b27 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -16,13 +16,15 @@ | |||
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/cachectl.h> | 17 | #include <asm/cachectl.h> |
18 | 18 | ||
19 | #include <asm-generic/pgtable-nopud.h> | ||
20 | |||
19 | /* | 21 | /* |
20 | * Each address space has 2 4K pages as its page directory, giving 1024 | 22 | * Each address space has 2 4K pages as its page directory, giving 1024 |
21 | * (== PTRS_PER_PGD) 8 byte pointers to pmd tables. Each pmd table is a | 23 | * (== PTRS_PER_PGD) 8 byte pointers to pmd tables. Each pmd table is a |
22 | * pair of 4K pages, giving 1024 (== PTRS_PER_PMD) 8 byte pointers to | 24 | * single 4K page, giving 512 (== PTRS_PER_PMD) 8 byte pointers to page |
23 | * page tables. Each page table is a single 4K page, giving 512 (== | 25 | * tables. Each page table is also a single 4K page, giving 512 (== |
24 | * PTRS_PER_PTE) 8 byte ptes. Each pgde is initialized to point to | 26 | * PTRS_PER_PTE) 8 byte ptes. Each pud entry is initialized to point to |
25 | * invalid_pmd_table, each pmde is initialized to point to | 27 | * invalid_pmd_table, each pmd entry is initialized to point to |
26 | * invalid_pte_table, each pte is initialized to 0. When memory is low, | 28 | * invalid_pte_table, each pte is initialized to 0. When memory is low, |
27 | * and a pmd table or a page table allocation fails, empty_bad_pmd_table | 29 | * and a pmd table or a page table allocation fails, empty_bad_pmd_table |
28 | * and empty_bad_page_table is returned back to higher layer code, so | 30 | * and empty_bad_page_table is returned back to higher layer code, so |
@@ -36,17 +38,17 @@ | |||
36 | */ | 38 | */ |
37 | 39 | ||
38 | /* PMD_SHIFT determines the size of the area a second-level page table can map */ | 40 | /* PMD_SHIFT determines the size of the area a second-level page table can map */ |
39 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3)) | 41 | #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT + PTE_ORDER - 3)) |
40 | #define PMD_SIZE (1UL << PMD_SHIFT) | 42 | #define PMD_SIZE (1UL << PMD_SHIFT) |
41 | #define PMD_MASK (~(PMD_SIZE-1)) | 43 | #define PMD_MASK (~(PMD_SIZE-1)) |
42 | 44 | ||
43 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | 45 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
44 | #define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + 1 - 3)) | 46 | #define PGDIR_SHIFT (PMD_SHIFT + (PAGE_SHIFT + PMD_ORDER - 3)) |
45 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 47 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
46 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 48 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
47 | 49 | ||
48 | /* | 50 | /* |
49 | * For 4kB page size we use a 3 level page tree and a 8kB pmd and pgds which | 51 | * For 4kB page size we use a 3 level page tree and an 8kB pud, which |
50 | * permits us mapping 40 bits of virtual address space. | 52 | * permits us mapping 40 bits of virtual address space. |
51 | * | 53 | * |
52 | * We used to implement 41 bits by having an order 1 pmd level but that seemed | 54 | * We used to implement 41 bits by having an order 1 pmd level but that seemed |
@@ -57,7 +59,7 @@ | |||
57 | * two levels would be easy to implement. | 59 | * two levels would be easy to implement. |
58 | * | 60 | * |
59 | * For 16kB page size we use a 2 level page tree which permits a total of | 61 | * For 16kB page size we use a 2 level page tree which permits a total of |
60 | * 36 bits of virtual address space. We could add a third leve. but it seems | 62 | * 36 bits of virtual address space. We could add a third level but it seems |
61 | * like at the moment there's no need for this. | 63 | * like at the moment there's no need for this. |
62 | * | 64 | * |
63 | * For 64kB page size we use a 2 level page table tree for a total of 42 bits | 65 | * For 64kB page size we use a 2 level page table tree for a total of 42 bits |
@@ -65,21 +67,25 @@ | |||
65 | */ | 67 | */ |
66 | #ifdef CONFIG_PAGE_SIZE_4KB | 68 | #ifdef CONFIG_PAGE_SIZE_4KB |
67 | #define PGD_ORDER 1 | 69 | #define PGD_ORDER 1 |
70 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
68 | #define PMD_ORDER 0 | 71 | #define PMD_ORDER 0 |
69 | #define PTE_ORDER 0 | 72 | #define PTE_ORDER 0 |
70 | #endif | 73 | #endif |
71 | #ifdef CONFIG_PAGE_SIZE_8KB | 74 | #ifdef CONFIG_PAGE_SIZE_8KB |
72 | #define PGD_ORDER 0 | 75 | #define PGD_ORDER 0 |
76 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
73 | #define PMD_ORDER 0 | 77 | #define PMD_ORDER 0 |
74 | #define PTE_ORDER 0 | 78 | #define PTE_ORDER 0 |
75 | #endif | 79 | #endif |
76 | #ifdef CONFIG_PAGE_SIZE_16KB | 80 | #ifdef CONFIG_PAGE_SIZE_16KB |
77 | #define PGD_ORDER 0 | 81 | #define PGD_ORDER 0 |
82 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
78 | #define PMD_ORDER 0 | 83 | #define PMD_ORDER 0 |
79 | #define PTE_ORDER 0 | 84 | #define PTE_ORDER 0 |
80 | #endif | 85 | #endif |
81 | #ifdef CONFIG_PAGE_SIZE_64KB | 86 | #ifdef CONFIG_PAGE_SIZE_64KB |
82 | #define PGD_ORDER 0 | 87 | #define PGD_ORDER 0 |
88 | #define PUD_ORDER aieeee_attempt_to_allocate_pud | ||
83 | #define PMD_ORDER 0 | 89 | #define PMD_ORDER 0 |
84 | #define PTE_ORDER 0 | 90 | #define PTE_ORDER 0 |
85 | #endif | 91 | #endif |
@@ -91,7 +97,7 @@ | |||
91 | #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) | 97 | #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) |
92 | #define FIRST_USER_ADDRESS 0 | 98 | #define FIRST_USER_ADDRESS 0 |
93 | 99 | ||
94 | #define VMALLOC_START XKSEG | 100 | #define VMALLOC_START MAP_BASE |
95 | #define VMALLOC_END \ | 101 | #define VMALLOC_END \ |
96 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | 102 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) |
97 | 103 | ||
@@ -102,13 +108,13 @@ | |||
102 | #define pgd_ERROR(e) \ | 108 | #define pgd_ERROR(e) \ |
103 | printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) | 109 | printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e)) |
104 | 110 | ||
105 | extern pte_t invalid_pte_table[PAGE_SIZE/sizeof(pte_t)]; | 111 | extern pte_t invalid_pte_table[PTRS_PER_PTE]; |
106 | extern pte_t empty_bad_page_table[PAGE_SIZE/sizeof(pte_t)]; | 112 | extern pte_t empty_bad_page_table[PTRS_PER_PTE]; |
107 | extern pmd_t invalid_pmd_table[2*PAGE_SIZE/sizeof(pmd_t)]; | 113 | extern pmd_t invalid_pmd_table[PTRS_PER_PMD]; |
108 | extern pmd_t empty_bad_pmd_table[2*PAGE_SIZE/sizeof(pmd_t)]; | 114 | extern pmd_t empty_bad_pmd_table[PTRS_PER_PMD]; |
109 | 115 | ||
110 | /* | 116 | /* |
111 | * Empty pmd entries point to the invalid_pte_table. | 117 | * Empty pgd/pmd entries point to the invalid_pte_table. |
112 | */ | 118 | */ |
113 | static inline int pmd_none(pmd_t pmd) | 119 | static inline int pmd_none(pmd_t pmd) |
114 | { | 120 | { |
@@ -128,26 +134,30 @@ static inline void pmd_clear(pmd_t *pmdp) | |||
128 | } | 134 | } |
129 | 135 | ||
130 | /* | 136 | /* |
131 | * Empty pgd entries point to the invalid_pmd_table. | 137 | * Empty pud entries point to the invalid_pmd_table. |
132 | */ | 138 | */ |
133 | static inline int pgd_none(pgd_t pgd) | 139 | static inline int pud_none(pud_t pud) |
134 | { | 140 | { |
135 | return pgd_val(pgd) == (unsigned long) invalid_pmd_table; | 141 | return pud_val(pud) == (unsigned long) invalid_pmd_table; |
136 | } | 142 | } |
137 | 143 | ||
138 | #define pgd_bad(pgd) (pgd_val(pgd) &~ PAGE_MASK) | 144 | static inline int pud_bad(pud_t pud) |
145 | { | ||
146 | return pud_val(pud) & ~PAGE_MASK; | ||
147 | } | ||
139 | 148 | ||
140 | static inline int pgd_present(pgd_t pgd) | 149 | static inline int pud_present(pud_t pud) |
141 | { | 150 | { |
142 | return pgd_val(pgd) != (unsigned long) invalid_pmd_table; | 151 | return pud_val(pud) != (unsigned long) invalid_pmd_table; |
143 | } | 152 | } |
144 | 153 | ||
145 | static inline void pgd_clear(pgd_t *pgdp) | 154 | static inline void pud_clear(pud_t *pudp) |
146 | { | 155 | { |
147 | pgd_val(*pgdp) = ((unsigned long) invalid_pmd_table); | 156 | pud_val(*pudp) = ((unsigned long) invalid_pmd_table); |
148 | } | 157 | } |
149 | 158 | ||
150 | #define pte_page(x) pfn_to_page((unsigned long)((pte_val(x) >> PAGE_SHIFT))) | 159 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
160 | |||
151 | #ifdef CONFIG_CPU_VR41XX | 161 | #ifdef CONFIG_CPU_VR41XX |
152 | #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) | 162 | #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) |
153 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) | 163 | #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) |
@@ -157,26 +167,27 @@ static inline void pgd_clear(pgd_t *pgdp) | |||
157 | #endif | 167 | #endif |
158 | 168 | ||
159 | #define __pgd_offset(address) pgd_index(address) | 169 | #define __pgd_offset(address) pgd_index(address) |
160 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | 170 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) |
171 | #define __pmd_offset(address) pmd_index(address) | ||
161 | 172 | ||
162 | /* to find an entry in a kernel page-table-directory */ | 173 | /* to find an entry in a kernel page-table-directory */ |
163 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) | 174 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) |
164 | 175 | ||
165 | #define pgd_index(address) ((address) >> PGDIR_SHIFT) | 176 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
177 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | ||
166 | 178 | ||
167 | /* to find an entry in a page-table-directory */ | 179 | /* to find an entry in a page-table-directory */ |
168 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) | 180 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) |
169 | 181 | ||
170 | static inline unsigned long pgd_page(pgd_t pgd) | 182 | static inline unsigned long pud_page(pud_t pud) |
171 | { | 183 | { |
172 | return pgd_val(pgd); | 184 | return pud_val(pud); |
173 | } | 185 | } |
174 | 186 | ||
175 | /* Find an entry in the second-level page table.. */ | 187 | /* Find an entry in the second-level page table.. */ |
176 | static inline pmd_t *pmd_offset(pgd_t * dir, unsigned long address) | 188 | static inline pmd_t *pmd_offset(pud_t * pud, unsigned long address) |
177 | { | 189 | { |
178 | return (pmd_t *) pgd_page(*dir) + | 190 | return (pmd_t *) pud_page(*pud) + pmd_index(address); |
179 | ((address >> PMD_SHIFT) & (PTRS_PER_PMD - 1)); | ||
180 | } | 191 | } |
181 | 192 | ||
182 | /* Find an entry in the third-level page table.. */ | 193 | /* Find an entry in the third-level page table.. */ |
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h index 3aad751ccd5f..01e76e932e3f 100644 --- a/include/asm-mips/pgtable-bits.h +++ b/include/asm-mips/pgtable-bits.h | |||
@@ -33,7 +33,7 @@ | |||
33 | * unpredictable things. The code (when it is written) to deal with | 33 | * unpredictable things. The code (when it is written) to deal with |
34 | * this problem will be in the update_mmu_cache() code for the r4k. | 34 | * this problem will be in the update_mmu_cache() code for the r4k. |
35 | */ | 35 | */ |
36 | #if defined(CONFIG_CPU_MIPS32) && defined(CONFIG_64BIT_PHYS_ADDR) | 36 | #if defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) |
37 | 37 | ||
38 | #define _PAGE_PRESENT (1<<6) /* implemented in software */ | 38 | #define _PAGE_PRESENT (1<<6) /* implemented in software */ |
39 | #define _PAGE_READ (1<<7) /* implemented in software */ | 39 | #define _PAGE_READ (1<<7) /* implemented in software */ |
@@ -123,7 +123,7 @@ | |||
123 | 123 | ||
124 | #endif | 124 | #endif |
125 | #endif | 125 | #endif |
126 | #endif /* defined(CONFIG_CPU_MIPS32) && defined(CONFIG_64BIT_PHYS_ADDR) */ | 126 | #endif /* defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) */ |
127 | 127 | ||
128 | #define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) | 128 | #define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) |
129 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) | 129 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) |
@@ -140,7 +140,7 @@ | |||
140 | #define PAGE_CACHABLE_DEFAULT _CACHE_CACHABLE_COW | 140 | #define PAGE_CACHABLE_DEFAULT _CACHE_CACHABLE_COW |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | #if defined(CONFIG_CPU_MIPS32) && defined(CONFIG_64BIT_PHYS_ADDR) | 143 | #if defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) |
144 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 3) | 144 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 3) |
145 | #else | 145 | #else |
146 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 9) | 146 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 9) |
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index eaf5d9b3a0e1..34facd996503 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #ifndef _ASM_PGTABLE_H | 8 | #ifndef _ASM_PGTABLE_H |
9 | #define _ASM_PGTABLE_H | 9 | #define _ASM_PGTABLE_H |
10 | 10 | ||
11 | #include <asm-generic/4level-fixup.h> | ||
12 | |||
13 | #include <linux/config.h> | 11 | #include <linux/config.h> |
14 | #ifdef CONFIG_32BIT | 12 | #ifdef CONFIG_32BIT |
15 | #include <asm/pgtable-32.h> | 13 | #include <asm/pgtable-32.h> |
@@ -18,6 +16,7 @@ | |||
18 | #include <asm/pgtable-64.h> | 16 | #include <asm/pgtable-64.h> |
19 | #endif | 17 | #endif |
20 | 18 | ||
19 | #include <asm/io.h> | ||
21 | #include <asm/pgtable-bits.h> | 20 | #include <asm/pgtable-bits.h> |
22 | 21 | ||
23 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) | 22 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) |
@@ -76,7 +75,6 @@ extern void paging_init(void); | |||
76 | * Conversion functions: convert a page and protection to a page entry, | 75 | * Conversion functions: convert a page and protection to a page entry, |
77 | * and a page entry and page directory to the page they refer to. | 76 | * and a page entry and page directory to the page they refer to. |
78 | */ | 77 | */ |
79 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
80 | #define pmd_phys(pmd) (pmd_val(pmd) - PAGE_OFFSET) | 78 | #define pmd_phys(pmd) (pmd_val(pmd) - PAGE_OFFSET) |
81 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) | 79 | #define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT)) |
82 | #define pmd_page_kernel(pmd) pmd_val(pmd) | 80 | #define pmd_page_kernel(pmd) pmd_val(pmd) |
@@ -84,7 +82,7 @@ extern void paging_init(void); | |||
84 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) | 82 | #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL)) |
85 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) | 83 | #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT) |
86 | 84 | ||
87 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | 85 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
88 | static inline void set_pte(pte_t *ptep, pte_t pte) | 86 | static inline void set_pte(pte_t *ptep, pte_t pte) |
89 | { | 87 | { |
90 | ptep->pte_high = pte.pte_high; | 88 | ptep->pte_high = pte.pte_high; |
@@ -148,11 +146,18 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt | |||
148 | #endif | 146 | #endif |
149 | 147 | ||
150 | /* | 148 | /* |
151 | * (pmds are folded into pgds so this doesn't get actually called, | 149 | * (pmds are folded into puds so this doesn't get actually called, |
152 | * but the define is needed for a generic inline function.) | 150 | * but the define is needed for a generic inline function.) |
153 | */ | 151 | */ |
154 | #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0) | 152 | #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0) |
155 | #define set_pgd(pgdptr, pgdval) do { *(pgdptr) = (pgdval); } while(0) | 153 | |
154 | #ifdef CONFIG_64BIT | ||
155 | /* | ||
156 | * (puds are folded into pgds so this doesn't get actually called, | ||
157 | * but the define is needed for a generic inline function.) | ||
158 | */ | ||
159 | #define set_pud(pudptr, pudval) do { *(pudptr) = (pudval); } while(0) | ||
160 | #endif | ||
156 | 161 | ||
157 | #define PGD_T_LOG2 ffz(~sizeof(pgd_t)) | 162 | #define PGD_T_LOG2 ffz(~sizeof(pgd_t)) |
158 | #define PMD_T_LOG2 ffz(~sizeof(pmd_t)) | 163 | #define PMD_T_LOG2 ffz(~sizeof(pmd_t)) |
@@ -165,7 +170,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
165 | * Undefined behaviour if not.. | 170 | * Undefined behaviour if not.. |
166 | */ | 171 | */ |
167 | static inline int pte_user(pte_t pte) { BUG(); return 0; } | 172 | static inline int pte_user(pte_t pte) { BUG(); return 0; } |
168 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | 173 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
169 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; } | 174 | static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_READ; } |
170 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; } | 175 | static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_WRITE; } |
171 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; } | 176 | static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_MODIFIED; } |
@@ -324,7 +329,7 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot) | |||
324 | */ | 329 | */ |
325 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) | 330 | #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) |
326 | 331 | ||
327 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | 332 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) |
328 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 333 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
329 | { | 334 | { |
330 | pte.pte_low &= _PAGE_CHG_MASK; | 335 | pte.pte_low &= _PAGE_CHG_MASK; |
@@ -357,7 +362,6 @@ static inline void update_mmu_cache(struct vm_area_struct *vma, | |||
357 | #endif | 362 | #endif |
358 | 363 | ||
359 | #ifdef CONFIG_64BIT_PHYS_ADDR | 364 | #ifdef CONFIG_64BIT_PHYS_ADDR |
360 | extern phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size); | ||
361 | extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); | 365 | extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); |
362 | 366 | ||
363 | static inline int io_remap_pfn_range(struct vm_area_struct *vma, | 367 | static inline int io_remap_pfn_range(struct vm_area_struct *vma, |
@@ -367,7 +371,7 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, | |||
367 | pgprot_t prot) | 371 | pgprot_t prot) |
368 | { | 372 | { |
369 | phys_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size); | 373 | phys_t phys_addr_high = fixup_bigphys_addr(pfn << PAGE_SHIFT, size); |
370 | return remap_pfn_range(vma, vaddr, pfn, size, prot); | 374 | return remap_pfn_range(vma, vaddr, phys_addr_high >> PAGE_SHIFT, size, prot); |
371 | } | 375 | } |
372 | #else | 376 | #else |
373 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 377 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index d6466aa09fb7..f1980c6c3bcc 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h | |||
@@ -96,12 +96,26 @@ union mips_fpu_union { | |||
96 | {{0,},} \ | 96 | {{0,},} \ |
97 | } | 97 | } |
98 | 98 | ||
99 | #define NUM_DSP_REGS 6 | ||
100 | |||
101 | typedef __u32 dspreg_t; | ||
102 | |||
103 | struct mips_dsp_state { | ||
104 | dspreg_t dspr[NUM_DSP_REGS]; | ||
105 | unsigned int dspcontrol; | ||
106 | unsigned short used_dsp; | ||
107 | }; | ||
108 | |||
109 | #define INIT_DSP {{0,},} | ||
110 | |||
99 | typedef struct { | 111 | typedef struct { |
100 | unsigned long seg; | 112 | unsigned long seg; |
101 | } mm_segment_t; | 113 | } mm_segment_t; |
102 | 114 | ||
103 | #define ARCH_MIN_TASKALIGN 8 | 115 | #define ARCH_MIN_TASKALIGN 8 |
104 | 116 | ||
117 | struct mips_abi; | ||
118 | |||
105 | /* | 119 | /* |
106 | * If you change thread_struct remember to change the #defines below too! | 120 | * If you change thread_struct remember to change the #defines below too! |
107 | */ | 121 | */ |
@@ -117,6 +131,9 @@ struct thread_struct { | |||
117 | /* Saved fpu/fpu emulator stuff. */ | 131 | /* Saved fpu/fpu emulator stuff. */ |
118 | union mips_fpu_union fpu; | 132 | union mips_fpu_union fpu; |
119 | 133 | ||
134 | /* Saved state of the DSP ASE, if available. */ | ||
135 | struct mips_dsp_state dsp; | ||
136 | |||
120 | /* Other stuff associated with the thread. */ | 137 | /* Other stuff associated with the thread. */ |
121 | unsigned long cp0_badvaddr; /* Last user fault */ | 138 | unsigned long cp0_badvaddr; /* Last user fault */ |
122 | unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ | 139 | unsigned long cp0_baduaddr; /* Last kernel fault accessing USEG */ |
@@ -129,6 +146,7 @@ struct thread_struct { | |||
129 | unsigned long mflags; | 146 | unsigned long mflags; |
130 | unsigned long irix_trampoline; /* Wheee... */ | 147 | unsigned long irix_trampoline; /* Wheee... */ |
131 | unsigned long irix_oldctx; | 148 | unsigned long irix_oldctx; |
149 | struct mips_abi *abi; | ||
132 | }; | 150 | }; |
133 | 151 | ||
134 | #define MF_ABI_MASK (MF_32BIT_REGS | MF_32BIT_ADDR) | 152 | #define MF_ABI_MASK (MF_32BIT_REGS | MF_32BIT_ADDR) |
@@ -151,6 +169,10 @@ struct thread_struct { | |||
151 | */ \ | 169 | */ \ |
152 | INIT_FPU, \ | 170 | INIT_FPU, \ |
153 | /* \ | 171 | /* \ |
172 | * saved dsp/dsp emulator stuff \ | ||
173 | */ \ | ||
174 | INIT_DSP, \ | ||
175 | /* \ | ||
154 | * Other stuff associated with the process \ | 176 | * Other stuff associated with the process \ |
155 | */ \ | 177 | */ \ |
156 | 0, 0, 0, 0, \ | 178 | 0, 0, 0, 0, \ |
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index 2b5c624c3d4f..95c5839ac465 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #define MMLO 68 | 22 | #define MMLO 68 |
23 | #define FPC_CSR 69 | 23 | #define FPC_CSR 69 |
24 | #define FPC_EIR 70 | 24 | #define FPC_EIR 70 |
25 | #define DSP_BASE 71 /* 3 more hi / lo register pairs */ | ||
26 | #define DSP_CONTROL 77 | ||
25 | 27 | ||
26 | /* | 28 | /* |
27 | * This struct defines the way the registers are stored on the stack during a | 29 | * This struct defines the way the registers are stored on the stack during a |
@@ -38,18 +40,18 @@ struct pt_regs { | |||
38 | 40 | ||
39 | /* Saved special registers. */ | 41 | /* Saved special registers. */ |
40 | unsigned long cp0_status; | 42 | unsigned long cp0_status; |
41 | unsigned long lo; | ||
42 | unsigned long hi; | 43 | unsigned long hi; |
44 | unsigned long lo; | ||
43 | unsigned long cp0_badvaddr; | 45 | unsigned long cp0_badvaddr; |
44 | unsigned long cp0_cause; | 46 | unsigned long cp0_cause; |
45 | unsigned long cp0_epc; | 47 | unsigned long cp0_epc; |
46 | }; | 48 | }; |
47 | 49 | ||
48 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | 50 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ |
49 | /* #define PTRACE_GETREGS 12 */ | 51 | #define PTRACE_GETREGS 12 |
50 | /* #define PTRACE_SETREGS 13 */ | 52 | #define PTRACE_SETREGS 13 |
51 | /* #define PTRACE_GETFPREGS 14 */ | 53 | #define PTRACE_GETFPREGS 14 |
52 | /* #define PTRACE_SETFPREGS 15 */ | 54 | #define PTRACE_SETFPREGS 15 |
53 | /* #define PTRACE_GETFPXREGS 18 */ | 55 | /* #define PTRACE_GETFPXREGS 18 */ |
54 | /* #define PTRACE_SETFPXREGS 19 */ | 56 | /* #define PTRACE_SETFPXREGS 19 */ |
55 | 57 | ||
@@ -58,6 +60,13 @@ struct pt_regs { | |||
58 | #define PTRACE_GET_THREAD_AREA 25 | 60 | #define PTRACE_GET_THREAD_AREA 25 |
59 | #define PTRACE_SET_THREAD_AREA 26 | 61 | #define PTRACE_SET_THREAD_AREA 26 |
60 | 62 | ||
63 | /* Calls to trace a 64bit program from a 32bit program. */ | ||
64 | #define PTRACE_PEEKTEXT_3264 0xc0 | ||
65 | #define PTRACE_PEEKDATA_3264 0xc1 | ||
66 | #define PTRACE_POKETEXT_3264 0xc2 | ||
67 | #define PTRACE_POKEDATA_3264 0xc3 | ||
68 | #define PTRACE_GET_THREAD_AREA_3264 0xc4 | ||
69 | |||
61 | #ifdef __KERNEL__ | 70 | #ifdef __KERNEL__ |
62 | 71 | ||
63 | #include <linux/linkage.h> | 72 | #include <linux/linkage.h> |
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h index 5bea49feec66..a5ea9d828aee 100644 --- a/include/asm-mips/r4kcache.h +++ b/include/asm-mips/r4kcache.h | |||
@@ -21,7 +21,7 @@ | |||
21 | * | 21 | * |
22 | * - The MIPS32 and MIPS64 specs permit an implementation to directly derive | 22 | * - The MIPS32 and MIPS64 specs permit an implementation to directly derive |
23 | * the index bits from the virtual address. This breaks with tradition | 23 | * the index bits from the virtual address. This breaks with tradition |
24 | * set by the R4000. To keep unpleassant surprises from happening we pick | 24 | * set by the R4000. To keep unpleasant surprises from happening we pick |
25 | * an address in KSEG0 / CKSEG0. | 25 | * an address in KSEG0 / CKSEG0. |
26 | * - We need a properly sign extended address for 64-bit code. To get away | 26 | * - We need a properly sign extended address for 64-bit code. To get away |
27 | * without ifdefs we let the compiler do it by a type cast. | 27 | * without ifdefs we let the compiler do it by a type cast. |
@@ -30,11 +30,11 @@ | |||
30 | 30 | ||
31 | #define cache_op(op,addr) \ | 31 | #define cache_op(op,addr) \ |
32 | __asm__ __volatile__( \ | 32 | __asm__ __volatile__( \ |
33 | " .set push \n" \ | ||
33 | " .set noreorder \n" \ | 34 | " .set noreorder \n" \ |
34 | " .set mips3\n\t \n" \ | 35 | " .set mips3\n\t \n" \ |
35 | " cache %0, %1 \n" \ | 36 | " cache %0, %1 \n" \ |
36 | " .set mips0 \n" \ | 37 | " .set pop \n" \ |
37 | " .set reorder" \ | ||
38 | : \ | 38 | : \ |
39 | : "i" (op), "m" (*(unsigned char *)(addr))) | 39 | : "i" (op), "m" (*(unsigned char *)(addr))) |
40 | 40 | ||
@@ -84,14 +84,14 @@ static inline void flush_scache_line(unsigned long addr) | |||
84 | static inline void protected_flush_icache_line(unsigned long addr) | 84 | static inline void protected_flush_icache_line(unsigned long addr) |
85 | { | 85 | { |
86 | __asm__ __volatile__( | 86 | __asm__ __volatile__( |
87 | ".set noreorder\n\t" | 87 | " .set push \n" |
88 | ".set mips3\n" | 88 | " .set noreorder \n" |
89 | "1:\tcache %0,(%1)\n" | 89 | " .set mips3 \n" |
90 | "2:\t.set mips0\n\t" | 90 | "1: cache %0, (%1) \n" |
91 | ".set reorder\n\t" | 91 | "2: .set pop \n" |
92 | ".section\t__ex_table,\"a\"\n\t" | 92 | " .section __ex_table,\"a\" \n" |
93 | STR(PTR)"\t1b,2b\n\t" | 93 | " "STR(PTR)" 1b, 2b \n" |
94 | ".previous" | 94 | " .previous" |
95 | : | 95 | : |
96 | : "i" (Hit_Invalidate_I), "r" (addr)); | 96 | : "i" (Hit_Invalidate_I), "r" (addr)); |
97 | } | 97 | } |
@@ -100,19 +100,19 @@ static inline void protected_flush_icache_line(unsigned long addr) | |||
100 | * R10000 / R12000 hazard - these processors don't support the Hit_Writeback_D | 100 | * R10000 / R12000 hazard - these processors don't support the Hit_Writeback_D |
101 | * cacheop so we use Hit_Writeback_Inv_D which is supported by all R4000-style | 101 | * cacheop so we use Hit_Writeback_Inv_D which is supported by all R4000-style |
102 | * caches. We're talking about one cacheline unnecessarily getting invalidated | 102 | * caches. We're talking about one cacheline unnecessarily getting invalidated |
103 | * here so the penaltiy isn't overly hard. | 103 | * here so the penalty isn't overly hard. |
104 | */ | 104 | */ |
105 | static inline void protected_writeback_dcache_line(unsigned long addr) | 105 | static inline void protected_writeback_dcache_line(unsigned long addr) |
106 | { | 106 | { |
107 | __asm__ __volatile__( | 107 | __asm__ __volatile__( |
108 | ".set noreorder\n\t" | 108 | " .set push \n" |
109 | ".set mips3\n" | 109 | " .set noreorder \n" |
110 | "1:\tcache %0,(%1)\n" | 110 | " .set mips3 \n" |
111 | "2:\t.set mips0\n\t" | 111 | "1: cache %0, (%1) \n" |
112 | ".set reorder\n\t" | 112 | "2: .set pop \n" |
113 | ".section\t__ex_table,\"a\"\n\t" | 113 | " .section __ex_table,\"a\" \n" |
114 | STR(PTR)"\t1b,2b\n\t" | 114 | " "STR(PTR)" 1b, 2b \n" |
115 | ".previous" | 115 | " .previous" |
116 | : | 116 | : |
117 | : "i" (Hit_Writeback_Inv_D), "r" (addr)); | 117 | : "i" (Hit_Writeback_Inv_D), "r" (addr)); |
118 | } | 118 | } |
@@ -120,14 +120,14 @@ static inline void protected_writeback_dcache_line(unsigned long addr) | |||
120 | static inline void protected_writeback_scache_line(unsigned long addr) | 120 | static inline void protected_writeback_scache_line(unsigned long addr) |
121 | { | 121 | { |
122 | __asm__ __volatile__( | 122 | __asm__ __volatile__( |
123 | ".set noreorder\n\t" | 123 | " .set push \n" |
124 | ".set mips3\n" | 124 | " .set noreorder \n" |
125 | "1:\tcache %0,(%1)\n" | 125 | " .set mips3 \n" |
126 | "2:\t.set mips0\n\t" | 126 | "1: cache %0, (%1) \n" |
127 | ".set reorder\n\t" | 127 | "2: .set pop \n" |
128 | ".section\t__ex_table,\"a\"\n\t" | 128 | " .section __ex_table,\"a\" \n" |
129 | STR(PTR)"\t1b,2b\n\t" | 129 | " "STR(PTR)" 1b, 2b \n" |
130 | ".previous" | 130 | " .previous" |
131 | : | 131 | : |
132 | : "i" (Hit_Writeback_Inv_SD), "r" (addr)); | 132 | : "i" (Hit_Writeback_Inv_SD), "r" (addr)); |
133 | } | 133 | } |
@@ -142,6 +142,7 @@ static inline void invalidate_tcache_page(unsigned long addr) | |||
142 | 142 | ||
143 | #define cache16_unroll32(base,op) \ | 143 | #define cache16_unroll32(base,op) \ |
144 | __asm__ __volatile__( \ | 144 | __asm__ __volatile__( \ |
145 | " .set push \n" \ | ||
145 | " .set noreorder \n" \ | 146 | " .set noreorder \n" \ |
146 | " .set mips3 \n" \ | 147 | " .set mips3 \n" \ |
147 | " cache %1, 0x000(%0); cache %1, 0x010(%0) \n" \ | 148 | " cache %1, 0x000(%0); cache %1, 0x010(%0) \n" \ |
@@ -160,8 +161,7 @@ static inline void invalidate_tcache_page(unsigned long addr) | |||
160 | " cache %1, 0x1a0(%0); cache %1, 0x1b0(%0) \n" \ | 161 | " cache %1, 0x1a0(%0); cache %1, 0x1b0(%0) \n" \ |
161 | " cache %1, 0x1c0(%0); cache %1, 0x1d0(%0) \n" \ | 162 | " cache %1, 0x1c0(%0); cache %1, 0x1d0(%0) \n" \ |
162 | " cache %1, 0x1e0(%0); cache %1, 0x1f0(%0) \n" \ | 163 | " cache %1, 0x1e0(%0); cache %1, 0x1f0(%0) \n" \ |
163 | " .set mips0 \n" \ | 164 | " .set pop \n" \ |
164 | " .set reorder \n" \ | ||
165 | : \ | 165 | : \ |
166 | : "r" (base), \ | 166 | : "r" (base), \ |
167 | "i" (op)); | 167 | "i" (op)); |
@@ -285,6 +285,7 @@ static inline void blast_scache16_page_indexed(unsigned long page) | |||
285 | 285 | ||
286 | #define cache32_unroll32(base,op) \ | 286 | #define cache32_unroll32(base,op) \ |
287 | __asm__ __volatile__( \ | 287 | __asm__ __volatile__( \ |
288 | " .set push \n" \ | ||
288 | " .set noreorder \n" \ | 289 | " .set noreorder \n" \ |
289 | " .set mips3 \n" \ | 290 | " .set mips3 \n" \ |
290 | " cache %1, 0x000(%0); cache %1, 0x020(%0) \n" \ | 291 | " cache %1, 0x000(%0); cache %1, 0x020(%0) \n" \ |
@@ -303,8 +304,7 @@ static inline void blast_scache16_page_indexed(unsigned long page) | |||
303 | " cache %1, 0x340(%0); cache %1, 0x360(%0) \n" \ | 304 | " cache %1, 0x340(%0); cache %1, 0x360(%0) \n" \ |
304 | " cache %1, 0x380(%0); cache %1, 0x3a0(%0) \n" \ | 305 | " cache %1, 0x380(%0); cache %1, 0x3a0(%0) \n" \ |
305 | " cache %1, 0x3c0(%0); cache %1, 0x3e0(%0) \n" \ | 306 | " cache %1, 0x3c0(%0); cache %1, 0x3e0(%0) \n" \ |
306 | " .set mips0 \n" \ | 307 | " .set pop \n" \ |
307 | " .set reorder \n" \ | ||
308 | : \ | 308 | : \ |
309 | : "r" (base), \ | 309 | : "r" (base), \ |
310 | "i" (op)); | 310 | "i" (op)); |
@@ -428,6 +428,7 @@ static inline void blast_scache32_page_indexed(unsigned long page) | |||
428 | 428 | ||
429 | #define cache64_unroll32(base,op) \ | 429 | #define cache64_unroll32(base,op) \ |
430 | __asm__ __volatile__( \ | 430 | __asm__ __volatile__( \ |
431 | " .set push \n" \ | ||
431 | " .set noreorder \n" \ | 432 | " .set noreorder \n" \ |
432 | " .set mips3 \n" \ | 433 | " .set mips3 \n" \ |
433 | " cache %1, 0x000(%0); cache %1, 0x040(%0) \n" \ | 434 | " cache %1, 0x000(%0); cache %1, 0x040(%0) \n" \ |
@@ -446,8 +447,7 @@ static inline void blast_scache32_page_indexed(unsigned long page) | |||
446 | " cache %1, 0x680(%0); cache %1, 0x6c0(%0) \n" \ | 447 | " cache %1, 0x680(%0); cache %1, 0x6c0(%0) \n" \ |
447 | " cache %1, 0x700(%0); cache %1, 0x740(%0) \n" \ | 448 | " cache %1, 0x700(%0); cache %1, 0x740(%0) \n" \ |
448 | " cache %1, 0x780(%0); cache %1, 0x7c0(%0) \n" \ | 449 | " cache %1, 0x780(%0); cache %1, 0x7c0(%0) \n" \ |
449 | " .set mips0 \n" \ | 450 | " .set pop \n" \ |
450 | " .set reorder \n" \ | ||
451 | : \ | 451 | : \ |
452 | : "r" (base), \ | 452 | : "r" (base), \ |
453 | "i" (op)); | 453 | "i" (op)); |
@@ -532,6 +532,7 @@ static inline void blast_scache64_page_indexed(unsigned long page) | |||
532 | 532 | ||
533 | #define cache128_unroll32(base,op) \ | 533 | #define cache128_unroll32(base,op) \ |
534 | __asm__ __volatile__( \ | 534 | __asm__ __volatile__( \ |
535 | " .set push \n" \ | ||
535 | " .set noreorder \n" \ | 536 | " .set noreorder \n" \ |
536 | " .set mips3 \n" \ | 537 | " .set mips3 \n" \ |
537 | " cache %1, 0x000(%0); cache %1, 0x080(%0) \n" \ | 538 | " cache %1, 0x000(%0); cache %1, 0x080(%0) \n" \ |
@@ -550,8 +551,7 @@ static inline void blast_scache64_page_indexed(unsigned long page) | |||
550 | " cache %1, 0xd00(%0); cache %1, 0xd80(%0) \n" \ | 551 | " cache %1, 0xd00(%0); cache %1, 0xd80(%0) \n" \ |
551 | " cache %1, 0xe00(%0); cache %1, 0xe80(%0) \n" \ | 552 | " cache %1, 0xe00(%0); cache %1, 0xe80(%0) \n" \ |
552 | " cache %1, 0xf00(%0); cache %1, 0xf80(%0) \n" \ | 553 | " cache %1, 0xf00(%0); cache %1, 0xf80(%0) \n" \ |
553 | " .set mips0 \n" \ | 554 | " .set pop \n" \ |
554 | " .set reorder \n" \ | ||
555 | : \ | 555 | : \ |
556 | : "r" (base), \ | 556 | : "r" (base), \ |
557 | "i" (op)); | 557 | "i" (op)); |
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h index 3c4b637fd925..a60e0dc7c9b9 100644 --- a/include/asm-mips/rtc.h +++ b/include/asm-mips/rtc.h | |||
@@ -14,7 +14,9 @@ | |||
14 | 14 | ||
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | 16 | ||
17 | #include <linux/spinlock.h> | ||
17 | #include <linux/rtc.h> | 18 | #include <linux/rtc.h> |
19 | #include <asm/time.h> | ||
18 | 20 | ||
19 | #define RTC_PIE 0x40 /* periodic interrupt enable */ | 21 | #define RTC_PIE 0x40 /* periodic interrupt enable */ |
20 | #define RTC_AIE 0x20 /* alarm interrupt enable */ | 22 | #define RTC_AIE 0x20 /* alarm interrupt enable */ |
@@ -27,11 +29,52 @@ | |||
27 | #define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ | 29 | #define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ |
28 | #define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ | 30 | #define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ |
29 | 31 | ||
30 | unsigned int get_rtc_time(struct rtc_time *time); | 32 | static DEFINE_SPINLOCK(mips_rtc_lock); |
31 | int set_rtc_time(struct rtc_time *time); | ||
32 | unsigned int get_rtc_ss(void); | ||
33 | int get_rtc_pll(struct rtc_pll_info *pll); | ||
34 | int set_rtc_pll(struct rtc_pll_info *pll); | ||
35 | 33 | ||
34 | static inline unsigned int get_rtc_time(struct rtc_time *time) | ||
35 | { | ||
36 | unsigned long nowtime; | ||
37 | |||
38 | spin_lock(&mips_rtc_lock); | ||
39 | nowtime = rtc_get_time(); | ||
40 | to_tm(nowtime, time); | ||
41 | time->tm_year -= 1900; | ||
42 | spin_unlock(&mips_rtc_lock); | ||
43 | |||
44 | return RTC_24H; | ||
45 | } | ||
46 | |||
47 | static inline int set_rtc_time(struct rtc_time *time) | ||
48 | { | ||
49 | unsigned long nowtime; | ||
50 | int ret; | ||
51 | |||
52 | spin_lock(&mips_rtc_lock); | ||
53 | nowtime = mktime(time->tm_year+1900, time->tm_mon+1, | ||
54 | time->tm_mday, time->tm_hour, time->tm_min, | ||
55 | time->tm_sec); | ||
56 | ret = rtc_set_time(nowtime); | ||
57 | spin_unlock(&mips_rtc_lock); | ||
58 | |||
59 | return ret; | ||
60 | } | ||
61 | |||
62 | static inline unsigned int get_rtc_ss(void) | ||
63 | { | ||
64 | struct rtc_time h; | ||
65 | |||
66 | get_rtc_time(&h); | ||
67 | return h.tm_sec; | ||
68 | } | ||
69 | |||
70 | static inline int get_rtc_pll(struct rtc_pll_info *pll) | ||
71 | { | ||
72 | return -EINVAL; | ||
73 | } | ||
74 | |||
75 | static inline int set_rtc_pll(struct rtc_pll_info *pll) | ||
76 | { | ||
77 | return -EINVAL; | ||
78 | } | ||
36 | #endif | 79 | #endif |
37 | #endif | 80 | #endif |
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h new file mode 100644 index 000000000000..83cdf6ab0d1f --- /dev/null +++ b/include/asm-mips/rtlx.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | #ifndef _RTLX_H | ||
7 | #define _RTLX_H_ | ||
8 | |||
9 | #define LX_NODE_BASE 10 | ||
10 | |||
11 | #define MIPSCPU_INT_BASE 16 | ||
12 | #define MIPS_CPU_RTLX_IRQ 0 | ||
13 | |||
14 | #define RTLX_VERSION 1 | ||
15 | #define RTLX_xID 0x12345600 | ||
16 | #define RTLX_ID (RTLX_xID | RTLX_VERSION) | ||
17 | #define RTLX_CHANNELS 8 | ||
18 | |||
19 | enum rtlx_state { | ||
20 | RTLX_STATE_UNUSED = 0, | ||
21 | RTLX_STATE_INITIALISED, | ||
22 | RTLX_STATE_REMOTE_READY, | ||
23 | RTLX_STATE_OPENED | ||
24 | }; | ||
25 | |||
26 | #define RTLX_BUFFER_SIZE 1024 | ||
27 | /* each channel supports read and write. | ||
28 | linux (vpe0) reads lx_buffer and writes rt_buffer | ||
29 | SP (vpe1) reads rt_buffer and writes lx_buffer | ||
30 | */ | ||
31 | typedef struct rtlx_channel { | ||
32 | enum rtlx_state rt_state; | ||
33 | enum rtlx_state lx_state; | ||
34 | |||
35 | int buffer_size; | ||
36 | |||
37 | /* read and write indexes per buffer */ | ||
38 | int rt_write, rt_read; | ||
39 | char *rt_buffer; | ||
40 | |||
41 | int lx_write, lx_read; | ||
42 | char *lx_buffer; | ||
43 | |||
44 | void *queues; | ||
45 | |||
46 | } rtlx_channel_t; | ||
47 | |||
48 | typedef struct rtlx_info { | ||
49 | unsigned long id; | ||
50 | enum rtlx_state state; | ||
51 | |||
52 | struct rtlx_channel channel[RTLX_CHANNELS]; | ||
53 | |||
54 | } rtlx_info_t; | ||
55 | |||
56 | #endif | ||
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h index c2c97dec661b..3d6aa7c7ea81 100644 --- a/include/asm-mips/semaphore.h +++ b/include/asm-mips/semaphore.h | |||
@@ -45,9 +45,6 @@ struct semaphore { | |||
45 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 45 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
46 | } | 46 | } |
47 | 47 | ||
48 | #define __MUTEX_INITIALIZER(name) \ | ||
49 | __SEMAPHORE_INITIALIZER(name, 1) | ||
50 | |||
51 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ | 48 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ |
52 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 49 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
53 | 50 | ||
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h index 4eed8e2acdc3..e796d75f027e 100644 --- a/include/asm-mips/serial.h +++ b/include/asm-mips/serial.h | |||
@@ -52,16 +52,6 @@ | |||
52 | #define JAZZ_SERIAL_PORT_DEFNS | 52 | #define JAZZ_SERIAL_PORT_DEFNS |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #ifdef CONFIG_MIPS_COBALT | ||
56 | #include <asm/cobalt/cobalt.h> | ||
57 | #define COBALT_BASE_BAUD (18432000 / 16) | ||
58 | #define COBALT_SERIAL_PORT_DEFNS \ | ||
59 | /* UART CLK PORT IRQ FLAGS */ \ | ||
60 | { 0, COBALT_BASE_BAUD, 0xc800000, COBALT_SERIAL_IRQ, STD_COM_FLAGS }, /* ttyS0 */ | ||
61 | #else | ||
62 | #define COBALT_SERIAL_PORT_DEFNS | ||
63 | #endif | ||
64 | |||
65 | /* | 55 | /* |
66 | * Both Galileo boards have the same UART mappings. | 56 | * Both Galileo boards have the same UART mappings. |
67 | */ | 57 | */ |
@@ -113,17 +103,6 @@ | |||
113 | #define IVR_SERIAL_PORT_DEFNS | 103 | #define IVR_SERIAL_PORT_DEFNS |
114 | #endif | 104 | #endif |
115 | 105 | ||
116 | #ifdef CONFIG_TOSHIBA_JMR3927 | ||
117 | #include <asm/jmr3927/jmr3927.h> | ||
118 | #define TXX927_SERIAL_PORT_DEFNS \ | ||
119 | { .baud_base = JMR3927_BASE_BAUD, .port = UART0_ADDR, .irq = UART0_INT, \ | ||
120 | .flags = UART0_FLAGS, .type = 1 }, \ | ||
121 | { .baud_base = JMR3927_BASE_BAUD, .port = UART1_ADDR, .irq = UART1_INT, \ | ||
122 | .flags = UART1_FLAGS, .type = 1 }, | ||
123 | #else | ||
124 | #define TXX927_SERIAL_PORT_DEFNS | ||
125 | #endif | ||
126 | |||
127 | #ifdef CONFIG_SERIAL_AU1X00 | 106 | #ifdef CONFIG_SERIAL_AU1X00 |
128 | #include <asm/mach-au1x00/au1000.h> | 107 | #include <asm/mach-au1x00/au1000.h> |
129 | #ifdef CONFIG_SOC_AU1000 | 108 | #ifdef CONFIG_SOC_AU1000 |
@@ -227,9 +206,9 @@ | |||
227 | #define JAGUAR_ATX_SERIAL1_BASE 0xfd000023L | 206 | #define JAGUAR_ATX_SERIAL1_BASE 0xfd000023L |
228 | 207 | ||
229 | #define _JAGUAR_ATX_SERIAL_INIT(int, base) \ | 208 | #define _JAGUAR_ATX_SERIAL_INIT(int, base) \ |
230 | { baud_base: JAGUAR_ATX_BASE_BAUD, irq: int, \ | 209 | { .baud_base = JAGUAR_ATX_BASE_BAUD, irq: int, \ |
231 | flags: (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ | 210 | .flags = (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ |
232 | iomem_base: (u8 *) base, iomem_reg_shift: 2, \ | 211 | .iomem_base = (u8 *) base, iomem_reg_shift: 2, \ |
233 | io_type: SERIAL_IO_MEM } | 212 | io_type: SERIAL_IO_MEM } |
234 | #define MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS \ | 213 | #define MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS \ |
235 | _JAGUAR_ATX_SERIAL_INIT(JAGUAR_ATX_SERIAL1_IRQ, JAGUAR_ATX_SERIAL1_BASE) | 214 | _JAGUAR_ATX_SERIAL_INIT(JAGUAR_ATX_SERIAL1_IRQ, JAGUAR_ATX_SERIAL1_BASE) |
@@ -243,9 +222,9 @@ | |||
243 | #define OCELOT_3_SERIAL_BASE (signed)0xfd000020 | 222 | #define OCELOT_3_SERIAL_BASE (signed)0xfd000020 |
244 | 223 | ||
245 | #define _OCELOT_3_SERIAL_INIT(int, base) \ | 224 | #define _OCELOT_3_SERIAL_INIT(int, base) \ |
246 | { baud_base: OCELOT_3_BASE_BAUD, irq: int, \ | 225 | { .baud_base = OCELOT_3_BASE_BAUD, irq: int, \ |
247 | flags: STD_COM_FLAGS, \ | 226 | .flags = STD_COM_FLAGS, \ |
248 | iomem_base: (u8 *) base, iomem_reg_shift: 2, \ | 227 | .iomem_base = (u8 *) base, iomem_reg_shift: 2, \ |
249 | io_type: SERIAL_IO_MEM } | 228 | io_type: SERIAL_IO_MEM } |
250 | 229 | ||
251 | #define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ | 230 | #define MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ |
@@ -342,7 +321,6 @@ | |||
342 | #endif /* CONFIG_SGI_IP32 */ | 321 | #endif /* CONFIG_SGI_IP32 */ |
343 | 322 | ||
344 | #define SERIAL_PORT_DFNS \ | 323 | #define SERIAL_PORT_DFNS \ |
345 | COBALT_SERIAL_PORT_DEFNS \ | ||
346 | DDB5477_SERIAL_PORT_DEFNS \ | 324 | DDB5477_SERIAL_PORT_DEFNS \ |
347 | EV96100_SERIAL_PORT_DEFNS \ | 325 | EV96100_SERIAL_PORT_DEFNS \ |
348 | IP32_SERIAL_PORT_DEFNS \ | 326 | IP32_SERIAL_PORT_DEFNS \ |
@@ -354,7 +332,6 @@ | |||
354 | MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \ | 332 | MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS \ |
355 | MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ | 333 | MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ |
356 | MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ | 334 | MOMENCO_OCELOT_3_SERIAL_PORT_DEFNS \ |
357 | TXX927_SERIAL_PORT_DEFNS \ | ||
358 | AU1000_SERIAL_PORT_DEFNS | 335 | AU1000_SERIAL_PORT_DEFNS |
359 | 336 | ||
360 | #endif /* _ASM_SERIAL_H */ | 337 | #endif /* _ASM_SERIAL_H */ |
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h index ac3dfc7af5b0..fcec52bafb25 100644 --- a/include/asm-mips/sgi/hpc3.h +++ b/include/asm-mips/sgi/hpc3.h | |||
@@ -128,26 +128,26 @@ struct hpc3_ethregs { | |||
128 | volatile u32 rx_gfptr; /* current GIO fifo ptr */ | 128 | volatile u32 rx_gfptr; /* current GIO fifo ptr */ |
129 | volatile u32 rx_dfptr; /* current device fifo ptr */ | 129 | volatile u32 rx_dfptr; /* current device fifo ptr */ |
130 | u32 _unused1; /* padding */ | 130 | u32 _unused1; /* padding */ |
131 | volatile u32 rx_reset; /* reset register */ | 131 | volatile u32 reset; /* reset register */ |
132 | #define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */ | 132 | #define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */ |
133 | #define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */ | 133 | #define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */ |
134 | #define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ | 134 | #define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ |
135 | 135 | ||
136 | volatile u32 rx_dconfig; /* DMA configuration register */ | 136 | volatile u32 dconfig; /* DMA configuration register */ |
137 | #define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ | 137 | #define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ |
138 | #define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ | 138 | #define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ |
139 | #define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ | 139 | #define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ |
140 | #define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ | 140 | #define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */ |
141 | #define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ | 141 | #define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */ |
142 | #define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ | 142 | #define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */ |
143 | #define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ | 143 | #define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ |
144 | #define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */ | 144 | #define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */ |
145 | 145 | ||
146 | volatile u32 rx_pconfig; /* PIO configuration register */ | 146 | volatile u32 pconfig; /* PIO configuration register */ |
147 | #define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ | 147 | #define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ |
148 | #define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ | 148 | #define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ |
149 | #define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ | 149 | #define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ |
150 | #define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ | 150 | #define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ |
151 | 151 | ||
152 | u32 _unused2[0x1000/4 - 8]; /* padding */ | 152 | u32 _unused2[0x1000/4 - 8]; /* padding */ |
153 | 153 | ||
diff --git a/include/asm-mips/sibyte/bcm1480_int.h b/include/asm-mips/sibyte/bcm1480_int.h new file mode 100644 index 000000000000..42d4cf00efd3 --- /dev/null +++ b/include/asm-mips/sibyte/bcm1480_int.h | |||
@@ -0,0 +1,310 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1480 Board Support Package | ||
3 | * | ||
4 | * Interrupt Mapper definitions File: bcm1480_int.h | ||
5 | * | ||
6 | * This module contains constants for manipulating the | ||
7 | * BCM1255/BCM1280/BCM1455/BCM1480's interrupt mapper and | ||
8 | * definitions for the interrupt sources. | ||
9 | * | ||
10 | * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03) | ||
11 | * | ||
12 | ********************************************************************* | ||
13 | * | ||
14 | * Copyright 2000,2001,2002,2003 | ||
15 | * Broadcom Corporation. All rights reserved. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or | ||
18 | * modify it under the terms of the GNU General Public License as | ||
19 | * published by the Free Software Foundation; either version 2 of | ||
20 | * the License, or (at your option) any later version. | ||
21 | * | ||
22 | * This program is distributed in the hope that it will be useful, | ||
23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 | * GNU General Public License for more details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License | ||
28 | * along with this program; if not, write to the Free Software | ||
29 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
30 | * MA 02111-1307 USA | ||
31 | ********************************************************************* */ | ||
32 | |||
33 | |||
34 | #ifndef _BCM1480_INT_H | ||
35 | #define _BCM1480_INT_H | ||
36 | |||
37 | #include "sb1250_defs.h" | ||
38 | |||
39 | /* ********************************************************************* | ||
40 | * Interrupt Mapper Constants | ||
41 | ********************************************************************* */ | ||
42 | |||
43 | /* | ||
44 | * The interrupt mapper deals with 128-bit logical registers that are | ||
45 | * implemented as pairs of 64-bit registers, with the "low" 64 bits in | ||
46 | * a register that has an address 0x1000 higher(!) than the | ||
47 | * corresponding "high" register. | ||
48 | * | ||
49 | * For appropriate registers, bit 0 of the "high" register is a | ||
50 | * cascade bit that summarizes (as a bit-OR) the 64 bits of the "low" | ||
51 | * register. | ||
52 | */ | ||
53 | |||
54 | /* | ||
55 | * This entire file uses _BCM1480_ in all the symbols because it is | ||
56 | * entirely BCM1480 specific. | ||
57 | */ | ||
58 | |||
59 | /* | ||
60 | * Interrupt sources (Table 22) | ||
61 | */ | ||
62 | |||
63 | #define K_BCM1480_INT_SOURCES 128 | ||
64 | |||
65 | #define _BCM1480_INT_HIGH(k) (k) | ||
66 | #define _BCM1480_INT_LOW(k) ((k)+64) | ||
67 | |||
68 | #define K_BCM1480_INT_ADDR_TRAP _BCM1480_INT_HIGH(1) | ||
69 | #define K_BCM1480_INT_GPIO_0 _BCM1480_INT_HIGH(4) | ||
70 | #define K_BCM1480_INT_GPIO_1 _BCM1480_INT_HIGH(5) | ||
71 | #define K_BCM1480_INT_GPIO_2 _BCM1480_INT_HIGH(6) | ||
72 | #define K_BCM1480_INT_GPIO_3 _BCM1480_INT_HIGH(7) | ||
73 | #define K_BCM1480_INT_PCI_INTA _BCM1480_INT_HIGH(8) | ||
74 | #define K_BCM1480_INT_PCI_INTB _BCM1480_INT_HIGH(9) | ||
75 | #define K_BCM1480_INT_PCI_INTC _BCM1480_INT_HIGH(10) | ||
76 | #define K_BCM1480_INT_PCI_INTD _BCM1480_INT_HIGH(11) | ||
77 | #define K_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_HIGH(12) | ||
78 | #define K_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_HIGH(13) | ||
79 | #define K_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_HIGH(14) | ||
80 | #define K_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_HIGH(15) | ||
81 | #define K_BCM1480_INT_TIMER_0 _BCM1480_INT_HIGH(20) | ||
82 | #define K_BCM1480_INT_TIMER_1 _BCM1480_INT_HIGH(21) | ||
83 | #define K_BCM1480_INT_TIMER_2 _BCM1480_INT_HIGH(22) | ||
84 | #define K_BCM1480_INT_TIMER_3 _BCM1480_INT_HIGH(23) | ||
85 | #define K_BCM1480_INT_DM_CH_0 _BCM1480_INT_HIGH(28) | ||
86 | #define K_BCM1480_INT_DM_CH_1 _BCM1480_INT_HIGH(29) | ||
87 | #define K_BCM1480_INT_DM_CH_2 _BCM1480_INT_HIGH(30) | ||
88 | #define K_BCM1480_INT_DM_CH_3 _BCM1480_INT_HIGH(31) | ||
89 | #define K_BCM1480_INT_MAC_0 _BCM1480_INT_HIGH(36) | ||
90 | #define K_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_HIGH(37) | ||
91 | #define K_BCM1480_INT_MAC_1 _BCM1480_INT_HIGH(38) | ||
92 | #define K_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_HIGH(39) | ||
93 | #define K_BCM1480_INT_MAC_2 _BCM1480_INT_HIGH(40) | ||
94 | #define K_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_HIGH(41) | ||
95 | #define K_BCM1480_INT_MAC_3 _BCM1480_INT_HIGH(42) | ||
96 | #define K_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_HIGH(43) | ||
97 | #define K_BCM1480_INT_PMI_LOW _BCM1480_INT_HIGH(52) | ||
98 | #define K_BCM1480_INT_PMI_HIGH _BCM1480_INT_HIGH(53) | ||
99 | #define K_BCM1480_INT_PMO_LOW _BCM1480_INT_HIGH(54) | ||
100 | #define K_BCM1480_INT_PMO_HIGH _BCM1480_INT_HIGH(55) | ||
101 | #define K_BCM1480_INT_MBOX_0_0 _BCM1480_INT_HIGH(56) | ||
102 | #define K_BCM1480_INT_MBOX_0_1 _BCM1480_INT_HIGH(57) | ||
103 | #define K_BCM1480_INT_MBOX_0_2 _BCM1480_INT_HIGH(58) | ||
104 | #define K_BCM1480_INT_MBOX_0_3 _BCM1480_INT_HIGH(59) | ||
105 | #define K_BCM1480_INT_MBOX_1_0 _BCM1480_INT_HIGH(60) | ||
106 | #define K_BCM1480_INT_MBOX_1_1 _BCM1480_INT_HIGH(61) | ||
107 | #define K_BCM1480_INT_MBOX_1_2 _BCM1480_INT_HIGH(62) | ||
108 | #define K_BCM1480_INT_MBOX_1_3 _BCM1480_INT_HIGH(63) | ||
109 | |||
110 | #define K_BCM1480_INT_BAD_ECC _BCM1480_INT_LOW(1) | ||
111 | #define K_BCM1480_INT_COR_ECC _BCM1480_INT_LOW(2) | ||
112 | #define K_BCM1480_INT_IO_BUS _BCM1480_INT_LOW(3) | ||
113 | #define K_BCM1480_INT_PERF_CNT _BCM1480_INT_LOW(4) | ||
114 | #define K_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_LOW(5) | ||
115 | #define K_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_LOW(6) | ||
116 | #define K_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_LOW(7) | ||
117 | #define K_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_LOW(8) | ||
118 | #define K_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_LOW(9) | ||
119 | #define K_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_LOW(10) | ||
120 | #define K_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_LOW(11) | ||
121 | #define K_BCM1480_INT_PCI_ERROR _BCM1480_INT_LOW(16) | ||
122 | #define K_BCM1480_INT_PCI_RESET _BCM1480_INT_LOW(17) | ||
123 | #define K_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_LOW(18) | ||
124 | #define K_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_LOW(19) | ||
125 | #define K_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_LOW(20) | ||
126 | #define K_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_LOW(21) | ||
127 | #define K_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_LOW(22) | ||
128 | #define K_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_LOW(23) | ||
129 | #define K_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_LOW(24) | ||
130 | #define K_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_LOW(25) | ||
131 | #define K_BCM1480_INT_LDT_SMI _BCM1480_INT_LOW(32) | ||
132 | #define K_BCM1480_INT_LDT_NMI _BCM1480_INT_LOW(33) | ||
133 | #define K_BCM1480_INT_LDT_INIT _BCM1480_INT_LOW(34) | ||
134 | #define K_BCM1480_INT_LDT_STARTUP _BCM1480_INT_LOW(35) | ||
135 | #define K_BCM1480_INT_LDT_EXT _BCM1480_INT_LOW(36) | ||
136 | #define K_BCM1480_INT_SMB_0 _BCM1480_INT_LOW(40) | ||
137 | #define K_BCM1480_INT_SMB_1 _BCM1480_INT_LOW(41) | ||
138 | #define K_BCM1480_INT_PCMCIA _BCM1480_INT_LOW(42) | ||
139 | #define K_BCM1480_INT_UART_0 _BCM1480_INT_LOW(44) | ||
140 | #define K_BCM1480_INT_UART_1 _BCM1480_INT_LOW(45) | ||
141 | #define K_BCM1480_INT_UART_2 _BCM1480_INT_LOW(46) | ||
142 | #define K_BCM1480_INT_UART_3 _BCM1480_INT_LOW(47) | ||
143 | #define K_BCM1480_INT_GPIO_4 _BCM1480_INT_LOW(52) | ||
144 | #define K_BCM1480_INT_GPIO_5 _BCM1480_INT_LOW(53) | ||
145 | #define K_BCM1480_INT_GPIO_6 _BCM1480_INT_LOW(54) | ||
146 | #define K_BCM1480_INT_GPIO_7 _BCM1480_INT_LOW(55) | ||
147 | #define K_BCM1480_INT_GPIO_8 _BCM1480_INT_LOW(56) | ||
148 | #define K_BCM1480_INT_GPIO_9 _BCM1480_INT_LOW(57) | ||
149 | #define K_BCM1480_INT_GPIO_10 _BCM1480_INT_LOW(58) | ||
150 | #define K_BCM1480_INT_GPIO_11 _BCM1480_INT_LOW(59) | ||
151 | #define K_BCM1480_INT_GPIO_12 _BCM1480_INT_LOW(60) | ||
152 | #define K_BCM1480_INT_GPIO_13 _BCM1480_INT_LOW(61) | ||
153 | #define K_BCM1480_INT_GPIO_14 _BCM1480_INT_LOW(62) | ||
154 | #define K_BCM1480_INT_GPIO_15 _BCM1480_INT_LOW(63) | ||
155 | |||
156 | /* | ||
157 | * Mask values for each interrupt | ||
158 | */ | ||
159 | |||
160 | #define _BCM1480_INT_MASK1(n) _SB_MAKEMASK1(((n) & 0x3F)) | ||
161 | #define _BCM1480_INT_OFFSET(n) (((n) & 0x40) << 6) | ||
162 | |||
163 | #define M_BCM1480_INT_CASCADE _BCM1480_INT_MASK1(_BCM1480_INT_HIGH(0)) | ||
164 | |||
165 | #define M_BCM1480_INT_ADDR_TRAP _BCM1480_INT_MASK1(K_BCM1480_INT_ADDR_TRAP) | ||
166 | #define M_BCM1480_INT_GPIO_0 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_0) | ||
167 | #define M_BCM1480_INT_GPIO_1 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_1) | ||
168 | #define M_BCM1480_INT_GPIO_2 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_2) | ||
169 | #define M_BCM1480_INT_GPIO_3 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_3) | ||
170 | #define M_BCM1480_INT_PCI_INTA _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTA) | ||
171 | #define M_BCM1480_INT_PCI_INTB _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTB) | ||
172 | #define M_BCM1480_INT_PCI_INTC _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTC) | ||
173 | #define M_BCM1480_INT_PCI_INTD _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_INTD) | ||
174 | #define M_BCM1480_INT_CYCLE_CP0 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP0) | ||
175 | #define M_BCM1480_INT_CYCLE_CP1 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP1) | ||
176 | #define M_BCM1480_INT_CYCLE_CP2 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP2) | ||
177 | #define M_BCM1480_INT_CYCLE_CP3 _BCM1480_INT_MASK1(K_BCM1480_INT_CYCLE_CP3) | ||
178 | #define M_BCM1480_INT_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_0) | ||
179 | #define M_BCM1480_INT_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_1) | ||
180 | #define M_BCM1480_INT_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_2) | ||
181 | #define M_BCM1480_INT_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_TIMER_3) | ||
182 | #define M_BCM1480_INT_DM_CH_0 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_0) | ||
183 | #define M_BCM1480_INT_DM_CH_1 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_1) | ||
184 | #define M_BCM1480_INT_DM_CH_2 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_2) | ||
185 | #define M_BCM1480_INT_DM_CH_3 _BCM1480_INT_MASK1(K_BCM1480_INT_DM_CH_3) | ||
186 | #define M_BCM1480_INT_MAC_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0) | ||
187 | #define M_BCM1480_INT_MAC_0_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_0_CH1) | ||
188 | #define M_BCM1480_INT_MAC_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1) | ||
189 | #define M_BCM1480_INT_MAC_1_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_1_CH1) | ||
190 | #define M_BCM1480_INT_MAC_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2) | ||
191 | #define M_BCM1480_INT_MAC_2_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_2_CH1) | ||
192 | #define M_BCM1480_INT_MAC_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3) | ||
193 | #define M_BCM1480_INT_MAC_3_CH1 _BCM1480_INT_MASK1(K_BCM1480_INT_MAC_3_CH1) | ||
194 | #define M_BCM1480_INT_PMI_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_LOW) | ||
195 | #define M_BCM1480_INT_PMI_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMI_HIGH) | ||
196 | #define M_BCM1480_INT_PMO_LOW _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_LOW) | ||
197 | #define M_BCM1480_INT_PMO_HIGH _BCM1480_INT_MASK1(K_BCM1480_INT_PMO_HIGH) | ||
198 | #define M_BCM1480_INT_MBOX_0_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_0) | ||
199 | #define M_BCM1480_INT_MBOX_0_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_1) | ||
200 | #define M_BCM1480_INT_MBOX_0_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_2) | ||
201 | #define M_BCM1480_INT_MBOX_0_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_3) | ||
202 | #define M_BCM1480_INT_MBOX_1_0 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_0) | ||
203 | #define M_BCM1480_INT_MBOX_1_1 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_1) | ||
204 | #define M_BCM1480_INT_MBOX_1_2 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_2) | ||
205 | #define M_BCM1480_INT_MBOX_1_3 _BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_1_3) | ||
206 | #define M_BCM1480_INT_BAD_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_BAD_ECC) | ||
207 | #define M_BCM1480_INT_COR_ECC _BCM1480_INT_MASK1(K_BCM1480_INT_COR_ECC) | ||
208 | #define M_BCM1480_INT_IO_BUS _BCM1480_INT_MASK1(K_BCM1480_INT_IO_BUS) | ||
209 | #define M_BCM1480_INT_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_PERF_CNT) | ||
210 | #define M_BCM1480_INT_SW_PERF_CNT _BCM1480_INT_MASK1(K_BCM1480_INT_SW_PERF_CNT) | ||
211 | #define M_BCM1480_INT_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_TRACE_FREEZE) | ||
212 | #define M_BCM1480_INT_SW_TRACE_FREEZE _BCM1480_INT_MASK1(K_BCM1480_INT_SW_TRACE_FREEZE) | ||
213 | #define M_BCM1480_INT_WATCHDOG_TIMER_0 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_0) | ||
214 | #define M_BCM1480_INT_WATCHDOG_TIMER_1 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_1) | ||
215 | #define M_BCM1480_INT_WATCHDOG_TIMER_2 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_2) | ||
216 | #define M_BCM1480_INT_WATCHDOG_TIMER_3 _BCM1480_INT_MASK1(K_BCM1480_INT_WATCHDOG_TIMER_3) | ||
217 | #define M_BCM1480_INT_PCI_ERROR _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_ERROR) | ||
218 | #define M_BCM1480_INT_PCI_RESET _BCM1480_INT_MASK1(K_BCM1480_INT_PCI_RESET) | ||
219 | #define M_BCM1480_INT_NODE_CONTROLLER _BCM1480_INT_MASK1(K_BCM1480_INT_NODE_CONTROLLER) | ||
220 | #define M_BCM1480_INT_HOST_BRIDGE _BCM1480_INT_MASK1(K_BCM1480_INT_HOST_BRIDGE) | ||
221 | #define M_BCM1480_INT_PORT_0_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_FATAL) | ||
222 | #define M_BCM1480_INT_PORT_0_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_0_NONFATAL) | ||
223 | #define M_BCM1480_INT_PORT_1_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_FATAL) | ||
224 | #define M_BCM1480_INT_PORT_1_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_1_NONFATAL) | ||
225 | #define M_BCM1480_INT_PORT_2_FATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_FATAL) | ||
226 | #define M_BCM1480_INT_PORT_2_NONFATAL _BCM1480_INT_MASK1(K_BCM1480_INT_PORT_2_NONFATAL) | ||
227 | #define M_BCM1480_INT_LDT_SMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_SMI) | ||
228 | #define M_BCM1480_INT_LDT_NMI _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_NMI) | ||
229 | #define M_BCM1480_INT_LDT_INIT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_INIT) | ||
230 | #define M_BCM1480_INT_LDT_STARTUP _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_STARTUP) | ||
231 | #define M_BCM1480_INT_LDT_EXT _BCM1480_INT_MASK1(K_BCM1480_INT_LDT_EXT) | ||
232 | #define M_BCM1480_INT_SMB_0 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_0) | ||
233 | #define M_BCM1480_INT_SMB_1 _BCM1480_INT_MASK1(K_BCM1480_INT_SMB_1) | ||
234 | #define M_BCM1480_INT_PCMCIA _BCM1480_INT_MASK1(K_BCM1480_INT_PCMCIA) | ||
235 | #define M_BCM1480_INT_UART_0 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_0) | ||
236 | #define M_BCM1480_INT_UART_1 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_1) | ||
237 | #define M_BCM1480_INT_UART_2 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_2) | ||
238 | #define M_BCM1480_INT_UART_3 _BCM1480_INT_MASK1(K_BCM1480_INT_UART_3) | ||
239 | #define M_BCM1480_INT_GPIO_4 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_4) | ||
240 | #define M_BCM1480_INT_GPIO_5 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_5) | ||
241 | #define M_BCM1480_INT_GPIO_6 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_6) | ||
242 | #define M_BCM1480_INT_GPIO_7 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_7) | ||
243 | #define M_BCM1480_INT_GPIO_8 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_8) | ||
244 | #define M_BCM1480_INT_GPIO_9 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_9) | ||
245 | #define M_BCM1480_INT_GPIO_10 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_10) | ||
246 | #define M_BCM1480_INT_GPIO_11 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_11) | ||
247 | #define M_BCM1480_INT_GPIO_12 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_12) | ||
248 | #define M_BCM1480_INT_GPIO_13 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_13) | ||
249 | #define M_BCM1480_INT_GPIO_14 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_14) | ||
250 | #define M_BCM1480_INT_GPIO_15 _BCM1480_INT_MASK1(K_BCM1480_INT_GPIO_15) | ||
251 | |||
252 | /* | ||
253 | * Interrupt mappings (Table 18) | ||
254 | */ | ||
255 | |||
256 | #define K_BCM1480_INT_MAP_I0 0 /* interrupt pins on processor */ | ||
257 | #define K_BCM1480_INT_MAP_I1 1 | ||
258 | #define K_BCM1480_INT_MAP_I2 2 | ||
259 | #define K_BCM1480_INT_MAP_I3 3 | ||
260 | #define K_BCM1480_INT_MAP_I4 4 | ||
261 | #define K_BCM1480_INT_MAP_I5 5 | ||
262 | #define K_BCM1480_INT_MAP_NMI 6 /* nonmaskable */ | ||
263 | #define K_BCM1480_INT_MAP_DINT 7 /* debug interrupt */ | ||
264 | |||
265 | /* | ||
266 | * Interrupt LDT Set Register (Table 19) | ||
267 | */ | ||
268 | |||
269 | #define S_BCM1480_INT_HT_INTMSG 0 | ||
270 | #define M_BCM1480_INT_HT_INTMSG _SB_MAKEMASK(3,S_BCM1480_INT_HT_INTMSG) | ||
271 | #define V_BCM1480_INT_HT_INTMSG(x) _SB_MAKEVALUE(x,S_BCM1480_INT_HT_INTMSG) | ||
272 | #define G_BCM1480_INT_HT_INTMSG(x) _SB_GETVALUE(x,S_BCM1480_INT_HT_INTMSG,M_BCM1480_INT_HT_INTMSG) | ||
273 | |||
274 | #define K_BCM1480_INT_HT_INTMSG_FIXED 0 | ||
275 | #define K_BCM1480_INT_HT_INTMSG_ARBITRATED 1 | ||
276 | #define K_BCM1480_INT_HT_INTMSG_SMI 2 | ||
277 | #define K_BCM1480_INT_HT_INTMSG_NMI 3 | ||
278 | #define K_BCM1480_INT_HT_INTMSG_INIT 4 | ||
279 | #define K_BCM1480_INT_HT_INTMSG_STARTUP 5 | ||
280 | #define K_BCM1480_INT_HT_INTMSG_EXTINT 6 | ||
281 | #define K_BCM1480_INT_HT_INTMSG_RESERVED 7 | ||
282 | |||
283 | #define M_BCM1480_INT_HT_TRIGGERMODE _SB_MAKEMASK1(3) | ||
284 | #define V_BCM1480_INT_HT_EDGETRIGGER 0 | ||
285 | #define V_BCM1480_INT_HT_LEVELTRIGGER M_BCM1480_INT_HT_TRIGGERMODE | ||
286 | |||
287 | #define M_BCM1480_INT_HT_DESTMODE _SB_MAKEMASK1(4) | ||
288 | #define V_BCM1480_INT_HT_PHYSICALDEST 0 | ||
289 | #define V_BCM1480_INT_HT_LOGICALDEST M_BCM1480_INT_HT_DESTMODE | ||
290 | |||
291 | #define S_BCM1480_INT_HT_INTDEST 5 | ||
292 | #define M_BCM1480_INT_HT_INTDEST _SB_MAKEMASK(8,S_BCM1480_INT_HT_INTDEST) | ||
293 | #define V_BCM1480_INT_HT_INTDEST(x) _SB_MAKEVALUE(x,S_BCM1480_INT_HT_INTDEST) | ||
294 | #define G_BCM1480_INT_HT_INTDEST(x) _SB_GETVALUE(x,S_BCM1480_INT_HT_INTDEST,M_BCM1480_INT_HT_INTDEST) | ||
295 | |||
296 | #define S_BCM1480_INT_HT_VECTOR 13 | ||
297 | #define M_BCM1480_INT_HT_VECTOR _SB_MAKEMASK(8,S_BCM1480_INT_HT_VECTOR) | ||
298 | #define V_BCM1480_INT_HT_VECTOR(x) _SB_MAKEVALUE(x,S_BCM1480_INT_HT_VECTOR) | ||
299 | #define G_BCM1480_INT_HT_VECTOR(x) _SB_GETVALUE(x,S_BCM1480_INT_HT_VECTOR,M_BCM1480_INT_HT_VECTOR) | ||
300 | |||
301 | /* | ||
302 | * Vector prefix (Table 4-7) | ||
303 | */ | ||
304 | |||
305 | #define M_BCM1480_HTVECT_RAISE_INTLDT_HIGH 0x00 | ||
306 | #define M_BCM1480_HTVECT_RAISE_MBOX_0 0x40 | ||
307 | #define M_BCM1480_HTVECT_RAISE_INTLDT_LO 0x80 | ||
308 | #define M_BCM1480_HTVECT_RAISE_MBOX_1 0xC0 | ||
309 | |||
310 | #endif /* _BCM1480_INT_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_l2c.h b/include/asm-mips/sibyte/bcm1480_l2c.h new file mode 100644 index 000000000000..886b099565e6 --- /dev/null +++ b/include/asm-mips/sibyte/bcm1480_l2c.h | |||
@@ -0,0 +1,176 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1480 Board Support Package | ||
3 | * | ||
4 | * L2 Cache constants and macros File: bcm1480_l2c.h | ||
5 | * | ||
6 | * This module contains constants useful for manipulating the | ||
7 | * level 2 cache. | ||
8 | * | ||
9 | * BCM1400 specification level: 1280-UM100-D2 (11/14/03) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _BCM1480_L2C_H | ||
34 | #define _BCM1480_L2C_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Format of level 2 cache management address (Table 55) | ||
40 | */ | ||
41 | |||
42 | #define S_BCM1480_L2C_MGMT_INDEX 5 | ||
43 | #define M_BCM1480_L2C_MGMT_INDEX _SB_MAKEMASK(12,S_BCM1480_L2C_MGMT_INDEX) | ||
44 | #define V_BCM1480_L2C_MGMT_INDEX(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_MGMT_INDEX) | ||
45 | #define G_BCM1480_L2C_MGMT_INDEX(x) _SB_GETVALUE(x,S_BCM1480_L2C_MGMT_INDEX,M_BCM1480_L2C_MGMT_INDEX) | ||
46 | |||
47 | #define S_BCM1480_L2C_MGMT_WAY 17 | ||
48 | #define M_BCM1480_L2C_MGMT_WAY _SB_MAKEMASK(3,S_BCM1480_L2C_MGMT_WAY) | ||
49 | #define V_BCM1480_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_MGMT_WAY) | ||
50 | #define G_BCM1480_L2C_MGMT_WAY(x) _SB_GETVALUE(x,S_BCM1480_L2C_MGMT_WAY,M_BCM1480_L2C_MGMT_WAY) | ||
51 | |||
52 | #define M_BCM1480_L2C_MGMT_DIRTY _SB_MAKEMASK1(20) | ||
53 | #define M_BCM1480_L2C_MGMT_VALID _SB_MAKEMASK1(21) | ||
54 | |||
55 | #define S_BCM1480_L2C_MGMT_ECC_DIAG 22 | ||
56 | #define M_BCM1480_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2,S_BCM1480_L2C_MGMT_ECC_DIAG) | ||
57 | #define V_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_MGMT_ECC_DIAG) | ||
58 | #define G_BCM1480_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x,S_BCM1480_L2C_MGMT_ECC_DIAG,M_BCM1480_L2C_MGMT_ECC_DIAG) | ||
59 | |||
60 | #define A_BCM1480_L2C_MGMT_TAG_BASE 0x00D0000000 | ||
61 | |||
62 | #define BCM1480_L2C_ENTRIES_PER_WAY 4096 | ||
63 | #define BCM1480_L2C_NUM_WAYS 8 | ||
64 | |||
65 | |||
66 | /* | ||
67 | * Level 2 Cache Tag register (Table 59) | ||
68 | */ | ||
69 | |||
70 | #define S_BCM1480_L2C_TAG_MBZ 0 | ||
71 | #define M_BCM1480_L2C_TAG_MBZ _SB_MAKEMASK(5,S_BCM1480_L2C_TAG_MBZ) | ||
72 | |||
73 | #define S_BCM1480_L2C_TAG_INDEX 5 | ||
74 | #define M_BCM1480_L2C_TAG_INDEX _SB_MAKEMASK(12,S_BCM1480_L2C_TAG_INDEX) | ||
75 | #define V_BCM1480_L2C_TAG_INDEX(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_INDEX) | ||
76 | #define G_BCM1480_L2C_TAG_INDEX(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_INDEX,M_BCM1480_L2C_TAG_INDEX) | ||
77 | |||
78 | /* Note that index bit 16 is also tag bit 40 */ | ||
79 | #define S_BCM1480_L2C_TAG_TAG 17 | ||
80 | #define M_BCM1480_L2C_TAG_TAG _SB_MAKEMASK(23,S_BCM1480_L2C_TAG_TAG) | ||
81 | #define V_BCM1480_L2C_TAG_TAG(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_TAG) | ||
82 | #define G_BCM1480_L2C_TAG_TAG(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_TAG,M_BCM1480_L2C_TAG_TAG) | ||
83 | |||
84 | #define S_BCM1480_L2C_TAG_ECC 40 | ||
85 | #define M_BCM1480_L2C_TAG_ECC _SB_MAKEMASK(6,S_BCM1480_L2C_TAG_ECC) | ||
86 | #define V_BCM1480_L2C_TAG_ECC(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_ECC) | ||
87 | #define G_BCM1480_L2C_TAG_ECC(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_ECC,M_BCM1480_L2C_TAG_ECC) | ||
88 | |||
89 | #define S_BCM1480_L2C_TAG_WAY 46 | ||
90 | #define M_BCM1480_L2C_TAG_WAY _SB_MAKEMASK(3,S_BCM1480_L2C_TAG_WAY) | ||
91 | #define V_BCM1480_L2C_TAG_WAY(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_TAG_WAY) | ||
92 | #define G_BCM1480_L2C_TAG_WAY(x) _SB_GETVALUE(x,S_BCM1480_L2C_TAG_WAY,M_BCM1480_L2C_TAG_WAY) | ||
93 | |||
94 | #define M_BCM1480_L2C_TAG_DIRTY _SB_MAKEMASK1(49) | ||
95 | #define M_BCM1480_L2C_TAG_VALID _SB_MAKEMASK1(50) | ||
96 | |||
97 | #define S_BCM1480_L2C_DATA_ECC 51 | ||
98 | #define M_BCM1480_L2C_DATA_ECC _SB_MAKEMASK(10,S_BCM1480_L2C_DATA_ECC) | ||
99 | #define V_BCM1480_L2C_DATA_ECC(x) _SB_MAKEVALUE(x,S_BCM1480_L2C_DATA_ECC) | ||
100 | #define G_BCM1480_L2C_DATA_ECC(x) _SB_GETVALUE(x,S_BCM1480_L2C_DATA_ECC,M_BCM1480_L2C_DATA_ECC) | ||
101 | |||
102 | |||
103 | /* | ||
104 | * L2 Misc0 Value Register (Table 60) | ||
105 | */ | ||
106 | |||
107 | #define S_BCM1480_L2C_MISC0_WAY_REMOTE 0 | ||
108 | #define M_BCM1480_L2C_MISC0_WAY_REMOTE _SB_MAKEMASK(8,S_BCM1480_L2C_MISC0_WAY_REMOTE) | ||
109 | #define G_BCM1480_L2C_MISC0_WAY_REMOTE(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_WAY_REMOTE,M_BCM1480_L2C_MISC0_WAY_REMOTE) | ||
110 | |||
111 | #define S_BCM1480_L2C_MISC0_WAY_LOCAL 8 | ||
112 | #define M_BCM1480_L2C_MISC0_WAY_LOCAL _SB_MAKEMASK(8,S_BCM1480_L2C_MISC0_WAY_LOCAL) | ||
113 | #define G_BCM1480_L2C_MISC0_WAY_LOCAL(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_WAY_LOCAL,M_BCM1480_L2C_MISC0_WAY_LOCAL) | ||
114 | |||
115 | #define S_BCM1480_L2C_MISC0_WAY_ENABLE 16 | ||
116 | #define M_BCM1480_L2C_MISC0_WAY_ENABLE _SB_MAKEMASK(8,S_BCM1480_L2C_MISC0_WAY_ENABLE) | ||
117 | #define G_BCM1480_L2C_MISC0_WAY_ENABLE(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_WAY_ENABLE,M_BCM1480_L2C_MISC0_WAY_ENABLE) | ||
118 | |||
119 | #define S_BCM1480_L2C_MISC0_CACHE_DISABLE 24 | ||
120 | #define M_BCM1480_L2C_MISC0_CACHE_DISABLE _SB_MAKEMASK(2,S_BCM1480_L2C_MISC0_CACHE_DISABLE) | ||
121 | #define G_BCM1480_L2C_MISC0_CACHE_DISABLE(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_CACHE_DISABLE,M_BCM1480_L2C_MISC0_CACHE_DISABLE) | ||
122 | |||
123 | #define S_BCM1480_L2C_MISC0_CACHE_QUAD 26 | ||
124 | #define M_BCM1480_L2C_MISC0_CACHE_QUAD _SB_MAKEMASK(2,S_BCM1480_L2C_MISC0_CACHE_QUAD) | ||
125 | #define G_BCM1480_L2C_MISC0_CACHE_QUAD(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC0_CACHE_QUAD,M_BCM1480_L2C_MISC0_CACHE_QUAD) | ||
126 | |||
127 | #define S_BCM1480_L2C_MISC0_MC_PRIORITY 30 | ||
128 | #define M_BCM1480_L2C_MISC0_MC_PRIORITY _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_MC_PRIORITY) | ||
129 | |||
130 | #define S_BCM1480_L2C_MISC0_ECC_CLEANUP 31 | ||
131 | #define M_BCM1480_L2C_MISC0_ECC_CLEANUP _SB_MAKEMASK1(S_BCM1480_L2C_MISC0_ECC_CLEANUP) | ||
132 | |||
133 | |||
134 | /* | ||
135 | * L2 Misc1 Value Register (Table 60) | ||
136 | */ | ||
137 | |||
138 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_0 0 | ||
139 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_0 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_0) | ||
140 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_0(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_0,M_BCM1480_L2C_MISC1_WAY_AGENT_0) | ||
141 | |||
142 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_1 8 | ||
143 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_1 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_1) | ||
144 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_1(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_1,M_BCM1480_L2C_MISC1_WAY_AGENT_1) | ||
145 | |||
146 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_2 16 | ||
147 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_2 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_2) | ||
148 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_2(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_2,M_BCM1480_L2C_MISC1_WAY_AGENT_2) | ||
149 | |||
150 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_3 24 | ||
151 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_3 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_3) | ||
152 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_3(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_3,M_BCM1480_L2C_MISC1_WAY_AGENT_3) | ||
153 | |||
154 | #define S_BCM1480_L2C_MISC1_WAY_AGENT_4 32 | ||
155 | #define M_BCM1480_L2C_MISC1_WAY_AGENT_4 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC1_WAY_AGENT_4) | ||
156 | #define G_BCM1480_L2C_MISC1_WAY_AGENT_4(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC1_WAY_AGENT_4,M_BCM1480_L2C_MISC1_WAY_AGENT_4) | ||
157 | |||
158 | |||
159 | /* | ||
160 | * L2 Misc2 Value Register (Table 60) | ||
161 | */ | ||
162 | |||
163 | #define S_BCM1480_L2C_MISC2_WAY_AGENT_8 0 | ||
164 | #define M_BCM1480_L2C_MISC2_WAY_AGENT_8 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC2_WAY_AGENT_8) | ||
165 | #define G_BCM1480_L2C_MISC2_WAY_AGENT_8(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC2_WAY_AGENT_8,M_BCM1480_L2C_MISC2_WAY_AGENT_8) | ||
166 | |||
167 | #define S_BCM1480_L2C_MISC2_WAY_AGENT_9 8 | ||
168 | #define M_BCM1480_L2C_MISC2_WAY_AGENT_9 _SB_MAKEMASK(8,S_BCM1480_L2C_MISC2_WAY_AGENT_9) | ||
169 | #define G_BCM1480_L2C_MISC2_WAY_AGENT_9(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC2_WAY_AGENT_9,M_BCM1480_L2C_MISC2_WAY_AGENT_9) | ||
170 | |||
171 | #define S_BCM1480_L2C_MISC2_WAY_AGENT_A 16 | ||
172 | #define M_BCM1480_L2C_MISC2_WAY_AGENT_A _SB_MAKEMASK(8,S_BCM1480_L2C_MISC2_WAY_AGENT_A) | ||
173 | #define G_BCM1480_L2C_MISC2_WAY_AGENT_A(x) _SB_GETVALUE(x,S_BCM1480_L2C_MISC2_WAY_AGENT_A,M_BCM1480_L2C_MISC2_WAY_AGENT_A) | ||
174 | |||
175 | |||
176 | #endif /* _BCM1480_L2C_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_mc.h b/include/asm-mips/sibyte/bcm1480_mc.h new file mode 100644 index 000000000000..6bdc941afc91 --- /dev/null +++ b/include/asm-mips/sibyte/bcm1480_mc.h | |||
@@ -0,0 +1,962 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1480 Board Support Package | ||
3 | * | ||
4 | * Memory Controller constants File: bcm1480_mc.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * programming the memory controller. | ||
8 | * | ||
9 | * BCM1400 specification level: 1280-UM100-D1 (11/14/03 Review Copy) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | |||
33 | #ifndef _BCM1480_MC_H | ||
34 | #define _BCM1480_MC_H | ||
35 | |||
36 | #include "sb1250_defs.h" | ||
37 | |||
38 | /* | ||
39 | * Memory Channel Configuration Register (Table 81) | ||
40 | */ | ||
41 | |||
42 | #define S_BCM1480_MC_INTLV0 0 | ||
43 | #define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV0) | ||
44 | #define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV0) | ||
45 | #define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV0,M_BCM1480_MC_INTLV0) | ||
46 | #define V_BCM1480_MC_INTLV0_DEFAULT V_BCM1480_MC_INTLV0(0) | ||
47 | |||
48 | #define S_BCM1480_MC_INTLV1 8 | ||
49 | #define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV1) | ||
50 | #define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV1) | ||
51 | #define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV1,M_BCM1480_MC_INTLV1) | ||
52 | #define V_BCM1480_MC_INTLV1_DEFAULT V_BCM1480_MC_INTLV1(0) | ||
53 | |||
54 | #define S_BCM1480_MC_INTLV2 16 | ||
55 | #define M_BCM1480_MC_INTLV2 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV2) | ||
56 | #define V_BCM1480_MC_INTLV2(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV2) | ||
57 | #define G_BCM1480_MC_INTLV2(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV2,M_BCM1480_MC_INTLV2) | ||
58 | #define V_BCM1480_MC_INTLV2_DEFAULT V_BCM1480_MC_INTLV2(0) | ||
59 | |||
60 | #define S_BCM1480_MC_CS_MODE 32 | ||
61 | #define M_BCM1480_MC_CS_MODE _SB_MAKEMASK(8,S_BCM1480_MC_CS_MODE) | ||
62 | #define V_BCM1480_MC_CS_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS_MODE) | ||
63 | #define G_BCM1480_MC_CS_MODE(x) _SB_GETVALUE(x,S_BCM1480_MC_CS_MODE,M_BCM1480_MC_CS_MODE) | ||
64 | #define V_BCM1480_MC_CS_MODE_DEFAULT V_BCM1480_MC_CS_MODE(0) | ||
65 | |||
66 | #define V_BCM1480_MC_CONFIG_DEFAULT (V_BCM1480_MC_INTLV0_DEFAULT | \ | ||
67 | V_BCM1480_MC_INTLV1_DEFAULT | \ | ||
68 | V_BCM1480_MC_INTLV2_DEFAULT | \ | ||
69 | V_BCM1480_MC_CS_MODE_DEFAULT) | ||
70 | |||
71 | #define K_BCM1480_MC_CS01_MODE 0x03 | ||
72 | #define K_BCM1480_MC_CS02_MODE 0x05 | ||
73 | #define K_BCM1480_MC_CS0123_MODE 0x0F | ||
74 | #define K_BCM1480_MC_CS0246_MODE 0x55 | ||
75 | #define K_BCM1480_MC_CS0145_MODE 0x33 | ||
76 | #define K_BCM1480_MC_CS0167_MODE 0xC3 | ||
77 | #define K_BCM1480_MC_CSFULL_MODE 0xFF | ||
78 | |||
79 | /* | ||
80 | * Chip Select Start Address Register (Table 82) | ||
81 | */ | ||
82 | |||
83 | #define S_BCM1480_MC_CS0_START 0 | ||
84 | #define M_BCM1480_MC_CS0_START _SB_MAKEMASK(12,S_BCM1480_MC_CS0_START) | ||
85 | #define V_BCM1480_MC_CS0_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS0_START) | ||
86 | #define G_BCM1480_MC_CS0_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS0_START,M_BCM1480_MC_CS0_START) | ||
87 | |||
88 | #define S_BCM1480_MC_CS1_START 16 | ||
89 | #define M_BCM1480_MC_CS1_START _SB_MAKEMASK(12,S_BCM1480_MC_CS1_START) | ||
90 | #define V_BCM1480_MC_CS1_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS1_START) | ||
91 | #define G_BCM1480_MC_CS1_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS1_START,M_BCM1480_MC_CS1_START) | ||
92 | |||
93 | #define S_BCM1480_MC_CS2_START 32 | ||
94 | #define M_BCM1480_MC_CS2_START _SB_MAKEMASK(12,S_BCM1480_MC_CS2_START) | ||
95 | #define V_BCM1480_MC_CS2_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS2_START) | ||
96 | #define G_BCM1480_MC_CS2_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS2_START,M_BCM1480_MC_CS2_START) | ||
97 | |||
98 | #define S_BCM1480_MC_CS3_START 48 | ||
99 | #define M_BCM1480_MC_CS3_START _SB_MAKEMASK(12,S_BCM1480_MC_CS3_START) | ||
100 | #define V_BCM1480_MC_CS3_START(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS3_START) | ||
101 | #define G_BCM1480_MC_CS3_START(x) _SB_GETVALUE(x,S_BCM1480_MC_CS3_START,M_BCM1480_MC_CS3_START) | ||
102 | |||
103 | /* | ||
104 | * Chip Select End Address Register (Table 83) | ||
105 | */ | ||
106 | |||
107 | #define S_BCM1480_MC_CS0_END 0 | ||
108 | #define M_BCM1480_MC_CS0_END _SB_MAKEMASK(12,S_BCM1480_MC_CS0_END) | ||
109 | #define V_BCM1480_MC_CS0_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS0_END) | ||
110 | #define G_BCM1480_MC_CS0_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS0_END,M_BCM1480_MC_CS0_END) | ||
111 | |||
112 | #define S_BCM1480_MC_CS1_END 16 | ||
113 | #define M_BCM1480_MC_CS1_END _SB_MAKEMASK(12,S_BCM1480_MC_CS1_END) | ||
114 | #define V_BCM1480_MC_CS1_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS1_END) | ||
115 | #define G_BCM1480_MC_CS1_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS1_END,M_BCM1480_MC_CS1_END) | ||
116 | |||
117 | #define S_BCM1480_MC_CS2_END 32 | ||
118 | #define M_BCM1480_MC_CS2_END _SB_MAKEMASK(12,S_BCM1480_MC_CS2_END) | ||
119 | #define V_BCM1480_MC_CS2_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS2_END) | ||
120 | #define G_BCM1480_MC_CS2_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS2_END,M_BCM1480_MC_CS2_END) | ||
121 | |||
122 | #define S_BCM1480_MC_CS3_END 48 | ||
123 | #define M_BCM1480_MC_CS3_END _SB_MAKEMASK(12,S_BCM1480_MC_CS3_END) | ||
124 | #define V_BCM1480_MC_CS3_END(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS3_END) | ||
125 | #define G_BCM1480_MC_CS3_END(x) _SB_GETVALUE(x,S_BCM1480_MC_CS3_END,M_BCM1480_MC_CS3_END) | ||
126 | |||
127 | /* | ||
128 | * Row Address Bit Select Register 0 (Table 84) | ||
129 | */ | ||
130 | |||
131 | #define S_BCM1480_MC_ROW00 0 | ||
132 | #define M_BCM1480_MC_ROW00 _SB_MAKEMASK(6,S_BCM1480_MC_ROW00) | ||
133 | #define V_BCM1480_MC_ROW00(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW00) | ||
134 | #define G_BCM1480_MC_ROW00(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW00,M_BCM1480_MC_ROW00) | ||
135 | |||
136 | #define S_BCM1480_MC_ROW01 8 | ||
137 | #define M_BCM1480_MC_ROW01 _SB_MAKEMASK(6,S_BCM1480_MC_ROW01) | ||
138 | #define V_BCM1480_MC_ROW01(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW01) | ||
139 | #define G_BCM1480_MC_ROW01(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW01,M_BCM1480_MC_ROW01) | ||
140 | |||
141 | #define S_BCM1480_MC_ROW02 16 | ||
142 | #define M_BCM1480_MC_ROW02 _SB_MAKEMASK(6,S_BCM1480_MC_ROW02) | ||
143 | #define V_BCM1480_MC_ROW02(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW02) | ||
144 | #define G_BCM1480_MC_ROW02(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW02,M_BCM1480_MC_ROW02) | ||
145 | |||
146 | #define S_BCM1480_MC_ROW03 24 | ||
147 | #define M_BCM1480_MC_ROW03 _SB_MAKEMASK(6,S_BCM1480_MC_ROW03) | ||
148 | #define V_BCM1480_MC_ROW03(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW03) | ||
149 | #define G_BCM1480_MC_ROW03(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW03,M_BCM1480_MC_ROW03) | ||
150 | |||
151 | #define S_BCM1480_MC_ROW04 32 | ||
152 | #define M_BCM1480_MC_ROW04 _SB_MAKEMASK(6,S_BCM1480_MC_ROW04) | ||
153 | #define V_BCM1480_MC_ROW04(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW04) | ||
154 | #define G_BCM1480_MC_ROW04(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW04,M_BCM1480_MC_ROW04) | ||
155 | |||
156 | #define S_BCM1480_MC_ROW05 40 | ||
157 | #define M_BCM1480_MC_ROW05 _SB_MAKEMASK(6,S_BCM1480_MC_ROW05) | ||
158 | #define V_BCM1480_MC_ROW05(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW05) | ||
159 | #define G_BCM1480_MC_ROW05(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW05,M_BCM1480_MC_ROW05) | ||
160 | |||
161 | #define S_BCM1480_MC_ROW06 48 | ||
162 | #define M_BCM1480_MC_ROW06 _SB_MAKEMASK(6,S_BCM1480_MC_ROW06) | ||
163 | #define V_BCM1480_MC_ROW06(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW06) | ||
164 | #define G_BCM1480_MC_ROW06(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW06,M_BCM1480_MC_ROW06) | ||
165 | |||
166 | #define S_BCM1480_MC_ROW07 56 | ||
167 | #define M_BCM1480_MC_ROW07 _SB_MAKEMASK(6,S_BCM1480_MC_ROW07) | ||
168 | #define V_BCM1480_MC_ROW07(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW07) | ||
169 | #define G_BCM1480_MC_ROW07(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW07,M_BCM1480_MC_ROW07) | ||
170 | |||
171 | /* | ||
172 | * Row Address Bit Select Register 1 (Table 85) | ||
173 | */ | ||
174 | |||
175 | #define S_BCM1480_MC_ROW08 0 | ||
176 | #define M_BCM1480_MC_ROW08 _SB_MAKEMASK(6,S_BCM1480_MC_ROW08) | ||
177 | #define V_BCM1480_MC_ROW08(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW08) | ||
178 | #define G_BCM1480_MC_ROW08(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW08,M_BCM1480_MC_ROW08) | ||
179 | |||
180 | #define S_BCM1480_MC_ROW09 8 | ||
181 | #define M_BCM1480_MC_ROW09 _SB_MAKEMASK(6,S_BCM1480_MC_ROW09) | ||
182 | #define V_BCM1480_MC_ROW09(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW09) | ||
183 | #define G_BCM1480_MC_ROW09(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW09,M_BCM1480_MC_ROW09) | ||
184 | |||
185 | #define S_BCM1480_MC_ROW10 16 | ||
186 | #define M_BCM1480_MC_ROW10 _SB_MAKEMASK(6,S_BCM1480_MC_ROW10) | ||
187 | #define V_BCM1480_MC_ROW10(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW10) | ||
188 | #define G_BCM1480_MC_ROW10(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW10,M_BCM1480_MC_ROW10) | ||
189 | |||
190 | #define S_BCM1480_MC_ROW11 24 | ||
191 | #define M_BCM1480_MC_ROW11 _SB_MAKEMASK(6,S_BCM1480_MC_ROW11) | ||
192 | #define V_BCM1480_MC_ROW11(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW11) | ||
193 | #define G_BCM1480_MC_ROW11(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW11,M_BCM1480_MC_ROW11) | ||
194 | |||
195 | #define S_BCM1480_MC_ROW12 32 | ||
196 | #define M_BCM1480_MC_ROW12 _SB_MAKEMASK(6,S_BCM1480_MC_ROW12) | ||
197 | #define V_BCM1480_MC_ROW12(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW12) | ||
198 | #define G_BCM1480_MC_ROW12(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW12,M_BCM1480_MC_ROW12) | ||
199 | |||
200 | #define S_BCM1480_MC_ROW13 40 | ||
201 | #define M_BCM1480_MC_ROW13 _SB_MAKEMASK(6,S_BCM1480_MC_ROW13) | ||
202 | #define V_BCM1480_MC_ROW13(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW13) | ||
203 | #define G_BCM1480_MC_ROW13(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW13,M_BCM1480_MC_ROW13) | ||
204 | |||
205 | #define S_BCM1480_MC_ROW14 48 | ||
206 | #define M_BCM1480_MC_ROW14 _SB_MAKEMASK(6,S_BCM1480_MC_ROW14) | ||
207 | #define V_BCM1480_MC_ROW14(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ROW14) | ||
208 | #define G_BCM1480_MC_ROW14(x) _SB_GETVALUE(x,S_BCM1480_MC_ROW14,M_BCM1480_MC_ROW14) | ||
209 | |||
210 | #define K_BCM1480_MC_ROWX_BIT_SPACING 8 | ||
211 | |||
212 | /* | ||
213 | * Column Address Bit Select Register 0 (Table 86) | ||
214 | */ | ||
215 | |||
216 | #define S_BCM1480_MC_COL00 0 | ||
217 | #define M_BCM1480_MC_COL00 _SB_MAKEMASK(6,S_BCM1480_MC_COL00) | ||
218 | #define V_BCM1480_MC_COL00(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL00) | ||
219 | #define G_BCM1480_MC_COL00(x) _SB_GETVALUE(x,S_BCM1480_MC_COL00,M_BCM1480_MC_COL00) | ||
220 | |||
221 | #define S_BCM1480_MC_COL01 8 | ||
222 | #define M_BCM1480_MC_COL01 _SB_MAKEMASK(6,S_BCM1480_MC_COL01) | ||
223 | #define V_BCM1480_MC_COL01(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL01) | ||
224 | #define G_BCM1480_MC_COL01(x) _SB_GETVALUE(x,S_BCM1480_MC_COL01,M_BCM1480_MC_COL01) | ||
225 | |||
226 | #define S_BCM1480_MC_COL02 16 | ||
227 | #define M_BCM1480_MC_COL02 _SB_MAKEMASK(6,S_BCM1480_MC_COL02) | ||
228 | #define V_BCM1480_MC_COL02(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL02) | ||
229 | #define G_BCM1480_MC_COL02(x) _SB_GETVALUE(x,S_BCM1480_MC_COL02,M_BCM1480_MC_COL02) | ||
230 | |||
231 | #define S_BCM1480_MC_COL03 24 | ||
232 | #define M_BCM1480_MC_COL03 _SB_MAKEMASK(6,S_BCM1480_MC_COL03) | ||
233 | #define V_BCM1480_MC_COL03(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL03) | ||
234 | #define G_BCM1480_MC_COL03(x) _SB_GETVALUE(x,S_BCM1480_MC_COL03,M_BCM1480_MC_COL03) | ||
235 | |||
236 | #define S_BCM1480_MC_COL04 32 | ||
237 | #define M_BCM1480_MC_COL04 _SB_MAKEMASK(6,S_BCM1480_MC_COL04) | ||
238 | #define V_BCM1480_MC_COL04(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL04) | ||
239 | #define G_BCM1480_MC_COL04(x) _SB_GETVALUE(x,S_BCM1480_MC_COL04,M_BCM1480_MC_COL04) | ||
240 | |||
241 | #define S_BCM1480_MC_COL05 40 | ||
242 | #define M_BCM1480_MC_COL05 _SB_MAKEMASK(6,S_BCM1480_MC_COL05) | ||
243 | #define V_BCM1480_MC_COL05(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL05) | ||
244 | #define G_BCM1480_MC_COL05(x) _SB_GETVALUE(x,S_BCM1480_MC_COL05,M_BCM1480_MC_COL05) | ||
245 | |||
246 | #define S_BCM1480_MC_COL06 48 | ||
247 | #define M_BCM1480_MC_COL06 _SB_MAKEMASK(6,S_BCM1480_MC_COL06) | ||
248 | #define V_BCM1480_MC_COL06(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL06) | ||
249 | #define G_BCM1480_MC_COL06(x) _SB_GETVALUE(x,S_BCM1480_MC_COL06,M_BCM1480_MC_COL06) | ||
250 | |||
251 | #define S_BCM1480_MC_COL07 56 | ||
252 | #define M_BCM1480_MC_COL07 _SB_MAKEMASK(6,S_BCM1480_MC_COL07) | ||
253 | #define V_BCM1480_MC_COL07(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL07) | ||
254 | #define G_BCM1480_MC_COL07(x) _SB_GETVALUE(x,S_BCM1480_MC_COL07,M_BCM1480_MC_COL07) | ||
255 | |||
256 | /* | ||
257 | * Column Address Bit Select Register 1 (Table 87) | ||
258 | */ | ||
259 | |||
260 | #define S_BCM1480_MC_COL08 0 | ||
261 | #define M_BCM1480_MC_COL08 _SB_MAKEMASK(6,S_BCM1480_MC_COL08) | ||
262 | #define V_BCM1480_MC_COL08(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL08) | ||
263 | #define G_BCM1480_MC_COL08(x) _SB_GETVALUE(x,S_BCM1480_MC_COL08,M_BCM1480_MC_COL08) | ||
264 | |||
265 | #define S_BCM1480_MC_COL09 8 | ||
266 | #define M_BCM1480_MC_COL09 _SB_MAKEMASK(6,S_BCM1480_MC_COL09) | ||
267 | #define V_BCM1480_MC_COL09(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL09) | ||
268 | #define G_BCM1480_MC_COL09(x) _SB_GETVALUE(x,S_BCM1480_MC_COL09,M_BCM1480_MC_COL09) | ||
269 | |||
270 | #define S_BCM1480_MC_COL10 16 /* not a valid position, must be prog as 0 */ | ||
271 | |||
272 | #define S_BCM1480_MC_COL11 24 | ||
273 | #define M_BCM1480_MC_COL11 _SB_MAKEMASK(6,S_BCM1480_MC_COL11) | ||
274 | #define V_BCM1480_MC_COL11(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL11) | ||
275 | #define G_BCM1480_MC_COL11(x) _SB_GETVALUE(x,S_BCM1480_MC_COL11,M_BCM1480_MC_COL11) | ||
276 | |||
277 | #define S_BCM1480_MC_COL12 32 | ||
278 | #define M_BCM1480_MC_COL12 _SB_MAKEMASK(6,S_BCM1480_MC_COL12) | ||
279 | #define V_BCM1480_MC_COL12(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL12) | ||
280 | #define G_BCM1480_MC_COL12(x) _SB_GETVALUE(x,S_BCM1480_MC_COL12,M_BCM1480_MC_COL12) | ||
281 | |||
282 | #define S_BCM1480_MC_COL13 40 | ||
283 | #define M_BCM1480_MC_COL13 _SB_MAKEMASK(6,S_BCM1480_MC_COL13) | ||
284 | #define V_BCM1480_MC_COL13(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL13) | ||
285 | #define G_BCM1480_MC_COL13(x) _SB_GETVALUE(x,S_BCM1480_MC_COL13,M_BCM1480_MC_COL13) | ||
286 | |||
287 | #define S_BCM1480_MC_COL14 48 | ||
288 | #define M_BCM1480_MC_COL14 _SB_MAKEMASK(6,S_BCM1480_MC_COL14) | ||
289 | #define V_BCM1480_MC_COL14(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COL14) | ||
290 | #define G_BCM1480_MC_COL14(x) _SB_GETVALUE(x,S_BCM1480_MC_COL14,M_BCM1480_MC_COL14) | ||
291 | |||
292 | #define K_BCM1480_MC_COLX_BIT_SPACING 8 | ||
293 | |||
294 | /* | ||
295 | * CS0 and CS1 Bank Address Bit Select Register (Table 88) | ||
296 | */ | ||
297 | |||
298 | #define S_BCM1480_MC_CS01_BANK0 0 | ||
299 | #define M_BCM1480_MC_CS01_BANK0 _SB_MAKEMASK(6,S_BCM1480_MC_CS01_BANK0) | ||
300 | #define V_BCM1480_MC_CS01_BANK0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS01_BANK0) | ||
301 | #define G_BCM1480_MC_CS01_BANK0(x) _SB_GETVALUE(x,S_BCM1480_MC_CS01_BANK0,M_BCM1480_MC_CS01_BANK0) | ||
302 | |||
303 | #define S_BCM1480_MC_CS01_BANK1 8 | ||
304 | #define M_BCM1480_MC_CS01_BANK1 _SB_MAKEMASK(6,S_BCM1480_MC_CS01_BANK1) | ||
305 | #define V_BCM1480_MC_CS01_BANK1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS01_BANK1) | ||
306 | #define G_BCM1480_MC_CS01_BANK1(x) _SB_GETVALUE(x,S_BCM1480_MC_CS01_BANK1,M_BCM1480_MC_CS01_BANK1) | ||
307 | |||
308 | #define S_BCM1480_MC_CS01_BANK2 16 | ||
309 | #define M_BCM1480_MC_CS01_BANK2 _SB_MAKEMASK(6,S_BCM1480_MC_CS01_BANK2) | ||
310 | #define V_BCM1480_MC_CS01_BANK2(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS01_BANK2) | ||
311 | #define G_BCM1480_MC_CS01_BANK2(x) _SB_GETVALUE(x,S_BCM1480_MC_CS01_BANK2,M_BCM1480_MC_CS01_BANK2) | ||
312 | |||
313 | /* | ||
314 | * CS2 and CS3 Bank Address Bit Select Register (Table 89) | ||
315 | */ | ||
316 | |||
317 | #define S_BCM1480_MC_CS23_BANK0 0 | ||
318 | #define M_BCM1480_MC_CS23_BANK0 _SB_MAKEMASK(6,S_BCM1480_MC_CS23_BANK0) | ||
319 | #define V_BCM1480_MC_CS23_BANK0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS23_BANK0) | ||
320 | #define G_BCM1480_MC_CS23_BANK0(x) _SB_GETVALUE(x,S_BCM1480_MC_CS23_BANK0,M_BCM1480_MC_CS23_BANK0) | ||
321 | |||
322 | #define S_BCM1480_MC_CS23_BANK1 8 | ||
323 | #define M_BCM1480_MC_CS23_BANK1 _SB_MAKEMASK(6,S_BCM1480_MC_CS23_BANK1) | ||
324 | #define V_BCM1480_MC_CS23_BANK1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS23_BANK1) | ||
325 | #define G_BCM1480_MC_CS23_BANK1(x) _SB_GETVALUE(x,S_BCM1480_MC_CS23_BANK1,M_BCM1480_MC_CS23_BANK1) | ||
326 | |||
327 | #define S_BCM1480_MC_CS23_BANK2 16 | ||
328 | #define M_BCM1480_MC_CS23_BANK2 _SB_MAKEMASK(6,S_BCM1480_MC_CS23_BANK2) | ||
329 | #define V_BCM1480_MC_CS23_BANK2(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CS23_BANK2) | ||
330 | #define G_BCM1480_MC_CS23_BANK2(x) _SB_GETVALUE(x,S_BCM1480_MC_CS23_BANK2,M_BCM1480_MC_CS23_BANK2) | ||
331 | |||
332 | #define K_BCM1480_MC_CSXX_BANKX_BIT_SPACING 8 | ||
333 | |||
334 | /* | ||
335 | * DRAM Command Register (Table 90) | ||
336 | */ | ||
337 | |||
338 | #define S_BCM1480_MC_COMMAND 0 | ||
339 | #define M_BCM1480_MC_COMMAND _SB_MAKEMASK(4,S_BCM1480_MC_COMMAND) | ||
340 | #define V_BCM1480_MC_COMMAND(x) _SB_MAKEVALUE(x,S_BCM1480_MC_COMMAND) | ||
341 | #define G_BCM1480_MC_COMMAND(x) _SB_GETVALUE(x,S_BCM1480_MC_COMMAND,M_BCM1480_MC_COMMAND) | ||
342 | |||
343 | #define K_BCM1480_MC_COMMAND_EMRS 0 | ||
344 | #define K_BCM1480_MC_COMMAND_MRS 1 | ||
345 | #define K_BCM1480_MC_COMMAND_PRE 2 | ||
346 | #define K_BCM1480_MC_COMMAND_AR 3 | ||
347 | #define K_BCM1480_MC_COMMAND_SETRFSH 4 | ||
348 | #define K_BCM1480_MC_COMMAND_CLRRFSH 5 | ||
349 | #define K_BCM1480_MC_COMMAND_SETPWRDN 6 | ||
350 | #define K_BCM1480_MC_COMMAND_CLRPWRDN 7 | ||
351 | |||
352 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
353 | #define K_BCM1480_MC_COMMAND_EMRS2 8 | ||
354 | #define K_BCM1480_MC_COMMAND_EMRS3 9 | ||
355 | #define K_BCM1480_MC_COMMAND_ENABLE_MCLK 10 | ||
356 | #define K_BCM1480_MC_COMMAND_DISABLE_MCLK 11 | ||
357 | #endif | ||
358 | |||
359 | #define V_BCM1480_MC_COMMAND_EMRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS) | ||
360 | #define V_BCM1480_MC_COMMAND_MRS V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_MRS) | ||
361 | #define V_BCM1480_MC_COMMAND_PRE V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_PRE) | ||
362 | #define V_BCM1480_MC_COMMAND_AR V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_AR) | ||
363 | #define V_BCM1480_MC_COMMAND_SETRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETRFSH) | ||
364 | #define V_BCM1480_MC_COMMAND_CLRRFSH V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRRFSH) | ||
365 | #define V_BCM1480_MC_COMMAND_SETPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_SETPWRDN) | ||
366 | #define V_BCM1480_MC_COMMAND_CLRPWRDN V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_CLRPWRDN) | ||
367 | |||
368 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
369 | #define V_BCM1480_MC_COMMAND_EMRS2 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS2) | ||
370 | #define V_BCM1480_MC_COMMAND_EMRS3 V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_EMRS3) | ||
371 | #define V_BCM1480_MC_COMMAND_ENABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_ENABLE_MCLK) | ||
372 | #define V_BCM1480_MC_COMMAND_DISABLE_MCLK V_BCM1480_MC_COMMAND(K_BCM1480_MC_COMMAND_DISABLE_MCLK) | ||
373 | #endif | ||
374 | |||
375 | #define S_BCM1480_MC_CS0 4 | ||
376 | #define M_BCM1480_MC_CS0 _SB_MAKEMASK1(4) | ||
377 | #define M_BCM1480_MC_CS1 _SB_MAKEMASK1(5) | ||
378 | #define M_BCM1480_MC_CS2 _SB_MAKEMASK1(6) | ||
379 | #define M_BCM1480_MC_CS3 _SB_MAKEMASK1(7) | ||
380 | #define M_BCM1480_MC_CS4 _SB_MAKEMASK1(8) | ||
381 | #define M_BCM1480_MC_CS5 _SB_MAKEMASK1(9) | ||
382 | #define M_BCM1480_MC_CS6 _SB_MAKEMASK1(10) | ||
383 | #define M_BCM1480_MC_CS7 _SB_MAKEMASK1(11) | ||
384 | |||
385 | #define M_BCM1480_MC_CMD_ACTIVE _SB_MAKEMASK1(16) | ||
386 | |||
387 | /* | ||
388 | * DRAM Mode Register (Table 91) | ||
389 | */ | ||
390 | |||
391 | #define S_BCM1480_MC_EMODE 0 | ||
392 | #define M_BCM1480_MC_EMODE _SB_MAKEMASK(15,S_BCM1480_MC_EMODE) | ||
393 | #define V_BCM1480_MC_EMODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_EMODE) | ||
394 | #define G_BCM1480_MC_EMODE(x) _SB_GETVALUE(x,S_BCM1480_MC_EMODE,M_BCM1480_MC_EMODE) | ||
395 | #define V_BCM1480_MC_EMODE_DEFAULT V_BCM1480_MC_EMODE(0) | ||
396 | |||
397 | #define S_BCM1480_MC_MODE 16 | ||
398 | #define M_BCM1480_MC_MODE _SB_MAKEMASK(15,S_BCM1480_MC_MODE) | ||
399 | #define V_BCM1480_MC_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_MODE) | ||
400 | #define G_BCM1480_MC_MODE(x) _SB_GETVALUE(x,S_BCM1480_MC_MODE,M_BCM1480_MC_MODE) | ||
401 | #define V_BCM1480_MC_MODE_DEFAULT V_BCM1480_MC_MODE(0) | ||
402 | |||
403 | #define S_BCM1480_MC_DRAM_TYPE 32 | ||
404 | #define M_BCM1480_MC_DRAM_TYPE _SB_MAKEMASK(4,S_BCM1480_MC_DRAM_TYPE) | ||
405 | #define V_BCM1480_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DRAM_TYPE) | ||
406 | #define G_BCM1480_MC_DRAM_TYPE(x) _SB_GETVALUE(x,S_BCM1480_MC_DRAM_TYPE,M_BCM1480_MC_DRAM_TYPE) | ||
407 | |||
408 | #define K_BCM1480_MC_DRAM_TYPE_JEDEC 0 | ||
409 | #define K_BCM1480_MC_DRAM_TYPE_FCRAM 1 | ||
410 | |||
411 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
412 | #define K_BCM1480_MC_DRAM_TYPE_DDR2 2 | ||
413 | #endif | ||
414 | |||
415 | #define V_BCM1480_MC_DRAM_TYPE_JEDEC V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_JEDEC) | ||
416 | #define V_BCM1480_MC_DRAM_TYPE_FCRAM V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_FCRAM) | ||
417 | |||
418 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
419 | #define V_BCM1480_MC_DRAM_TYPE_DDR2 V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_DDR2) | ||
420 | #endif | ||
421 | |||
422 | #define M_BCM1480_MC_GANGED _SB_MAKEMASK1(36) | ||
423 | #define M_BCM1480_MC_BY9_INTF _SB_MAKEMASK1(37) | ||
424 | #define M_BCM1480_MC_FORCE_ECC64 _SB_MAKEMASK1(38) | ||
425 | #define M_BCM1480_MC_ECC_DISABLE _SB_MAKEMASK1(39) | ||
426 | |||
427 | #define S_BCM1480_MC_PG_POLICY 40 | ||
428 | #define M_BCM1480_MC_PG_POLICY _SB_MAKEMASK(2,S_BCM1480_MC_PG_POLICY) | ||
429 | #define V_BCM1480_MC_PG_POLICY(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PG_POLICY) | ||
430 | #define G_BCM1480_MC_PG_POLICY(x) _SB_GETVALUE(x,S_BCM1480_MC_PG_POLICY,M_BCM1480_MC_PG_POLICY) | ||
431 | |||
432 | #define K_BCM1480_MC_PG_POLICY_CLOSED 0 | ||
433 | #define K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK 1 | ||
434 | |||
435 | #define V_BCM1480_MC_PG_POLICY_CLOSED V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CLOSED) | ||
436 | #define V_BCM1480_MC_PG_POLICY_CAS_TIME_CHK V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK) | ||
437 | |||
438 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
439 | #define M_BCM1480_MC_2T_CMD _SB_MAKEMASK1(42) | ||
440 | #define M_BCM1480_MC_ECC_COR_DIS _SB_MAKEMASK1(43) | ||
441 | #endif | ||
442 | |||
443 | #define V_BCM1480_MC_DRAMMODE_DEFAULT V_BCM1480_MC_EMODE_DEFAULT | V_BCM1480_MC_MODE_DEFAULT | V_BCM1480_MC_DRAM_TYPE_JEDEC | \ | ||
444 | V_BCM1480_MC_PG_POLICY(K_BCM1480_MC_PG_POLICY_CAS_TIME_CHK) | ||
445 | |||
446 | /* | ||
447 | * Memory Clock Configuration Register (Table 92) | ||
448 | */ | ||
449 | |||
450 | #define S_BCM1480_MC_CLK_RATIO 0 | ||
451 | #define M_BCM1480_MC_CLK_RATIO _SB_MAKEMASK(6,S_BCM1480_MC_CLK_RATIO) | ||
452 | #define V_BCM1480_MC_CLK_RATIO(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CLK_RATIO) | ||
453 | #define G_BCM1480_MC_CLK_RATIO(x) _SB_GETVALUE(x,S_BCM1480_MC_CLK_RATIO,M_BCM1480_MC_CLK_RATIO) | ||
454 | |||
455 | #define V_BCM1480_MC_CLK_RATIO_DEFAULT V_BCM1480_MC_CLK_RATIO(10) | ||
456 | |||
457 | #define S_BCM1480_MC_REF_RATE 8 | ||
458 | #define M_BCM1480_MC_REF_RATE _SB_MAKEMASK(8,S_BCM1480_MC_REF_RATE) | ||
459 | #define V_BCM1480_MC_REF_RATE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_REF_RATE) | ||
460 | #define G_BCM1480_MC_REF_RATE(x) _SB_GETVALUE(x,S_BCM1480_MC_REF_RATE,M_BCM1480_MC_REF_RATE) | ||
461 | |||
462 | #define K_BCM1480_MC_REF_RATE_100MHz 0x31 | ||
463 | #define K_BCM1480_MC_REF_RATE_200MHz 0x62 | ||
464 | #define K_BCM1480_MC_REF_RATE_400MHz 0xC4 | ||
465 | |||
466 | #define V_BCM1480_MC_REF_RATE_100MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_100MHz) | ||
467 | #define V_BCM1480_MC_REF_RATE_200MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_200MHz) | ||
468 | #define V_BCM1480_MC_REF_RATE_400MHz V_BCM1480_MC_REF_RATE(K_BCM1480_MC_REF_RATE_400MHz) | ||
469 | #define V_BCM1480_MC_REF_RATE_DEFAULT V_BCM1480_MC_REF_RATE_400MHz | ||
470 | |||
471 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
472 | #define M_BCM1480_MC_AUTO_REF_DIS _SB_MAKEMASK1(16) | ||
473 | #endif | ||
474 | |||
475 | /* | ||
476 | * ODT Register (Table 99) | ||
477 | */ | ||
478 | |||
479 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
480 | #define M_BCM1480_MC_RD_ODT0_CS0 _SB_MAKEMASK1(0) | ||
481 | #define M_BCM1480_MC_RD_ODT0_CS2 _SB_MAKEMASK1(1) | ||
482 | #define M_BCM1480_MC_RD_ODT0_CS4 _SB_MAKEMASK1(2) | ||
483 | #define M_BCM1480_MC_RD_ODT0_CS6 _SB_MAKEMASK1(3) | ||
484 | #define M_BCM1480_MC_WR_ODT0_CS0 _SB_MAKEMASK1(4) | ||
485 | #define M_BCM1480_MC_WR_ODT0_CS2 _SB_MAKEMASK1(5) | ||
486 | #define M_BCM1480_MC_WR_ODT0_CS4 _SB_MAKEMASK1(6) | ||
487 | #define M_BCM1480_MC_WR_ODT0_CS6 _SB_MAKEMASK1(7) | ||
488 | #define M_BCM1480_MC_RD_ODT2_CS0 _SB_MAKEMASK1(8) | ||
489 | #define M_BCM1480_MC_RD_ODT2_CS2 _SB_MAKEMASK1(9) | ||
490 | #define M_BCM1480_MC_RD_ODT2_CS4 _SB_MAKEMASK1(10) | ||
491 | #define M_BCM1480_MC_RD_ODT2_CS6 _SB_MAKEMASK1(11) | ||
492 | #define M_BCM1480_MC_WR_ODT2_CS0 _SB_MAKEMASK1(12) | ||
493 | #define M_BCM1480_MC_WR_ODT2_CS2 _SB_MAKEMASK1(13) | ||
494 | #define M_BCM1480_MC_WR_ODT2_CS4 _SB_MAKEMASK1(14) | ||
495 | #define M_BCM1480_MC_WR_ODT2_CS6 _SB_MAKEMASK1(15) | ||
496 | #define M_BCM1480_MC_RD_ODT4_CS0 _SB_MAKEMASK1(16) | ||
497 | #define M_BCM1480_MC_RD_ODT4_CS2 _SB_MAKEMASK1(17) | ||
498 | #define M_BCM1480_MC_RD_ODT4_CS4 _SB_MAKEMASK1(18) | ||
499 | #define M_BCM1480_MC_RD_ODT4_CS6 _SB_MAKEMASK1(19) | ||
500 | #define M_BCM1480_MC_WR_ODT4_CS0 _SB_MAKEMASK1(20) | ||
501 | #define M_BCM1480_MC_WR_ODT4_CS2 _SB_MAKEMASK1(21) | ||
502 | #define M_BCM1480_MC_WR_ODT4_CS4 _SB_MAKEMASK1(22) | ||
503 | #define M_BCM1480_MC_WR_ODT4_CS6 _SB_MAKEMASK1(23) | ||
504 | #define M_BCM1480_MC_RD_ODT6_CS0 _SB_MAKEMASK1(24) | ||
505 | #define M_BCM1480_MC_RD_ODT6_CS2 _SB_MAKEMASK1(25) | ||
506 | #define M_BCM1480_MC_RD_ODT6_CS4 _SB_MAKEMASK1(26) | ||
507 | #define M_BCM1480_MC_RD_ODT6_CS6 _SB_MAKEMASK1(27) | ||
508 | #define M_BCM1480_MC_WR_ODT6_CS0 _SB_MAKEMASK1(28) | ||
509 | #define M_BCM1480_MC_WR_ODT6_CS2 _SB_MAKEMASK1(29) | ||
510 | #define M_BCM1480_MC_WR_ODT6_CS4 _SB_MAKEMASK1(30) | ||
511 | #define M_BCM1480_MC_WR_ODT6_CS6 _SB_MAKEMASK1(31) | ||
512 | |||
513 | #define M_BCM1480_MC_CS_ODD_ODT_EN _SB_MAKEMASK1(32) | ||
514 | #endif | ||
515 | |||
516 | /* | ||
517 | * Memory DLL Configuration Register (Table 93) | ||
518 | */ | ||
519 | |||
520 | #define S_BCM1480_MC_ADDR_COARSE_ADJ 0 | ||
521 | #define M_BCM1480_MC_ADDR_COARSE_ADJ _SB_MAKEMASK(6,S_BCM1480_MC_ADDR_COARSE_ADJ) | ||
522 | #define V_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ADDR_COARSE_ADJ) | ||
523 | #define G_BCM1480_MC_ADDR_COARSE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_ADDR_COARSE_ADJ,M_BCM1480_MC_ADDR_COARSE_ADJ) | ||
524 | #define V_BCM1480_MC_ADDR_COARSE_ADJ_DEFAULT V_BCM1480_MC_ADDR_COARSE_ADJ(0x0) | ||
525 | |||
526 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
527 | #define S_BCM1480_MC_ADDR_FREQ_RANGE 8 | ||
528 | #define M_BCM1480_MC_ADDR_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_ADDR_FREQ_RANGE) | ||
529 | #define V_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ADDR_FREQ_RANGE) | ||
530 | #define G_BCM1480_MC_ADDR_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_ADDR_FREQ_RANGE,M_BCM1480_MC_ADDR_FREQ_RANGE) | ||
531 | #define V_BCM1480_MC_ADDR_FREQ_RANGE_DEFAULT V_BCM1480_MC_ADDR_FREQ_RANGE(0x4) | ||
532 | #endif | ||
533 | |||
534 | #define S_BCM1480_MC_ADDR_FINE_ADJ 8 | ||
535 | #define M_BCM1480_MC_ADDR_FINE_ADJ _SB_MAKEMASK(4,S_BCM1480_MC_ADDR_FINE_ADJ) | ||
536 | #define V_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ADDR_FINE_ADJ) | ||
537 | #define G_BCM1480_MC_ADDR_FINE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_ADDR_FINE_ADJ,M_BCM1480_MC_ADDR_FINE_ADJ) | ||
538 | #define V_BCM1480_MC_ADDR_FINE_ADJ_DEFAULT V_BCM1480_MC_ADDR_FINE_ADJ(0x8) | ||
539 | |||
540 | #define S_BCM1480_MC_DQI_COARSE_ADJ 16 | ||
541 | #define M_BCM1480_MC_DQI_COARSE_ADJ _SB_MAKEMASK(6,S_BCM1480_MC_DQI_COARSE_ADJ) | ||
542 | #define V_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQI_COARSE_ADJ) | ||
543 | #define G_BCM1480_MC_DQI_COARSE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQI_COARSE_ADJ,M_BCM1480_MC_DQI_COARSE_ADJ) | ||
544 | #define V_BCM1480_MC_DQI_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQI_COARSE_ADJ(0x0) | ||
545 | |||
546 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
547 | #define S_BCM1480_MC_DQI_FREQ_RANGE 24 | ||
548 | #define M_BCM1480_MC_DQI_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_DQI_FREQ_RANGE) | ||
549 | #define V_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQI_FREQ_RANGE) | ||
550 | #define G_BCM1480_MC_DQI_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_DQI_FREQ_RANGE,M_BCM1480_MC_DQI_FREQ_RANGE) | ||
551 | #define V_BCM1480_MC_DQI_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQI_FREQ_RANGE(0x4) | ||
552 | #endif | ||
553 | |||
554 | #define S_BCM1480_MC_DQI_FINE_ADJ 24 | ||
555 | #define M_BCM1480_MC_DQI_FINE_ADJ _SB_MAKEMASK(4,S_BCM1480_MC_DQI_FINE_ADJ) | ||
556 | #define V_BCM1480_MC_DQI_FINE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQI_FINE_ADJ) | ||
557 | #define G_BCM1480_MC_DQI_FINE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQI_FINE_ADJ,M_BCM1480_MC_DQI_FINE_ADJ) | ||
558 | #define V_BCM1480_MC_DQI_FINE_ADJ_DEFAULT V_BCM1480_MC_DQI_FINE_ADJ(0x8) | ||
559 | |||
560 | #define S_BCM1480_MC_DQO_COARSE_ADJ 32 | ||
561 | #define M_BCM1480_MC_DQO_COARSE_ADJ _SB_MAKEMASK(6,S_BCM1480_MC_DQO_COARSE_ADJ) | ||
562 | #define V_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQO_COARSE_ADJ) | ||
563 | #define G_BCM1480_MC_DQO_COARSE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQO_COARSE_ADJ,M_BCM1480_MC_DQO_COARSE_ADJ) | ||
564 | #define V_BCM1480_MC_DQO_COARSE_ADJ_DEFAULT V_BCM1480_MC_DQO_COARSE_ADJ(0x0) | ||
565 | |||
566 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
567 | #define S_BCM1480_MC_DQO_FREQ_RANGE 40 | ||
568 | #define M_BCM1480_MC_DQO_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_DQO_FREQ_RANGE) | ||
569 | #define V_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQO_FREQ_RANGE) | ||
570 | #define G_BCM1480_MC_DQO_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_DQO_FREQ_RANGE,M_BCM1480_MC_DQO_FREQ_RANGE) | ||
571 | #define V_BCM1480_MC_DQO_FREQ_RANGE_DEFAULT V_BCM1480_MC_DQO_FREQ_RANGE(0x4) | ||
572 | #endif | ||
573 | |||
574 | #define S_BCM1480_MC_DQO_FINE_ADJ 40 | ||
575 | #define M_BCM1480_MC_DQO_FINE_ADJ _SB_MAKEMASK(4,S_BCM1480_MC_DQO_FINE_ADJ) | ||
576 | #define V_BCM1480_MC_DQO_FINE_ADJ(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DQO_FINE_ADJ) | ||
577 | #define G_BCM1480_MC_DQO_FINE_ADJ(x) _SB_GETVALUE(x,S_BCM1480_MC_DQO_FINE_ADJ,M_BCM1480_MC_DQO_FINE_ADJ) | ||
578 | #define V_BCM1480_MC_DQO_FINE_ADJ_DEFAULT V_BCM1480_MC_DQO_FINE_ADJ(0x8) | ||
579 | |||
580 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
581 | #define S_BCM1480_MC_DLL_PDSEL 44 | ||
582 | #define M_BCM1480_MC_DLL_PDSEL _SB_MAKEMASK(2,S_BCM1480_MC_DLL_PDSEL) | ||
583 | #define V_BCM1480_MC_DLL_PDSEL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_PDSEL) | ||
584 | #define G_BCM1480_MC_DLL_PDSEL(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_PDSEL,M_BCM1480_MC_DLL_PDSEL) | ||
585 | #define V_BCM1480_MC_DLL_DEFAULT_PDSEL V_BCM1480_MC_DLL_PDSEL(0x0) | ||
586 | |||
587 | #define M_BCM1480_MC_DLL_REGBYPASS _SB_MAKEMASK1(46) | ||
588 | #define M_BCM1480_MC_DQO_SHIFT _SB_MAKEMASK1(47) | ||
589 | #endif | ||
590 | |||
591 | #define S_BCM1480_MC_DLL_DEFAULT 48 | ||
592 | #define M_BCM1480_MC_DLL_DEFAULT _SB_MAKEMASK(6,S_BCM1480_MC_DLL_DEFAULT) | ||
593 | #define V_BCM1480_MC_DLL_DEFAULT(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_DEFAULT) | ||
594 | #define G_BCM1480_MC_DLL_DEFAULT(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_DEFAULT,M_BCM1480_MC_DLL_DEFAULT) | ||
595 | #define V_BCM1480_MC_DLL_DEFAULT_DEFAULT V_BCM1480_MC_DLL_DEFAULT(0x10) | ||
596 | |||
597 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
598 | #define S_BCM1480_MC_DLL_REGCTRL 54 | ||
599 | #define M_BCM1480_MC_DLL_REGCTRL _SB_MAKEMASK(2,S_BCM1480_MC_DLL_REGCTRL) | ||
600 | #define V_BCM1480_MC_DLL_REGCTRL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_REGCTRL) | ||
601 | #define G_BCM1480_MC_DLL_REGCTRL(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_REGCTRL,M_BCM1480_MC_DLL_REGCTRL) | ||
602 | #define V_BCM1480_MC_DLL_DEFAULT_REGCTRL V_BCM1480_MC_DLL_REGCTRL(0x0) | ||
603 | #endif | ||
604 | |||
605 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
606 | #define S_BCM1480_MC_DLL_FREQ_RANGE 56 | ||
607 | #define M_BCM1480_MC_DLL_FREQ_RANGE _SB_MAKEMASK(4,S_BCM1480_MC_DLL_FREQ_RANGE) | ||
608 | #define V_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_FREQ_RANGE) | ||
609 | #define G_BCM1480_MC_DLL_FREQ_RANGE(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_FREQ_RANGE,M_BCM1480_MC_DLL_FREQ_RANGE) | ||
610 | #define V_BCM1480_MC_DLL_FREQ_RANGE_DEFAULT V_BCM1480_MC_DLL_FREQ_RANGE(0x4) | ||
611 | #endif | ||
612 | |||
613 | #define S_BCM1480_MC_DLL_STEP_SIZE 56 | ||
614 | #define M_BCM1480_MC_DLL_STEP_SIZE _SB_MAKEMASK(4,S_BCM1480_MC_DLL_STEP_SIZE) | ||
615 | #define V_BCM1480_MC_DLL_STEP_SIZE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_STEP_SIZE) | ||
616 | #define G_BCM1480_MC_DLL_STEP_SIZE(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_STEP_SIZE,M_BCM1480_MC_DLL_STEP_SIZE) | ||
617 | #define V_BCM1480_MC_DLL_STEP_SIZE_DEFAULT V_BCM1480_MC_DLL_STEP_SIZE(0x8) | ||
618 | |||
619 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
620 | #define S_BCM1480_MC_DLL_BGCTRL 60 | ||
621 | #define M_BCM1480_MC_DLL_BGCTRL _SB_MAKEMASK(2,S_BCM1480_MC_DLL_BGCTRL) | ||
622 | #define V_BCM1480_MC_DLL_BGCTRL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_DLL_BGCTRL) | ||
623 | #define G_BCM1480_MC_DLL_BGCTRL(x) _SB_GETVALUE(x,S_BCM1480_MC_DLL_BGCTRL,M_BCM1480_MC_DLL_BGCTRL) | ||
624 | #define V_BCM1480_MC_DLL_DEFAULT_BGCTRL V_BCM1480_MC_DLL_BGCTRL(0x0) | ||
625 | #endif | ||
626 | |||
627 | #define M_BCM1480_MC_DLL_BYPASS _SB_MAKEMASK1(63) | ||
628 | |||
629 | /* | ||
630 | * Memory Drive Configuration Register (Table 94) | ||
631 | */ | ||
632 | |||
633 | #define S_BCM1480_MC_RTT_BYP_PULLDOWN 0 | ||
634 | #define M_BCM1480_MC_RTT_BYP_PULLDOWN _SB_MAKEMASK(3,S_BCM1480_MC_RTT_BYP_PULLDOWN) | ||
635 | #define V_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_MAKEVALUE(x,S_BCM1480_MC_RTT_BYP_PULLDOWN) | ||
636 | #define G_BCM1480_MC_RTT_BYP_PULLDOWN(x) _SB_GETVALUE(x,S_BCM1480_MC_RTT_BYP_PULLDOWN,M_BCM1480_MC_RTT_BYP_PULLDOWN) | ||
637 | |||
638 | #define S_BCM1480_MC_RTT_BYP_PULLUP 6 | ||
639 | #define M_BCM1480_MC_RTT_BYP_PULLUP _SB_MAKEMASK(3,S_BCM1480_MC_RTT_BYP_PULLUP) | ||
640 | #define V_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_RTT_BYP_PULLUP) | ||
641 | #define G_BCM1480_MC_RTT_BYP_PULLUP(x) _SB_GETVALUE(x,S_BCM1480_MC_RTT_BYP_PULLUP,M_BCM1480_MC_RTT_BYP_PULLUP) | ||
642 | |||
643 | #define M_BCM1480_MC_RTT_BYPASS _SB_MAKEMASK1(8) | ||
644 | #define M_BCM1480_MC_RTT_COMP_MOV_AVG _SB_MAKEMASK1(9) | ||
645 | |||
646 | #define S_BCM1480_MC_PVT_BYP_C1_PULLDOWN 10 | ||
647 | #define M_BCM1480_MC_PVT_BYP_C1_PULLDOWN _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C1_PULLDOWN) | ||
648 | #define V_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLDOWN) | ||
649 | #define G_BCM1480_MC_PVT_BYP_C1_PULLDOWN(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLDOWN,M_BCM1480_MC_PVT_BYP_C1_PULLDOWN) | ||
650 | |||
651 | #define S_BCM1480_MC_PVT_BYP_C1_PULLUP 15 | ||
652 | #define M_BCM1480_MC_PVT_BYP_C1_PULLUP _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C1_PULLUP) | ||
653 | #define V_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLUP) | ||
654 | #define G_BCM1480_MC_PVT_BYP_C1_PULLUP(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C1_PULLUP,M_BCM1480_MC_PVT_BYP_C1_PULLUP) | ||
655 | |||
656 | #define S_BCM1480_MC_PVT_BYP_C2_PULLDOWN 20 | ||
657 | #define M_BCM1480_MC_PVT_BYP_C2_PULLDOWN _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C2_PULLDOWN) | ||
658 | #define V_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLDOWN) | ||
659 | #define G_BCM1480_MC_PVT_BYP_C2_PULLDOWN(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLDOWN,M_BCM1480_MC_PVT_BYP_C2_PULLDOWN) | ||
660 | |||
661 | #define S_BCM1480_MC_PVT_BYP_C2_PULLUP 25 | ||
662 | #define M_BCM1480_MC_PVT_BYP_C2_PULLUP _SB_MAKEMASK(4,S_BCM1480_MC_PVT_BYP_C2_PULLUP) | ||
663 | #define V_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLUP) | ||
664 | #define G_BCM1480_MC_PVT_BYP_C2_PULLUP(x) _SB_GETVALUE(x,S_BCM1480_MC_PVT_BYP_C2_PULLUP,M_BCM1480_MC_PVT_BYP_C2_PULLUP) | ||
665 | |||
666 | #define M_BCM1480_MC_PVT_BYPASS _SB_MAKEMASK1(30) | ||
667 | #define M_BCM1480_MC_PVT_COMP_MOV_AVG _SB_MAKEMASK1(31) | ||
668 | |||
669 | #define M_BCM1480_MC_CLK_CLASS _SB_MAKEMASK1(34) | ||
670 | #define M_BCM1480_MC_DATA_CLASS _SB_MAKEMASK1(35) | ||
671 | #define M_BCM1480_MC_ADDR_CLASS _SB_MAKEMASK1(36) | ||
672 | |||
673 | #define M_BCM1480_MC_DQ_ODT_75 _SB_MAKEMASK1(37) | ||
674 | #define M_BCM1480_MC_DQ_ODT_150 _SB_MAKEMASK1(38) | ||
675 | #define M_BCM1480_MC_DQS_ODT_75 _SB_MAKEMASK1(39) | ||
676 | #define M_BCM1480_MC_DQS_ODT_150 _SB_MAKEMASK1(40) | ||
677 | #define M_BCM1480_MC_DQS_DIFF _SB_MAKEMASK1(41) | ||
678 | |||
679 | /* | ||
680 | * ECC Test Data Register (Table 95) | ||
681 | */ | ||
682 | |||
683 | #define S_BCM1480_MC_DATA_INVERT 0 | ||
684 | #define M_DATA_ECC_INVERT _SB_MAKEMASK(64,S_BCM1480_MC_ECC_INVERT) | ||
685 | |||
686 | /* | ||
687 | * ECC Test ECC Register (Table 96) | ||
688 | */ | ||
689 | |||
690 | #define S_BCM1480_MC_ECC_INVERT 0 | ||
691 | #define M_BCM1480_MC_ECC_INVERT _SB_MAKEMASK(8,S_BCM1480_MC_ECC_INVERT) | ||
692 | |||
693 | /* | ||
694 | * SDRAM Timing Register (Table 97) | ||
695 | */ | ||
696 | |||
697 | #define S_BCM1480_MC_tRCD 0 | ||
698 | #define M_BCM1480_MC_tRCD _SB_MAKEMASK(4,S_BCM1480_MC_tRCD) | ||
699 | #define V_BCM1480_MC_tRCD(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRCD) | ||
700 | #define G_BCM1480_MC_tRCD(x) _SB_GETVALUE(x,S_BCM1480_MC_tRCD,M_BCM1480_MC_tRCD) | ||
701 | #define K_BCM1480_MC_tRCD_DEFAULT 3 | ||
702 | #define V_BCM1480_MC_tRCD_DEFAULT V_BCM1480_MC_tRCD(K_BCM1480_MC_tRCD_DEFAULT) | ||
703 | |||
704 | #define S_BCM1480_MC_tCL 4 | ||
705 | #define M_BCM1480_MC_tCL _SB_MAKEMASK(4,S_BCM1480_MC_tCL) | ||
706 | #define V_BCM1480_MC_tCL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tCL) | ||
707 | #define G_BCM1480_MC_tCL(x) _SB_GETVALUE(x,S_BCM1480_MC_tCL,M_BCM1480_MC_tCL) | ||
708 | #define K_BCM1480_MC_tCL_DEFAULT 2 | ||
709 | #define V_BCM1480_MC_tCL_DEFAULT V_BCM1480_MC_tCL(K_BCM1480_MC_tCL_DEFAULT) | ||
710 | |||
711 | #define M_BCM1480_MC_tCrDh _SB_MAKEMASK1(8) | ||
712 | |||
713 | #define S_BCM1480_MC_tWR 9 | ||
714 | #define M_BCM1480_MC_tWR _SB_MAKEMASK(3,S_BCM1480_MC_tWR) | ||
715 | #define V_BCM1480_MC_tWR(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tWR) | ||
716 | #define G_BCM1480_MC_tWR(x) _SB_GETVALUE(x,S_BCM1480_MC_tWR,M_BCM1480_MC_tWR) | ||
717 | #define K_BCM1480_MC_tWR_DEFAULT 2 | ||
718 | #define V_BCM1480_MC_tWR_DEFAULT V_BCM1480_MC_tWR(K_BCM1480_MC_tWR_DEFAULT) | ||
719 | |||
720 | #define S_BCM1480_MC_tCwD 12 | ||
721 | #define M_BCM1480_MC_tCwD _SB_MAKEMASK(4,S_BCM1480_MC_tCwD) | ||
722 | #define V_BCM1480_MC_tCwD(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tCwD) | ||
723 | #define G_BCM1480_MC_tCwD(x) _SB_GETVALUE(x,S_BCM1480_MC_tCwD,M_BCM1480_MC_tCwD) | ||
724 | #define K_BCM1480_MC_tCwD_DEFAULT 1 | ||
725 | #define V_BCM1480_MC_tCwD_DEFAULT V_BCM1480_MC_tCwD(K_BCM1480_MC_tCwD_DEFAULT) | ||
726 | |||
727 | #define S_BCM1480_MC_tRP 16 | ||
728 | #define M_BCM1480_MC_tRP _SB_MAKEMASK(4,S_BCM1480_MC_tRP) | ||
729 | #define V_BCM1480_MC_tRP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRP) | ||
730 | #define G_BCM1480_MC_tRP(x) _SB_GETVALUE(x,S_BCM1480_MC_tRP,M_BCM1480_MC_tRP) | ||
731 | #define K_BCM1480_MC_tRP_DEFAULT 4 | ||
732 | #define V_BCM1480_MC_tRP_DEFAULT V_BCM1480_MC_tRP(K_BCM1480_MC_tRP_DEFAULT) | ||
733 | |||
734 | #define S_BCM1480_MC_tRRD 20 | ||
735 | #define M_BCM1480_MC_tRRD _SB_MAKEMASK(4,S_BCM1480_MC_tRRD) | ||
736 | #define V_BCM1480_MC_tRRD(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRRD) | ||
737 | #define G_BCM1480_MC_tRRD(x) _SB_GETVALUE(x,S_BCM1480_MC_tRRD,M_BCM1480_MC_tRRD) | ||
738 | #define K_BCM1480_MC_tRRD_DEFAULT 2 | ||
739 | #define V_BCM1480_MC_tRRD_DEFAULT V_BCM1480_MC_tRRD(K_BCM1480_MC_tRRD_DEFAULT) | ||
740 | |||
741 | #define S_BCM1480_MC_tRCw 24 | ||
742 | #define M_BCM1480_MC_tRCw _SB_MAKEMASK(5,S_BCM1480_MC_tRCw) | ||
743 | #define V_BCM1480_MC_tRCw(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRCw) | ||
744 | #define G_BCM1480_MC_tRCw(x) _SB_GETVALUE(x,S_BCM1480_MC_tRCw,M_BCM1480_MC_tRCw) | ||
745 | #define K_BCM1480_MC_tRCw_DEFAULT 10 | ||
746 | #define V_BCM1480_MC_tRCw_DEFAULT V_BCM1480_MC_tRCw(K_BCM1480_MC_tRCw_DEFAULT) | ||
747 | |||
748 | #define S_BCM1480_MC_tRCr 32 | ||
749 | #define M_BCM1480_MC_tRCr _SB_MAKEMASK(5,S_BCM1480_MC_tRCr) | ||
750 | #define V_BCM1480_MC_tRCr(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRCr) | ||
751 | #define G_BCM1480_MC_tRCr(x) _SB_GETVALUE(x,S_BCM1480_MC_tRCr,M_BCM1480_MC_tRCr) | ||
752 | #define K_BCM1480_MC_tRCr_DEFAULT 9 | ||
753 | #define V_BCM1480_MC_tRCr_DEFAULT V_BCM1480_MC_tRCr(K_BCM1480_MC_tRCr_DEFAULT) | ||
754 | |||
755 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
756 | #define S_BCM1480_MC_tFAW 40 | ||
757 | #define M_BCM1480_MC_tFAW _SB_MAKEMASK(6,S_BCM1480_MC_tFAW) | ||
758 | #define V_BCM1480_MC_tFAW(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tFAW) | ||
759 | #define G_BCM1480_MC_tFAW(x) _SB_GETVALUE(x,S_BCM1480_MC_tFAW,M_BCM1480_MC_tFAW) | ||
760 | #define K_BCM1480_MC_tFAW_DEFAULT 0 | ||
761 | #define V_BCM1480_MC_tFAW_DEFAULT V_BCM1480_MC_tFAW(K_BCM1480_MC_tFAW_DEFAULT) | ||
762 | #endif | ||
763 | |||
764 | #define S_BCM1480_MC_tRFC 48 | ||
765 | #define M_BCM1480_MC_tRFC _SB_MAKEMASK(7,S_BCM1480_MC_tRFC) | ||
766 | #define V_BCM1480_MC_tRFC(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRFC) | ||
767 | #define G_BCM1480_MC_tRFC(x) _SB_GETVALUE(x,S_BCM1480_MC_tRFC,M_BCM1480_MC_tRFC) | ||
768 | #define K_BCM1480_MC_tRFC_DEFAULT 12 | ||
769 | #define V_BCM1480_MC_tRFC_DEFAULT V_BCM1480_MC_tRFC(K_BCM1480_MC_tRFC_DEFAULT) | ||
770 | |||
771 | #define S_BCM1480_MC_tFIFO 56 | ||
772 | #define M_BCM1480_MC_tFIFO _SB_MAKEMASK(2,S_BCM1480_MC_tFIFO) | ||
773 | #define V_BCM1480_MC_tFIFO(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tFIFO) | ||
774 | #define G_BCM1480_MC_tFIFO(x) _SB_GETVALUE(x,S_BCM1480_MC_tFIFO,M_BCM1480_MC_tFIFO) | ||
775 | #define K_BCM1480_MC_tFIFO_DEFAULT 0 | ||
776 | #define V_BCM1480_MC_tFIFO_DEFAULT V_BCM1480_MC_tFIFO(K_BCM1480_MC_tFIFO_DEFAULT) | ||
777 | |||
778 | #define S_BCM1480_MC_tW2R 58 | ||
779 | #define M_BCM1480_MC_tW2R _SB_MAKEMASK(2,S_BCM1480_MC_tW2R) | ||
780 | #define V_BCM1480_MC_tW2R(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tW2R) | ||
781 | #define G_BCM1480_MC_tW2R(x) _SB_GETVALUE(x,S_BCM1480_MC_tW2R,M_BCM1480_MC_tW2R) | ||
782 | #define K_BCM1480_MC_tW2R_DEFAULT 1 | ||
783 | #define V_BCM1480_MC_tW2R_DEFAULT V_BCM1480_MC_tW2R(K_BCM1480_MC_tW2R_DEFAULT) | ||
784 | |||
785 | #define S_BCM1480_MC_tR2W 60 | ||
786 | #define M_BCM1480_MC_tR2W _SB_MAKEMASK(2,S_BCM1480_MC_tR2W) | ||
787 | #define V_BCM1480_MC_tR2W(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tR2W) | ||
788 | #define G_BCM1480_MC_tR2W(x) _SB_GETVALUE(x,S_BCM1480_MC_tR2W,M_BCM1480_MC_tR2W) | ||
789 | #define K_BCM1480_MC_tR2W_DEFAULT 0 | ||
790 | #define V_BCM1480_MC_tR2W_DEFAULT V_BCM1480_MC_tR2W(K_BCM1480_MC_tR2W_DEFAULT) | ||
791 | |||
792 | #define M_BCM1480_MC_tR2R _SB_MAKEMASK1(62) | ||
793 | |||
794 | #define V_BCM1480_MC_TIMING_DEFAULT (M_BCM1480_MC_tR2R | \ | ||
795 | V_BCM1480_MC_tFIFO_DEFAULT | \ | ||
796 | V_BCM1480_MC_tR2W_DEFAULT | \ | ||
797 | V_BCM1480_MC_tW2R_DEFAULT | \ | ||
798 | V_BCM1480_MC_tRFC_DEFAULT | \ | ||
799 | V_BCM1480_MC_tRCr_DEFAULT | \ | ||
800 | V_BCM1480_MC_tRCw_DEFAULT | \ | ||
801 | V_BCM1480_MC_tRRD_DEFAULT | \ | ||
802 | V_BCM1480_MC_tRP_DEFAULT | \ | ||
803 | V_BCM1480_MC_tCwD_DEFAULT | \ | ||
804 | V_BCM1480_MC_tWR_DEFAULT | \ | ||
805 | M_BCM1480_MC_tCrDh | \ | ||
806 | V_BCM1480_MC_tCL_DEFAULT | \ | ||
807 | V_BCM1480_MC_tRCD_DEFAULT) | ||
808 | |||
809 | /* | ||
810 | * SDRAM Timing Register 2 | ||
811 | */ | ||
812 | |||
813 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
814 | |||
815 | #define S_BCM1480_MC_tAL 0 | ||
816 | #define M_BCM1480_MC_tAL _SB_MAKEMASK(4,S_BCM1480_MC_tAL) | ||
817 | #define V_BCM1480_MC_tAL(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tAL) | ||
818 | #define G_BCM1480_MC_tAL(x) _SB_GETVALUE(x,S_BCM1480_MC_tAL,M_BCM1480_MC_tAL) | ||
819 | #define K_BCM1480_MC_tAL_DEFAULT 0 | ||
820 | #define V_BCM1480_MC_tAL_DEFAULT V_BCM1480_MC_tAL(K_BCM1480_MC_tAL_DEFAULT) | ||
821 | |||
822 | #define S_BCM1480_MC_tRTP 4 | ||
823 | #define M_BCM1480_MC_tRTP _SB_MAKEMASK(3,S_BCM1480_MC_tRTP) | ||
824 | #define V_BCM1480_MC_tRTP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRTP) | ||
825 | #define G_BCM1480_MC_tRTP(x) _SB_GETVALUE(x,S_BCM1480_MC_tRTP,M_BCM1480_MC_tRTP) | ||
826 | #define K_BCM1480_MC_tRTP_DEFAULT 2 | ||
827 | #define V_BCM1480_MC_tRTP_DEFAULT V_BCM1480_MC_tRTP(K_BCM1480_MC_tRTP_DEFAULT) | ||
828 | |||
829 | #define S_BCM1480_MC_tW2W 8 | ||
830 | #define M_BCM1480_MC_tW2W _SB_MAKEMASK(2,S_BCM1480_MC_tW2W) | ||
831 | #define V_BCM1480_MC_tW2W(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tW2W) | ||
832 | #define G_BCM1480_MC_tW2W(x) _SB_GETVALUE(x,S_BCM1480_MC_tW2W,M_BCM1480_MC_tW2W) | ||
833 | #define K_BCM1480_MC_tW2W_DEFAULT 0 | ||
834 | #define V_BCM1480_MC_tW2W_DEFAULT V_BCM1480_MC_tW2W(K_BCM1480_MC_tW2W_DEFAULT) | ||
835 | |||
836 | #define S_BCM1480_MC_tRAP 12 | ||
837 | #define M_BCM1480_MC_tRAP _SB_MAKEMASK(4,S_BCM1480_MC_tRAP) | ||
838 | #define V_BCM1480_MC_tRAP(x) _SB_MAKEVALUE(x,S_BCM1480_MC_tRAP) | ||
839 | #define G_BCM1480_MC_tRAP(x) _SB_GETVALUE(x,S_BCM1480_MC_tRAP,M_BCM1480_MC_tRAP) | ||
840 | #define K_BCM1480_MC_tRAP_DEFAULT 0 | ||
841 | #define V_BCM1480_MC_tRAP_DEFAULT V_BCM1480_MC_tRAP(K_BCM1480_MC_tRAP_DEFAULT) | ||
842 | |||
843 | #endif | ||
844 | |||
845 | |||
846 | |||
847 | /* | ||
848 | * Global Registers: single instances per BCM1480 | ||
849 | */ | ||
850 | |||
851 | /* | ||
852 | * Global Configuration Register (Table 99) | ||
853 | */ | ||
854 | |||
855 | #define S_BCM1480_MC_BLK_SET_MARK 8 | ||
856 | #define M_BCM1480_MC_BLK_SET_MARK _SB_MAKEMASK(4,S_BCM1480_MC_BLK_SET_MARK) | ||
857 | #define V_BCM1480_MC_BLK_SET_MARK(x) _SB_MAKEVALUE(x,S_BCM1480_MC_BLK_SET_MARK) | ||
858 | #define G_BCM1480_MC_BLK_SET_MARK(x) _SB_GETVALUE(x,S_BCM1480_MC_BLK_SET_MARK,M_BCM1480_MC_BLK_SET_MARK) | ||
859 | |||
860 | #define S_BCM1480_MC_BLK_CLR_MARK 12 | ||
861 | #define M_BCM1480_MC_BLK_CLR_MARK _SB_MAKEMASK(4,S_BCM1480_MC_BLK_CLR_MARK) | ||
862 | #define V_BCM1480_MC_BLK_CLR_MARK(x) _SB_MAKEVALUE(x,S_BCM1480_MC_BLK_CLR_MARK) | ||
863 | #define G_BCM1480_MC_BLK_CLR_MARK(x) _SB_GETVALUE(x,S_BCM1480_MC_BLK_CLR_MARK,M_BCM1480_MC_BLK_CLR_MARK) | ||
864 | |||
865 | #define M_BCM1480_MC_PKT_PRIORITY _SB_MAKEMASK1(16) | ||
866 | |||
867 | #define S_BCM1480_MC_MAX_AGE 20 | ||
868 | #define M_BCM1480_MC_MAX_AGE _SB_MAKEMASK(4,S_BCM1480_MC_MAX_AGE) | ||
869 | #define V_BCM1480_MC_MAX_AGE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_MAX_AGE) | ||
870 | #define G_BCM1480_MC_MAX_AGE(x) _SB_GETVALUE(x,S_BCM1480_MC_MAX_AGE,M_BCM1480_MC_MAX_AGE) | ||
871 | |||
872 | #define M_BCM1480_MC_BERR_DISABLE _SB_MAKEMASK1(29) | ||
873 | #define M_BCM1480_MC_FORCE_SEQ _SB_MAKEMASK1(30) | ||
874 | #define M_BCM1480_MC_VGEN _SB_MAKEMASK1(32) | ||
875 | |||
876 | #define S_BCM1480_MC_SLEW 33 | ||
877 | #define M_BCM1480_MC_SLEW _SB_MAKEMASK(2,S_BCM1480_MC_SLEW) | ||
878 | #define V_BCM1480_MC_SLEW(x) _SB_MAKEVALUE(x,S_BCM1480_MC_SLEW) | ||
879 | #define G_BCM1480_MC_SLEW(x) _SB_GETVALUE(x,S_BCM1480_MC_SLEW,M_BCM1480_MC_SLEW) | ||
880 | |||
881 | #define M_BCM1480_MC_SSTL_VOLTAGE _SB_MAKEMASK1(35) | ||
882 | |||
883 | /* | ||
884 | * Global Channel Interleave Register (Table 100) | ||
885 | */ | ||
886 | |||
887 | #define S_BCM1480_MC_INTLV0 0 | ||
888 | #define M_BCM1480_MC_INTLV0 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV0) | ||
889 | #define V_BCM1480_MC_INTLV0(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV0) | ||
890 | #define G_BCM1480_MC_INTLV0(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV0,M_BCM1480_MC_INTLV0) | ||
891 | |||
892 | #define S_BCM1480_MC_INTLV1 8 | ||
893 | #define M_BCM1480_MC_INTLV1 _SB_MAKEMASK(6,S_BCM1480_MC_INTLV1) | ||
894 | #define V_BCM1480_MC_INTLV1(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV1) | ||
895 | #define G_BCM1480_MC_INTLV1(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV1,M_BCM1480_MC_INTLV1) | ||
896 | |||
897 | #define S_BCM1480_MC_INTLV_MODE 16 | ||
898 | #define M_BCM1480_MC_INTLV_MODE _SB_MAKEMASK(3,S_BCM1480_MC_INTLV_MODE) | ||
899 | #define V_BCM1480_MC_INTLV_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_MC_INTLV_MODE) | ||
900 | #define G_BCM1480_MC_INTLV_MODE(x) _SB_GETVALUE(x,S_BCM1480_MC_INTLV_MODE,M_BCM1480_MC_INTLV_MODE) | ||
901 | |||
902 | #define K_BCM1480_MC_INTLV_MODE_NONE 0x0 | ||
903 | #define K_BCM1480_MC_INTLV_MODE_01 0x1 | ||
904 | #define K_BCM1480_MC_INTLV_MODE_23 0x2 | ||
905 | #define K_BCM1480_MC_INTLV_MODE_01_23 0x3 | ||
906 | #define K_BCM1480_MC_INTLV_MODE_0123 0x4 | ||
907 | |||
908 | #define V_BCM1480_MC_INTLV_MODE_NONE V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_NONE) | ||
909 | #define V_BCM1480_MC_INTLV_MODE_01 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01) | ||
910 | #define V_BCM1480_MC_INTLV_MODE_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_23) | ||
911 | #define V_BCM1480_MC_INTLV_MODE_01_23 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_01_23) | ||
912 | #define V_BCM1480_MC_INTLV_MODE_0123 V_BCM1480_MC_INTLV_MODE(K_BCM1480_MC_INTLV_MODE_0123) | ||
913 | |||
914 | /* | ||
915 | * ECC Status Register | ||
916 | */ | ||
917 | |||
918 | #define S_BCM1480_MC_ECC_ERR_ADDR 0 | ||
919 | #define M_BCM1480_MC_ECC_ERR_ADDR _SB_MAKEMASK(37,S_BCM1480_MC_ECC_ERR_ADDR) | ||
920 | #define V_BCM1480_MC_ECC_ERR_ADDR(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ECC_ERR_ADDR) | ||
921 | #define G_BCM1480_MC_ECC_ERR_ADDR(x) _SB_GETVALUE(x,S_BCM1480_MC_ECC_ERR_ADDR,M_BCM1480_MC_ECC_ERR_ADDR) | ||
922 | |||
923 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
924 | #define M_BCM1480_MC_ECC_ERR_RMW _SB_MAKEMASK1(60) | ||
925 | #endif | ||
926 | |||
927 | #define M_BCM1480_MC_ECC_MULT_ERR_DET _SB_MAKEMASK1(61) | ||
928 | #define M_BCM1480_MC_ECC_UERR_DET _SB_MAKEMASK1(62) | ||
929 | #define M_BCM1480_MC_ECC_CERR_DET _SB_MAKEMASK1(63) | ||
930 | |||
931 | /* | ||
932 | * Global ECC Address Register (Table 102) | ||
933 | */ | ||
934 | |||
935 | #define S_BCM1480_MC_ECC_CORR_ADDR 0 | ||
936 | #define M_BCM1480_MC_ECC_CORR_ADDR _SB_MAKEMASK(37,S_BCM1480_MC_ECC_CORR_ADDR) | ||
937 | #define V_BCM1480_MC_ECC_CORR_ADDR(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ECC_CORR_ADDR) | ||
938 | #define G_BCM1480_MC_ECC_CORR_ADDR(x) _SB_GETVALUE(x,S_BCM1480_MC_ECC_CORR_ADDR,M_BCM1480_MC_ECC_CORR_ADDR) | ||
939 | |||
940 | /* | ||
941 | * Global ECC Correction Register (Table 103) | ||
942 | */ | ||
943 | |||
944 | #define S_BCM1480_MC_ECC_CORRECT 0 | ||
945 | #define M_BCM1480_MC_ECC_CORRECT _SB_MAKEMASK(64,S_BCM1480_MC_ECC_CORRECT) | ||
946 | #define V_BCM1480_MC_ECC_CORRECT(x) _SB_MAKEVALUE(x,S_BCM1480_MC_ECC_CORRECT) | ||
947 | #define G_BCM1480_MC_ECC_CORRECT(x) _SB_GETVALUE(x,S_BCM1480_MC_ECC_CORRECT,M_BCM1480_MC_ECC_CORRECT) | ||
948 | |||
949 | /* | ||
950 | * Global ECC Performance Counters Control Register (Table 104) | ||
951 | */ | ||
952 | |||
953 | #define S_BCM1480_MC_CHANNEL_SELECT 0 | ||
954 | #define M_BCM1480_MC_CHANNEL_SELECT _SB_MAKEMASK(4,S_BCM1480_MC_CHANNEL_SELECT) | ||
955 | #define V_BCM1480_MC_CHANNEL_SELECT(x) _SB_MAKEVALUE(x,S_BCM1480_MC_CHANNEL_SELECT) | ||
956 | #define G_BCM1480_MC_CHANNEL_SELECT(x) _SB_GETVALUE(x,S_BCM1480_MC_CHANNEL_SELECT,M_BCM1480_MC_CHANNEL_SELECT) | ||
957 | #define K_BCM1480_MC_CHANNEL_SELECT_0 0x1 | ||
958 | #define K_BCM1480_MC_CHANNEL_SELECT_1 0x2 | ||
959 | #define K_BCM1480_MC_CHANNEL_SELECT_2 0x4 | ||
960 | #define K_BCM1480_MC_CHANNEL_SELECT_3 0x8 | ||
961 | |||
962 | #endif /* _BCM1480_MC_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h new file mode 100644 index 000000000000..c2dd2fe3047c --- /dev/null +++ b/include/asm-mips/sibyte/bcm1480_regs.h | |||
@@ -0,0 +1,869 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1255/BCM1280/BCM1455/BCM1480 Board Support Package | ||
3 | * | ||
4 | * Register Definitions File: bcm1480_regs.h | ||
5 | * | ||
6 | * This module contains the addresses of the on-chip peripherals | ||
7 | * on the BCM1280 and BCM1480. | ||
8 | * | ||
9 | * BCM1480 specification level: 1X55_1X80-UM100-D4 (11/24/03) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | #ifndef _BCM1480_REGS_H | ||
33 | #define _BCM1480_REGS_H | ||
34 | |||
35 | #include "sb1250_defs.h" | ||
36 | |||
37 | /* ********************************************************************* | ||
38 | * Pull in the BCM1250's registers since a great deal of the 1480's | ||
39 | * functions are the same as the BCM1250. | ||
40 | ********************************************************************* */ | ||
41 | |||
42 | #include "sb1250_regs.h" | ||
43 | |||
44 | |||
45 | /* ********************************************************************* | ||
46 | * Some general notes: | ||
47 | * | ||
48 | * Register addresses are grouped by function and follow the order | ||
49 | * of the User Manual. | ||
50 | * | ||
51 | * For the most part, when there is more than one peripheral | ||
52 | * of the same type on the SOC, the constants below will be | ||
53 | * offsets from the base of each peripheral. For example, | ||
54 | * the MAC registers are described as offsets from the first | ||
55 | * MAC register, and there will be a MAC_REGISTER() macro | ||
56 | * to calculate the base address of a given MAC. | ||
57 | * | ||
58 | * The information in this file is based on the BCM1X55/BCM1X80 | ||
59 | * User Manual, Document 1X55_1X80-UM100-R, 22/12/03. | ||
60 | * | ||
61 | * This file is basically a "what's new" header file. Since the | ||
62 | * BCM1250 and the new BCM1480 (and derivatives) share many common | ||
63 | * features, this file contains only what's new or changed from | ||
64 | * the 1250. (above, you can see that we include the 1250 symbols | ||
65 | * to get the base functionality). | ||
66 | * | ||
67 | * In software, be sure to use the correct symbols, particularly | ||
68 | * for blocks that are different between the two chip families. | ||
69 | * All BCM1480-specific symbols have _BCM1480_ in their names, | ||
70 | * and all BCM1250-specific and "base" functions that are common in | ||
71 | * both chips have no special names (this is for compatibility with | ||
72 | * older include files). Therefore, if you're working with the | ||
73 | * SCD, which is very different on each chip, A_SCD_xxx implies | ||
74 | * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480 | ||
75 | * version. | ||
76 | ********************************************************************* */ | ||
77 | |||
78 | |||
79 | /* ********************************************************************* | ||
80 | * Memory Controller Registers (Section 6) | ||
81 | ********************************************************************* */ | ||
82 | |||
83 | #define A_BCM1480_MC_BASE_0 0x0010050000 | ||
84 | #define A_BCM1480_MC_BASE_1 0x0010051000 | ||
85 | #define A_BCM1480_MC_BASE_2 0x0010052000 | ||
86 | #define A_BCM1480_MC_BASE_3 0x0010053000 | ||
87 | #define BCM1480_MC_REGISTER_SPACING 0x1000 | ||
88 | |||
89 | #define A_BCM1480_MC_BASE(ctlid) (A_BCM1480_MC_BASE_0+(ctlid)*BCM1480_MC_REGISTER_SPACING) | ||
90 | #define A_BCM1480_MC_REGISTER(ctlid,reg) (A_BCM1480_MC_BASE(ctlid)+(reg)) | ||
91 | |||
92 | #define R_BCM1480_MC_CONFIG 0x0000000100 | ||
93 | #define R_BCM1480_MC_CS_START 0x0000000120 | ||
94 | #define R_BCM1480_MC_CS_END 0x0000000140 | ||
95 | #define S_BCM1480_MC_CS_STARTEND 24 | ||
96 | |||
97 | #define R_BCM1480_MC_CS01_ROW0 0x0000000180 | ||
98 | #define R_BCM1480_MC_CS01_ROW1 0x00000001A0 | ||
99 | #define R_BCM1480_MC_CS23_ROW0 0x0000000200 | ||
100 | #define R_BCM1480_MC_CS23_ROW1 0x0000000220 | ||
101 | #define R_BCM1480_MC_CS01_COL0 0x0000000280 | ||
102 | #define R_BCM1480_MC_CS01_COL1 0x00000002A0 | ||
103 | #define R_BCM1480_MC_CS23_COL0 0x0000000300 | ||
104 | #define R_BCM1480_MC_CS23_COL1 0x0000000320 | ||
105 | |||
106 | #define R_BCM1480_MC_CSX_BASE 0x0000000180 | ||
107 | #define R_BCM1480_MC_CSX_ROW0 0x0000000000 /* relative to CSX_BASE */ | ||
108 | #define R_BCM1480_MC_CSX_ROW1 0x0000000020 /* relative to CSX_BASE */ | ||
109 | #define R_BCM1480_MC_CSX_COL0 0x0000000100 /* relative to CSX_BASE */ | ||
110 | #define R_BCM1480_MC_CSX_COL1 0x0000000120 /* relative to CSX_BASE */ | ||
111 | #define BCM1480_MC_CSX_SPACING 0x0000000080 /* CS23 relative to CS01 */ | ||
112 | |||
113 | #define R_BCM1480_MC_CS01_BA 0x0000000380 | ||
114 | #define R_BCM1480_MC_CS23_BA 0x00000003A0 | ||
115 | #define R_BCM1480_MC_DRAMCMD 0x0000000400 | ||
116 | #define R_BCM1480_MC_DRAMMODE 0x0000000420 | ||
117 | #define R_BCM1480_MC_CLOCK_CFG 0x0000000440 | ||
118 | #define R_BCM1480_MC_MCLK_CFG R_BCM1480_MC_CLOCK_CFG | ||
119 | #define R_BCM1480_MC_TEST_DATA 0x0000000480 | ||
120 | #define R_BCM1480_MC_TEST_ECC 0x00000004A0 | ||
121 | #define R_BCM1480_MC_TIMING1 0x00000004C0 | ||
122 | #define R_BCM1480_MC_TIMING2 0x00000004E0 | ||
123 | #define R_BCM1480_MC_DLL_CFG 0x0000000500 | ||
124 | #define R_BCM1480_MC_DRIVE_CFG 0x0000000520 | ||
125 | |||
126 | #if SIBYTE_HDR_FEATURE(1480, PASS2) | ||
127 | #define R_BCM1480_MC_ODT 0x0000000460 | ||
128 | #define R_BCM1480_MC_ECC_STATUS 0x0000000540 | ||
129 | #endif | ||
130 | |||
131 | /* Global registers (single instance) */ | ||
132 | #define A_BCM1480_MC_GLB_CONFIG 0x0010054100 | ||
133 | #define A_BCM1480_MC_GLB_INTLV 0x0010054120 | ||
134 | #define A_BCM1480_MC_GLB_ECC_STATUS 0x0010054140 | ||
135 | #define A_BCM1480_MC_GLB_ECC_ADDR 0x0010054160 | ||
136 | #define A_BCM1480_MC_GLB_ECC_CORRECT 0x0010054180 | ||
137 | #define A_BCM1480_MC_GLB_PERF_CNT_CONTROL 0x00100541A0 | ||
138 | |||
139 | /* ********************************************************************* | ||
140 | * L2 Cache Control Registers (Section 5) | ||
141 | ********************************************************************* */ | ||
142 | |||
143 | #define A_BCM1480_L2_BASE 0x0010040000 | ||
144 | |||
145 | #define A_BCM1480_L2_READ_TAG 0x0010040018 | ||
146 | #define A_BCM1480_L2_ECC_TAG 0x0010040038 | ||
147 | #define A_BCM1480_L2_MISC0_VALUE 0x0010040058 | ||
148 | #define A_BCM1480_L2_MISC1_VALUE 0x0010040078 | ||
149 | #define A_BCM1480_L2_MISC2_VALUE 0x0010040098 | ||
150 | #define A_BCM1480_L2_MISC_CONFIG 0x0010040040 /* x040 */ | ||
151 | #define A_BCM1480_L2_CACHE_DISABLE 0x0010040060 /* x060 */ | ||
152 | #define A_BCM1480_L2_MAKECACHEDISABLE(x) (A_BCM1480_L2_CACHE_DISABLE | (((x)&0xF) << 12)) | ||
153 | #define A_BCM1480_L2_WAY_ENABLE_3_0 0x0010040080 /* x080 */ | ||
154 | #define A_BCM1480_L2_WAY_ENABLE_7_4 0x00100400A0 /* x0A0 */ | ||
155 | #define A_BCM1480_L2_MAKE_WAY_ENABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((x)&0xF) << 12)) | ||
156 | #define A_BCM1480_L2_MAKE_WAY_ENABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((x)&0xF) << 12)) | ||
157 | #define A_BCM1480_L2_MAKE_WAY_DISABLE_LO(x) (A_BCM1480_L2_WAY_ENABLE_3_0 | (((~x)&0xF) << 12)) | ||
158 | #define A_BCM1480_L2_MAKE_WAY_DISABLE_HI(x) (A_BCM1480_L2_WAY_ENABLE_7_4 | (((~x)&0xF) << 12)) | ||
159 | #define A_BCM1480_L2_WAY_LOCAL_3_0 0x0010040100 /* x100 */ | ||
160 | #define A_BCM1480_L2_WAY_LOCAL_7_4 0x0010040120 /* x120 */ | ||
161 | #define A_BCM1480_L2_WAY_REMOTE_3_0 0x0010040140 /* x140 */ | ||
162 | #define A_BCM1480_L2_WAY_REMOTE_7_4 0x0010040160 /* x160 */ | ||
163 | #define A_BCM1480_L2_WAY_AGENT_3_0 0x00100400C0 /* xxC0 */ | ||
164 | #define A_BCM1480_L2_WAY_AGENT_7_4 0x00100400E0 /* xxE0 */ | ||
165 | #define A_BCM1480_L2_WAY_ENABLE(A, banks) (A | (((~(banks))&0x0F) << 8)) | ||
166 | #define A_BCM1480_L2_BANK_BASE 0x00D0300000 | ||
167 | #define A_BCM1480_L2_BANK_ADDRESS(b) (A_BCM1480_L2_BANK_BASE | (((b)&0x7)<<17)) | ||
168 | #define A_BCM1480_L2_MGMT_TAG_BASE 0x00D0000000 | ||
169 | |||
170 | |||
171 | /* ********************************************************************* | ||
172 | * PCI-X Interface Registers (Section 7) | ||
173 | ********************************************************************* */ | ||
174 | |||
175 | #define A_BCM1480_PCI_BASE 0x0010061400 | ||
176 | |||
177 | #define A_BCM1480_PCI_RESET 0x0010061400 | ||
178 | #define A_BCM1480_PCI_DLL 0x0010061500 | ||
179 | |||
180 | #define A_BCM1480_PCI_TYPE00_HEADER 0x002E000000 | ||
181 | |||
182 | /* ********************************************************************* | ||
183 | * Ethernet MAC Registers (Section 11) and DMA Registers (Section 10.6) | ||
184 | ********************************************************************* */ | ||
185 | |||
186 | /* No register changes with Rev.C BCM1250, but one additional MAC */ | ||
187 | |||
188 | #define A_BCM1480_MAC_BASE_2 0x0010066000 | ||
189 | |||
190 | #ifndef A_MAC_BASE_2 | ||
191 | #define A_MAC_BASE_2 A_BCM1480_MAC_BASE_2 | ||
192 | #endif | ||
193 | |||
194 | #define A_BCM1480_MAC_BASE_3 0x0010067000 | ||
195 | #define A_MAC_BASE_3 A_BCM1480_MAC_BASE_3 | ||
196 | |||
197 | #define R_BCM1480_MAC_DMA_OODPKTLOST 0x00000038 | ||
198 | |||
199 | #ifndef R_MAC_DMA_OODPKTLOST | ||
200 | #define R_MAC_DMA_OODPKTLOST R_BCM1480_MAC_DMA_OODPKTLOST | ||
201 | #endif | ||
202 | |||
203 | |||
204 | /* ********************************************************************* | ||
205 | * DUART Registers (Section 14) | ||
206 | ********************************************************************* */ | ||
207 | |||
208 | /* No significant differences from BCM1250, two DUARTs */ | ||
209 | |||
210 | /* Conventions, per user manual: | ||
211 | * DUART generic, channels A,B,C,D | ||
212 | * DUART0 implementing channels A,B | ||
213 | * DUART1 inplementing channels C,D | ||
214 | */ | ||
215 | |||
216 | #define BCM1480_DUART_NUM_PORTS 4 | ||
217 | |||
218 | #define A_BCM1480_DUART0 0x0010060000 | ||
219 | #define A_BCM1480_DUART1 0x0010060400 | ||
220 | #define A_BCM1480_DUART(chan) ((((chan)&2) == 0)? A_BCM1480_DUART0 : A_BCM1480_DUART1) | ||
221 | |||
222 | #define BCM1480_DUART_CHANREG_SPACING 0x100 | ||
223 | #define A_BCM1480_DUART_CHANREG(chan,reg) (A_BCM1480_DUART(chan) \ | ||
224 | + BCM1480_DUART_CHANREG_SPACING*((chan)&1) \ | ||
225 | + (reg)) | ||
226 | #define R_BCM1480_DUART_CHANREG(chan,reg) (BCM1480_DUART_CHANREG_SPACING*((chan)&1) + (reg)) | ||
227 | |||
228 | #define R_BCM1480_DUART_IMRREG(chan) (R_DUART_IMR_A + ((chan)&1)*DUART_IMRISR_SPACING) | ||
229 | #define R_BCM1480_DUART_ISRREG(chan) (R_DUART_ISR_A + ((chan)&1)*DUART_IMRISR_SPACING) | ||
230 | |||
231 | #define A_BCM1480_DUART_IMRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_IMRREG(chan)) | ||
232 | #define A_BCM1480_DUART_ISRREG(chan) (A_BCM1480_DUART(chan) + R_BCM1480_DUART_ISRREG(chan)) | ||
233 | |||
234 | /* | ||
235 | * These constants are the absolute addresses. | ||
236 | */ | ||
237 | |||
238 | #define A_BCM1480_DUART_MODE_REG_1_C 0x0010060400 | ||
239 | #define A_BCM1480_DUART_MODE_REG_2_C 0x0010060410 | ||
240 | #define A_BCM1480_DUART_STATUS_C 0x0010060420 | ||
241 | #define A_BCM1480_DUART_CLK_SEL_C 0x0010060430 | ||
242 | #define A_BCM1480_DUART_FULL_CTL_C 0x0010060440 | ||
243 | #define A_BCM1480_DUART_CMD_C 0x0010060450 | ||
244 | #define A_BCM1480_DUART_RX_HOLD_C 0x0010060460 | ||
245 | #define A_BCM1480_DUART_TX_HOLD_C 0x0010060470 | ||
246 | #define A_BCM1480_DUART_OPCR_C 0x0010060480 | ||
247 | #define A_BCM1480_DUART_AUX_CTRL_C 0x0010060490 | ||
248 | |||
249 | #define A_BCM1480_DUART_MODE_REG_1_D 0x0010060500 | ||
250 | #define A_BCM1480_DUART_MODE_REG_2_D 0x0010060510 | ||
251 | #define A_BCM1480_DUART_STATUS_D 0x0010060520 | ||
252 | #define A_BCM1480_DUART_CLK_SEL_D 0x0010060530 | ||
253 | #define A_BCM1480_DUART_FULL_CTL_D 0x0010060540 | ||
254 | #define A_BCM1480_DUART_CMD_D 0x0010060550 | ||
255 | #define A_BCM1480_DUART_RX_HOLD_D 0x0010060560 | ||
256 | #define A_BCM1480_DUART_TX_HOLD_D 0x0010060570 | ||
257 | #define A_BCM1480_DUART_OPCR_D 0x0010060580 | ||
258 | #define A_BCM1480_DUART_AUX_CTRL_D 0x0010060590 | ||
259 | |||
260 | #define A_BCM1480_DUART_INPORT_CHNG_CD 0x0010060600 | ||
261 | #define A_BCM1480_DUART_AUX_CTRL_CD 0x0010060610 | ||
262 | #define A_BCM1480_DUART_ISR_C 0x0010060620 | ||
263 | #define A_BCM1480_DUART_IMR_C 0x0010060630 | ||
264 | #define A_BCM1480_DUART_ISR_D 0x0010060640 | ||
265 | #define A_BCM1480_DUART_IMR_D 0x0010060650 | ||
266 | #define A_BCM1480_DUART_OUT_PORT_CD 0x0010060660 | ||
267 | #define A_BCM1480_DUART_OPCR_CD 0x0010060670 | ||
268 | #define A_BCM1480_DUART_IN_PORT_CD 0x0010060680 | ||
269 | #define A_BCM1480_DUART_ISR_CD 0x0010060690 | ||
270 | #define A_BCM1480_DUART_IMR_CD 0x00100606A0 | ||
271 | #define A_BCM1480_DUART_SET_OPR_CD 0x00100606B0 | ||
272 | #define A_BCM1480_DUART_CLEAR_OPR_CD 0x00100606C0 | ||
273 | #define A_BCM1480_DUART_INPORT_CHNG_C 0x00100606D0 | ||
274 | #define A_BCM1480_DUART_INPORT_CHNG_D 0x00100606E0 | ||
275 | |||
276 | |||
277 | /* ********************************************************************* | ||
278 | * Generic Bus Registers (Section 15) and PCMCIA Registers (Section 16) | ||
279 | ********************************************************************* */ | ||
280 | |||
281 | #define A_BCM1480_IO_PCMCIA_CFG_B 0x0010061A58 | ||
282 | #define A_BCM1480_IO_PCMCIA_STATUS_B 0x0010061A68 | ||
283 | |||
284 | /* ********************************************************************* | ||
285 | * GPIO Registers (Section 17) | ||
286 | ********************************************************************* */ | ||
287 | |||
288 | /* One additional GPIO register, placed _before_ the BCM1250's GPIO block base */ | ||
289 | |||
290 | #define A_BCM1480_GPIO_INT_ADD_TYPE 0x0010061A78 | ||
291 | #define R_BCM1480_GPIO_INT_ADD_TYPE (-8) | ||
292 | |||
293 | #define A_GPIO_INT_ADD_TYPE A_BCM1480_GPIO_INT_ADD_TYPE | ||
294 | #define R_GPIO_INT_ADD_TYPE R_BCM1480_GPIO_INT_ADD_TYPE | ||
295 | |||
296 | /* ********************************************************************* | ||
297 | * SMBus Registers (Section 18) | ||
298 | ********************************************************************* */ | ||
299 | |||
300 | /* No changes from BCM1250 */ | ||
301 | |||
302 | /* ********************************************************************* | ||
303 | * Timer Registers (Sections 4.6) | ||
304 | ********************************************************************* */ | ||
305 | |||
306 | /* BCM1480 has two additional watchdogs */ | ||
307 | |||
308 | /* Watchdog timers */ | ||
309 | |||
310 | #define A_BCM1480_SCD_WDOG_2 0x0010022050 | ||
311 | #define A_BCM1480_SCD_WDOG_3 0x0010022150 | ||
312 | |||
313 | #define BCM1480_SCD_NUM_WDOGS 4 | ||
314 | |||
315 | #define A_BCM1480_SCD_WDOG_BASE(w) (A_BCM1480_SCD_WDOG_0+((w)&2)*0x1000 + ((w)&1)*0x100) | ||
316 | #define A_BCM1480_SCD_WDOG_REGISTER(w,r) (A_BCM1480_SCD_WDOG_BASE(w) + (r)) | ||
317 | |||
318 | #define A_BCM1480_SCD_WDOG_INIT_2 0x0010022050 | ||
319 | #define A_BCM1480_SCD_WDOG_CNT_2 0x0010022058 | ||
320 | #define A_BCM1480_SCD_WDOG_CFG_2 0x0010022060 | ||
321 | |||
322 | #define A_BCM1480_SCD_WDOG_INIT_3 0x0010022150 | ||
323 | #define A_BCM1480_SCD_WDOG_CNT_3 0x0010022158 | ||
324 | #define A_BCM1480_SCD_WDOG_CFG_3 0x0010022160 | ||
325 | |||
326 | /* BCM1480 has two additional compare registers */ | ||
327 | |||
328 | #define A_BCM1480_SCD_ZBBUS_CYCLE_COUNT A_SCD_ZBBUS_CYCLE_COUNT | ||
329 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP_BASE 0x0010020C00 | ||
330 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP0 A_SCD_ZBBUS_CYCLE_CP0 | ||
331 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP1 A_SCD_ZBBUS_CYCLE_CP1 | ||
332 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP2 0x0010020C10 | ||
333 | #define A_BCM1480_SCD_ZBBUS_CYCLE_CP3 0x0010020C18 | ||
334 | |||
335 | /* ********************************************************************* | ||
336 | * System Control Registers (Section 4.2) | ||
337 | ********************************************************************* */ | ||
338 | |||
339 | /* Scratch register in different place */ | ||
340 | |||
341 | #define A_BCM1480_SCD_SCRATCH 0x100200A0 | ||
342 | |||
343 | /* ********************************************************************* | ||
344 | * System Address Trap Registers (Section 4.9) | ||
345 | ********************************************************************* */ | ||
346 | |||
347 | /* No changes from BCM1250 */ | ||
348 | |||
349 | /* ********************************************************************* | ||
350 | * System Interrupt Mapper Registers (Sections 4.3-4.5) | ||
351 | ********************************************************************* */ | ||
352 | |||
353 | #define A_BCM1480_IMR_CPU0_BASE 0x0010020000 | ||
354 | #define A_BCM1480_IMR_CPU1_BASE 0x0010022000 | ||
355 | #define A_BCM1480_IMR_CPU2_BASE 0x0010024000 | ||
356 | #define A_BCM1480_IMR_CPU3_BASE 0x0010026000 | ||
357 | #define BCM1480_IMR_REGISTER_SPACING 0x2000 | ||
358 | #define BCM1480_IMR_REGISTER_SPACING_SHIFT 13 | ||
359 | |||
360 | #define A_BCM1480_IMR_MAPPER(cpu) (A_BCM1480_IMR_CPU0_BASE+(cpu)*BCM1480_IMR_REGISTER_SPACING) | ||
361 | #define A_BCM1480_IMR_REGISTER(cpu,reg) (A_BCM1480_IMR_MAPPER(cpu)+(reg)) | ||
362 | |||
363 | /* Most IMR registers are 128 bits, implemented as non-contiguous | ||
364 | 64-bit registers high (_H) and low (_L) */ | ||
365 | #define BCM1480_IMR_HL_SPACING 0x1000 | ||
366 | |||
367 | #define R_BCM1480_IMR_INTERRUPT_DIAG_H 0x0010 | ||
368 | #define R_BCM1480_IMR_LDT_INTERRUPT_H 0x0018 | ||
369 | #define R_BCM1480_IMR_LDT_INTERRUPT_CLR_H 0x0020 | ||
370 | #define R_BCM1480_IMR_INTERRUPT_MASK_H 0x0028 | ||
371 | #define R_BCM1480_IMR_INTERRUPT_TRACE_H 0x0038 | ||
372 | #define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_H 0x0040 | ||
373 | #define R_BCM1480_IMR_LDT_INTERRUPT_SET 0x0048 | ||
374 | #define R_BCM1480_IMR_MAILBOX_0_CPU 0x00C0 | ||
375 | #define R_BCM1480_IMR_MAILBOX_0_SET_CPU 0x00C8 | ||
376 | #define R_BCM1480_IMR_MAILBOX_0_CLR_CPU 0x00D0 | ||
377 | #define R_BCM1480_IMR_MAILBOX_1_CPU 0x00E0 | ||
378 | #define R_BCM1480_IMR_MAILBOX_1_SET_CPU 0x00E8 | ||
379 | #define R_BCM1480_IMR_MAILBOX_1_CLR_CPU 0x00F0 | ||
380 | #define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_H 0x0100 | ||
381 | #define BCM1480_IMR_INTERRUPT_STATUS_COUNT 8 | ||
382 | #define R_BCM1480_IMR_INTERRUPT_MAP_BASE_H 0x0200 | ||
383 | #define BCM1480_IMR_INTERRUPT_MAP_COUNT 64 | ||
384 | |||
385 | #define R_BCM1480_IMR_INTERRUPT_DIAG_L 0x1010 | ||
386 | #define R_BCM1480_IMR_LDT_INTERRUPT_L 0x1018 | ||
387 | #define R_BCM1480_IMR_LDT_INTERRUPT_CLR_L 0x1020 | ||
388 | #define R_BCM1480_IMR_INTERRUPT_MASK_L 0x1028 | ||
389 | #define R_BCM1480_IMR_INTERRUPT_TRACE_L 0x1038 | ||
390 | #define R_BCM1480_IMR_INTERRUPT_SOURCE_STATUS_L 0x1040 | ||
391 | #define R_BCM1480_IMR_INTERRUPT_STATUS_BASE_L 0x1100 | ||
392 | #define R_BCM1480_IMR_INTERRUPT_MAP_BASE_L 0x1200 | ||
393 | |||
394 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE 0x0010028000 | ||
395 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU1_BASE 0x0010028100 | ||
396 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU2_BASE 0x0010028200 | ||
397 | #define A_BCM1480_IMR_ALIAS_MAILBOX_CPU3_BASE 0x0010028300 | ||
398 | #define BCM1480_IMR_ALIAS_MAILBOX_SPACING 0100 | ||
399 | |||
400 | #define A_BCM1480_IMR_ALIAS_MAILBOX(cpu) (A_BCM1480_IMR_ALIAS_MAILBOX_CPU0_BASE + \ | ||
401 | (cpu)*BCM1480_IMR_ALIAS_MAILBOX_SPACING) | ||
402 | #define A_BCM1480_IMR_ALIAS_MAILBOX_REGISTER(cpu,reg) (A_BCM1480_IMR_ALIAS_MAILBOX(cpu)+(reg)) | ||
403 | |||
404 | #define R_BCM1480_IMR_ALIAS_MAILBOX_0 0x0000 /* 0x0x0 */ | ||
405 | #define R_BCM1480_IMR_ALIAS_MAILBOX_0_SET 0x0008 /* 0x0x8 */ | ||
406 | |||
407 | /* ********************************************************************* | ||
408 | * System Performance Counter Registers (Section 4.7) | ||
409 | ********************************************************************* */ | ||
410 | |||
411 | /* BCM1480 has four more performance counter registers, and two control | ||
412 | registers. */ | ||
413 | |||
414 | #define A_BCM1480_SCD_PERF_CNT_BASE 0x00100204C0 | ||
415 | |||
416 | #define A_BCM1480_SCD_PERF_CNT_CFG0 0x00100204C0 | ||
417 | #define A_BCM1480_SCD_PERF_CNT_CFG_0 A_BCM1480_SCD_PERF_CNT_CFG0 | ||
418 | #define A_BCM1480_SCD_PERF_CNT_CFG1 0x00100204C8 | ||
419 | #define A_BCM1480_SCD_PERF_CNT_CFG_1 A_BCM1480_SCD_PERF_CNT_CFG1 | ||
420 | |||
421 | #define A_BCM1480_SCD_PERF_CNT_0 A_SCD_PERF_CNT_0 | ||
422 | #define A_BCM1480_SCD_PERF_CNT_1 A_SCD_PERF_CNT_1 | ||
423 | #define A_BCM1480_SCD_PERF_CNT_2 A_SCD_PERF_CNT_2 | ||
424 | #define A_BCM1480_SCD_PERF_CNT_3 A_SCD_PERF_CNT_3 | ||
425 | |||
426 | #define A_BCM1480_SCD_PERF_CNT_4 0x00100204F0 | ||
427 | #define A_BCM1480_SCD_PERF_CNT_5 0x00100204F8 | ||
428 | #define A_BCM1480_SCD_PERF_CNT_6 0x0010020500 | ||
429 | #define A_BCM1480_SCD_PERF_CNT_7 0x0010020508 | ||
430 | |||
431 | /* ********************************************************************* | ||
432 | * System Bus Watcher Registers (Section 4.8) | ||
433 | ********************************************************************* */ | ||
434 | |||
435 | |||
436 | /* Same as 1250 except BUS_ERR_STATUS_DEBUG is in a different place. */ | ||
437 | |||
438 | #define A_BCM1480_BUS_ERR_STATUS_DEBUG 0x00100208D8 | ||
439 | |||
440 | /* ********************************************************************* | ||
441 | * System Debug Controller Registers (Section 19) | ||
442 | ********************************************************************* */ | ||
443 | |||
444 | /* Same as 1250 */ | ||
445 | |||
446 | /* ********************************************************************* | ||
447 | * System Trace Unit Registers (Sections 4.10) | ||
448 | ********************************************************************* */ | ||
449 | |||
450 | /* Same as 1250 */ | ||
451 | |||
452 | /* ********************************************************************* | ||
453 | * Data Mover DMA Registers (Section 10.7) | ||
454 | ********************************************************************* */ | ||
455 | |||
456 | /* Same as 1250 */ | ||
457 | |||
458 | |||
459 | /* ********************************************************************* | ||
460 | * HyperTransport Interface Registers (Section 8) | ||
461 | ********************************************************************* */ | ||
462 | |||
463 | #define BCM1480_HT_NUM_PORTS 3 | ||
464 | #define BCM1480_HT_PORT_SPACING 0x800 | ||
465 | #define A_BCM1480_HT_PORT_HEADER(x) (A_BCM1480_HT_PORT0_HEADER + ((x)*BCM1480_HT_PORT_SPACING)) | ||
466 | |||
467 | #define A_BCM1480_HT_PORT0_HEADER 0x00FE000000 | ||
468 | #define A_BCM1480_HT_PORT1_HEADER 0x00FE000800 | ||
469 | #define A_BCM1480_HT_PORT2_HEADER 0x00FE001000 | ||
470 | #define A_BCM1480_HT_TYPE00_HEADER 0x00FE002000 | ||
471 | |||
472 | |||
473 | /* ********************************************************************* | ||
474 | * Node Controller Registers (Section 9) | ||
475 | ********************************************************************* */ | ||
476 | |||
477 | #define A_BCM1480_NC_BASE 0x00DFBD0000 | ||
478 | |||
479 | #define A_BCM1480_NC_RLD_FIELD 0x00DFBD0000 | ||
480 | #define A_BCM1480_NC_RLD_TRIGGER 0x00DFBD0020 | ||
481 | #define A_BCM1480_NC_RLD_BAD_ERROR 0x00DFBD0040 | ||
482 | #define A_BCM1480_NC_RLD_COR_ERROR 0x00DFBD0060 | ||
483 | #define A_BCM1480_NC_RLD_ECC_STATUS 0x00DFBD0080 | ||
484 | #define A_BCM1480_NC_RLD_WAY_ENABLE 0x00DFBD00A0 | ||
485 | #define A_BCM1480_NC_RLD_RANDOM_LFSR 0x00DFBD00C0 | ||
486 | |||
487 | #define A_BCM1480_NC_INTERRUPT_STATUS 0x00DFBD00E0 | ||
488 | #define A_BCM1480_NC_INTERRUPT_ENABLE 0x00DFBD0100 | ||
489 | #define A_BCM1480_NC_TIMEOUT_COUNTER 0x00DFBD0120 | ||
490 | #define A_BCM1480_NC_TIMEOUT_COUNTER_SEL 0x00DFBD0140 | ||
491 | |||
492 | #define A_BCM1480_NC_CREDIT_STATUS_REG0 0x00DFBD0200 | ||
493 | #define A_BCM1480_NC_CREDIT_STATUS_REG1 0x00DFBD0220 | ||
494 | #define A_BCM1480_NC_CREDIT_STATUS_REG2 0x00DFBD0240 | ||
495 | #define A_BCM1480_NC_CREDIT_STATUS_REG3 0x00DFBD0260 | ||
496 | #define A_BCM1480_NC_CREDIT_STATUS_REG4 0x00DFBD0280 | ||
497 | #define A_BCM1480_NC_CREDIT_STATUS_REG5 0x00DFBD02A0 | ||
498 | #define A_BCM1480_NC_CREDIT_STATUS_REG6 0x00DFBD02C0 | ||
499 | #define A_BCM1480_NC_CREDIT_STATUS_REG7 0x00DFBD02E0 | ||
500 | #define A_BCM1480_NC_CREDIT_STATUS_REG8 0x00DFBD0300 | ||
501 | #define A_BCM1480_NC_CREDIT_STATUS_REG9 0x00DFBD0320 | ||
502 | #define A_BCM1480_NC_CREDIT_STATUS_REG10 0x00DFBE0000 | ||
503 | #define A_BCM1480_NC_CREDIT_STATUS_REG11 0x00DFBE0020 | ||
504 | #define A_BCM1480_NC_CREDIT_STATUS_REG12 0x00DFBE0040 | ||
505 | |||
506 | #define A_BCM1480_NC_SR_TIMEOUT_COUNTER 0x00DFBE0060 | ||
507 | #define A_BCM1480_NC_SR_TIMEOUT_COUNTER_SEL 0x00DFBE0080 | ||
508 | |||
509 | |||
510 | /* ********************************************************************* | ||
511 | * H&R Block Configuration Registers (Section 12.4) | ||
512 | ********************************************************************* */ | ||
513 | |||
514 | #define A_BCM1480_HR_BASE_0 0x00DF820000 | ||
515 | #define A_BCM1480_HR_BASE_1 0x00DF8A0000 | ||
516 | #define A_BCM1480_HR_BASE_2 0x00DF920000 | ||
517 | #define BCM1480_HR_REGISTER_SPACING 0x80000 | ||
518 | |||
519 | #define A_BCM1480_HR_BASE(idx) (A_BCM1480_HR_BASE_0 + ((idx)*BCM1480_HR_REGISTER_SPACING)) | ||
520 | #define A_BCM1480_HR_REGISTER(idx,reg) (A_BCM1480_HR_BASE(idx) + (reg)) | ||
521 | |||
522 | #define R_BCM1480_HR_CFG 0x0000000000 | ||
523 | |||
524 | #define R_BCM1480_HR_MAPPING 0x0000010010 | ||
525 | |||
526 | #define BCM1480_HR_RULE_SPACING 0x0000000010 | ||
527 | #define BCM1480_HR_NUM_RULES 16 | ||
528 | #define BCM1480_HR_OP_OFFSET 0x0000000100 | ||
529 | #define BCM1480_HR_TYPE_OFFSET 0x0000000108 | ||
530 | #define R_BCM1480_HR_RULE_OP(idx) (BCM1480_HR_OP_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING)) | ||
531 | #define R_BCM1480_HR_RULE_TYPE(idx) (BCM1480_HR_TYPE_OFFSET + ((idx)*BCM1480_HR_RULE_SPACING)) | ||
532 | |||
533 | #define BCM1480_HR_LEAF_SPACING 0x0000000010 | ||
534 | #define BCM1480_HR_NUM_LEAVES 10 | ||
535 | #define BCM1480_HR_LEAF_OFFSET 0x0000000300 | ||
536 | #define R_BCM1480_HR_HA_LEAF0(idx) (BCM1480_HR_LEAF_OFFSET + ((idx)*BCM1480_HR_LEAF_SPACING)) | ||
537 | |||
538 | #define R_BCM1480_HR_EX_LEAF0 0x00000003A0 | ||
539 | |||
540 | #define BCM1480_HR_PATH_SPACING 0x0000000010 | ||
541 | #define BCM1480_HR_NUM_PATHS 16 | ||
542 | #define BCM1480_HR_PATH_OFFSET 0x0000000600 | ||
543 | #define R_BCM1480_HR_PATH(idx) (BCM1480_HR_PATH_OFFSET + ((idx)*BCM1480_HR_PATH_SPACING)) | ||
544 | |||
545 | #define R_BCM1480_HR_PATH_DEFAULT 0x0000000700 | ||
546 | |||
547 | #define BCM1480_HR_ROUTE_SPACING 8 | ||
548 | #define BCM1480_HR_NUM_ROUTES 512 | ||
549 | #define BCM1480_HR_ROUTE_OFFSET 0x0000001000 | ||
550 | #define R_BCM1480_HR_RT_WORD(idx) (BCM1480_HR_ROUTE_OFFSET + ((idx)*BCM1480_HR_ROUTE_SPACING)) | ||
551 | |||
552 | |||
553 | /* checked to here - ehs */ | ||
554 | /* ********************************************************************* | ||
555 | * Packet Manager DMA Registers (Section 12.5) | ||
556 | ********************************************************************* */ | ||
557 | |||
558 | #define A_BCM1480_PM_BASE 0x0010056000 | ||
559 | |||
560 | #define A_BCM1480_PMI_LCL_0 0x0010058000 | ||
561 | #define A_BCM1480_PMO_LCL_0 0x001005C000 | ||
562 | #define A_BCM1480_PMI_OFFSET_0 (A_BCM1480_PMI_LCL_0 - A_BCM1480_PM_BASE) | ||
563 | #define A_BCM1480_PMO_OFFSET_0 (A_BCM1480_PMO_LCL_0 - A_BCM1480_PM_BASE) | ||
564 | |||
565 | #define BCM1480_PM_LCL_REGISTER_SPACING 0x100 | ||
566 | #define BCM1480_PM_NUM_CHANNELS 32 | ||
567 | |||
568 | #define A_BCM1480_PMI_LCL_BASE(idx) (A_BCM1480_PMI_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING)) | ||
569 | #define A_BCM1480_PMI_LCL_REGISTER(idx,reg) (A_BCM1480_PMI_LCL_BASE(idx) + (reg)) | ||
570 | #define A_BCM1480_PMO_LCL_BASE(idx) (A_BCM1480_PMO_LCL_0 + ((idx)*BCM1480_PM_LCL_REGISTER_SPACING)) | ||
571 | #define A_BCM1480_PMO_LCL_REGISTER(idx,reg) (A_BCM1480_PMO_LCL_BASE(idx) + (reg)) | ||
572 | |||
573 | #define BCM1480_PM_INT_PACKING 8 | ||
574 | #define BCM1480_PM_INT_FUNCTION_SPACING 0x40 | ||
575 | #define BCM1480_PM_INT_NUM_FUNCTIONS 3 | ||
576 | |||
577 | /* | ||
578 | * DMA channel registers relative to A_BCM1480_PMI_LCL_BASE(n) and A_BCM1480_PMO_LCL_BASE(n) | ||
579 | */ | ||
580 | |||
581 | #define R_BCM1480_PM_BASE_SIZE 0x0000000000 | ||
582 | #define R_BCM1480_PM_CNT 0x0000000008 | ||
583 | #define R_BCM1480_PM_PFCNT 0x0000000010 | ||
584 | #define R_BCM1480_PM_LAST 0x0000000018 | ||
585 | #define R_BCM1480_PM_PFINDX 0x0000000020 | ||
586 | #define R_BCM1480_PM_INT_WMK 0x0000000028 | ||
587 | #define R_BCM1480_PM_CONFIG0 0x0000000030 | ||
588 | #define R_BCM1480_PM_LOCALDEBUG 0x0000000078 | ||
589 | #define R_BCM1480_PM_CACHEABILITY 0x0000000080 /* PMI only */ | ||
590 | #define R_BCM1480_PM_INT_CNFG 0x0000000088 | ||
591 | #define R_BCM1480_PM_DESC_MERGE_TIMER 0x0000000090 | ||
592 | #define R_BCM1480_PM_LOCALDEBUG_PIB 0x00000000F8 /* PMI only */ | ||
593 | #define R_BCM1480_PM_LOCALDEBUG_POB 0x00000000F8 /* PMO only */ | ||
594 | |||
595 | /* | ||
596 | * Global Registers (Not Channelized) | ||
597 | */ | ||
598 | |||
599 | #define A_BCM1480_PMI_GLB_0 0x0010056000 | ||
600 | #define A_BCM1480_PMO_GLB_0 0x0010057000 | ||
601 | |||
602 | /* | ||
603 | * PM to TX Mapping Register relative to A_BCM1480_PMI_GLB_0 and A_BCM1480_PMO_GLB_0 | ||
604 | */ | ||
605 | |||
606 | #define R_BCM1480_PM_PMO_MAPPING 0x00000008C8 /* PMO only */ | ||
607 | |||
608 | #define A_BCM1480_PM_PMO_MAPPING (A_BCM1480_PMO_GLB_0 + R_BCM1480_PM_PMO_MAPPING) | ||
609 | |||
610 | /* | ||
611 | * Interrupt mapping registers | ||
612 | */ | ||
613 | |||
614 | |||
615 | #define A_BCM1480_PMI_INT_0 0x0010056800 | ||
616 | #define A_BCM1480_PMI_INT(q) (A_BCM1480_PMI_INT_0 + ((q>>8)<<8)) | ||
617 | #define A_BCM1480_PMI_INT_OFFSET_0 (A_BCM1480_PMI_INT_0 - A_BCM1480_PM_BASE) | ||
618 | #define A_BCM1480_PMO_INT_0 0x0010057800 | ||
619 | #define A_BCM1480_PMO_INT(q) (A_BCM1480_PMO_INT_0 + ((q>>8)<<8)) | ||
620 | #define A_BCM1480_PMO_INT_OFFSET_0 (A_BCM1480_PMO_INT_0 - A_BCM1480_PM_BASE) | ||
621 | |||
622 | /* | ||
623 | * Interrupt registers relative to A_BCM1480_PMI_INT_0 and A_BCM1480_PMO_INT_0 | ||
624 | */ | ||
625 | |||
626 | #define R_BCM1480_PM_INT_ST 0x0000000000 | ||
627 | #define R_BCM1480_PM_INT_MSK 0x0000000040 | ||
628 | #define R_BCM1480_PM_INT_CLR 0x0000000080 | ||
629 | #define R_BCM1480_PM_MRGD_INT 0x00000000C0 | ||
630 | |||
631 | /* | ||
632 | * Debug registers (global) | ||
633 | */ | ||
634 | |||
635 | #define A_BCM1480_PM_GLOBALDEBUGMODE_PMI 0x0010056000 | ||
636 | #define A_BCM1480_PM_GLOBALDEBUG_PID 0x00100567F8 | ||
637 | #define A_BCM1480_PM_GLOBALDEBUG_PIB 0x0010056FF8 | ||
638 | #define A_BCM1480_PM_GLOBALDEBUGMODE_PMO 0x0010057000 | ||
639 | #define A_BCM1480_PM_GLOBALDEBUG_POD 0x00100577F8 | ||
640 | #define A_BCM1480_PM_GLOBALDEBUG_POB 0x0010057FF8 | ||
641 | |||
642 | /* ********************************************************************* | ||
643 | * Switch performance counters | ||
644 | ********************************************************************* */ | ||
645 | |||
646 | #define A_BCM1480_SWPERF_CFG 0xdfb91800 | ||
647 | #define A_BCM1480_SWPERF_CNT0 0xdfb91880 | ||
648 | #define A_BCM1480_SWPERF_CNT1 0xdfb91888 | ||
649 | #define A_BCM1480_SWPERF_CNT2 0xdfb91890 | ||
650 | #define A_BCM1480_SWPERF_CNT3 0xdfb91898 | ||
651 | |||
652 | |||
653 | /* ********************************************************************* | ||
654 | * Switch Trace Unit | ||
655 | ********************************************************************* */ | ||
656 | |||
657 | #define A_BCM1480_SWTRC_MATCH_CONTROL_0 0xDFB91000 | ||
658 | #define A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 0xDFB91100 | ||
659 | #define A_BCM1480_SWTRC_MATCH_DATA_MASK_0 0xDFB91108 | ||
660 | #define A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 0xDFB91200 | ||
661 | #define A_BCM1480_SWTRC_MATCH_TAG_MAKS_0 0xDFB91208 | ||
662 | #define A_BCM1480_SWTRC_EVENT_0 0xDFB91300 | ||
663 | #define A_BCM1480_SWTRC_SEQUENCE_0 0xDFB91400 | ||
664 | |||
665 | #define A_BCM1480_SWTRC_CFG 0xDFB91500 | ||
666 | #define A_BCM1480_SWTRC_READ 0xDFB91508 | ||
667 | |||
668 | #define A_BCM1480_SWDEBUG_SCHEDSTOP 0xDFB92000 | ||
669 | |||
670 | #define A_BCM1480_SWTRC_MATCH_CONTROL(x) (A_BCM1480_SWTRC_MATCH_CONTROL_0 + ((x)*8)) | ||
671 | #define A_BCM1480_SWTRC_EVENT(x) (A_BCM1480_SWTRC_EVENT_0 + ((x)*8)) | ||
672 | #define A_BCM1480_SWTRC_SEQUENCE(x) (A_BCM1480_SWTRC_SEQUENCE_0 + ((x)*8)) | ||
673 | |||
674 | #define A_BCM1480_SWTRC_MATCH_DATA_VALUE(x) (A_BCM1480_SWTRC_MATCH_DATA_VALUE_0 + ((x)*16)) | ||
675 | #define A_BCM1480_SWTRC_MATCH_DATA_MASK(x) (A_BCM1480_SWTRC_MATCH_DATA_MASK_0 + ((x)*16)) | ||
676 | #define A_BCM1480_SWTRC_MATCH_TAG_VALUE(x) (A_BCM1480_SWTRC_MATCH_TAG_VALUE_0 + ((x)*16)) | ||
677 | #define A_BCM1480_SWTRC_MATCH_TAG_MASK(x) (A_BCM1480_SWTRC_MATCH_TAG_MASK_0 + ((x)*16)) | ||
678 | |||
679 | |||
680 | |||
681 | /* ********************************************************************* | ||
682 | * High-Speed Port Registers (Section 13) | ||
683 | ********************************************************************* */ | ||
684 | |||
685 | #define A_BCM1480_HSP_BASE_0 0x00DF810000 | ||
686 | #define A_BCM1480_HSP_BASE_1 0x00DF890000 | ||
687 | #define A_BCM1480_HSP_BASE_2 0x00DF910000 | ||
688 | #define BCM1480_HSP_REGISTER_SPACING 0x80000 | ||
689 | |||
690 | #define A_BCM1480_HSP_BASE(idx) (A_BCM1480_HSP_BASE_0 + ((idx)*BCM1480_HSP_REGISTER_SPACING)) | ||
691 | #define A_BCM1480_HSP_REGISTER(idx,reg) (A_BCM1480_HSP_BASE(idx) + (reg)) | ||
692 | |||
693 | #define R_BCM1480_HSP_RX_SPI4_CFG_0 0x0000000000 | ||
694 | #define R_BCM1480_HSP_RX_SPI4_CFG_1 0x0000000008 | ||
695 | #define R_BCM1480_HSP_RX_SPI4_DESKEW_OVERRIDE 0x0000000010 | ||
696 | #define R_BCM1480_HSP_RX_SPI4_DESKEW_DATAPATH 0x0000000018 | ||
697 | #define R_BCM1480_HSP_RX_SPI4_PORT_INT_EN 0x0000000020 | ||
698 | #define R_BCM1480_HSP_RX_SPI4_PORT_INT_STATUS 0x0000000028 | ||
699 | |||
700 | #define R_BCM1480_HSP_RX_SPI4_CALENDAR_0 0x0000000200 | ||
701 | #define R_BCM1480_HSP_RX_SPI4_CALENDAR_1 0x0000000208 | ||
702 | |||
703 | #define R_BCM1480_HSP_RX_PLL_CNFG 0x0000000800 | ||
704 | #define R_BCM1480_HSP_RX_CALIBRATION 0x0000000808 | ||
705 | #define R_BCM1480_HSP_RX_TEST 0x0000000810 | ||
706 | #define R_BCM1480_HSP_RX_DIAG_DETAILS 0x0000000818 | ||
707 | #define R_BCM1480_HSP_RX_DIAG_CRC_0 0x0000000820 | ||
708 | #define R_BCM1480_HSP_RX_DIAG_CRC_1 0x0000000828 | ||
709 | #define R_BCM1480_HSP_RX_DIAG_HTCMD 0x0000000830 | ||
710 | #define R_BCM1480_HSP_RX_DIAG_PKTCTL 0x0000000838 | ||
711 | |||
712 | #define R_BCM1480_HSP_RX_VIS_FLCTRL_COUNTER 0x0000000870 | ||
713 | |||
714 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_0 0x0000020020 | ||
715 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_1 0x0000020028 | ||
716 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_2 0x0000020030 | ||
717 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_3 0x0000020038 | ||
718 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_4 0x0000020040 | ||
719 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_5 0x0000020048 | ||
720 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_6 0x0000020050 | ||
721 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC_7 0x0000020058 | ||
722 | #define R_BCM1480_HSP_RX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_RX_PKT_RAMALLOC_0 + 8*(idx)) | ||
723 | |||
724 | /* XXX Following registers were shuffled. Renamed/renumbered per errata. */ | ||
725 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_0 0x0000020078 | ||
726 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_1 0x0000020080 | ||
727 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_2 0x0000020088 | ||
728 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_3 0x0000020090 | ||
729 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_4 0x0000020098 | ||
730 | #define R_BCM1480_HSP_RX_HT_RAMALLOC_5 0x00000200A0 | ||
731 | |||
732 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_0 0x00000200B0 | ||
733 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_1 0x00000200B8 | ||
734 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_2 0x00000200C0 | ||
735 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_3 0x00000200C8 | ||
736 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_4 0x00000200D0 | ||
737 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_5 0x00000200D8 | ||
738 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_6 0x00000200E0 | ||
739 | #define R_BCM1480_HSP_RX_SPI_WATERMARK_7 0x00000200E8 | ||
740 | #define R_BCM1480_HSP_RX_SPI_WATERMARK(idx) (R_BCM1480_HSP_RX_SPI_WATERMARK_0 + 8*(idx)) | ||
741 | |||
742 | #define R_BCM1480_HSP_RX_VIS_CMDQ_0 0x00000200F0 | ||
743 | #define R_BCM1480_HSP_RX_VIS_CMDQ_1 0x00000200F8 | ||
744 | #define R_BCM1480_HSP_RX_VIS_CMDQ_2 0x0000020100 | ||
745 | #define R_BCM1480_HSP_RX_RAM_READCTL 0x0000020108 | ||
746 | #define R_BCM1480_HSP_RX_RAM_READWINDOW 0x0000020110 | ||
747 | #define R_BCM1480_HSP_RX_RF_READCTL 0x0000020118 | ||
748 | #define R_BCM1480_HSP_RX_RF_READWINDOW 0x0000020120 | ||
749 | |||
750 | #define R_BCM1480_HSP_TX_SPI4_CFG_0 0x0000040000 | ||
751 | #define R_BCM1480_HSP_TX_SPI4_CFG_1 0x0000040008 | ||
752 | #define R_BCM1480_HSP_TX_SPI4_TRAINING_FMT 0x0000040010 | ||
753 | |||
754 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_0 0x0000040020 | ||
755 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_1 0x0000040028 | ||
756 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_2 0x0000040030 | ||
757 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_3 0x0000040038 | ||
758 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_4 0x0000040040 | ||
759 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_5 0x0000040048 | ||
760 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_6 0x0000040050 | ||
761 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC_7 0x0000040058 | ||
762 | #define R_BCM1480_HSP_TX_PKT_RAMALLOC(idx) (R_BCM1480_HSP_TX_PKT_RAMALLOC_0 + 8*(idx)) | ||
763 | #define R_BCM1480_HSP_TX_NPC_RAMALLOC 0x0000040078 | ||
764 | #define R_BCM1480_HSP_TX_RSP_RAMALLOC 0x0000040080 | ||
765 | #define R_BCM1480_HSP_TX_PC_RAMALLOC 0x0000040088 | ||
766 | #define R_BCM1480_HSP_TX_HTCC_RAMALLOC_0 0x0000040090 | ||
767 | #define R_BCM1480_HSP_TX_HTCC_RAMALLOC_1 0x0000040098 | ||
768 | #define R_BCM1480_HSP_TX_HTCC_RAMALLOC_2 0x00000400A0 | ||
769 | |||
770 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 0x00000400B0 | ||
771 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_1 0x00000400B8 | ||
772 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_2 0x00000400C0 | ||
773 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT_3 0x00000400C8 | ||
774 | #define R_BCM1480_HSP_TX_PKT_RXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_RXPHITCNT_0 + 8*(idx)) | ||
775 | #define R_BCM1480_HSP_TX_HTIO_RXPHITCNT 0x00000400D0 | ||
776 | #define R_BCM1480_HSP_TX_HTCC_RXPHITCNT 0x00000400D8 | ||
777 | |||
778 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 0x00000400E0 | ||
779 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_1 0x00000400E8 | ||
780 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_2 0x00000400F0 | ||
781 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT_3 0x00000400F8 | ||
782 | #define R_BCM1480_HSP_TX_PKT_TXPHITCNT(idx) (R_BCM1480_HSP_TX_PKT_TXPHITCNT_0 + 8*(idx)) | ||
783 | #define R_BCM1480_HSP_TX_HTIO_TXPHITCNT 0x0000040100 | ||
784 | #define R_BCM1480_HSP_TX_HTCC_TXPHITCNT 0x0000040108 | ||
785 | |||
786 | #define R_BCM1480_HSP_TX_SPI4_CALENDAR_0 0x0000040200 | ||
787 | #define R_BCM1480_HSP_TX_SPI4_CALENDAR_1 0x0000040208 | ||
788 | |||
789 | #define R_BCM1480_HSP_TX_PLL_CNFG 0x0000040800 | ||
790 | #define R_BCM1480_HSP_TX_CALIBRATION 0x0000040808 | ||
791 | #define R_BCM1480_HSP_TX_TEST 0x0000040810 | ||
792 | |||
793 | #define R_BCM1480_HSP_TX_VIS_CMDQ_0 0x0000040840 | ||
794 | #define R_BCM1480_HSP_TX_VIS_CMDQ_1 0x0000040848 | ||
795 | #define R_BCM1480_HSP_TX_VIS_CMDQ_2 0x0000040850 | ||
796 | #define R_BCM1480_HSP_TX_RAM_READCTL 0x0000040860 | ||
797 | #define R_BCM1480_HSP_TX_RAM_READWINDOW 0x0000040868 | ||
798 | #define R_BCM1480_HSP_TX_RF_READCTL 0x0000040870 | ||
799 | #define R_BCM1480_HSP_TX_RF_READWINDOW 0x0000040878 | ||
800 | |||
801 | #define R_BCM1480_HSP_TX_SPI4_PORT_INT_STATUS 0x0000040880 | ||
802 | #define R_BCM1480_HSP_TX_SPI4_PORT_INT_EN 0x0000040888 | ||
803 | |||
804 | #define R_BCM1480_HSP_TX_NEXT_ADDR_BASE 0x000040400 | ||
805 | #define R_BCM1480_HSP_TX_NEXT_ADDR_REGISTER(x) (R_BCM1480_HSP_TX_NEXT_ADDR_BASE+ 8*(x)) | ||
806 | |||
807 | |||
808 | |||
809 | /* ********************************************************************* | ||
810 | * Physical Address Map (Table 10 and Figure 7) | ||
811 | ********************************************************************* */ | ||
812 | |||
813 | #define A_BCM1480_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000) | ||
814 | #define A_BCM1480_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024)) | ||
815 | #define A_BCM1480_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000) | ||
816 | #define A_BCM1480_PHYS_IO_SYSTEM _SB_MAKE64(0x0010060000) | ||
817 | #define A_BCM1480_PHYS_GENBUS _SB_MAKE64(0x0010090000) | ||
818 | #define A_BCM1480_PHYS_GENBUS_END _SB_MAKE64(0x0028000000) | ||
819 | #define A_BCM1480_PHYS_PCI_MISC_MATCH_BYTES _SB_MAKE64(0x0028000000) | ||
820 | #define A_BCM1480_PHYS_PCI_IACK_MATCH_BYTES _SB_MAKE64(0x0029000000) | ||
821 | #define A_BCM1480_PHYS_PCI_IO_MATCH_BYTES _SB_MAKE64(0x002C000000) | ||
822 | #define A_BCM1480_PHYS_PCI_CFG_MATCH_BYTES _SB_MAKE64(0x002E000000) | ||
823 | #define A_BCM1480_PHYS_PCI_OMAP_MATCH_BYTES _SB_MAKE64(0x002F000000) | ||
824 | #define A_BCM1480_PHYS_PCI_MEM_MATCH_BYTES _SB_MAKE64(0x0030000000) | ||
825 | #define A_BCM1480_PHYS_HT_MEM_MATCH_BYTES _SB_MAKE64(0x0040000000) | ||
826 | #define A_BCM1480_PHYS_HT_MEM_MATCH_BITS _SB_MAKE64(0x0060000000) | ||
827 | #define A_BCM1480_PHYS_MEMORY_1 _SB_MAKE64(0x0080000000) | ||
828 | #define A_BCM1480_PHYS_MEMORY_2 _SB_MAKE64(0x0090000000) | ||
829 | #define A_BCM1480_PHYS_PCI_MISC_MATCH_BITS _SB_MAKE64(0x00A8000000) | ||
830 | #define A_BCM1480_PHYS_PCI_IACK_MATCH_BITS _SB_MAKE64(0x00A9000000) | ||
831 | #define A_BCM1480_PHYS_PCI_IO_MATCH_BITS _SB_MAKE64(0x00AC000000) | ||
832 | #define A_BCM1480_PHYS_PCI_CFG_MATCH_BITS _SB_MAKE64(0x00AE000000) | ||
833 | #define A_BCM1480_PHYS_PCI_OMAP_MATCH_BITS _SB_MAKE64(0x00AF000000) | ||
834 | #define A_BCM1480_PHYS_PCI_MEM_MATCH_BITS _SB_MAKE64(0x00B0000000) | ||
835 | #define A_BCM1480_PHYS_MEMORY_3 _SB_MAKE64(0x00C0000000) | ||
836 | #define A_BCM1480_PHYS_L2_CACHE_TEST _SB_MAKE64(0x00D0000000) | ||
837 | #define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BYTES _SB_MAKE64(0x00D8000000) | ||
838 | #define A_BCM1480_PHYS_HT_IO_MATCH_BYTES _SB_MAKE64(0x00DC000000) | ||
839 | #define A_BCM1480_PHYS_HT_CFG_MATCH_BYTES _SB_MAKE64(0x00DE000000) | ||
840 | #define A_BCM1480_PHYS_HS_SUBSYS _SB_MAKE64(0x00DF000000) | ||
841 | #define A_BCM1480_PHYS_HT_SPECIAL_MATCH_BITS _SB_MAKE64(0x00F8000000) | ||
842 | #define A_BCM1480_PHYS_HT_IO_MATCH_BITS _SB_MAKE64(0x00FC000000) | ||
843 | #define A_BCM1480_PHYS_HT_CFG_MATCH_BITS _SB_MAKE64(0x00FE000000) | ||
844 | #define A_BCM1480_PHYS_MEMORY_EXP _SB_MAKE64(0x0100000000) | ||
845 | #define A_BCM1480_PHYS_MEMORY_EXP_SIZE _SB_MAKE64((508*1024*1024*1024)) | ||
846 | #define A_BCM1480_PHYS_PCI_UPPER _SB_MAKE64(0x1000000000) | ||
847 | #define A_BCM1480_PHYS_HT_UPPER_MATCH_BYTES _SB_MAKE64(0x2000000000) | ||
848 | #define A_BCM1480_PHYS_HT_UPPER_MATCH_BITS _SB_MAKE64(0x3000000000) | ||
849 | #define A_BCM1480_PHYS_HT_NODE_ALIAS _SB_MAKE64(0x4000000000) | ||
850 | #define A_BCM1480_PHYS_HT_FULLACCESS _SB_MAKE64(0xF000000000) | ||
851 | |||
852 | |||
853 | /* ********************************************************************* | ||
854 | * L2 Cache as RAM (Table 54) | ||
855 | ********************************************************************* */ | ||
856 | |||
857 | #define A_BCM1480_PHYS_L2CACHE_WAY_SIZE _SB_MAKE64(0x0000020000) | ||
858 | #define BCM1480_PHYS_L2CACHE_NUM_WAYS 8 | ||
859 | #define A_BCM1480_PHYS_L2CACHE_TOTAL_SIZE _SB_MAKE64(0x0000100000) | ||
860 | #define A_BCM1480_PHYS_L2CACHE_WAY0 _SB_MAKE64(0x00D0300000) | ||
861 | #define A_BCM1480_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D0320000) | ||
862 | #define A_BCM1480_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D0340000) | ||
863 | #define A_BCM1480_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D0360000) | ||
864 | #define A_BCM1480_PHYS_L2CACHE_WAY4 _SB_MAKE64(0x00D0380000) | ||
865 | #define A_BCM1480_PHYS_L2CACHE_WAY5 _SB_MAKE64(0x00D03A0000) | ||
866 | #define A_BCM1480_PHYS_L2CACHE_WAY6 _SB_MAKE64(0x00D03C0000) | ||
867 | #define A_BCM1480_PHYS_L2CACHE_WAY7 _SB_MAKE64(0x00D03E0000) | ||
868 | |||
869 | #endif /* _BCM1480_REGS_H */ | ||
diff --git a/include/asm-mips/sibyte/bcm1480_scd.h b/include/asm-mips/sibyte/bcm1480_scd.h new file mode 100644 index 000000000000..648bed96780f --- /dev/null +++ b/include/asm-mips/sibyte/bcm1480_scd.h | |||
@@ -0,0 +1,436 @@ | |||
1 | /* ********************************************************************* | ||
2 | * BCM1280/BCM1400 Board Support Package | ||
3 | * | ||
4 | * SCD Constants and Macros File: bcm1480_scd.h | ||
5 | * | ||
6 | * This module contains constants and macros useful for | ||
7 | * manipulating the System Control and Debug module. | ||
8 | * | ||
9 | * BCM1400 specification level: 1X55_1X80-UM100-R (12/18/03) | ||
10 | * | ||
11 | ********************************************************************* | ||
12 | * | ||
13 | * Copyright 2000,2001,2002,2003 | ||
14 | * Broadcom Corporation. All rights reserved. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or | ||
17 | * modify it under the terms of the GNU General Public License as | ||
18 | * published by the Free Software Foundation; either version 2 of | ||
19 | * the License, or (at your option) any later version. | ||
20 | * | ||
21 | * This program is distributed in the hope that it will be useful, | ||
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
24 | * GNU General Public License for more details. | ||
25 | * | ||
26 | * You should have received a copy of the GNU General Public License | ||
27 | * along with this program; if not, write to the Free Software | ||
28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
29 | * MA 02111-1307 USA | ||
30 | ********************************************************************* */ | ||
31 | |||
32 | #ifndef _BCM1480_SCD_H | ||
33 | #define _BCM1480_SCD_H | ||
34 | |||
35 | #include "sb1250_defs.h" | ||
36 | |||
37 | /* ********************************************************************* | ||
38 | * Pull in the BCM1250's SCD since lots of stuff is the same. | ||
39 | ********************************************************************* */ | ||
40 | |||
41 | #include "sb1250_scd.h" | ||
42 | |||
43 | /* ********************************************************************* | ||
44 | * Some general notes: | ||
45 | * | ||
46 | * This file is basically a "what's new" header file. Since the | ||
47 | * BCM1250 and the new BCM1480 (and derivatives) share many common | ||
48 | * features, this file contains only what's new or changed from | ||
49 | * the 1250. (above, you can see that we include the 1250 symbols | ||
50 | * to get the base functionality). | ||
51 | * | ||
52 | * In software, be sure to use the correct symbols, particularly | ||
53 | * for blocks that are different between the two chip families. | ||
54 | * All BCM1480-specific symbols have _BCM1480_ in their names, | ||
55 | * and all BCM1250-specific and "base" functions that are common in | ||
56 | * both chips have no special names (this is for compatibility with | ||
57 | * older include files). Therefore, if you're working with the | ||
58 | * SCD, which is very different on each chip, A_SCD_xxx implies | ||
59 | * the BCM1250 version and A_BCM1480_SCD_xxx implies the BCM1480 | ||
60 | * version. | ||
61 | ********************************************************************* */ | ||
62 | |||
63 | /* ********************************************************************* | ||
64 | * System control/debug registers | ||
65 | ********************************************************************* */ | ||
66 | |||
67 | /* | ||
68 | * System Identification and Revision Register (Table 12) | ||
69 | * Register: SCD_SYSTEM_REVISION | ||
70 | * This register is field compatible with the 1250. | ||
71 | */ | ||
72 | |||
73 | /* | ||
74 | * New part definitions | ||
75 | */ | ||
76 | |||
77 | #define K_SYS_PART_BCM1480 0x1406 | ||
78 | #define K_SYS_PART_BCM1280 0x1206 | ||
79 | #define K_SYS_PART_BCM1455 0x1407 | ||
80 | #define K_SYS_PART_BCM1255 0x1257 | ||
81 | |||
82 | /* | ||
83 | * Manufacturing Information Register (Table 14) | ||
84 | * Register: SCD_SYSTEM_MANUF | ||
85 | */ | ||
86 | |||
87 | /* | ||
88 | * System Configuration Register (Table 15) | ||
89 | * Register: SCD_SYSTEM_CFG | ||
90 | * Entire register is different from 1250, all new constants below | ||
91 | */ | ||
92 | |||
93 | #define M_BCM1480_SYS_RESERVED0 _SB_MAKEMASK1(0) | ||
94 | #define M_BCM1480_SYS_HT_MINRSTCNT _SB_MAKEMASK1(1) | ||
95 | #define M_BCM1480_SYS_RESERVED2 _SB_MAKEMASK1(2) | ||
96 | #define M_BCM1480_SYS_RESERVED3 _SB_MAKEMASK1(3) | ||
97 | #define M_BCM1480_SYS_RESERVED4 _SB_MAKEMASK1(4) | ||
98 | #define M_BCM1480_SYS_IOB_DIV _SB_MAKEMASK1(5) | ||
99 | |||
100 | #define S_BCM1480_SYS_PLL_DIV _SB_MAKE64(6) | ||
101 | #define M_BCM1480_SYS_PLL_DIV _SB_MAKEMASK(5,S_BCM1480_SYS_PLL_DIV) | ||
102 | #define V_BCM1480_SYS_PLL_DIV(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_PLL_DIV) | ||
103 | #define G_BCM1480_SYS_PLL_DIV(x) _SB_GETVALUE(x,S_BCM1480_SYS_PLL_DIV,M_BCM1480_SYS_PLL_DIV) | ||
104 | |||
105 | #define S_BCM1480_SYS_SW_DIV _SB_MAKE64(11) | ||
106 | #define M_BCM1480_SYS_SW_DIV _SB_MAKEMASK(5,S_BCM1480_SYS_SW_DIV) | ||
107 | #define V_BCM1480_SYS_SW_DIV(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_SW_DIV) | ||
108 | #define G_BCM1480_SYS_SW_DIV(x) _SB_GETVALUE(x,S_BCM1480_SYS_SW_DIV,M_BCM1480_SYS_SW_DIV) | ||
109 | |||
110 | #define M_BCM1480_SYS_PCMCIA_ENABLE _SB_MAKEMASK1(16) | ||
111 | #define M_BCM1480_SYS_DUART1_ENABLE _SB_MAKEMASK1(17) | ||
112 | |||
113 | #define S_BCM1480_SYS_BOOT_MODE _SB_MAKE64(18) | ||
114 | #define M_BCM1480_SYS_BOOT_MODE _SB_MAKEMASK(2,S_BCM1480_SYS_BOOT_MODE) | ||
115 | #define V_BCM1480_SYS_BOOT_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_BOOT_MODE) | ||
116 | #define G_BCM1480_SYS_BOOT_MODE(x) _SB_GETVALUE(x,S_BCM1480_SYS_BOOT_MODE,M_BCM1480_SYS_BOOT_MODE) | ||
117 | #define K_BCM1480_SYS_BOOT_MODE_ROM32 0 | ||
118 | #define K_BCM1480_SYS_BOOT_MODE_ROM8 1 | ||
119 | #define K_BCM1480_SYS_BOOT_MODE_SMBUS_SMALL 2 | ||
120 | #define K_BCM1480_SYS_BOOT_MODE_SMBUS_BIG 3 | ||
121 | #define M_BCM1480_SYS_BOOT_MODE_SMBUS _SB_MAKEMASK1(19) | ||
122 | |||
123 | #define M_BCM1480_SYS_PCI_HOST _SB_MAKEMASK1(20) | ||
124 | #define M_BCM1480_SYS_PCI_ARBITER _SB_MAKEMASK1(21) | ||
125 | #define M_BCM1480_SYS_BIG_ENDIAN _SB_MAKEMASK1(22) | ||
126 | #define M_BCM1480_SYS_GENCLK_EN _SB_MAKEMASK1(23) | ||
127 | #define M_BCM1480_SYS_GEN_PARITY_EN _SB_MAKEMASK1(24) | ||
128 | #define M_BCM1480_SYS_RESERVED25 _SB_MAKEMASK1(25) | ||
129 | |||
130 | #define S_BCM1480_SYS_CONFIG 26 | ||
131 | #define M_BCM1480_SYS_CONFIG _SB_MAKEMASK(6,S_BCM1480_SYS_CONFIG) | ||
132 | #define V_BCM1480_SYS_CONFIG(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_CONFIG) | ||
133 | #define G_BCM1480_SYS_CONFIG(x) _SB_GETVALUE(x,S_BCM1480_SYS_CONFIG,M_BCM1480_SYS_CONFIG) | ||
134 | |||
135 | #define M_BCM1480_SYS_RESERVED32 _SB_MAKEMASK(32,15) | ||
136 | |||
137 | #define S_BCM1480_SYS_NODEID 47 | ||
138 | #define M_BCM1480_SYS_NODEID _SB_MAKEMASK(4,S_BCM1480_SYS_NODEID) | ||
139 | #define V_BCM1480_SYS_NODEID(x) _SB_MAKEVALUE(x,S_BCM1480_SYS_NODEID) | ||
140 | #define G_BCM1480_SYS_NODEID(x) _SB_GETVALUE(x,S_BCM1480_SYS_NODEID,M_BCM1480_SYS_NODEID) | ||
141 | |||
142 | #define M_BCM1480_SYS_CCNUMA_EN _SB_MAKEMASK1(51) | ||
143 | #define M_BCM1480_SYS_CPU_RESET_0 _SB_MAKEMASK1(52) | ||
144 | #define M_BCM1480_SYS_CPU_RESET_1 _SB_MAKEMASK1(53) | ||
145 | #define M_BCM1480_SYS_CPU_RESET_2 _SB_MAKEMASK1(54) | ||
146 | #define M_BCM1480_SYS_CPU_RESET_3 _SB_MAKEMASK1(55) | ||
147 | #define S_BCM1480_SYS_DISABLECPU0 56 | ||
148 | #define M_BCM1480_SYS_DISABLECPU0 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU0) | ||
149 | #define S_BCM1480_SYS_DISABLECPU1 57 | ||
150 | #define M_BCM1480_SYS_DISABLECPU1 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU1) | ||
151 | #define S_BCM1480_SYS_DISABLECPU2 58 | ||
152 | #define M_BCM1480_SYS_DISABLECPU2 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU2) | ||
153 | #define S_BCM1480_SYS_DISABLECPU3 59 | ||
154 | #define M_BCM1480_SYS_DISABLECPU3 _SB_MAKEMASK1(S_BCM1480_SYS_DISABLECPU3) | ||
155 | |||
156 | #define M_BCM1480_SYS_SB_SOFTRES _SB_MAKEMASK1(60) | ||
157 | #define M_BCM1480_SYS_EXT_RESET _SB_MAKEMASK1(61) | ||
158 | #define M_BCM1480_SYS_SYSTEM_RESET _SB_MAKEMASK1(62) | ||
159 | #define M_BCM1480_SYS_SW_FLAG _SB_MAKEMASK1(63) | ||
160 | |||
161 | /* | ||
162 | * Scratch Register (Table 16) | ||
163 | * Register: SCD_SYSTEM_SCRATCH | ||
164 | * Same as BCM1250 | ||
165 | */ | ||
166 | |||
167 | |||
168 | /* | ||
169 | * Mailbox Registers (Table 17) | ||
170 | * Registers: SCD_MBOX_{0,1}_CPU_x | ||
171 | * Same as BCM1250 | ||
172 | */ | ||
173 | |||
174 | |||
175 | /* | ||
176 | * See bcm1480_int.h for interrupt mapper registers. | ||
177 | */ | ||
178 | |||
179 | |||
180 | /* | ||
181 | * Watchdog Timer Initial Count Registers (Table 23) | ||
182 | * Registers: SCD_WDOG_INIT_CNT_x | ||
183 | * | ||
184 | * The watchdogs are almost the same as the 1250, except | ||
185 | * the configuration register has more bits to control the | ||
186 | * other CPUs. | ||
187 | */ | ||
188 | |||
189 | |||
190 | /* | ||
191 | * Watchdog Timer Configuration Registers (Table 25) | ||
192 | * Registers: SCD_WDOG_CFG_x | ||
193 | */ | ||
194 | |||
195 | #define M_BCM1480_SCD_WDOG_ENABLE _SB_MAKEMASK1(0) | ||
196 | |||
197 | #define S_BCM1480_SCD_WDOG_RESET_TYPE 2 | ||
198 | #define M_BCM1480_SCD_WDOG_RESET_TYPE _SB_MAKEMASK(5,S_BCM1480_SCD_WDOG_RESET_TYPE) | ||
199 | #define V_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_WDOG_RESET_TYPE) | ||
200 | #define G_BCM1480_SCD_WDOG_RESET_TYPE(x) _SB_GETVALUE(x,S_BCM1480_SCD_WDOG_RESET_TYPE,M_BCM1480_SCD_WDOG_RESET_TYPE) | ||
201 | |||
202 | #define K_BCM1480_SCD_WDOG_RESET_FULL 0 /* actually, (x & 1) == 0 */ | ||
203 | #define K_BCM1480_SCD_WDOG_RESET_SOFT 1 | ||
204 | #define K_BCM1480_SCD_WDOG_RESET_CPU0 3 | ||
205 | #define K_BCM1480_SCD_WDOG_RESET_CPU1 5 | ||
206 | #define K_BCM1480_SCD_WDOG_RESET_CPU2 9 | ||
207 | #define K_BCM1480_SCD_WDOG_RESET_CPU3 17 | ||
208 | #define K_BCM1480_SCD_WDOG_RESET_ALL_CPUS 31 | ||
209 | |||
210 | |||
211 | #define M_BCM1480_SCD_WDOG_HAS_RESET _SB_MAKEMASK1(8) | ||
212 | |||
213 | /* | ||
214 | * General Timer Initial Count Registers (Table 26) | ||
215 | * Registers: SCD_TIMER_INIT_x | ||
216 | * | ||
217 | * The timer registers are the same as the BCM1250 | ||
218 | */ | ||
219 | |||
220 | |||
221 | /* | ||
222 | * ZBbus Count Register (Table 29) | ||
223 | * Register: ZBBUS_CYCLE_COUNT | ||
224 | * | ||
225 | * Same as BCM1250 | ||
226 | */ | ||
227 | |||
228 | /* | ||
229 | * ZBbus Compare Registers (Table 30) | ||
230 | * Registers: ZBBUS_CYCLE_CPx | ||
231 | * | ||
232 | * Same as BCM1250 | ||
233 | */ | ||
234 | |||
235 | |||
236 | /* | ||
237 | * System Performance Counter Configuration Register (Table 31) | ||
238 | * Register: PERF_CNT_CFG_0 | ||
239 | * | ||
240 | * Since the clear/enable bits are moved compared to the | ||
241 | * 1250 and there are more fields, this register will be BCM1480 specific. | ||
242 | */ | ||
243 | |||
244 | #define S_BCM1480_SPC_CFG_SRC0 0 | ||
245 | #define M_BCM1480_SPC_CFG_SRC0 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC0) | ||
246 | #define V_BCM1480_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC0) | ||
247 | #define G_BCM1480_SPC_CFG_SRC0(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC0,M_BCM1480_SPC_CFG_SRC0) | ||
248 | |||
249 | #define S_BCM1480_SPC_CFG_SRC1 8 | ||
250 | #define M_BCM1480_SPC_CFG_SRC1 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC1) | ||
251 | #define V_BCM1480_SPC_CFG_SRC1(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC1) | ||
252 | #define G_BCM1480_SPC_CFG_SRC1(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC1,M_BCM1480_SPC_CFG_SRC1) | ||
253 | |||
254 | #define S_BCM1480_SPC_CFG_SRC2 16 | ||
255 | #define M_BCM1480_SPC_CFG_SRC2 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC2) | ||
256 | #define V_BCM1480_SPC_CFG_SRC2(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC2) | ||
257 | #define G_BCM1480_SPC_CFG_SRC2(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC2,M_BCM1480_SPC_CFG_SRC2) | ||
258 | |||
259 | #define S_BCM1480_SPC_CFG_SRC3 24 | ||
260 | #define M_BCM1480_SPC_CFG_SRC3 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC3) | ||
261 | #define V_BCM1480_SPC_CFG_SRC3(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC3) | ||
262 | #define G_BCM1480_SPC_CFG_SRC3(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC3,M_BCM1480_SPC_CFG_SRC3) | ||
263 | |||
264 | #define S_BCM1480_SPC_CFG_SRC4 32 | ||
265 | #define M_BCM1480_SPC_CFG_SRC4 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC4) | ||
266 | #define V_BCM1480_SPC_CFG_SRC4(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC4) | ||
267 | #define G_BCM1480_SPC_CFG_SRC4(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC4,M_BCM1480_SPC_CFG_SRC4) | ||
268 | |||
269 | #define S_BCM1480_SPC_CFG_SRC5 40 | ||
270 | #define M_BCM1480_SPC_CFG_SRC5 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC5) | ||
271 | #define V_BCM1480_SPC_CFG_SRC5(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC5) | ||
272 | #define G_BCM1480_SPC_CFG_SRC5(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC5,M_BCM1480_SPC_CFG_SRC5) | ||
273 | |||
274 | #define S_BCM1480_SPC_CFG_SRC6 48 | ||
275 | #define M_BCM1480_SPC_CFG_SRC6 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC6) | ||
276 | #define V_BCM1480_SPC_CFG_SRC6(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC6) | ||
277 | #define G_BCM1480_SPC_CFG_SRC6(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC6,M_BCM1480_SPC_CFG_SRC6) | ||
278 | |||
279 | #define S_BCM1480_SPC_CFG_SRC7 56 | ||
280 | #define M_BCM1480_SPC_CFG_SRC7 _SB_MAKEMASK(8,S_BCM1480_SPC_CFG_SRC7) | ||
281 | #define V_BCM1480_SPC_CFG_SRC7(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CFG_SRC7) | ||
282 | #define G_BCM1480_SPC_CFG_SRC7(x) _SB_GETVALUE(x,S_BCM1480_SPC_CFG_SRC7,M_BCM1480_SPC_CFG_SRC7) | ||
283 | |||
284 | /* | ||
285 | * System Performance Counter Control Register (Table 32) | ||
286 | * Register: PERF_CNT_CFG_1 | ||
287 | * BCM1480 specific | ||
288 | */ | ||
289 | |||
290 | #define M_BCM1480_SPC_CFG_CLEAR _SB_MAKEMASK1(0) | ||
291 | #define M_BCM1480_SPC_CFG_ENABLE _SB_MAKEMASK1(1) | ||
292 | |||
293 | /* | ||
294 | * System Performance Counters (Table 33) | ||
295 | * Registers: PERF_CNT_x | ||
296 | */ | ||
297 | |||
298 | #define S_BCM1480_SPC_CNT_COUNT 0 | ||
299 | #define M_BCM1480_SPC_CNT_COUNT _SB_MAKEMASK(40,S_BCM1480_SPC_CNT_COUNT) | ||
300 | #define V_BCM1480_SPC_CNT_COUNT(x) _SB_MAKEVALUE(x,S_BCM1480_SPC_CNT_COUNT) | ||
301 | #define G_BCM1480_SPC_CNT_COUNT(x) _SB_GETVALUE(x,S_BCM1480_SPC_CNT_COUNT,M_BCM1480_SPC_CNT_COUNT) | ||
302 | |||
303 | #define M_BCM1480_SPC_CNT_OFLOW _SB_MAKEMASK1(40) | ||
304 | |||
305 | |||
306 | /* | ||
307 | * Bus Watcher Error Status Register (Tables 36, 37) | ||
308 | * Registers: BUS_ERR_STATUS, BUS_ERR_STATUS_DEBUG | ||
309 | * Same as BCM1250. | ||
310 | */ | ||
311 | |||
312 | /* | ||
313 | * Bus Watcher Error Data Registers (Table 38) | ||
314 | * Registers: BUS_ERR_DATA_x | ||
315 | * Same as BCM1250. | ||
316 | */ | ||
317 | |||
318 | /* | ||
319 | * Bus Watcher L2 ECC Counter Register (Table 39) | ||
320 | * Register: BUS_L2_ERRORS | ||
321 | * Same as BCM1250. | ||
322 | */ | ||
323 | |||
324 | |||
325 | /* | ||
326 | * Bus Watcher Memory and I/O Error Counter Register (Table 40) | ||
327 | * Register: BUS_MEM_IO_ERRORS | ||
328 | * Same as BCM1250. | ||
329 | */ | ||
330 | |||
331 | |||
332 | /* | ||
333 | * Address Trap Registers | ||
334 | * | ||
335 | * Register layout same as BCM1250, almost. The bus agents | ||
336 | * are different, and the address trap configuration bits are | ||
337 | * slightly different. | ||
338 | */ | ||
339 | |||
340 | #define M_BCM1480_ATRAP_INDEX _SB_MAKEMASK(4,0) | ||
341 | #define M_BCM1480_ATRAP_ADDRESS _SB_MAKEMASK(40,0) | ||
342 | |||
343 | #define S_BCM1480_ATRAP_CFG_CNT 0 | ||
344 | #define M_BCM1480_ATRAP_CFG_CNT _SB_MAKEMASK(3,S_BCM1480_ATRAP_CFG_CNT) | ||
345 | #define V_BCM1480_ATRAP_CFG_CNT(x) _SB_MAKEVALUE(x,S_BCM1480_ATRAP_CFG_CNT) | ||
346 | #define G_BCM1480_ATRAP_CFG_CNT(x) _SB_GETVALUE(x,S_BCM1480_ATRAP_CFG_CNT,M_BCM1480_ATRAP_CFG_CNT) | ||
347 | |||
348 | #define M_BCM1480_ATRAP_CFG_WRITE _SB_MAKEMASK1(3) | ||
349 | #define M_BCM1480_ATRAP_CFG_ALL _SB_MAKEMASK1(4) | ||
350 | #define M_BCM1480_ATRAP_CFG_INV _SB_MAKEMASK1(5) | ||
351 | #define M_BCM1480_ATRAP_CFG_USESRC _SB_MAKEMASK1(6) | ||
352 | #define M_BCM1480_ATRAP_CFG_SRCINV _SB_MAKEMASK1(7) | ||
353 | |||
354 | #define S_BCM1480_ATRAP_CFG_AGENTID 8 | ||
355 | #define M_BCM1480_ATRAP_CFG_AGENTID _SB_MAKEMASK(4,S_BCM1480_ATRAP_CFG_AGENTID) | ||
356 | #define V_BCM1480_ATRAP_CFG_AGENTID(x) _SB_MAKEVALUE(x,S_BCM1480_ATRAP_CFG_AGENTID) | ||
357 | #define G_BCM1480_ATRAP_CFG_AGENTID(x) _SB_GETVALUE(x,S_BCM1480_ATRAP_CFG_AGENTID,M_BCM1480_ATRAP_CFG_AGENTID) | ||
358 | |||
359 | |||
360 | #define K_BCM1480_BUS_AGENT_CPU0 0 | ||
361 | #define K_BCM1480_BUS_AGENT_CPU1 1 | ||
362 | #define K_BCM1480_BUS_AGENT_NC 2 | ||
363 | #define K_BCM1480_BUS_AGENT_IOB 3 | ||
364 | #define K_BCM1480_BUS_AGENT_SCD 4 | ||
365 | #define K_BCM1480_BUS_AGENT_L2C 6 | ||
366 | #define K_BCM1480_BUS_AGENT_MC 7 | ||
367 | #define K_BCM1480_BUS_AGENT_CPU2 8 | ||
368 | #define K_BCM1480_BUS_AGENT_CPU3 9 | ||
369 | #define K_BCM1480_BUS_AGENT_PM 10 | ||
370 | |||
371 | #define S_BCM1480_ATRAP_CFG_CATTR 12 | ||
372 | #define M_BCM1480_ATRAP_CFG_CATTR _SB_MAKEMASK(2,S_BCM1480_ATRAP_CFG_CATTR) | ||
373 | #define V_BCM1480_ATRAP_CFG_CATTR(x) _SB_MAKEVALUE(x,S_BCM1480_ATRAP_CFG_CATTR) | ||
374 | #define G_BCM1480_ATRAP_CFG_CATTR(x) _SB_GETVALUE(x,S_BCM1480_ATRAP_CFG_CATTR,M_BCM1480_ATRAP_CFG_CATTR) | ||
375 | |||
376 | #define K_BCM1480_ATRAP_CFG_CATTR_IGNORE 0 | ||
377 | #define K_BCM1480_ATRAP_CFG_CATTR_UNC 1 | ||
378 | #define K_BCM1480_ATRAP_CFG_CATTR_NONCOH 2 | ||
379 | #define K_BCM1480_ATRAP_CFG_CATTR_COHERENT 3 | ||
380 | |||
381 | #define M_BCM1480_ATRAP_CFG_CATTRINV _SB_MAKEMASK1(14) | ||
382 | |||
383 | |||
384 | /* | ||
385 | * Trace Event Registers (Table 47) | ||
386 | * Same as BCM1250. | ||
387 | */ | ||
388 | |||
389 | /* | ||
390 | * Trace Sequence Control Registers (Table 48) | ||
391 | * Registers: TRACE_SEQUENCE_x | ||
392 | * | ||
393 | * Same as BCM1250 except for two new fields. | ||
394 | */ | ||
395 | |||
396 | |||
397 | #define M_BCM1480_SCD_TRSEQ_TID_MATCH_EN _SB_MAKEMASK1(25) | ||
398 | |||
399 | #define S_BCM1480_SCD_TRSEQ_SWFUNC 26 | ||
400 | #define M_BCM1480_SCD_TRSEQ_SWFUNC _SB_MAKEMASK(2,S_BCM1480_SCD_TRSEQ_SWFUNC) | ||
401 | #define V_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_TRSEQ_SWFUNC) | ||
402 | #define G_BCM1480_SCD_TRSEQ_SWFUNC(x) _SB_GETVALUE(x,S_BCM1480_SCD_TRSEQ_SWFUNC,M_BCM1480_SCD_TRSEQ_SWFUNC) | ||
403 | |||
404 | /* | ||
405 | * Trace Control Register (Table 49) | ||
406 | * Register: TRACE_CFG | ||
407 | * | ||
408 | * Bits 0..8 are the same as the BCM1250, rest are different. | ||
409 | * Entire register is redefined below. | ||
410 | */ | ||
411 | |||
412 | #define M_BCM1480_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) | ||
413 | #define M_BCM1480_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) | ||
414 | #define M_BCM1480_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) | ||
415 | #define M_BCM1480_SCD_TRACE_CFG_STOP _SB_MAKEMASK1(3) | ||
416 | #define M_BCM1480_SCD_TRACE_CFG_FREEZE _SB_MAKEMASK1(4) | ||
417 | #define M_BCM1480_SCD_TRACE_CFG_FREEZE_FULL _SB_MAKEMASK1(5) | ||
418 | #define M_BCM1480_SCD_TRACE_CFG_DEBUG_FULL _SB_MAKEMASK1(6) | ||
419 | #define M_BCM1480_SCD_TRACE_CFG_FULL _SB_MAKEMASK1(7) | ||
420 | #define M_BCM1480_SCD_TRACE_CFG_FORCE_CNT _SB_MAKEMASK1(8) | ||
421 | |||
422 | #define S_BCM1480_SCD_TRACE_CFG_MODE 16 | ||
423 | #define M_BCM1480_SCD_TRACE_CFG_MODE _SB_MAKEMASK(2,S_BCM1480_SCD_TRACE_CFG_MODE) | ||
424 | #define V_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_TRACE_CFG_MODE) | ||
425 | #define G_BCM1480_SCD_TRACE_CFG_MODE(x) _SB_GETVALUE(x,S_BCM1480_SCD_TRACE_CFG_MODE,M_BCM1480_SCD_TRACE_CFG_MODE) | ||
426 | |||
427 | #define K_BCM1480_SCD_TRACE_CFG_MODE_BLOCKERS 0 | ||
428 | #define K_BCM1480_SCD_TRACE_CFG_MODE_BYTEEN_INT 1 | ||
429 | #define K_BCM1480_SCD_TRACE_CFG_MODE_FLOW_ID 2 | ||
430 | |||
431 | #define S_BCM1480_SCD_TRACE_CFG_CUR_ADDR 24 | ||
432 | #define M_BCM1480_SCD_TRACE_CFG_CUR_ADDR _SB_MAKEMASK(8,S_BCM1480_SCD_TRACE_CFG_CUR_ADDR) | ||
433 | #define V_BCM1480_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x,S_BCM1480_SCD_TRACE_CFG_CUR_ADDR) | ||
434 | #define G_BCM1480_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x,S_BCM1480_SCD_TRACE_CFG_CUR_ADDR,M_BCM1480_SCD_TRACE_CFG_CUR_ADDR) | ||
435 | |||
436 | #endif /* _BCM1480_SCD_H */ | ||
diff --git a/include/asm-mips/sibyte/bigsur.h b/include/asm-mips/sibyte/bigsur.h new file mode 100644 index 000000000000..ebefe797fc1d --- /dev/null +++ b/include/asm-mips/sibyte/bigsur.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000,2001,2002,2003,2004 Broadcom Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | */ | ||
18 | #ifndef __ASM_SIBYTE_BIGSUR_H | ||
19 | #define __ASM_SIBYTE_BIGSUR_H | ||
20 | |||
21 | #include <asm/sibyte/sb1250.h> | ||
22 | #include <asm/sibyte/bcm1480_int.h> | ||
23 | |||
24 | #ifdef CONFIG_SIBYTE_BIGSUR | ||
25 | #define SIBYTE_BOARD_NAME "BCM91x80A/B (BigSur)" | ||
26 | #define SIBYTE_HAVE_PCMCIA 1 | ||
27 | #define SIBYTE_HAVE_IDE 1 | ||
28 | #endif | ||
29 | |||
30 | /* Generic bus chip selects */ | ||
31 | #define LEDS_CS 3 | ||
32 | #define LEDS_PHYS 0x100a0000 | ||
33 | |||
34 | #ifdef SIBYTE_HAVE_IDE | ||
35 | #define IDE_CS 4 | ||
36 | #define IDE_PHYS 0x100b0000 | ||
37 | #define K_GPIO_GB_IDE 4 | ||
38 | #define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE) | ||
39 | #endif | ||
40 | |||
41 | #ifdef SIBYTE_HAVE_PCMCIA | ||
42 | #define PCMCIA_CS 6 | ||
43 | #define PCMCIA_PHYS 0x11000000 | ||
44 | #define K_GPIO_PC_READY 9 | ||
45 | #define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY) | ||
46 | #endif | ||
47 | |||
48 | #endif /* __ASM_SIBYTE_BIGSUR_H */ | ||
49 | |||
diff --git a/include/asm-mips/sibyte/board.h b/include/asm-mips/sibyte/board.h index d7b11b6c7c32..900edcbeec37 100644 --- a/include/asm-mips/sibyte/board.h +++ b/include/asm-mips/sibyte/board.h | |||
@@ -21,8 +21,6 @@ | |||
21 | 21 | ||
22 | #include <linux/config.h> | 22 | #include <linux/config.h> |
23 | 23 | ||
24 | #ifdef CONFIG_SIBYTE_BOARD | ||
25 | |||
26 | #if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \ | 24 | #if defined(CONFIG_SIBYTE_SWARM) || defined(CONFIG_SIBYTE_PTSWARM) || \ |
27 | defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \ | 25 | defined(CONFIG_SIBYTE_CRHONE) || defined(CONFIG_SIBYTE_CRHINE) || \ |
28 | defined(CONFIG_SIBYTE_LITTLESUR) | 26 | defined(CONFIG_SIBYTE_LITTLESUR) |
@@ -37,6 +35,10 @@ | |||
37 | #include <asm/sibyte/carmel.h> | 35 | #include <asm/sibyte/carmel.h> |
38 | #endif | 36 | #endif |
39 | 37 | ||
38 | #ifdef CONFIG_SIBYTE_BIGSUR | ||
39 | #include <asm/sibyte/bigsur.h> | ||
40 | #endif | ||
41 | |||
40 | #ifdef __ASSEMBLY__ | 42 | #ifdef __ASSEMBLY__ |
41 | 43 | ||
42 | #ifdef LEDS_PHYS | 44 | #ifdef LEDS_PHYS |
@@ -54,16 +56,6 @@ | |||
54 | #define setleds(t0,t1,c0,c1,c2,c3) | 56 | #define setleds(t0,t1,c0,c1,c2,c3) |
55 | #endif /* LEDS_PHYS */ | 57 | #endif /* LEDS_PHYS */ |
56 | 58 | ||
57 | #else | ||
58 | |||
59 | #ifdef LEDS_PHYS | ||
60 | extern void setleds(char *str); | ||
61 | #else | ||
62 | #define setleds(s) do { } while (0) | ||
63 | #endif /* LEDS_PHYS */ | ||
64 | |||
65 | #endif /* __ASSEMBLY__ */ | 59 | #endif /* __ASSEMBLY__ */ |
66 | 60 | ||
67 | #endif /* CONFIG_SIBYTE_BOARD */ | ||
68 | |||
69 | #endif /* _SIBYTE_BOARD_H */ | 61 | #endif /* _SIBYTE_BOARD_H */ |
diff --git a/include/asm-mips/sibyte/sb1250.h b/include/asm-mips/sibyte/sb1250.h index d62da4e2dd36..a474c29cd701 100644 --- a/include/asm-mips/sibyte/sb1250.h +++ b/include/asm-mips/sibyte/sb1250.h | |||
@@ -27,6 +27,9 @@ | |||
27 | 27 | ||
28 | #define SB1250_NR_IRQS 64 | 28 | #define SB1250_NR_IRQS 64 |
29 | 29 | ||
30 | #define BCM1480_NR_IRQS 128 | ||
31 | #define BCM1480_NR_IRQS_HALF 64 | ||
32 | |||
30 | #define SB1250_DUART_MINOR_BASE 64 | 33 | #define SB1250_DUART_MINOR_BASE 64 |
31 | 34 | ||
32 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
@@ -35,6 +38,7 @@ | |||
35 | 38 | ||
36 | /* For revision/pass information */ | 39 | /* For revision/pass information */ |
37 | #include <asm/sibyte/sb1250_scd.h> | 40 | #include <asm/sibyte/sb1250_scd.h> |
41 | #include <asm/sibyte/bcm1480_scd.h> | ||
38 | extern unsigned int sb1_pass; | 42 | extern unsigned int sb1_pass; |
39 | extern unsigned int soc_pass; | 43 | extern unsigned int soc_pass; |
40 | extern unsigned int soc_type; | 44 | extern unsigned int soc_type; |
@@ -46,6 +50,13 @@ extern unsigned long sb1250_gettimeoffset(void); | |||
46 | extern void sb1250_mask_irq(int cpu, int irq); | 50 | extern void sb1250_mask_irq(int cpu, int irq); |
47 | extern void sb1250_unmask_irq(int cpu, int irq); | 51 | extern void sb1250_unmask_irq(int cpu, int irq); |
48 | extern void sb1250_smp_finish(void); | 52 | extern void sb1250_smp_finish(void); |
53 | |||
54 | extern void bcm1480_time_init(void); | ||
55 | extern unsigned long bcm1480_gettimeoffset(void); | ||
56 | extern void bcm1480_mask_irq(int cpu, int irq); | ||
57 | extern void bcm1480_unmask_irq(int cpu, int irq); | ||
58 | extern void bcm1480_smp_finish(void); | ||
59 | |||
49 | extern void prom_printf(char *fmt, ...); | 60 | extern void prom_printf(char *fmt, ...); |
50 | 61 | ||
51 | #define AT_spin \ | 62 | #define AT_spin \ |
@@ -58,6 +69,6 @@ extern void prom_printf(char *fmt, ...); | |||
58 | 69 | ||
59 | #endif | 70 | #endif |
60 | 71 | ||
61 | #define IOADDR(a) (IO_BASE + (a)) | 72 | #define IOADDR(a) ((volatile void __iomem *)(IO_BASE + (a))) |
62 | 73 | ||
63 | #endif | 74 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250_defs.h b/include/asm-mips/sibyte/sb1250_defs.h index 40ef97c76c8b..335dbaf1d831 100644 --- a/include/asm-mips/sibyte/sb1250_defs.h +++ b/include/asm-mips/sibyte/sb1250_defs.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -97,13 +95,17 @@ | |||
97 | * ordering, so be careful when adding support for new minor revs. | 95 | * ordering, so be careful when adding support for new minor revs. |
98 | ********************************************************************* */ | 96 | ********************************************************************* */ |
99 | 97 | ||
100 | #define SIBYTE_HDR_FMASK_1250_ALL 0x00000ff | 98 | #define SIBYTE_HDR_FMASK_1250_ALL 0x000000ff |
101 | #define SIBYTE_HDR_FMASK_1250_PASS1 0x0000001 | 99 | #define SIBYTE_HDR_FMASK_1250_PASS1 0x00000001 |
102 | #define SIBYTE_HDR_FMASK_1250_PASS2 0x0000002 | 100 | #define SIBYTE_HDR_FMASK_1250_PASS2 0x00000002 |
103 | #define SIBYTE_HDR_FMASK_1250_PASS3 0x0000004 | 101 | #define SIBYTE_HDR_FMASK_1250_PASS3 0x00000004 |
102 | |||
103 | #define SIBYTE_HDR_FMASK_112x_ALL 0x00000f00 | ||
104 | #define SIBYTE_HDR_FMASK_112x_PASS1 0x00000100 | ||
104 | 105 | ||
105 | #define SIBYTE_HDR_FMASK_112x_ALL 0x0000f00 | 106 | #define SIBYTE_HDR_FMASK_1480_ALL 0x0000f000 |
106 | #define SIBYTE_HDR_FMASK_112x_PASS1 0x0000100 | 107 | #define SIBYTE_HDR_FMASK_1480_PASS1 0x00001000 |
108 | #define SIBYTE_HDR_FMASK_1480_PASS2 0x00002000 | ||
107 | 109 | ||
108 | /* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ | 110 | /* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ |
109 | #define SIBYTE_HDR_FMASK(chip, pass) \ | 111 | #define SIBYTE_HDR_FMASK(chip, pass) \ |
@@ -111,8 +113,17 @@ | |||
111 | #define SIBYTE_HDR_FMASK_ALLREVS(chip) \ | 113 | #define SIBYTE_HDR_FMASK_ALLREVS(chip) \ |
112 | (SIBYTE_HDR_FMASK_ ## chip ## _ALL) | 114 | (SIBYTE_HDR_FMASK_ ## chip ## _ALL) |
113 | 115 | ||
116 | /* Default constant value for all chips, all revisions */ | ||
114 | #define SIBYTE_HDR_FMASK_ALL \ | 117 | #define SIBYTE_HDR_FMASK_ALL \ |
118 | (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL \ | ||
119 | | SIBYTE_HDR_FMASK_1480_ALL) | ||
120 | |||
121 | /* This one is used for the "original" BCM1250/BCM112x chips. We use this | ||
122 | to weed out constants and macros that do not exist on later chips like | ||
123 | the BCM1480 */ | ||
124 | #define SIBYTE_HDR_FMASK_1250_112x_ALL \ | ||
115 | (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL) | 125 | (SIBYTE_HDR_FMASK_1250_ALL | SIBYTE_HDR_FMASK_112x_ALL) |
126 | #define SIBYTE_HDR_FMASK_1250_112x SIBYTE_HDR_FMASK_1250_112x_ALL | ||
116 | 127 | ||
117 | #ifndef SIBYTE_HDR_FEATURES | 128 | #ifndef SIBYTE_HDR_FEATURES |
118 | #define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_ALL | 129 | #define SIBYTE_HDR_FEATURES SIBYTE_HDR_FMASK_ALL |
@@ -133,6 +144,12 @@ | |||
133 | #define SIBYTE_HDR_FEATURE_CHIP(chip) \ | 144 | #define SIBYTE_HDR_FEATURE_CHIP(chip) \ |
134 | (!! (SIBYTE_HDR_FMASK_ALLREVS(chip) & SIBYTE_HDR_FEATURES)) | 145 | (!! (SIBYTE_HDR_FMASK_ALLREVS(chip) & SIBYTE_HDR_FEATURES)) |
135 | 146 | ||
147 | /* True for all versions of the BCM1250 and BCM1125, but not true for | ||
148 | anything else */ | ||
149 | #define SIBYTE_HDR_FEATURE_1250_112x \ | ||
150 | (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x)) | ||
151 | /* (!! (SIBYTE_HDR_FEATURES & SIBYHTE_HDR_FMASK_1250_112x)) */ | ||
152 | |||
136 | /* True if header features enabled for that rev or later, inclusive. */ | 153 | /* True if header features enabled for that rev or later, inclusive. */ |
137 | #define SIBYTE_HDR_FEATURE(chip, pass) \ | 154 | #define SIBYTE_HDR_FEATURE(chip, pass) \ |
138 | (!! ((SIBYTE_HDR_FMASK(chip, pass) \ | 155 | (!! ((SIBYTE_HDR_FMASK(chip, pass) \ |
diff --git a/include/asm-mips/sibyte/sb1250_dma.h b/include/asm-mips/sibyte/sb1250_dma.h index 3cdb48f50ed0..e6145f524fbd 100644 --- a/include/asm-mips/sibyte/sb1250_dma.h +++ b/include/asm-mips/sibyte/sb1250_dma.h | |||
@@ -7,9 +7,8 @@ | |||
7 | * programming the SB1250's DMA controllers, both the data mover | 7 | * programming the SB1250's DMA controllers, both the data mover |
8 | * and the Ethernet DMA. | 8 | * and the Ethernet DMA. |
9 | * | 9 | * |
10 | * SB1250 specification level: User's manual 1/02/02 | 10 | * SB1250 specification level: User's manual 10/21/02 |
11 | * | 11 | * BCM1280 specification level: User's manual 11/24/03 |
12 | * Author: Mitch Lichtenberg | ||
13 | * | 12 | * |
14 | ********************************************************************* | 13 | ********************************************************************* |
15 | * | 14 | * |
@@ -58,17 +57,17 @@ | |||
58 | #define M_DMA_RESERVED1 _SB_MAKEMASK1(2) | 57 | #define M_DMA_RESERVED1 _SB_MAKEMASK1(2) |
59 | 58 | ||
60 | #define S_DMA_DESC_TYPE _SB_MAKE64(1) | 59 | #define S_DMA_DESC_TYPE _SB_MAKE64(1) |
61 | #define M_DMA_DESC_TYPE _SB_MAKE64(2,S_DMA_DESC_TYPE) | 60 | #define M_DMA_DESC_TYPE _SB_MAKEMASK(2,S_DMA_DESC_TYPE) |
62 | #define V_DMA_DESC_TYPE(x) _SB_MAKEVALUE(x,S_DMA_DESC_TYPE) | 61 | #define V_DMA_DESC_TYPE(x) _SB_MAKEVALUE(x,S_DMA_DESC_TYPE) |
63 | #define G_DMA_DESC_TYPE(x) _SB_GETVALUE(x,S_DMA_DESC_TYPE,M_DMA_DESC_TYPE) | 62 | #define G_DMA_DESC_TYPE(x) _SB_GETVALUE(x,S_DMA_DESC_TYPE,M_DMA_DESC_TYPE) |
64 | 63 | ||
65 | #define K_DMA_DESC_TYPE_RING_AL 0 | 64 | #define K_DMA_DESC_TYPE_RING_AL 0 |
66 | #define K_DMA_DESC_TYPE_CHAIN_AL 1 | 65 | #define K_DMA_DESC_TYPE_CHAIN_AL 1 |
67 | 66 | ||
68 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 67 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
69 | #define K_DMA_DESC_TYPE_RING_UAL_WI 2 | 68 | #define K_DMA_DESC_TYPE_RING_UAL_WI 2 |
70 | #define K_DMA_DESC_TYPE_RING_UAL_RMW 3 | 69 | #define K_DMA_DESC_TYPE_RING_UAL_RMW 3 |
71 | #endif /* 1250 PASS3 || 112x PASS1 */ | 70 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
72 | 71 | ||
73 | #define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3) | 72 | #define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3) |
74 | #define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4) | 73 | #define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4) |
@@ -111,11 +110,11 @@ | |||
111 | #define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4) | 110 | #define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4) |
112 | #define M_DMA_L2CA _SB_MAKEMASK1(5) | 111 | #define M_DMA_L2CA _SB_MAKEMASK1(5) |
113 | 112 | ||
114 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 113 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
115 | #define M_DMA_RX_XTRA_STATUS _SB_MAKEMASK1(6) | 114 | #define M_DMA_RX_XTRA_STATUS _SB_MAKEMASK1(6) |
116 | #define M_DMA_TX_CPU_PAUSE _SB_MAKEMASK1(6) | 115 | #define M_DMA_TX_CPU_PAUSE _SB_MAKEMASK1(6) |
117 | #define M_DMA_TX_FC_PAUSE_EN _SB_MAKEMASK1(7) | 116 | #define M_DMA_TX_FC_PAUSE_EN _SB_MAKEMASK1(7) |
118 | #endif /* 1250 PASS3 || 112x PASS1 */ | 117 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
119 | 118 | ||
120 | #define M_DMA_MBZ1 _SB_MAKEMASK(6,15) | 119 | #define M_DMA_MBZ1 _SB_MAKEMASK(6,15) |
121 | 120 | ||
@@ -165,14 +164,14 @@ | |||
165 | #define S_DMA_CURDSCR_COUNT _SB_MAKE64(40) | 164 | #define S_DMA_CURDSCR_COUNT _SB_MAKE64(40) |
166 | #define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16,S_DMA_CURDSCR_COUNT) | 165 | #define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16,S_DMA_CURDSCR_COUNT) |
167 | 166 | ||
168 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 167 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
169 | #define M_DMA_TX_CH_PAUSE_ON _SB_MAKEMASK1(56) | 168 | #define M_DMA_TX_CH_PAUSE_ON _SB_MAKEMASK1(56) |
170 | #endif /* 1250 PASS3 || 112x PASS1 */ | 169 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
171 | 170 | ||
172 | /* | 171 | /* |
173 | * Receive Packet Drop Registers | 172 | * Receive Packet Drop Registers |
174 | */ | 173 | */ |
175 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 174 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
176 | #define S_DMA_OODLOST_RX _SB_MAKE64(0) | 175 | #define S_DMA_OODLOST_RX _SB_MAKE64(0) |
177 | #define M_DMA_OODLOST_RX _SB_MAKEMASK(16,S_DMA_OODLOST_RX) | 176 | #define M_DMA_OODLOST_RX _SB_MAKEMASK(16,S_DMA_OODLOST_RX) |
178 | #define G_DMA_OODLOST_RX(x) _SB_GETVALUE(x,S_DMA_OODLOST_RX,M_DMA_OODLOST_RX) | 177 | #define G_DMA_OODLOST_RX(x) _SB_GETVALUE(x,S_DMA_OODLOST_RX,M_DMA_OODLOST_RX) |
@@ -180,7 +179,7 @@ | |||
180 | #define S_DMA_EOP_COUNT_RX _SB_MAKE64(16) | 179 | #define S_DMA_EOP_COUNT_RX _SB_MAKE64(16) |
181 | #define M_DMA_EOP_COUNT_RX _SB_MAKEMASK(8,S_DMA_EOP_COUNT_RX) | 180 | #define M_DMA_EOP_COUNT_RX _SB_MAKEMASK(8,S_DMA_EOP_COUNT_RX) |
182 | #define G_DMA_EOP_COUNT_RX(x) _SB_GETVALUE(x,S_DMA_EOP_COUNT_RX,M_DMA_EOP_COUNT_RX) | 181 | #define G_DMA_EOP_COUNT_RX(x) _SB_GETVALUE(x,S_DMA_EOP_COUNT_RX,M_DMA_EOP_COUNT_RX) |
183 | #endif /* 1250 PASS3 || 112x PASS1 */ | 182 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
184 | 183 | ||
185 | /* ********************************************************************* | 184 | /* ********************************************************************* |
186 | * DMA Descriptors | 185 | * DMA Descriptors |
@@ -201,21 +200,21 @@ | |||
201 | 200 | ||
202 | #define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR) | 201 | #define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR) |
203 | 202 | ||
204 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 203 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
205 | #define S_DMA_DSCRA_A_ADDR_UA _SB_MAKE64(0) | 204 | #define S_DMA_DSCRA_A_ADDR_UA _SB_MAKE64(0) |
206 | #define M_DMA_DSCRA_A_ADDR_UA _SB_MAKEMASK(40,S_DMA_DSCRA_A_ADDR_UA) | 205 | #define M_DMA_DSCRA_A_ADDR_UA _SB_MAKEMASK(40,S_DMA_DSCRA_A_ADDR_UA) |
207 | #endif /* 1250 PASS3 || 112x PASS1 */ | 206 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
208 | 207 | ||
209 | #define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40) | 208 | #define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40) |
210 | #define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9,S_DMA_DSCRA_A_SIZE) | 209 | #define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9,S_DMA_DSCRA_A_SIZE) |
211 | #define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRA_A_SIZE) | 210 | #define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRA_A_SIZE) |
212 | #define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRA_A_SIZE,M_DMA_DSCRA_A_SIZE) | 211 | #define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRA_A_SIZE,M_DMA_DSCRA_A_SIZE) |
213 | 212 | ||
214 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 213 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
215 | #define S_DMA_DSCRA_DSCR_CNT _SB_MAKE64(40) | 214 | #define S_DMA_DSCRA_DSCR_CNT _SB_MAKE64(40) |
216 | #define M_DMA_DSCRA_DSCR_CNT _SB_MAKEMASK(8,S_DMA_DSCRA_DSCR_CNT) | 215 | #define M_DMA_DSCRA_DSCR_CNT _SB_MAKEMASK(8,S_DMA_DSCRA_DSCR_CNT) |
217 | #define G_DMA_DSCRA_DSCR_CNT(x) _SB_GETVALUE(x,S_DMA_DSCRA_DSCR_CNT,M_DMA_DSCRA_DSCR_CNT) | 216 | #define G_DMA_DSCRA_DSCR_CNT(x) _SB_GETVALUE(x,S_DMA_DSCRA_DSCR_CNT,M_DMA_DSCRA_DSCR_CNT) |
218 | #endif /* 1250 PASS3 || 112x PASS1 */ | 217 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
219 | 218 | ||
220 | #define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49) | 219 | #define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49) |
221 | #define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50) | 220 | #define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50) |
@@ -235,12 +234,12 @@ | |||
235 | #define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_OPTIONS) | 234 | #define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_OPTIONS) |
236 | #define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x,S_DMA_DSCRB_OPTIONS,M_DMA_DSCRB_OPTIONS) | 235 | #define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x,S_DMA_DSCRB_OPTIONS,M_DMA_DSCRB_OPTIONS) |
237 | 236 | ||
238 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 237 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
239 | #define S_DMA_DSCRB_A_SIZE _SB_MAKE64(8) | 238 | #define S_DMA_DSCRB_A_SIZE _SB_MAKE64(8) |
240 | #define M_DMA_DSCRB_A_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_A_SIZE) | 239 | #define M_DMA_DSCRB_A_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_A_SIZE) |
241 | #define V_DMA_DSCRB_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_A_SIZE) | 240 | #define V_DMA_DSCRB_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_A_SIZE) |
242 | #define G_DMA_DSCRB_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRB_A_SIZE,M_DMA_DSCRB_A_SIZE) | 241 | #define G_DMA_DSCRB_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRB_A_SIZE,M_DMA_DSCRB_A_SIZE) |
243 | #endif /* 1250 PASS3 || 112x PASS1 */ | 242 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
244 | 243 | ||
245 | #define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10) | 244 | #define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10) |
246 | 245 | ||
@@ -255,12 +254,12 @@ | |||
255 | 254 | ||
256 | #define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49) | 255 | #define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49) |
257 | 256 | ||
258 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 257 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
259 | #define S_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKE64(48) | 258 | #define S_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKE64(48) |
260 | #define M_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKEMASK(2,S_DMA_DSCRB_PKT_SIZE_MSB) | 259 | #define M_DMA_DSCRB_PKT_SIZE_MSB _SB_MAKEMASK(2,S_DMA_DSCRB_PKT_SIZE_MSB) |
261 | #define V_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB) | 260 | #define V_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB) |
262 | #define G_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_GETVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB,M_DMA_DSCRB_PKT_SIZE_MSB) | 261 | #define G_DMA_DSCRB_PKT_SIZE_MSB(x) _SB_GETVALUE(x,S_DMA_DSCRB_PKT_SIZE_MSB,M_DMA_DSCRB_PKT_SIZE_MSB) |
263 | #endif /* 1250 PASS3 || 112x PASS1 */ | 262 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
264 | 263 | ||
265 | #define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50) | 264 | #define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50) |
266 | #define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_PKT_SIZE) | 265 | #define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_PKT_SIZE) |
@@ -282,15 +281,16 @@ | |||
282 | #define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51) | 281 | #define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51) |
283 | #define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52) | 282 | #define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52) |
284 | 283 | ||
285 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 284 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
286 | /* Note: BADTCPCS is actually in DSCR_B options field */ | 285 | /* Note: This bit is in the DSCR_B options field */ |
287 | #define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0) | 286 | #define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0) |
288 | #endif /* 1250 PASS2 || 112x PASS1 */ | 287 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
289 | 288 | ||
290 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 289 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
290 | /* Note: These bits are in the DSCR_B options field */ | ||
291 | #define M_DMA_ETH_VLAN_FLAG _SB_MAKEMASK1(1) | 291 | #define M_DMA_ETH_VLAN_FLAG _SB_MAKEMASK1(1) |
292 | #define M_DMA_ETH_CRC_FLAG _SB_MAKEMASK1(2) | 292 | #define M_DMA_ETH_CRC_FLAG _SB_MAKEMASK1(2) |
293 | #endif /* 1250 PASS3 || 112x PASS1 */ | 293 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
294 | 294 | ||
295 | #define S_DMA_ETHRX_RXCH 53 | 295 | #define S_DMA_ETHRX_RXCH 53 |
296 | #define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2,S_DMA_ETHRX_RXCH) | 296 | #define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2,S_DMA_ETHRX_RXCH) |
@@ -438,7 +438,7 @@ | |||
438 | M_DM_CUR_DSCR_DSCR_COUNT) | 438 | M_DM_CUR_DSCR_DSCR_COUNT) |
439 | 439 | ||
440 | 440 | ||
441 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 441 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
442 | /* | 442 | /* |
443 | * Data Mover Channel Partial Result Registers | 443 | * Data Mover Channel Partial Result Registers |
444 | * Register: DM_PARTIAL_0 | 444 | * Register: DM_PARTIAL_0 |
@@ -459,10 +459,10 @@ | |||
459 | M_DM_PARTIAL_TCPCS_PARTIAL) | 459 | M_DM_PARTIAL_TCPCS_PARTIAL) |
460 | 460 | ||
461 | #define M_DM_PARTIAL_ODD_BYTE _SB_MAKEMASK1(48) | 461 | #define M_DM_PARTIAL_ODD_BYTE _SB_MAKEMASK1(48) |
462 | #endif /* 1250 PASS3 || 112x PASS1 */ | 462 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
463 | 463 | ||
464 | 464 | ||
465 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 465 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
466 | /* | 466 | /* |
467 | * Data Mover CRC Definition Registers | 467 | * Data Mover CRC Definition Registers |
468 | * Register: CRC_DEF_0 | 468 | * Register: CRC_DEF_0 |
@@ -479,10 +479,10 @@ | |||
479 | #define V_CRC_DEF_CRC_POLY(r) _SB_MAKEVALUE(r,S_CRC_DEF_CRC_POLY) | 479 | #define V_CRC_DEF_CRC_POLY(r) _SB_MAKEVALUE(r,S_CRC_DEF_CRC_POLY) |
480 | #define G_CRC_DEF_CRC_POLY(r) _SB_GETVALUE(r,S_CRC_DEF_CRC_POLY,\ | 480 | #define G_CRC_DEF_CRC_POLY(r) _SB_GETVALUE(r,S_CRC_DEF_CRC_POLY,\ |
481 | M_CRC_DEF_CRC_POLY) | 481 | M_CRC_DEF_CRC_POLY) |
482 | #endif /* 1250 PASS3 || 112x PASS1 */ | 482 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
483 | 483 | ||
484 | 484 | ||
485 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 485 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
486 | /* | 486 | /* |
487 | * Data Mover CRC/Checksum Definition Registers | 487 | * Data Mover CRC/Checksum Definition Registers |
488 | * Register: CTCP_DEF_0 | 488 | * Register: CTCP_DEF_0 |
@@ -511,7 +511,7 @@ | |||
511 | #define K_CTCP_DEF_CRC_WIDTH_1 2 | 511 | #define K_CTCP_DEF_CRC_WIDTH_1 2 |
512 | 512 | ||
513 | #define M_CTCP_DEF_CRC_BIT_ORDER _SB_MAKEMASK1(50) | 513 | #define M_CTCP_DEF_CRC_BIT_ORDER _SB_MAKEMASK1(50) |
514 | #endif /* 1250 PASS3 || 112x PASS1 */ | 514 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
515 | 515 | ||
516 | 516 | ||
517 | /* | 517 | /* |
@@ -560,12 +560,12 @@ | |||
560 | #define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50) | 560 | #define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50) |
561 | #define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51) | 561 | #define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51) |
562 | 562 | ||
563 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 563 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
564 | #define M_DM_DSCRA_RD_BKOFF _SB_MAKEMASK1(52) | 564 | #define M_DM_DSCRA_RD_BKOFF _SB_MAKEMASK1(52) |
565 | #define M_DM_DSCRA_WR_BKOFF _SB_MAKEMASK1(53) | 565 | #define M_DM_DSCRA_WR_BKOFF _SB_MAKEMASK1(53) |
566 | #endif /* 1250 PASS2 || 112x PASS1 */ | 566 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
567 | 567 | ||
568 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 568 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
569 | #define M_DM_DSCRA_TCPCS_EN _SB_MAKEMASK1(54) | 569 | #define M_DM_DSCRA_TCPCS_EN _SB_MAKEMASK1(54) |
570 | #define M_DM_DSCRA_TCPCS_RES _SB_MAKEMASK1(55) | 570 | #define M_DM_DSCRA_TCPCS_RES _SB_MAKEMASK1(55) |
571 | #define M_DM_DSCRA_TCPCS_AP _SB_MAKEMASK1(56) | 571 | #define M_DM_DSCRA_TCPCS_AP _SB_MAKEMASK1(56) |
@@ -574,7 +574,7 @@ | |||
574 | #define M_DM_DSCRA_CRC_AP _SB_MAKEMASK1(59) | 574 | #define M_DM_DSCRA_CRC_AP _SB_MAKEMASK1(59) |
575 | #define M_DM_DSCRA_CRC_DFN _SB_MAKEMASK1(60) | 575 | #define M_DM_DSCRA_CRC_DFN _SB_MAKEMASK1(60) |
576 | #define M_DM_DSCRA_CRC_XBIT _SB_MAKEMASK1(61) | 576 | #define M_DM_DSCRA_CRC_XBIT _SB_MAKEMASK1(61) |
577 | #endif /* 1250 PASS3 || 112x PASS1 */ | 577 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
578 | 578 | ||
579 | #define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(3,61) | 579 | #define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(3,61) |
580 | 580 | ||
diff --git a/include/asm-mips/sibyte/sb1250_genbus.h b/include/asm-mips/sibyte/sb1250_genbus.h index f1f509f295c4..1b5cbc5c6454 100644 --- a/include/asm-mips/sibyte/sb1250_genbus.h +++ b/include/asm-mips/sibyte/sb1250_genbus.h | |||
@@ -6,9 +6,8 @@ | |||
6 | * This module contains constants and macros useful for | 6 | * This module contains constants and macros useful for |
7 | * manipulating the SB1250's Generic Bus interface | 7 | * manipulating the SB1250's Generic Bus interface |
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 10/21/02 |
10 | * | 10 | * BCM1280 specification level: User's Manual 11/14/03 |
11 | * Author: Mitch Lichtenberg | ||
12 | * | 11 | * |
13 | ********************************************************************* | 12 | ********************************************************************* |
14 | * | 13 | * |
@@ -51,19 +50,21 @@ | |||
51 | #define M_IO_WIDTH_SEL _SB_MAKEMASK(2,S_IO_WIDTH_SEL) | 50 | #define M_IO_WIDTH_SEL _SB_MAKEMASK(2,S_IO_WIDTH_SEL) |
52 | #define K_IO_WIDTH_SEL_1 0 | 51 | #define K_IO_WIDTH_SEL_1 0 |
53 | #define K_IO_WIDTH_SEL_2 1 | 52 | #define K_IO_WIDTH_SEL_2 1 |
54 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 53 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ |
54 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
55 | #define K_IO_WIDTH_SEL_1L 2 | 55 | #define K_IO_WIDTH_SEL_1L 2 |
56 | #endif /* 1250 PASS2 || 112x PASS1 */ | 56 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
57 | #define K_IO_WIDTH_SEL_4 3 | 57 | #define K_IO_WIDTH_SEL_4 3 |
58 | #define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x,S_IO_WIDTH_SEL) | 58 | #define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x,S_IO_WIDTH_SEL) |
59 | #define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x,S_IO_WIDTH_SEL,M_IO_WIDTH_SEL) | 59 | #define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x,S_IO_WIDTH_SEL,M_IO_WIDTH_SEL) |
60 | 60 | ||
61 | #define S_IO_PARITY_ENA 4 | 61 | #define S_IO_PARITY_ENA 4 |
62 | #define M_IO_PARITY_ENA _SB_MAKEMASK1(S_IO_PARITY_ENA) | 62 | #define M_IO_PARITY_ENA _SB_MAKEMASK1(S_IO_PARITY_ENA) |
63 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 63 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ |
64 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
64 | #define S_IO_BURST_EN 5 | 65 | #define S_IO_BURST_EN 5 |
65 | #define M_IO_BURST_EN _SB_MAKEMASK1(S_IO_BURST_EN) | 66 | #define M_IO_BURST_EN _SB_MAKEMASK1(S_IO_BURST_EN) |
66 | #endif /* 1250 PASS2 || 112x PASS1 */ | 67 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
67 | #define S_IO_PARITY_ODD 6 | 68 | #define S_IO_PARITY_ODD 6 |
68 | #define M_IO_PARITY_ODD _SB_MAKEMASK1(S_IO_PARITY_ODD) | 69 | #define M_IO_PARITY_ODD _SB_MAKEMASK1(S_IO_PARITY_ODD) |
69 | #define S_IO_NONMUX 7 | 70 | #define S_IO_NONMUX 7 |
@@ -96,8 +97,11 @@ | |||
96 | 97 | ||
97 | #define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */ | 98 | #define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */ |
98 | 99 | ||
100 | #define M_IO_BLK_CACHE _SB_MAKEMASK1(15) | ||
101 | |||
102 | |||
99 | /* | 103 | /* |
100 | * Generic Bus Region 0 Timing Registers (Table 11-7) | 104 | * Generic Bus Timing 0 Registers (Table 11-7) |
101 | */ | 105 | */ |
102 | 106 | ||
103 | #define S_IO_ALE_WIDTH 0 | 107 | #define S_IO_ALE_WIDTH 0 |
@@ -105,21 +109,23 @@ | |||
105 | #define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x,S_IO_ALE_WIDTH) | 109 | #define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x,S_IO_ALE_WIDTH) |
106 | #define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x,S_IO_ALE_WIDTH,M_IO_ALE_WIDTH) | 110 | #define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x,S_IO_ALE_WIDTH,M_IO_ALE_WIDTH) |
107 | 111 | ||
108 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 112 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ |
113 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
109 | #define M_IO_EARLY_CS _SB_MAKEMASK1(3) | 114 | #define M_IO_EARLY_CS _SB_MAKEMASK1(3) |
110 | #endif /* 1250 PASS2 || 112x PASS1 */ | 115 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
111 | 116 | ||
112 | #define S_IO_ALE_TO_CS 4 | 117 | #define S_IO_ALE_TO_CS 4 |
113 | #define M_IO_ALE_TO_CS _SB_MAKEMASK(2,S_IO_ALE_TO_CS) | 118 | #define M_IO_ALE_TO_CS _SB_MAKEMASK(2,S_IO_ALE_TO_CS) |
114 | #define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_CS) | 119 | #define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_CS) |
115 | #define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x,S_IO_ALE_TO_CS,M_IO_ALE_TO_CS) | 120 | #define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x,S_IO_ALE_TO_CS,M_IO_ALE_TO_CS) |
116 | 121 | ||
117 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 122 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ |
123 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
118 | #define S_IO_BURST_WIDTH _SB_MAKE64(6) | 124 | #define S_IO_BURST_WIDTH _SB_MAKE64(6) |
119 | #define M_IO_BURST_WIDTH _SB_MAKEMASK(2,S_IO_BURST_WIDTH) | 125 | #define M_IO_BURST_WIDTH _SB_MAKEMASK(2,S_IO_BURST_WIDTH) |
120 | #define V_IO_BURST_WIDTH(x) _SB_MAKEVALUE(x,S_IO_BURST_WIDTH) | 126 | #define V_IO_BURST_WIDTH(x) _SB_MAKEVALUE(x,S_IO_BURST_WIDTH) |
121 | #define G_IO_BURST_WIDTH(x) _SB_GETVALUE(x,S_IO_BURST_WIDTH,M_IO_BURST_WIDTH) | 127 | #define G_IO_BURST_WIDTH(x) _SB_GETVALUE(x,S_IO_BURST_WIDTH,M_IO_BURST_WIDTH) |
122 | #endif /* 1250 PASS2 || 112x PASS1 */ | 128 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
123 | 129 | ||
124 | #define S_IO_CS_WIDTH 8 | 130 | #define S_IO_CS_WIDTH 8 |
125 | #define M_IO_CS_WIDTH _SB_MAKEMASK(5,S_IO_CS_WIDTH) | 131 | #define M_IO_CS_WIDTH _SB_MAKEMASK(5,S_IO_CS_WIDTH) |
@@ -141,9 +147,10 @@ | |||
141 | #define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_WRITE) | 147 | #define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_WRITE) |
142 | #define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x,S_IO_ALE_TO_WRITE,M_IO_ALE_TO_WRITE) | 148 | #define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x,S_IO_ALE_TO_WRITE,M_IO_ALE_TO_WRITE) |
143 | 149 | ||
144 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 150 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) \ |
151 | || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
145 | #define M_IO_RDY_SYNC _SB_MAKEMASK1(3) | 152 | #define M_IO_RDY_SYNC _SB_MAKEMASK1(3) |
146 | #endif /* 1250 PASS2 || 112x PASS1 */ | 153 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
147 | 154 | ||
148 | #define S_IO_WRITE_WIDTH 4 | 155 | #define S_IO_WRITE_WIDTH 4 |
149 | #define M_IO_WRITE_WIDTH _SB_MAKEMASK(4,S_IO_WRITE_WIDTH) | 156 | #define M_IO_WRITE_WIDTH _SB_MAKEMASK(4,S_IO_WRITE_WIDTH) |
@@ -183,9 +190,127 @@ | |||
183 | #define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10) | 190 | #define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10) |
184 | #define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11) | 191 | #define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11) |
185 | #define M_IO_MULT_CS_INT _SB_MAKEMASK1(12) | 192 | #define M_IO_MULT_CS_INT _SB_MAKEMASK1(12) |
186 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 193 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
187 | #define M_IO_COH_ERR _SB_MAKEMASK1(14) | 194 | #define M_IO_COH_ERR _SB_MAKEMASK1(14) |
188 | #endif /* 1250 PASS2 || 112x PASS1 */ | 195 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
196 | |||
197 | |||
198 | /* | ||
199 | * Generic Bus Output Drive Control Register 0 (Table 14-18) | ||
200 | */ | ||
201 | |||
202 | #define S_IO_SLEW0 0 | ||
203 | #define M_IO_SLEW0 _SB_MAKEMASK(2,S_IO_SLEW0) | ||
204 | #define V_IO_SLEW0(x) _SB_MAKEVALUE(x,S_IO_SLEW0) | ||
205 | #define G_IO_SLEW0(x) _SB_GETVALUE(x,S_IO_SLEW0,M_IO_SLEW0) | ||
206 | |||
207 | #define S_IO_DRV_A 2 | ||
208 | #define M_IO_DRV_A _SB_MAKEMASK(2,S_IO_DRV_A) | ||
209 | #define V_IO_DRV_A(x) _SB_MAKEVALUE(x,S_IO_DRV_A) | ||
210 | #define G_IO_DRV_A(x) _SB_GETVALUE(x,S_IO_DRV_A,M_IO_DRV_A) | ||
211 | |||
212 | #define S_IO_DRV_B 6 | ||
213 | #define M_IO_DRV_B _SB_MAKEMASK(2,S_IO_DRV_B) | ||
214 | #define V_IO_DRV_B(x) _SB_MAKEVALUE(x,S_IO_DRV_B) | ||
215 | #define G_IO_DRV_B(x) _SB_GETVALUE(x,S_IO_DRV_B,M_IO_DRV_B) | ||
216 | |||
217 | #define S_IO_DRV_C 10 | ||
218 | #define M_IO_DRV_C _SB_MAKEMASK(2,S_IO_DRV_C) | ||
219 | #define V_IO_DRV_C(x) _SB_MAKEVALUE(x,S_IO_DRV_C) | ||
220 | #define G_IO_DRV_C(x) _SB_GETVALUE(x,S_IO_DRV_C,M_IO_DRV_C) | ||
221 | |||
222 | #define S_IO_DRV_D 14 | ||
223 | #define M_IO_DRV_D _SB_MAKEMASK(2,S_IO_DRV_D) | ||
224 | #define V_IO_DRV_D(x) _SB_MAKEVALUE(x,S_IO_DRV_D) | ||
225 | #define G_IO_DRV_D(x) _SB_GETVALUE(x,S_IO_DRV_D,M_IO_DRV_D) | ||
226 | |||
227 | /* | ||
228 | * Generic Bus Output Drive Control Register 1 (Table 14-19) | ||
229 | */ | ||
230 | |||
231 | #define S_IO_DRV_E 2 | ||
232 | #define M_IO_DRV_E _SB_MAKEMASK(2,S_IO_DRV_E) | ||
233 | #define V_IO_DRV_E(x) _SB_MAKEVALUE(x,S_IO_DRV_E) | ||
234 | #define G_IO_DRV_E(x) _SB_GETVALUE(x,S_IO_DRV_E,M_IO_DRV_E) | ||
235 | |||
236 | #define S_IO_DRV_F 6 | ||
237 | #define M_IO_DRV_F _SB_MAKEMASK(2,S_IO_DRV_F) | ||
238 | #define V_IO_DRV_F(x) _SB_MAKEVALUE(x,S_IO_DRV_F) | ||
239 | #define G_IO_DRV_F(x) _SB_GETVALUE(x,S_IO_DRV_F,M_IO_DRV_F) | ||
240 | |||
241 | #define S_IO_SLEW1 8 | ||
242 | #define M_IO_SLEW1 _SB_MAKEMASK(2,S_IO_SLEW1) | ||
243 | #define V_IO_SLEW1(x) _SB_MAKEVALUE(x,S_IO_SLEW1) | ||
244 | #define G_IO_SLEW1(x) _SB_GETVALUE(x,S_IO_SLEW1,M_IO_SLEW1) | ||
245 | |||
246 | #define S_IO_DRV_G 10 | ||
247 | #define M_IO_DRV_G _SB_MAKEMASK(2,S_IO_DRV_G) | ||
248 | #define V_IO_DRV_G(x) _SB_MAKEVALUE(x,S_IO_DRV_G) | ||
249 | #define G_IO_DRV_G(x) _SB_GETVALUE(x,S_IO_DRV_G,M_IO_DRV_G) | ||
250 | |||
251 | #define S_IO_SLEW2 12 | ||
252 | #define M_IO_SLEW2 _SB_MAKEMASK(2,S_IO_SLEW2) | ||
253 | #define V_IO_SLEW2(x) _SB_MAKEVALUE(x,S_IO_SLEW2) | ||
254 | #define G_IO_SLEW2(x) _SB_GETVALUE(x,S_IO_SLEW2,M_IO_SLEW2) | ||
255 | |||
256 | #define S_IO_DRV_H 14 | ||
257 | #define M_IO_DRV_H _SB_MAKEMASK(2,S_IO_DRV_H) | ||
258 | #define V_IO_DRV_H(x) _SB_MAKEVALUE(x,S_IO_DRV_H) | ||
259 | #define G_IO_DRV_H(x) _SB_GETVALUE(x,S_IO_DRV_H,M_IO_DRV_H) | ||
260 | |||
261 | /* | ||
262 | * Generic Bus Output Drive Control Register 2 (Table 14-20) | ||
263 | */ | ||
264 | |||
265 | #define S_IO_DRV_J 2 | ||
266 | #define M_IO_DRV_J _SB_MAKEMASK(2,S_IO_DRV_J) | ||
267 | #define V_IO_DRV_J(x) _SB_MAKEVALUE(x,S_IO_DRV_J) | ||
268 | #define G_IO_DRV_J(x) _SB_GETVALUE(x,S_IO_DRV_J,M_IO_DRV_J) | ||
269 | |||
270 | #define S_IO_DRV_K 6 | ||
271 | #define M_IO_DRV_K _SB_MAKEMASK(2,S_IO_DRV_K) | ||
272 | #define V_IO_DRV_K(x) _SB_MAKEVALUE(x,S_IO_DRV_K) | ||
273 | #define G_IO_DRV_K(x) _SB_GETVALUE(x,S_IO_DRV_K,M_IO_DRV_K) | ||
274 | |||
275 | #define S_IO_DRV_L 10 | ||
276 | #define M_IO_DRV_L _SB_MAKEMASK(2,S_IO_DRV_L) | ||
277 | #define V_IO_DRV_L(x) _SB_MAKEVALUE(x,S_IO_DRV_L) | ||
278 | #define G_IO_DRV_L(x) _SB_GETVALUE(x,S_IO_DRV_L,M_IO_DRV_L) | ||
279 | |||
280 | #define S_IO_DRV_M 14 | ||
281 | #define M_IO_DRV_M _SB_MAKEMASK(2,S_IO_DRV_M) | ||
282 | #define V_IO_DRV_M(x) _SB_MAKEVALUE(x,S_IO_DRV_M) | ||
283 | #define G_IO_DRV_M(x) _SB_GETVALUE(x,S_IO_DRV_M,M_IO_DRV_M) | ||
284 | |||
285 | /* | ||
286 | * Generic Bus Output Drive Control Register 3 (Table 14-21) | ||
287 | */ | ||
288 | |||
289 | #define S_IO_SLEW3 0 | ||
290 | #define M_IO_SLEW3 _SB_MAKEMASK(2,S_IO_SLEW3) | ||
291 | #define V_IO_SLEW3(x) _SB_MAKEVALUE(x,S_IO_SLEW3) | ||
292 | #define G_IO_SLEW3(x) _SB_GETVALUE(x,S_IO_SLEW3,M_IO_SLEW3) | ||
293 | |||
294 | #define S_IO_DRV_N 2 | ||
295 | #define M_IO_DRV_N _SB_MAKEMASK(2,S_IO_DRV_N) | ||
296 | #define V_IO_DRV_N(x) _SB_MAKEVALUE(x,S_IO_DRV_N) | ||
297 | #define G_IO_DRV_N(x) _SB_GETVALUE(x,S_IO_DRV_N,M_IO_DRV_N) | ||
298 | |||
299 | #define S_IO_DRV_P 6 | ||
300 | #define M_IO_DRV_P _SB_MAKEMASK(2,S_IO_DRV_P) | ||
301 | #define V_IO_DRV_P(x) _SB_MAKEVALUE(x,S_IO_DRV_P) | ||
302 | #define G_IO_DRV_P(x) _SB_GETVALUE(x,S_IO_DRV_P,M_IO_DRV_P) | ||
303 | |||
304 | #define S_IO_DRV_Q 10 | ||
305 | #define M_IO_DRV_Q _SB_MAKEMASK(2,S_IO_DRV_Q) | ||
306 | #define V_IO_DRV_Q(x) _SB_MAKEVALUE(x,S_IO_DRV_Q) | ||
307 | #define G_IO_DRV_Q(x) _SB_GETVALUE(x,S_IO_DRV_Q,M_IO_DRV_Q) | ||
308 | |||
309 | #define S_IO_DRV_R 14 | ||
310 | #define M_IO_DRV_R _SB_MAKEMASK(2,S_IO_DRV_R) | ||
311 | #define V_IO_DRV_R(x) _SB_MAKEVALUE(x,S_IO_DRV_R) | ||
312 | #define G_IO_DRV_R(x) _SB_GETVALUE(x,S_IO_DRV_R,M_IO_DRV_R) | ||
313 | |||
189 | 314 | ||
190 | /* | 315 | /* |
191 | * PCMCIA configuration register (Table 12-6) | 316 | * PCMCIA configuration register (Table 12-6) |
@@ -202,6 +327,22 @@ | |||
202 | #define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8) | 327 | #define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8) |
203 | #define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9) | 328 | #define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9) |
204 | 329 | ||
330 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
331 | #define S_PCMCIA_MODE 16 | ||
332 | #define M_PCMCIA_MODE _SB_MAKEMASK(3,S_PCMCIA_MODE) | ||
333 | #define V_PCMCIA_MODE(x) _SB_MAKEVALUE(x,S_PCMCIA_MODE) | ||
334 | #define G_PCMCIA_MODE(x) _SB_GETVALUE(x,S_PCMCIA_MODE,M_PCMCIA_MODE) | ||
335 | |||
336 | #define K_PCMCIA_MODE_PCMA_NOB 0 /* standard PCMCIA "A", no "B" */ | ||
337 | #define K_PCMCIA_MODE_IDEA_NOB 1 /* IDE "A", no "B" */ | ||
338 | #define K_PCMCIA_MODE_PCMIOA_NOB 2 /* PCMCIA with I/O "A", no "B" */ | ||
339 | #define K_PCMCIA_MODE_PCMA_PCMB 4 /* standard PCMCIA "A", standard PCMCIA "B" */ | ||
340 | #define K_PCMCIA_MODE_IDEA_PCMB 5 /* IDE "A", standard PCMCIA "B" */ | ||
341 | #define K_PCMCIA_MODE_PCMA_IDEB 6 /* standard PCMCIA "A", IDE "B" */ | ||
342 | #define K_PCMCIA_MODE_IDEA_IDEB 7 /* IDE "A", IDE "B" */ | ||
343 | #endif | ||
344 | |||
345 | |||
205 | /* | 346 | /* |
206 | * PCMCIA status register (Table 12-7) | 347 | * PCMCIA status register (Table 12-7) |
207 | */ | 348 | */ |
@@ -272,5 +413,62 @@ | |||
272 | #define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE14) | 413 | #define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE14) |
273 | #define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE14,M_GPIO_INTR_TYPE14) | 414 | #define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE14,M_GPIO_INTR_TYPE14) |
274 | 415 | ||
416 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
417 | |||
418 | /* | ||
419 | * GPIO Interrupt Additional Type Register | ||
420 | */ | ||
421 | |||
422 | #define K_GPIO_INTR_BOTHEDGE 0 | ||
423 | #define K_GPIO_INTR_RISEEDGE 1 | ||
424 | #define K_GPIO_INTR_UNPRED1 2 | ||
425 | #define K_GPIO_INTR_UNPRED2 3 | ||
426 | |||
427 | #define S_GPIO_INTR_ATYPEX(n) (((n)/2)*2) | ||
428 | #define M_GPIO_INTR_ATYPEX(n) _SB_MAKEMASK(2,S_GPIO_INTR_ATYPEX(n)) | ||
429 | #define V_GPIO_INTR_ATYPEX(n,x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPEX(n)) | ||
430 | #define G_GPIO_INTR_ATYPEX(n,x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPEX(n),M_GPIO_INTR_ATYPEX(n)) | ||
431 | |||
432 | #define S_GPIO_INTR_ATYPE0 0 | ||
433 | #define M_GPIO_INTR_ATYPE0 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE0) | ||
434 | #define V_GPIO_INTR_ATYPE0(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE0) | ||
435 | #define G_GPIO_INTR_ATYPE0(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE0,M_GPIO_INTR_ATYPE0) | ||
436 | |||
437 | #define S_GPIO_INTR_ATYPE2 2 | ||
438 | #define M_GPIO_INTR_ATYPE2 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE2) | ||
439 | #define V_GPIO_INTR_ATYPE2(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE2) | ||
440 | #define G_GPIO_INTR_ATYPE2(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE2,M_GPIO_INTR_ATYPE2) | ||
441 | |||
442 | #define S_GPIO_INTR_ATYPE4 4 | ||
443 | #define M_GPIO_INTR_ATYPE4 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE4) | ||
444 | #define V_GPIO_INTR_ATYPE4(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE4) | ||
445 | #define G_GPIO_INTR_ATYPE4(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE4,M_GPIO_INTR_ATYPE4) | ||
446 | |||
447 | #define S_GPIO_INTR_ATYPE6 6 | ||
448 | #define M_GPIO_INTR_ATYPE6 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE6) | ||
449 | #define V_GPIO_INTR_ATYPE6(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE6) | ||
450 | #define G_GPIO_INTR_ATYPE6(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE6,M_GPIO_INTR_ATYPE6) | ||
451 | |||
452 | #define S_GPIO_INTR_ATYPE8 8 | ||
453 | #define M_GPIO_INTR_ATYPE8 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE8) | ||
454 | #define V_GPIO_INTR_ATYPE8(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE8) | ||
455 | #define G_GPIO_INTR_ATYPE8(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE8,M_GPIO_INTR_ATYPE8) | ||
456 | |||
457 | #define S_GPIO_INTR_ATYPE10 10 | ||
458 | #define M_GPIO_INTR_ATYPE10 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE10) | ||
459 | #define V_GPIO_INTR_ATYPE10(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE10) | ||
460 | #define G_GPIO_INTR_ATYPE10(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE10,M_GPIO_INTR_ATYPE10) | ||
461 | |||
462 | #define S_GPIO_INTR_ATYPE12 12 | ||
463 | #define M_GPIO_INTR_ATYPE12 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE12) | ||
464 | #define V_GPIO_INTR_ATYPE12(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE12) | ||
465 | #define G_GPIO_INTR_ATYPE12(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE12,M_GPIO_INTR_ATYPE12) | ||
466 | |||
467 | #define S_GPIO_INTR_ATYPE14 14 | ||
468 | #define M_GPIO_INTR_ATYPE14 _SB_MAKEMASK(2,S_GPIO_INTR_ATYPE14) | ||
469 | #define V_GPIO_INTR_ATYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_ATYPE14) | ||
470 | #define G_GPIO_INTR_ATYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_ATYPE14,M_GPIO_INTR_ATYPE14) | ||
471 | #endif | ||
472 | |||
275 | 473 | ||
276 | #endif | 474 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250_int.h b/include/asm-mips/sibyte/sb1250_int.h index e173e2ea4c98..05c7b39f1b02 100644 --- a/include/asm-mips/sibyte/sb1250_int.h +++ b/include/asm-mips/sibyte/sb1250_int.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -47,6 +45,10 @@ | |||
47 | * First, the interrupt numbers. | 45 | * First, the interrupt numbers. |
48 | */ | 46 | */ |
49 | 47 | ||
48 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
49 | |||
50 | #define K_INT_SOURCES 64 | ||
51 | |||
50 | #define K_INT_WATCHDOG_TIMER_0 0 | 52 | #define K_INT_WATCHDOG_TIMER_0 0 |
51 | #define K_INT_WATCHDOG_TIMER_1 1 | 53 | #define K_INT_WATCHDOG_TIMER_1 1 |
52 | #define K_INT_TIMER_0 2 | 54 | #define K_INT_TIMER_0 2 |
@@ -244,4 +246,6 @@ | |||
244 | #define M_LDTVECT_RAISEMBOX 0x40 | 246 | #define M_LDTVECT_RAISEMBOX 0x40 |
245 | 247 | ||
246 | 248 | ||
249 | #endif /* 1250/112x */ | ||
250 | |||
247 | #endif | 251 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250_l2c.h b/include/asm-mips/sibyte/sb1250_l2c.h index 8afe8e01581b..842f205094af 100644 --- a/include/asm-mips/sibyte/sb1250_l2c.h +++ b/include/asm-mips/sibyte/sb1250_l2c.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -89,8 +87,13 @@ | |||
89 | #define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x,S_L2C_MGMT_WAY) | 87 | #define V_L2C_MGMT_WAY(x) _SB_MAKEVALUE(x,S_L2C_MGMT_WAY) |
90 | #define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x,S_L2C_MGMT_WAY,M_L2C_MGMT_WAY) | 88 | #define G_L2C_MGMT_WAY(x) _SB_GETVALUE(x,S_L2C_MGMT_WAY,M_L2C_MGMT_WAY) |
91 | 89 | ||
92 | #define S_L2C_MGMT_TAG 21 | 90 | #define S_L2C_MGMT_ECC_DIAG 21 |
93 | #define M_L2C_MGMT_TAG _SB_MAKEMASK(6,S_L2C_MGMT_TAG) | 91 | #define M_L2C_MGMT_ECC_DIAG _SB_MAKEMASK(2,S_L2C_MGMT_ECC_DIAG) |
92 | #define V_L2C_MGMT_ECC_DIAG(x) _SB_MAKEVALUE(x,S_L2C_MGMT_ECC_DIAG) | ||
93 | #define G_L2C_MGMT_ECC_DIAG(x) _SB_GETVALUE(x,S_L2C_MGMT_ECC_DIAG,M_L2C_MGMT_ECC_DIAG) | ||
94 | |||
95 | #define S_L2C_MGMT_TAG 23 | ||
96 | #define M_L2C_MGMT_TAG _SB_MAKEMASK(4,S_L2C_MGMT_TAG) | ||
94 | #define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x,S_L2C_MGMT_TAG) | 97 | #define V_L2C_MGMT_TAG(x) _SB_MAKEVALUE(x,S_L2C_MGMT_TAG) |
95 | #define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x,S_L2C_MGMT_TAG,M_L2C_MGMT_TAG) | 98 | #define G_L2C_MGMT_TAG(x) _SB_GETVALUE(x,S_L2C_MGMT_TAG,M_L2C_MGMT_TAG) |
96 | 99 | ||
diff --git a/include/asm-mips/sibyte/sb1250_ldt.h b/include/asm-mips/sibyte/sb1250_ldt.h index f2617ded0a8f..7092535d1108 100644 --- a/include/asm-mips/sibyte/sb1250_ldt.h +++ b/include/asm-mips/sibyte/sb1250_ldt.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
diff --git a/include/asm-mips/sibyte/sb1250_mac.h b/include/asm-mips/sibyte/sb1250_mac.h index 18e74e43f4a2..adfc688fa559 100644 --- a/include/asm-mips/sibyte/sb1250_mac.h +++ b/include/asm-mips/sibyte/sb1250_mac.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -81,7 +79,10 @@ | |||
81 | #define M_MAC_RESERVED1 _SB_MAKEMASK(8,9) | 79 | #define M_MAC_RESERVED1 _SB_MAKEMASK(8,9) |
82 | 80 | ||
83 | #define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17) | 81 | #define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17) |
84 | #define M_MAC_RESERVED2 _SB_MAKEMASK1(18) | 82 | |
83 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
84 | #define M_MAC_TIMESTAMP _SB_MAKEMASK1(18) | ||
85 | #endif | ||
85 | #define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19) | 86 | #define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19) |
86 | #define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20) | 87 | #define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20) |
87 | #define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21) | 88 | #define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21) |
@@ -132,9 +133,9 @@ | |||
132 | #define M_MAC_RX_CH_SEL_MSB _SB_MAKEMASK1(44) | 133 | #define M_MAC_RX_CH_SEL_MSB _SB_MAKEMASK1(44) |
133 | #endif /* 1250 PASS2 || 112x PASS1 */ | 134 | #endif /* 1250 PASS2 || 112x PASS1 */ |
134 | 135 | ||
135 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 136 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
136 | #define M_MAC_SPLIT_CH_SEL _SB_MAKEMASK1(45) | 137 | #define M_MAC_SPLIT_CH_SEL _SB_MAKEMASK1(45) |
137 | #endif /* 1250 PASS3 || 112x PASS1 */ | 138 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
138 | 139 | ||
139 | #define S_MAC_BYPASS_IFG _SB_MAKE64(46) | 140 | #define S_MAC_BYPASS_IFG _SB_MAKE64(46) |
140 | #define M_MAC_BYPASS_IFG _SB_MAKEMASK(8,S_MAC_BYPASS_IFG) | 141 | #define M_MAC_BYPASS_IFG _SB_MAKEMASK(8,S_MAC_BYPASS_IFG) |
@@ -176,10 +177,22 @@ | |||
176 | 177 | ||
177 | #define M_MAC_PORT_RESET _SB_MAKEMASK1(8) | 178 | #define M_MAC_PORT_RESET _SB_MAKEMASK1(8) |
178 | 179 | ||
180 | #if (SIBYTE_HDR_FEATURE_CHIP(1250) || SIBYTE_HDR_FEATURE_CHIP(112x)) | ||
179 | #define M_MAC_RX_ENABLE _SB_MAKEMASK1(10) | 181 | #define M_MAC_RX_ENABLE _SB_MAKEMASK1(10) |
180 | #define M_MAC_TX_ENABLE _SB_MAKEMASK1(11) | 182 | #define M_MAC_TX_ENABLE _SB_MAKEMASK1(11) |
181 | #define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12) | 183 | #define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12) |
182 | #define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13) | 184 | #define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13) |
185 | #endif | ||
186 | |||
187 | /* | ||
188 | * MAC reset information register (1280/1255) | ||
189 | */ | ||
190 | #if SIBYTE_HDR_FEATURE_CHIP(1480) | ||
191 | #define M_MAC_RX_CH0_PAUSE_ON _SB_MAKEMASK1(8) | ||
192 | #define M_MAC_RX_CH1_PAUSE_ON _SB_MAKEMASK1(16) | ||
193 | #define M_MAC_TX_CH0_PAUSE_ON _SB_MAKEMASK1(24) | ||
194 | #define M_MAC_TX_CH1_PAUSE_ON _SB_MAKEMASK1(32) | ||
195 | #endif | ||
183 | 196 | ||
184 | /* | 197 | /* |
185 | * MAC DMA Control Register | 198 | * MAC DMA Control Register |
@@ -267,12 +280,12 @@ | |||
267 | #define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x,S_MAC_IFG_RX) | 280 | #define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x,S_MAC_IFG_RX) |
268 | #define G_MAC_IFG_RX(x) _SB_GETVALUE(x,S_MAC_IFG_RX,M_MAC_IFG_RX) | 281 | #define G_MAC_IFG_RX(x) _SB_GETVALUE(x,S_MAC_IFG_RX,M_MAC_IFG_RX) |
269 | 282 | ||
270 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 283 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
271 | #define S_MAC_PRE_LEN _SB_MAKE64(0) | 284 | #define S_MAC_PRE_LEN _SB_MAKE64(0) |
272 | #define M_MAC_PRE_LEN _SB_MAKEMASK(6,S_MAC_PRE_LEN) | 285 | #define M_MAC_PRE_LEN _SB_MAKEMASK(6,S_MAC_PRE_LEN) |
273 | #define V_MAC_PRE_LEN(x) _SB_MAKEVALUE(x,S_MAC_PRE_LEN) | 286 | #define V_MAC_PRE_LEN(x) _SB_MAKEVALUE(x,S_MAC_PRE_LEN) |
274 | #define G_MAC_PRE_LEN(x) _SB_GETVALUE(x,S_MAC_PRE_LEN,M_MAC_PRE_LEN) | 287 | #define G_MAC_PRE_LEN(x) _SB_GETVALUE(x,S_MAC_PRE_LEN,M_MAC_PRE_LEN) |
275 | #endif /* 1250 PASS3 || 112x PASS1 */ | 288 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
276 | 289 | ||
277 | #define S_MAC_IFG_TX _SB_MAKE64(6) | 290 | #define S_MAC_IFG_TX _SB_MAKE64(6) |
278 | #define M_MAC_IFG_TX _SB_MAKEMASK(6,S_MAC_IFG_TX) | 291 | #define M_MAC_IFG_TX _SB_MAKEMASK(6,S_MAC_IFG_TX) |
@@ -458,9 +471,9 @@ | |||
458 | #define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x,S_MAC_COUNTER_ADDR) | 471 | #define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x,S_MAC_COUNTER_ADDR) |
459 | #define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x,S_MAC_COUNTER_ADDR,M_MAC_COUNTER_ADDR) | 472 | #define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x,S_MAC_COUNTER_ADDR,M_MAC_COUNTER_ADDR) |
460 | 473 | ||
461 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 474 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
462 | #define M_MAC_TX_PAUSE_ON _SB_MAKEMASK1(52) | 475 | #define M_MAC_TX_PAUSE_ON _SB_MAKEMASK1(52) |
463 | #endif /* 1250 PASS3 || 112x PASS1 */ | 476 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
464 | 477 | ||
465 | /* | 478 | /* |
466 | * MAC Fifo Pointer Registers (Table 9-19) [Debug register] | 479 | * MAC Fifo Pointer Registers (Table 9-19) [Debug register] |
@@ -594,7 +607,7 @@ | |||
594 | #define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_IPHDR_OFFSET) | 607 | #define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_IPHDR_OFFSET) |
595 | #define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x,S_MAC_IPHDR_OFFSET,M_MAC_IPHDR_OFFSET) | 608 | #define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x,S_MAC_IPHDR_OFFSET,M_MAC_IPHDR_OFFSET) |
596 | 609 | ||
597 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 610 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
598 | #define S_MAC_RX_CRC_OFFSET _SB_MAKE64(16) | 611 | #define S_MAC_RX_CRC_OFFSET _SB_MAKE64(16) |
599 | #define M_MAC_RX_CRC_OFFSET _SB_MAKEMASK(8,S_MAC_RX_CRC_OFFSET) | 612 | #define M_MAC_RX_CRC_OFFSET _SB_MAKEMASK(8,S_MAC_RX_CRC_OFFSET) |
600 | #define V_MAC_RX_CRC_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_RX_CRC_OFFSET) | 613 | #define V_MAC_RX_CRC_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_RX_CRC_OFFSET) |
@@ -612,7 +625,7 @@ | |||
612 | #define M_MAC_RX_CH_MSN_SEL _SB_MAKEMASK(8,S_MAC_RX_CH_MSN_SEL) | 625 | #define M_MAC_RX_CH_MSN_SEL _SB_MAKEMASK(8,S_MAC_RX_CH_MSN_SEL) |
613 | #define V_MAC_RX_CH_MSN_SEL(x) _SB_MAKEVALUE(x,S_MAC_RX_CH_MSN_SEL) | 626 | #define V_MAC_RX_CH_MSN_SEL(x) _SB_MAKEVALUE(x,S_MAC_RX_CH_MSN_SEL) |
614 | #define G_MAC_RX_CH_MSN_SEL(x) _SB_GETVALUE(x,S_MAC_RX_CH_MSN_SEL,M_MAC_RX_CH_MSN_SEL) | 627 | #define G_MAC_RX_CH_MSN_SEL(x) _SB_GETVALUE(x,S_MAC_RX_CH_MSN_SEL,M_MAC_RX_CH_MSN_SEL) |
615 | #endif /* 1250 PASS3 || 112x PASS1 */ | 628 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ |
616 | 629 | ||
617 | /* | 630 | /* |
618 | * MAC Receive Channel Select Registers (Table 9-25) | 631 | * MAC Receive Channel Select Registers (Table 9-25) |
diff --git a/include/asm-mips/sibyte/sb1250_mc.h b/include/asm-mips/sibyte/sb1250_mc.h index 1dd41c927996..26e421498c97 100644 --- a/include/asm-mips/sibyte/sb1250_mc.h +++ b/include/asm-mips/sibyte/sb1250_mc.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -324,6 +322,10 @@ | |||
324 | #define K_MC_tRFC_DEFAULT 12 | 322 | #define K_MC_tRFC_DEFAULT 12 |
325 | #define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT) | 323 | #define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT) |
326 | 324 | ||
325 | #if SIBYTE_HDR_FEATURE(1250, PASS3) | ||
326 | #define M_MC_tRFC_PLUS16 _SB_MAKEMASK1(51) /* 1250C3 and later. */ | ||
327 | #endif | ||
328 | |||
327 | #define S_MC_tCwCr 40 | 329 | #define S_MC_tCwCr 40 |
328 | #define M_MC_tCwCr _SB_MAKEMASK(4,S_MC_tCwCr) | 330 | #define M_MC_tCwCr _SB_MAKEMASK(4,S_MC_tCwCr) |
329 | #define V_MC_tCwCr(x) _SB_MAKEVALUE(x,S_MC_tCwCr) | 331 | #define V_MC_tCwCr(x) _SB_MAKEVALUE(x,S_MC_tCwCr) |
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h index 9db80cd13a79..bab3a4580a36 100644 --- a/include/asm-mips/sibyte/sb1250_regs.h +++ b/include/asm-mips/sibyte/sb1250_regs.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: 01/02/2002 | 9 | * SB1250 specification level: 01/02/2002 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -61,6 +59,8 @@ | |||
61 | * XXX: can't remove MC base 0 if 112x, since it's used by other macros, | 59 | * XXX: can't remove MC base 0 if 112x, since it's used by other macros, |
62 | * since there is one reg there (but it could get its addr/offset constant). | 60 | * since there is one reg there (but it could get its addr/offset constant). |
63 | */ | 61 | */ |
62 | |||
63 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | ||
64 | #define A_MC_BASE_0 0x0010051000 | 64 | #define A_MC_BASE_0 0x0010051000 |
65 | #define A_MC_BASE_1 0x0010052000 | 65 | #define A_MC_BASE_1 0x0010052000 |
66 | #define MC_REGISTER_SPACING 0x1000 | 66 | #define MC_REGISTER_SPACING 0x1000 |
@@ -101,10 +101,14 @@ | |||
101 | #define R_MC_TEST_ECC 0x0000000420 | 101 | #define R_MC_TEST_ECC 0x0000000420 |
102 | #define R_MC_MCLK_CFG 0x0000000500 | 102 | #define R_MC_MCLK_CFG 0x0000000500 |
103 | 103 | ||
104 | #endif /* 1250 & 112x */ | ||
105 | |||
104 | /* ********************************************************************* | 106 | /* ********************************************************************* |
105 | * L2 Cache Control Registers | 107 | * L2 Cache Control Registers |
106 | ********************************************************************* */ | 108 | ********************************************************************* */ |
107 | 109 | ||
110 | #if SIBYTE_HDR_FEATURE_1250_112x /* This L2C only on 1250/112x */ | ||
111 | |||
108 | #define A_L2_READ_TAG 0x0010040018 | 112 | #define A_L2_READ_TAG 0x0010040018 |
109 | #define A_L2_ECC_TAG 0x0010040038 | 113 | #define A_L2_ECC_TAG 0x0010040038 |
110 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) | 114 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) |
@@ -125,13 +129,16 @@ | |||
125 | #define A_L2_READ_ADDRESS A_L2_READ_TAG | 129 | #define A_L2_READ_ADDRESS A_L2_READ_TAG |
126 | #define A_L2_EEC_ADDRESS A_L2_ECC_TAG | 130 | #define A_L2_EEC_ADDRESS A_L2_ECC_TAG |
127 | 131 | ||
132 | #endif | ||
128 | 133 | ||
129 | /* ********************************************************************* | 134 | /* ********************************************************************* |
130 | * PCI Interface Registers | 135 | * PCI Interface Registers |
131 | ********************************************************************* */ | 136 | ********************************************************************* */ |
132 | 137 | ||
138 | #if SIBYTE_HDR_FEATURE_1250_112x /* This PCI/HT only on 1250/112x */ | ||
133 | #define A_PCI_TYPE00_HEADER 0x00DE000000 | 139 | #define A_PCI_TYPE00_HEADER 0x00DE000000 |
134 | #define A_PCI_TYPE01_HEADER 0x00DE000800 | 140 | #define A_PCI_TYPE01_HEADER 0x00DE000800 |
141 | #endif | ||
135 | 142 | ||
136 | 143 | ||
137 | /* ********************************************************************* | 144 | /* ********************************************************************* |
@@ -264,15 +271,15 @@ | |||
264 | ********************************************************************* */ | 271 | ********************************************************************* */ |
265 | 272 | ||
266 | 273 | ||
274 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | ||
267 | #define R_DUART_NUM_PORTS 2 | 275 | #define R_DUART_NUM_PORTS 2 |
268 | 276 | ||
269 | #define A_DUART 0x0010060000 | 277 | #define A_DUART 0x0010060000 |
270 | 278 | ||
271 | #define A_DUART_REG(r) | ||
272 | |||
273 | #define DUART_CHANREG_SPACING 0x100 | 279 | #define DUART_CHANREG_SPACING 0x100 |
274 | #define A_DUART_CHANREG(chan,reg) (A_DUART + DUART_CHANREG_SPACING*(chan) + (reg)) | 280 | #define A_DUART_CHANREG(chan,reg) (A_DUART + DUART_CHANREG_SPACING*(chan) + (reg)) |
275 | #define R_DUART_CHANREG(chan,reg) (DUART_CHANREG_SPACING*(chan) + (reg)) | 281 | #define R_DUART_CHANREG(chan,reg) (DUART_CHANREG_SPACING*(chan) + (reg)) |
282 | #endif /* 1250 & 112x */ | ||
276 | 283 | ||
277 | #define R_DUART_MODE_REG_1 0x100 | 284 | #define R_DUART_MODE_REG_1 0x100 |
278 | #define R_DUART_MODE_REG_2 0x110 | 285 | #define R_DUART_MODE_REG_2 0x110 |
@@ -307,11 +314,13 @@ | |||
307 | 314 | ||
308 | #define DUART_IMRISR_SPACING 0x20 | 315 | #define DUART_IMRISR_SPACING 0x20 |
309 | 316 | ||
317 | #if SIBYTE_HDR_FEATURE_1250_112x /* This MC only on 1250 & 112x */ | ||
310 | #define R_DUART_IMRREG(chan) (R_DUART_IMR_A + (chan)*DUART_IMRISR_SPACING) | 318 | #define R_DUART_IMRREG(chan) (R_DUART_IMR_A + (chan)*DUART_IMRISR_SPACING) |
311 | #define R_DUART_ISRREG(chan) (R_DUART_ISR_A + (chan)*DUART_IMRISR_SPACING) | 319 | #define R_DUART_ISRREG(chan) (R_DUART_ISR_A + (chan)*DUART_IMRISR_SPACING) |
312 | 320 | ||
313 | #define A_DUART_IMRREG(chan) (A_DUART + R_DUART_IMRREG(chan)) | 321 | #define A_DUART_IMRREG(chan) (A_DUART + R_DUART_IMRREG(chan)) |
314 | #define A_DUART_ISRREG(chan) (A_DUART + R_DUART_ISRREG(chan)) | 322 | #define A_DUART_ISRREG(chan) (A_DUART + R_DUART_ISRREG(chan)) |
323 | #endif /* 1250 & 112x */ | ||
315 | 324 | ||
316 | 325 | ||
317 | 326 | ||
@@ -368,6 +377,8 @@ | |||
368 | ********************************************************************* */ | 377 | ********************************************************************* */ |
369 | 378 | ||
370 | 379 | ||
380 | #if SIBYTE_HDR_FEATURE_1250_112x /* sync serial only on 1250/112x */ | ||
381 | |||
371 | #define A_SER_BASE_0 0x0010060400 | 382 | #define A_SER_BASE_0 0x0010060400 |
372 | #define A_SER_BASE_1 0x0010060800 | 383 | #define A_SER_BASE_1 0x0010060800 |
373 | #define SER_SPACING 0x400 | 384 | #define SER_SPACING 0x400 |
@@ -457,6 +468,8 @@ | |||
457 | #define R_SER_RMON_RX_ERRORS 0x000001F0 | 468 | #define R_SER_RMON_RX_ERRORS 0x000001F0 |
458 | #define R_SER_RMON_RX_BADADDR 0x000001F8 | 469 | #define R_SER_RMON_RX_BADADDR 0x000001F8 |
459 | 470 | ||
471 | #endif /* 1250/112x */ | ||
472 | |||
460 | /* ********************************************************************* | 473 | /* ********************************************************************* |
461 | * Generic Bus Registers | 474 | * Generic Bus Registers |
462 | ********************************************************************* */ | 475 | ********************************************************************* */ |
@@ -634,12 +647,13 @@ | |||
634 | 647 | ||
635 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 648 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) |
636 | #define A_SCD_SCRATCH 0x0010020C10 | 649 | #define A_SCD_SCRATCH 0x0010020C10 |
650 | #endif /* 1250 PASS2 || 112x PASS1 */ | ||
637 | 651 | ||
652 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) | ||
638 | #define A_SCD_ZBBUS_CYCLE_COUNT 0x0010030000 | 653 | #define A_SCD_ZBBUS_CYCLE_COUNT 0x0010030000 |
639 | #define A_SCD_ZBBUS_CYCLE_CP0 0x0010020C00 | 654 | #define A_SCD_ZBBUS_CYCLE_CP0 0x0010020C00 |
640 | #define A_SCD_ZBBUS_CYCLE_CP1 0x0010020C08 | 655 | #define A_SCD_ZBBUS_CYCLE_CP1 0x0010020C08 |
641 | #endif /* 1250 PASS2 || 112x PASS1 */ | 656 | #endif |
642 | |||
643 | 657 | ||
644 | /* ********************************************************************* | 658 | /* ********************************************************************* |
645 | * System Control Registers | 659 | * System Control Registers |
@@ -667,15 +681,16 @@ | |||
667 | #define A_ADDR_TRAP_CFG_1 0x0010020448 | 681 | #define A_ADDR_TRAP_CFG_1 0x0010020448 |
668 | #define A_ADDR_TRAP_CFG_2 0x0010020450 | 682 | #define A_ADDR_TRAP_CFG_2 0x0010020450 |
669 | #define A_ADDR_TRAP_CFG_3 0x0010020458 | 683 | #define A_ADDR_TRAP_CFG_3 0x0010020458 |
670 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 684 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
671 | #define A_ADDR_TRAP_REG_DEBUG 0x0010020460 | 685 | #define A_ADDR_TRAP_REG_DEBUG 0x0010020460 |
672 | #endif /* 1250 PASS2 || 112x PASS1 */ | 686 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
673 | 687 | ||
674 | 688 | ||
675 | /* ********************************************************************* | 689 | /* ********************************************************************* |
676 | * System Interrupt Mapper Registers | 690 | * System Interrupt Mapper Registers |
677 | ********************************************************************* */ | 691 | ********************************************************************* */ |
678 | 692 | ||
693 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
679 | #define A_IMR_CPU0_BASE 0x0010020000 | 694 | #define A_IMR_CPU0_BASE 0x0010020000 |
680 | #define A_IMR_CPU1_BASE 0x0010022000 | 695 | #define A_IMR_CPU1_BASE 0x0010022000 |
681 | #define IMR_REGISTER_SPACING 0x2000 | 696 | #define IMR_REGISTER_SPACING 0x2000 |
@@ -700,6 +715,7 @@ | |||
700 | #define R_IMR_INTERRUPT_STATUS_COUNT 7 | 715 | #define R_IMR_INTERRUPT_STATUS_COUNT 7 |
701 | #define R_IMR_INTERRUPT_MAP_BASE 0x0200 | 716 | #define R_IMR_INTERRUPT_MAP_BASE 0x0200 |
702 | #define R_IMR_INTERRUPT_MAP_COUNT 64 | 717 | #define R_IMR_INTERRUPT_MAP_COUNT 64 |
718 | #endif /* 1250/112x */ | ||
703 | 719 | ||
704 | /* ********************************************************************* | 720 | /* ********************************************************************* |
705 | * System Performance Counter Registers | 721 | * System Performance Counter Registers |
@@ -718,6 +734,7 @@ | |||
718 | #define A_SCD_BUS_ERR_STATUS 0x0010020880 | 734 | #define A_SCD_BUS_ERR_STATUS 0x0010020880 |
719 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 735 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) |
720 | #define A_SCD_BUS_ERR_STATUS_DEBUG 0x00100208D0 | 736 | #define A_SCD_BUS_ERR_STATUS_DEBUG 0x00100208D0 |
737 | #define A_BUS_ERR_STATUS_DEBUG 0x00100208D0 | ||
721 | #endif /* 1250 PASS2 || 112x PASS1 */ | 738 | #endif /* 1250 PASS2 || 112x PASS1 */ |
722 | #define A_BUS_ERR_DATA_0 0x00100208A0 | 739 | #define A_BUS_ERR_DATA_0 0x00100208A0 |
723 | #define A_BUS_ERR_DATA_1 0x00100208A8 | 740 | #define A_BUS_ERR_DATA_1 0x00100208A8 |
@@ -798,6 +815,7 @@ | |||
798 | * Physical Address Map | 815 | * Physical Address Map |
799 | ********************************************************************* */ | 816 | ********************************************************************* */ |
800 | 817 | ||
818 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
801 | #define A_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000) | 819 | #define A_PHYS_MEMORY_0 _SB_MAKE64(0x0000000000) |
802 | #define A_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024)) | 820 | #define A_PHYS_MEMORY_SIZE _SB_MAKE64((256*1024*1024)) |
803 | #define A_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000) | 821 | #define A_PHYS_SYSTEM_CTL _SB_MAKE64(0x0010000000) |
@@ -831,6 +849,7 @@ | |||
831 | #define A_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D01A0000) | 849 | #define A_PHYS_L2CACHE_WAY1 _SB_MAKE64(0x00D01A0000) |
832 | #define A_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D01C0000) | 850 | #define A_PHYS_L2CACHE_WAY2 _SB_MAKE64(0x00D01C0000) |
833 | #define A_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D01E0000) | 851 | #define A_PHYS_L2CACHE_WAY3 _SB_MAKE64(0x00D01E0000) |
852 | #endif | ||
834 | 853 | ||
835 | 854 | ||
836 | #endif | 855 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h index dbbd682fb47e..a667bc14a7cd 100644 --- a/include/asm-mips/sibyte/sb1250_scd.h +++ b/include/asm-mips/sibyte/sb1250_scd.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -51,26 +49,70 @@ | |||
51 | #define V_SYS_REVISION(x) _SB_MAKEVALUE(x,S_SYS_REVISION) | 49 | #define V_SYS_REVISION(x) _SB_MAKEVALUE(x,S_SYS_REVISION) |
52 | #define G_SYS_REVISION(x) _SB_GETVALUE(x,S_SYS_REVISION,M_SYS_REVISION) | 50 | #define G_SYS_REVISION(x) _SB_GETVALUE(x,S_SYS_REVISION,M_SYS_REVISION) |
53 | 51 | ||
54 | #if SIBYTE_HDR_FEATURE_CHIP(1250) | 52 | #define K_SYS_REVISION_BCM1250_PASS1 0x01 |
55 | #define K_SYS_REVISION_BCM1250_PASS1 1 | 53 | |
56 | #define K_SYS_REVISION_BCM1250_PASS2 3 | 54 | #define K_SYS_REVISION_BCM1250_PASS2 0x03 |
57 | #define K_SYS_REVISION_BCM1250_A10 11 | 55 | #define K_SYS_REVISION_BCM1250_A1 0x03 /* Pass 2.0 WB */ |
58 | #define K_SYS_REVISION_BCM1250_PASS2_2 16 | 56 | #define K_SYS_REVISION_BCM1250_A2 0x04 /* Pass 2.0 FC */ |
59 | #define K_SYS_REVISION_BCM1250_B2 17 | 57 | #define K_SYS_REVISION_BCM1250_A3 0x05 /* Pass 2.1 FC */ |
60 | #define K_SYS_REVISION_BCM1250_PASS3 32 | 58 | #define K_SYS_REVISION_BCM1250_A4 0x06 /* Pass 2.1 WB */ |
61 | #define K_SYS_REVISION_BCM1250_C1 33 | 59 | #define K_SYS_REVISION_BCM1250_A6 0x07 /* OR 0x04 (A2) w/WID != 0 */ |
60 | #define K_SYS_REVISION_BCM1250_A8 0x0b /* A8/A10 */ | ||
61 | #define K_SYS_REVISION_BCM1250_A9 0x08 | ||
62 | #define K_SYS_REVISION_BCM1250_A10 K_SYS_REVISION_BCM1250_A8 | ||
62 | 63 | ||
64 | #define K_SYS_REVISION_BCM1250_PASS2_2 0x10 | ||
65 | #define K_SYS_REVISION_BCM1250_B0 K_SYS_REVISION_BCM1250_B1 | ||
66 | #define K_SYS_REVISION_BCM1250_B1 0x10 | ||
67 | #define K_SYS_REVISION_BCM1250_B2 0x11 | ||
68 | |||
69 | #define K_SYS_REVISION_BCM1250_C0 0x20 | ||
70 | #define K_SYS_REVISION_BCM1250_C1 0x21 | ||
71 | #define K_SYS_REVISION_BCM1250_C2 0x22 | ||
72 | #define K_SYS_REVISION_BCM1250_C3 0x23 | ||
73 | |||
74 | #if SIBYTE_HDR_FEATURE_CHIP(1250) | ||
63 | /* XXX: discourage people from using these constants. */ | 75 | /* XXX: discourage people from using these constants. */ |
64 | #define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1 | 76 | #define K_SYS_REVISION_PASS1 K_SYS_REVISION_BCM1250_PASS1 |
65 | #define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2 | 77 | #define K_SYS_REVISION_PASS2 K_SYS_REVISION_BCM1250_PASS2 |
66 | #define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2 | 78 | #define K_SYS_REVISION_PASS2_2 K_SYS_REVISION_BCM1250_PASS2_2 |
67 | #define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3 | 79 | #define K_SYS_REVISION_PASS3 K_SYS_REVISION_BCM1250_PASS3 |
80 | #define K_SYS_REVISION_BCM1250_PASS3 K_SYS_REVISION_BCM1250_C0 | ||
68 | #endif /* 1250 */ | 81 | #endif /* 1250 */ |
69 | 82 | ||
70 | #if SIBYTE_HDR_FEATURE_CHIP(112x) | 83 | #define K_SYS_REVISION_BCM112x_A1 0x20 |
71 | #define K_SYS_REVISION_BCM112x_A1 32 | 84 | #define K_SYS_REVISION_BCM112x_A2 0x21 |
72 | #define K_SYS_REVISION_BCM112x_A2 33 | 85 | #define K_SYS_REVISION_BCM112x_A3 0x22 |
73 | #endif /* 112x */ | 86 | #define K_SYS_REVISION_BCM112x_A4 0x23 |
87 | |||
88 | #define K_SYS_REVISION_BCM1480_S0 0x01 | ||
89 | #define K_SYS_REVISION_BCM1480_A1 0x02 | ||
90 | #define K_SYS_REVISION_BCM1480_A2 0x03 | ||
91 | #define K_SYS_REVISION_BCM1480_A3 0x04 | ||
92 | #define K_SYS_REVISION_BCM1480_B0 0x11 | ||
93 | |||
94 | /*Cache size - 23:20 of revision register*/ | ||
95 | #define S_SYS_L2C_SIZE _SB_MAKE64(20) | ||
96 | #define M_SYS_L2C_SIZE _SB_MAKEMASK(4,S_SYS_L2C_SIZE) | ||
97 | #define V_SYS_L2C_SIZE(x) _SB_MAKEVALUE(x,S_SYS_L2C_SIZE) | ||
98 | #define G_SYS_L2C_SIZE(x) _SB_GETVALUE(x,S_SYS_L2C_SIZE,M_SYS_L2C_SIZE) | ||
99 | |||
100 | #define K_SYS_L2C_SIZE_1MB 0 | ||
101 | #define K_SYS_L2C_SIZE_512KB 5 | ||
102 | #define K_SYS_L2C_SIZE_256KB 2 | ||
103 | #define K_SYS_L2C_SIZE_128KB 1 | ||
104 | |||
105 | #define K_SYS_L2C_SIZE_BCM1250 K_SYS_L2C_SIZE_512KB | ||
106 | #define K_SYS_L2C_SIZE_BCM1125 K_SYS_L2C_SIZE_256KB | ||
107 | #define K_SYS_L2C_SIZE_BCM1122 K_SYS_L2C_SIZE_128KB | ||
108 | |||
109 | |||
110 | /* Number of CPU cores, bits 27:24 of revision register*/ | ||
111 | #define S_SYS_NUM_CPUS _SB_MAKE64(24) | ||
112 | #define M_SYS_NUM_CPUS _SB_MAKEMASK(4,S_SYS_NUM_CPUS) | ||
113 | #define V_SYS_NUM_CPUS(x) _SB_MAKEVALUE(x,S_SYS_NUM_CPUS) | ||
114 | #define G_SYS_NUM_CPUS(x) _SB_GETVALUE(x,S_SYS_NUM_CPUS,M_SYS_NUM_CPUS) | ||
115 | |||
74 | 116 | ||
75 | /* XXX: discourage people from using these constants. */ | 117 | /* XXX: discourage people from using these constants. */ |
76 | #define S_SYS_PART _SB_MAKE64(16) | 118 | #define S_SYS_PART _SB_MAKE64(16) |
@@ -83,6 +125,8 @@ | |||
83 | #define K_SYS_PART_BCM1120 0x1121 | 125 | #define K_SYS_PART_BCM1120 0x1121 |
84 | #define K_SYS_PART_BCM1125 0x1123 | 126 | #define K_SYS_PART_BCM1125 0x1123 |
85 | #define K_SYS_PART_BCM1125H 0x1124 | 127 | #define K_SYS_PART_BCM1125H 0x1124 |
128 | #define K_SYS_PART_BCM1122 0x1113 | ||
129 | |||
86 | 130 | ||
87 | /* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */ | 131 | /* The "peripheral set" (SOC type) is the low 4 bits of the "part" field. */ |
88 | #define S_SYS_SOC_TYPE _SB_MAKE64(16) | 132 | #define S_SYS_SOC_TYPE _SB_MAKE64(16) |
@@ -96,6 +140,8 @@ | |||
96 | #define K_SYS_SOC_TYPE_BCM1125 0x3 | 140 | #define K_SYS_SOC_TYPE_BCM1125 0x3 |
97 | #define K_SYS_SOC_TYPE_BCM1125H 0x4 | 141 | #define K_SYS_SOC_TYPE_BCM1125H 0x4 |
98 | #define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */ | 142 | #define K_SYS_SOC_TYPE_BCM1250_ALT2 0x5 /* 1250pass2 w/ 1/2 L2. */ |
143 | #define K_SYS_SOC_TYPE_BCM1x80 0x6 | ||
144 | #define K_SYS_SOC_TYPE_BCM1x55 0x7 | ||
99 | 145 | ||
100 | /* | 146 | /* |
101 | * Calculate correct SOC type given a copy of system revision register. | 147 | * Calculate correct SOC type given a copy of system revision register. |
@@ -127,10 +173,12 @@ | |||
127 | #define V_SYS_WID(x) _SB_MAKEVALUE(x,S_SYS_WID) | 173 | #define V_SYS_WID(x) _SB_MAKEVALUE(x,S_SYS_WID) |
128 | #define G_SYS_WID(x) _SB_GETVALUE(x,S_SYS_WID,M_SYS_WID) | 174 | #define G_SYS_WID(x) _SB_GETVALUE(x,S_SYS_WID,M_SYS_WID) |
129 | 175 | ||
130 | /* System Manufacturing Register | 176 | /* |
131 | * Register: SCD_SYSTEM_MANUF | 177 | * System Manufacturing Register |
132 | */ | 178 | * Register: SCD_SYSTEM_MANUF |
179 | */ | ||
133 | 180 | ||
181 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
134 | /* Wafer ID: bits 31:0 */ | 182 | /* Wafer ID: bits 31:0 */ |
135 | #define S_SYS_WAFERID1_200 _SB_MAKE64(0) | 183 | #define S_SYS_WAFERID1_200 _SB_MAKE64(0) |
136 | #define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200) | 184 | #define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200) |
@@ -139,8 +187,8 @@ | |||
139 | 187 | ||
140 | #define S_SYS_BIN _SB_MAKE64(32) | 188 | #define S_SYS_BIN _SB_MAKE64(32) |
141 | #define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN) | 189 | #define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN) |
142 | #define V_SYS_BIN _SB_MAKEVALUE(x,S_SYS_BIN) | 190 | #define V_SYS_BIN(x) _SB_MAKEVALUE(x,S_SYS_BIN) |
143 | #define G_SYS_BIN _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN) | 191 | #define G_SYS_BIN(x) _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN) |
144 | 192 | ||
145 | /* Wafer ID: bits 39:36 */ | 193 | /* Wafer ID: bits 39:36 */ |
146 | #define S_SYS_WAFERID2_200 _SB_MAKE64(36) | 194 | #define S_SYS_WAFERID2_200 _SB_MAKE64(36) |
@@ -163,12 +211,14 @@ | |||
163 | #define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS) | 211 | #define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS) |
164 | #define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS) | 212 | #define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS) |
165 | #define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS) | 213 | #define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS) |
214 | #endif | ||
166 | 215 | ||
167 | /* | 216 | /* |
168 | * System Config Register (Table 4-2) | 217 | * System Config Register (Table 4-2) |
169 | * Register: SCD_SYSTEM_CFG | 218 | * Register: SCD_SYSTEM_CFG |
170 | */ | 219 | */ |
171 | 220 | ||
221 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
172 | #define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3) | 222 | #define M_SYS_LDT_PLL_BYP _SB_MAKEMASK1(3) |
173 | #define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4) | 223 | #define M_SYS_PCI_SYNC_TEST_MODE _SB_MAKEMASK1(4) |
174 | #define M_SYS_IOB0_DIV _SB_MAKEMASK1(5) | 224 | #define M_SYS_IOB0_DIV _SB_MAKEMASK1(5) |
@@ -253,6 +303,8 @@ | |||
253 | #define M_SYS_SW_FLAG _SB_MAKEMASK1(63) | 303 | #define M_SYS_SW_FLAG _SB_MAKEMASK1(63) |
254 | #endif /* 1250 PASS2 || 112x PASS1 */ | 304 | #endif /* 1250 PASS2 || 112x PASS1 */ |
255 | 305 | ||
306 | #endif | ||
307 | |||
256 | 308 | ||
257 | /* | 309 | /* |
258 | * Mailbox Registers (Table 4-3) | 310 | * Mailbox Registers (Table 4-3) |
@@ -326,6 +378,7 @@ | |||
326 | * System Performance Counters | 378 | * System Performance Counters |
327 | */ | 379 | */ |
328 | 380 | ||
381 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
329 | #define S_SPC_CFG_SRC0 0 | 382 | #define S_SPC_CFG_SRC0 0 |
330 | #define M_SPC_CFG_SRC0 _SB_MAKEMASK(8,S_SPC_CFG_SRC0) | 383 | #define M_SPC_CFG_SRC0 _SB_MAKEMASK(8,S_SPC_CFG_SRC0) |
331 | #define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x,S_SPC_CFG_SRC0) | 384 | #define V_SPC_CFG_SRC0(x) _SB_MAKEVALUE(x,S_SPC_CFG_SRC0) |
@@ -348,6 +401,7 @@ | |||
348 | 401 | ||
349 | #define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) | 402 | #define M_SPC_CFG_CLEAR _SB_MAKEMASK1(32) |
350 | #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) | 403 | #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33) |
404 | #endif | ||
351 | 405 | ||
352 | 406 | ||
353 | /* | 407 | /* |
@@ -412,6 +466,7 @@ | |||
412 | * Address Trap Registers | 466 | * Address Trap Registers |
413 | */ | 467 | */ |
414 | 468 | ||
469 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
415 | #define M_ATRAP_INDEX _SB_MAKEMASK(4,0) | 470 | #define M_ATRAP_INDEX _SB_MAKEMASK(4,0) |
416 | #define M_ATRAP_ADDRESS _SB_MAKEMASK(40,0) | 471 | #define M_ATRAP_ADDRESS _SB_MAKEMASK(40,0) |
417 | 472 | ||
@@ -436,7 +491,6 @@ | |||
436 | #define K_BUS_AGENT_IOB0 2 | 491 | #define K_BUS_AGENT_IOB0 2 |
437 | #define K_BUS_AGENT_IOB1 3 | 492 | #define K_BUS_AGENT_IOB1 3 |
438 | #define K_BUS_AGENT_SCD 4 | 493 | #define K_BUS_AGENT_SCD 4 |
439 | #define K_BUS_AGENT_RESERVED 5 | ||
440 | #define K_BUS_AGENT_L2C 6 | 494 | #define K_BUS_AGENT_L2C 6 |
441 | #define K_BUS_AGENT_MC 7 | 495 | #define K_BUS_AGENT_MC 7 |
442 | 496 | ||
@@ -454,10 +508,14 @@ | |||
454 | #define K_ATRAP_CFG_CATTR_NOTNONCOH 6 | 508 | #define K_ATRAP_CFG_CATTR_NOTNONCOH 6 |
455 | #define K_ATRAP_CFG_CATTR_NOTCOHERENT 7 | 509 | #define K_ATRAP_CFG_CATTR_NOTCOHERENT 7 |
456 | 510 | ||
511 | #endif /* 1250/112x */ | ||
512 | |||
457 | /* | 513 | /* |
458 | * Trace Buffer Config register | 514 | * Trace Buffer Config register |
459 | */ | 515 | */ |
460 | 516 | ||
517 | #if SIBYTE_HDR_FEATURE_1250_112x | ||
518 | |||
461 | #define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) | 519 | #define M_SCD_TRACE_CFG_RESET _SB_MAKEMASK1(0) |
462 | #define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) | 520 | #define M_SCD_TRACE_CFG_START_READ _SB_MAKEMASK1(1) |
463 | #define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) | 521 | #define M_SCD_TRACE_CFG_START _SB_MAKEMASK1(2) |
@@ -475,6 +533,8 @@ | |||
475 | #define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR) | 533 | #define V_SCD_TRACE_CFG_CUR_ADDR(x) _SB_MAKEVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR) |
476 | #define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR,M_SCD_TRACE_CFG_CUR_ADDR) | 534 | #define G_SCD_TRACE_CFG_CUR_ADDR(x) _SB_GETVALUE(x,S_SCD_TRACE_CFG_CUR_ADDR,M_SCD_TRACE_CFG_CUR_ADDR) |
477 | 535 | ||
536 | #endif /* 1250/112x */ | ||
537 | |||
478 | /* | 538 | /* |
479 | * Trace Event registers | 539 | * Trace Event registers |
480 | */ | 540 | */ |
@@ -578,5 +638,7 @@ | |||
578 | #define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20) | 638 | #define M_SCD_TRSEQ_DEBUGPIN _SB_MAKEMASK1(20) |
579 | #define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21) | 639 | #define M_SCD_TRSEQ_DEBUGCPU _SB_MAKEMASK1(21) |
580 | #define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22) | 640 | #define M_SCD_TRSEQ_CLEARUSE _SB_MAKEMASK1(22) |
641 | #define M_SCD_TRSEQ_ALLD_A _SB_MAKEMASK1(23) | ||
642 | #define M_SCD_TRSEQ_ALL_A _SB_MAKEMASK1(24) | ||
581 | 643 | ||
582 | #endif | 644 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250_smbus.h b/include/asm-mips/sibyte/sb1250_smbus.h index 335c53e92936..279a912213cd 100644 --- a/include/asm-mips/sibyte/sb1250_smbus.h +++ b/include/asm-mips/sibyte/sb1250_smbus.h | |||
@@ -6,9 +6,8 @@ | |||
6 | * This module contains constants and macros useful for | 6 | * This module contains constants and macros useful for |
7 | * manipulating the SB1250's SMbus devices. | 7 | * manipulating the SB1250's SMbus devices. |
8 | * | 8 | * |
9 | * SB1250 specification level: 01/02/2002 | 9 | * SB1250 specification level: 10/21/02 |
10 | * | 10 | * BCM1280 specification level: 11/24/03 |
11 | * Author: Mitch Lichtenberg | ||
12 | * | 11 | * |
13 | ********************************************************************* | 12 | ********************************************************************* |
14 | * | 13 | * |
@@ -47,6 +46,7 @@ | |||
47 | 46 | ||
48 | #define K_SMB_FREQ_400KHZ 0x1F | 47 | #define K_SMB_FREQ_400KHZ 0x1F |
49 | #define K_SMB_FREQ_100KHZ 0x7D | 48 | #define K_SMB_FREQ_100KHZ 0x7D |
49 | #define K_SMB_FREQ_10KHZ 1250 | ||
50 | 50 | ||
51 | #define S_SMB_CMD 0 | 51 | #define S_SMB_CMD 0 |
52 | #define M_SMB_CMD _SB_MAKEMASK(8,S_SMB_CMD) | 52 | #define M_SMB_CMD _SB_MAKEMASK(8,S_SMB_CMD) |
@@ -58,7 +58,11 @@ | |||
58 | 58 | ||
59 | #define M_SMB_ERR_INTR _SB_MAKEMASK1(0) | 59 | #define M_SMB_ERR_INTR _SB_MAKEMASK1(0) |
60 | #define M_SMB_FINISH_INTR _SB_MAKEMASK1(1) | 60 | #define M_SMB_FINISH_INTR _SB_MAKEMASK1(1) |
61 | #define M_SMB_DATA_OUT _SB_MAKEMASK1(4) | 61 | |
62 | #define S_SMB_DATA_OUT 4 | ||
63 | #define M_SMB_DATA_OUT _SB_MAKEMASK1(S_SMB_DATA_OUT) | ||
64 | #define V_SMB_DATA_OUT(x) _SB_MAKEVALUE(x,S_SMB_DATA_OUT) | ||
65 | |||
62 | #define M_SMB_DATA_DIR _SB_MAKEMASK1(5) | 66 | #define M_SMB_DATA_DIR _SB_MAKEMASK1(5) |
63 | #define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR | 67 | #define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR |
64 | #define M_SMB_CLK_OUT _SB_MAKEMASK1(6) | 68 | #define M_SMB_CLK_OUT _SB_MAKEMASK1(6) |
@@ -71,8 +75,23 @@ | |||
71 | #define M_SMB_BUSY _SB_MAKEMASK1(0) | 75 | #define M_SMB_BUSY _SB_MAKEMASK1(0) |
72 | #define M_SMB_ERROR _SB_MAKEMASK1(1) | 76 | #define M_SMB_ERROR _SB_MAKEMASK1(1) |
73 | #define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2) | 77 | #define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2) |
74 | #define M_SMB_REF _SB_MAKEMASK1(6) | 78 | |
75 | #define M_SMB_DATA_IN _SB_MAKEMASK1(7) | 79 | #if SIBYTE_HDR_FEATURE(1250, PASS3) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
80 | #define S_SMB_SCL_IN 5 | ||
81 | #define M_SMB_SCL_IN _SB_MAKEMASK1(S_SMB_SCL_IN) | ||
82 | #define V_SMB_SCL_IN(x) _SB_MAKEVALUE(x,S_SMB_SCL_IN) | ||
83 | #define G_SMB_SCL_IN(x) _SB_GETVALUE(x,S_SMB_SCL_IN,M_SMB_SCL_IN) | ||
84 | #endif /* 1250 PASS3 || 112x PASS1 || 1480 */ | ||
85 | |||
86 | #define S_SMB_REF 6 | ||
87 | #define M_SMB_REF _SB_MAKEMASK1(S_SMB_REF) | ||
88 | #define V_SMB_REF(x) _SB_MAKEVALUE(x,S_SMB_REF) | ||
89 | #define G_SMB_REF(x) _SB_GETVALUE(x,S_SMB_REF,M_SMB_REF) | ||
90 | |||
91 | #define S_SMB_DATA_IN 7 | ||
92 | #define M_SMB_DATA_IN _SB_MAKEMASK1(S_SMB_DATA_IN) | ||
93 | #define V_SMB_DATA_IN(x) _SB_MAKEVALUE(x,S_SMB_DATA_IN) | ||
94 | #define G_SMB_DATA_IN(x) _SB_GETVALUE(x,S_SMB_DATA_IN,M_SMB_DATA_IN) | ||
76 | 95 | ||
77 | /* | 96 | /* |
78 | * SMBus Start/Command registers (Table 14-9) | 97 | * SMBus Start/Command registers (Table 14-9) |
@@ -132,16 +151,14 @@ | |||
132 | #define V_SPEC_MB(x) _SB_MAKEVALUE(x,S_SPEC_PEC) | 151 | #define V_SPEC_MB(x) _SB_MAKEVALUE(x,S_SPEC_PEC) |
133 | 152 | ||
134 | 153 | ||
135 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 154 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
136 | 155 | ||
137 | #define S_SMB_CMDH 8 | 156 | #define S_SMB_CMDH 8 |
138 | #define M_SMB_CMDH _SB_MAKEMASK(8,S_SMBH_CMD) | 157 | #define M_SMB_CMDH _SB_MAKEMASK(8,S_SMB_CMDH) |
139 | #define V_SMB_CMDH(x) _SB_MAKEVALUE(x,S_SMBH_CMD) | 158 | #define V_SMB_CMDH(x) _SB_MAKEVALUE(x,S_SMB_CMDH) |
140 | 159 | ||
141 | #define M_SMB_EXTEND _SB_MAKEMASK1(14) | 160 | #define M_SMB_EXTEND _SB_MAKEMASK1(14) |
142 | 161 | ||
143 | #define M_SMB_DIR _SB_MAKEMASK1(13) | ||
144 | |||
145 | #define S_SMB_DFMT 8 | 162 | #define S_SMB_DFMT 8 |
146 | #define M_SMB_DFMT _SB_MAKEMASK(3,S_SMB_DFMT) | 163 | #define M_SMB_DFMT _SB_MAKEMASK(3,S_SMB_DFMT) |
147 | #define V_SMB_DFMT(x) _SB_MAKEVALUE(x,S_SMB_DFMT) | 164 | #define V_SMB_DFMT(x) _SB_MAKEVALUE(x,S_SMB_DFMT) |
@@ -165,6 +182,23 @@ | |||
165 | #define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE) | 182 | #define V_SMB_DFMT_CMD5BYTE V_SMB_DFMT(K_SMB_DFMT_CMD5BYTE) |
166 | #define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED) | 183 | #define V_SMB_DFMT_RESERVED V_SMB_DFMT(K_SMB_DFMT_RESERVED) |
167 | 184 | ||
168 | #endif /* 1250 PASS2 || 112x PASS1 */ | 185 | #define S_SMB_AFMT 11 |
186 | #define M_SMB_AFMT _SB_MAKEMASK(2,S_SMB_AFMT) | ||
187 | #define V_SMB_AFMT(x) _SB_MAKEVALUE(x,S_SMB_AFMT) | ||
188 | #define G_SMB_AFMT(x) _SB_GETVALUE(x,S_SMB_AFMT,M_SMB_AFMT) | ||
189 | |||
190 | #define K_SMB_AFMT_NONE 0 | ||
191 | #define K_SMB_AFMT_ADDR 1 | ||
192 | #define K_SMB_AFMT_ADDR_CMD1BYTE 2 | ||
193 | #define K_SMB_AFMT_ADDR_CMD2BYTE 3 | ||
194 | |||
195 | #define V_SMB_AFMT_NONE V_SMB_AFMT(K_SMB_AFMT_NONE) | ||
196 | #define V_SMB_AFMT_ADDR V_SMB_AFMT(K_SMB_AFMT_ADDR) | ||
197 | #define V_SMB_AFMT_ADDR_CMD1BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD1BYTE) | ||
198 | #define V_SMB_AFMT_ADDR_CMD2BYTE V_SMB_AFMT(K_SMB_AFMT_ADDR_CMD2BYTE) | ||
199 | |||
200 | #define M_SMB_DIR _SB_MAKEMASK1(13) | ||
201 | |||
202 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ | ||
169 | 203 | ||
170 | #endif | 204 | #endif |
diff --git a/include/asm-mips/sibyte/sb1250_syncser.h b/include/asm-mips/sibyte/sb1250_syncser.h index fa2760d38b8b..dd154ac505d8 100644 --- a/include/asm-mips/sibyte/sb1250_syncser.h +++ b/include/asm-mips/sibyte/sb1250_syncser.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h index 923ea4f44e0f..e87045e62bf0 100644 --- a/include/asm-mips/sibyte/sb1250_uart.h +++ b/include/asm-mips/sibyte/sb1250_uart.h | |||
@@ -8,8 +8,6 @@ | |||
8 | * | 8 | * |
9 | * SB1250 specification level: User's manual 1/02/02 | 9 | * SB1250 specification level: User's manual 1/02/02 |
10 | * | 10 | * |
11 | * Author: Mitch Lichtenberg | ||
12 | * | ||
13 | ********************************************************************* | 11 | ********************************************************************* |
14 | * | 12 | * |
15 | * Copyright 2000,2001,2002,2003 | 13 | * Copyright 2000,2001,2002,2003 |
@@ -240,7 +238,12 @@ | |||
240 | */ | 238 | */ |
241 | 239 | ||
242 | #define M_DUART_ISR_TX_A _SB_MAKEMASK1(0) | 240 | #define M_DUART_ISR_TX_A _SB_MAKEMASK1(0) |
243 | #define M_DUART_ISR_RX_A _SB_MAKEMASK1(1) | 241 | |
242 | #define S_DUART_ISR_RX_A 1 | ||
243 | #define M_DUART_ISR_RX_A _SB_MAKEMASK1(S_DUART_ISR_RX_A) | ||
244 | #define V_DUART_ISR_RX_A(x) _SB_MAKEVALUE(x,S_DUART_ISR_RX_A) | ||
245 | #define G_DUART_ISR_RX_A(x) _SB_GETVALUE(x,S_DUART_ISR_RX_A,M_DUART_ISR_RX_A) | ||
246 | |||
244 | #define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) | 247 | #define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2) |
245 | #define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) | 248 | #define M_DUART_ISR_IN_A _SB_MAKEMASK1(3) |
246 | #define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) | 249 | #define M_DUART_ISR_TX_B _SB_MAKEMASK1(4) |
@@ -331,7 +334,7 @@ | |||
331 | #define M_DUART_OUT_PIN_CLR(chan) \ | 334 | #define M_DUART_OUT_PIN_CLR(chan) \ |
332 | (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1) | 335 | (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1) |
333 | 336 | ||
334 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) | 337 | #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) || SIBYTE_HDR_FEATURE_CHIP(1480) |
335 | /* | 338 | /* |
336 | * Full Interrupt Control Register | 339 | * Full Interrupt Control Register |
337 | */ | 340 | */ |
@@ -345,7 +348,7 @@ | |||
345 | #define M_DUART_INT_TIME _SB_MAKEMASK(4,S_DUART_INT_TIME) | 348 | #define M_DUART_INT_TIME _SB_MAKEMASK(4,S_DUART_INT_TIME) |
346 | #define V_DUART_INT_TIME(x) _SB_MAKEVALUE(x,S_DUART_INT_TIME) | 349 | #define V_DUART_INT_TIME(x) _SB_MAKEVALUE(x,S_DUART_INT_TIME) |
347 | #define G_DUART_INT_TIME(x) _SB_GETVALUE(x,S_DUART_INT_TIME,M_DUART_INT_TIME) | 350 | #define G_DUART_INT_TIME(x) _SB_GETVALUE(x,S_DUART_INT_TIME,M_DUART_INT_TIME) |
348 | #endif /* 1250 PASS2 || 112x PASS1 */ | 351 | #endif /* 1250 PASS2 || 112x PASS1 || 1480 */ |
349 | 352 | ||
350 | 353 | ||
351 | /* ********************************************************************** */ | 354 | /* ********************************************************************** */ |
diff --git a/include/asm-mips/sibyte/swarm.h b/include/asm-mips/sibyte/swarm.h index 97fa0494c30c..06e1d528e03a 100644 --- a/include/asm-mips/sibyte/swarm.h +++ b/include/asm-mips/sibyte/swarm.h | |||
@@ -34,7 +34,7 @@ | |||
34 | #define SIBYTE_DEFAULT_CONSOLE "ttyS0,115200" | 34 | #define SIBYTE_DEFAULT_CONSOLE "ttyS0,115200" |
35 | #endif | 35 | #endif |
36 | #ifdef CONFIG_SIBYTE_LITTLESUR | 36 | #ifdef CONFIG_SIBYTE_LITTLESUR |
37 | #define SIBYTE_BOARD_NAME "BCM1250C2 (LittleSur)" | 37 | #define SIBYTE_BOARD_NAME "BCM91250C2 (LittleSur)" |
38 | #define SIBYTE_HAVE_PCMCIA 0 | 38 | #define SIBYTE_HAVE_PCMCIA 0 |
39 | #define SIBYTE_HAVE_IDE 1 | 39 | #define SIBYTE_HAVE_IDE 1 |
40 | #define SIBYTE_DEFAULT_CONSOLE "cfe0" | 40 | #define SIBYTE_DEFAULT_CONSOLE "cfe0" |
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index f7fbebaa0744..8edabb0be23f 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h | |||
@@ -27,14 +27,15 @@ struct sigcontext { | |||
27 | unsigned int sc_fpc_csr; | 27 | unsigned int sc_fpc_csr; |
28 | unsigned int sc_fpc_eir; /* Unused */ | 28 | unsigned int sc_fpc_eir; /* Unused */ |
29 | unsigned int sc_used_math; | 29 | unsigned int sc_used_math; |
30 | unsigned int sc_ssflags; /* Unused */ | 30 | unsigned int sc_dsp; /* dsp status, was sc_ssflags */ |
31 | unsigned long long sc_mdhi; | 31 | unsigned long long sc_mdhi; |
32 | unsigned long long sc_mdlo; | 32 | unsigned long long sc_mdlo; |
33 | 33 | unsigned long sc_hi1; /* Was sc_cause */ | |
34 | unsigned int sc_cause; /* Unused */ | 34 | unsigned long sc_lo1; /* Was sc_badvaddr */ |
35 | unsigned int sc_badvaddr; /* Unused */ | 35 | unsigned long sc_hi2; /* Was sc_sigset[4] */ |
36 | 36 | unsigned long sc_lo2; | |
37 | unsigned long sc_sigset[4]; /* kernel's sigset_t */ | 37 | unsigned long sc_hi3; |
38 | unsigned long sc_lo3; | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 41 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
@@ -48,19 +49,19 @@ struct sigcontext { | |||
48 | * Warning: this structure illdefined with sc_badvaddr being just an unsigned | 49 | * Warning: this structure illdefined with sc_badvaddr being just an unsigned |
49 | * int so it was changed to unsigned long in 2.6.0-test1. This may break | 50 | * int so it was changed to unsigned long in 2.6.0-test1. This may break |
50 | * binary compatibility - no prisoners. | 51 | * binary compatibility - no prisoners. |
52 | * DSP ASE in 2.6.12-rc4. Turn sc_mdhi and sc_mdlo into an array of four | ||
53 | * entries, add sc_dsp and sc_reserved for padding. No prisoners. | ||
51 | */ | 54 | */ |
52 | struct sigcontext { | 55 | struct sigcontext { |
53 | unsigned long sc_regs[32]; | 56 | unsigned long sc_regs[32]; |
54 | unsigned long sc_fpregs[32]; | 57 | unsigned long sc_fpregs[32]; |
55 | unsigned long sc_mdhi; | 58 | unsigned long sc_hi[4]; |
56 | unsigned long sc_mdlo; | 59 | unsigned long sc_lo[4]; |
57 | unsigned long sc_pc; | 60 | unsigned long sc_pc; |
58 | unsigned long sc_badvaddr; | ||
59 | unsigned int sc_status; | ||
60 | unsigned int sc_fpc_csr; | 61 | unsigned int sc_fpc_csr; |
61 | unsigned int sc_fpc_eir; | ||
62 | unsigned int sc_used_math; | 62 | unsigned int sc_used_math; |
63 | unsigned int sc_cause; | 63 | unsigned int sc_dsp; |
64 | unsigned int sc_reserved; | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | #ifdef __KERNEL__ | 67 | #ifdef __KERNEL__ |
@@ -68,23 +69,24 @@ struct sigcontext { | |||
68 | #include <linux/posix_types.h> | 69 | #include <linux/posix_types.h> |
69 | 70 | ||
70 | struct sigcontext32 { | 71 | struct sigcontext32 { |
71 | __u32 sc_regmask; /* Unused */ | 72 | __u32 sc_regmask; /* Unused */ |
72 | __u32 sc_status; | 73 | __u32 sc_status; |
73 | __u64 sc_pc; | 74 | __u64 sc_pc; |
74 | __u64 sc_regs[32]; | 75 | __u64 sc_regs[32]; |
75 | __u64 sc_fpregs[32]; | 76 | __u64 sc_fpregs[32]; |
76 | __u32 sc_ownedfp; /* Unused */ | 77 | __u32 sc_ownedfp; /* Unused */ |
77 | __u32 sc_fpc_csr; | 78 | __u32 sc_fpc_csr; |
78 | __u32 sc_fpc_eir; /* Unused */ | 79 | __u32 sc_fpc_eir; /* Unused */ |
79 | __u32 sc_used_math; | 80 | __u32 sc_used_math; |
80 | __u32 sc_ssflags; /* Unused */ | 81 | __u32 sc_dsp; /* dsp status, was sc_ssflags */ |
81 | __u64 sc_mdhi; | 82 | __u64 sc_mdhi; |
82 | __u64 sc_mdlo; | 83 | __u64 sc_mdlo; |
83 | 84 | __u32 sc_hi1; /* Was sc_cause */ | |
84 | __u32 sc_cause; /* Unused */ | 85 | __u32 sc_lo1; /* Was sc_badvaddr */ |
85 | __u32 sc_badvaddr; /* Unused */ | 86 | __u32 sc_hi2; /* Was sc_sigset[4] */ |
86 | 87 | __u32 sc_lo2; | |
87 | __u32 sc_sigset[4]; /* kernel's sigset_t */ | 88 | __u32 sc_hi3; |
89 | __u32 sc_lo3; | ||
88 | }; | 90 | }; |
89 | #endif /* __KERNEL__ */ | 91 | #endif /* __KERNEL__ */ |
90 | 92 | ||
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h index 698becab5a9e..2ba313d94a78 100644 --- a/include/asm-mips/siginfo.h +++ b/include/asm-mips/siginfo.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/config.h> | 12 | #include <linux/config.h> |
13 | 13 | ||
14 | #define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int)) | ||
14 | #undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ | 15 | #undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */ |
15 | 16 | ||
16 | #define HAVE_ARCH_SIGINFO_T | 17 | #define HAVE_ARCH_SIGINFO_T |
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h index f2c470f1d369..8ca539e80d87 100644 --- a/include/asm-mips/signal.h +++ b/include/asm-mips/signal.h | |||
@@ -98,12 +98,39 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ | |||
98 | #define MINSIGSTKSZ 2048 | 98 | #define MINSIGSTKSZ 2048 |
99 | #define SIGSTKSZ 8192 | 99 | #define SIGSTKSZ 8192 |
100 | 100 | ||
101 | #ifdef __KERNEL__ | ||
102 | |||
103 | /* | ||
104 | * These values of sa_flags are used only by the kernel as part of the | ||
105 | * irq handling routines. | ||
106 | * | ||
107 | * SA_INTERRUPT is also used by the irq handling routines. | ||
108 | * SA_SHIRQ flag is for shared interrupt support on PCI and EISA. | ||
109 | */ | ||
110 | #define SA_SAMPLE_RANDOM SA_RESTART | ||
111 | |||
112 | #ifdef CONFIG_TRAD_SIGNALS | ||
113 | #define sig_uses_siginfo(ka) ((ka)->sa.sa_flags & SA_SIGINFO) | ||
114 | #else | ||
115 | #define sig_uses_siginfo(ka) (1) | ||
116 | #endif | ||
117 | |||
118 | #endif /* __KERNEL__ */ | ||
119 | |||
101 | #define SIG_BLOCK 1 /* for blocking signals */ | 120 | #define SIG_BLOCK 1 /* for blocking signals */ |
102 | #define SIG_UNBLOCK 2 /* for unblocking signals */ | 121 | #define SIG_UNBLOCK 2 /* for unblocking signals */ |
103 | #define SIG_SETMASK 3 /* for setting the signal mask */ | 122 | #define SIG_SETMASK 3 /* for setting the signal mask */ |
104 | #define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: | 123 | #define SIG_SETMASK32 256 /* Goodie from SGI for BSD compatibility: |
105 | set only the low 32 bit of the sigset. */ | 124 | set only the low 32 bit of the sigset. */ |
106 | #include <asm-generic/signal.h> | 125 | |
126 | /* Type of a signal handler. */ | ||
127 | typedef void __signalfn_t(int); | ||
128 | typedef __signalfn_t __user *__sighandler_t; | ||
129 | |||
130 | /* Fake signal functions */ | ||
131 | #define SIG_DFL ((__sighandler_t)0) /* default signal handling */ | ||
132 | #define SIG_IGN ((__sighandler_t)1) /* ignore signal */ | ||
133 | #define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ | ||
107 | 134 | ||
108 | struct sigaction { | 135 | struct sigaction { |
109 | unsigned int sa_flags; | 136 | unsigned int sa_flags; |
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h index 0e00dd474afc..fb78773a5efe 100644 --- a/include/asm-mips/sn/sn0/arch.h +++ b/include/asm-mips/sn/sn0/arch.h | |||
@@ -74,13 +74,8 @@ | |||
74 | #define MAX_MEM_SLOTS 32 /* max slots per node */ | 74 | #define MAX_MEM_SLOTS 32 /* max slots per node */ |
75 | #endif /* defined(N_MODE) */ | 75 | #endif /* defined(N_MODE) */ |
76 | 76 | ||
77 | #if SABLE_RTL | ||
78 | #define SLOT_SHIFT (28) | ||
79 | #define SLOT_MIN_MEM_SIZE (16*1024*1024) | ||
80 | #else | ||
81 | #define SLOT_SHIFT (27) | 77 | #define SLOT_SHIFT (27) |
82 | #define SLOT_MIN_MEM_SIZE (32*1024*1024) | 78 | #define SLOT_MIN_MEM_SIZE (32*1024*1024) |
83 | #endif | ||
84 | 79 | ||
85 | #define CPUS_PER_NODE 2 /* CPUs on a single hub */ | 80 | #define CPUS_PER_NODE 2 /* CPUs on a single hub */ |
86 | #define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */ | 81 | #define CPUS_PER_NODE_SHFT 1 /* Bits to shift in the node number */ |
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h index 753b6620e6fa..0bb31e5aaca6 100644 --- a/include/asm-mips/socket.h +++ b/include/asm-mips/socket.h | |||
@@ -37,8 +37,6 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | |||
37 | #define SO_ERROR 0x1007 /* get error status and clear */ | 37 | #define SO_ERROR 0x1007 /* get error status and clear */ |
38 | #define SO_SNDBUF 0x1001 /* Send buffer size. */ | 38 | #define SO_SNDBUF 0x1001 /* Send buffer size. */ |
39 | #define SO_RCVBUF 0x1002 /* Receive buffer. */ | 39 | #define SO_RCVBUF 0x1002 /* Receive buffer. */ |
40 | #define SO_SNDBUFFORCE 0x100a | ||
41 | #define SO_RCVBUFFORCE 0x100b | ||
42 | #define SO_SNDLOWAT 0x1003 /* send low-water mark */ | 40 | #define SO_SNDLOWAT 0x1003 /* send low-water mark */ |
43 | #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ | 41 | #define SO_RCVLOWAT 0x1004 /* receive low-water mark */ |
44 | #define SO_SNDTIMEO 0x1005 /* send timeout */ | 42 | #define SO_SNDTIMEO 0x1005 /* send timeout */ |
@@ -69,6 +67,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | |||
69 | #define SCM_TIMESTAMP SO_TIMESTAMP | 67 | #define SCM_TIMESTAMP SO_TIMESTAMP |
70 | 68 | ||
71 | #define SO_PEERSEC 30 | 69 | #define SO_PEERSEC 30 |
70 | #define SO_SNDBUFFORCE 31 | ||
71 | #define SO_RCVBUFFORCE 33 | ||
72 | 72 | ||
73 | #ifdef __KERNEL__ | 73 | #ifdef __KERNEL__ |
74 | 74 | ||
@@ -92,6 +92,7 @@ enum sock_type { | |||
92 | SOCK_RAW = 3, | 92 | SOCK_RAW = 3, |
93 | SOCK_RDM = 4, | 93 | SOCK_RDM = 4, |
94 | SOCK_SEQPACKET = 5, | 94 | SOCK_SEQPACKET = 5, |
95 | SOCK_DCCP = 6, | ||
95 | SOCK_PACKET = 10, | 96 | SOCK_PACKET = 10, |
96 | }; | 97 | }; |
97 | 98 | ||
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h index 4d0135b11156..669b8e349ff2 100644 --- a/include/asm-mips/spinlock.h +++ b/include/asm-mips/spinlock.h | |||
@@ -9,17 +9,16 @@ | |||
9 | #ifndef _ASM_SPINLOCK_H | 9 | #ifndef _ASM_SPINLOCK_H |
10 | #define _ASM_SPINLOCK_H | 10 | #define _ASM_SPINLOCK_H |
11 | 11 | ||
12 | #include <linux/config.h> | ||
13 | #include <asm/war.h> | 12 | #include <asm/war.h> |
14 | 13 | ||
15 | /* | 14 | /* |
16 | * Your basic SMP spinlocks, allowing only a single CPU anywhere | 15 | * Your basic SMP spinlocks, allowing only a single CPU anywhere |
17 | */ | 16 | */ |
18 | 17 | ||
19 | #define __raw_spin_is_locked(x) ((x)->lock != 0) | 18 | #define __raw_spin_is_locked(x) ((x)->lock != 0) |
20 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 19 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
21 | #define __raw_spin_unlock_wait(x) \ | 20 | #define __raw_spin_unlock_wait(x) \ |
22 | do { cpu_relax(); } while ((x)->lock) | 21 | do { cpu_relax(); } while ((x)->lock) |
23 | 22 | ||
24 | /* | 23 | /* |
25 | * Simple spin lock operations. There are two variants, one clears IRQ's | 24 | * Simple spin lock operations. There are two variants, one clears IRQ's |
@@ -119,6 +118,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock) | |||
119 | * read-locks. | 118 | * read-locks. |
120 | */ | 119 | */ |
121 | 120 | ||
121 | /* | ||
122 | * read_can_lock - would read_trylock() succeed? | ||
123 | * @lock: the rwlock in question. | ||
124 | */ | ||
125 | #define __raw_read_can_lock(rw) ((rw)->lock >= 0) | ||
126 | |||
127 | /* | ||
128 | * write_can_lock - would write_trylock() succeed? | ||
129 | * @lock: the rwlock in question. | ||
130 | */ | ||
131 | #define __raw_write_can_lock(rw) (!(rw)->lock) | ||
132 | |||
122 | static inline void __raw_read_lock(raw_rwlock_t *rw) | 133 | static inline void __raw_read_lock(raw_rwlock_t *rw) |
123 | { | 134 | { |
124 | unsigned int tmp; | 135 | unsigned int tmp; |
@@ -197,8 +208,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) | |||
197 | " lui %1, 0x8000 \n" | 208 | " lui %1, 0x8000 \n" |
198 | " sc %1, %0 \n" | 209 | " sc %1, %0 \n" |
199 | " beqzl %1, 1b \n" | 210 | " beqzl %1, 1b \n" |
200 | " nop \n" | 211 | " sync \n" |
201 | " sync \n" | ||
202 | " .set reorder \n" | 212 | " .set reorder \n" |
203 | : "=m" (rw->lock), "=&r" (tmp) | 213 | : "=m" (rw->lock), "=&r" (tmp) |
204 | : "m" (rw->lock) | 214 | : "m" (rw->lock) |
@@ -211,8 +221,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) | |||
211 | " lui %1, 0x8000 \n" | 221 | " lui %1, 0x8000 \n" |
212 | " sc %1, %0 \n" | 222 | " sc %1, %0 \n" |
213 | " beqz %1, 1b \n" | 223 | " beqz %1, 1b \n" |
214 | " nop \n" | 224 | " sync \n" |
215 | " sync \n" | ||
216 | " .set reorder \n" | 225 | " .set reorder \n" |
217 | : "=m" (rw->lock), "=&r" (tmp) | 226 | : "=m" (rw->lock), "=&r" (tmp) |
218 | : "m" (rw->lock) | 227 | : "m" (rw->lock) |
@@ -246,8 +255,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
246 | " lui %1, 0x8000 \n" | 255 | " lui %1, 0x8000 \n" |
247 | " sc %1, %0 \n" | 256 | " sc %1, %0 \n" |
248 | " beqzl %1, 1b \n" | 257 | " beqzl %1, 1b \n" |
249 | " nop \n" | 258 | " sync \n" |
250 | " sync \n" | ||
251 | " li %2, 1 \n" | 259 | " li %2, 1 \n" |
252 | " .set reorder \n" | 260 | " .set reorder \n" |
253 | "2: \n" | 261 | "2: \n" |
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 7b5e64600bc8..a8919dcc93c8 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h | |||
@@ -60,7 +60,6 @@ | |||
60 | mfc0 k0, CP0_CONTEXT | 60 | mfc0 k0, CP0_CONTEXT |
61 | lui k1, %hi(kernelsp) | 61 | lui k1, %hi(kernelsp) |
62 | srl k0, k0, 23 | 62 | srl k0, k0, 23 |
63 | sll k0, k0, 2 | ||
64 | addu k1, k0 | 63 | addu k1, k0 |
65 | LONG_L k1, %lo(kernelsp)(k1) | 64 | LONG_L k1, %lo(kernelsp)(k1) |
66 | #endif | 65 | #endif |
@@ -76,9 +75,14 @@ | |||
76 | #endif | 75 | #endif |
77 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | 76 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) |
78 | MFC0 k1, CP0_CONTEXT | 77 | MFC0 k1, CP0_CONTEXT |
78 | lui k0, %highest(kernelsp) | ||
79 | dsrl k1, 23 | 79 | dsrl k1, 23 |
80 | dsll k1, k1, 3 | 80 | daddiu k0, %higher(kernelsp) |
81 | LONG_L k1, kernelsp(k1) | 81 | dsll k0, k0, 16 |
82 | daddiu k0, %hi(kernelsp) | ||
83 | dsll k0, k0, 16 | ||
84 | daddu k1, k1, k0 | ||
85 | LONG_L k1, %lo(kernelsp)(k1) | ||
82 | #endif | 86 | #endif |
83 | .endm | 87 | .endm |
84 | 88 | ||
@@ -86,25 +90,28 @@ | |||
86 | #ifdef CONFIG_32BIT | 90 | #ifdef CONFIG_32BIT |
87 | mfc0 \temp, CP0_CONTEXT | 91 | mfc0 \temp, CP0_CONTEXT |
88 | srl \temp, 23 | 92 | srl \temp, 23 |
89 | sll \temp, 2 | ||
90 | LONG_S \stackp, kernelsp(\temp) | ||
91 | #endif | 93 | #endif |
92 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 94 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) |
93 | lw \temp, TI_CPU(gp) | 95 | lw \temp, TI_CPU(gp) |
94 | dsll \temp, 3 | 96 | dsll \temp, 3 |
95 | lui \temp2, %hi(kernelsp) | ||
96 | daddu \temp, \temp2 | ||
97 | LONG_S \stackp, %lo(kernelsp)(\temp) | ||
98 | #endif | 97 | #endif |
99 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | 98 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) |
100 | lw \temp, TI_CPU(gp) | 99 | MFC0 \temp, CP0_CONTEXT |
101 | dsll \temp, 3 | 100 | dsrl \temp, 23 |
102 | LONG_S \stackp, kernelsp(\temp) | ||
103 | #endif | 101 | #endif |
102 | LONG_S \stackp, kernelsp(\temp) | ||
104 | .endm | 103 | .endm |
105 | #else | 104 | #else |
106 | .macro get_saved_sp /* Uniprocessor variation */ | 105 | .macro get_saved_sp /* Uniprocessor variation */ |
106 | #if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) | ||
107 | lui k1, %highest(kernelsp) | ||
108 | daddiu k1, %higher(kernelsp) | ||
109 | dsll k1, k1, 16 | ||
110 | daddiu k1, %hi(kernelsp) | ||
111 | dsll k1, k1, 16 | ||
112 | #else | ||
107 | lui k1, %hi(kernelsp) | 113 | lui k1, %hi(kernelsp) |
114 | #endif | ||
108 | LONG_L k1, %lo(kernelsp)(k1) | 115 | LONG_L k1, %lo(kernelsp)(k1) |
109 | .endm | 116 | .endm |
110 | 117 | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 6663efd49b27..330c4e497af3 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <asm/addrspace.h> | 18 | #include <asm/addrspace.h> |
19 | #include <asm/cpu-features.h> | 19 | #include <asm/cpu-features.h> |
20 | #include <asm/dsp.h> | ||
20 | #include <asm/ptrace.h> | 21 | #include <asm/ptrace.h> |
21 | #include <asm/war.h> | 22 | #include <asm/war.h> |
22 | #include <asm/interrupt.h> | 23 | #include <asm/interrupt.h> |
@@ -70,7 +71,7 @@ | |||
70 | * does not enforce ordering, since there is no data dependency between | 71 | * does not enforce ordering, since there is no data dependency between |
71 | * the read of "a" and the read of "b". Therefore, on some CPUs, such | 72 | * the read of "a" and the read of "b". Therefore, on some CPUs, such |
72 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() | 73 | * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() |
73 | * in cases like thiswhere there are no data dependencies. | 74 | * in cases like this where there are no data dependencies. |
74 | */ | 75 | */ |
75 | 76 | ||
76 | #define read_barrier_depends() do { } while(0) | 77 | #define read_barrier_depends() do { } while(0) |
@@ -154,15 +155,15 @@ extern asmlinkage void *resume(void *last, void *next, void *next_ti); | |||
154 | 155 | ||
155 | struct task_struct; | 156 | struct task_struct; |
156 | 157 | ||
157 | #define switch_to(prev,next,last) \ | 158 | #define switch_to(prev,next,last) \ |
158 | do { \ | 159 | do { \ |
159 | (last) = resume(prev, next, next->thread_info); \ | 160 | if (cpu_has_dsp) \ |
161 | __save_dsp(prev); \ | ||
162 | (last) = resume(prev, next, next->thread_info); \ | ||
163 | if (cpu_has_dsp) \ | ||
164 | __restore_dsp(current); \ | ||
160 | } while(0) | 165 | } while(0) |
161 | 166 | ||
162 | #define ROT_IN_PIECES \ | ||
163 | " .set noreorder \n" \ | ||
164 | " .set reorder \n" | ||
165 | |||
166 | static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) | 167 | static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) |
167 | { | 168 | { |
168 | __u32 retval; | 169 | __u32 retval; |
@@ -171,14 +172,17 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) | |||
171 | unsigned long dummy; | 172 | unsigned long dummy; |
172 | 173 | ||
173 | __asm__ __volatile__( | 174 | __asm__ __volatile__( |
175 | " .set mips3 \n" | ||
174 | "1: ll %0, %3 # xchg_u32 \n" | 176 | "1: ll %0, %3 # xchg_u32 \n" |
177 | " .set mips0 \n" | ||
175 | " move %2, %z4 \n" | 178 | " move %2, %z4 \n" |
179 | " .set mips3 \n" | ||
176 | " sc %2, %1 \n" | 180 | " sc %2, %1 \n" |
177 | " beqzl %2, 1b \n" | 181 | " beqzl %2, 1b \n" |
178 | ROT_IN_PIECES | ||
179 | #ifdef CONFIG_SMP | 182 | #ifdef CONFIG_SMP |
180 | " sync \n" | 183 | " sync \n" |
181 | #endif | 184 | #endif |
185 | " .set mips0 \n" | ||
182 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | 186 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) |
183 | : "R" (*m), "Jr" (val) | 187 | : "R" (*m), "Jr" (val) |
184 | : "memory"); | 188 | : "memory"); |
@@ -186,13 +190,17 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) | |||
186 | unsigned long dummy; | 190 | unsigned long dummy; |
187 | 191 | ||
188 | __asm__ __volatile__( | 192 | __asm__ __volatile__( |
193 | " .set mips3 \n" | ||
189 | "1: ll %0, %3 # xchg_u32 \n" | 194 | "1: ll %0, %3 # xchg_u32 \n" |
195 | " .set mips0 \n" | ||
190 | " move %2, %z4 \n" | 196 | " move %2, %z4 \n" |
197 | " .set mips3 \n" | ||
191 | " sc %2, %1 \n" | 198 | " sc %2, %1 \n" |
192 | " beqz %2, 1b \n" | 199 | " beqz %2, 1b \n" |
193 | #ifdef CONFIG_SMP | 200 | #ifdef CONFIG_SMP |
194 | " sync \n" | 201 | " sync \n" |
195 | #endif | 202 | #endif |
203 | " .set mips0 \n" | ||
196 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | 204 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) |
197 | : "R" (*m), "Jr" (val) | 205 | : "R" (*m), "Jr" (val) |
198 | : "memory"); | 206 | : "memory"); |
@@ -217,14 +225,15 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) | |||
217 | unsigned long dummy; | 225 | unsigned long dummy; |
218 | 226 | ||
219 | __asm__ __volatile__( | 227 | __asm__ __volatile__( |
228 | " .set mips3 \n" | ||
220 | "1: lld %0, %3 # xchg_u64 \n" | 229 | "1: lld %0, %3 # xchg_u64 \n" |
221 | " move %2, %z4 \n" | 230 | " move %2, %z4 \n" |
222 | " scd %2, %1 \n" | 231 | " scd %2, %1 \n" |
223 | " beqzl %2, 1b \n" | 232 | " beqzl %2, 1b \n" |
224 | ROT_IN_PIECES | ||
225 | #ifdef CONFIG_SMP | 233 | #ifdef CONFIG_SMP |
226 | " sync \n" | 234 | " sync \n" |
227 | #endif | 235 | #endif |
236 | " .set mips0 \n" | ||
228 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | 237 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) |
229 | : "R" (*m), "Jr" (val) | 238 | : "R" (*m), "Jr" (val) |
230 | : "memory"); | 239 | : "memory"); |
@@ -232,6 +241,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) | |||
232 | unsigned long dummy; | 241 | unsigned long dummy; |
233 | 242 | ||
234 | __asm__ __volatile__( | 243 | __asm__ __volatile__( |
244 | " .set mips3 \n" | ||
235 | "1: lld %0, %3 # xchg_u64 \n" | 245 | "1: lld %0, %3 # xchg_u64 \n" |
236 | " move %2, %z4 \n" | 246 | " move %2, %z4 \n" |
237 | " scd %2, %1 \n" | 247 | " scd %2, %1 \n" |
@@ -239,6 +249,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) | |||
239 | #ifdef CONFIG_SMP | 249 | #ifdef CONFIG_SMP |
240 | " sync \n" | 250 | " sync \n" |
241 | #endif | 251 | #endif |
252 | " .set mips0 \n" | ||
242 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) | 253 | : "=&r" (retval), "=m" (*m), "=&r" (dummy) |
243 | : "R" (*m), "Jr" (val) | 254 | : "R" (*m), "Jr" (val) |
244 | : "memory"); | 255 | : "memory"); |
@@ -286,34 +297,41 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old, | |||
286 | 297 | ||
287 | if (cpu_has_llsc && R10000_LLSC_WAR) { | 298 | if (cpu_has_llsc && R10000_LLSC_WAR) { |
288 | __asm__ __volatile__( | 299 | __asm__ __volatile__( |
300 | " .set push \n" | ||
289 | " .set noat \n" | 301 | " .set noat \n" |
302 | " .set mips3 \n" | ||
290 | "1: ll %0, %2 # __cmpxchg_u32 \n" | 303 | "1: ll %0, %2 # __cmpxchg_u32 \n" |
291 | " bne %0, %z3, 2f \n" | 304 | " bne %0, %z3, 2f \n" |
305 | " .set mips0 \n" | ||
292 | " move $1, %z4 \n" | 306 | " move $1, %z4 \n" |
307 | " .set mips3 \n" | ||
293 | " sc $1, %1 \n" | 308 | " sc $1, %1 \n" |
294 | " beqzl $1, 1b \n" | 309 | " beqzl $1, 1b \n" |
295 | ROT_IN_PIECES | ||
296 | #ifdef CONFIG_SMP | 310 | #ifdef CONFIG_SMP |
297 | " sync \n" | 311 | " sync \n" |
298 | #endif | 312 | #endif |
299 | "2: \n" | 313 | "2: \n" |
300 | " .set at \n" | 314 | " .set pop \n" |
301 | : "=&r" (retval), "=m" (*m) | 315 | : "=&r" (retval), "=m" (*m) |
302 | : "R" (*m), "Jr" (old), "Jr" (new) | 316 | : "R" (*m), "Jr" (old), "Jr" (new) |
303 | : "memory"); | 317 | : "memory"); |
304 | } else if (cpu_has_llsc) { | 318 | } else if (cpu_has_llsc) { |
305 | __asm__ __volatile__( | 319 | __asm__ __volatile__( |
320 | " .set push \n" | ||
306 | " .set noat \n" | 321 | " .set noat \n" |
322 | " .set mips3 \n" | ||
307 | "1: ll %0, %2 # __cmpxchg_u32 \n" | 323 | "1: ll %0, %2 # __cmpxchg_u32 \n" |
308 | " bne %0, %z3, 2f \n" | 324 | " bne %0, %z3, 2f \n" |
325 | " .set mips0 \n" | ||
309 | " move $1, %z4 \n" | 326 | " move $1, %z4 \n" |
327 | " .set mips3 \n" | ||
310 | " sc $1, %1 \n" | 328 | " sc $1, %1 \n" |
311 | " beqz $1, 1b \n" | 329 | " beqz $1, 1b \n" |
312 | #ifdef CONFIG_SMP | 330 | #ifdef CONFIG_SMP |
313 | " sync \n" | 331 | " sync \n" |
314 | #endif | 332 | #endif |
315 | "2: \n" | 333 | "2: \n" |
316 | " .set at \n" | 334 | " .set pop \n" |
317 | : "=&r" (retval), "=m" (*m) | 335 | : "=&r" (retval), "=m" (*m) |
318 | : "R" (*m), "Jr" (old), "Jr" (new) | 336 | : "R" (*m), "Jr" (old), "Jr" (new) |
319 | : "memory"); | 337 | : "memory"); |
@@ -338,24 +356,27 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, | |||
338 | 356 | ||
339 | if (cpu_has_llsc) { | 357 | if (cpu_has_llsc) { |
340 | __asm__ __volatile__( | 358 | __asm__ __volatile__( |
359 | " .set push \n" | ||
341 | " .set noat \n" | 360 | " .set noat \n" |
361 | " .set mips3 \n" | ||
342 | "1: lld %0, %2 # __cmpxchg_u64 \n" | 362 | "1: lld %0, %2 # __cmpxchg_u64 \n" |
343 | " bne %0, %z3, 2f \n" | 363 | " bne %0, %z3, 2f \n" |
344 | " move $1, %z4 \n" | 364 | " move $1, %z4 \n" |
345 | " scd $1, %1 \n" | 365 | " scd $1, %1 \n" |
346 | " beqzl $1, 1b \n" | 366 | " beqzl $1, 1b \n" |
347 | ROT_IN_PIECES | ||
348 | #ifdef CONFIG_SMP | 367 | #ifdef CONFIG_SMP |
349 | " sync \n" | 368 | " sync \n" |
350 | #endif | 369 | #endif |
351 | "2: \n" | 370 | "2: \n" |
352 | " .set at \n" | 371 | " .set pop \n" |
353 | : "=&r" (retval), "=m" (*m) | 372 | : "=&r" (retval), "=m" (*m) |
354 | : "R" (*m), "Jr" (old), "Jr" (new) | 373 | : "R" (*m), "Jr" (old), "Jr" (new) |
355 | : "memory"); | 374 | : "memory"); |
356 | } else if (cpu_has_llsc) { | 375 | } else if (cpu_has_llsc) { |
357 | __asm__ __volatile__( | 376 | __asm__ __volatile__( |
377 | " .set push \n" | ||
358 | " .set noat \n" | 378 | " .set noat \n" |
379 | " .set mips3 \n" | ||
359 | "1: lld %0, %2 # __cmpxchg_u64 \n" | 380 | "1: lld %0, %2 # __cmpxchg_u64 \n" |
360 | " bne %0, %z3, 2f \n" | 381 | " bne %0, %z3, 2f \n" |
361 | " move $1, %z4 \n" | 382 | " move $1, %z4 \n" |
@@ -365,7 +386,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, | |||
365 | " sync \n" | 386 | " sync \n" |
366 | #endif | 387 | #endif |
367 | "2: \n" | 388 | "2: \n" |
368 | " .set at \n" | 389 | " .set pop \n" |
369 | : "=&r" (retval), "=m" (*m) | 390 | : "=&r" (retval), "=m" (*m) |
370 | : "R" (*m), "Jr" (old), "Jr" (new) | 391 | : "R" (*m), "Jr" (old), "Jr" (new) |
371 | : "memory"); | 392 | : "memory"); |
@@ -406,18 +427,20 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, | |||
406 | 427 | ||
407 | #define cmpxchg(ptr,old,new) ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr)))) | 428 | #define cmpxchg(ptr,old,new) ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr)))) |
408 | 429 | ||
430 | extern void set_handler (unsigned long offset, void *addr, unsigned long len); | ||
431 | extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); | ||
432 | extern void *set_vi_handler (int n, void *addr); | ||
433 | extern void *set_vi_srs_handler (int n, void *addr, int regset); | ||
409 | extern void *set_except_vector(int n, void *addr); | 434 | extern void *set_except_vector(int n, void *addr); |
410 | extern void per_cpu_trap_init(void); | 435 | extern void per_cpu_trap_init(void); |
411 | 436 | ||
412 | extern NORET_TYPE void __die(const char *, struct pt_regs *, const char *file, | 437 | extern NORET_TYPE void die(const char *, struct pt_regs *); |
413 | const char *func, unsigned long line); | ||
414 | extern void __die_if_kernel(const char *, struct pt_regs *, const char *file, | ||
415 | const char *func, unsigned long line); | ||
416 | 438 | ||
417 | #define die(msg, regs) \ | 439 | static inline void die_if_kernel(const char *str, struct pt_regs *regs) |
418 | __die(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__) | 440 | { |
419 | #define die_if_kernel(msg, regs) \ | 441 | if (unlikely(!user_mode(regs))) |
420 | __die_if_kernel(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__) | 442 | die(str, regs); |
443 | } | ||
421 | 444 | ||
422 | extern int stop_a_enabled; | 445 | extern int stop_a_enabled; |
423 | 446 | ||
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index a70cb0854c8a..e6c24472e03f 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
@@ -26,6 +26,7 @@ struct thread_info { | |||
26 | struct task_struct *task; /* main task structure */ | 26 | struct task_struct *task; /* main task structure */ |
27 | struct exec_domain *exec_domain; /* execution domain */ | 27 | struct exec_domain *exec_domain; /* execution domain */ |
28 | unsigned long flags; /* low level flags */ | 28 | unsigned long flags; /* low level flags */ |
29 | unsigned long tp_value; /* thread pointer */ | ||
29 | __u32 cpu; /* current CPU */ | 30 | __u32 cpu; /* current CPU */ |
30 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 31 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
31 | 32 | ||
@@ -114,6 +115,7 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
114 | #define TIF_SIGPENDING 2 /* signal pending */ | 115 | #define TIF_SIGPENDING 2 /* signal pending */ |
115 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 116 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
116 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ | 117 | #define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */ |
118 | #define TIF_SECCOMP 5 /* secure computing */ | ||
117 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 119 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ |
118 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 120 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
119 | #define TIF_MEMDIE 18 | 121 | #define TIF_MEMDIE 18 |
@@ -124,13 +126,14 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
124 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 126 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
125 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 127 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
126 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | 128 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) |
129 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | ||
127 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | 130 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) |
128 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 131 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
129 | 132 | ||
130 | #define _TIF_WORK_MASK 0x0000ffef /* work to do on | 133 | /* work to do on interrupt/exception return */ |
131 | interrupt/exception return */ | 134 | #define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP) |
132 | #define _TIF_ALLWORK_MASK 0x8000ffff /* work to do on any return to | 135 | /* work to do on any return to u-space */ |
133 | u-space */ | 136 | #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP) |
134 | 137 | ||
135 | #endif /* __KERNEL__ */ | 138 | #endif /* __KERNEL__ */ |
136 | 139 | ||
diff --git a/include/asm-mips/traps.h b/include/asm-mips/traps.h index 179012263007..d02e019b0127 100644 --- a/include/asm-mips/traps.h +++ b/include/asm-mips/traps.h | |||
@@ -21,4 +21,7 @@ | |||
21 | extern void (*board_be_init)(void); | 21 | extern void (*board_be_init)(void); |
22 | extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup); | 22 | extern int (*board_be_handler)(struct pt_regs *regs, int is_fixup); |
23 | 23 | ||
24 | extern void (*board_nmi_handler_setup)(void); | ||
25 | extern void (*board_ejtag_handler_setup)(void); | ||
26 | |||
24 | #endif /* _ASM_TRAPS_H */ | 27 | #endif /* _ASM_TRAPS_H */ |
diff --git a/include/asm-mips/tx4938/rbtx4938.h b/include/asm-mips/tx4938/rbtx4938.h new file mode 100644 index 000000000000..0fbedafdcea8 --- /dev/null +++ b/include/asm-mips/tx4938/rbtx4938.h | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * linux/include/asm-mips/tx4938/rbtx4938.h | ||
3 | * Definitions for TX4937/TX4938 | ||
4 | * | ||
5 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
6 | * terms of the GNU General Public License version 2. This program is | ||
7 | * licensed "as is" without any warranty of any kind, whether express | ||
8 | * or implied. | ||
9 | * | ||
10 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
11 | */ | ||
12 | #ifndef __ASM_TX_BOARDS_RBTX4938_H | ||
13 | #define __ASM_TX_BOARDS_RBTX4938_H | ||
14 | |||
15 | #include <asm/addrspace.h> | ||
16 | #include <asm/tx4938/tx4938.h> | ||
17 | |||
18 | /* CS */ | ||
19 | #define RBTX4938_CE0 0x1c000000 /* 64M */ | ||
20 | #define RBTX4938_CE2 0x17f00000 /* 1M */ | ||
21 | |||
22 | /* Address map */ | ||
23 | #define RBTX4938_FPGA_REG_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000000) | ||
24 | #define RBTX4938_FPGA_REV_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000002) | ||
25 | #define RBTX4938_CONFIG1_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000004) | ||
26 | #define RBTX4938_CONFIG2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000006) | ||
27 | #define RBTX4938_CONFIG3_ADDR (KSEG1 + RBTX4938_CE2 + 0x00000008) | ||
28 | #define RBTX4938_LED_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001000) | ||
29 | #define RBTX4938_DIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001002) | ||
30 | #define RBTX4938_BDIPSW_ADDR (KSEG1 + RBTX4938_CE2 + 0x00001004) | ||
31 | #define RBTX4938_IMASK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002000) | ||
32 | #define RBTX4938_IMASK2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002002) | ||
33 | #define RBTX4938_INTPOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002004) | ||
34 | #define RBTX4938_ISTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002006) | ||
35 | #define RBTX4938_ISTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x00002008) | ||
36 | #define RBTX4938_IMSTAT_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200a) | ||
37 | #define RBTX4938_IMSTAT2_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000200c) | ||
38 | #define RBTX4938_SOFTINT_ADDR (KSEG1 + RBTX4938_CE2 + 0x00003000) | ||
39 | #define RBTX4938_PIOSEL_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005000) | ||
40 | #define RBTX4938_SPICS_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005002) | ||
41 | #define RBTX4938_SFPWR_ADDR (KSEG1 + RBTX4938_CE2 + 0x00005008) | ||
42 | #define RBTX4938_SFVOL_ADDR (KSEG1 + RBTX4938_CE2 + 0x0000500a) | ||
43 | #define RBTX4938_SOFTRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007000) | ||
44 | #define RBTX4938_SOFTRESETLOCK_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007002) | ||
45 | #define RBTX4938_PCIRESET_ADDR (KSEG1 + RBTX4938_CE2 + 0x00007004) | ||
46 | #define RBTX4938_ETHER_BASE (KSEG1 + RBTX4938_CE2 + 0x00020000) | ||
47 | |||
48 | /* Ethernet port address (Jumperless Mode (W12:Open)) */ | ||
49 | #define RBTX4938_ETHER_ADDR (RBTX4938_ETHER_BASE + 0x280) | ||
50 | |||
51 | /* bits for ISTAT/IMASK/IMSTAT */ | ||
52 | #define RBTX4938_INTB_PCID 0 | ||
53 | #define RBTX4938_INTB_PCIC 1 | ||
54 | #define RBTX4938_INTB_PCIB 2 | ||
55 | #define RBTX4938_INTB_PCIA 3 | ||
56 | #define RBTX4938_INTB_RTC 4 | ||
57 | #define RBTX4938_INTB_ATA 5 | ||
58 | #define RBTX4938_INTB_MODEM 6 | ||
59 | #define RBTX4938_INTB_SWINT 7 | ||
60 | #define RBTX4938_INTF_PCID (1 << RBTX4938_INTB_PCID) | ||
61 | #define RBTX4938_INTF_PCIC (1 << RBTX4938_INTB_PCIC) | ||
62 | #define RBTX4938_INTF_PCIB (1 << RBTX4938_INTB_PCIB) | ||
63 | #define RBTX4938_INTF_PCIA (1 << RBTX4938_INTB_PCIA) | ||
64 | #define RBTX4938_INTF_RTC (1 << RBTX4938_INTB_RTC) | ||
65 | #define RBTX4938_INTF_ATA (1 << RBTX4938_INTB_ATA) | ||
66 | #define RBTX4938_INTF_MODEM (1 << RBTX4938_INTB_MODEM) | ||
67 | #define RBTX4938_INTF_SWINT (1 << RBTX4938_INTB_SWINT) | ||
68 | |||
69 | #define rbtx4938_fpga_rev_ptr \ | ||
70 | ((volatile unsigned char *)RBTX4938_FPGA_REV_ADDR) | ||
71 | #define rbtx4938_led_ptr \ | ||
72 | ((volatile unsigned char *)RBTX4938_LED_ADDR) | ||
73 | #define rbtx4938_dipsw_ptr \ | ||
74 | ((volatile unsigned char *)RBTX4938_DIPSW_ADDR) | ||
75 | #define rbtx4938_bdipsw_ptr \ | ||
76 | ((volatile unsigned char *)RBTX4938_BDIPSW_ADDR) | ||
77 | #define rbtx4938_imask_ptr \ | ||
78 | ((volatile unsigned char *)RBTX4938_IMASK_ADDR) | ||
79 | #define rbtx4938_imask2_ptr \ | ||
80 | ((volatile unsigned char *)RBTX4938_IMASK2_ADDR) | ||
81 | #define rbtx4938_intpol_ptr \ | ||
82 | ((volatile unsigned char *)RBTX4938_INTPOL_ADDR) | ||
83 | #define rbtx4938_istat_ptr \ | ||
84 | ((volatile unsigned char *)RBTX4938_ISTAT_ADDR) | ||
85 | #define rbtx4938_istat2_ptr \ | ||
86 | ((volatile unsigned char *)RBTX4938_ISTAT2_ADDR) | ||
87 | #define rbtx4938_imstat_ptr \ | ||
88 | ((volatile unsigned char *)RBTX4938_IMSTAT_ADDR) | ||
89 | #define rbtx4938_imstat2_ptr \ | ||
90 | ((volatile unsigned char *)RBTX4938_IMSTAT2_ADDR) | ||
91 | #define rbtx4938_softint_ptr \ | ||
92 | ((volatile unsigned char *)RBTX4938_SOFTINT_ADDR) | ||
93 | #define rbtx4938_piosel_ptr \ | ||
94 | ((volatile unsigned char *)RBTX4938_PIOSEL_ADDR) | ||
95 | #define rbtx4938_spics_ptr \ | ||
96 | ((volatile unsigned char *)RBTX4938_SPICS_ADDR) | ||
97 | #define rbtx4938_sfpwr_ptr \ | ||
98 | ((volatile unsigned char *)RBTX4938_SFPWR_ADDR) | ||
99 | #define rbtx4938_sfvol_ptr \ | ||
100 | ((volatile unsigned char *)RBTX4938_SFVOL_ADDR) | ||
101 | #define rbtx4938_softreset_ptr \ | ||
102 | ((volatile unsigned char *)RBTX4938_SOFTRESET_ADDR) | ||
103 | #define rbtx4938_softresetlock_ptr \ | ||
104 | ((volatile unsigned char *)RBTX4938_SOFTRESETLOCK_ADDR) | ||
105 | #define rbtx4938_pcireset_ptr \ | ||
106 | ((volatile unsigned char *)RBTX4938_PCIRESET_ADDR) | ||
107 | |||
108 | /* SPI */ | ||
109 | #define RBTX4938_SEEPROM1_CHIPID 0 | ||
110 | #define RBTX4938_SEEPROM2_CHIPID 1 | ||
111 | #define RBTX4938_SEEPROM3_CHIPID 2 | ||
112 | #define RBTX4938_SRTC_CHIPID 3 | ||
113 | |||
114 | /* | ||
115 | * IRQ mappings | ||
116 | */ | ||
117 | |||
118 | #define RBTX4938_SOFT_INT0 0 /* not used */ | ||
119 | #define RBTX4938_SOFT_INT1 1 /* not used */ | ||
120 | #define RBTX4938_IRC_INT 2 | ||
121 | #define RBTX4938_TIMER_INT 7 | ||
122 | |||
123 | /* These are the virtual IRQ numbers, we divide all IRQ's into | ||
124 | * 'spaces', the 'space' determines where and how to enable/disable | ||
125 | * that particular IRQ on an RBTX4938 machine. Add new 'spaces' as new | ||
126 | * IRQ hardware is supported. | ||
127 | */ | ||
128 | #define RBTX4938_NR_IRQ_LOCAL 8 | ||
129 | #define RBTX4938_NR_IRQ_IRC 32 /* On-Chip IRC */ | ||
130 | #define RBTX4938_NR_IRQ_IOC 8 | ||
131 | |||
132 | #define MI8259_IRQ_ISA_RAW_BEG 0 /* optional backplane i8259 */ | ||
133 | #define MI8259_IRQ_ISA_RAW_END 15 | ||
134 | #define TX4938_IRQ_CP0_RAW_BEG 0 /* tx4938 cpu built-in cp0 */ | ||
135 | #define TX4938_IRQ_CP0_RAW_END 7 | ||
136 | #define TX4938_IRQ_PIC_RAW_BEG 0 /* tx4938 cpu build-in pic */ | ||
137 | #define TX4938_IRQ_PIC_RAW_END 31 | ||
138 | |||
139 | #define MI8259_IRQ_ISA_BEG MI8259_IRQ_ISA_RAW_BEG /* 0 */ | ||
140 | #define MI8259_IRQ_ISA_END MI8259_IRQ_ISA_RAW_END /* 15 */ | ||
141 | |||
142 | #define TX4938_IRQ_CP0_BEG ((MI8259_IRQ_ISA_END+1)+TX4938_IRQ_CP0_RAW_BEG) /* 16 */ | ||
143 | #define TX4938_IRQ_CP0_END ((MI8259_IRQ_ISA_END+1)+TX4938_IRQ_CP0_RAW_END) /* 23 */ | ||
144 | |||
145 | #define TX4938_IRQ_PIC_BEG ((TX4938_IRQ_CP0_END+1)+TX4938_IRQ_PIC_RAW_BEG) /* 24 */ | ||
146 | #define TX4938_IRQ_PIC_END ((TX4938_IRQ_CP0_END+1)+TX4938_IRQ_PIC_RAW_END) /* 55 */ | ||
147 | #define TX4938_IRQ_NEST_EXT_ON_PIC (TX4938_IRQ_PIC_BEG+2) | ||
148 | #define TX4938_IRQ_NEST_PIC_ON_CP0 (TX4938_IRQ_CP0_BEG+2) | ||
149 | #define TX4938_IRQ_USER0 (TX4938_IRQ_CP0_BEG+0) | ||
150 | #define TX4938_IRQ_USER1 (TX4938_IRQ_CP0_BEG+1) | ||
151 | #define TX4938_IRQ_CPU_TIMER (TX4938_IRQ_CP0_BEG+7) | ||
152 | |||
153 | #define TOSHIBA_RBTX4938_IRQ_IOC_RAW_BEG 0 | ||
154 | #define TOSHIBA_RBTX4938_IRQ_IOC_RAW_END 7 | ||
155 | |||
156 | #define TOSHIBA_RBTX4938_IRQ_IOC_BEG ((TX4938_IRQ_PIC_END+1)+TOSHIBA_RBTX4938_IRQ_IOC_RAW_BEG) /* 56 */ | ||
157 | #define TOSHIBA_RBTX4938_IRQ_IOC_END ((TX4938_IRQ_PIC_END+1)+TOSHIBA_RBTX4938_IRQ_IOC_RAW_END) /* 63 */ | ||
158 | #define RBTX4938_IRQ_LOCAL TX4938_IRQ_CP0_BEG | ||
159 | #define RBTX4938_IRQ_IRC (RBTX4938_IRQ_LOCAL + RBTX4938_NR_IRQ_LOCAL) | ||
160 | #define RBTX4938_IRQ_IOC (RBTX4938_IRQ_IRC + RBTX4938_NR_IRQ_IRC) | ||
161 | #define RBTX4938_IRQ_END (RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC) | ||
162 | |||
163 | #define RBTX4938_IRQ_LOCAL_SOFT0 (RBTX4938_IRQ_LOCAL + RBTX4938_SOFT_INT0) | ||
164 | #define RBTX4938_IRQ_LOCAL_SOFT1 (RBTX4938_IRQ_LOCAL + RBTX4938_SOFT_INT1) | ||
165 | #define RBTX4938_IRQ_LOCAL_IRC (RBTX4938_IRQ_LOCAL + RBTX4938_IRC_INT) | ||
166 | #define RBTX4938_IRQ_LOCAL_TIMER (RBTX4938_IRQ_LOCAL + RBTX4938_TIMER_INT) | ||
167 | #define RBTX4938_IRQ_IRC_ECCERR (RBTX4938_IRQ_IRC + TX4938_IR_ECCERR) | ||
168 | #define RBTX4938_IRQ_IRC_WTOERR (RBTX4938_IRQ_IRC + TX4938_IR_WTOERR) | ||
169 | #define RBTX4938_IRQ_IRC_INT(n) (RBTX4938_IRQ_IRC + TX4938_IR_INT(n)) | ||
170 | #define RBTX4938_IRQ_IRC_SIO(n) (RBTX4938_IRQ_IRC + TX4938_IR_SIO(n)) | ||
171 | #define RBTX4938_IRQ_IRC_DMA(ch,n) (RBTX4938_IRQ_IRC + TX4938_IR_DMA(ch,n)) | ||
172 | #define RBTX4938_IRQ_IRC_PIO (RBTX4938_IRQ_IRC + TX4938_IR_PIO) | ||
173 | #define RBTX4938_IRQ_IRC_PDMAC (RBTX4938_IRQ_IRC + TX4938_IR_PDMAC) | ||
174 | #define RBTX4938_IRQ_IRC_PCIC (RBTX4938_IRQ_IRC + TX4938_IR_PCIC) | ||
175 | #define RBTX4938_IRQ_IRC_TMR(n) (RBTX4938_IRQ_IRC + TX4938_IR_TMR(n)) | ||
176 | #define RBTX4938_IRQ_IRC_NDFMC (RBTX4938_IRQ_IRC + TX4938_IR_NDFMC) | ||
177 | #define RBTX4938_IRQ_IRC_PCIERR (RBTX4938_IRQ_IRC + TX4938_IR_PCIERR) | ||
178 | #define RBTX4938_IRQ_IRC_PCIPME (RBTX4938_IRQ_IRC + TX4938_IR_PCIPME) | ||
179 | #define RBTX4938_IRQ_IRC_ACLC (RBTX4938_IRQ_IRC + TX4938_IR_ACLC) | ||
180 | #define RBTX4938_IRQ_IRC_ACLCPME (RBTX4938_IRQ_IRC + TX4938_IR_ACLCPME) | ||
181 | #define RBTX4938_IRQ_IRC_PCIC1 (RBTX4938_IRQ_IRC + TX4938_IR_PCIC1) | ||
182 | #define RBTX4938_IRQ_IRC_SPI (RBTX4938_IRQ_IRC + TX4938_IR_SPI) | ||
183 | #define RBTX4938_IRQ_IOC_PCID (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCID) | ||
184 | #define RBTX4938_IRQ_IOC_PCIC (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIC) | ||
185 | #define RBTX4938_IRQ_IOC_PCIB (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIB) | ||
186 | #define RBTX4938_IRQ_IOC_PCIA (RBTX4938_IRQ_IOC + RBTX4938_INTB_PCIA) | ||
187 | #define RBTX4938_IRQ_IOC_RTC (RBTX4938_IRQ_IOC + RBTX4938_INTB_RTC) | ||
188 | #define RBTX4938_IRQ_IOC_ATA (RBTX4938_IRQ_IOC + RBTX4938_INTB_ATA) | ||
189 | #define RBTX4938_IRQ_IOC_MODEM (RBTX4938_IRQ_IOC + RBTX4938_INTB_MODEM) | ||
190 | #define RBTX4938_IRQ_IOC_SWINT (RBTX4938_IRQ_IOC + RBTX4938_INTB_SWINT) | ||
191 | |||
192 | |||
193 | /* IOC (PCI, etc) */ | ||
194 | #define RBTX4938_IRQ_IOCINT (TX4938_IRQ_NEST_EXT_ON_PIC) | ||
195 | /* Onboard 10M Ether */ | ||
196 | #define RBTX4938_IRQ_ETHER (TX4938_IRQ_NEST_EXT_ON_PIC + 1) | ||
197 | |||
198 | #define RBTX4938_RTL_8019_BASE (RBTX4938_ETHER_ADDR - mips_io_port_base) | ||
199 | #define RBTX4938_RTL_8019_IRQ (RBTX4938_IRQ_ETHER) | ||
200 | |||
201 | /* IRCR : Int. Control */ | ||
202 | #define TX4938_IRCR_LOW 0x00000000 | ||
203 | #define TX4938_IRCR_HIGH 0x00000001 | ||
204 | #define TX4938_IRCR_DOWN 0x00000002 | ||
205 | #define TX4938_IRCR_UP 0x00000003 | ||
206 | |||
207 | #endif /* __ASM_TX_BOARDS_RBTX4938_H */ | ||
diff --git a/include/asm-mips/tx4938/spi.h b/include/asm-mips/tx4938/spi.h new file mode 100644 index 000000000000..0dbbab820a5a --- /dev/null +++ b/include/asm-mips/tx4938/spi.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * linux/include/asm-mips/tx4938/spi.h | ||
3 | * Definitions for TX4937/TX4938 SPI | ||
4 | * | ||
5 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
6 | * | ||
7 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
8 | * terms of the GNU General Public License version 2. This program is | ||
9 | * licensed "as is" without any warranty of any kind, whether express | ||
10 | * or implied. | ||
11 | * | ||
12 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
13 | */ | ||
14 | #ifndef __ASM_TX_BOARDS_TX4938_SPI_H | ||
15 | #define __ASM_TX_BOARDS_TX4938_SPI_H | ||
16 | |||
17 | /* SPI */ | ||
18 | struct spi_dev_desc { | ||
19 | unsigned int baud; | ||
20 | unsigned short tcss, tcsh, tcsr; /* CS setup/hold/recovery time */ | ||
21 | unsigned int byteorder:1; /* 0:LSB-First, 1:MSB-First */ | ||
22 | unsigned int polarity:1; /* 0:High-Active */ | ||
23 | unsigned int phase:1; /* 0:Sample-Then-Shift */ | ||
24 | }; | ||
25 | |||
26 | extern void txx9_spi_init(unsigned long base, int (*cs_func)(int chipid, int on)) __init; | ||
27 | extern void txx9_spi_irqinit(int irc_irq) __init; | ||
28 | extern int txx9_spi_io(int chipid, struct spi_dev_desc *desc, | ||
29 | unsigned char **inbufs, unsigned int *incounts, | ||
30 | unsigned char **outbufs, unsigned int *outcounts, | ||
31 | int cansleep); | ||
32 | extern int spi_eeprom_write_enable(int chipid, int enable); | ||
33 | extern int spi_eeprom_read_status(int chipid); | ||
34 | extern int spi_eeprom_read(int chipid, int address, unsigned char *buf, int len); | ||
35 | extern int spi_eeprom_write(int chipid, int address, unsigned char *buf, int len); | ||
36 | extern void spi_eeprom_proc_create(struct proc_dir_entry *dir, int chipid) __init; | ||
37 | |||
38 | #define TXX9_IMCLK (txx9_gbus_clock / 2) | ||
39 | |||
40 | /* | ||
41 | * SPI | ||
42 | */ | ||
43 | |||
44 | /* SPMCR : SPI Master Control */ | ||
45 | #define TXx9_SPMCR_OPMODE 0xc0 | ||
46 | #define TXx9_SPMCR_CONFIG 0x40 | ||
47 | #define TXx9_SPMCR_ACTIVE 0x80 | ||
48 | #define TXx9_SPMCR_SPSTP 0x02 | ||
49 | #define TXx9_SPMCR_BCLR 0x01 | ||
50 | |||
51 | /* SPCR0 : SPI Status */ | ||
52 | #define TXx9_SPCR0_TXIFL_MASK 0xc000 | ||
53 | #define TXx9_SPCR0_RXIFL_MASK 0x3000 | ||
54 | #define TXx9_SPCR0_SIDIE 0x0800 | ||
55 | #define TXx9_SPCR0_SOEIE 0x0400 | ||
56 | #define TXx9_SPCR0_RBSIE 0x0200 | ||
57 | #define TXx9_SPCR0_TBSIE 0x0100 | ||
58 | #define TXx9_SPCR0_IFSPSE 0x0010 | ||
59 | #define TXx9_SPCR0_SBOS 0x0004 | ||
60 | #define TXx9_SPCR0_SPHA 0x0002 | ||
61 | #define TXx9_SPCR0_SPOL 0x0001 | ||
62 | |||
63 | /* SPSR : SPI Status */ | ||
64 | #define TXx9_SPSR_TBSI 0x8000 | ||
65 | #define TXx9_SPSR_RBSI 0x4000 | ||
66 | #define TXx9_SPSR_TBS_MASK 0x3800 | ||
67 | #define TXx9_SPSR_RBS_MASK 0x0700 | ||
68 | #define TXx9_SPSR_SPOE 0x0080 | ||
69 | #define TXx9_SPSR_IFSD 0x0008 | ||
70 | #define TXx9_SPSR_SIDLE 0x0004 | ||
71 | #define TXx9_SPSR_STRDY 0x0002 | ||
72 | #define TXx9_SPSR_SRRDY 0x0001 | ||
73 | |||
74 | #endif /* __ASM_TX_BOARDS_TX4938_SPI_H */ | ||
diff --git a/include/asm-mips/tx4938/tx4938.h b/include/asm-mips/tx4938/tx4938.h new file mode 100644 index 000000000000..e25b1a0975cb --- /dev/null +++ b/include/asm-mips/tx4938/tx4938.h | |||
@@ -0,0 +1,706 @@ | |||
1 | /* | ||
2 | * linux/include/asm-mips/tx4938/tx4938.h | ||
3 | * Definitions for TX4937/TX4938 | ||
4 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
5 | * | ||
6 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
7 | * terms of the GNU General Public License version 2. This program is | ||
8 | * licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | * | ||
11 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
12 | */ | ||
13 | #ifndef __ASM_TX_BOARDS_TX4938_H | ||
14 | #define __ASM_TX_BOARDS_TX4938_H | ||
15 | |||
16 | #include <asm/tx4938/tx4938_mips.h> | ||
17 | |||
18 | #define tx4938_read_nfmc(addr) (*(volatile unsigned int *)(addr)) | ||
19 | #define tx4938_write_nfmc(b,addr) (*(volatile unsigned int *)(addr)) = (b) | ||
20 | |||
21 | #define TX4938_NR_IRQ_LOCAL TX4938_IRQ_PIC_BEG | ||
22 | |||
23 | #define TX4938_IRQ_IRC_PCIC (TX4938_NR_IRQ_LOCAL + TX4938_IR_PCIC) | ||
24 | #define TX4938_IRQ_IRC_PCIERR (TX4938_NR_IRQ_LOCAL + TX4938_IR_PCIERR) | ||
25 | |||
26 | #define TX4938_PCIIO_0 0x10000000 | ||
27 | #define TX4938_PCIIO_1 0x01010000 | ||
28 | #define TX4938_PCIMEM_0 0x08000000 | ||
29 | #define TX4938_PCIMEM_1 0x11000000 | ||
30 | |||
31 | #define TX4938_PCIIO_SIZE_0 0x01000000 | ||
32 | #define TX4938_PCIIO_SIZE_1 0x00010000 | ||
33 | #define TX4938_PCIMEM_SIZE_0 0x08000000 | ||
34 | #define TX4938_PCIMEM_SIZE_1 0x00010000 | ||
35 | |||
36 | #define TX4938_REG_BASE 0xff1f0000 /* == TX4937_REG_BASE */ | ||
37 | #define TX4938_REG_SIZE 0x00010000 /* == TX4937_REG_SIZE */ | ||
38 | |||
39 | /* NDFMC, SRAMC, PCIC1, SPIC: TX4938 only */ | ||
40 | #define TX4938_NDFMC_REG (TX4938_REG_BASE + 0x5000) | ||
41 | #define TX4938_SRAMC_REG (TX4938_REG_BASE + 0x6000) | ||
42 | #define TX4938_PCIC1_REG (TX4938_REG_BASE + 0x7000) | ||
43 | #define TX4938_SDRAMC_REG (TX4938_REG_BASE + 0x8000) | ||
44 | #define TX4938_EBUSC_REG (TX4938_REG_BASE + 0x9000) | ||
45 | #define TX4938_DMA_REG(ch) (TX4938_REG_BASE + 0xb000 + (ch) * 0x800) | ||
46 | #define TX4938_PCIC_REG (TX4938_REG_BASE + 0xd000) | ||
47 | #define TX4938_CCFG_REG (TX4938_REG_BASE + 0xe000) | ||
48 | #define TX4938_NR_TMR 3 | ||
49 | #define TX4938_TMR_REG(ch) ((TX4938_REG_BASE + 0xf000) + (ch) * 0x100) | ||
50 | #define TX4938_NR_SIO 2 | ||
51 | #define TX4938_SIO_REG(ch) ((TX4938_REG_BASE + 0xf300) + (ch) * 0x100) | ||
52 | #define TX4938_PIO_REG (TX4938_REG_BASE + 0xf500) | ||
53 | #define TX4938_IRC_REG (TX4938_REG_BASE + 0xf600) | ||
54 | #define TX4938_ACLC_REG (TX4938_REG_BASE + 0xf700) | ||
55 | #define TX4938_SPI_REG (TX4938_REG_BASE + 0xf800) | ||
56 | |||
57 | #ifndef _LANGUAGE_ASSEMBLY | ||
58 | #include <asm/byteorder.h> | ||
59 | |||
60 | #define TX4938_MKA(x) ((u32)( ((u32)(TX4938_REG_BASE)) | ((u32)(x)) )) | ||
61 | |||
62 | #define TX4938_RD08( reg ) (*(vu08*)(reg)) | ||
63 | #define TX4938_WR08( reg, val ) ((*(vu08*)(reg))=(val)) | ||
64 | |||
65 | #define TX4938_RD16( reg ) (*(vu16*)(reg)) | ||
66 | #define TX4938_WR16( reg, val ) ((*(vu16*)(reg))=(val)) | ||
67 | |||
68 | #define TX4938_RD32( reg ) (*(vu32*)(reg)) | ||
69 | #define TX4938_WR32( reg, val ) ((*(vu32*)(reg))=(val)) | ||
70 | |||
71 | #define TX4938_RD64( reg ) (*(vu64*)(reg)) | ||
72 | #define TX4938_WR64( reg, val ) ((*(vu64*)(reg))=(val)) | ||
73 | |||
74 | #define TX4938_RD( reg ) TX4938_RD32( reg ) | ||
75 | #define TX4938_WR( reg, val ) TX4938_WR32( reg, val ) | ||
76 | |||
77 | #endif /* !__ASSEMBLY__ */ | ||
78 | |||
79 | #ifdef __ASSEMBLY__ | ||
80 | #define _CONST64(c) c | ||
81 | #else | ||
82 | #define _CONST64(c) c##ull | ||
83 | |||
84 | #include <asm/byteorder.h> | ||
85 | |||
86 | #ifdef __BIG_ENDIAN | ||
87 | #define endian_def_l2(e1,e2) \ | ||
88 | volatile unsigned long e1,e2 | ||
89 | #define endian_def_s2(e1,e2) \ | ||
90 | volatile unsigned short e1,e2 | ||
91 | #define endian_def_sb2(e1,e2,e3) \ | ||
92 | volatile unsigned short e1;volatile unsigned char e2,e3 | ||
93 | #define endian_def_b2s(e1,e2,e3) \ | ||
94 | volatile unsigned char e1,e2;volatile unsigned short e3 | ||
95 | #define endian_def_b4(e1,e2,e3,e4) \ | ||
96 | volatile unsigned char e1,e2,e3,e4 | ||
97 | #else | ||
98 | #define endian_def_l2(e1,e2) \ | ||
99 | volatile unsigned long e2,e1 | ||
100 | #define endian_def_s2(e1,e2) \ | ||
101 | volatile unsigned short e2,e1 | ||
102 | #define endian_def_sb2(e1,e2,e3) \ | ||
103 | volatile unsigned char e3,e2;volatile unsigned short e1 | ||
104 | #define endian_def_b2s(e1,e2,e3) \ | ||
105 | volatile unsigned short e3;volatile unsigned char e2,e1 | ||
106 | #define endian_def_b4(e1,e2,e3,e4) \ | ||
107 | volatile unsigned char e4,e3,e2,e1 | ||
108 | #endif | ||
109 | |||
110 | |||
111 | struct tx4938_sdramc_reg { | ||
112 | volatile unsigned long long cr[4]; | ||
113 | volatile unsigned long long unused0[4]; | ||
114 | volatile unsigned long long tr; | ||
115 | volatile unsigned long long unused1[2]; | ||
116 | volatile unsigned long long cmd; | ||
117 | volatile unsigned long long sfcmd; | ||
118 | }; | ||
119 | |||
120 | struct tx4938_ebusc_reg { | ||
121 | volatile unsigned long long cr[8]; | ||
122 | }; | ||
123 | |||
124 | struct tx4938_dma_reg { | ||
125 | struct tx4938_dma_ch_reg { | ||
126 | volatile unsigned long long cha; | ||
127 | volatile unsigned long long sar; | ||
128 | volatile unsigned long long dar; | ||
129 | endian_def_l2(unused0, cntr); | ||
130 | endian_def_l2(unused1, sair); | ||
131 | endian_def_l2(unused2, dair); | ||
132 | endian_def_l2(unused3, ccr); | ||
133 | endian_def_l2(unused4, csr); | ||
134 | } ch[4]; | ||
135 | volatile unsigned long long dbr[8]; | ||
136 | volatile unsigned long long tdhr; | ||
137 | volatile unsigned long long midr; | ||
138 | endian_def_l2(unused0, mcr); | ||
139 | }; | ||
140 | |||
141 | struct tx4938_pcic_reg { | ||
142 | volatile unsigned long pciid; | ||
143 | volatile unsigned long pcistatus; | ||
144 | volatile unsigned long pciccrev; | ||
145 | volatile unsigned long pcicfg1; | ||
146 | volatile unsigned long p2gm0plbase; /* +10 */ | ||
147 | volatile unsigned long p2gm0pubase; | ||
148 | volatile unsigned long p2gm1plbase; | ||
149 | volatile unsigned long p2gm1pubase; | ||
150 | volatile unsigned long p2gm2pbase; /* +20 */ | ||
151 | volatile unsigned long p2giopbase; | ||
152 | volatile unsigned long unused0; | ||
153 | volatile unsigned long pcisid; | ||
154 | volatile unsigned long unused1; /* +30 */ | ||
155 | volatile unsigned long pcicapptr; | ||
156 | volatile unsigned long unused2; | ||
157 | volatile unsigned long pcicfg2; | ||
158 | volatile unsigned long g2ptocnt; /* +40 */ | ||
159 | volatile unsigned long unused3[15]; | ||
160 | volatile unsigned long g2pstatus; /* +80 */ | ||
161 | volatile unsigned long g2pmask; | ||
162 | volatile unsigned long pcisstatus; | ||
163 | volatile unsigned long pcimask; | ||
164 | volatile unsigned long p2gcfg; /* +90 */ | ||
165 | volatile unsigned long p2gstatus; | ||
166 | volatile unsigned long p2gmask; | ||
167 | volatile unsigned long p2gccmd; | ||
168 | volatile unsigned long unused4[24]; /* +a0 */ | ||
169 | volatile unsigned long pbareqport; /* +100 */ | ||
170 | volatile unsigned long pbacfg; | ||
171 | volatile unsigned long pbastatus; | ||
172 | volatile unsigned long pbamask; | ||
173 | volatile unsigned long pbabm; /* +110 */ | ||
174 | volatile unsigned long pbacreq; | ||
175 | volatile unsigned long pbacgnt; | ||
176 | volatile unsigned long pbacstate; | ||
177 | volatile unsigned long long g2pmgbase[3]; /* +120 */ | ||
178 | volatile unsigned long long g2piogbase; | ||
179 | volatile unsigned long g2pmmask[3]; /* +140 */ | ||
180 | volatile unsigned long g2piomask; | ||
181 | volatile unsigned long long g2pmpbase[3]; /* +150 */ | ||
182 | volatile unsigned long long g2piopbase; | ||
183 | volatile unsigned long pciccfg; /* +170 */ | ||
184 | volatile unsigned long pcicstatus; | ||
185 | volatile unsigned long pcicmask; | ||
186 | volatile unsigned long unused5; | ||
187 | volatile unsigned long long p2gmgbase[3]; /* +180 */ | ||
188 | volatile unsigned long long p2giogbase; | ||
189 | volatile unsigned long g2pcfgadrs; /* +1a0 */ | ||
190 | volatile unsigned long g2pcfgdata; | ||
191 | volatile unsigned long unused6[8]; | ||
192 | volatile unsigned long g2pintack; | ||
193 | volatile unsigned long g2pspc; | ||
194 | volatile unsigned long unused7[12]; /* +1d0 */ | ||
195 | volatile unsigned long long pdmca; /* +200 */ | ||
196 | volatile unsigned long long pdmga; | ||
197 | volatile unsigned long long pdmpa; | ||
198 | volatile unsigned long long pdmctr; | ||
199 | volatile unsigned long long pdmcfg; /* +220 */ | ||
200 | volatile unsigned long long pdmsts; | ||
201 | }; | ||
202 | |||
203 | struct tx4938_aclc_reg { | ||
204 | volatile unsigned long acctlen; | ||
205 | volatile unsigned long acctldis; | ||
206 | volatile unsigned long acregacc; | ||
207 | volatile unsigned long unused0; | ||
208 | volatile unsigned long acintsts; | ||
209 | volatile unsigned long acintmsts; | ||
210 | volatile unsigned long acinten; | ||
211 | volatile unsigned long acintdis; | ||
212 | volatile unsigned long acsemaph; | ||
213 | volatile unsigned long unused1[7]; | ||
214 | volatile unsigned long acgpidat; | ||
215 | volatile unsigned long acgpodat; | ||
216 | volatile unsigned long acslten; | ||
217 | volatile unsigned long acsltdis; | ||
218 | volatile unsigned long acfifosts; | ||
219 | volatile unsigned long unused2[11]; | ||
220 | volatile unsigned long acdmasts; | ||
221 | volatile unsigned long acdmasel; | ||
222 | volatile unsigned long unused3[6]; | ||
223 | volatile unsigned long acaudodat; | ||
224 | volatile unsigned long acsurrdat; | ||
225 | volatile unsigned long accentdat; | ||
226 | volatile unsigned long aclfedat; | ||
227 | volatile unsigned long acaudiat; | ||
228 | volatile unsigned long unused4; | ||
229 | volatile unsigned long acmodoat; | ||
230 | volatile unsigned long acmodidat; | ||
231 | volatile unsigned long unused5[15]; | ||
232 | volatile unsigned long acrevid; | ||
233 | }; | ||
234 | |||
235 | |||
236 | struct tx4938_tmr_reg { | ||
237 | volatile unsigned long tcr; | ||
238 | volatile unsigned long tisr; | ||
239 | volatile unsigned long cpra; | ||
240 | volatile unsigned long cprb; | ||
241 | volatile unsigned long itmr; | ||
242 | volatile unsigned long unused0[3]; | ||
243 | volatile unsigned long ccdr; | ||
244 | volatile unsigned long unused1[3]; | ||
245 | volatile unsigned long pgmr; | ||
246 | volatile unsigned long unused2[3]; | ||
247 | volatile unsigned long wtmr; | ||
248 | volatile unsigned long unused3[43]; | ||
249 | volatile unsigned long trr; | ||
250 | }; | ||
251 | |||
252 | struct tx4938_sio_reg { | ||
253 | volatile unsigned long lcr; | ||
254 | volatile unsigned long dicr; | ||
255 | volatile unsigned long disr; | ||
256 | volatile unsigned long cisr; | ||
257 | volatile unsigned long fcr; | ||
258 | volatile unsigned long flcr; | ||
259 | volatile unsigned long bgr; | ||
260 | volatile unsigned long tfifo; | ||
261 | volatile unsigned long rfifo; | ||
262 | }; | ||
263 | |||
264 | struct tx4938_pio_reg { | ||
265 | volatile unsigned long dout; | ||
266 | volatile unsigned long din; | ||
267 | volatile unsigned long dir; | ||
268 | volatile unsigned long od; | ||
269 | volatile unsigned long flag[2]; | ||
270 | volatile unsigned long pol; | ||
271 | volatile unsigned long intc; | ||
272 | volatile unsigned long maskcpu; | ||
273 | volatile unsigned long maskext; | ||
274 | }; | ||
275 | struct tx4938_irc_reg { | ||
276 | volatile unsigned long cer; | ||
277 | volatile unsigned long cr[2]; | ||
278 | volatile unsigned long unused0; | ||
279 | volatile unsigned long ilr[8]; | ||
280 | volatile unsigned long unused1[4]; | ||
281 | volatile unsigned long imr; | ||
282 | volatile unsigned long unused2[7]; | ||
283 | volatile unsigned long scr; | ||
284 | volatile unsigned long unused3[7]; | ||
285 | volatile unsigned long ssr; | ||
286 | volatile unsigned long unused4[7]; | ||
287 | volatile unsigned long csr; | ||
288 | }; | ||
289 | |||
290 | struct tx4938_ndfmc_reg { | ||
291 | endian_def_l2(unused0, dtr); | ||
292 | endian_def_l2(unused1, mcr); | ||
293 | endian_def_l2(unused2, sr); | ||
294 | endian_def_l2(unused3, isr); | ||
295 | endian_def_l2(unused4, imr); | ||
296 | endian_def_l2(unused5, spr); | ||
297 | endian_def_l2(unused6, rstr); | ||
298 | }; | ||
299 | |||
300 | struct tx4938_spi_reg { | ||
301 | volatile unsigned long mcr; | ||
302 | volatile unsigned long cr0; | ||
303 | volatile unsigned long cr1; | ||
304 | volatile unsigned long fs; | ||
305 | volatile unsigned long unused1; | ||
306 | volatile unsigned long sr; | ||
307 | volatile unsigned long dr; | ||
308 | volatile unsigned long unused2; | ||
309 | }; | ||
310 | |||
311 | struct tx4938_sramc_reg { | ||
312 | volatile unsigned long long cr; | ||
313 | }; | ||
314 | |||
315 | struct tx4938_ccfg_reg { | ||
316 | volatile unsigned long long ccfg; | ||
317 | volatile unsigned long long crir; | ||
318 | volatile unsigned long long pcfg; | ||
319 | volatile unsigned long long tear; | ||
320 | volatile unsigned long long clkctr; | ||
321 | volatile unsigned long long unused0; | ||
322 | volatile unsigned long long garbc; | ||
323 | volatile unsigned long long unused1; | ||
324 | volatile unsigned long long unused2; | ||
325 | volatile unsigned long long ramp; | ||
326 | volatile unsigned long long unused3; | ||
327 | volatile unsigned long long jmpadr; | ||
328 | }; | ||
329 | |||
330 | #undef endian_def_l2 | ||
331 | #undef endian_def_s2 | ||
332 | #undef endian_def_sb2 | ||
333 | #undef endian_def_b2s | ||
334 | #undef endian_def_b4 | ||
335 | |||
336 | #endif /* __ASSEMBLY__ */ | ||
337 | |||
338 | /* | ||
339 | * NDFMC | ||
340 | */ | ||
341 | |||
342 | /* NDFMCR : NDFMC Mode Control */ | ||
343 | #define TX4938_NDFMCR_WE 0x80 | ||
344 | #define TX4938_NDFMCR_ECC_ALL 0x60 | ||
345 | #define TX4938_NDFMCR_ECC_RESET 0x60 | ||
346 | #define TX4938_NDFMCR_ECC_READ 0x40 | ||
347 | #define TX4938_NDFMCR_ECC_ON 0x20 | ||
348 | #define TX4938_NDFMCR_ECC_OFF 0x00 | ||
349 | #define TX4938_NDFMCR_CE 0x10 | ||
350 | #define TX4938_NDFMCR_BSPRT 0x04 | ||
351 | #define TX4938_NDFMCR_ALE 0x02 | ||
352 | #define TX4938_NDFMCR_CLE 0x01 | ||
353 | |||
354 | /* NDFMCR : NDFMC Status */ | ||
355 | #define TX4938_NDFSR_BUSY 0x80 | ||
356 | |||
357 | /* NDFMCR : NDFMC Reset */ | ||
358 | #define TX4938_NDFRSTR_RST 0x01 | ||
359 | |||
360 | /* | ||
361 | * IRC | ||
362 | */ | ||
363 | |||
364 | #define TX4938_IR_ECCERR 0 | ||
365 | #define TX4938_IR_WTOERR 1 | ||
366 | #define TX4938_NUM_IR_INT 6 | ||
367 | #define TX4938_IR_INT(n) (2 + (n)) | ||
368 | #define TX4938_NUM_IR_SIO 2 | ||
369 | #define TX4938_IR_SIO(n) (8 + (n)) | ||
370 | #define TX4938_NUM_IR_DMA 4 | ||
371 | #define TX4938_IR_DMA(ch,n) ((ch ? 27 : 10) + (n)) /* 10-13,27-30 */ | ||
372 | #define TX4938_IR_PIO 14 | ||
373 | #define TX4938_IR_PDMAC 15 | ||
374 | #define TX4938_IR_PCIC 16 | ||
375 | #define TX4938_NUM_IR_TMR 3 | ||
376 | #define TX4938_IR_TMR(n) (17 + (n)) | ||
377 | #define TX4938_IR_NDFMC 21 | ||
378 | #define TX4938_IR_PCIERR 22 | ||
379 | #define TX4938_IR_PCIPME 23 | ||
380 | #define TX4938_IR_ACLC 24 | ||
381 | #define TX4938_IR_ACLCPME 25 | ||
382 | #define TX4938_IR_PCIC1 26 | ||
383 | #define TX4938_IR_SPI 31 | ||
384 | #define TX4938_NUM_IR 32 | ||
385 | /* multiplex */ | ||
386 | #define TX4938_IR_ETH0 TX4938_IR_INT(4) | ||
387 | #define TX4938_IR_ETH1 TX4938_IR_INT(3) | ||
388 | |||
389 | /* | ||
390 | * CCFG | ||
391 | */ | ||
392 | /* CCFG : Chip Configuration */ | ||
393 | #define TX4938_CCFG_WDRST _CONST64(0x0000020000000000) | ||
394 | #define TX4938_CCFG_WDREXEN _CONST64(0x0000010000000000) | ||
395 | #define TX4938_CCFG_BCFG_MASK _CONST64(0x000000ff00000000) | ||
396 | #define TX4938_CCFG_TINTDIS 0x01000000 | ||
397 | #define TX4938_CCFG_PCI66 0x00800000 | ||
398 | #define TX4938_CCFG_PCIMODE 0x00400000 | ||
399 | #define TX4938_CCFG_PCI1_66 0x00200000 | ||
400 | #define TX4938_CCFG_DIVMODE_MASK 0x001e0000 | ||
401 | #define TX4938_CCFG_DIVMODE_2 (0x4 << 17) | ||
402 | #define TX4938_CCFG_DIVMODE_2_5 (0xf << 17) | ||
403 | #define TX4938_CCFG_DIVMODE_3 (0x5 << 17) | ||
404 | #define TX4938_CCFG_DIVMODE_4 (0x6 << 17) | ||
405 | #define TX4938_CCFG_DIVMODE_4_5 (0xd << 17) | ||
406 | #define TX4938_CCFG_DIVMODE_8 (0x0 << 17) | ||
407 | #define TX4938_CCFG_DIVMODE_10 (0xb << 17) | ||
408 | #define TX4938_CCFG_DIVMODE_12 (0x1 << 17) | ||
409 | #define TX4938_CCFG_DIVMODE_16 (0x2 << 17) | ||
410 | #define TX4938_CCFG_DIVMODE_18 (0x9 << 17) | ||
411 | #define TX4938_CCFG_BEOW 0x00010000 | ||
412 | #define TX4938_CCFG_WR 0x00008000 | ||
413 | #define TX4938_CCFG_TOE 0x00004000 | ||
414 | #define TX4938_CCFG_PCIXARB 0x00002000 | ||
415 | #define TX4938_CCFG_PCIDIVMODE_MASK 0x00001c00 | ||
416 | #define TX4938_CCFG_PCIDIVMODE_4 (0x1 << 10) | ||
417 | #define TX4938_CCFG_PCIDIVMODE_4_5 (0x3 << 10) | ||
418 | #define TX4938_CCFG_PCIDIVMODE_5 (0x5 << 10) | ||
419 | #define TX4938_CCFG_PCIDIVMODE_5_5 (0x7 << 10) | ||
420 | #define TX4938_CCFG_PCIDIVMODE_8 (0x0 << 10) | ||
421 | #define TX4938_CCFG_PCIDIVMODE_9 (0x2 << 10) | ||
422 | #define TX4938_CCFG_PCIDIVMODE_10 (0x4 << 10) | ||
423 | #define TX4938_CCFG_PCIDIVMODE_11 (0x6 << 10) | ||
424 | #define TX4938_CCFG_PCI1DMD 0x00000100 | ||
425 | #define TX4938_CCFG_SYSSP_MASK 0x000000c0 | ||
426 | #define TX4938_CCFG_ENDIAN 0x00000004 | ||
427 | #define TX4938_CCFG_HALT 0x00000002 | ||
428 | #define TX4938_CCFG_ACEHOLD 0x00000001 | ||
429 | |||
430 | /* PCFG : Pin Configuration */ | ||
431 | #define TX4938_PCFG_ETH0_SEL _CONST64(0x8000000000000000) | ||
432 | #define TX4938_PCFG_ETH1_SEL _CONST64(0x4000000000000000) | ||
433 | #define TX4938_PCFG_ATA_SEL _CONST64(0x2000000000000000) | ||
434 | #define TX4938_PCFG_ISA_SEL _CONST64(0x1000000000000000) | ||
435 | #define TX4938_PCFG_SPI_SEL _CONST64(0x0800000000000000) | ||
436 | #define TX4938_PCFG_NDF_SEL _CONST64(0x0400000000000000) | ||
437 | #define TX4938_PCFG_SDCLKDLY_MASK 0x30000000 | ||
438 | #define TX4938_PCFG_SDCLKDLY(d) ((d)<<28) | ||
439 | #define TX4938_PCFG_SYSCLKEN 0x08000000 | ||
440 | #define TX4938_PCFG_SDCLKEN_ALL 0x07800000 | ||
441 | #define TX4938_PCFG_SDCLKEN(ch) (0x00800000<<(ch)) | ||
442 | #define TX4938_PCFG_PCICLKEN_ALL 0x003f0000 | ||
443 | #define TX4938_PCFG_PCICLKEN(ch) (0x00010000<<(ch)) | ||
444 | #define TX4938_PCFG_SEL2 0x00000200 | ||
445 | #define TX4938_PCFG_SEL1 0x00000100 | ||
446 | #define TX4938_PCFG_DMASEL_ALL 0x0000000f | ||
447 | #define TX4938_PCFG_DMASEL0_DRQ0 0x00000000 | ||
448 | #define TX4938_PCFG_DMASEL0_SIO1 0x00000001 | ||
449 | #define TX4938_PCFG_DMASEL1_DRQ1 0x00000000 | ||
450 | #define TX4938_PCFG_DMASEL1_SIO1 0x00000002 | ||
451 | #define TX4938_PCFG_DMASEL2_DRQ2 0x00000000 | ||
452 | #define TX4938_PCFG_DMASEL2_SIO0 0x00000004 | ||
453 | #define TX4938_PCFG_DMASEL3_DRQ3 0x00000000 | ||
454 | #define TX4938_PCFG_DMASEL3_SIO0 0x00000008 | ||
455 | |||
456 | /* CLKCTR : Clock Control */ | ||
457 | #define TX4938_CLKCTR_NDFCKD _CONST64(0x0001000000000000) | ||
458 | #define TX4938_CLKCTR_NDFRST _CONST64(0x0000000100000000) | ||
459 | #define TX4938_CLKCTR_ETH1CKD 0x80000000 | ||
460 | #define TX4938_CLKCTR_ETH0CKD 0x40000000 | ||
461 | #define TX4938_CLKCTR_SPICKD 0x20000000 | ||
462 | #define TX4938_CLKCTR_SRAMCKD 0x10000000 | ||
463 | #define TX4938_CLKCTR_PCIC1CKD 0x08000000 | ||
464 | #define TX4938_CLKCTR_DMA1CKD 0x04000000 | ||
465 | #define TX4938_CLKCTR_ACLCKD 0x02000000 | ||
466 | #define TX4938_CLKCTR_PIOCKD 0x01000000 | ||
467 | #define TX4938_CLKCTR_DMACKD 0x00800000 | ||
468 | #define TX4938_CLKCTR_PCICKD 0x00400000 | ||
469 | #define TX4938_CLKCTR_TM0CKD 0x00100000 | ||
470 | #define TX4938_CLKCTR_TM1CKD 0x00080000 | ||
471 | #define TX4938_CLKCTR_TM2CKD 0x00040000 | ||
472 | #define TX4938_CLKCTR_SIO0CKD 0x00020000 | ||
473 | #define TX4938_CLKCTR_SIO1CKD 0x00010000 | ||
474 | #define TX4938_CLKCTR_ETH1RST 0x00008000 | ||
475 | #define TX4938_CLKCTR_ETH0RST 0x00004000 | ||
476 | #define TX4938_CLKCTR_SPIRST 0x00002000 | ||
477 | #define TX4938_CLKCTR_SRAMRST 0x00001000 | ||
478 | #define TX4938_CLKCTR_PCIC1RST 0x00000800 | ||
479 | #define TX4938_CLKCTR_DMA1RST 0x00000400 | ||
480 | #define TX4938_CLKCTR_ACLRST 0x00000200 | ||
481 | #define TX4938_CLKCTR_PIORST 0x00000100 | ||
482 | #define TX4938_CLKCTR_DMARST 0x00000080 | ||
483 | #define TX4938_CLKCTR_PCIRST 0x00000040 | ||
484 | #define TX4938_CLKCTR_TM0RST 0x00000010 | ||
485 | #define TX4938_CLKCTR_TM1RST 0x00000008 | ||
486 | #define TX4938_CLKCTR_TM2RST 0x00000004 | ||
487 | #define TX4938_CLKCTR_SIO0RST 0x00000002 | ||
488 | #define TX4938_CLKCTR_SIO1RST 0x00000001 | ||
489 | |||
490 | /* bits for G2PSTATUS/G2PMASK */ | ||
491 | #define TX4938_PCIC_G2PSTATUS_ALL 0x00000003 | ||
492 | #define TX4938_PCIC_G2PSTATUS_TTOE 0x00000002 | ||
493 | #define TX4938_PCIC_G2PSTATUS_RTOE 0x00000001 | ||
494 | |||
495 | /* bits for PCIMASK (see also PCI_STATUS_XXX in linux/pci.h */ | ||
496 | #define TX4938_PCIC_PCISTATUS_ALL 0x0000f900 | ||
497 | |||
498 | /* bits for PBACFG */ | ||
499 | #define TX4938_PCIC_PBACFG_FIXPA 0x00000008 | ||
500 | #define TX4938_PCIC_PBACFG_RPBA 0x00000004 | ||
501 | #define TX4938_PCIC_PBACFG_PBAEN 0x00000002 | ||
502 | #define TX4938_PCIC_PBACFG_BMCEN 0x00000001 | ||
503 | |||
504 | /* bits for G2PMnGBASE */ | ||
505 | #define TX4938_PCIC_G2PMnGBASE_BSDIS _CONST64(0x0000002000000000) | ||
506 | #define TX4938_PCIC_G2PMnGBASE_ECHG _CONST64(0x0000001000000000) | ||
507 | |||
508 | /* bits for G2PIOGBASE */ | ||
509 | #define TX4938_PCIC_G2PIOGBASE_BSDIS _CONST64(0x0000002000000000) | ||
510 | #define TX4938_PCIC_G2PIOGBASE_ECHG _CONST64(0x0000001000000000) | ||
511 | |||
512 | /* bits for PCICSTATUS/PCICMASK */ | ||
513 | #define TX4938_PCIC_PCICSTATUS_ALL 0x000007b8 | ||
514 | #define TX4938_PCIC_PCICSTATUS_PME 0x00000400 | ||
515 | #define TX4938_PCIC_PCICSTATUS_TLB 0x00000200 | ||
516 | #define TX4938_PCIC_PCICSTATUS_NIB 0x00000100 | ||
517 | #define TX4938_PCIC_PCICSTATUS_ZIB 0x00000080 | ||
518 | #define TX4938_PCIC_PCICSTATUS_PERR 0x00000020 | ||
519 | #define TX4938_PCIC_PCICSTATUS_SERR 0x00000010 | ||
520 | #define TX4938_PCIC_PCICSTATUS_GBE 0x00000008 | ||
521 | #define TX4938_PCIC_PCICSTATUS_IWB 0x00000002 | ||
522 | #define TX4938_PCIC_PCICSTATUS_E2PDONE 0x00000001 | ||
523 | |||
524 | /* bits for PCICCFG */ | ||
525 | #define TX4938_PCIC_PCICCFG_GBWC_MASK 0x0fff0000 | ||
526 | #define TX4938_PCIC_PCICCFG_HRST 0x00000800 | ||
527 | #define TX4938_PCIC_PCICCFG_SRST 0x00000400 | ||
528 | #define TX4938_PCIC_PCICCFG_IRBER 0x00000200 | ||
529 | #define TX4938_PCIC_PCICCFG_G2PMEN(ch) (0x00000100>>(ch)) | ||
530 | #define TX4938_PCIC_PCICCFG_G2PM0EN 0x00000100 | ||
531 | #define TX4938_PCIC_PCICCFG_G2PM1EN 0x00000080 | ||
532 | #define TX4938_PCIC_PCICCFG_G2PM2EN 0x00000040 | ||
533 | #define TX4938_PCIC_PCICCFG_G2PIOEN 0x00000020 | ||
534 | #define TX4938_PCIC_PCICCFG_TCAR 0x00000010 | ||
535 | #define TX4938_PCIC_PCICCFG_ICAEN 0x00000008 | ||
536 | |||
537 | /* bits for P2GMnGBASE */ | ||
538 | #define TX4938_PCIC_P2GMnGBASE_TMEMEN _CONST64(0x0000004000000000) | ||
539 | #define TX4938_PCIC_P2GMnGBASE_TBSDIS _CONST64(0x0000002000000000) | ||
540 | #define TX4938_PCIC_P2GMnGBASE_TECHG _CONST64(0x0000001000000000) | ||
541 | |||
542 | /* bits for P2GIOGBASE */ | ||
543 | #define TX4938_PCIC_P2GIOGBASE_TIOEN _CONST64(0x0000004000000000) | ||
544 | #define TX4938_PCIC_P2GIOGBASE_TBSDIS _CONST64(0x0000002000000000) | ||
545 | #define TX4938_PCIC_P2GIOGBASE_TECHG _CONST64(0x0000001000000000) | ||
546 | |||
547 | #define TX4938_PCIC_IDSEL_AD_TO_SLOT(ad) ((ad) - 11) | ||
548 | #define TX4938_PCIC_MAX_DEVNU TX4938_PCIC_IDSEL_AD_TO_SLOT(32) | ||
549 | |||
550 | /* bits for PDMCFG */ | ||
551 | #define TX4938_PCIC_PDMCFG_RSTFIFO 0x00200000 | ||
552 | #define TX4938_PCIC_PDMCFG_EXFER 0x00100000 | ||
553 | #define TX4938_PCIC_PDMCFG_REQDLY_MASK 0x00003800 | ||
554 | #define TX4938_PCIC_PDMCFG_REQDLY_NONE (0 << 11) | ||
555 | #define TX4938_PCIC_PDMCFG_REQDLY_16 (1 << 11) | ||
556 | #define TX4938_PCIC_PDMCFG_REQDLY_32 (2 << 11) | ||
557 | #define TX4938_PCIC_PDMCFG_REQDLY_64 (3 << 11) | ||
558 | #define TX4938_PCIC_PDMCFG_REQDLY_128 (4 << 11) | ||
559 | #define TX4938_PCIC_PDMCFG_REQDLY_256 (5 << 11) | ||
560 | #define TX4938_PCIC_PDMCFG_REQDLY_512 (6 << 11) | ||
561 | #define TX4938_PCIC_PDMCFG_REQDLY_1024 (7 << 11) | ||
562 | #define TX4938_PCIC_PDMCFG_ERRIE 0x00000400 | ||
563 | #define TX4938_PCIC_PDMCFG_NCCMPIE 0x00000200 | ||
564 | #define TX4938_PCIC_PDMCFG_NTCMPIE 0x00000100 | ||
565 | #define TX4938_PCIC_PDMCFG_CHNEN 0x00000080 | ||
566 | #define TX4938_PCIC_PDMCFG_XFRACT 0x00000040 | ||
567 | #define TX4938_PCIC_PDMCFG_BSWAP 0x00000020 | ||
568 | #define TX4938_PCIC_PDMCFG_XFRSIZE_MASK 0x0000000c | ||
569 | #define TX4938_PCIC_PDMCFG_XFRSIZE_1DW 0x00000000 | ||
570 | #define TX4938_PCIC_PDMCFG_XFRSIZE_1QW 0x00000004 | ||
571 | #define TX4938_PCIC_PDMCFG_XFRSIZE_4QW 0x00000008 | ||
572 | #define TX4938_PCIC_PDMCFG_XFRDIRC 0x00000002 | ||
573 | #define TX4938_PCIC_PDMCFG_CHRST 0x00000001 | ||
574 | |||
575 | /* bits for PDMSTS */ | ||
576 | #define TX4938_PCIC_PDMSTS_REQCNT_MASK 0x3f000000 | ||
577 | #define TX4938_PCIC_PDMSTS_FIFOCNT_MASK 0x00f00000 | ||
578 | #define TX4938_PCIC_PDMSTS_FIFOWP_MASK 0x000c0000 | ||
579 | #define TX4938_PCIC_PDMSTS_FIFORP_MASK 0x00030000 | ||
580 | #define TX4938_PCIC_PDMSTS_ERRINT 0x00000800 | ||
581 | #define TX4938_PCIC_PDMSTS_DONEINT 0x00000400 | ||
582 | #define TX4938_PCIC_PDMSTS_CHNEN 0x00000200 | ||
583 | #define TX4938_PCIC_PDMSTS_XFRACT 0x00000100 | ||
584 | #define TX4938_PCIC_PDMSTS_ACCMP 0x00000080 | ||
585 | #define TX4938_PCIC_PDMSTS_NCCMP 0x00000040 | ||
586 | #define TX4938_PCIC_PDMSTS_NTCMP 0x00000020 | ||
587 | #define TX4938_PCIC_PDMSTS_CFGERR 0x00000008 | ||
588 | #define TX4938_PCIC_PDMSTS_PCIERR 0x00000004 | ||
589 | #define TX4938_PCIC_PDMSTS_CHNERR 0x00000002 | ||
590 | #define TX4938_PCIC_PDMSTS_DATAERR 0x00000001 | ||
591 | #define TX4938_PCIC_PDMSTS_ALL_CMP 0x000000e0 | ||
592 | #define TX4938_PCIC_PDMSTS_ALL_ERR 0x0000000f | ||
593 | |||
594 | /* | ||
595 | * DMA | ||
596 | */ | ||
597 | /* bits for MCR */ | ||
598 | #define TX4938_DMA_MCR_EIS(ch) (0x10000000<<(ch)) | ||
599 | #define TX4938_DMA_MCR_DIS(ch) (0x01000000<<(ch)) | ||
600 | #define TX4938_DMA_MCR_RSFIF 0x00000080 | ||
601 | #define TX4938_DMA_MCR_FIFUM(ch) (0x00000008<<(ch)) | ||
602 | #define TX4938_DMA_MCR_RPRT 0x00000002 | ||
603 | #define TX4938_DMA_MCR_MSTEN 0x00000001 | ||
604 | |||
605 | /* bits for CCRn */ | ||
606 | #define TX4938_DMA_CCR_IMMCHN 0x20000000 | ||
607 | #define TX4938_DMA_CCR_USEXFSZ 0x10000000 | ||
608 | #define TX4938_DMA_CCR_LE 0x08000000 | ||
609 | #define TX4938_DMA_CCR_DBINH 0x04000000 | ||
610 | #define TX4938_DMA_CCR_SBINH 0x02000000 | ||
611 | #define TX4938_DMA_CCR_CHRST 0x01000000 | ||
612 | #define TX4938_DMA_CCR_RVBYTE 0x00800000 | ||
613 | #define TX4938_DMA_CCR_ACKPOL 0x00400000 | ||
614 | #define TX4938_DMA_CCR_REQPL 0x00200000 | ||
615 | #define TX4938_DMA_CCR_EGREQ 0x00100000 | ||
616 | #define TX4938_DMA_CCR_CHDN 0x00080000 | ||
617 | #define TX4938_DMA_CCR_DNCTL 0x00060000 | ||
618 | #define TX4938_DMA_CCR_EXTRQ 0x00010000 | ||
619 | #define TX4938_DMA_CCR_INTRQD 0x0000e000 | ||
620 | #define TX4938_DMA_CCR_INTENE 0x00001000 | ||
621 | #define TX4938_DMA_CCR_INTENC 0x00000800 | ||
622 | #define TX4938_DMA_CCR_INTENT 0x00000400 | ||
623 | #define TX4938_DMA_CCR_CHNEN 0x00000200 | ||
624 | #define TX4938_DMA_CCR_XFACT 0x00000100 | ||
625 | #define TX4938_DMA_CCR_SMPCHN 0x00000020 | ||
626 | #define TX4938_DMA_CCR_XFSZ(order) (((order) << 2) & 0x0000001c) | ||
627 | #define TX4938_DMA_CCR_XFSZ_1W TX4938_DMA_CCR_XFSZ(2) | ||
628 | #define TX4938_DMA_CCR_XFSZ_2W TX4938_DMA_CCR_XFSZ(3) | ||
629 | #define TX4938_DMA_CCR_XFSZ_4W TX4938_DMA_CCR_XFSZ(4) | ||
630 | #define TX4938_DMA_CCR_XFSZ_8W TX4938_DMA_CCR_XFSZ(5) | ||
631 | #define TX4938_DMA_CCR_XFSZ_16W TX4938_DMA_CCR_XFSZ(6) | ||
632 | #define TX4938_DMA_CCR_XFSZ_32W TX4938_DMA_CCR_XFSZ(7) | ||
633 | #define TX4938_DMA_CCR_MEMIO 0x00000002 | ||
634 | #define TX4938_DMA_CCR_SNGAD 0x00000001 | ||
635 | |||
636 | /* bits for CSRn */ | ||
637 | #define TX4938_DMA_CSR_CHNEN 0x00000400 | ||
638 | #define TX4938_DMA_CSR_STLXFER 0x00000200 | ||
639 | #define TX4938_DMA_CSR_CHNACT 0x00000100 | ||
640 | #define TX4938_DMA_CSR_ABCHC 0x00000080 | ||
641 | #define TX4938_DMA_CSR_NCHNC 0x00000040 | ||
642 | #define TX4938_DMA_CSR_NTRNFC 0x00000020 | ||
643 | #define TX4938_DMA_CSR_EXTDN 0x00000010 | ||
644 | #define TX4938_DMA_CSR_CFERR 0x00000008 | ||
645 | #define TX4938_DMA_CSR_CHERR 0x00000004 | ||
646 | #define TX4938_DMA_CSR_DESERR 0x00000002 | ||
647 | #define TX4938_DMA_CSR_SORERR 0x00000001 | ||
648 | |||
649 | /* TX4938 Interrupt Controller (32-bit registers) */ | ||
650 | #define TX4938_IRC_BASE 0xf510 | ||
651 | #define TX4938_IRC_IRFLAG0 0xf510 | ||
652 | #define TX4938_IRC_IRFLAG1 0xf514 | ||
653 | #define TX4938_IRC_IRPOL 0xf518 | ||
654 | #define TX4938_IRC_IRRCNT 0xf51c | ||
655 | #define TX4938_IRC_IRMASKINT 0xf520 | ||
656 | #define TX4938_IRC_IRMASKEXT 0xf524 | ||
657 | #define TX4938_IRC_IRDEN 0xf600 | ||
658 | #define TX4938_IRC_IRDM0 0xf604 | ||
659 | #define TX4938_IRC_IRDM1 0xf608 | ||
660 | #define TX4938_IRC_IRLVL0 0xf610 | ||
661 | #define TX4938_IRC_IRLVL1 0xf614 | ||
662 | #define TX4938_IRC_IRLVL2 0xf618 | ||
663 | #define TX4938_IRC_IRLVL3 0xf61c | ||
664 | #define TX4938_IRC_IRLVL4 0xf620 | ||
665 | #define TX4938_IRC_IRLVL5 0xf624 | ||
666 | #define TX4938_IRC_IRLVL6 0xf628 | ||
667 | #define TX4938_IRC_IRLVL7 0xf62c | ||
668 | #define TX4938_IRC_IRMSK 0xf640 | ||
669 | #define TX4938_IRC_IREDC 0xf660 | ||
670 | #define TX4938_IRC_IRPND 0xf680 | ||
671 | #define TX4938_IRC_IRCS 0xf6a0 | ||
672 | #define TX4938_IRC_LIMIT 0xf6ff | ||
673 | |||
674 | |||
675 | #ifndef __ASSEMBLY__ | ||
676 | |||
677 | #define tx4938_sdramcptr ((struct tx4938_sdramc_reg *)TX4938_SDRAMC_REG) | ||
678 | #define tx4938_ebuscptr ((struct tx4938_ebusc_reg *)TX4938_EBUSC_REG) | ||
679 | #define tx4938_dmaptr(ch) ((struct tx4938_dma_reg *)TX4938_DMA_REG(ch)) | ||
680 | #define tx4938_ndfmcptr ((struct tx4938_ndfmc_reg *)TX4938_NDFMC_REG) | ||
681 | #define tx4938_ircptr ((struct tx4938_irc_reg *)TX4938_IRC_REG) | ||
682 | #define tx4938_pcicptr ((struct tx4938_pcic_reg *)TX4938_PCIC_REG) | ||
683 | #define tx4938_pcic1ptr ((struct tx4938_pcic_reg *)TX4938_PCIC1_REG) | ||
684 | #define tx4938_ccfgptr ((struct tx4938_ccfg_reg *)TX4938_CCFG_REG) | ||
685 | #define tx4938_tmrptr(ch) ((struct tx4938_tmr_reg *)TX4938_TMR_REG(ch)) | ||
686 | #define tx4938_sioptr(ch) ((struct tx4938_sio_reg *)TX4938_SIO_REG(ch)) | ||
687 | #define tx4938_pioptr ((struct tx4938_pio_reg *)TX4938_PIO_REG) | ||
688 | #define tx4938_aclcptr ((struct tx4938_aclc_reg *)TX4938_ACLC_REG) | ||
689 | #define tx4938_spiptr ((struct tx4938_spi_reg *)TX4938_SPI_REG) | ||
690 | #define tx4938_sramcptr ((struct tx4938_sramc_reg *)TX4938_SRAMC_REG) | ||
691 | |||
692 | |||
693 | #define TX4938_REV_MAJ_MIN() ((unsigned long)tx4938_ccfgptr->crir & 0x00ff) | ||
694 | #define TX4938_REV_PCODE() ((unsigned long)tx4938_ccfgptr->crir >> 16) | ||
695 | |||
696 | #define TX4938_SDRAMC_BA(ch) ((tx4938_sdramcptr->cr[ch] >> 49) << 21) | ||
697 | #define TX4938_SDRAMC_SIZE(ch) (((tx4938_sdramcptr->cr[ch] >> 33) + 1) << 21) | ||
698 | |||
699 | #define TX4938_EBUSC_BA(ch) ((tx4938_ebuscptr->cr[ch] >> 48) << 20) | ||
700 | #define TX4938_EBUSC_SIZE(ch) \ | ||
701 | (0x00100000 << ((unsigned long)(tx4938_ebuscptr->cr[ch] >> 8) & 0xf)) | ||
702 | |||
703 | |||
704 | #endif /* !__ASSEMBLY__ */ | ||
705 | |||
706 | #endif | ||
diff --git a/include/asm-mips/tx4938/tx4938_mips.h b/include/asm-mips/tx4938/tx4938_mips.h new file mode 100644 index 000000000000..cf89b205f103 --- /dev/null +++ b/include/asm-mips/tx4938/tx4938_mips.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * linux/include/asm-mips/tx4938/tx4938_bitmask.h | ||
3 | * Generic bitmask definitions | ||
4 | * | ||
5 | * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the | ||
6 | * terms of the GNU General Public License version 2. This program is | ||
7 | * licensed "as is" without any warranty of any kind, whether express | ||
8 | * or implied. | ||
9 | * | ||
10 | * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com) | ||
11 | */ | ||
12 | |||
13 | #ifndef TX4938_TX4938_MIPS_H | ||
14 | #define TX4938_TX4938_MIPS_H | ||
15 | #ifndef __ASSEMBLY__ | ||
16 | |||
17 | #define reg_rd08(r) ((u8 )(*((vu8 *)(r)))) | ||
18 | #define reg_rd16(r) ((u16)(*((vu16*)(r)))) | ||
19 | #define reg_rd32(r) ((u32)(*((vu32*)(r)))) | ||
20 | #define reg_rd64(r) ((u64)(*((vu64*)(r)))) | ||
21 | |||
22 | #define reg_wr08(r,v) ((*((vu8 *)(r)))=((u8 )(v))) | ||
23 | #define reg_wr16(r,v) ((*((vu16*)(r)))=((u16)(v))) | ||
24 | #define reg_wr32(r,v) ((*((vu32*)(r)))=((u32)(v))) | ||
25 | #define reg_wr64(r,v) ((*((vu64*)(r)))=((u64)(v))) | ||
26 | |||
27 | typedef volatile __signed char vs8; | ||
28 | typedef volatile unsigned char vu8; | ||
29 | |||
30 | typedef volatile __signed short vs16; | ||
31 | typedef volatile unsigned short vu16; | ||
32 | |||
33 | typedef volatile __signed int vs32; | ||
34 | typedef volatile unsigned int vu32; | ||
35 | |||
36 | typedef s8 s08; | ||
37 | typedef vs8 vs08; | ||
38 | |||
39 | typedef u8 u08; | ||
40 | typedef vu8 vu08; | ||
41 | |||
42 | #if (_MIPS_SZLONG == 64) | ||
43 | |||
44 | typedef volatile __signed__ long vs64; | ||
45 | typedef volatile unsigned long vu64; | ||
46 | |||
47 | #else | ||
48 | |||
49 | typedef volatile __signed__ long long vs64; | ||
50 | typedef volatile unsigned long long vu64; | ||
51 | |||
52 | #endif | ||
53 | #endif | ||
54 | #endif | ||
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 5c2c98329012..41bb96bb2120 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h | |||
@@ -196,63 +196,55 @@ | |||
196 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | 196 | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) |
197 | 197 | ||
198 | struct __large_struct { unsigned long buf[100]; }; | 198 | struct __large_struct { unsigned long buf[100]; }; |
199 | #define __m(x) (*(struct __large_struct *)(x)) | 199 | #define __m(x) (*(struct __large_struct __user *)(x)) |
200 | 200 | ||
201 | /* | 201 | /* |
202 | * Yuck. We need two variants, one for 64bit operation and one | 202 | * Yuck. We need two variants, one for 64bit operation and one |
203 | * for 32 bit mode and old iron. | 203 | * for 32 bit mode and old iron. |
204 | */ | 204 | */ |
205 | #ifdef __mips64 | 205 | #ifdef __mips64 |
206 | #define __GET_USER_DW(__gu_err) __get_user_asm("ld", __gu_err) | 206 | #define __GET_USER_DW(ptr) __get_user_asm("ld", ptr) |
207 | #else | 207 | #else |
208 | #define __GET_USER_DW(__gu_err) __get_user_asm_ll32(__gu_err) | 208 | #define __GET_USER_DW(ptr) __get_user_asm_ll32(ptr) |
209 | #endif | 209 | #endif |
210 | 210 | ||
211 | #define __get_user_nocheck(x,ptr,size) \ | 211 | #define __get_user_nocheck(x,ptr,size) \ |
212 | ({ \ | 212 | ({ \ |
213 | __typeof(*(ptr)) __gu_val = 0; \ | 213 | __typeof(*(ptr)) __gu_val = (__typeof(*(ptr))) 0; \ |
214 | long __gu_addr; \ | ||
215 | long __gu_err = 0; \ | 214 | long __gu_err = 0; \ |
216 | \ | 215 | \ |
217 | might_sleep(); \ | ||
218 | __gu_addr = (long) (ptr); \ | ||
219 | switch (size) { \ | 216 | switch (size) { \ |
220 | case 1: __get_user_asm("lb", __gu_err); break; \ | 217 | case 1: __get_user_asm("lb", ptr); break; \ |
221 | case 2: __get_user_asm("lh", __gu_err); break; \ | 218 | case 2: __get_user_asm("lh", ptr); break; \ |
222 | case 4: __get_user_asm("lw", __gu_err); break; \ | 219 | case 4: __get_user_asm("lw", ptr); break; \ |
223 | case 8: __GET_USER_DW(__gu_err); break; \ | 220 | case 8: __GET_USER_DW(ptr); break; \ |
224 | default: __get_user_unknown(); break; \ | 221 | default: __get_user_unknown(); break; \ |
225 | } \ | 222 | } \ |
226 | x = (__typeof__(*(ptr))) __gu_val; \ | 223 | (x) = (__typeof__(*(ptr))) __gu_val; \ |
227 | __gu_err; \ | 224 | __gu_err; \ |
228 | }) | 225 | }) |
229 | 226 | ||
230 | #define __get_user_check(x,ptr,size) \ | 227 | #define __get_user_check(x,ptr,size) \ |
231 | ({ \ | 228 | ({ \ |
229 | const __typeof__(*(ptr)) __user * __gu_addr = (ptr); \ | ||
232 | __typeof__(*(ptr)) __gu_val = 0; \ | 230 | __typeof__(*(ptr)) __gu_val = 0; \ |
233 | long __gu_addr; \ | 231 | long __gu_err = -EFAULT; \ |
234 | long __gu_err; \ | ||
235 | \ | ||
236 | might_sleep(); \ | ||
237 | __gu_addr = (long) (ptr); \ | ||
238 | __gu_err = access_ok(VERIFY_READ, (void *) __gu_addr, size) \ | ||
239 | ? 0 : -EFAULT; \ | ||
240 | \ | 232 | \ |
241 | if (likely(!__gu_err)) { \ | 233 | if (likely(access_ok(VERIFY_READ, __gu_addr, size))) { \ |
242 | switch (size) { \ | 234 | switch (size) { \ |
243 | case 1: __get_user_asm("lb", __gu_err); break; \ | 235 | case 1: __get_user_asm("lb", __gu_addr); break; \ |
244 | case 2: __get_user_asm("lh", __gu_err); break; \ | 236 | case 2: __get_user_asm("lh", __gu_addr); break; \ |
245 | case 4: __get_user_asm("lw", __gu_err); break; \ | 237 | case 4: __get_user_asm("lw", __gu_addr); break; \ |
246 | case 8: __GET_USER_DW(__gu_err); break; \ | 238 | case 8: __GET_USER_DW(__gu_addr); break; \ |
247 | default: __get_user_unknown(); break; \ | 239 | default: __get_user_unknown(); break; \ |
248 | } \ | 240 | } \ |
249 | } \ | 241 | } \ |
250 | x = (__typeof__(*(ptr))) __gu_val; \ | 242 | (x) = (__typeof__(*(ptr))) __gu_val; \ |
251 | __gu_err; \ | 243 | __gu_err; \ |
252 | }) | 244 | }) |
253 | 245 | ||
254 | #define __get_user_asm(insn,__gu_err) \ | 246 | #define __get_user_asm(insn, addr) \ |
255 | ({ \ | 247 | { \ |
256 | __asm__ __volatile__( \ | 248 | __asm__ __volatile__( \ |
257 | "1: " insn " %1, %3 \n" \ | 249 | "1: " insn " %1, %3 \n" \ |
258 | "2: \n" \ | 250 | "2: \n" \ |
@@ -264,20 +256,20 @@ struct __large_struct { unsigned long buf[100]; }; | |||
264 | " "__UA_ADDR "\t1b, 3b \n" \ | 256 | " "__UA_ADDR "\t1b, 3b \n" \ |
265 | " .previous \n" \ | 257 | " .previous \n" \ |
266 | : "=r" (__gu_err), "=r" (__gu_val) \ | 258 | : "=r" (__gu_err), "=r" (__gu_val) \ |
267 | : "0" (__gu_err), "o" (__m(__gu_addr)), "i" (-EFAULT)); \ | 259 | : "0" (0), "o" (__m(addr)), "i" (-EFAULT)); \ |
268 | }) | 260 | } |
269 | 261 | ||
270 | /* | 262 | /* |
271 | * Get a long long 64 using 32 bit registers. | 263 | * Get a long long 64 using 32 bit registers. |
272 | */ | 264 | */ |
273 | #define __get_user_asm_ll32(__gu_err) \ | 265 | #define __get_user_asm_ll32(addr) \ |
274 | ({ \ | 266 | { \ |
275 | __asm__ __volatile__( \ | 267 | __asm__ __volatile__( \ |
276 | "1: lw %1, %3 \n" \ | 268 | "1: lw %1, (%3) \n" \ |
277 | "2: lw %D1, %4 \n" \ | 269 | "2: lw %D1, 4(%3) \n" \ |
278 | " move %0, $0 \n" \ | 270 | " move %0, $0 \n" \ |
279 | "3: .section .fixup,\"ax\" \n" \ | 271 | "3: .section .fixup,\"ax\" \n" \ |
280 | "4: li %0, %5 \n" \ | 272 | "4: li %0, %4 \n" \ |
281 | " move %1, $0 \n" \ | 273 | " move %1, $0 \n" \ |
282 | " move %D1, $0 \n" \ | 274 | " move %D1, $0 \n" \ |
283 | " j 3b \n" \ | 275 | " j 3b \n" \ |
@@ -287,9 +279,8 @@ struct __large_struct { unsigned long buf[100]; }; | |||
287 | " " __UA_ADDR " 2b, 4b \n" \ | 279 | " " __UA_ADDR " 2b, 4b \n" \ |
288 | " .previous \n" \ | 280 | " .previous \n" \ |
289 | : "=r" (__gu_err), "=&r" (__gu_val) \ | 281 | : "=r" (__gu_err), "=&r" (__gu_val) \ |
290 | : "0" (__gu_err), "o" (__m(__gu_addr)), \ | 282 | : "0" (0), "r" (addr), "i" (-EFAULT)); \ |
291 | "o" (__m(__gu_addr + 4)), "i" (-EFAULT)); \ | 283 | } |
292 | }) | ||
293 | 284 | ||
294 | extern void __get_user_unknown(void); | 285 | extern void __get_user_unknown(void); |
295 | 286 | ||
@@ -298,25 +289,22 @@ extern void __get_user_unknown(void); | |||
298 | * for 32 bit mode and old iron. | 289 | * for 32 bit mode and old iron. |
299 | */ | 290 | */ |
300 | #ifdef __mips64 | 291 | #ifdef __mips64 |
301 | #define __PUT_USER_DW(__pu_val) __put_user_asm("sd", __pu_val) | 292 | #define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr) |
302 | #else | 293 | #else |
303 | #define __PUT_USER_DW(__pu_val) __put_user_asm_ll32(__pu_val) | 294 | #define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr) |
304 | #endif | 295 | #endif |
305 | 296 | ||
306 | #define __put_user_nocheck(x,ptr,size) \ | 297 | #define __put_user_nocheck(x,ptr,size) \ |
307 | ({ \ | 298 | ({ \ |
308 | __typeof__(*(ptr)) __pu_val; \ | 299 | __typeof__(*(ptr)) __pu_val; \ |
309 | long __pu_addr; \ | ||
310 | long __pu_err = 0; \ | 300 | long __pu_err = 0; \ |
311 | \ | 301 | \ |
312 | might_sleep(); \ | ||
313 | __pu_val = (x); \ | 302 | __pu_val = (x); \ |
314 | __pu_addr = (long) (ptr); \ | ||
315 | switch (size) { \ | 303 | switch (size) { \ |
316 | case 1: __put_user_asm("sb", __pu_val); break; \ | 304 | case 1: __put_user_asm("sb", ptr); break; \ |
317 | case 2: __put_user_asm("sh", __pu_val); break; \ | 305 | case 2: __put_user_asm("sh", ptr); break; \ |
318 | case 4: __put_user_asm("sw", __pu_val); break; \ | 306 | case 4: __put_user_asm("sw", ptr); break; \ |
319 | case 8: __PUT_USER_DW(__pu_val); break; \ | 307 | case 8: __PUT_USER_DW(ptr); break; \ |
320 | default: __put_user_unknown(); break; \ | 308 | default: __put_user_unknown(); break; \ |
321 | } \ | 309 | } \ |
322 | __pu_err; \ | 310 | __pu_err; \ |
@@ -324,30 +312,24 @@ extern void __get_user_unknown(void); | |||
324 | 312 | ||
325 | #define __put_user_check(x,ptr,size) \ | 313 | #define __put_user_check(x,ptr,size) \ |
326 | ({ \ | 314 | ({ \ |
327 | __typeof__(*(ptr)) __pu_val; \ | 315 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
328 | long __pu_addr; \ | 316 | __typeof__(*(ptr)) __pu_val = (x); \ |
329 | long __pu_err; \ | 317 | long __pu_err = -EFAULT; \ |
330 | \ | 318 | \ |
331 | might_sleep(); \ | 319 | if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ |
332 | __pu_val = (x); \ | ||
333 | __pu_addr = (long) (ptr); \ | ||
334 | __pu_err = access_ok(VERIFY_WRITE, (void *) __pu_addr, size) \ | ||
335 | ? 0 : -EFAULT; \ | ||
336 | \ | ||
337 | if (likely(!__pu_err)) { \ | ||
338 | switch (size) { \ | 320 | switch (size) { \ |
339 | case 1: __put_user_asm("sb", __pu_val); break; \ | 321 | case 1: __put_user_asm("sb", __pu_addr); break; \ |
340 | case 2: __put_user_asm("sh", __pu_val); break; \ | 322 | case 2: __put_user_asm("sh", __pu_addr); break; \ |
341 | case 4: __put_user_asm("sw", __pu_val); break; \ | 323 | case 4: __put_user_asm("sw", __pu_addr); break; \ |
342 | case 8: __PUT_USER_DW(__pu_val); break; \ | 324 | case 8: __PUT_USER_DW(__pu_addr); break; \ |
343 | default: __put_user_unknown(); break; \ | 325 | default: __put_user_unknown(); break; \ |
344 | } \ | 326 | } \ |
345 | } \ | 327 | } \ |
346 | __pu_err; \ | 328 | __pu_err; \ |
347 | }) | 329 | }) |
348 | 330 | ||
349 | #define __put_user_asm(insn, __pu_val) \ | 331 | #define __put_user_asm(insn, ptr) \ |
350 | ({ \ | 332 | { \ |
351 | __asm__ __volatile__( \ | 333 | __asm__ __volatile__( \ |
352 | "1: " insn " %z2, %3 # __put_user_asm\n" \ | 334 | "1: " insn " %z2, %3 # __put_user_asm\n" \ |
353 | "2: \n" \ | 335 | "2: \n" \ |
@@ -359,18 +341,18 @@ extern void __get_user_unknown(void); | |||
359 | " " __UA_ADDR " 1b, 3b \n" \ | 341 | " " __UA_ADDR " 1b, 3b \n" \ |
360 | " .previous \n" \ | 342 | " .previous \n" \ |
361 | : "=r" (__pu_err) \ | 343 | : "=r" (__pu_err) \ |
362 | : "0" (__pu_err), "Jr" (__pu_val), "o" (__m(__pu_addr)), \ | 344 | : "0" (0), "Jr" (__pu_val), "o" (__m(ptr)), \ |
363 | "i" (-EFAULT)); \ | 345 | "i" (-EFAULT)); \ |
364 | }) | 346 | } |
365 | 347 | ||
366 | #define __put_user_asm_ll32(__pu_val) \ | 348 | #define __put_user_asm_ll32(ptr) \ |
367 | ({ \ | 349 | { \ |
368 | __asm__ __volatile__( \ | 350 | __asm__ __volatile__( \ |
369 | "1: sw %2, %3 # __put_user_asm_ll32 \n" \ | 351 | "1: sw %2, (%3) # __put_user_asm_ll32 \n" \ |
370 | "2: sw %D2, %4 \n" \ | 352 | "2: sw %D2, 4(%3) \n" \ |
371 | "3: \n" \ | 353 | "3: \n" \ |
372 | " .section .fixup,\"ax\" \n" \ | 354 | " .section .fixup,\"ax\" \n" \ |
373 | "4: li %0, %5 \n" \ | 355 | "4: li %0, %4 \n" \ |
374 | " j 3b \n" \ | 356 | " j 3b \n" \ |
375 | " .previous \n" \ | 357 | " .previous \n" \ |
376 | " .section __ex_table,\"a\" \n" \ | 358 | " .section __ex_table,\"a\" \n" \ |
@@ -378,9 +360,9 @@ extern void __get_user_unknown(void); | |||
378 | " " __UA_ADDR " 2b, 4b \n" \ | 360 | " " __UA_ADDR " 2b, 4b \n" \ |
379 | " .previous" \ | 361 | " .previous" \ |
380 | : "=r" (__pu_err) \ | 362 | : "=r" (__pu_err) \ |
381 | : "0" (__pu_err), "r" (__pu_val), "o" (__m(__pu_addr)), \ | 363 | : "0" (0), "r" (__pu_val), "r" (ptr), \ |
382 | "o" (__m(__pu_addr + 4)), "i" (-EFAULT)); \ | 364 | "i" (-EFAULT)); \ |
383 | }) | 365 | } |
384 | 366 | ||
385 | extern void __put_user_unknown(void); | 367 | extern void __put_user_unknown(void); |
386 | 368 | ||
@@ -403,7 +385,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
403 | 385 | ||
404 | #define __invoke_copy_to_user(to,from,n) \ | 386 | #define __invoke_copy_to_user(to,from,n) \ |
405 | ({ \ | 387 | ({ \ |
406 | register void *__cu_to_r __asm__ ("$4"); \ | 388 | register void __user *__cu_to_r __asm__ ("$4"); \ |
407 | register const void *__cu_from_r __asm__ ("$5"); \ | 389 | register const void *__cu_from_r __asm__ ("$5"); \ |
408 | register long __cu_len_r __asm__ ("$6"); \ | 390 | register long __cu_len_r __asm__ ("$6"); \ |
409 | \ | 391 | \ |
@@ -435,7 +417,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
435 | */ | 417 | */ |
436 | #define __copy_to_user(to,from,n) \ | 418 | #define __copy_to_user(to,from,n) \ |
437 | ({ \ | 419 | ({ \ |
438 | void *__cu_to; \ | 420 | void __user *__cu_to; \ |
439 | const void *__cu_from; \ | 421 | const void *__cu_from; \ |
440 | long __cu_len; \ | 422 | long __cu_len; \ |
441 | \ | 423 | \ |
@@ -465,7 +447,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
465 | */ | 447 | */ |
466 | #define copy_to_user(to,from,n) \ | 448 | #define copy_to_user(to,from,n) \ |
467 | ({ \ | 449 | ({ \ |
468 | void *__cu_to; \ | 450 | void __user *__cu_to; \ |
469 | const void *__cu_from; \ | 451 | const void *__cu_from; \ |
470 | long __cu_len; \ | 452 | long __cu_len; \ |
471 | \ | 453 | \ |
@@ -482,7 +464,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
482 | #define __invoke_copy_from_user(to,from,n) \ | 464 | #define __invoke_copy_from_user(to,from,n) \ |
483 | ({ \ | 465 | ({ \ |
484 | register void *__cu_to_r __asm__ ("$4"); \ | 466 | register void *__cu_to_r __asm__ ("$4"); \ |
485 | register const void *__cu_from_r __asm__ ("$5"); \ | 467 | register const void __user *__cu_from_r __asm__ ("$5"); \ |
486 | register long __cu_len_r __asm__ ("$6"); \ | 468 | register long __cu_len_r __asm__ ("$6"); \ |
487 | \ | 469 | \ |
488 | __cu_to_r = (to); \ | 470 | __cu_to_r = (to); \ |
@@ -521,7 +503,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
521 | #define __copy_from_user(to,from,n) \ | 503 | #define __copy_from_user(to,from,n) \ |
522 | ({ \ | 504 | ({ \ |
523 | void *__cu_to; \ | 505 | void *__cu_to; \ |
524 | const void *__cu_from; \ | 506 | const void __user *__cu_from; \ |
525 | long __cu_len; \ | 507 | long __cu_len; \ |
526 | \ | 508 | \ |
527 | might_sleep(); \ | 509 | might_sleep(); \ |
@@ -552,7 +534,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
552 | #define copy_from_user(to,from,n) \ | 534 | #define copy_from_user(to,from,n) \ |
553 | ({ \ | 535 | ({ \ |
554 | void *__cu_to; \ | 536 | void *__cu_to; \ |
555 | const void *__cu_from; \ | 537 | const void __user *__cu_from; \ |
556 | long __cu_len; \ | 538 | long __cu_len; \ |
557 | \ | 539 | \ |
558 | might_sleep(); \ | 540 | might_sleep(); \ |
@@ -569,8 +551,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
569 | 551 | ||
570 | #define copy_in_user(to,from,n) \ | 552 | #define copy_in_user(to,from,n) \ |
571 | ({ \ | 553 | ({ \ |
572 | void *__cu_to; \ | 554 | void __user *__cu_to; \ |
573 | const void *__cu_from; \ | 555 | const void __user *__cu_from; \ |
574 | long __cu_len; \ | 556 | long __cu_len; \ |
575 | \ | 557 | \ |
576 | might_sleep(); \ | 558 | might_sleep(); \ |
@@ -596,7 +578,7 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n); | |||
596 | * On success, this will be zero. | 578 | * On success, this will be zero. |
597 | */ | 579 | */ |
598 | static inline __kernel_size_t | 580 | static inline __kernel_size_t |
599 | __clear_user(void *addr, __kernel_size_t size) | 581 | __clear_user(void __user *addr, __kernel_size_t size) |
600 | { | 582 | { |
601 | __kernel_size_t res; | 583 | __kernel_size_t res; |
602 | 584 | ||
@@ -616,7 +598,7 @@ __clear_user(void *addr, __kernel_size_t size) | |||
616 | 598 | ||
617 | #define clear_user(addr,n) \ | 599 | #define clear_user(addr,n) \ |
618 | ({ \ | 600 | ({ \ |
619 | void * __cl_addr = (addr); \ | 601 | void __user * __cl_addr = (addr); \ |
620 | unsigned long __cl_size = (n); \ | 602 | unsigned long __cl_size = (n); \ |
621 | if (__cl_size && access_ok(VERIFY_WRITE, \ | 603 | if (__cl_size && access_ok(VERIFY_WRITE, \ |
622 | ((unsigned long)(__cl_addr)), __cl_size)) \ | 604 | ((unsigned long)(__cl_addr)), __cl_size)) \ |
@@ -645,7 +627,7 @@ __clear_user(void *addr, __kernel_size_t size) | |||
645 | * and returns @count. | 627 | * and returns @count. |
646 | */ | 628 | */ |
647 | static inline long | 629 | static inline long |
648 | __strncpy_from_user(char *__to, const char *__from, long __len) | 630 | __strncpy_from_user(char *__to, const char __user *__from, long __len) |
649 | { | 631 | { |
650 | long res; | 632 | long res; |
651 | 633 | ||
@@ -682,7 +664,7 @@ __strncpy_from_user(char *__to, const char *__from, long __len) | |||
682 | * and returns @count. | 664 | * and returns @count. |
683 | */ | 665 | */ |
684 | static inline long | 666 | static inline long |
685 | strncpy_from_user(char *__to, const char *__from, long __len) | 667 | strncpy_from_user(char *__to, const char __user *__from, long __len) |
686 | { | 668 | { |
687 | long res; | 669 | long res; |
688 | 670 | ||
@@ -701,7 +683,7 @@ strncpy_from_user(char *__to, const char *__from, long __len) | |||
701 | } | 683 | } |
702 | 684 | ||
703 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ | 685 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ |
704 | static inline long __strlen_user(const char *s) | 686 | static inline long __strlen_user(const char __user *s) |
705 | { | 687 | { |
706 | long res; | 688 | long res; |
707 | 689 | ||
@@ -731,7 +713,7 @@ static inline long __strlen_user(const char *s) | |||
731 | * If there is a limit on the length of a valid string, you may wish to | 713 | * If there is a limit on the length of a valid string, you may wish to |
732 | * consider using strnlen_user() instead. | 714 | * consider using strnlen_user() instead. |
733 | */ | 715 | */ |
734 | static inline long strlen_user(const char *s) | 716 | static inline long strlen_user(const char __user *s) |
735 | { | 717 | { |
736 | long res; | 718 | long res; |
737 | 719 | ||
@@ -748,7 +730,7 @@ static inline long strlen_user(const char *s) | |||
748 | } | 730 | } |
749 | 731 | ||
750 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ | 732 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ |
751 | static inline long __strnlen_user(const char *s, long n) | 733 | static inline long __strnlen_user(const char __user *s, long n) |
752 | { | 734 | { |
753 | long res; | 735 | long res; |
754 | 736 | ||
@@ -779,7 +761,7 @@ static inline long __strnlen_user(const char *s, long n) | |||
779 | * If there is a limit on the length of a valid string, you may wish to | 761 | * If there is a limit on the length of a valid string, you may wish to |
780 | * consider using strnlen_user() instead. | 762 | * consider using strnlen_user() instead. |
781 | */ | 763 | */ |
782 | static inline long strnlen_user(const char *s, long n) | 764 | static inline long strnlen_user(const char __user *s, long n) |
783 | { | 765 | { |
784 | long res; | 766 | long res; |
785 | 767 | ||
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index ad4d48056307..89ea8b60e945 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h | |||
@@ -303,16 +303,21 @@ | |||
303 | #define __NR_add_key (__NR_Linux + 280) | 303 | #define __NR_add_key (__NR_Linux + 280) |
304 | #define __NR_request_key (__NR_Linux + 281) | 304 | #define __NR_request_key (__NR_Linux + 281) |
305 | #define __NR_keyctl (__NR_Linux + 282) | 305 | #define __NR_keyctl (__NR_Linux + 282) |
306 | #define __NR_set_thread_area (__NR_Linux + 283) | ||
307 | #define __NR_inotify_init (__NR_Linux + 284) | ||
308 | #define __NR_inotify_add_watch (__NR_Linux + 285) | ||
309 | #define __NR_inotify_rm_watch (__NR_Linux + 286) | ||
310 | |||
306 | 311 | ||
307 | /* | 312 | /* |
308 | * Offset of the last Linux o32 flavoured syscall | 313 | * Offset of the last Linux o32 flavoured syscall |
309 | */ | 314 | */ |
310 | #define __NR_Linux_syscalls 282 | 315 | #define __NR_Linux_syscalls 286 |
311 | 316 | ||
312 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 317 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
313 | 318 | ||
314 | #define __NR_O32_Linux 4000 | 319 | #define __NR_O32_Linux 4000 |
315 | #define __NR_O32_Linux_syscalls 282 | 320 | #define __NR_O32_Linux_syscalls 283 |
316 | 321 | ||
317 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 322 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
318 | 323 | ||
@@ -562,16 +567,20 @@ | |||
562 | #define __NR_add_key (__NR_Linux + 239) | 567 | #define __NR_add_key (__NR_Linux + 239) |
563 | #define __NR_request_key (__NR_Linux + 240) | 568 | #define __NR_request_key (__NR_Linux + 240) |
564 | #define __NR_keyctl (__NR_Linux + 241) | 569 | #define __NR_keyctl (__NR_Linux + 241) |
570 | #define __NR_set_thread_area (__NR_Linux + 242) | ||
571 | #define __NR_inotify_init (__NR_Linux + 243) | ||
572 | #define __NR_inotify_add_watch (__NR_Linux + 244) | ||
573 | #define __NR_inotify_rm_watch (__NR_Linux + 245) | ||
565 | 574 | ||
566 | /* | 575 | /* |
567 | * Offset of the last Linux 64-bit flavoured syscall | 576 | * Offset of the last Linux 64-bit flavoured syscall |
568 | */ | 577 | */ |
569 | #define __NR_Linux_syscalls 241 | 578 | #define __NR_Linux_syscalls 245 |
570 | 579 | ||
571 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 580 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
572 | 581 | ||
573 | #define __NR_64_Linux 5000 | 582 | #define __NR_64_Linux 5000 |
574 | #define __NR_64_Linux_syscalls 241 | 583 | #define __NR_64_Linux_syscalls 242 |
575 | 584 | ||
576 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 585 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
577 | 586 | ||
@@ -825,16 +834,20 @@ | |||
825 | #define __NR_add_key (__NR_Linux + 243) | 834 | #define __NR_add_key (__NR_Linux + 243) |
826 | #define __NR_request_key (__NR_Linux + 244) | 835 | #define __NR_request_key (__NR_Linux + 244) |
827 | #define __NR_keyctl (__NR_Linux + 245) | 836 | #define __NR_keyctl (__NR_Linux + 245) |
837 | #define __NR_set_thread_area (__NR_Linux + 246) | ||
838 | #define __NR_inotify_init (__NR_Linux + 247) | ||
839 | #define __NR_inotify_add_watch (__NR_Linux + 248) | ||
840 | #define __NR_inotify_rm_watch (__NR_Linux + 249) | ||
828 | 841 | ||
829 | /* | 842 | /* |
830 | * Offset of the last N32 flavoured syscall | 843 | * Offset of the last N32 flavoured syscall |
831 | */ | 844 | */ |
832 | #define __NR_Linux_syscalls 245 | 845 | #define __NR_Linux_syscalls 249 |
833 | 846 | ||
834 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 847 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
835 | 848 | ||
836 | #define __NR_N32_Linux 6000 | 849 | #define __NR_N32_Linux 6000 |
837 | #define __NR_N32_Linux_syscalls 245 | 850 | #define __NR_N32_Linux_syscalls 246 |
838 | 851 | ||
839 | #ifndef __ASSEMBLY__ | 852 | #ifndef __ASSEMBLY__ |
840 | 853 | ||
@@ -1164,7 +1177,6 @@ asmlinkage long sys_mmap2( | |||
1164 | unsigned long fd, unsigned long pgoff); | 1177 | unsigned long fd, unsigned long pgoff); |
1165 | asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs); | 1178 | asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs); |
1166 | asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs); | 1179 | asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs); |
1167 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
1168 | struct sigaction; | 1180 | struct sigaction; |
1169 | asmlinkage long sys_rt_sigaction(int sig, | 1181 | asmlinkage long sys_rt_sigaction(int sig, |
1170 | const struct sigaction __user *act, | 1182 | const struct sigaction __user *act, |
diff --git a/include/asm-mips/vga.h b/include/asm-mips/vga.h index 6b35cf054c79..ca5cec97e167 100644 --- a/include/asm-mips/vga.h +++ b/include/asm-mips/vga.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef _ASM_VGA_H | 6 | #ifndef _ASM_VGA_H |
7 | #define _ASM_VGA_H | 7 | #define _ASM_VGA_H |
8 | 8 | ||
9 | #include <asm/byteorder.h> | ||
10 | |||
9 | /* | 11 | /* |
10 | * On the PC, we can just recalculate addresses and then | 12 | * On the PC, we can just recalculate addresses and then |
11 | * access the videoram directly without any black magic. | 13 | * access the videoram directly without any black magic. |
@@ -16,4 +18,27 @@ | |||
16 | #define vga_readb(x) (*(x)) | 18 | #define vga_readb(x) (*(x)) |
17 | #define vga_writeb(x,y) (*(y) = (x)) | 19 | #define vga_writeb(x,y) (*(y) = (x)) |
18 | 20 | ||
21 | #define VT_BUF_HAVE_RW | ||
22 | /* | ||
23 | * These are only needed for supporting VGA or MDA text mode, which use little | ||
24 | * endian byte ordering. | ||
25 | * In other cases, we can optimize by using native byte ordering and | ||
26 | * <linux/vt_buffer.h> has already done the right job for us. | ||
27 | */ | ||
28 | |||
29 | static inline void scr_writew(u16 val, volatile u16 *addr) | ||
30 | { | ||
31 | *addr = cpu_to_le16(val); | ||
32 | } | ||
33 | |||
34 | static inline u16 scr_readw(volatile const u16 *addr) | ||
35 | { | ||
36 | return le16_to_cpu(*addr); | ||
37 | } | ||
38 | |||
39 | #define scr_memcpyw(d, s, c) memcpy(d, s, c) | ||
40 | #define scr_memmovew(d, s, c) memmove(d, s, c) | ||
41 | #define VT_BUF_HAVE_MEMCPYW | ||
42 | #define VT_BUF_HAVE_MEMMOVEW | ||
43 | |||
19 | #endif /* _ASM_VGA_H */ | 44 | #endif /* _ASM_VGA_H */ |
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h index 04ee53b34c2e..ad374bd3f130 100644 --- a/include/asm-mips/war.h +++ b/include/asm-mips/war.h | |||
@@ -177,6 +177,17 @@ | |||
177 | #endif | 177 | #endif |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * The RM9000 has a bug (though PMC-Sierra opposes it being called that) | ||
181 | * where invalid instructions in the same I-cache line worth of instructions | ||
182 | * being fetched may case spurious exceptions. | ||
183 | */ | ||
184 | #if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \ | ||
185 | defined(CONFIG_PMC_YOSEMITE) | ||
186 | #define ICACHE_REFILLS_WORKAROUND_WAR 1 | ||
187 | #endif | ||
188 | |||
189 | |||
190 | /* | ||
180 | * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that | 191 | * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that |
181 | * may cause ll / sc and lld / scd sequences to execute non-atomically. | 192 | * may cause ll / sc and lld / scd sequences to execute non-atomically. |
182 | */ | 193 | */ |
@@ -187,6 +198,9 @@ | |||
187 | /* | 198 | /* |
188 | * Workarounds default to off | 199 | * Workarounds default to off |
189 | */ | 200 | */ |
201 | #ifndef ICACHE_REFILLS_WORKAROUND_WAR | ||
202 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
203 | #endif | ||
190 | #ifndef R4600_V1_INDEX_ICACHEOP_WAR | 204 | #ifndef R4600_V1_INDEX_ICACHEOP_WAR |
191 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | 205 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 |
192 | #endif | 206 | #endif |
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 30b023411fef..3ce3440d1b0c 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h | |||
@@ -21,7 +21,9 @@ | |||
21 | #ifndef _PARISC_ASSEMBLY_H | 21 | #ifndef _PARISC_ASSEMBLY_H |
22 | #define _PARISC_ASSEMBLY_H | 22 | #define _PARISC_ASSEMBLY_H |
23 | 23 | ||
24 | #ifdef __LP64__ | 24 | #define CALLEE_FLOAT_FRAME_SIZE 80 |
25 | |||
26 | #ifdef CONFIG_64BIT | ||
25 | #define LDREG ldd | 27 | #define LDREG ldd |
26 | #define STREG std | 28 | #define STREG std |
27 | #define LDREGX ldd,s | 29 | #define LDREGX ldd,s |
@@ -30,8 +32,8 @@ | |||
30 | #define SHRREG shrd | 32 | #define SHRREG shrd |
31 | #define RP_OFFSET 16 | 33 | #define RP_OFFSET 16 |
32 | #define FRAME_SIZE 128 | 34 | #define FRAME_SIZE 128 |
33 | #define CALLEE_SAVE_FRAME_SIZE 144 | 35 | #define CALLEE_REG_FRAME_SIZE 144 |
34 | #else | 36 | #else /* CONFIG_64BIT */ |
35 | #define LDREG ldw | 37 | #define LDREG ldw |
36 | #define STREG stw | 38 | #define STREG stw |
37 | #define LDREGX ldwx,s | 39 | #define LDREGX ldwx,s |
@@ -40,9 +42,11 @@ | |||
40 | #define SHRREG shr | 42 | #define SHRREG shr |
41 | #define RP_OFFSET 20 | 43 | #define RP_OFFSET 20 |
42 | #define FRAME_SIZE 64 | 44 | #define FRAME_SIZE 64 |
43 | #define CALLEE_SAVE_FRAME_SIZE 128 | 45 | #define CALLEE_REG_FRAME_SIZE 128 |
44 | #endif | 46 | #endif |
45 | 47 | ||
48 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) | ||
49 | |||
46 | #ifdef CONFIG_PA20 | 50 | #ifdef CONFIG_PA20 |
47 | #define BL b,l | 51 | #define BL b,l |
48 | # ifdef CONFIG_64BIT | 52 | # ifdef CONFIG_64BIT |
@@ -300,9 +304,35 @@ | |||
300 | fldd,mb -8(\regs), %fr0 | 304 | fldd,mb -8(\regs), %fr0 |
301 | .endm | 305 | .endm |
302 | 306 | ||
307 | .macro callee_save_float | ||
308 | fstd,ma %fr12, 8(%r30) | ||
309 | fstd,ma %fr13, 8(%r30) | ||
310 | fstd,ma %fr14, 8(%r30) | ||
311 | fstd,ma %fr15, 8(%r30) | ||
312 | fstd,ma %fr16, 8(%r30) | ||
313 | fstd,ma %fr17, 8(%r30) | ||
314 | fstd,ma %fr18, 8(%r30) | ||
315 | fstd,ma %fr19, 8(%r30) | ||
316 | fstd,ma %fr20, 8(%r30) | ||
317 | fstd,ma %fr21, 8(%r30) | ||
318 | .endm | ||
319 | |||
320 | .macro callee_rest_float | ||
321 | fldd,mb -8(%r30), %fr21 | ||
322 | fldd,mb -8(%r30), %fr20 | ||
323 | fldd,mb -8(%r30), %fr19 | ||
324 | fldd,mb -8(%r30), %fr18 | ||
325 | fldd,mb -8(%r30), %fr17 | ||
326 | fldd,mb -8(%r30), %fr16 | ||
327 | fldd,mb -8(%r30), %fr15 | ||
328 | fldd,mb -8(%r30), %fr14 | ||
329 | fldd,mb -8(%r30), %fr13 | ||
330 | fldd,mb -8(%r30), %fr12 | ||
331 | .endm | ||
332 | |||
303 | #ifdef __LP64__ | 333 | #ifdef __LP64__ |
304 | .macro callee_save | 334 | .macro callee_save |
305 | std,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) | 335 | std,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
306 | mfctl %cr27, %r3 | 336 | mfctl %cr27, %r3 |
307 | std %r4, -136(%r30) | 337 | std %r4, -136(%r30) |
308 | std %r5, -128(%r30) | 338 | std %r5, -128(%r30) |
@@ -340,13 +370,13 @@ | |||
340 | ldd -128(%r30), %r5 | 370 | ldd -128(%r30), %r5 |
341 | ldd -136(%r30), %r4 | 371 | ldd -136(%r30), %r4 |
342 | mtctl %r3, %cr27 | 372 | mtctl %r3, %cr27 |
343 | ldd,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 | 373 | ldd,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
344 | .endm | 374 | .endm |
345 | 375 | ||
346 | #else /* ! __LP64__ */ | 376 | #else /* ! __LP64__ */ |
347 | 377 | ||
348 | .macro callee_save | 378 | .macro callee_save |
349 | stw,ma %r3, CALLEE_SAVE_FRAME_SIZE(%r30) | 379 | stw,ma %r3, CALLEE_REG_FRAME_SIZE(%r30) |
350 | mfctl %cr27, %r3 | 380 | mfctl %cr27, %r3 |
351 | stw %r4, -124(%r30) | 381 | stw %r4, -124(%r30) |
352 | stw %r5, -120(%r30) | 382 | stw %r5, -120(%r30) |
@@ -384,7 +414,7 @@ | |||
384 | ldw -120(%r30), %r5 | 414 | ldw -120(%r30), %r5 |
385 | ldw -124(%r30), %r4 | 415 | ldw -124(%r30), %r4 |
386 | mtctl %r3, %cr27 | 416 | mtctl %r3, %cr27 |
387 | ldw,mb -CALLEE_SAVE_FRAME_SIZE(%r30), %r3 | 417 | ldw,mb -CALLEE_REG_FRAME_SIZE(%r30), %r3 |
388 | .endm | 418 | .endm |
389 | #endif /* ! __LP64__ */ | 419 | #endif /* ! __LP64__ */ |
390 | 420 | ||
@@ -450,5 +480,30 @@ | |||
450 | REST_CR (%cr22, PT_PSW (\regs)) | 480 | REST_CR (%cr22, PT_PSW (\regs)) |
451 | .endm | 481 | .endm |
452 | 482 | ||
483 | |||
484 | /* First step to create a "relied upon translation" | ||
485 | * See PA 2.0 Arch. page F-4 and F-5. | ||
486 | * | ||
487 | * The ssm was originally necessary due to a "PCxT bug". | ||
488 | * But someone decided it needed to be added to the architecture | ||
489 | * and this "feature" went into rev3 of PA-RISC 1.1 Arch Manual. | ||
490 | * It's been carried forward into PA 2.0 Arch as well. :^( | ||
491 | * | ||
492 | * "ssm 0,%r0" is a NOP with side effects (prefetch barrier). | ||
493 | * rsm/ssm prevents the ifetch unit from speculatively fetching | ||
494 | * instructions past this line in the code stream. | ||
495 | * PA 2.0 processor will single step all insn in the same QUAD (4 insn). | ||
496 | */ | ||
497 | .macro pcxt_ssm_bug | ||
498 | rsm PSW_SM_I,%r0 | ||
499 | nop /* 1 */ | ||
500 | nop /* 2 */ | ||
501 | nop /* 3 */ | ||
502 | nop /* 4 */ | ||
503 | nop /* 5 */ | ||
504 | nop /* 6 */ | ||
505 | nop /* 7 */ | ||
506 | .endm | ||
507 | |||
453 | #endif /* __ASSEMBLY__ */ | 508 | #endif /* __ASSEMBLY__ */ |
454 | #endif | 509 | #endif |
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h index af7db694b22d..55b98c67fd82 100644 --- a/include/asm-parisc/bitops.h +++ b/include/asm-parisc/bitops.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _PARISC_BITOPS_H | 2 | #define _PARISC_BITOPS_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <asm/spinlock.h> | 5 | #include <asm/types.h> /* for BITS_PER_LONG/SHIFT_PER_LONG */ |
6 | #include <asm/byteorder.h> | 6 | #include <asm/byteorder.h> |
7 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
8 | 8 | ||
@@ -12,193 +12,157 @@ | |||
12 | * to include/asm-i386/bitops.h or kerneldoc | 12 | * to include/asm-i386/bitops.h or kerneldoc |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifdef __LP64__ | 15 | #define CHOP_SHIFTCOUNT(x) (((unsigned long) (x)) & (BITS_PER_LONG - 1)) |
16 | # define SHIFT_PER_LONG 6 | ||
17 | #ifndef BITS_PER_LONG | ||
18 | # define BITS_PER_LONG 64 | ||
19 | #endif | ||
20 | #else | ||
21 | # define SHIFT_PER_LONG 5 | ||
22 | #ifndef BITS_PER_LONG | ||
23 | # define BITS_PER_LONG 32 | ||
24 | #endif | ||
25 | #endif | ||
26 | |||
27 | #define CHOP_SHIFTCOUNT(x) ((x) & (BITS_PER_LONG - 1)) | ||
28 | 16 | ||
29 | 17 | ||
30 | #define smp_mb__before_clear_bit() smp_mb() | 18 | #define smp_mb__before_clear_bit() smp_mb() |
31 | #define smp_mb__after_clear_bit() smp_mb() | 19 | #define smp_mb__after_clear_bit() smp_mb() |
32 | 20 | ||
33 | static __inline__ void set_bit(int nr, volatile unsigned long * address) | 21 | /* See http://marc.theaimsgroup.com/?t=108826637900003 for discussion |
22 | * on use of volatile and __*_bit() (set/clear/change): | ||
23 | * *_bit() want use of volatile. | ||
24 | * __*_bit() are "relaxed" and don't use spinlock or volatile. | ||
25 | */ | ||
26 | |||
27 | static __inline__ void set_bit(int nr, volatile unsigned long * addr) | ||
34 | { | 28 | { |
35 | unsigned long mask; | 29 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
36 | unsigned long *addr = (unsigned long *) address; | ||
37 | unsigned long flags; | 30 | unsigned long flags; |
38 | 31 | ||
39 | addr += (nr >> SHIFT_PER_LONG); | 32 | addr += (nr >> SHIFT_PER_LONG); |
40 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
41 | _atomic_spin_lock_irqsave(addr, flags); | 33 | _atomic_spin_lock_irqsave(addr, flags); |
42 | *addr |= mask; | 34 | *addr |= mask; |
43 | _atomic_spin_unlock_irqrestore(addr, flags); | 35 | _atomic_spin_unlock_irqrestore(addr, flags); |
44 | } | 36 | } |
45 | 37 | ||
46 | static __inline__ void __set_bit(int nr, volatile unsigned long * address) | 38 | static __inline__ void __set_bit(unsigned long nr, volatile unsigned long * addr) |
47 | { | 39 | { |
48 | unsigned long mask; | 40 | unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG); |
49 | unsigned long *addr = (unsigned long *) address; | ||
50 | 41 | ||
51 | addr += (nr >> SHIFT_PER_LONG); | 42 | *m |= 1UL << CHOP_SHIFTCOUNT(nr); |
52 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
53 | *addr |= mask; | ||
54 | } | 43 | } |
55 | 44 | ||
56 | static __inline__ void clear_bit(int nr, volatile unsigned long * address) | 45 | static __inline__ void clear_bit(int nr, volatile unsigned long * addr) |
57 | { | 46 | { |
58 | unsigned long mask; | 47 | unsigned long mask = ~(1UL << CHOP_SHIFTCOUNT(nr)); |
59 | unsigned long *addr = (unsigned long *) address; | ||
60 | unsigned long flags; | 48 | unsigned long flags; |
61 | 49 | ||
62 | addr += (nr >> SHIFT_PER_LONG); | 50 | addr += (nr >> SHIFT_PER_LONG); |
63 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
64 | _atomic_spin_lock_irqsave(addr, flags); | 51 | _atomic_spin_lock_irqsave(addr, flags); |
65 | *addr &= ~mask; | 52 | *addr &= mask; |
66 | _atomic_spin_unlock_irqrestore(addr, flags); | 53 | _atomic_spin_unlock_irqrestore(addr, flags); |
67 | } | 54 | } |
68 | 55 | ||
69 | static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address) | 56 | static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * addr) |
70 | { | 57 | { |
71 | unsigned long mask; | 58 | unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG); |
72 | unsigned long *addr = (unsigned long *) address; | ||
73 | 59 | ||
74 | addr += (nr >> SHIFT_PER_LONG); | 60 | *m &= ~(1UL << CHOP_SHIFTCOUNT(nr)); |
75 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
76 | *addr &= ~mask; | ||
77 | } | 61 | } |
78 | 62 | ||
79 | static __inline__ void change_bit(int nr, volatile unsigned long * address) | 63 | static __inline__ void change_bit(int nr, volatile unsigned long * addr) |
80 | { | 64 | { |
81 | unsigned long mask; | 65 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
82 | unsigned long *addr = (unsigned long *) address; | ||
83 | unsigned long flags; | 66 | unsigned long flags; |
84 | 67 | ||
85 | addr += (nr >> SHIFT_PER_LONG); | 68 | addr += (nr >> SHIFT_PER_LONG); |
86 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
87 | _atomic_spin_lock_irqsave(addr, flags); | 69 | _atomic_spin_lock_irqsave(addr, flags); |
88 | *addr ^= mask; | 70 | *addr ^= mask; |
89 | _atomic_spin_unlock_irqrestore(addr, flags); | 71 | _atomic_spin_unlock_irqrestore(addr, flags); |
90 | } | 72 | } |
91 | 73 | ||
92 | static __inline__ void __change_bit(int nr, volatile unsigned long * address) | 74 | static __inline__ void __change_bit(unsigned long nr, volatile unsigned long * addr) |
93 | { | 75 | { |
94 | unsigned long mask; | 76 | unsigned long *m = (unsigned long *) addr + (nr >> SHIFT_PER_LONG); |
95 | unsigned long *addr = (unsigned long *) address; | ||
96 | 77 | ||
97 | addr += (nr >> SHIFT_PER_LONG); | 78 | *m ^= 1UL << CHOP_SHIFTCOUNT(nr); |
98 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
99 | *addr ^= mask; | ||
100 | } | 79 | } |
101 | 80 | ||
102 | static __inline__ int test_and_set_bit(int nr, volatile unsigned long * address) | 81 | static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) |
103 | { | 82 | { |
104 | unsigned long mask; | 83 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
105 | unsigned long *addr = (unsigned long *) address; | 84 | unsigned long oldbit; |
106 | int oldbit; | ||
107 | unsigned long flags; | 85 | unsigned long flags; |
108 | 86 | ||
109 | addr += (nr >> SHIFT_PER_LONG); | 87 | addr += (nr >> SHIFT_PER_LONG); |
110 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
111 | _atomic_spin_lock_irqsave(addr, flags); | 88 | _atomic_spin_lock_irqsave(addr, flags); |
112 | oldbit = (*addr & mask) ? 1 : 0; | 89 | oldbit = *addr; |
113 | *addr |= mask; | 90 | *addr = oldbit | mask; |
114 | _atomic_spin_unlock_irqrestore(addr, flags); | 91 | _atomic_spin_unlock_irqrestore(addr, flags); |
115 | 92 | ||
116 | return oldbit; | 93 | return (oldbit & mask) ? 1 : 0; |
117 | } | 94 | } |
118 | 95 | ||
119 | static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address) | 96 | static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address) |
120 | { | 97 | { |
121 | unsigned long mask; | 98 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
122 | unsigned long *addr = (unsigned long *) address; | 99 | unsigned long oldbit; |
123 | int oldbit; | 100 | unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG); |
124 | 101 | ||
125 | addr += (nr >> SHIFT_PER_LONG); | 102 | oldbit = *addr; |
126 | mask = 1L << CHOP_SHIFTCOUNT(nr); | 103 | *addr = oldbit | mask; |
127 | oldbit = (*addr & mask) ? 1 : 0; | ||
128 | *addr |= mask; | ||
129 | 104 | ||
130 | return oldbit; | 105 | return (oldbit & mask) ? 1 : 0; |
131 | } | 106 | } |
132 | 107 | ||
133 | static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * address) | 108 | static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) |
134 | { | 109 | { |
135 | unsigned long mask; | 110 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
136 | unsigned long *addr = (unsigned long *) address; | 111 | unsigned long oldbit; |
137 | int oldbit; | ||
138 | unsigned long flags; | 112 | unsigned long flags; |
139 | 113 | ||
140 | addr += (nr >> SHIFT_PER_LONG); | 114 | addr += (nr >> SHIFT_PER_LONG); |
141 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
142 | _atomic_spin_lock_irqsave(addr, flags); | 115 | _atomic_spin_lock_irqsave(addr, flags); |
143 | oldbit = (*addr & mask) ? 1 : 0; | 116 | oldbit = *addr; |
144 | *addr &= ~mask; | 117 | *addr = oldbit & ~mask; |
145 | _atomic_spin_unlock_irqrestore(addr, flags); | 118 | _atomic_spin_unlock_irqrestore(addr, flags); |
146 | 119 | ||
147 | return oldbit; | 120 | return (oldbit & mask) ? 1 : 0; |
148 | } | 121 | } |
149 | 122 | ||
150 | static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address) | 123 | static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address) |
151 | { | 124 | { |
152 | unsigned long mask; | 125 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
153 | unsigned long *addr = (unsigned long *) address; | 126 | unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG); |
154 | int oldbit; | 127 | unsigned long oldbit; |
155 | 128 | ||
156 | addr += (nr >> SHIFT_PER_LONG); | 129 | oldbit = *addr; |
157 | mask = 1L << CHOP_SHIFTCOUNT(nr); | 130 | *addr = oldbit & ~mask; |
158 | oldbit = (*addr & mask) ? 1 : 0; | ||
159 | *addr &= ~mask; | ||
160 | 131 | ||
161 | return oldbit; | 132 | return (oldbit & mask) ? 1 : 0; |
162 | } | 133 | } |
163 | 134 | ||
164 | static __inline__ int test_and_change_bit(int nr, volatile unsigned long * address) | 135 | static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) |
165 | { | 136 | { |
166 | unsigned long mask; | 137 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
167 | unsigned long *addr = (unsigned long *) address; | 138 | unsigned long oldbit; |
168 | int oldbit; | ||
169 | unsigned long flags; | 139 | unsigned long flags; |
170 | 140 | ||
171 | addr += (nr >> SHIFT_PER_LONG); | 141 | addr += (nr >> SHIFT_PER_LONG); |
172 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
173 | _atomic_spin_lock_irqsave(addr, flags); | 142 | _atomic_spin_lock_irqsave(addr, flags); |
174 | oldbit = (*addr & mask) ? 1 : 0; | 143 | oldbit = *addr; |
175 | *addr ^= mask; | 144 | *addr = oldbit ^ mask; |
176 | _atomic_spin_unlock_irqrestore(addr, flags); | 145 | _atomic_spin_unlock_irqrestore(addr, flags); |
177 | 146 | ||
178 | return oldbit; | 147 | return (oldbit & mask) ? 1 : 0; |
179 | } | 148 | } |
180 | 149 | ||
181 | static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address) | 150 | static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address) |
182 | { | 151 | { |
183 | unsigned long mask; | 152 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
184 | unsigned long *addr = (unsigned long *) address; | 153 | unsigned long *addr = (unsigned long *)address + (nr >> SHIFT_PER_LONG); |
185 | int oldbit; | 154 | unsigned long oldbit; |
186 | 155 | ||
187 | addr += (nr >> SHIFT_PER_LONG); | 156 | oldbit = *addr; |
188 | mask = 1L << CHOP_SHIFTCOUNT(nr); | 157 | *addr = oldbit ^ mask; |
189 | oldbit = (*addr & mask) ? 1 : 0; | ||
190 | *addr ^= mask; | ||
191 | 158 | ||
192 | return oldbit; | 159 | return (oldbit & mask) ? 1 : 0; |
193 | } | 160 | } |
194 | 161 | ||
195 | static __inline__ int test_bit(int nr, const volatile unsigned long *address) | 162 | static __inline__ int test_bit(int nr, const volatile unsigned long *address) |
196 | { | 163 | { |
197 | unsigned long mask; | 164 | unsigned long mask = 1UL << CHOP_SHIFTCOUNT(nr); |
198 | const unsigned long *addr = (const unsigned long *)address; | 165 | const unsigned long *addr = (const unsigned long *)address + (nr >> SHIFT_PER_LONG); |
199 | |||
200 | addr += (nr >> SHIFT_PER_LONG); | ||
201 | mask = 1L << CHOP_SHIFTCOUNT(nr); | ||
202 | 166 | ||
203 | return !!(*addr & mask); | 167 | return !!(*addr & mask); |
204 | } | 168 | } |
@@ -229,7 +193,7 @@ static __inline__ unsigned long __ffs(unsigned long x) | |||
229 | unsigned long ret; | 193 | unsigned long ret; |
230 | 194 | ||
231 | __asm__( | 195 | __asm__( |
232 | #if BITS_PER_LONG > 32 | 196 | #ifdef __LP64__ |
233 | " ldi 63,%1\n" | 197 | " ldi 63,%1\n" |
234 | " extrd,u,*<> %0,63,32,%%r0\n" | 198 | " extrd,u,*<> %0,63,32,%%r0\n" |
235 | " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ | 199 | " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ |
@@ -304,14 +268,7 @@ static __inline__ int fls(int x) | |||
304 | * hweightN: returns the hamming weight (i.e. the number | 268 | * hweightN: returns the hamming weight (i.e. the number |
305 | * of bits set) of a N-bit word | 269 | * of bits set) of a N-bit word |
306 | */ | 270 | */ |
307 | #define hweight64(x) \ | 271 | #define hweight64(x) generic_hweight64(x) |
308 | ({ \ | ||
309 | unsigned long __x = (x); \ | ||
310 | unsigned int __w; \ | ||
311 | __w = generic_hweight32((unsigned int) __x); \ | ||
312 | __w += generic_hweight32((unsigned int) (__x>>32)); \ | ||
313 | __w; \ | ||
314 | }) | ||
315 | #define hweight32(x) generic_hweight32(x) | 272 | #define hweight32(x) generic_hweight32(x) |
316 | #define hweight16(x) generic_hweight16(x) | 273 | #define hweight16(x) generic_hweight16(x) |
317 | #define hweight8(x) generic_hweight8(x) | 274 | #define hweight8(x) generic_hweight8(x) |
@@ -324,7 +281,13 @@ static __inline__ int fls(int x) | |||
324 | */ | 281 | */ |
325 | static inline int sched_find_first_bit(const unsigned long *b) | 282 | static inline int sched_find_first_bit(const unsigned long *b) |
326 | { | 283 | { |
327 | #ifndef __LP64__ | 284 | #ifdef __LP64__ |
285 | if (unlikely(b[0])) | ||
286 | return __ffs(b[0]); | ||
287 | if (unlikely(b[1])) | ||
288 | return __ffs(b[1]) + 64; | ||
289 | return __ffs(b[2]) + 128; | ||
290 | #else | ||
328 | if (unlikely(b[0])) | 291 | if (unlikely(b[0])) |
329 | return __ffs(b[0]); | 292 | return __ffs(b[0]); |
330 | if (unlikely(b[1])) | 293 | if (unlikely(b[1])) |
@@ -334,14 +297,6 @@ static inline int sched_find_first_bit(const unsigned long *b) | |||
334 | if (b[3]) | 297 | if (b[3]) |
335 | return __ffs(b[3]) + 96; | 298 | return __ffs(b[3]) + 96; |
336 | return __ffs(b[4]) + 128; | 299 | return __ffs(b[4]) + 128; |
337 | #else | ||
338 | if (unlikely(b[0])) | ||
339 | return __ffs(b[0]); | ||
340 | if (unlikely(((unsigned int)b[1]))) | ||
341 | return __ffs(b[1]) + 64; | ||
342 | if (b[1] >> 32) | ||
343 | return __ffs(b[1] >> 32) + 96; | ||
344 | return __ffs(b[2]) + 128; | ||
345 | #endif | 300 | #endif |
346 | } | 301 | } |
347 | 302 | ||
@@ -391,7 +346,7 @@ found_middle: | |||
391 | 346 | ||
392 | static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) | 347 | static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset) |
393 | { | 348 | { |
394 | const unsigned long *p = addr + (offset >> 6); | 349 | const unsigned long *p = addr + (offset >> SHIFT_PER_LONG); |
395 | unsigned long result = offset & ~(BITS_PER_LONG-1); | 350 | unsigned long result = offset & ~(BITS_PER_LONG-1); |
396 | unsigned long tmp; | 351 | unsigned long tmp; |
397 | 352 | ||
@@ -445,71 +400,90 @@ found_middle: | |||
445 | * test_and_{set,clear}_bit guarantee atomicity without | 400 | * test_and_{set,clear}_bit guarantee atomicity without |
446 | * disabling interrupts. | 401 | * disabling interrupts. |
447 | */ | 402 | */ |
448 | #ifdef __LP64__ | ||
449 | #define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
450 | #define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
451 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
452 | #define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr) | ||
453 | #else | ||
454 | #define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
455 | #define ext2_set_bit_atomic(l,nr,addr) test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
456 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
457 | #define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr) | ||
458 | #endif | ||
459 | 403 | ||
460 | #endif /* __KERNEL__ */ | 404 | /* '3' is bits per byte */ |
405 | #define LE_BYTE_ADDR ((sizeof(unsigned long) - 1) << 3) | ||
461 | 406 | ||
462 | static __inline__ int ext2_test_bit(int nr, __const__ void * addr) | 407 | #define ext2_test_bit(nr, addr) \ |
463 | { | 408 | test_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) |
464 | __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; | 409 | #define ext2_set_bit(nr, addr) \ |
410 | __test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) | ||
411 | #define ext2_clear_bit(nr, addr) \ | ||
412 | __test_and_clear_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) | ||
465 | 413 | ||
466 | return (ADDR[nr >> 3] >> (nr & 7)) & 1; | 414 | #define ext2_set_bit_atomic(l,nr,addr) \ |
467 | } | 415 | test_and_set_bit((nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) |
416 | #define ext2_clear_bit_atomic(l,nr,addr) \ | ||
417 | test_and_clear_bit( (nr) ^ LE_BYTE_ADDR, (unsigned long *)addr) | ||
418 | |||
419 | #endif /* __KERNEL__ */ | ||
468 | 420 | ||
469 | /* | ||
470 | * This implementation of ext2_find_{first,next}_zero_bit was stolen from | ||
471 | * Linus' asm-alpha/bitops.h and modified for a big-endian machine. | ||
472 | */ | ||
473 | 421 | ||
474 | #define ext2_find_first_zero_bit(addr, size) \ | 422 | #define ext2_find_first_zero_bit(addr, size) \ |
475 | ext2_find_next_zero_bit((addr), (size), 0) | 423 | ext2_find_next_zero_bit((addr), (size), 0) |
476 | 424 | ||
477 | extern __inline__ unsigned long ext2_find_next_zero_bit(void *addr, | 425 | /* include/linux/byteorder does not support "unsigned long" type */ |
478 | unsigned long size, unsigned long offset) | 426 | static inline unsigned long ext2_swabp(unsigned long * x) |
479 | { | 427 | { |
480 | unsigned int *p = ((unsigned int *) addr) + (offset >> 5); | 428 | #ifdef __LP64__ |
481 | unsigned int result = offset & ~31UL; | 429 | return (unsigned long) __swab64p((u64 *) x); |
482 | unsigned int tmp; | 430 | #else |
431 | return (unsigned long) __swab32p((u32 *) x); | ||
432 | #endif | ||
433 | } | ||
434 | |||
435 | /* include/linux/byteorder doesn't support "unsigned long" type */ | ||
436 | static inline unsigned long ext2_swab(unsigned long y) | ||
437 | { | ||
438 | #ifdef __LP64__ | ||
439 | return (unsigned long) __swab64((u64) y); | ||
440 | #else | ||
441 | return (unsigned long) __swab32((u32) y); | ||
442 | #endif | ||
443 | } | ||
444 | |||
445 | static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) | ||
446 | { | ||
447 | unsigned long *p = (unsigned long *) addr + (offset >> SHIFT_PER_LONG); | ||
448 | unsigned long result = offset & ~(BITS_PER_LONG - 1); | ||
449 | unsigned long tmp; | ||
483 | 450 | ||
484 | if (offset >= size) | 451 | if (offset >= size) |
485 | return size; | 452 | return size; |
486 | size -= result; | 453 | size -= result; |
487 | offset &= 31UL; | 454 | offset &= (BITS_PER_LONG - 1UL); |
488 | if (offset) { | 455 | if (offset) { |
489 | tmp = cpu_to_le32p(p++); | 456 | tmp = ext2_swabp(p++); |
490 | tmp |= ~0UL >> (32-offset); | 457 | tmp |= (~0UL >> (BITS_PER_LONG - offset)); |
491 | if (size < 32) | 458 | if (size < BITS_PER_LONG) |
492 | goto found_first; | 459 | goto found_first; |
493 | if (tmp != ~0U) | 460 | if (~tmp) |
494 | goto found_middle; | 461 | goto found_middle; |
495 | size -= 32; | 462 | size -= BITS_PER_LONG; |
496 | result += 32; | 463 | result += BITS_PER_LONG; |
497 | } | 464 | } |
498 | while (size >= 32) { | 465 | |
499 | if ((tmp = cpu_to_le32p(p++)) != ~0U) | 466 | while (size & ~(BITS_PER_LONG - 1)) { |
500 | goto found_middle; | 467 | if (~(tmp = *(p++))) |
501 | result += 32; | 468 | goto found_middle_swap; |
502 | size -= 32; | 469 | result += BITS_PER_LONG; |
470 | size -= BITS_PER_LONG; | ||
503 | } | 471 | } |
504 | if (!size) | 472 | if (!size) |
505 | return result; | 473 | return result; |
506 | tmp = cpu_to_le32p(p); | 474 | tmp = ext2_swabp(p); |
507 | found_first: | 475 | found_first: |
508 | tmp |= ~0U << size; | 476 | tmp |= ~0UL << size; |
477 | if (tmp == ~0UL) /* Are any bits zero? */ | ||
478 | return result + size; /* Nope. Skip ffz */ | ||
509 | found_middle: | 479 | found_middle: |
510 | return result + ffz(tmp); | 480 | return result + ffz(tmp); |
481 | |||
482 | found_middle_swap: | ||
483 | return result + ffz(ext2_swab(tmp)); | ||
511 | } | 484 | } |
512 | 485 | ||
486 | |||
513 | /* Bitmap functions for the minix filesystem. */ | 487 | /* Bitmap functions for the minix filesystem. */ |
514 | #define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr) | 488 | #define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr) |
515 | #define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr)) | 489 | #define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr)) |
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index aa592d8c0e39..1bc3c83ee74b 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h | |||
@@ -100,30 +100,34 @@ static inline void flush_cache_range(struct vm_area_struct *vma, | |||
100 | 100 | ||
101 | /* Simple function to work out if we have an existing address translation | 101 | /* Simple function to work out if we have an existing address translation |
102 | * for a user space vma. */ | 102 | * for a user space vma. */ |
103 | static inline pte_t *__translation_exists(struct mm_struct *mm, | 103 | static inline int translation_exists(struct vm_area_struct *vma, |
104 | unsigned long addr) | 104 | unsigned long addr, unsigned long pfn) |
105 | { | 105 | { |
106 | pgd_t *pgd = pgd_offset(mm, addr); | 106 | pgd_t *pgd = pgd_offset(vma->vm_mm, addr); |
107 | pmd_t *pmd; | 107 | pmd_t *pmd; |
108 | pte_t *pte; | 108 | pte_t pte; |
109 | 109 | ||
110 | if(pgd_none(*pgd)) | 110 | if(pgd_none(*pgd)) |
111 | return NULL; | 111 | return 0; |
112 | 112 | ||
113 | pmd = pmd_offset(pgd, addr); | 113 | pmd = pmd_offset(pgd, addr); |
114 | if(pmd_none(*pmd) || pmd_bad(*pmd)) | 114 | if(pmd_none(*pmd) || pmd_bad(*pmd)) |
115 | return NULL; | 115 | return 0; |
116 | 116 | ||
117 | pte = pte_offset_map(pmd, addr); | 117 | /* We cannot take the pte lock here: flush_cache_page is usually |
118 | * called with pte lock already held. Whereas flush_dcache_page | ||
119 | * takes flush_dcache_mmap_lock, which is lower in the hierarchy: | ||
120 | * the vma itself is secure, but the pte might come or go racily. | ||
121 | */ | ||
122 | pte = *pte_offset_map(pmd, addr); | ||
123 | /* But pte_unmap() does nothing on this architecture */ | ||
118 | 124 | ||
119 | /* The PA flush mappings show up as pte_none, but they're | 125 | /* Filter out coincidental file entries and swap entries */ |
120 | * valid none the less */ | 126 | if (!(pte_val(pte) & (_PAGE_FLUSH|_PAGE_PRESENT))) |
121 | if(pte_none(*pte) && ((pte_val(*pte) & _PAGE_FLUSH) == 0)) | 127 | return 0; |
122 | return NULL; | ||
123 | return pte; | ||
124 | } | ||
125 | #define translation_exists(vma, addr) __translation_exists((vma)->vm_mm, addr) | ||
126 | 128 | ||
129 | return pte_pfn(pte) == pfn; | ||
130 | } | ||
127 | 131 | ||
128 | /* Private function to flush a page from the cache of a non-current | 132 | /* Private function to flush a page from the cache of a non-current |
129 | * process. cr25 contains the Page Directory of the current user | 133 | * process. cr25 contains the Page Directory of the current user |
@@ -175,9 +179,8 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long | |||
175 | { | 179 | { |
176 | BUG_ON(!vma->vm_mm->context); | 180 | BUG_ON(!vma->vm_mm->context); |
177 | 181 | ||
178 | if(likely(translation_exists(vma, vmaddr))) | 182 | if (likely(translation_exists(vma, vmaddr, pfn))) |
179 | __flush_cache_page(vma, vmaddr); | 183 | __flush_cache_page(vma, vmaddr); |
180 | 184 | ||
181 | } | 185 | } |
182 | #endif | 186 | #endif |
183 | |||
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h index 4db84f969e9e..74d4ac6f2151 100644 --- a/include/asm-parisc/dma-mapping.h +++ b/include/asm-parisc/dma-mapping.h | |||
@@ -9,8 +9,8 @@ | |||
9 | /* See Documentation/DMA-mapping.txt */ | 9 | /* See Documentation/DMA-mapping.txt */ |
10 | struct hppa_dma_ops { | 10 | struct hppa_dma_ops { |
11 | int (*dma_supported)(struct device *dev, u64 mask); | 11 | int (*dma_supported)(struct device *dev, u64 mask); |
12 | void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, int flag); | 12 | void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag); |
13 | void *(*alloc_noncoherent)(struct device *dev, size_t size, dma_addr_t *iova, int flag); | 13 | void *(*alloc_noncoherent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag); |
14 | void (*free_consistent)(struct device *dev, size_t size, void *vaddr, dma_addr_t iova); | 14 | void (*free_consistent)(struct device *dev, size_t size, void *vaddr, dma_addr_t iova); |
15 | dma_addr_t (*map_single)(struct device *dev, void *addr, size_t size, enum dma_data_direction direction); | 15 | dma_addr_t (*map_single)(struct device *dev, void *addr, size_t size, enum dma_data_direction direction); |
16 | void (*unmap_single)(struct device *dev, dma_addr_t iova, size_t size, enum dma_data_direction direction); | 16 | void (*unmap_single)(struct device *dev, dma_addr_t iova, size_t size, enum dma_data_direction direction); |
@@ -49,14 +49,14 @@ extern struct hppa_dma_ops *hppa_dma_ops; | |||
49 | 49 | ||
50 | static inline void * | 50 | static inline void * |
51 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 51 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
52 | int flag) | 52 | gfp_t flag) |
53 | { | 53 | { |
54 | return hppa_dma_ops->alloc_consistent(dev, size, dma_handle, flag); | 54 | return hppa_dma_ops->alloc_consistent(dev, size, dma_handle, flag); |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline void * | 57 | static inline void * |
58 | dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 58 | dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
59 | int flag) | 59 | gfp_t flag) |
60 | { | 60 | { |
61 | return hppa_dma_ops->alloc_noncoherent(dev, size, dma_handle, flag); | 61 | return hppa_dma_ops->alloc_noncoherent(dev, size, dma_handle, flag); |
62 | } | 62 | } |
diff --git a/include/asm-parisc/errno.h b/include/asm-parisc/errno.h index 08464c405471..e2f3ddc796be 100644 --- a/include/asm-parisc/errno.h +++ b/include/asm-parisc/errno.h | |||
@@ -114,6 +114,7 @@ | |||
114 | 114 | ||
115 | #define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ | 115 | #define ENOTSUP 252 /* Function not implemented (POSIX.4 / HPUX) */ |
116 | #define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */ | 116 | #define ECANCELLED 253 /* aio request was canceled before complete (POSIX.4 / HPUX) */ |
117 | #define ECANCELED ECANCELLED /* SuSv3 and Solaris wants one 'L' */ | ||
117 | 118 | ||
118 | /* for robust mutexes */ | 119 | /* for robust mutexes */ |
119 | #define EOWNERDEAD 254 /* Owner died */ | 120 | #define EOWNERDEAD 254 /* Owner died */ |
diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h index d3cfc0168fb1..6a910311b56b 100644 --- a/include/asm-parisc/grfioctl.h +++ b/include/asm-parisc/grfioctl.h | |||
@@ -69,6 +69,8 @@ | |||
69 | #define CRT_ID_TVRX S9000_ID_98765 /* TVRX (gto/falcon) */ | 69 | #define CRT_ID_TVRX S9000_ID_98765 /* TVRX (gto/falcon) */ |
70 | #define CRT_ID_ARTIST S9000_ID_ARTIST /* Artist */ | 70 | #define CRT_ID_ARTIST S9000_ID_ARTIST /* Artist */ |
71 | #define CRT_ID_SUMMIT 0x2FC1066B /* Summit FX2, FX4, FX6 ... */ | 71 | #define CRT_ID_SUMMIT 0x2FC1066B /* Summit FX2, FX4, FX6 ... */ |
72 | #define CRT_ID_LEGO 0x35ACDA30 /* Lego FX5, FX10 ... */ | ||
73 | #define CRT_ID_PINNACLE 0x35ACDA16 /* Pinnacle FXe */ | ||
72 | 74 | ||
73 | /* structure for ioctl(GCDESCRIBE) */ | 75 | /* structure for ioctl(GCDESCRIBE) */ |
74 | 76 | ||
diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index 3243cf2cd227..b27bf7aeb256 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h | |||
@@ -22,7 +22,6 @@ | |||
22 | 22 | ||
23 | #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) | 23 | #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) |
24 | #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) | 24 | #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) |
25 | #define ide_check_region(from,extent) check_region((from), (extent)) | ||
26 | #define ide_request_region(from,extent,name) request_region((from), (extent), (name)) | 25 | #define ide_request_region(from,extent,name) request_region((from), (extent), (name)) |
27 | #define ide_release_region(from,extent) release_region((from), (extent)) | 26 | #define ide_release_region(from,extent) release_region((from), (extent)) |
28 | /* Generic I/O and MEMIO string operations. */ | 27 | /* Generic I/O and MEMIO string operations. */ |
diff --git a/include/asm-parisc/led.h b/include/asm-parisc/led.h index 1ac8ab6c580d..efadfd543ec6 100644 --- a/include/asm-parisc/led.h +++ b/include/asm-parisc/led.h | |||
@@ -23,9 +23,6 @@ | |||
23 | 23 | ||
24 | #define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */ | 24 | #define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */ |
25 | 25 | ||
26 | /* led tasklet struct */ | ||
27 | extern struct tasklet_struct led_tasklet; | ||
28 | |||
29 | /* register_led_driver() */ | 26 | /* register_led_driver() */ |
30 | int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg); | 27 | int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg); |
31 | 28 | ||
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h index 595d3dce120a..ae039f4fd711 100644 --- a/include/asm-parisc/mmzone.h +++ b/include/asm-parisc/mmzone.h | |||
@@ -27,12 +27,6 @@ extern struct node_map_data node_data[]; | |||
27 | }) | 27 | }) |
28 | #define node_localnr(pfn, nid) ((pfn) - node_start_pfn(nid)) | 28 | #define node_localnr(pfn, nid) ((pfn) - node_start_pfn(nid)) |
29 | 29 | ||
30 | #define local_mapnr(kvaddr) \ | ||
31 | ({ \ | ||
32 | unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT; \ | ||
33 | (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \ | ||
34 | }) | ||
35 | |||
36 | #define pfn_to_page(pfn) \ | 30 | #define pfn_to_page(pfn) \ |
37 | ({ \ | 31 | ({ \ |
38 | unsigned long __pfn = (pfn); \ | 32 | unsigned long __pfn = (pfn); \ |
diff --git a/include/asm-parisc/parisc-device.h b/include/asm-parisc/parisc-device.h index ef69ab4b17a9..1d247e32a608 100644 --- a/include/asm-parisc/parisc-device.h +++ b/include/asm-parisc/parisc-device.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #include <linux/device.h> | 1 | #include <linux/device.h> |
2 | 2 | ||
3 | struct parisc_device { | 3 | struct parisc_device { |
4 | unsigned long hpa; /* Hard Physical Address */ | 4 | struct resource hpa; /* Hard Physical Address */ |
5 | struct parisc_device_id id; | 5 | struct parisc_device_id id; |
6 | struct parisc_driver *driver; /* Driver for this device */ | 6 | struct parisc_driver *driver; /* Driver for this device */ |
7 | char name[80]; /* The hardware description */ | 7 | char name[80]; /* The hardware description */ |
@@ -39,6 +39,11 @@ struct parisc_driver { | |||
39 | #define to_parisc_driver(d) container_of(d, struct parisc_driver, drv) | 39 | #define to_parisc_driver(d) container_of(d, struct parisc_driver, drv) |
40 | #define parisc_parent(d) to_parisc_device(d->dev.parent) | 40 | #define parisc_parent(d) to_parisc_device(d->dev.parent) |
41 | 41 | ||
42 | static inline char *parisc_pathname(struct parisc_device *d) | ||
43 | { | ||
44 | return d->dev.bus_id; | ||
45 | } | ||
46 | |||
42 | static inline void | 47 | static inline void |
43 | parisc_set_drvdata(struct parisc_device *d, void *p) | 48 | parisc_set_drvdata(struct parisc_device *d, void *p) |
44 | { | 49 | { |
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index d0b761f690b5..fa39d07d49e9 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
@@ -69,7 +69,7 @@ struct pci_hba_data { | |||
69 | #define PCI_PORT_HBA(a) ((a) >> HBA_PORT_SPACE_BITS) | 69 | #define PCI_PORT_HBA(a) ((a) >> HBA_PORT_SPACE_BITS) |
70 | #define PCI_PORT_ADDR(a) ((a) & (HBA_PORT_SPACE_SIZE - 1)) | 70 | #define PCI_PORT_ADDR(a) ((a) & (HBA_PORT_SPACE_SIZE - 1)) |
71 | 71 | ||
72 | #if CONFIG_64BIT | 72 | #ifdef CONFIG_64BIT |
73 | #define PCI_F_EXTEND 0xffffffff00000000UL | 73 | #define PCI_F_EXTEND 0xffffffff00000000UL |
74 | #define PCI_IS_LMMIO(hba,a) pci_is_lmmio(hba,a) | 74 | #define PCI_IS_LMMIO(hba,a) pci_is_lmmio(hba,a) |
75 | 75 | ||
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index 820c6e712cd7..c28fb6f48c6c 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h | |||
@@ -501,6 +501,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
501 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 501 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
502 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 502 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
503 | 503 | ||
504 | #define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_NO_CACHE) | ||
505 | |||
504 | #define MK_IOSPACE_PFN(space, pfn) (pfn) | 506 | #define MK_IOSPACE_PFN(space, pfn) (pfn) |
505 | #define GET_IOSPACE(pfn) 0 | 507 | #define GET_IOSPACE(pfn) 0 |
506 | #define GET_PFN(pfn) (pfn) | 508 | #define GET_PFN(pfn) (pfn) |
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index a9dfadd05658..aae40e8c3aa8 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h | |||
@@ -122,8 +122,27 @@ struct thread_struct { | |||
122 | }; | 122 | }; |
123 | 123 | ||
124 | /* Thread struct flags. */ | 124 | /* Thread struct flags. */ |
125 | #define PARISC_UAC_NOPRINT (1UL << 0) /* see prctl and unaligned.c */ | ||
126 | #define PARISC_UAC_SIGBUS (1UL << 1) | ||
125 | #define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */ | 127 | #define PARISC_KERNEL_DEATH (1UL << 31) /* see die_if_kernel()... */ |
126 | 128 | ||
129 | #define PARISC_UAC_SHIFT 0 | ||
130 | #define PARISC_UAC_MASK (PARISC_UAC_NOPRINT|PARISC_UAC_SIGBUS) | ||
131 | |||
132 | #define SET_UNALIGN_CTL(task,value) \ | ||
133 | ({ \ | ||
134 | (task)->thread.flags = (((task)->thread.flags & ~PARISC_UAC_MASK) \ | ||
135 | | (((value) << PARISC_UAC_SHIFT) & \ | ||
136 | PARISC_UAC_MASK)); \ | ||
137 | 0; \ | ||
138 | }) | ||
139 | |||
140 | #define GET_UNALIGN_CTL(task,addr) \ | ||
141 | ({ \ | ||
142 | put_user(((task)->thread.flags & PARISC_UAC_MASK) \ | ||
143 | >> PARISC_UAC_SHIFT, (int __user *) (addr)); \ | ||
144 | }) | ||
145 | |||
127 | #define INIT_THREAD { \ | 146 | #define INIT_THREAD { \ |
128 | regs: { gr: { 0, }, \ | 147 | regs: { gr: { 0, }, \ |
129 | fr: { 0, }, \ | 148 | fr: { 0, }, \ |
diff --git a/include/asm-parisc/psw.h b/include/asm-parisc/psw.h index 51323029f377..4334d6ca2add 100644 --- a/include/asm-parisc/psw.h +++ b/include/asm-parisc/psw.h | |||
@@ -1,4 +1,7 @@ | |||
1 | #ifndef _PARISC_PSW_H | 1 | #ifndef _PARISC_PSW_H |
2 | |||
3 | #include <linux/config.h> | ||
4 | |||
2 | #define PSW_I 0x00000001 | 5 | #define PSW_I 0x00000001 |
3 | #define PSW_D 0x00000002 | 6 | #define PSW_D 0x00000002 |
4 | #define PSW_P 0x00000004 | 7 | #define PSW_P 0x00000004 |
@@ -9,6 +12,16 @@ | |||
9 | #define PSW_G 0x00000040 /* PA1.x only */ | 12 | #define PSW_G 0x00000040 /* PA1.x only */ |
10 | #define PSW_O 0x00000080 /* PA2.0 only */ | 13 | #define PSW_O 0x00000080 /* PA2.0 only */ |
11 | 14 | ||
15 | /* ssm/rsm instructions number PSW_W and PSW_E differently */ | ||
16 | #define PSW_SM_I PSW_I /* Enable External Interrupts */ | ||
17 | #define PSW_SM_D PSW_D | ||
18 | #define PSW_SM_P PSW_P | ||
19 | #define PSW_SM_Q PSW_Q /* Enable Interrupt State Collection */ | ||
20 | #define PSW_SM_R PSW_R /* Enable Recover Counter Trap */ | ||
21 | #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */ | ||
22 | |||
23 | #define PSW_SM_QUIET PSW_SM_R+PSW_SM_Q+PSW_SM_P+PSW_SM_D+PSW_SM_I | ||
24 | |||
12 | #define PSW_CB 0x0000ff00 | 25 | #define PSW_CB 0x0000ff00 |
13 | 26 | ||
14 | #define PSW_M 0x00010000 | 27 | #define PSW_M 0x00010000 |
@@ -30,33 +43,21 @@ | |||
30 | #define PSW_Z 0x40000000 /* PA1.x only */ | 43 | #define PSW_Z 0x40000000 /* PA1.x only */ |
31 | #define PSW_Y 0x80000000 /* PA1.x only */ | 44 | #define PSW_Y 0x80000000 /* PA1.x only */ |
32 | 45 | ||
33 | #ifdef __LP64__ | 46 | #ifdef CONFIG_64BIT |
34 | #define PSW_HI_CB 0x000000ff /* PA2.0 only */ | 47 | # define PSW_HI_CB 0x000000ff /* PA2.0 only */ |
35 | #endif | 48 | #endif |
36 | 49 | ||
37 | /* PSW bits to be used with ssm/rsm */ | 50 | #ifdef CONFIG_64BIT |
38 | #define PSW_SM_I 0x1 | 51 | # define USER_PSW_HI_MASK PSW_HI_CB |
39 | #define PSW_SM_D 0x2 | 52 | # define WIDE_PSW PSW_W |
40 | #define PSW_SM_P 0x4 | 53 | #else |
41 | #define PSW_SM_Q 0x8 | 54 | # define WIDE_PSW 0 |
42 | #define PSW_SM_R 0x10 | ||
43 | #define PSW_SM_F 0x20 | ||
44 | #define PSW_SM_G 0x40 | ||
45 | #define PSW_SM_O 0x80 | ||
46 | #define PSW_SM_E 0x100 | ||
47 | #define PSW_SM_W 0x200 | ||
48 | |||
49 | #ifdef __LP64__ | ||
50 | # define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) | ||
51 | # define KERNEL_PSW (PSW_W | PSW_C | PSW_Q | PSW_P | PSW_D) | ||
52 | # define REAL_MODE_PSW (PSW_W | PSW_Q) | ||
53 | # define USER_PSW_MASK (PSW_W | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) | ||
54 | # define USER_PSW_HI_MASK (PSW_HI_CB) | ||
55 | #else | ||
56 | # define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) | ||
57 | # define KERNEL_PSW (PSW_C | PSW_Q | PSW_P | PSW_D) | ||
58 | # define REAL_MODE_PSW (PSW_Q) | ||
59 | # define USER_PSW_MASK (PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) | ||
60 | #endif | 55 | #endif |
61 | 56 | ||
57 | /* Used when setting up for rfi */ | ||
58 | #define KERNEL_PSW (WIDE_PSW | PSW_C | PSW_Q | PSW_P | PSW_D) | ||
59 | #define REAL_MODE_PSW (WIDE_PSW | PSW_Q) | ||
60 | #define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB) | ||
61 | #define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I) | ||
62 | |||
62 | #endif | 63 | #endif |
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h index 3f428aa371a4..93f990e418f1 100644 --- a/include/asm-parisc/ptrace.h +++ b/include/asm-parisc/ptrace.h | |||
@@ -49,7 +49,7 @@ struct pt_regs { | |||
49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) | 49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) |
50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) | 50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) |
51 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) | 51 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) |
52 | #define profile_pc(regs) instruction_pointer(regs) | 52 | unsigned long profile_pc(struct pt_regs *); |
53 | extern void show_regs(struct pt_regs *); | 53 | extern void show_regs(struct pt_regs *); |
54 | #endif | 54 | #endif |
55 | 55 | ||
diff --git a/include/asm-parisc/semaphore.h b/include/asm-parisc/semaphore.h index f78bb2e34538..c9ee41cd0707 100644 --- a/include/asm-parisc/semaphore.h +++ b/include/asm-parisc/semaphore.h | |||
@@ -49,9 +49,6 @@ struct semaphore { | |||
49 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 49 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
50 | } | 50 | } |
51 | 51 | ||
52 | #define __MUTEX_INITIALIZER(name) \ | ||
53 | __SEMAPHORE_INITIALIZER(name,1) | ||
54 | |||
55 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 52 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
56 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 53 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
57 | 54 | ||
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h index 43eaa6e742e0..7c3f406a746a 100644 --- a/include/asm-parisc/spinlock.h +++ b/include/asm-parisc/spinlock.h | |||
@@ -5,11 +5,6 @@ | |||
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | #include <asm/spinlock_types.h> | 6 | #include <asm/spinlock_types.h> |
7 | 7 | ||
8 | /* Note that PA-RISC has to use `1' to mean unlocked and `0' to mean locked | ||
9 | * since it only has load-and-zero. Moreover, at least on some PA processors, | ||
10 | * the semaphore address has to be 16-byte aligned. | ||
11 | */ | ||
12 | |||
13 | static inline int __raw_spin_is_locked(raw_spinlock_t *x) | 8 | static inline int __raw_spin_is_locked(raw_spinlock_t *x) |
14 | { | 9 | { |
15 | volatile unsigned int *a = __ldcw_align(x); | 10 | volatile unsigned int *a = __ldcw_align(x); |
diff --git a/include/asm-parisc/spinlock_types.h b/include/asm-parisc/spinlock_types.h index 785bba822fbf..d6b479bdb886 100644 --- a/include/asm-parisc/spinlock_types.h +++ b/include/asm-parisc/spinlock_types.h | |||
@@ -6,11 +6,15 @@ | |||
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | typedef struct { | 8 | typedef struct { |
9 | #ifdef CONFIG_PA20 | ||
10 | volatile unsigned int slock; | ||
11 | # define __RAW_SPIN_LOCK_UNLOCKED { 1 } | ||
12 | #else | ||
9 | volatile unsigned int lock[4]; | 13 | volatile unsigned int lock[4]; |
14 | # define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } | ||
15 | #endif | ||
10 | } raw_spinlock_t; | 16 | } raw_spinlock_t; |
11 | 17 | ||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } | ||
13 | |||
14 | typedef struct { | 18 | typedef struct { |
15 | raw_spinlock_t lock; | 19 | raw_spinlock_t lock; |
16 | volatile int counter; | 20 | volatile int counter; |
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h index 26ff844a21c1..f3928d3a80cb 100644 --- a/include/asm-parisc/system.h +++ b/include/asm-parisc/system.h | |||
@@ -138,13 +138,7 @@ static inline void set_eiem(unsigned long val) | |||
138 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | 138 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) |
139 | 139 | ||
140 | 140 | ||
141 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ | 141 | #ifndef CONFIG_PA20 |
142 | #define __ldcw(a) ({ \ | ||
143 | unsigned __ret; \ | ||
144 | __asm__ __volatile__("ldcw 0(%1),%0" : "=r" (__ret) : "r" (a)); \ | ||
145 | __ret; \ | ||
146 | }) | ||
147 | |||
148 | /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, | 142 | /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, |
149 | and GCC only guarantees 8-byte alignment for stack locals, we can't | 143 | and GCC only guarantees 8-byte alignment for stack locals, we can't |
150 | be assured of 16-byte alignment for atomic lock data even if we | 144 | be assured of 16-byte alignment for atomic lock data even if we |
@@ -152,37 +146,41 @@ static inline void set_eiem(unsigned long val) | |||
152 | we use a struct containing an array of four ints for the atomic lock | 146 | we use a struct containing an array of four ints for the atomic lock |
153 | type and dynamically select the 16-byte aligned int from the array | 147 | type and dynamically select the 16-byte aligned int from the array |
154 | for the semaphore. */ | 148 | for the semaphore. */ |
149 | |||
155 | #define __PA_LDCW_ALIGNMENT 16 | 150 | #define __PA_LDCW_ALIGNMENT 16 |
156 | #define __ldcw_align(a) ({ \ | 151 | #define __ldcw_align(a) ({ \ |
157 | unsigned long __ret = (unsigned long) &(a)->lock[0]; \ | 152 | unsigned long __ret = (unsigned long) &(a)->lock[0]; \ |
158 | __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ | 153 | __ret = (__ret + __PA_LDCW_ALIGNMENT - 1) & ~(__PA_LDCW_ALIGNMENT - 1); \ |
159 | (volatile unsigned int *) __ret; \ | 154 | (volatile unsigned int *) __ret; \ |
160 | }) | 155 | }) |
156 | #define LDCW "ldcw" | ||
161 | 157 | ||
162 | #ifdef CONFIG_SMP | 158 | #else /*CONFIG_PA20*/ |
163 | # define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) | 159 | /* From: "Jim Hull" <jim.hull of hp.com> |
164 | #endif | 160 | I've attached a summary of the change, but basically, for PA 2.0, as |
161 | long as the ",CO" (coherent operation) completer is specified, then the | ||
162 | 16-byte alignment requirement for ldcw and ldcd is relaxed, and instead | ||
163 | they only require "natural" alignment (4-byte for ldcw, 8-byte for | ||
164 | ldcd). */ | ||
165 | 165 | ||
166 | #define KERNEL_START (0x10100000 - 0x1000) | 166 | #define __PA_LDCW_ALIGNMENT 4 |
167 | #define __ldcw_align(a) ((volatile unsigned int *)a) | ||
168 | #define LDCW "ldcw,co" | ||
167 | 169 | ||
168 | /* This is for the serialisation of PxTLB broadcasts. At least on the | 170 | #endif /*!CONFIG_PA20*/ |
169 | * N class systems, only one PxTLB inter processor broadcast can be | ||
170 | * active at any one time on the Merced bus. This tlb purge | ||
171 | * synchronisation is fairly lightweight and harmless so we activate | ||
172 | * it on all SMP systems not just the N class. */ | ||
173 | #ifdef CONFIG_SMP | ||
174 | extern spinlock_t pa_tlb_lock; | ||
175 | 171 | ||
176 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | 172 | /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */ |
177 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | 173 | #define __ldcw(a) ({ \ |
178 | 174 | unsigned __ret; \ | |
179 | #else | 175 | __asm__ __volatile__(LDCW " 0(%1),%0" : "=r" (__ret) : "r" (a)); \ |
180 | 176 | __ret; \ | |
181 | #define purge_tlb_start(x) do { } while(0) | 177 | }) |
182 | #define purge_tlb_end(x) do { } while (0) | ||
183 | 178 | ||
179 | #ifdef CONFIG_SMP | ||
180 | # define __lock_aligned __attribute__((__section__(".data.lock_aligned"))) | ||
184 | #endif | 181 | #endif |
185 | 182 | ||
183 | #define KERNEL_START (0x10100000 - 0x1000) | ||
186 | #define arch_align_stack(x) (x) | 184 | #define arch_align_stack(x) (x) |
187 | 185 | ||
188 | #endif | 186 | #endif |
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index eb27b78930e8..e97aa8d1eff5 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
@@ -7,6 +7,26 @@ | |||
7 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
8 | #include <asm/mmu_context.h> | 8 | #include <asm/mmu_context.h> |
9 | 9 | ||
10 | |||
11 | /* This is for the serialisation of PxTLB broadcasts. At least on the | ||
12 | * N class systems, only one PxTLB inter processor broadcast can be | ||
13 | * active at any one time on the Merced bus. This tlb purge | ||
14 | * synchronisation is fairly lightweight and harmless so we activate | ||
15 | * it on all SMP systems not just the N class. */ | ||
16 | #ifdef CONFIG_SMP | ||
17 | extern spinlock_t pa_tlb_lock; | ||
18 | |||
19 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | ||
20 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | ||
21 | |||
22 | #else | ||
23 | |||
24 | #define purge_tlb_start(x) do { } while(0) | ||
25 | #define purge_tlb_end(x) do { } while (0) | ||
26 | |||
27 | #endif | ||
28 | |||
29 | |||
10 | extern void flush_tlb_all(void); | 30 | extern void flush_tlb_all(void); |
11 | 31 | ||
12 | /* | 32 | /* |
@@ -64,29 +84,27 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
64 | { | 84 | { |
65 | unsigned long npages; | 85 | unsigned long npages; |
66 | 86 | ||
67 | |||
68 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; | 87 | npages = ((end - (start & PAGE_MASK)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT; |
69 | if (npages >= 512) /* XXX arbitrary, should be tuned */ | 88 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ |
70 | flush_tlb_all(); | 89 | flush_tlb_all(); |
71 | else { | 90 | else { |
72 | 91 | preempt_disable(); | |
73 | mtsp(vma->vm_mm->context,1); | 92 | mtsp(vma->vm_mm->context,1); |
93 | purge_tlb_start(); | ||
74 | if (split_tlb) { | 94 | if (split_tlb) { |
75 | purge_tlb_start(); | ||
76 | while (npages--) { | 95 | while (npages--) { |
77 | pdtlb(start); | 96 | pdtlb(start); |
78 | pitlb(start); | 97 | pitlb(start); |
79 | start += PAGE_SIZE; | 98 | start += PAGE_SIZE; |
80 | } | 99 | } |
81 | purge_tlb_end(); | ||
82 | } else { | 100 | } else { |
83 | purge_tlb_start(); | ||
84 | while (npages--) { | 101 | while (npages--) { |
85 | pdtlb(start); | 102 | pdtlb(start); |
86 | start += PAGE_SIZE; | 103 | start += PAGE_SIZE; |
87 | } | 104 | } |
88 | purge_tlb_end(); | 105 | preempt_enable(); |
89 | } | 106 | } |
107 | purge_tlb_end(); | ||
90 | } | 108 | } |
91 | } | 109 | } |
92 | 110 | ||
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h index d21b9d0d63ea..34fdce361a5a 100644 --- a/include/asm-parisc/types.h +++ b/include/asm-parisc/types.h | |||
@@ -33,8 +33,10 @@ typedef unsigned long long __u64; | |||
33 | 33 | ||
34 | #ifdef __LP64__ | 34 | #ifdef __LP64__ |
35 | #define BITS_PER_LONG 64 | 35 | #define BITS_PER_LONG 64 |
36 | #define SHIFT_PER_LONG 6 | ||
36 | #else | 37 | #else |
37 | #define BITS_PER_LONG 32 | 38 | #define BITS_PER_LONG 32 |
39 | #define SHIFT_PER_LONG 5 | ||
38 | #endif | 40 | #endif |
39 | 41 | ||
40 | #ifndef __ASSEMBLY__ | 42 | #ifndef __ASSEMBLY__ |
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 6a9f0cadff58..80b7b98c70a1 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h | |||
@@ -687,8 +687,8 @@ | |||
687 | #define __NR_shmget (__NR_Linux + 194) | 687 | #define __NR_shmget (__NR_Linux + 194) |
688 | #define __NR_shmctl (__NR_Linux + 195) | 688 | #define __NR_shmctl (__NR_Linux + 195) |
689 | 689 | ||
690 | #define __NR_getpmsg (__NR_Linux + 196) /* some people actually want streams */ | 690 | #define __NR_getpmsg (__NR_Linux + 196) /* Somebody *wants* streams? */ |
691 | #define __NR_putpmsg (__NR_Linux + 197) /* some people actually want streams */ | 691 | #define __NR_putpmsg (__NR_Linux + 197) |
692 | 692 | ||
693 | #define __NR_lstat64 (__NR_Linux + 198) | 693 | #define __NR_lstat64 (__NR_Linux + 198) |
694 | #define __NR_truncate64 (__NR_Linux + 199) | 694 | #define __NR_truncate64 (__NR_Linux + 199) |
@@ -755,8 +755,14 @@ | |||
755 | #define __NR_mbind (__NR_Linux + 260) | 755 | #define __NR_mbind (__NR_Linux + 260) |
756 | #define __NR_get_mempolicy (__NR_Linux + 261) | 756 | #define __NR_get_mempolicy (__NR_Linux + 261) |
757 | #define __NR_set_mempolicy (__NR_Linux + 262) | 757 | #define __NR_set_mempolicy (__NR_Linux + 262) |
758 | #define __NR_vserver (__NR_Linux + 263) | ||
759 | #define __NR_add_key (__NR_Linux + 264) | ||
760 | #define __NR_request_key (__NR_Linux + 265) | ||
761 | #define __NR_keyctl (__NR_Linux + 266) | ||
762 | #define __NR_ioprio_set (__NR_Linux + 267) | ||
763 | #define __NR_ioprio_get (__NR_Linux + 268) | ||
758 | 764 | ||
759 | #define __NR_Linux_syscalls 263 | 765 | #define __NR_Linux_syscalls 269 |
760 | 766 | ||
761 | #define HPUX_GATEWAY_ADDR 0xC0000004 | 767 | #define HPUX_GATEWAY_ADDR 0xC0000004 |
762 | #define LINUX_GATEWAY_ADDR 0x100 | 768 | #define LINUX_GATEWAY_ADDR 0x100 |
@@ -807,10 +813,10 @@ | |||
807 | #define K_INLINE_SYSCALL(name, nr, args...) ({ \ | 813 | #define K_INLINE_SYSCALL(name, nr, args...) ({ \ |
808 | long __sys_res; \ | 814 | long __sys_res; \ |
809 | { \ | 815 | { \ |
810 | register unsigned long __res asm("r28"); \ | 816 | register unsigned long __res __asm__("r28"); \ |
811 | K_LOAD_ARGS_##nr(args) \ | 817 | K_LOAD_ARGS_##nr(args) \ |
812 | /* FIXME: HACK stw/ldw r19 around syscall */ \ | 818 | /* FIXME: HACK stw/ldw r19 around syscall */ \ |
813 | asm volatile( \ | 819 | __asm__ volatile( \ |
814 | K_STW_ASM_PIC \ | 820 | K_STW_ASM_PIC \ |
815 | " ble 0x100(%%sr2, %%r0)\n" \ | 821 | " ble 0x100(%%sr2, %%r0)\n" \ |
816 | " ldi %1, %%r20\n" \ | 822 | " ldi %1, %%r20\n" \ |
@@ -1005,7 +1011,6 @@ int sys_clone(unsigned long clone_flags, unsigned long usp, | |||
1005 | struct pt_regs *regs); | 1011 | struct pt_regs *regs); |
1006 | int sys_vfork(struct pt_regs *regs); | 1012 | int sys_vfork(struct pt_regs *regs); |
1007 | int sys_pipe(int *fildes); | 1013 | int sys_pipe(int *fildes); |
1008 | long sys_ptrace(long request, pid_t pid, long addr, long data); | ||
1009 | struct sigaction; | 1014 | struct sigaction; |
1010 | asmlinkage long sys_rt_sigaction(int sig, | 1015 | asmlinkage long sys_rt_sigaction(int sig, |
1011 | const struct sigaction __user *act, | 1016 | const struct sigaction __user *act, |
diff --git a/include/asm-ppc64/a.out.h b/include/asm-powerpc/a.out.h index 3871e252a6f1..c7393a977364 100644 --- a/include/asm-ppc64/a.out.h +++ b/include/asm-powerpc/a.out.h | |||
@@ -1,14 +1,5 @@ | |||
1 | #ifndef __PPC64_A_OUT_H__ | 1 | #ifndef _ASM_POWERPC_A_OUT_H |
2 | #define __PPC64_A_OUT_H__ | 2 | #define _ASM_POWERPC_A_OUT_H |
3 | |||
4 | /* | ||
5 | * c 2001 PPC 64 Team, IBM Corp | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | 3 | ||
13 | struct exec | 4 | struct exec |
14 | { | 5 | { |
@@ -27,6 +18,7 @@ struct exec | |||
27 | #define N_SYMSIZE(a) ((a).a_syms) | 18 | #define N_SYMSIZE(a) ((a).a_syms) |
28 | 19 | ||
29 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | #ifdef __powerpc64__ | ||
30 | 22 | ||
31 | #define STACK_TOP_USER64 TASK_SIZE_USER64 | 23 | #define STACK_TOP_USER64 TASK_SIZE_USER64 |
32 | #define STACK_TOP_USER32 TASK_SIZE_USER32 | 24 | #define STACK_TOP_USER32 TASK_SIZE_USER32 |
@@ -34,6 +26,11 @@ struct exec | |||
34 | #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ | 26 | #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ |
35 | STACK_TOP_USER32 : STACK_TOP_USER64) | 27 | STACK_TOP_USER32 : STACK_TOP_USER64) |
36 | 28 | ||
29 | #else /* __powerpc64__ */ | ||
30 | |||
31 | #define STACK_TOP TASK_SIZE | ||
32 | |||
33 | #endif /* __powerpc64__ */ | ||
37 | #endif /* __KERNEL__ */ | 34 | #endif /* __KERNEL__ */ |
38 | 35 | ||
39 | #endif /* __PPC64_A_OUT_H__ */ | 36 | #endif /* _ASM_POWERPC_A_OUT_H */ |
diff --git a/include/asm-ppc/atomic.h b/include/asm-powerpc/atomic.h index eeafd505836e..ed4b345ed75d 100644 --- a/include/asm-ppc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -1,29 +1,20 @@ | |||
1 | #ifndef _ASM_POWERPC_ATOMIC_H_ | ||
2 | #define _ASM_POWERPC_ATOMIC_H_ | ||
3 | |||
1 | /* | 4 | /* |
2 | * PowerPC atomic operations | 5 | * PowerPC atomic operations |
3 | */ | 6 | */ |
4 | 7 | ||
5 | #ifndef _ASM_PPC_ATOMIC_H_ | ||
6 | #define _ASM_PPC_ATOMIC_H_ | ||
7 | |||
8 | typedef struct { volatile int counter; } atomic_t; | 8 | typedef struct { volatile int counter; } atomic_t; |
9 | 9 | ||
10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
11 | #include <asm/synch.h> | ||
11 | 12 | ||
12 | #define ATOMIC_INIT(i) { (i) } | 13 | #define ATOMIC_INIT(i) { (i) } |
13 | 14 | ||
14 | #define atomic_read(v) ((v)->counter) | 15 | #define atomic_read(v) ((v)->counter) |
15 | #define atomic_set(v,i) (((v)->counter) = (i)) | 16 | #define atomic_set(v,i) (((v)->counter) = (i)) |
16 | 17 | ||
17 | extern void atomic_clear_mask(unsigned long mask, unsigned long *addr); | ||
18 | |||
19 | #ifdef CONFIG_SMP | ||
20 | #define SMP_SYNC "sync" | ||
21 | #define SMP_ISYNC "\n\tisync" | ||
22 | #else | ||
23 | #define SMP_SYNC "" | ||
24 | #define SMP_ISYNC | ||
25 | #endif | ||
26 | |||
27 | /* Erratum #77 on the 405 means we need a sync or dcbt before every stwcx. | 18 | /* Erratum #77 on the 405 means we need a sync or dcbt before every stwcx. |
28 | * The old ATOMIC_SYNC_FIX covered some but not all of this. | 19 | * The old ATOMIC_SYNC_FIX covered some but not all of this. |
29 | */ | 20 | */ |
@@ -53,12 +44,13 @@ static __inline__ int atomic_add_return(int a, atomic_t *v) | |||
53 | int t; | 44 | int t; |
54 | 45 | ||
55 | __asm__ __volatile__( | 46 | __asm__ __volatile__( |
47 | EIEIO_ON_SMP | ||
56 | "1: lwarx %0,0,%2 # atomic_add_return\n\ | 48 | "1: lwarx %0,0,%2 # atomic_add_return\n\ |
57 | add %0,%1,%0\n" | 49 | add %0,%1,%0\n" |
58 | PPC405_ERR77(0,%2) | 50 | PPC405_ERR77(0,%2) |
59 | " stwcx. %0,0,%2 \n\ | 51 | " stwcx. %0,0,%2 \n\ |
60 | bne- 1b" | 52 | bne- 1b" |
61 | SMP_ISYNC | 53 | ISYNC_ON_SMP |
62 | : "=&r" (t) | 54 | : "=&r" (t) |
63 | : "r" (a), "r" (&v->counter) | 55 | : "r" (a), "r" (&v->counter) |
64 | : "cc", "memory"); | 56 | : "cc", "memory"); |
@@ -88,12 +80,13 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v) | |||
88 | int t; | 80 | int t; |
89 | 81 | ||
90 | __asm__ __volatile__( | 82 | __asm__ __volatile__( |
83 | EIEIO_ON_SMP | ||
91 | "1: lwarx %0,0,%2 # atomic_sub_return\n\ | 84 | "1: lwarx %0,0,%2 # atomic_sub_return\n\ |
92 | subf %0,%1,%0\n" | 85 | subf %0,%1,%0\n" |
93 | PPC405_ERR77(0,%2) | 86 | PPC405_ERR77(0,%2) |
94 | " stwcx. %0,0,%2 \n\ | 87 | " stwcx. %0,0,%2 \n\ |
95 | bne- 1b" | 88 | bne- 1b" |
96 | SMP_ISYNC | 89 | ISYNC_ON_SMP |
97 | : "=&r" (t) | 90 | : "=&r" (t) |
98 | : "r" (a), "r" (&v->counter) | 91 | : "r" (a), "r" (&v->counter) |
99 | : "cc", "memory"); | 92 | : "cc", "memory"); |
@@ -121,12 +114,13 @@ static __inline__ int atomic_inc_return(atomic_t *v) | |||
121 | int t; | 114 | int t; |
122 | 115 | ||
123 | __asm__ __volatile__( | 116 | __asm__ __volatile__( |
117 | EIEIO_ON_SMP | ||
124 | "1: lwarx %0,0,%1 # atomic_inc_return\n\ | 118 | "1: lwarx %0,0,%1 # atomic_inc_return\n\ |
125 | addic %0,%0,1\n" | 119 | addic %0,%0,1\n" |
126 | PPC405_ERR77(0,%1) | 120 | PPC405_ERR77(0,%1) |
127 | " stwcx. %0,0,%1 \n\ | 121 | " stwcx. %0,0,%1 \n\ |
128 | bne- 1b" | 122 | bne- 1b" |
129 | SMP_ISYNC | 123 | ISYNC_ON_SMP |
130 | : "=&r" (t) | 124 | : "=&r" (t) |
131 | : "r" (&v->counter) | 125 | : "r" (&v->counter) |
132 | : "cc", "memory"); | 126 | : "cc", "memory"); |
@@ -164,12 +158,13 @@ static __inline__ int atomic_dec_return(atomic_t *v) | |||
164 | int t; | 158 | int t; |
165 | 159 | ||
166 | __asm__ __volatile__( | 160 | __asm__ __volatile__( |
161 | EIEIO_ON_SMP | ||
167 | "1: lwarx %0,0,%1 # atomic_dec_return\n\ | 162 | "1: lwarx %0,0,%1 # atomic_dec_return\n\ |
168 | addic %0,%0,-1\n" | 163 | addic %0,%0,-1\n" |
169 | PPC405_ERR77(0,%1) | 164 | PPC405_ERR77(0,%1) |
170 | " stwcx. %0,0,%1\n\ | 165 | " stwcx. %0,0,%1\n\ |
171 | bne- 1b" | 166 | bne- 1b" |
172 | SMP_ISYNC | 167 | ISYNC_ON_SMP |
173 | : "=&r" (t) | 168 | : "=&r" (t) |
174 | : "r" (&v->counter) | 169 | : "r" (&v->counter) |
175 | : "cc", "memory"); | 170 | : "cc", "memory"); |
@@ -189,13 +184,14 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) | |||
189 | int t; | 184 | int t; |
190 | 185 | ||
191 | __asm__ __volatile__( | 186 | __asm__ __volatile__( |
187 | EIEIO_ON_SMP | ||
192 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ | 188 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ |
193 | addic. %0,%0,-1\n\ | 189 | addic. %0,%0,-1\n\ |
194 | blt- 2f\n" | 190 | blt- 2f\n" |
195 | PPC405_ERR77(0,%1) | 191 | PPC405_ERR77(0,%1) |
196 | " stwcx. %0,0,%1\n\ | 192 | " stwcx. %0,0,%1\n\ |
197 | bne- 1b" | 193 | bne- 1b" |
198 | SMP_ISYNC | 194 | ISYNC_ON_SMP |
199 | "\n\ | 195 | "\n\ |
200 | 2:" : "=&r" (t) | 196 | 2:" : "=&r" (t) |
201 | : "r" (&v->counter) | 197 | : "r" (&v->counter) |
@@ -204,11 +200,10 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v) | |||
204 | return t; | 200 | return t; |
205 | } | 201 | } |
206 | 202 | ||
207 | #define __MB __asm__ __volatile__ (SMP_SYNC : : : "memory") | 203 | #define smp_mb__before_atomic_dec() smp_mb() |
208 | #define smp_mb__before_atomic_dec() __MB | 204 | #define smp_mb__after_atomic_dec() smp_mb() |
209 | #define smp_mb__after_atomic_dec() __MB | 205 | #define smp_mb__before_atomic_inc() smp_mb() |
210 | #define smp_mb__before_atomic_inc() __MB | 206 | #define smp_mb__after_atomic_inc() smp_mb() |
211 | #define smp_mb__after_atomic_inc() __MB | ||
212 | 207 | ||
213 | #endif /* __KERNEL__ */ | 208 | #endif /* __KERNEL__ */ |
214 | #endif /* _ASM_PPC_ATOMIC_H_ */ | 209 | #endif /* _ASM_POWERPC_ATOMIC_H_ */ |
diff --git a/include/asm-ppc64/auxvec.h b/include/asm-powerpc/auxvec.h index ac6381a106e1..79d8c4732309 100644 --- a/include/asm-ppc64/auxvec.h +++ b/include/asm-powerpc/auxvec.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __PPC64_AUXVEC_H | 1 | #ifndef _ASM_POWERPC_AUXVEC_H |
2 | #define __PPC64_AUXVEC_H | 2 | #define _ASM_POWERPC_AUXVEC_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * We need to put in some extra aux table entries to tell glibc what | 5 | * We need to put in some extra aux table entries to tell glibc what |
@@ -14,6 +14,8 @@ | |||
14 | /* The vDSO location. We have to use the same value as x86 for glibc's | 14 | /* The vDSO location. We have to use the same value as x86 for glibc's |
15 | * sake :-) | 15 | * sake :-) |
16 | */ | 16 | */ |
17 | #ifdef __powerpc64__ | ||
17 | #define AT_SYSINFO_EHDR 33 | 18 | #define AT_SYSINFO_EHDR 33 |
19 | #endif | ||
18 | 20 | ||
19 | #endif /* __PPC64_AUXVEC_H */ | 21 | #endif |
diff --git a/include/asm-ppc/backlight.h b/include/asm-powerpc/backlight.h index 3a1c3dede2a0..1ba1f27a0b63 100644 --- a/include/asm-ppc/backlight.h +++ b/include/asm-powerpc/backlight.h | |||
@@ -1,12 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * Routines for handling backlight control on PowerBooks | 2 | * Routines for handling backlight control on PowerBooks |
3 | * | 3 | * |
4 | * For now, implementation resides in arch/ppc/kernel/pmac_support.c | 4 | * For now, implementation resides in |
5 | * arch/powerpc/platforms/powermac/pmac_support.c | ||
5 | * | 6 | * |
6 | */ | 7 | */ |
8 | #ifndef __ASM_POWERPC_BACKLIGHT_H | ||
9 | #define __ASM_POWERPC_BACKLIGHT_H | ||
7 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
8 | #ifndef __ASM_PPC_BACKLIGHT_H | ||
9 | #define __ASM_PPC_BACKLIGHT_H | ||
10 | 11 | ||
11 | /* Abstract values */ | 12 | /* Abstract values */ |
12 | #define BACKLIGHT_OFF 0 | 13 | #define BACKLIGHT_OFF 0 |
@@ -26,5 +27,5 @@ extern int get_backlight_enable(void); | |||
26 | extern int set_backlight_level(int level); | 27 | extern int set_backlight_level(int level); |
27 | extern int get_backlight_level(void); | 28 | extern int get_backlight_level(void); |
28 | 29 | ||
29 | #endif | ||
30 | #endif /* __KERNEL__ */ | 30 | #endif /* __KERNEL__ */ |
31 | #endif | ||
diff --git a/include/asm-ppc64/bug.h b/include/asm-powerpc/bug.h index 160178278861..e4d028e87020 100644 --- a/include/asm-ppc64/bug.h +++ b/include/asm-powerpc/bug.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_BUG_H | 1 | #ifndef _ASM_POWERPC_BUG_H |
2 | #define _PPC64_BUG_H | 2 | #define _ASM_POWERPC_BUG_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Define an illegal instr to trap on the bug. | 5 | * Define an illegal instr to trap on the bug. |
@@ -11,9 +11,21 @@ | |||
11 | 11 | ||
12 | #ifndef __ASSEMBLY__ | 12 | #ifndef __ASSEMBLY__ |
13 | 13 | ||
14 | #ifdef __powerpc64__ | ||
15 | #define BUG_TABLE_ENTRY(label, line, file, func) \ | ||
16 | ".llong " #label "\n .long " #line "\n .llong " #file ", " #func "\n" | ||
17 | #define TRAP_OP(ra, rb) "1: tdnei " #ra ", " #rb "\n" | ||
18 | #define DATA_TYPE long long | ||
19 | #else | ||
20 | #define BUG_TABLE_ENTRY(label, line, file, func) \ | ||
21 | ".long " #label ", " #line ", " #file ", " #func "\n" | ||
22 | #define TRAP_OP(ra, rb) "1: twnei " #ra ", " #rb "\n" | ||
23 | #define DATA_TYPE int | ||
24 | #endif /* __powerpc64__ */ | ||
25 | |||
14 | struct bug_entry { | 26 | struct bug_entry { |
15 | unsigned long bug_addr; | 27 | unsigned long bug_addr; |
16 | long line; | 28 | int line; |
17 | const char *file; | 29 | const char *file; |
18 | const char *function; | 30 | const char *function; |
19 | }; | 31 | }; |
@@ -32,28 +44,28 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
32 | __asm__ __volatile__( \ | 44 | __asm__ __volatile__( \ |
33 | "1: twi 31,0,0\n" \ | 45 | "1: twi 31,0,0\n" \ |
34 | ".section __bug_table,\"a\"\n\t" \ | 46 | ".section __bug_table,\"a\"\n\t" \ |
35 | " .llong 1b,%0,%1,%2\n" \ | 47 | BUG_TABLE_ENTRY(1b,%0,%1,%2) \ |
36 | ".previous" \ | 48 | ".previous" \ |
37 | : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ | 49 | : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ |
38 | } while (0) | 50 | } while (0) |
39 | 51 | ||
40 | #define BUG_ON(x) do { \ | 52 | #define BUG_ON(x) do { \ |
41 | __asm__ __volatile__( \ | 53 | __asm__ __volatile__( \ |
42 | "1: tdnei %0,0\n" \ | 54 | TRAP_OP(%0,0) \ |
43 | ".section __bug_table,\"a\"\n\t" \ | 55 | ".section __bug_table,\"a\"\n\t" \ |
44 | " .llong 1b,%1,%2,%3\n" \ | 56 | BUG_TABLE_ENTRY(1b,%1,%2,%3) \ |
45 | ".previous" \ | 57 | ".previous" \ |
46 | : : "r" ((long long)(x)), "i" (__LINE__), \ | 58 | : : "r" ((DATA_TYPE)(x)), "i" (__LINE__), \ |
47 | "i" (__FILE__), "i" (__FUNCTION__)); \ | 59 | "i" (__FILE__), "i" (__FUNCTION__)); \ |
48 | } while (0) | 60 | } while (0) |
49 | 61 | ||
50 | #define WARN_ON(x) do { \ | 62 | #define WARN_ON(x) do { \ |
51 | __asm__ __volatile__( \ | 63 | __asm__ __volatile__( \ |
52 | "1: tdnei %0,0\n" \ | 64 | TRAP_OP(%0,0) \ |
53 | ".section __bug_table,\"a\"\n\t" \ | 65 | ".section __bug_table,\"a\"\n\t" \ |
54 | " .llong 1b,%1,%2,%3\n" \ | 66 | BUG_TABLE_ENTRY(1b,%1,%2,%3) \ |
55 | ".previous" \ | 67 | ".previous" \ |
56 | : : "r" ((long long)(x)), \ | 68 | : : "r" ((DATA_TYPE)(x)), \ |
57 | "i" (__LINE__ + BUG_WARNING_TRAP), \ | 69 | "i" (__LINE__ + BUG_WARNING_TRAP), \ |
58 | "i" (__FILE__), "i" (__FUNCTION__)); \ | 70 | "i" (__FILE__), "i" (__FUNCTION__)); \ |
59 | } while (0) | 71 | } while (0) |
@@ -61,9 +73,9 @@ struct bug_entry *find_bug(unsigned long bugaddr); | |||
61 | #define HAVE_ARCH_BUG | 73 | #define HAVE_ARCH_BUG |
62 | #define HAVE_ARCH_BUG_ON | 74 | #define HAVE_ARCH_BUG_ON |
63 | #define HAVE_ARCH_WARN_ON | 75 | #define HAVE_ARCH_WARN_ON |
64 | #endif | 76 | #endif /* CONFIG_BUG */ |
65 | #endif | 77 | #endif /* __ASSEMBLY __ */ |
66 | 78 | ||
67 | #include <asm-generic/bug.h> | 79 | #include <asm-generic/bug.h> |
68 | 80 | ||
69 | #endif | 81 | #endif /* _ASM_POWERPC_BUG_H */ |
diff --git a/include/asm-ppc64/byteorder.h b/include/asm-powerpc/byteorder.h index 8b57da62b674..b37752214a16 100644 --- a/include/asm-ppc64/byteorder.h +++ b/include/asm-powerpc/byteorder.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_BYTEORDER_H | 1 | #ifndef _ASM_POWERPC_BYTEORDER_H |
2 | #define _PPC64_BYTEORDER_H | 2 | #define _ASM_POWERPC_BYTEORDER_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -77,10 +77,13 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value) | |||
77 | 77 | ||
78 | #ifndef __STRICT_ANSI__ | 78 | #ifndef __STRICT_ANSI__ |
79 | #define __BYTEORDER_HAS_U64__ | 79 | #define __BYTEORDER_HAS_U64__ |
80 | #endif | 80 | #ifndef __powerpc64__ |
81 | #define __SWAB_64_THRU_32__ | ||
82 | #endif /* __powerpc64__ */ | ||
83 | #endif /* __STRICT_ANSI__ */ | ||
81 | 84 | ||
82 | #endif /* __GNUC__ */ | 85 | #endif /* __GNUC__ */ |
83 | 86 | ||
84 | #include <linux/byteorder/big_endian.h> | 87 | #include <linux/byteorder/big_endian.h> |
85 | 88 | ||
86 | #endif /* _PPC64_BYTEORDER_H */ | 89 | #endif /* _ASM_POWERPC_BYTEORDER_H */ |
diff --git a/include/asm-ppc64/checksum.h b/include/asm-powerpc/checksum.h index d22d4469de43..d8354d8a49ce 100644 --- a/include/asm-ppc64/checksum.h +++ b/include/asm-powerpc/checksum.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_CHECKSUM_H | 1 | #ifndef _ASM_POWERPC_CHECKSUM_H |
2 | #define _PPC64_CHECKSUM_H | 2 | #define _ASM_POWERPC_CHECKSUM_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -41,8 +41,14 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, | |||
41 | unsigned int sum); | 41 | unsigned int sum); |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * the same as csum_partial, but copies from src to dst while it | 44 | * Computes the checksum of a memory block at src, length len, |
45 | * checksums | 45 | * and adds in "sum" (32-bit), while copying the block to dst. |
46 | * If an access exception occurs on src or dst, it stores -EFAULT | ||
47 | * to *src_err or *dst_err respectively (if that pointer is not | ||
48 | * NULL), and, for an error on src, zeroes the rest of dst. | ||
49 | * | ||
50 | * Like csum_partial, this must be called with even lengths, | ||
51 | * except for the last fragment. | ||
46 | */ | 52 | */ |
47 | extern unsigned int csum_partial_copy_generic(const char *src, char *dst, | 53 | extern unsigned int csum_partial_copy_generic(const char *src, char *dst, |
48 | int len, unsigned int sum, | 54 | int len, unsigned int sum, |
@@ -51,12 +57,18 @@ extern unsigned int csum_partial_copy_generic(const char *src, char *dst, | |||
51 | * the same as csum_partial, but copies from src to dst while it | 57 | * the same as csum_partial, but copies from src to dst while it |
52 | * checksums. | 58 | * checksums. |
53 | */ | 59 | */ |
54 | |||
55 | unsigned int csum_partial_copy_nocheck(const char *src, | 60 | unsigned int csum_partial_copy_nocheck(const char *src, |
56 | char *dst, | 61 | char *dst, |
57 | int len, | 62 | int len, |
58 | unsigned int sum); | 63 | unsigned int sum); |
59 | 64 | ||
65 | #define csum_partial_copy_from_user(src, dst, len, sum, errp) \ | ||
66 | csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL) | ||
67 | |||
68 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | ||
69 | csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL) | ||
70 | |||
71 | |||
60 | /* | 72 | /* |
61 | * turns a 32-bit partial checksum (e.g. from csum_partial) into a | 73 | * turns a 32-bit partial checksum (e.g. from csum_partial) into a |
62 | * 1's complement 16-bit checksum. | 74 | * 1's complement 16-bit checksum. |
@@ -83,12 +95,7 @@ static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | |||
83 | return csum_fold(csum_partial(buff, len, 0)); | 95 | return csum_fold(csum_partial(buff, len, 0)); |
84 | } | 96 | } |
85 | 97 | ||
86 | #define csum_partial_copy_from_user(src, dst, len, sum, errp) \ | 98 | #ifdef __powerpc64__ |
87 | csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL) | ||
88 | |||
89 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | ||
90 | csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL) | ||
91 | |||
92 | static inline u32 csum_tcpudp_nofold(u32 saddr, | 99 | static inline u32 csum_tcpudp_nofold(u32 saddr, |
93 | u32 daddr, | 100 | u32 daddr, |
94 | unsigned short len, | 101 | unsigned short len, |
@@ -103,5 +110,23 @@ static inline u32 csum_tcpudp_nofold(u32 saddr, | |||
103 | s += (s >> 32); | 110 | s += (s >> 32); |
104 | return (u32) s; | 111 | return (u32) s; |
105 | } | 112 | } |
113 | #else | ||
114 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | ||
115 | unsigned long daddr, | ||
116 | unsigned short len, | ||
117 | unsigned short proto, | ||
118 | unsigned int sum) | ||
119 | { | ||
120 | __asm__("\n\ | ||
121 | addc %0,%0,%1 \n\ | ||
122 | adde %0,%0,%2 \n\ | ||
123 | adde %0,%0,%3 \n\ | ||
124 | addze %0,%0 \n\ | ||
125 | " | ||
126 | : "=r" (sum) | ||
127 | : "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum)); | ||
128 | return sum; | ||
129 | } | ||
106 | 130 | ||
107 | #endif | 131 | #endif |
132 | #endif | ||
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h new file mode 100644 index 000000000000..c019501daceb --- /dev/null +++ b/include/asm-powerpc/cputable.h | |||
@@ -0,0 +1,427 @@ | |||
1 | #ifndef __ASM_POWERPC_CPUTABLE_H | ||
2 | #define __ASM_POWERPC_CPUTABLE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <asm/ppc_asm.h> /* for ASM_CONST */ | ||
6 | |||
7 | #define PPC_FEATURE_32 0x80000000 | ||
8 | #define PPC_FEATURE_64 0x40000000 | ||
9 | #define PPC_FEATURE_601_INSTR 0x20000000 | ||
10 | #define PPC_FEATURE_HAS_ALTIVEC 0x10000000 | ||
11 | #define PPC_FEATURE_HAS_FPU 0x08000000 | ||
12 | #define PPC_FEATURE_HAS_MMU 0x04000000 | ||
13 | #define PPC_FEATURE_HAS_4xxMAC 0x02000000 | ||
14 | #define PPC_FEATURE_UNIFIED_CACHE 0x01000000 | ||
15 | #define PPC_FEATURE_HAS_SPE 0x00800000 | ||
16 | #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 | ||
17 | #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 | ||
18 | #define PPC_FEATURE_NO_TB 0x00100000 | ||
19 | |||
20 | #ifdef __KERNEL__ | ||
21 | #ifndef __ASSEMBLY__ | ||
22 | |||
23 | /* This structure can grow, it's real size is used by head.S code | ||
24 | * via the mkdefs mechanism. | ||
25 | */ | ||
26 | struct cpu_spec; | ||
27 | struct op_powerpc_model; | ||
28 | |||
29 | typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); | ||
30 | |||
31 | struct cpu_spec { | ||
32 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ | ||
33 | unsigned int pvr_mask; | ||
34 | unsigned int pvr_value; | ||
35 | |||
36 | char *cpu_name; | ||
37 | unsigned long cpu_features; /* Kernel features */ | ||
38 | unsigned int cpu_user_features; /* Userland features */ | ||
39 | |||
40 | /* cache line sizes */ | ||
41 | unsigned int icache_bsize; | ||
42 | unsigned int dcache_bsize; | ||
43 | |||
44 | /* number of performance monitor counters */ | ||
45 | unsigned int num_pmcs; | ||
46 | |||
47 | /* this is called to initialize various CPU bits like L1 cache, | ||
48 | * BHT, SPD, etc... from head.S before branching to identify_machine | ||
49 | */ | ||
50 | cpu_setup_t cpu_setup; | ||
51 | |||
52 | /* Used by oprofile userspace to select the right counters */ | ||
53 | char *oprofile_cpu_type; | ||
54 | |||
55 | /* Processor specific oprofile operations */ | ||
56 | struct op_powerpc_model *oprofile_model; | ||
57 | }; | ||
58 | |||
59 | extern struct cpu_spec *cur_cpu_spec; | ||
60 | |||
61 | extern void identify_cpu(unsigned long offset, unsigned long cpu); | ||
62 | extern void do_cpu_ftr_fixups(unsigned long offset); | ||
63 | |||
64 | #endif /* __ASSEMBLY__ */ | ||
65 | |||
66 | /* CPU kernel features */ | ||
67 | |||
68 | /* Retain the 32b definitions all use bottom half of word */ | ||
69 | #define CPU_FTR_SPLIT_ID_CACHE ASM_CONST(0x0000000000000001) | ||
70 | #define CPU_FTR_L2CR ASM_CONST(0x0000000000000002) | ||
71 | #define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004) | ||
72 | #define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008) | ||
73 | #define CPU_FTR_TAU ASM_CONST(0x0000000000000010) | ||
74 | #define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020) | ||
75 | #define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) | ||
76 | #define CPU_FTR_604_PERF_MON ASM_CONST(0x0000000000000080) | ||
77 | #define CPU_FTR_601 ASM_CONST(0x0000000000000100) | ||
78 | #define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200) | ||
79 | #define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) | ||
80 | #define CPU_FTR_L3CR ASM_CONST(0x0000000000000800) | ||
81 | #define CPU_FTR_L3_DISABLE_NAP ASM_CONST(0x0000000000001000) | ||
82 | #define CPU_FTR_NAP_DISABLE_L2_PR ASM_CONST(0x0000000000002000) | ||
83 | #define CPU_FTR_DUAL_PLL_750FX ASM_CONST(0x0000000000004000) | ||
84 | #define CPU_FTR_NO_DPM ASM_CONST(0x0000000000008000) | ||
85 | #define CPU_FTR_HAS_HIGH_BATS ASM_CONST(0x0000000000010000) | ||
86 | #define CPU_FTR_NEED_COHERENT ASM_CONST(0x0000000000020000) | ||
87 | #define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) | ||
88 | #define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) | ||
89 | |||
90 | #ifdef __powerpc64__ | ||
91 | /* Add the 64b processor unique features in the top half of the word */ | ||
92 | #define CPU_FTR_SLB ASM_CONST(0x0000000100000000) | ||
93 | #define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) | ||
94 | #define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) | ||
95 | #define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) | ||
96 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000) | ||
97 | #define CPU_FTR_IABR ASM_CONST(0x0000002000000000) | ||
98 | #define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) | ||
99 | #define CPU_FTR_CTRL ASM_CONST(0x0000008000000000) | ||
100 | #define CPU_FTR_SMT ASM_CONST(0x0000010000000000) | ||
101 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) | ||
102 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) | ||
103 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) | ||
104 | #else | ||
105 | /* ensure on 32b processors the flags are available for compiling but | ||
106 | * don't do anything */ | ||
107 | #define CPU_FTR_SLB ASM_CONST(0x0) | ||
108 | #define CPU_FTR_16M_PAGE ASM_CONST(0x0) | ||
109 | #define CPU_FTR_TLBIEL ASM_CONST(0x0) | ||
110 | #define CPU_FTR_NOEXECUTE ASM_CONST(0x0) | ||
111 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0) | ||
112 | #define CPU_FTR_IABR ASM_CONST(0x0) | ||
113 | #define CPU_FTR_MMCRA ASM_CONST(0x0) | ||
114 | #define CPU_FTR_CTRL ASM_CONST(0x0) | ||
115 | #define CPU_FTR_SMT ASM_CONST(0x0) | ||
116 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) | ||
117 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) | ||
118 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0) | ||
119 | #endif | ||
120 | |||
121 | #ifndef __ASSEMBLY__ | ||
122 | |||
123 | #define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ | ||
124 | CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \ | ||
125 | CPU_FTR_NODSISRALIGN | CPU_FTR_CTRL) | ||
126 | |||
127 | /* iSeries doesn't support large pages */ | ||
128 | #ifdef CONFIG_PPC_ISERIES | ||
129 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE) | ||
130 | #else | ||
131 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE) | ||
132 | #endif /* CONFIG_PPC_ISERIES */ | ||
133 | |||
134 | /* We only set the altivec features if the kernel was compiled with altivec | ||
135 | * support | ||
136 | */ | ||
137 | #ifdef CONFIG_ALTIVEC | ||
138 | #define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC | ||
139 | #define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC | ||
140 | #else | ||
141 | #define CPU_FTR_ALTIVEC_COMP 0 | ||
142 | #define PPC_FEATURE_HAS_ALTIVEC_COMP 0 | ||
143 | #endif | ||
144 | |||
145 | /* We need to mark all pages as being coherent if we're SMP or we | ||
146 | * have a 74[45]x and an MPC107 host bridge. | ||
147 | */ | ||
148 | #if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) | ||
149 | #define CPU_FTR_COMMON CPU_FTR_NEED_COHERENT | ||
150 | #else | ||
151 | #define CPU_FTR_COMMON 0 | ||
152 | #endif | ||
153 | |||
154 | /* The powersave features NAP & DOZE seems to confuse BDI when | ||
155 | debugging. So if a BDI is used, disable theses | ||
156 | */ | ||
157 | #ifndef CONFIG_BDI_SWITCH | ||
158 | #define CPU_FTR_MAYBE_CAN_DOZE CPU_FTR_CAN_DOZE | ||
159 | #define CPU_FTR_MAYBE_CAN_NAP CPU_FTR_CAN_NAP | ||
160 | #else | ||
161 | #define CPU_FTR_MAYBE_CAN_DOZE 0 | ||
162 | #define CPU_FTR_MAYBE_CAN_NAP 0 | ||
163 | #endif | ||
164 | |||
165 | #define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \ | ||
166 | !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ | ||
167 | !defined(CONFIG_BOOKE)) | ||
168 | |||
169 | enum { | ||
170 | CPU_FTRS_PPC601 = CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE, | ||
171 | CPU_FTRS_603 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
172 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | | ||
173 | CPU_FTR_MAYBE_CAN_NAP, | ||
174 | CPU_FTRS_604 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
175 | CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, | ||
176 | CPU_FTRS_740_NOTAU = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
177 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
178 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, | ||
179 | CPU_FTRS_740 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
180 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
181 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, | ||
182 | CPU_FTRS_750 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
183 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
184 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, | ||
185 | CPU_FTRS_750FX1 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
186 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
187 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | | ||
188 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, | ||
189 | CPU_FTRS_750FX2 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
190 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
191 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | | ||
192 | CPU_FTR_NO_DPM, | ||
193 | CPU_FTRS_750FX = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
194 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
195 | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | | ||
196 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, | ||
197 | CPU_FTRS_750GX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | | ||
198 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | | ||
199 | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | | ||
200 | CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, | ||
201 | CPU_FTRS_7400_NOTAU = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
202 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
203 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | | ||
204 | CPU_FTR_MAYBE_CAN_NAP, | ||
205 | CPU_FTRS_7400 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
206 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | | ||
207 | CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | | ||
208 | CPU_FTR_MAYBE_CAN_NAP, | ||
209 | CPU_FTRS_7450_20 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
210 | CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
211 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
212 | CPU_FTR_NEED_COHERENT, | ||
213 | CPU_FTRS_7450_21 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
214 | CPU_FTR_USE_TB | | ||
215 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
216 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
217 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | | ||
218 | CPU_FTR_NEED_COHERENT, | ||
219 | CPU_FTRS_7450_23 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
220 | CPU_FTR_USE_TB | | ||
221 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
222 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
223 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT, | ||
224 | CPU_FTRS_7455_1 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
225 | CPU_FTR_USE_TB | | ||
226 | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | | ||
227 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | | ||
228 | CPU_FTR_NEED_COHERENT, | ||
229 | CPU_FTRS_7455_20 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
230 | CPU_FTR_USE_TB | | ||
231 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
232 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
233 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | | ||
234 | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS, | ||
235 | CPU_FTRS_7455 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
236 | CPU_FTR_USE_TB | | ||
237 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
238 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
239 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | | ||
240 | CPU_FTR_NEED_COHERENT, | ||
241 | CPU_FTRS_7447_10 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
242 | CPU_FTR_USE_TB | | ||
243 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
244 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
245 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | | ||
246 | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, | ||
247 | CPU_FTRS_7447 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
248 | CPU_FTR_USE_TB | | ||
249 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
250 | CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
251 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | | ||
252 | CPU_FTR_NEED_COHERENT, | ||
253 | CPU_FTRS_7447A = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
254 | CPU_FTR_USE_TB | | ||
255 | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | | ||
256 | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | | ||
257 | CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | | ||
258 | CPU_FTR_NEED_COHERENT, | ||
259 | CPU_FTRS_82XX = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
260 | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB, | ||
261 | CPU_FTRS_G2_LE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | | ||
262 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, | ||
263 | CPU_FTRS_E300 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | | ||
264 | CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, | ||
265 | CPU_FTRS_CLASSIC32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
266 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, | ||
267 | CPU_FTRS_POWER3_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
268 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, | ||
269 | CPU_FTRS_POWER4_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
270 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, | ||
271 | CPU_FTRS_970_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | | ||
272 | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | | ||
273 | CPU_FTR_MAYBE_CAN_NAP, | ||
274 | CPU_FTRS_8XX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, | ||
275 | CPU_FTRS_40X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, | ||
276 | CPU_FTRS_44X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, | ||
277 | CPU_FTRS_E200 = CPU_FTR_USE_TB, | ||
278 | CPU_FTRS_E500 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, | ||
279 | CPU_FTRS_E500_2 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
280 | CPU_FTR_BIG_PHYS, | ||
281 | CPU_FTRS_GENERIC_32 = CPU_FTR_COMMON, | ||
282 | #ifdef __powerpc64__ | ||
283 | CPU_FTRS_POWER3 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
284 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR, | ||
285 | CPU_FTRS_RS64 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
286 | CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | | ||
287 | CPU_FTR_MMCRA | CPU_FTR_CTRL, | ||
288 | CPU_FTRS_POWER4 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
289 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA, | ||
290 | CPU_FTRS_PPC970 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
291 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | | ||
292 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA, | ||
293 | CPU_FTRS_POWER5 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
294 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | | ||
295 | CPU_FTR_MMCRA | CPU_FTR_SMT | | ||
296 | CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | | ||
297 | CPU_FTR_MMCRA_SIHV, | ||
298 | CPU_FTRS_CELL = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
299 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | | ||
300 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT, | ||
301 | CPU_FTRS_COMPATIBLE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | | ||
302 | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2, | ||
303 | #endif | ||
304 | |||
305 | CPU_FTRS_POSSIBLE = | ||
306 | #if CLASSIC_PPC | ||
307 | CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU | | ||
308 | CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 | | ||
309 | CPU_FTRS_750FX2 | CPU_FTRS_750FX | CPU_FTRS_750GX | | ||
310 | CPU_FTRS_7400_NOTAU | CPU_FTRS_7400 | CPU_FTRS_7450_20 | | ||
311 | CPU_FTRS_7450_21 | CPU_FTRS_7450_23 | CPU_FTRS_7455_1 | | ||
312 | CPU_FTRS_7455_20 | CPU_FTRS_7455 | CPU_FTRS_7447_10 | | ||
313 | CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | | ||
314 | CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_CLASSIC32 | | ||
315 | #else | ||
316 | CPU_FTRS_GENERIC_32 | | ||
317 | #endif | ||
318 | #ifdef CONFIG_PPC64BRIDGE | ||
319 | CPU_FTRS_POWER3_32 | | ||
320 | #endif | ||
321 | #ifdef CONFIG_POWER4 | ||
322 | CPU_FTRS_POWER4_32 | CPU_FTRS_970_32 | | ||
323 | #endif | ||
324 | #ifdef CONFIG_8xx | ||
325 | CPU_FTRS_8XX | | ||
326 | #endif | ||
327 | #ifdef CONFIG_40x | ||
328 | CPU_FTRS_40X | | ||
329 | #endif | ||
330 | #ifdef CONFIG_44x | ||
331 | CPU_FTRS_44X | | ||
332 | #endif | ||
333 | #ifdef CONFIG_E200 | ||
334 | CPU_FTRS_E200 | | ||
335 | #endif | ||
336 | #ifdef CONFIG_E500 | ||
337 | CPU_FTRS_E500 | CPU_FTRS_E500_2 | | ||
338 | #endif | ||
339 | #ifdef __powerpc64__ | ||
340 | CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | | ||
341 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | | ||
342 | #endif | ||
343 | 0, | ||
344 | |||
345 | CPU_FTRS_ALWAYS = | ||
346 | #if CLASSIC_PPC | ||
347 | CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU & | ||
348 | CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 & | ||
349 | CPU_FTRS_750FX2 & CPU_FTRS_750FX & CPU_FTRS_750GX & | ||
350 | CPU_FTRS_7400_NOTAU & CPU_FTRS_7400 & CPU_FTRS_7450_20 & | ||
351 | CPU_FTRS_7450_21 & CPU_FTRS_7450_23 & CPU_FTRS_7455_1 & | ||
352 | CPU_FTRS_7455_20 & CPU_FTRS_7455 & CPU_FTRS_7447_10 & | ||
353 | CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & | ||
354 | CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_CLASSIC32 & | ||
355 | #else | ||
356 | CPU_FTRS_GENERIC_32 & | ||
357 | #endif | ||
358 | #ifdef CONFIG_PPC64BRIDGE | ||
359 | CPU_FTRS_POWER3_32 & | ||
360 | #endif | ||
361 | #ifdef CONFIG_POWER4 | ||
362 | CPU_FTRS_POWER4_32 & CPU_FTRS_970_32 & | ||
363 | #endif | ||
364 | #ifdef CONFIG_8xx | ||
365 | CPU_FTRS_8XX & | ||
366 | #endif | ||
367 | #ifdef CONFIG_40x | ||
368 | CPU_FTRS_40X & | ||
369 | #endif | ||
370 | #ifdef CONFIG_44x | ||
371 | CPU_FTRS_44X & | ||
372 | #endif | ||
373 | #ifdef CONFIG_E200 | ||
374 | CPU_FTRS_E200 & | ||
375 | #endif | ||
376 | #ifdef CONFIG_E500 | ||
377 | CPU_FTRS_E500 & CPU_FTRS_E500_2 & | ||
378 | #endif | ||
379 | #ifdef __powerpc64__ | ||
380 | CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & | ||
381 | CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & | ||
382 | #endif | ||
383 | CPU_FTRS_POSSIBLE, | ||
384 | }; | ||
385 | |||
386 | static inline int cpu_has_feature(unsigned long feature) | ||
387 | { | ||
388 | return (CPU_FTRS_ALWAYS & feature) || | ||
389 | (CPU_FTRS_POSSIBLE | ||
390 | & cur_cpu_spec->cpu_features | ||
391 | & feature); | ||
392 | } | ||
393 | |||
394 | #endif /* !__ASSEMBLY__ */ | ||
395 | |||
396 | #ifdef __ASSEMBLY__ | ||
397 | |||
398 | #define BEGIN_FTR_SECTION 98: | ||
399 | |||
400 | #ifndef __powerpc64__ | ||
401 | #define END_FTR_SECTION(msk, val) \ | ||
402 | 99: \ | ||
403 | .section __ftr_fixup,"a"; \ | ||
404 | .align 2; \ | ||
405 | .long msk; \ | ||
406 | .long val; \ | ||
407 | .long 98b; \ | ||
408 | .long 99b; \ | ||
409 | .previous | ||
410 | #else /* __powerpc64__ */ | ||
411 | #define END_FTR_SECTION(msk, val) \ | ||
412 | 99: \ | ||
413 | .section __ftr_fixup,"a"; \ | ||
414 | .align 3; \ | ||
415 | .llong msk; \ | ||
416 | .llong val; \ | ||
417 | .llong 98b; \ | ||
418 | .llong 99b; \ | ||
419 | .previous | ||
420 | #endif /* __powerpc64__ */ | ||
421 | |||
422 | #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) | ||
423 | #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) | ||
424 | #endif /* __ASSEMBLY__ */ | ||
425 | |||
426 | #endif /* __KERNEL__ */ | ||
427 | #endif /* __ASM_POWERPC_CPUTABLE_H */ | ||
diff --git a/include/asm-ppc/dbdma.h b/include/asm-powerpc/dbdma.h index 8973565f95d3..8973565f95d3 100644 --- a/include/asm-ppc/dbdma.h +++ b/include/asm-powerpc/dbdma.h | |||
diff --git a/include/asm-ppc/dma.h b/include/asm-powerpc/dma.h index cc8e5cd8c9d2..926378d2cd94 100644 --- a/include/asm-ppc/dma.h +++ b/include/asm-powerpc/dma.h | |||
@@ -1,18 +1,14 @@ | |||
1 | #ifndef _ASM_POWERPC_DMA_H | ||
2 | #define _ASM_POWERPC_DMA_H | ||
3 | |||
1 | /* | 4 | /* |
2 | * include/asm-ppc/dma.h: Defines for using and allocating dma channels. | 5 | * Defines for using and allocating dma channels. |
3 | * Written by Hennus Bergman, 1992. | 6 | * Written by Hennus Bergman, 1992. |
4 | * High DMA channel support & info by Hannu Savolainen | 7 | * High DMA channel support & info by Hannu Savolainen |
5 | * and John Boyd, Nov. 1992. | 8 | * and John Boyd, Nov. 1992. |
6 | * Changes for ppc sound by Christoph Nadig | 9 | * Changes for ppc sound by Christoph Nadig |
7 | */ | 10 | */ |
8 | 11 | ||
9 | #ifdef __KERNEL__ | ||
10 | |||
11 | #include <linux/config.h> | ||
12 | #include <asm/io.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <asm/system.h> | ||
15 | |||
16 | /* | 12 | /* |
17 | * Note: Adapted for PowerPC by Gary Thomas | 13 | * Note: Adapted for PowerPC by Gary Thomas |
18 | * Modified by Cort Dougan <cort@cs.nmt.edu> | 14 | * Modified by Cort Dougan <cort@cs.nmt.edu> |
@@ -25,8 +21,10 @@ | |||
25 | * with a grain of salt. | 21 | * with a grain of salt. |
26 | */ | 22 | */ |
27 | 23 | ||
28 | #ifndef _ASM_DMA_H | 24 | #include <linux/config.h> |
29 | #define _ASM_DMA_H | 25 | #include <asm/io.h> |
26 | #include <linux/spinlock.h> | ||
27 | #include <asm/system.h> | ||
30 | 28 | ||
31 | #ifndef MAX_DMA_CHANNELS | 29 | #ifndef MAX_DMA_CHANNELS |
32 | #define MAX_DMA_CHANNELS 8 | 30 | #define MAX_DMA_CHANNELS 8 |
@@ -34,11 +32,9 @@ | |||
34 | 32 | ||
35 | /* The maximum address that we can perform a DMA transfer to on this platform */ | 33 | /* The maximum address that we can perform a DMA transfer to on this platform */ |
36 | /* Doesn't really apply... */ | 34 | /* Doesn't really apply... */ |
37 | #define MAX_DMA_ADDRESS 0xFFFFFFFF | 35 | #define MAX_DMA_ADDRESS (~0UL) |
38 | 36 | ||
39 | /* in arch/ppc/kernel/setup.c -- Cort */ | 37 | #if !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) |
40 | extern unsigned long DMA_MODE_WRITE, DMA_MODE_READ; | ||
41 | extern unsigned long ISA_DMA_THRESHOLD; | ||
42 | 38 | ||
43 | #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER | 39 | #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER |
44 | #define dma_outb outb_p | 40 | #define dma_outb outb_p |
@@ -171,7 +167,18 @@ extern long ppc_cs4232_dma, ppc_cs4232_dma2; | |||
171 | #define DMA1_EXT_REG 0x40B | 167 | #define DMA1_EXT_REG 0x40B |
172 | #define DMA2_EXT_REG 0x4D6 | 168 | #define DMA2_EXT_REG 0x4D6 |
173 | 169 | ||
170 | #ifndef __powerpc64__ | ||
171 | /* in arch/ppc/kernel/setup.c -- Cort */ | ||
172 | extern unsigned int DMA_MODE_WRITE; | ||
173 | extern unsigned int DMA_MODE_READ; | ||
174 | extern unsigned long ISA_DMA_THRESHOLD; | ||
175 | #else | ||
176 | #define DMA_MODE_READ 0x44 /* I/O to memory, no autoinit, increment, single mode */ | ||
177 | #define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */ | ||
178 | #endif | ||
179 | |||
174 | #define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */ | 180 | #define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */ |
181 | |||
175 | #define DMA_AUTOINIT 0x10 | 182 | #define DMA_AUTOINIT 0x10 |
176 | 183 | ||
177 | extern spinlock_t dma_spin_lock; | 184 | extern spinlock_t dma_spin_lock; |
@@ -200,8 +207,9 @@ static __inline__ void enable_dma(unsigned int dmanr) | |||
200 | if (dmanr <= 3) { | 207 | if (dmanr <= 3) { |
201 | dma_outb(dmanr, DMA1_MASK_REG); | 208 | dma_outb(dmanr, DMA1_MASK_REG); |
202 | dma_outb(ucDmaCmd, DMA1_CMD_REG); /* Enable group */ | 209 | dma_outb(ucDmaCmd, DMA1_CMD_REG); /* Enable group */ |
203 | } else | 210 | } else { |
204 | dma_outb(dmanr & 3, DMA2_MASK_REG); | 211 | dma_outb(dmanr & 3, DMA2_MASK_REG); |
212 | } | ||
205 | } | 213 | } |
206 | 214 | ||
207 | static __inline__ void disable_dma(unsigned int dmanr) | 215 | static __inline__ void disable_dma(unsigned int dmanr) |
@@ -290,19 +298,26 @@ static __inline__ void set_dma_page(unsigned int dmanr, int pagenr) | |||
290 | static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int phys) | 298 | static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int phys) |
291 | { | 299 | { |
292 | if (dmanr <= 3) { | 300 | if (dmanr <= 3) { |
293 | dma_outb(phys & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE); | 301 | dma_outb(phys & 0xff, |
294 | dma_outb((phys >> 8) & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE); | 302 | ((dmanr & 3) << 1) + IO_DMA1_BASE); |
303 | dma_outb((phys >> 8) & 0xff, | ||
304 | ((dmanr & 3) << 1) + IO_DMA1_BASE); | ||
295 | } else if (dmanr == SND_DMA1 || dmanr == SND_DMA2) { | 305 | } else if (dmanr == SND_DMA1 || dmanr == SND_DMA2) { |
296 | dma_outb(phys & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE); | 306 | dma_outb(phys & 0xff, |
297 | dma_outb((phys >> 8) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE); | 307 | ((dmanr & 3) << 2) + IO_DMA2_BASE); |
308 | dma_outb((phys >> 8) & 0xff, | ||
309 | ((dmanr & 3) << 2) + IO_DMA2_BASE); | ||
298 | dma_outb((dmanr & 3), DMA2_EXT_REG); | 310 | dma_outb((dmanr & 3), DMA2_EXT_REG); |
299 | } else { | 311 | } else { |
300 | dma_outb((phys >> 1) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE); | 312 | dma_outb((phys >> 1) & 0xff, |
301 | dma_outb((phys >> 9) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE); | 313 | ((dmanr & 3) << 2) + IO_DMA2_BASE); |
314 | dma_outb((phys >> 9) & 0xff, | ||
315 | ((dmanr & 3) << 2) + IO_DMA2_BASE); | ||
302 | } | 316 | } |
303 | set_dma_page(dmanr, phys >> 16); | 317 | set_dma_page(dmanr, phys >> 16); |
304 | } | 318 | } |
305 | 319 | ||
320 | |||
306 | /* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for | 321 | /* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for |
307 | * a specific DMA channel. | 322 | * a specific DMA channel. |
308 | * You must ensure the parameters are valid. | 323 | * You must ensure the parameters are valid. |
@@ -315,21 +330,24 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) | |||
315 | { | 330 | { |
316 | count--; | 331 | count--; |
317 | if (dmanr <= 3) { | 332 | if (dmanr <= 3) { |
318 | dma_outb(count & 0xff, ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); | 333 | dma_outb(count & 0xff, |
319 | dma_outb((count >> 8) & 0xff, ((dmanr & 3) << 1) + 1 + | 334 | ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); |
320 | IO_DMA1_BASE); | 335 | dma_outb((count >> 8) & 0xff, |
336 | ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); | ||
321 | } else if (dmanr == SND_DMA1 || dmanr == SND_DMA2) { | 337 | } else if (dmanr == SND_DMA1 || dmanr == SND_DMA2) { |
322 | dma_outb(count & 0xff, ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); | 338 | dma_outb(count & 0xff, |
323 | dma_outb((count >> 8) & 0xff, ((dmanr & 3) << 2) + 2 + | 339 | ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); |
324 | IO_DMA2_BASE); | 340 | dma_outb((count >> 8) & 0xff, |
341 | ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); | ||
325 | } else { | 342 | } else { |
326 | dma_outb((count >> 1) & 0xff, ((dmanr & 3) << 2) + 2 + | 343 | dma_outb((count >> 1) & 0xff, |
327 | IO_DMA2_BASE); | 344 | ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); |
328 | dma_outb((count >> 9) & 0xff, ((dmanr & 3) << 2) + 2 + | 345 | dma_outb((count >> 9) & 0xff, |
329 | IO_DMA2_BASE); | 346 | ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); |
330 | } | 347 | } |
331 | } | 348 | } |
332 | 349 | ||
350 | |||
333 | /* Get DMA residue count. After a DMA transfer, this | 351 | /* Get DMA residue count. After a DMA transfer, this |
334 | * should return zero. Reading this while a DMA transfer is | 352 | * should return zero. Reading this while a DMA transfer is |
335 | * still in progress will return unpredictable results. | 353 | * still in progress will return unpredictable results. |
@@ -340,8 +358,8 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) | |||
340 | */ | 358 | */ |
341 | static __inline__ int get_dma_residue(unsigned int dmanr) | 359 | static __inline__ int get_dma_residue(unsigned int dmanr) |
342 | { | 360 | { |
343 | unsigned int io_port = (dmanr <= 3) ? | 361 | unsigned int io_port = (dmanr <= 3) |
344 | ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE | 362 | ? ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE |
345 | : ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE; | 363 | : ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE; |
346 | 364 | ||
347 | /* using short to get 16-bit wrap around */ | 365 | /* using short to get 16-bit wrap around */ |
@@ -352,7 +370,6 @@ static __inline__ int get_dma_residue(unsigned int dmanr) | |||
352 | 370 | ||
353 | return (dmanr <= 3 || dmanr == SND_DMA1 || dmanr == SND_DMA2) | 371 | return (dmanr <= 3 || dmanr == SND_DMA1 || dmanr == SND_DMA2) |
354 | ? count : (count << 1); | 372 | ? count : (count << 1); |
355 | |||
356 | } | 373 | } |
357 | 374 | ||
358 | /* These are in kernel/dma.c: */ | 375 | /* These are in kernel/dma.c: */ |
@@ -367,5 +384,7 @@ extern int isa_dma_bridge_buggy; | |||
367 | #else | 384 | #else |
368 | #define isa_dma_bridge_buggy (0) | 385 | #define isa_dma_bridge_buggy (0) |
369 | #endif | 386 | #endif |
370 | #endif /* _ASM_DMA_H */ | 387 | |
371 | #endif /* __KERNEL__ */ | 388 | #endif /* !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) */ |
389 | |||
390 | #endif /* _ASM_POWERPC_DMA_H */ | ||
diff --git a/include/asm-ppc64/elf.h b/include/asm-powerpc/elf.h index c919a89343db..d22b10021b5d 100644 --- a/include/asm-ppc64/elf.h +++ b/include/asm-powerpc/elf.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef __PPC64_ELF_H | 1 | #ifndef _ASM_POWERPC_ELF_H |
2 | #define __PPC64_ELF_H | 2 | #define _ASM_POWERPC_ELF_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <asm/ptrace.h> | 5 | #include <asm/ptrace.h> |
6 | #include <asm/cputable.h> | 6 | #include <asm/cputable.h> |
7 | #include <asm/auxvec.h> | 7 | #include <asm/auxvec.h> |
8 | #include <asm/page.h> | ||
8 | 9 | ||
9 | /* PowerPC relocations defined by the ABIs */ | 10 | /* PowerPC relocations defined by the ABIs */ |
10 | #define R_PPC_NONE 0 | 11 | #define R_PPC_NONE 0 |
@@ -75,7 +76,7 @@ | |||
75 | #define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ | 76 | #define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ |
76 | #define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ | 77 | #define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ |
77 | 78 | ||
78 | /* Keep this the last entry. */ | 79 | /* keep this the last entry. */ |
79 | #define R_PPC_NUM 95 | 80 | #define R_PPC_NUM 95 |
80 | 81 | ||
81 | /* | 82 | /* |
@@ -90,8 +91,6 @@ | |||
90 | 91 | ||
91 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ | 92 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ |
92 | #define ELF_NFPREG 33 /* includes fpscr */ | 93 | #define ELF_NFPREG 33 /* includes fpscr */ |
93 | #define ELF_NVRREG32 33 /* includes vscr & vrsave stuffed together */ | ||
94 | #define ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */ | ||
95 | 94 | ||
96 | typedef unsigned long elf_greg_t64; | 95 | typedef unsigned long elf_greg_t64; |
97 | typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG]; | 96 | typedef elf_greg_t64 elf_gregset_t64[ELF_NGREG]; |
@@ -100,8 +99,21 @@ typedef unsigned int elf_greg_t32; | |||
100 | typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG]; | 99 | typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG]; |
101 | 100 | ||
102 | /* | 101 | /* |
103 | * These are used to set parameters in the core dumps. | 102 | * ELF_ARCH, CLASS, and DATA are used to set parameters in the core dumps. |
104 | */ | 103 | */ |
104 | #ifdef __powerpc64__ | ||
105 | # define ELF_NVRREG32 33 /* includes vscr & vrsave stuffed together */ | ||
106 | # define ELF_NVRREG 34 /* includes vscr & vrsave in split vectors */ | ||
107 | # define ELF_GREG_TYPE elf_greg_t64 | ||
108 | #else | ||
109 | # define ELF_NEVRREG 34 /* includes acc (as 2) */ | ||
110 | # define ELF_NVRREG 33 /* includes vscr */ | ||
111 | # define ELF_GREG_TYPE elf_greg_t32 | ||
112 | # define ELF_ARCH EM_PPC | ||
113 | # define ELF_CLASS ELFCLASS32 | ||
114 | # define ELF_DATA ELFDATA2MSB | ||
115 | #endif /* __powerpc64__ */ | ||
116 | |||
105 | #ifndef ELF_ARCH | 117 | #ifndef ELF_ARCH |
106 | # define ELF_ARCH EM_PPC64 | 118 | # define ELF_ARCH EM_PPC64 |
107 | # define ELF_CLASS ELFCLASS64 | 119 | # define ELF_CLASS ELFCLASS64 |
@@ -114,8 +126,9 @@ typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG]; | |||
114 | typedef elf_greg_t32 elf_greg_t; | 126 | typedef elf_greg_t32 elf_greg_t; |
115 | typedef elf_gregset_t32 elf_gregset_t; | 127 | typedef elf_gregset_t32 elf_gregset_t; |
116 | # define elf_addr_t u32 | 128 | # define elf_addr_t u32 |
117 | #endif | 129 | #endif /* ELF_ARCH */ |
118 | 130 | ||
131 | /* Floating point registers */ | ||
119 | typedef double elf_fpreg_t; | 132 | typedef double elf_fpreg_t; |
120 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | 133 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; |
121 | 134 | ||
@@ -125,7 +138,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |||
125 | * The entry with index 32 contains the vscr as the last word (offset 12) | 138 | * The entry with index 32 contains the vscr as the last word (offset 12) |
126 | * within the quadword. This allows the vscr to be stored as either a | 139 | * within the quadword. This allows the vscr to be stored as either a |
127 | * quadword (since it must be copied via a vector register to/from storage) | 140 | * quadword (since it must be copied via a vector register to/from storage) |
128 | * or as a word. The entry with index 33 contains the vrsave as the first | 141 | * or as a word. |
142 | * | ||
143 | * 64-bit kernel notes: The entry at index 33 contains the vrsave as the first | ||
129 | * word (offset 0) within the quadword. | 144 | * word (offset 0) within the quadword. |
130 | * | 145 | * |
131 | * This definition of the VMX state is compatible with the current PPC32 | 146 | * This definition of the VMX state is compatible with the current PPC32 |
@@ -138,7 +153,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |||
138 | */ | 153 | */ |
139 | typedef __vector128 elf_vrreg_t; | 154 | typedef __vector128 elf_vrreg_t; |
140 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; | 155 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; |
156 | #ifdef __powerpc64__ | ||
141 | typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; | 157 | typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; |
158 | #endif | ||
142 | 159 | ||
143 | /* | 160 | /* |
144 | * This is used to ensure we don't load something for the wrong architecture. | 161 | * This is used to ensure we don't load something for the wrong architecture. |
@@ -146,7 +163,7 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; | |||
146 | #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) | 163 | #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) |
147 | 164 | ||
148 | #define USE_ELF_CORE_DUMP | 165 | #define USE_ELF_CORE_DUMP |
149 | #define ELF_EXEC_PAGESIZE 4096 | 166 | #define ELF_EXEC_PAGESIZE PAGE_SIZE |
150 | 167 | ||
151 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | 168 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical |
152 | use of this is to invoke "./ld.so someprog" to test out a new version of | 169 | use of this is to invoke "./ld.so someprog" to test out a new version of |
@@ -158,26 +175,30 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; | |||
158 | #ifdef __KERNEL__ | 175 | #ifdef __KERNEL__ |
159 | 176 | ||
160 | /* Common routine for both 32-bit and 64-bit processes */ | 177 | /* Common routine for both 32-bit and 64-bit processes */ |
161 | static inline void ppc64_elf_core_copy_regs(elf_gregset_t elf_regs, | 178 | static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, |
162 | struct pt_regs *regs) | 179 | struct pt_regs *regs) |
163 | { | 180 | { |
164 | int i; | 181 | int i; |
165 | int gprs = sizeof(struct pt_regs)/sizeof(elf_greg_t64); | 182 | int gprs = sizeof(struct pt_regs)/sizeof(ELF_GREG_TYPE); |
166 | 183 | ||
167 | if (gprs > ELF_NGREG) | 184 | if (gprs > ELF_NGREG) |
168 | gprs = ELF_NGREG; | 185 | gprs = ELF_NGREG; |
169 | 186 | ||
170 | for (i=0; i < gprs; i++) | 187 | for (i=0; i < gprs; i++) |
171 | elf_regs[i] = (elf_greg_t)((elf_greg_t64 *)regs)[i]; | 188 | elf_regs[i] = (elf_greg_t)((ELF_GREG_TYPE *)regs)[i]; |
189 | |||
190 | memset((char *)(elf_regs) + sizeof(struct pt_regs), 0, \ | ||
191 | sizeof(elf_gregset_t) - sizeof(struct pt_regs)); | ||
192 | |||
172 | } | 193 | } |
173 | #define ELF_CORE_COPY_REGS(gregs, regs) ppc64_elf_core_copy_regs(gregs, regs); | 194 | #define ELF_CORE_COPY_REGS(gregs, regs) ppc_elf_core_copy_regs(gregs, regs); |
174 | 195 | ||
175 | static inline int dump_task_regs(struct task_struct *tsk, | 196 | static inline int dump_task_regs(struct task_struct *tsk, |
176 | elf_gregset_t *elf_regs) | 197 | elf_gregset_t *elf_regs) |
177 | { | 198 | { |
178 | struct pt_regs *regs = tsk->thread.regs; | 199 | struct pt_regs *regs = tsk->thread.regs; |
179 | if (regs) | 200 | if (regs) |
180 | ppc64_elf_core_copy_regs(*elf_regs, regs); | 201 | ppc_elf_core_copy_regs(*elf_regs, regs); |
181 | 202 | ||
182 | return 1; | 203 | return 1; |
183 | } | 204 | } |
@@ -186,15 +207,17 @@ static inline int dump_task_regs(struct task_struct *tsk, | |||
186 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | 207 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); |
187 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) | 208 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) |
188 | 209 | ||
189 | /* XXX Should we define the XFPREGS using altivec ??? */ | 210 | #endif /* __KERNEL__ */ |
190 | |||
191 | #endif | ||
192 | 211 | ||
193 | /* This yields a mask that user programs can use to figure out what | 212 | /* ELF_HWCAP yields a mask that user programs can use to figure out what |
194 | instruction set this cpu supports. This could be done in userspace, | 213 | instruction set this cpu supports. This could be done in userspace, |
195 | but it's not easy, and we've already done it here. */ | 214 | but it's not easy, and we've already done it here. */ |
196 | 215 | # define ELF_HWCAP (cur_cpu_spec->cpu_user_features) | |
197 | #define ELF_HWCAP (cur_cpu_spec->cpu_user_features) | 216 | #ifdef __powerpc64__ |
217 | # define ELF_PLAT_INIT(_r, load_addr) do { \ | ||
218 | _r->gpr[2] = load_addr; \ | ||
219 | } while (0) | ||
220 | #endif /* __powerpc64__ */ | ||
198 | 221 | ||
199 | /* This yields a string that ld.so will use to load implementation | 222 | /* This yields a string that ld.so will use to load implementation |
200 | specific libraries for optimization. This is more specific in | 223 | specific libraries for optimization. This is more specific in |
@@ -205,14 +228,10 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | |||
205 | 228 | ||
206 | #define ELF_PLATFORM (NULL) | 229 | #define ELF_PLATFORM (NULL) |
207 | 230 | ||
208 | #define ELF_PLAT_INIT(_r, load_addr) do { \ | ||
209 | memset(_r->gpr, 0, sizeof(_r->gpr)); \ | ||
210 | _r->ctr = _r->link = _r->xer = _r->ccr = 0; \ | ||
211 | _r->gpr[2] = load_addr; \ | ||
212 | } while (0) | ||
213 | |||
214 | #ifdef __KERNEL__ | 231 | #ifdef __KERNEL__ |
215 | #define SET_PERSONALITY(ex, ibcs2) \ | 232 | |
233 | #ifdef __powerpc64__ | ||
234 | # define SET_PERSONALITY(ex, ibcs2) \ | ||
216 | do { \ | 235 | do { \ |
217 | unsigned long new_flags = 0; \ | 236 | unsigned long new_flags = 0; \ |
218 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ | 237 | if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ |
@@ -225,7 +244,6 @@ do { \ | |||
225 | if (personality(current->personality) != PER_LINUX32) \ | 244 | if (personality(current->personality) != PER_LINUX32) \ |
226 | set_personality(PER_LINUX); \ | 245 | set_personality(PER_LINUX); \ |
227 | } while (0) | 246 | } while (0) |
228 | |||
229 | /* | 247 | /* |
230 | * An executable for which elf_read_implies_exec() returns TRUE will | 248 | * An executable for which elf_read_implies_exec() returns TRUE will |
231 | * have the READ_IMPLIES_EXEC personality flag set automatically. This | 249 | * have the READ_IMPLIES_EXEC personality flag set automatically. This |
@@ -233,19 +251,26 @@ do { \ | |||
233 | * the 64bit ABI has never had these issues dont enable the workaround | 251 | * the 64bit ABI has never had these issues dont enable the workaround |
234 | * even if we have an executable stack. | 252 | * even if we have an executable stack. |
235 | */ | 253 | */ |
236 | #define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ | 254 | # define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ |
237 | (exec_stk != EXSTACK_DISABLE_X) : 0) | 255 | (exec_stk != EXSTACK_DISABLE_X) : 0) |
256 | #else | ||
257 | # define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) | ||
258 | #endif /* __powerpc64__ */ | ||
238 | 259 | ||
239 | #endif | 260 | #endif /* __KERNEL__ */ |
240 | 261 | ||
241 | extern int dcache_bsize; | 262 | extern int dcache_bsize; |
242 | extern int icache_bsize; | 263 | extern int icache_bsize; |
243 | extern int ucache_bsize; | 264 | extern int ucache_bsize; |
244 | 265 | ||
245 | /* We do have an arch_setup_additional_pages for vDSO matters */ | 266 | #ifdef __powerpc64__ |
246 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES | ||
247 | struct linux_binprm; | 267 | struct linux_binprm; |
268 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES /* vDSO has arch_setup_additional_pages */ | ||
248 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack); | 269 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack); |
270 | #define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); | ||
271 | #else | ||
272 | #define VDSO_AUX_ENT(a,b) | ||
273 | #endif /* __powerpc64__ */ | ||
249 | 274 | ||
250 | /* | 275 | /* |
251 | * The requirements here are: | 276 | * The requirements here are: |
@@ -265,9 +290,8 @@ do { \ | |||
265 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ | 290 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ |
266 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ | 291 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ |
267 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ | 292 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ |
268 | /* vDSO base */ \ | 293 | VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->thread.vdso_base) \ |
269 | NEW_AUX_ENT(AT_SYSINFO_EHDR, current->thread.vdso_base); \ | 294 | } while (0) |
270 | } while (0) | ||
271 | 295 | ||
272 | /* PowerPC64 relocations defined by the ABIs */ | 296 | /* PowerPC64 relocations defined by the ABIs */ |
273 | #define R_PPC64_NONE R_PPC_NONE | 297 | #define R_PPC64_NONE R_PPC_NONE |
@@ -384,4 +408,4 @@ do { \ | |||
384 | /* Keep this the last entry. */ | 408 | /* Keep this the last entry. */ |
385 | #define R_PPC64_NUM 107 | 409 | #define R_PPC64_NUM 107 |
386 | 410 | ||
387 | #endif /* __PPC64_ELF_H */ | 411 | #endif /* _ASM_POWERPC_ELF_H */ |
diff --git a/include/asm-ppc64/firmware.h b/include/asm-powerpc/firmware.h index 22bb85cf60af..806c142ae9ea 100644 --- a/include/asm-ppc64/firmware.h +++ b/include/asm-powerpc/firmware.h | |||
@@ -1,8 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-ppc64/firmware.h | ||
3 | * | ||
4 | * Extracted from include/asm-ppc64/cputable.h | ||
5 | * | ||
6 | * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) | 2 | * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) |
7 | * | 3 | * |
8 | * Modifications for ppc64: | 4 | * Modifications for ppc64: |
@@ -13,8 +9,8 @@ | |||
13 | * as published by the Free Software Foundation; either version | 9 | * as published by the Free Software Foundation; either version |
14 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
15 | */ | 11 | */ |
16 | #ifndef __ASM_PPC_FIRMWARE_H | 12 | #ifndef __ASM_POWERPC_FIRMWARE_H |
17 | #define __ASM_PPC_FIRMWARE_H | 13 | #define __ASM_POWERPC_FIRMWARE_H |
18 | 14 | ||
19 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
20 | 16 | ||
@@ -98,4 +94,4 @@ extern firmware_feature_t firmware_features_table[]; | |||
98 | 94 | ||
99 | #endif /* __ASSEMBLY__ */ | 95 | #endif /* __ASSEMBLY__ */ |
100 | #endif /* __KERNEL__ */ | 96 | #endif /* __KERNEL__ */ |
101 | #endif /* __ASM_PPC_FIRMWARE_H */ | 97 | #endif /* __ASM_POWERPC_FIRMWARE_H */ |
diff --git a/include/asm-powerpc/grackle.h b/include/asm-powerpc/grackle.h new file mode 100644 index 000000000000..563c7a5e64c9 --- /dev/null +++ b/include/asm-powerpc/grackle.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Functions for setting up and using a MPC106 northbridge | ||
3 | */ | ||
4 | |||
5 | #include <asm/pci-bridge.h> | ||
6 | |||
7 | extern void setup_grackle(struct pci_controller *hose); | ||
diff --git a/include/asm-ppc/hardirq.h b/include/asm-powerpc/hardirq.h index 94f1411b1a93..3b3e3b49ec12 100644 --- a/include/asm-ppc/hardirq.h +++ b/include/asm-powerpc/hardirq.h | |||
@@ -1,11 +1,8 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifndef _ASM_POWERPC_HARDIRQ_H |
2 | #ifndef __ASM_HARDIRQ_H | 2 | #define _ASM_POWERPC_HARDIRQ_H |
3 | #define __ASM_HARDIRQ_H | ||
4 | 3 | ||
5 | #include <linux/config.h> | ||
6 | #include <linux/cache.h> | ||
7 | #include <linux/smp_lock.h> | ||
8 | #include <asm/irq.h> | 4 | #include <asm/irq.h> |
5 | #include <asm/bug.h> | ||
9 | 6 | ||
10 | /* The __last_jiffy_stamp field is needed to ensure that no decrementer | 7 | /* The __last_jiffy_stamp field is needed to ensure that no decrementer |
11 | * interrupt is lost on SMP machines. Since on most CPUs it is in the same | 8 | * interrupt is lost on SMP machines. Since on most CPUs it is in the same |
@@ -13,7 +10,7 @@ | |||
13 | * for uniformity. | 10 | * for uniformity. |
14 | */ | 11 | */ |
15 | typedef struct { | 12 | typedef struct { |
16 | unsigned long __softirq_pending; /* set_bit is used on this */ | 13 | unsigned int __softirq_pending; /* set_bit is used on this */ |
17 | unsigned int __last_jiffy_stamp; | 14 | unsigned int __last_jiffy_stamp; |
18 | } ____cacheline_aligned irq_cpustat_t; | 15 | } ____cacheline_aligned irq_cpustat_t; |
19 | 16 | ||
@@ -27,5 +24,4 @@ static inline void ack_bad_irq(int irq) | |||
27 | BUG(); | 24 | BUG(); |
28 | } | 25 | } |
29 | 26 | ||
30 | #endif /* __ASM_HARDIRQ_H */ | 27 | #endif /* _ASM_POWERPC_HARDIRQ_H */ |
31 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/heathrow.h b/include/asm-powerpc/heathrow.h index 22ac179856b9..22ac179856b9 100644 --- a/include/asm-ppc/heathrow.h +++ b/include/asm-powerpc/heathrow.h | |||
diff --git a/include/asm-ppc64/hw_irq.h b/include/asm-powerpc/hw_irq.h index baea40e695ec..c37b31b96337 100644 --- a/include/asm-ppc64/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h | |||
@@ -1,22 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> | 2 | * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> |
3 | * | ||
4 | * Use inline IRQs where possible - Anton Blanchard <anton@au.ibm.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | 3 | */ |
4 | #ifndef _ASM_POWERPC_HW_IRQ_H | ||
5 | #define _ASM_POWERPC_HW_IRQ_H | ||
6 | |||
11 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
12 | #ifndef _PPC64_HW_IRQ_H | ||
13 | #define _PPC64_HW_IRQ_H | ||
14 | 8 | ||
15 | #include <linux/config.h> | 9 | #include <linux/config.h> |
16 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
17 | #include <asm/irq.h> | 11 | #include <asm/ptrace.h> |
12 | #include <asm/processor.h> | ||
18 | 13 | ||
19 | int timer_interrupt(struct pt_regs *); | 14 | extern void timer_interrupt(struct pt_regs *); |
20 | extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); | 15 | extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); |
21 | 16 | ||
22 | #ifdef CONFIG_PPC_ISERIES | 17 | #ifdef CONFIG_PPC_ISERIES |
@@ -33,45 +28,60 @@ extern void local_irq_restore(unsigned long); | |||
33 | 28 | ||
34 | #else | 29 | #else |
35 | 30 | ||
36 | #define local_save_flags(flags) ((flags) = mfmsr()) | 31 | #if defined(CONFIG_BOOKE) |
32 | #define SET_MSR_EE(x) mtmsr(x) | ||
33 | #define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory") | ||
34 | #elif defined(__powerpc64__) | ||
35 | #define SET_MSR_EE(x) __mtmsrd(x, 1) | ||
37 | #define local_irq_restore(flags) do { \ | 36 | #define local_irq_restore(flags) do { \ |
38 | __asm__ __volatile__("": : :"memory"); \ | 37 | __asm__ __volatile__("": : :"memory"); \ |
39 | __mtmsrd((flags), 1); \ | 38 | __mtmsrd((flags), 1); \ |
40 | } while(0) | 39 | } while(0) |
40 | #else | ||
41 | #define SET_MSR_EE(x) mtmsr(x) | ||
42 | #define local_irq_restore(flags) mtmsr(flags) | ||
43 | #endif | ||
41 | 44 | ||
42 | static inline void local_irq_disable(void) | 45 | static inline void local_irq_disable(void) |
43 | { | 46 | { |
47 | #ifdef CONFIG_BOOKE | ||
48 | __asm__ __volatile__("wrteei 0": : :"memory"); | ||
49 | #else | ||
44 | unsigned long msr; | 50 | unsigned long msr; |
45 | msr = mfmsr(); | ||
46 | __mtmsrd(msr & ~MSR_EE, 1); | ||
47 | __asm__ __volatile__("": : :"memory"); | 51 | __asm__ __volatile__("": : :"memory"); |
52 | msr = mfmsr(); | ||
53 | SET_MSR_EE(msr & ~MSR_EE); | ||
54 | #endif | ||
48 | } | 55 | } |
49 | 56 | ||
50 | static inline void local_irq_enable(void) | 57 | static inline void local_irq_enable(void) |
51 | { | 58 | { |
59 | #ifdef CONFIG_BOOKE | ||
60 | __asm__ __volatile__("wrteei 1": : :"memory"); | ||
61 | #else | ||
52 | unsigned long msr; | 62 | unsigned long msr; |
53 | __asm__ __volatile__("": : :"memory"); | 63 | __asm__ __volatile__("": : :"memory"); |
54 | msr = mfmsr(); | 64 | msr = mfmsr(); |
55 | __mtmsrd(msr | MSR_EE, 1); | 65 | SET_MSR_EE(msr | MSR_EE); |
66 | #endif | ||
56 | } | 67 | } |
57 | 68 | ||
58 | static inline void __do_save_and_cli(unsigned long *flags) | 69 | static inline void local_irq_save_ptr(unsigned long *flags) |
59 | { | 70 | { |
60 | unsigned long msr; | 71 | unsigned long msr; |
61 | msr = mfmsr(); | 72 | msr = mfmsr(); |
62 | *flags = msr; | 73 | *flags = msr; |
63 | __mtmsrd(msr & ~MSR_EE, 1); | 74 | #ifdef CONFIG_BOOKE |
75 | __asm__ __volatile__("wrteei 0": : :"memory"); | ||
76 | #else | ||
77 | SET_MSR_EE(msr & ~MSR_EE); | ||
78 | #endif | ||
64 | __asm__ __volatile__("": : :"memory"); | 79 | __asm__ __volatile__("": : :"memory"); |
65 | } | 80 | } |
66 | 81 | ||
67 | #define local_irq_save(flags) __do_save_and_cli(&flags) | 82 | #define local_save_flags(flags) ((flags) = mfmsr()) |
68 | 83 | #define local_irq_save(flags) local_irq_save_ptr(&flags) | |
69 | #define irqs_disabled() \ | 84 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) |
70 | ({ \ | ||
71 | unsigned long flags; \ | ||
72 | local_save_flags(flags); \ | ||
73 | !(flags & MSR_EE); \ | ||
74 | }) | ||
75 | 85 | ||
76 | #endif /* CONFIG_PPC_ISERIES */ | 86 | #endif /* CONFIG_PPC_ISERIES */ |
77 | 87 | ||
@@ -99,6 +109,6 @@ static inline void __do_save_and_cli(unsigned long *flags) | |||
99 | */ | 109 | */ |
100 | struct hw_interrupt_type; | 110 | struct hw_interrupt_type; |
101 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | 111 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} |
102 | 112 | ||
103 | #endif /* _PPC64_HW_IRQ_H */ | 113 | #endif /* __KERNEL__ */ |
104 | #endif /* __KERNEL__ */ | 114 | #endif /* _ASM_POWERPC_HW_IRQ_H */ |
diff --git a/include/asm-powerpc/i8259.h b/include/asm-powerpc/i8259.h new file mode 100644 index 000000000000..fc4bfee124d7 --- /dev/null +++ b/include/asm-powerpc/i8259.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _ASM_POWERPC_I8259_H | ||
2 | #define _ASM_POWERPC_I8259_H | ||
3 | |||
4 | #include <linux/irq.h> | ||
5 | |||
6 | extern struct hw_interrupt_type i8259_pic; | ||
7 | |||
8 | extern void i8259_init(unsigned long intack_addr, int offset); | ||
9 | extern int i8259_irq(struct pt_regs *regs); | ||
10 | extern int i8259_irq_cascade(struct pt_regs *regs, void *unused); | ||
11 | |||
12 | #endif /* _ASM_POWERPC_I8259_H */ | ||
diff --git a/include/asm-ppc64/iommu.h b/include/asm-powerpc/iommu.h index c2f3b6e8a42f..9d91bdd667ae 100644 --- a/include/asm-ppc64/iommu.h +++ b/include/asm-powerpc/iommu.h | |||
@@ -1,5 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * iommu.h | ||
3 | * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation | 2 | * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation |
4 | * Rewrite, cleanup: | 3 | * Rewrite, cleanup: |
5 | * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation | 4 | * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation |
@@ -22,6 +21,7 @@ | |||
22 | #ifndef _ASM_IOMMU_H | 21 | #ifndef _ASM_IOMMU_H |
23 | #define _ASM_IOMMU_H | 22 | #define _ASM_IOMMU_H |
24 | 23 | ||
24 | #include <linux/config.h> | ||
25 | #include <asm/types.h> | 25 | #include <asm/types.h> |
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
@@ -29,44 +29,11 @@ | |||
29 | 29 | ||
30 | /* | 30 | /* |
31 | * IOMAP_MAX_ORDER defines the largest contiguous block | 31 | * IOMAP_MAX_ORDER defines the largest contiguous block |
32 | * of dma (tce) space we can get. IOMAP_MAX_ORDER = 13 | 32 | * of dma space we can get. IOMAP_MAX_ORDER = 13 |
33 | * allows up to 2**12 pages (4096 * 4096) = 16 MB | 33 | * allows up to 2**12 pages (4096 * 4096) = 16 MB |
34 | */ | 34 | */ |
35 | #define IOMAP_MAX_ORDER 13 | 35 | #define IOMAP_MAX_ORDER 13 |
36 | 36 | ||
37 | /* | ||
38 | * Tces come in two formats, one for the virtual bus and a different | ||
39 | * format for PCI | ||
40 | */ | ||
41 | #define TCE_VB 0 | ||
42 | #define TCE_PCI 1 | ||
43 | |||
44 | /* tce_entry | ||
45 | * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's | ||
46 | * abstracted so layout is irrelevant. | ||
47 | */ | ||
48 | union tce_entry { | ||
49 | unsigned long te_word; | ||
50 | struct { | ||
51 | unsigned int tb_cacheBits :6; /* Cache hash bits - not used */ | ||
52 | unsigned int tb_rsvd :6; | ||
53 | unsigned long tb_rpn :40; /* Real page number */ | ||
54 | unsigned int tb_valid :1; /* Tce is valid (vb only) */ | ||
55 | unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */ | ||
56 | unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */ | ||
57 | unsigned int tb_pciwr :1; /* Write allowed (pci only) */ | ||
58 | unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */ | ||
59 | } te_bits; | ||
60 | #define te_cacheBits te_bits.tb_cacheBits | ||
61 | #define te_rpn te_bits.tb_rpn | ||
62 | #define te_valid te_bits.tb_valid | ||
63 | #define te_allio te_bits.tb_allio | ||
64 | #define te_lpindex te_bits.tb_lpindex | ||
65 | #define te_pciwr te_bits.tb_pciwr | ||
66 | #define te_rdwr te_bits.tb_rdwr | ||
67 | }; | ||
68 | |||
69 | |||
70 | struct iommu_table { | 37 | struct iommu_table { |
71 | unsigned long it_busno; /* Bus number this table belongs to */ | 38 | unsigned long it_busno; /* Bus number this table belongs to */ |
72 | unsigned long it_size; /* Size of iommu table in entries */ | 39 | unsigned long it_size; /* Size of iommu table in entries */ |
@@ -83,6 +50,7 @@ struct iommu_table { | |||
83 | }; | 50 | }; |
84 | 51 | ||
85 | struct scatterlist; | 52 | struct scatterlist; |
53 | struct device_node; | ||
86 | 54 | ||
87 | #ifdef CONFIG_PPC_MULTIPLATFORM | 55 | #ifdef CONFIG_PPC_MULTIPLATFORM |
88 | 56 | ||
@@ -104,9 +72,8 @@ extern void iommu_devnode_init_pSeries(struct device_node *dn); | |||
104 | 72 | ||
105 | #ifdef CONFIG_PPC_ISERIES | 73 | #ifdef CONFIG_PPC_ISERIES |
106 | 74 | ||
107 | struct iSeries_Device_Node; | ||
108 | /* Creates table for an individual device node */ | 75 | /* Creates table for an individual device node */ |
109 | extern void iommu_devnode_init_iSeries(struct iSeries_Device_Node *dn); | 76 | extern void iommu_devnode_init_iSeries(struct device_node *dn); |
110 | 77 | ||
111 | #endif /* CONFIG_PPC_ISERIES */ | 78 | #endif /* CONFIG_PPC_ISERIES */ |
112 | 79 | ||
diff --git a/include/asm-ppc/irq.h b/include/asm-powerpc/irq.h index bd9674807f05..c7c3f912a3c2 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -1,11 +1,23 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifdef __KERNEL__ |
2 | #ifndef _ASM_IRQ_H | 2 | #ifndef _ASM_POWERPC_IRQ_H |
3 | #define _ASM_IRQ_H | 3 | #define _ASM_POWERPC_IRQ_H |
4 | |||
5 | /* | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
4 | 11 | ||
5 | #include <linux/config.h> | 12 | #include <linux/config.h> |
6 | #include <asm/machdep.h> /* ppc_md */ | 13 | #include <linux/threads.h> |
14 | |||
15 | #include <asm/types.h> | ||
7 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
8 | 17 | ||
18 | /* this number is used when no interrupt has been assigned */ | ||
19 | #define NO_IRQ (-1) | ||
20 | |||
9 | /* | 21 | /* |
10 | * These constants are used for passing information about interrupt | 22 | * These constants are used for passing information about interrupt |
11 | * signal polarity and level/edge sensing to the low-level PIC chip | 23 | * signal polarity and level/edge sensing to the low-level PIC chip |
@@ -24,6 +36,50 @@ | |||
24 | */ | 36 | */ |
25 | #define ARCH_HAS_IRQ_PER_CPU | 37 | #define ARCH_HAS_IRQ_PER_CPU |
26 | 38 | ||
39 | #define get_irq_desc(irq) (&irq_desc[(irq)]) | ||
40 | |||
41 | /* Define a way to iterate across irqs. */ | ||
42 | #define for_each_irq(i) \ | ||
43 | for ((i) = 0; (i) < NR_IRQS; ++(i)) | ||
44 | |||
45 | #ifdef CONFIG_PPC64 | ||
46 | |||
47 | /* | ||
48 | * Maximum number of interrupt sources that we can handle. | ||
49 | */ | ||
50 | #define NR_IRQS 512 | ||
51 | |||
52 | /* Interrupt numbers are virtual in case they are sparsely | ||
53 | * distributed by the hardware. | ||
54 | */ | ||
55 | extern unsigned int virt_irq_to_real_map[NR_IRQS]; | ||
56 | |||
57 | /* Create a mapping for a real_irq if it doesn't already exist. | ||
58 | * Return the virtual irq as a convenience. | ||
59 | */ | ||
60 | int virt_irq_create_mapping(unsigned int real_irq); | ||
61 | void virt_irq_init(void); | ||
62 | |||
63 | static inline unsigned int virt_irq_to_real(unsigned int virt_irq) | ||
64 | { | ||
65 | return virt_irq_to_real_map[virt_irq]; | ||
66 | } | ||
67 | |||
68 | extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq); | ||
69 | |||
70 | /* | ||
71 | * List of interrupt controllers. | ||
72 | */ | ||
73 | #define IC_INVALID 0 | ||
74 | #define IC_OPEN_PIC 1 | ||
75 | #define IC_PPC_XIC 2 | ||
76 | #define IC_BPA_IIC 3 | ||
77 | #define IC_ISERIES 4 | ||
78 | |||
79 | extern u64 ppc64_interrupt_controller; | ||
80 | |||
81 | #else /* 32-bit */ | ||
82 | |||
27 | #if defined(CONFIG_40x) | 83 | #if defined(CONFIG_40x) |
28 | #include <asm/ibm4xx.h> | 84 | #include <asm/ibm4xx.h> |
29 | 85 | ||
@@ -66,11 +122,6 @@ | |||
66 | #define NR_UIC_IRQS UIC_WIDTH | 122 | #define NR_UIC_IRQS UIC_WIDTH |
67 | #define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS) | 123 | #define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS) |
68 | #endif | 124 | #endif |
69 | static __inline__ int | ||
70 | irq_canonicalize(int irq) | ||
71 | { | ||
72 | return (irq); | ||
73 | } | ||
74 | 125 | ||
75 | #elif defined(CONFIG_44x) | 126 | #elif defined(CONFIG_44x) |
76 | #include <asm/ibm44x.h> | 127 | #include <asm/ibm44x.h> |
@@ -78,12 +129,6 @@ irq_canonicalize(int irq) | |||
78 | #define NR_UIC_IRQS 32 | 129 | #define NR_UIC_IRQS 32 |
79 | #define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS) | 130 | #define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS) |
80 | 131 | ||
81 | static __inline__ int | ||
82 | irq_canonicalize(int irq) | ||
83 | { | ||
84 | return (irq); | ||
85 | } | ||
86 | |||
87 | #elif defined(CONFIG_8xx) | 132 | #elif defined(CONFIG_8xx) |
88 | 133 | ||
89 | /* Now include the board configuration specific associations. | 134 | /* Now include the board configuration specific associations. |
@@ -170,20 +215,9 @@ irq_canonicalize(int irq) | |||
170 | */ | 215 | */ |
171 | #define mk_int_int_mask(IL) (1 << (7 - (IL/2))) | 216 | #define mk_int_int_mask(IL) (1 << (7 - (IL/2))) |
172 | 217 | ||
173 | /* always the same on 8xx -- Cort */ | ||
174 | static __inline__ int irq_canonicalize(int irq) | ||
175 | { | ||
176 | return irq; | ||
177 | } | ||
178 | |||
179 | #elif defined(CONFIG_83xx) | 218 | #elif defined(CONFIG_83xx) |
180 | #include <asm/mpc83xx.h> | 219 | #include <asm/mpc83xx.h> |
181 | 220 | ||
182 | static __inline__ int irq_canonicalize(int irq) | ||
183 | { | ||
184 | return irq; | ||
185 | } | ||
186 | |||
187 | #define NR_IRQS (NR_IPIC_INTS) | 221 | #define NR_IRQS (NR_IPIC_INTS) |
188 | 222 | ||
189 | #elif defined(CONFIG_85xx) | 223 | #elif defined(CONFIG_85xx) |
@@ -307,17 +341,13 @@ static __inline__ int irq_canonicalize(int irq) | |||
307 | #define SIU_INT_PC1 ((uint)0x3e+CPM_IRQ_OFFSET) | 341 | #define SIU_INT_PC1 ((uint)0x3e+CPM_IRQ_OFFSET) |
308 | #define SIU_INT_PC0 ((uint)0x3f+CPM_IRQ_OFFSET) | 342 | #define SIU_INT_PC0 ((uint)0x3f+CPM_IRQ_OFFSET) |
309 | 343 | ||
310 | static __inline__ int irq_canonicalize(int irq) | ||
311 | { | ||
312 | return irq; | ||
313 | } | ||
314 | |||
315 | #else /* CONFIG_40x + CONFIG_8xx */ | 344 | #else /* CONFIG_40x + CONFIG_8xx */ |
316 | /* | 345 | /* |
317 | * this is the # irq's for all ppc arch's (pmac/chrp/prep) | 346 | * this is the # irq's for all ppc arch's (pmac/chrp/prep) |
318 | * so it is the max of them all | 347 | * so it is the max of them all |
319 | */ | 348 | */ |
320 | #define NR_IRQS 256 | 349 | #define NR_IRQS 256 |
350 | #define __DO_IRQ_CANON 1 | ||
321 | 351 | ||
322 | #ifndef CONFIG_8260 | 352 | #ifndef CONFIG_8260 |
323 | 353 | ||
@@ -394,25 +424,81 @@ static __inline__ int irq_canonicalize(int irq) | |||
394 | 424 | ||
395 | #endif /* CONFIG_8260 */ | 425 | #endif /* CONFIG_8260 */ |
396 | 426 | ||
427 | #endif | ||
428 | |||
429 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | ||
430 | /* pedantic: these are long because they are used with set_bit --RR */ | ||
431 | extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | ||
432 | extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; | ||
433 | extern atomic_t ppc_n_lost_interrupts; | ||
434 | |||
435 | #define virt_irq_create_mapping(x) (x) | ||
436 | |||
437 | #endif | ||
438 | |||
397 | /* | 439 | /* |
398 | * This gets called from serial.c, which is now used on | 440 | * Because many systems have two overlapping names spaces for |
399 | * powermacs as well as prep/chrp boxes. | 441 | * interrupts (ISA and XICS for example), and the ISA interrupts |
400 | * Prep and chrp both have cascaded 8259 PICs. | 442 | * have historically not been easy to renumber, we allow ISA |
443 | * interrupts to take values 0 - 15, and shift up the remaining | ||
444 | * interrupts by 0x10. | ||
401 | */ | 445 | */ |
446 | #define NUM_ISA_INTERRUPTS 0x10 | ||
447 | extern int __irq_offset_value; | ||
448 | |||
449 | static inline int irq_offset_up(int irq) | ||
450 | { | ||
451 | return(irq + __irq_offset_value); | ||
452 | } | ||
453 | |||
454 | static inline int irq_offset_down(int irq) | ||
455 | { | ||
456 | return(irq - __irq_offset_value); | ||
457 | } | ||
458 | |||
459 | static inline int irq_offset_value(void) | ||
460 | { | ||
461 | return __irq_offset_value; | ||
462 | } | ||
463 | |||
464 | #ifdef __DO_IRQ_CANON | ||
465 | extern int ppc_do_canonicalize_irqs; | ||
466 | #else | ||
467 | #define ppc_do_canonicalize_irqs 0 | ||
468 | #endif | ||
469 | |||
402 | static __inline__ int irq_canonicalize(int irq) | 470 | static __inline__ int irq_canonicalize(int irq) |
403 | { | 471 | { |
404 | if (ppc_md.irq_canonicalize) | 472 | if (ppc_do_canonicalize_irqs && irq == 2) |
405 | return ppc_md.irq_canonicalize(irq); | 473 | irq = 9; |
406 | return irq; | 474 | return irq; |
407 | } | 475 | } |
408 | 476 | ||
409 | #endif | 477 | extern int distribute_irqs; |
410 | 478 | ||
411 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | 479 | struct irqaction; |
412 | /* pedantic: these are long because they are used with set_bit --RR */ | 480 | struct pt_regs; |
413 | extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | 481 | |
414 | extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; | 482 | #ifdef CONFIG_IRQSTACKS |
415 | extern atomic_t ppc_n_lost_interrupts; | 483 | /* |
484 | * Per-cpu stacks for handling hard and soft interrupts. | ||
485 | */ | ||
486 | extern struct thread_info *hardirq_ctx[NR_CPUS]; | ||
487 | extern struct thread_info *softirq_ctx[NR_CPUS]; | ||
488 | |||
489 | extern void irq_ctx_init(void); | ||
490 | extern void call_do_softirq(struct thread_info *tp); | ||
491 | extern int call_handle_IRQ_event(int irq, struct pt_regs *regs, | ||
492 | struct irqaction *action, struct thread_info *tp); | ||
493 | |||
494 | #define __ARCH_HAS_DO_SOFTIRQ | ||
495 | |||
496 | #else | ||
497 | #define irq_ctx_init() | ||
498 | |||
499 | #endif /* CONFIG_IRQSTACKS */ | ||
500 | |||
501 | extern void do_IRQ(struct pt_regs *regs); | ||
416 | 502 | ||
417 | #endif /* _ASM_IRQ_H */ | 503 | #endif /* _ASM_IRQ_H */ |
418 | #endif /* __KERNEL__ */ | 504 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc64/kdebug.h b/include/asm-powerpc/kdebug.h index d383d161cf8d..9dcbac674811 100644 --- a/include/asm-ppc64/kdebug.h +++ b/include/asm-powerpc/kdebug.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_KDEBUG_H | 1 | #ifndef _ASM_POWERPC_KDEBUG_H |
2 | #define _PPC64_KDEBUG_H 1 | 2 | #define _ASM_POWERPC_KDEBUG_H |
3 | 3 | ||
4 | /* nearly identical to x86_64/i386 code */ | 4 | /* nearly identical to x86_64/i386 code */ |
5 | 5 | ||
@@ -21,7 +21,7 @@ struct die_args { | |||
21 | then free. | 21 | then free. |
22 | */ | 22 | */ |
23 | int register_die_notifier(struct notifier_block *nb); | 23 | int register_die_notifier(struct notifier_block *nb); |
24 | extern struct notifier_block *ppc64_die_chain; | 24 | extern struct notifier_block *powerpc_die_chain; |
25 | 25 | ||
26 | /* Grossly misnamed. */ | 26 | /* Grossly misnamed. */ |
27 | enum die_val { | 27 | enum die_val { |
@@ -30,14 +30,13 @@ enum die_val { | |||
30 | DIE_DABR_MATCH, | 30 | DIE_DABR_MATCH, |
31 | DIE_BPT, | 31 | DIE_BPT, |
32 | DIE_SSTEP, | 32 | DIE_SSTEP, |
33 | DIE_GPF, | ||
34 | DIE_PAGE_FAULT, | 33 | DIE_PAGE_FAULT, |
35 | }; | 34 | }; |
36 | 35 | ||
37 | static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) | 36 | static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) |
38 | { | 37 | { |
39 | struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; | 38 | struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; |
40 | return notifier_call_chain(&ppc64_die_chain, val, &args); | 39 | return notifier_call_chain(&powerpc_die_chain, val, &args); |
41 | } | 40 | } |
42 | 41 | ||
43 | #endif | 42 | #endif /* _ASM_POWERPC_KDEBUG_H */ |
diff --git a/include/asm-ppc/keylargo.h b/include/asm-powerpc/keylargo.h index a669a3f0f5a2..a669a3f0f5a2 100644 --- a/include/asm-ppc/keylargo.h +++ b/include/asm-powerpc/keylargo.h | |||
diff --git a/include/asm-powerpc/kmap_types.h b/include/asm-powerpc/kmap_types.h new file mode 100644 index 000000000000..b6bac6f61c16 --- /dev/null +++ b/include/asm-powerpc/kmap_types.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef _ASM_POWERPC_KMAP_TYPES_H | ||
2 | #define _ASM_POWERPC_KMAP_TYPES_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | enum km_type { | ||
14 | KM_BOUNCE_READ, | ||
15 | KM_SKB_SUNRPC_DATA, | ||
16 | KM_SKB_DATA_SOFTIRQ, | ||
17 | KM_USER0, | ||
18 | KM_USER1, | ||
19 | KM_BIO_SRC_IRQ, | ||
20 | KM_BIO_DST_IRQ, | ||
21 | KM_PTE0, | ||
22 | KM_PTE1, | ||
23 | KM_IRQ0, | ||
24 | KM_IRQ1, | ||
25 | KM_SOFTIRQ0, | ||
26 | KM_SOFTIRQ1, | ||
27 | KM_PPC_SYNC_PAGE, | ||
28 | KM_PPC_SYNC_ICACHE, | ||
29 | KM_TYPE_NR | ||
30 | }; | ||
31 | |||
32 | #endif /* __KERNEL__ */ | ||
33 | #endif /* _ASM_POWERPC_KMAP_TYPES_H */ | ||
diff --git a/include/asm-ppc64/kprobes.h b/include/asm-powerpc/kprobes.h index d9129d2b038e..b2f09f17fbe0 100644 --- a/include/asm-ppc64/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef _ASM_KPROBES_H | 1 | #ifndef _ASM_POWERPC_KPROBES_H |
2 | #define _ASM_KPROBES_H | 2 | #define _ASM_POWERPC_KPROBES_H |
3 | /* | 3 | /* |
4 | * Kernel Probes (KProbes) | 4 | * Kernel Probes (KProbes) |
5 | * include/asm-ppc64/kprobes.h | ||
6 | * | 5 | * |
7 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -64,4 +63,4 @@ static inline int kprobe_exceptions_notify(struct notifier_block *self, | |||
64 | return 0; | 63 | return 0; |
65 | } | 64 | } |
66 | #endif | 65 | #endif |
67 | #endif /* _ASM_KPROBES_H */ | 66 | #endif /* _ASM_POWERPC_KPROBES_H */ |
diff --git a/include/asm-ppc64/lmb.h b/include/asm-powerpc/lmb.h index de91e034bd98..ea0afe343545 100644 --- a/include/asm-ppc64/lmb.h +++ b/include/asm-powerpc/lmb.h | |||
@@ -50,7 +50,7 @@ extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long, | |||
50 | extern unsigned long __init lmb_phys_mem_size(void); | 50 | extern unsigned long __init lmb_phys_mem_size(void); |
51 | extern unsigned long __init lmb_end_of_DRAM(void); | 51 | extern unsigned long __init lmb_end_of_DRAM(void); |
52 | extern unsigned long __init lmb_abs_to_phys(unsigned long); | 52 | extern unsigned long __init lmb_abs_to_phys(unsigned long); |
53 | extern void __init lmb_enforce_memory_limit(void); | 53 | extern void __init lmb_enforce_memory_limit(unsigned long); |
54 | 54 | ||
55 | extern void lmb_dump_all(void); | 55 | extern void lmb_dump_all(void); |
56 | 56 | ||
diff --git a/include/asm-ppc64/machdep.h b/include/asm-powerpc/machdep.h index 8027160ec96d..451b345cfc78 100644 --- a/include/asm-ppc64/machdep.h +++ b/include/asm-powerpc/machdep.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifndef _ASM_POWERPC_MACHDEP_H | ||
2 | #define _ASM_POWERPC_MACHDEP_H | ||
1 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
2 | #ifndef _PPC64_MACHDEP_H | ||
3 | #define _PPC64_MACHDEP_H | ||
4 | 4 | ||
5 | /* | 5 | /* |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
@@ -16,6 +16,11 @@ | |||
16 | 16 | ||
17 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
18 | 18 | ||
19 | /* We export this macro for external modules like Alsa to know if | ||
20 | * ppc_md.feature_call is implemented or not | ||
21 | */ | ||
22 | #define CONFIG_PPC_HAS_FEATURE_CALLS | ||
23 | |||
19 | struct pt_regs; | 24 | struct pt_regs; |
20 | struct pci_bus; | 25 | struct pci_bus; |
21 | struct device_node; | 26 | struct device_node; |
@@ -39,6 +44,7 @@ struct smp_ops_t { | |||
39 | #endif | 44 | #endif |
40 | 45 | ||
41 | struct machdep_calls { | 46 | struct machdep_calls { |
47 | #ifdef CONFIG_PPC64 | ||
42 | void (*hpte_invalidate)(unsigned long slot, | 48 | void (*hpte_invalidate)(unsigned long slot, |
43 | unsigned long va, | 49 | unsigned long va, |
44 | int large, | 50 | int large, |
@@ -56,9 +62,8 @@ struct machdep_calls { | |||
56 | unsigned long vflags, | 62 | unsigned long vflags, |
57 | unsigned long rflags); | 63 | unsigned long rflags); |
58 | long (*hpte_remove)(unsigned long hpte_group); | 64 | long (*hpte_remove)(unsigned long hpte_group); |
59 | void (*flush_hash_range)(unsigned long context, | 65 | void (*flush_hash_range)(unsigned long number, int local); |
60 | unsigned long number, | 66 | |
61 | int local); | ||
62 | /* special for kexec, to be called in real mode, linar mapping is | 67 | /* special for kexec, to be called in real mode, linar mapping is |
63 | * destroyed as well */ | 68 | * destroyed as well */ |
64 | void (*hpte_clear_all)(void); | 69 | void (*hpte_clear_all)(void); |
@@ -75,18 +80,21 @@ struct machdep_calls { | |||
75 | void (*iommu_dev_setup)(struct pci_dev *dev); | 80 | void (*iommu_dev_setup)(struct pci_dev *dev); |
76 | void (*iommu_bus_setup)(struct pci_bus *bus); | 81 | void (*iommu_bus_setup)(struct pci_bus *bus); |
77 | void (*irq_bus_setup)(struct pci_bus *bus); | 82 | void (*irq_bus_setup)(struct pci_bus *bus); |
83 | #endif | ||
78 | 84 | ||
79 | int (*probe)(int platform); | 85 | int (*probe)(int platform); |
80 | void (*setup_arch)(void); | 86 | void (*setup_arch)(void); |
81 | void (*init_early)(void); | 87 | void (*init_early)(void); |
82 | /* Optional, may be NULL. */ | 88 | /* Optional, may be NULL. */ |
83 | void (*get_cpuinfo)(struct seq_file *m); | 89 | void (*show_cpuinfo)(struct seq_file *m); |
90 | void (*show_percpuinfo)(struct seq_file *m, int i); | ||
84 | 91 | ||
85 | void (*init_IRQ)(void); | 92 | void (*init_IRQ)(void); |
86 | int (*get_irq)(struct pt_regs *); | 93 | int (*get_irq)(struct pt_regs *); |
87 | void (*cpu_irq_down)(int secondary); | 94 | void (*cpu_irq_down)(int secondary); |
88 | 95 | ||
89 | /* PCI stuff */ | 96 | /* PCI stuff */ |
97 | /* Called after scanning the bus, before allocating resources */ | ||
90 | void (*pcibios_fixup)(void); | 98 | void (*pcibios_fixup)(void); |
91 | int (*pci_probe_mode)(struct pci_bus *); | 99 | int (*pci_probe_mode)(struct pci_bus *); |
92 | 100 | ||
@@ -96,9 +104,13 @@ struct machdep_calls { | |||
96 | void (*panic)(char *str); | 104 | void (*panic)(char *str); |
97 | void (*cpu_die)(void); | 105 | void (*cpu_die)(void); |
98 | 106 | ||
107 | long (*time_init)(void); /* Optional, may be NULL */ | ||
108 | |||
99 | int (*set_rtc_time)(struct rtc_time *); | 109 | int (*set_rtc_time)(struct rtc_time *); |
100 | void (*get_rtc_time)(struct rtc_time *); | 110 | void (*get_rtc_time)(struct rtc_time *); |
101 | void (*get_boot_time)(struct rtc_time *); | 111 | unsigned long (*get_boot_time)(void); |
112 | unsigned char (*rtc_read_val)(int addr); | ||
113 | void (*rtc_write_val)(int addr, unsigned char val); | ||
102 | 114 | ||
103 | void (*calibrate_decr)(void); | 115 | void (*calibrate_decr)(void); |
104 | 116 | ||
@@ -107,10 +119,12 @@ struct machdep_calls { | |||
107 | /* Interface for platform error logging */ | 119 | /* Interface for platform error logging */ |
108 | void (*log_error)(char *buf, unsigned int err_type, int fatal); | 120 | void (*log_error)(char *buf, unsigned int err_type, int fatal); |
109 | 121 | ||
122 | unsigned char (*nvram_read_val)(int addr); | ||
123 | void (*nvram_write_val)(int addr, unsigned char val); | ||
110 | ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index); | 124 | ssize_t (*nvram_write)(char *buf, size_t count, loff_t *index); |
111 | ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index); | 125 | ssize_t (*nvram_read)(char *buf, size_t count, loff_t *index); |
112 | ssize_t (*nvram_size)(void); | 126 | ssize_t (*nvram_size)(void); |
113 | int (*nvram_sync)(void); | 127 | void (*nvram_sync)(void); |
114 | 128 | ||
115 | /* Exception handlers */ | 129 | /* Exception handlers */ |
116 | void (*system_reset_exception)(struct pt_regs *regs); | 130 | void (*system_reset_exception)(struct pt_regs *regs); |
@@ -130,19 +144,97 @@ struct machdep_calls { | |||
130 | 144 | ||
131 | /* Get access protection for /dev/mem */ | 145 | /* Get access protection for /dev/mem */ |
132 | pgprot_t (*phys_mem_access_prot)(struct file *file, | 146 | pgprot_t (*phys_mem_access_prot)(struct file *file, |
133 | unsigned long offset, | 147 | unsigned long pfn, |
134 | unsigned long size, | 148 | unsigned long size, |
135 | pgprot_t vma_prot); | 149 | pgprot_t vma_prot); |
136 | 150 | ||
137 | /* Idle loop for this platform, leave empty for default idle loop */ | 151 | /* Idle loop for this platform, leave empty for default idle loop */ |
138 | int (*idle_loop)(void); | 152 | void (*idle_loop)(void); |
139 | 153 | ||
140 | /* Function to enable pmcs for this platform, called once per cpu. */ | 154 | /* Function to enable performance monitor counters for this |
155 | platform, called once per cpu. */ | ||
141 | void (*enable_pmcs)(void); | 156 | void (*enable_pmcs)(void); |
157 | |||
158 | #ifdef CONFIG_PPC32 /* XXX for now */ | ||
159 | /* A general init function, called by ppc_init in init/main.c. | ||
160 | May be NULL. */ | ||
161 | void (*init)(void); | ||
162 | |||
163 | void (*idle)(void); | ||
164 | void (*power_save)(void); | ||
165 | |||
166 | void (*heartbeat)(void); | ||
167 | unsigned long heartbeat_reset; | ||
168 | unsigned long heartbeat_count; | ||
169 | |||
170 | void (*setup_io_mappings)(void); | ||
171 | |||
172 | void (*early_serial_map)(void); | ||
173 | void (*kgdb_map_scc)(void); | ||
174 | |||
175 | /* | ||
176 | * optional PCI "hooks" | ||
177 | */ | ||
178 | |||
179 | /* Called after PPC generic resource fixup to perform | ||
180 | machine specific fixups */ | ||
181 | void (*pcibios_fixup_resources)(struct pci_dev *); | ||
182 | |||
183 | /* Called for each PCI bus in the system when it's probed */ | ||
184 | void (*pcibios_fixup_bus)(struct pci_bus *); | ||
185 | |||
186 | /* Called when pci_enable_device() is called (initial=0) or | ||
187 | * when a device with no assigned resource is found (initial=1). | ||
188 | * Returns 0 to allow assignment/enabling of the device. */ | ||
189 | int (*pcibios_enable_device_hook)(struct pci_dev *, int initial); | ||
190 | |||
191 | /* For interrupt routing */ | ||
192 | unsigned char (*pci_swizzle)(struct pci_dev *, unsigned char *); | ||
193 | int (*pci_map_irq)(struct pci_dev *, unsigned char, unsigned char); | ||
194 | |||
195 | /* Called in indirect_* to avoid touching devices */ | ||
196 | int (*pci_exclude_device)(unsigned char, unsigned char); | ||
197 | |||
198 | /* Called at then very end of pcibios_init() */ | ||
199 | void (*pcibios_after_init)(void); | ||
200 | |||
201 | /* this is for modules, since _machine can be a define -- Cort */ | ||
202 | int ppc_machine; | ||
203 | |||
204 | #ifdef CONFIG_KEXEC | ||
205 | /* Called to shutdown machine specific hardware not already controlled | ||
206 | * by other drivers. | ||
207 | * XXX Should we move this one out of kexec scope? | ||
208 | */ | ||
209 | void (*machine_shutdown)(void); | ||
210 | |||
211 | /* Called to do the minimal shutdown needed to run a kexec'd kernel | ||
212 | * to run successfully. | ||
213 | * XXX Should we move this one out of kexec scope? | ||
214 | */ | ||
215 | void (*machine_crash_shutdown)(void); | ||
216 | |||
217 | /* Called to do what every setup is needed on image and the | ||
218 | * reboot code buffer. Returns 0 on success. | ||
219 | * Provide your own (maybe dummy) implementation if your platform | ||
220 | * claims to support kexec. | ||
221 | */ | ||
222 | int (*machine_kexec_prepare)(struct kimage *image); | ||
223 | |||
224 | /* Called to handle any machine specific cleanup on image */ | ||
225 | void (*machine_kexec_cleanup)(struct kimage *image); | ||
226 | |||
227 | /* Called to perform the _real_ kexec. | ||
228 | * Do NOT allocate memory or fail here. We are past the point of | ||
229 | * no return. | ||
230 | */ | ||
231 | void (*machine_kexec)(struct kimage *image); | ||
232 | #endif /* CONFIG_KEXEC */ | ||
233 | #endif /* CONFIG_PPC32 */ | ||
142 | }; | 234 | }; |
143 | 235 | ||
144 | extern int default_idle(void); | 236 | extern void default_idle(void); |
145 | extern int native_idle(void); | 237 | extern void native_idle(void); |
146 | 238 | ||
147 | extern struct machdep_calls ppc_md; | 239 | extern struct machdep_calls ppc_md; |
148 | extern char cmd_line[COMMAND_LINE_SIZE]; | 240 | extern char cmd_line[COMMAND_LINE_SIZE]; |
@@ -162,6 +254,13 @@ extern sys_ctrler_t sys_ctrler; | |||
162 | 254 | ||
163 | #endif /* CONFIG_PPC_PMAC */ | 255 | #endif /* CONFIG_PPC_PMAC */ |
164 | 256 | ||
257 | extern void setup_pci_ptrs(void); | ||
258 | |||
259 | #ifdef CONFIG_SMP | ||
260 | /* Poor default implementations */ | ||
261 | extern void __devinit smp_generic_give_timebase(void); | ||
262 | extern void __devinit smp_generic_take_timebase(void); | ||
263 | #endif /* CONFIG_SMP */ | ||
165 | 264 | ||
166 | 265 | ||
167 | /* Functions to produce codes on the leds. | 266 | /* Functions to produce codes on the leds. |
@@ -181,5 +280,5 @@ static inline void log_error(char *buf, unsigned int err_type, int fatal) | |||
181 | ppc_md.log_error(buf, err_type, fatal); | 280 | ppc_md.log_error(buf, err_type, fatal); |
182 | } | 281 | } |
183 | 282 | ||
184 | #endif /* _PPC64_MACHDEP_H */ | ||
185 | #endif /* __KERNEL__ */ | 283 | #endif /* __KERNEL__ */ |
284 | #endif /* _ASM_POWERPC_MACHDEP_H */ | ||
diff --git a/include/asm-ppc/macio.h b/include/asm-powerpc/macio.h index b553dd4b139e..b553dd4b139e 100644 --- a/include/asm-ppc/macio.h +++ b/include/asm-powerpc/macio.h | |||
diff --git a/include/asm-ppc/mediabay.h b/include/asm-powerpc/mediabay.h index 9daa3252d7b6..9daa3252d7b6 100644 --- a/include/asm-ppc/mediabay.h +++ b/include/asm-powerpc/mediabay.h | |||
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h new file mode 100644 index 000000000000..7083d1f74260 --- /dev/null +++ b/include/asm-powerpc/mpic.h | |||
@@ -0,0 +1,287 @@ | |||
1 | #ifndef _ASM_POWERPC_MPIC_H | ||
2 | #define _ASM_POWERPC_MPIC_H | ||
3 | |||
4 | #include <linux/irq.h> | ||
5 | |||
6 | /* | ||
7 | * Global registers | ||
8 | */ | ||
9 | |||
10 | #define MPIC_GREG_BASE 0x01000 | ||
11 | |||
12 | #define MPIC_GREG_FEATURE_0 0x00000 | ||
13 | #define MPIC_GREG_FEATURE_LAST_SRC_MASK 0x07ff0000 | ||
14 | #define MPIC_GREG_FEATURE_LAST_SRC_SHIFT 16 | ||
15 | #define MPIC_GREG_FEATURE_LAST_CPU_MASK 0x00001f00 | ||
16 | #define MPIC_GREG_FEATURE_LAST_CPU_SHIFT 8 | ||
17 | #define MPIC_GREG_FEATURE_VERSION_MASK 0xff | ||
18 | #define MPIC_GREG_FEATURE_1 0x00010 | ||
19 | #define MPIC_GREG_GLOBAL_CONF_0 0x00020 | ||
20 | #define MPIC_GREG_GCONF_RESET 0x80000000 | ||
21 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 | ||
22 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff | ||
23 | #define MPIC_GREG_GLOBAL_CONF_1 0x00030 | ||
24 | #define MPIC_GREG_VENDOR_0 0x00040 | ||
25 | #define MPIC_GREG_VENDOR_1 0x00050 | ||
26 | #define MPIC_GREG_VENDOR_2 0x00060 | ||
27 | #define MPIC_GREG_VENDOR_3 0x00070 | ||
28 | #define MPIC_GREG_VENDOR_ID 0x00080 | ||
29 | #define MPIC_GREG_VENDOR_ID_STEPPING_MASK 0x00ff0000 | ||
30 | #define MPIC_GREG_VENDOR_ID_STEPPING_SHIFT 16 | ||
31 | #define MPIC_GREG_VENDOR_ID_DEVICE_ID_MASK 0x0000ff00 | ||
32 | #define MPIC_GREG_VENDOR_ID_DEVICE_ID_SHIFT 8 | ||
33 | #define MPIC_GREG_VENDOR_ID_VENDOR_ID_MASK 0x000000ff | ||
34 | #define MPIC_GREG_PROCESSOR_INIT 0x00090 | ||
35 | #define MPIC_GREG_IPI_VECTOR_PRI_0 0x000a0 | ||
36 | #define MPIC_GREG_IPI_VECTOR_PRI_1 0x000b0 | ||
37 | #define MPIC_GREG_IPI_VECTOR_PRI_2 0x000c0 | ||
38 | #define MPIC_GREG_IPI_VECTOR_PRI_3 0x000d0 | ||
39 | #define MPIC_GREG_SPURIOUS 0x000e0 | ||
40 | #define MPIC_GREG_TIMER_FREQ 0x000f0 | ||
41 | |||
42 | /* | ||
43 | * | ||
44 | * Timer registers | ||
45 | */ | ||
46 | #define MPIC_TIMER_BASE 0x01100 | ||
47 | #define MPIC_TIMER_STRIDE 0x40 | ||
48 | |||
49 | #define MPIC_TIMER_CURRENT_CNT 0x00000 | ||
50 | #define MPIC_TIMER_BASE_CNT 0x00010 | ||
51 | #define MPIC_TIMER_VECTOR_PRI 0x00020 | ||
52 | #define MPIC_TIMER_DESTINATION 0x00030 | ||
53 | |||
54 | /* | ||
55 | * Per-Processor registers | ||
56 | */ | ||
57 | |||
58 | #define MPIC_CPU_THISBASE 0x00000 | ||
59 | #define MPIC_CPU_BASE 0x20000 | ||
60 | #define MPIC_CPU_STRIDE 0x01000 | ||
61 | |||
62 | #define MPIC_CPU_IPI_DISPATCH_0 0x00040 | ||
63 | #define MPIC_CPU_IPI_DISPATCH_1 0x00050 | ||
64 | #define MPIC_CPU_IPI_DISPATCH_2 0x00060 | ||
65 | #define MPIC_CPU_IPI_DISPATCH_3 0x00070 | ||
66 | #define MPIC_CPU_CURRENT_TASK_PRI 0x00080 | ||
67 | #define MPIC_CPU_TASKPRI_MASK 0x0000000f | ||
68 | #define MPIC_CPU_WHOAMI 0x00090 | ||
69 | #define MPIC_CPU_WHOAMI_MASK 0x0000001f | ||
70 | #define MPIC_CPU_INTACK 0x000a0 | ||
71 | #define MPIC_CPU_EOI 0x000b0 | ||
72 | |||
73 | /* | ||
74 | * Per-source registers | ||
75 | */ | ||
76 | |||
77 | #define MPIC_IRQ_BASE 0x10000 | ||
78 | #define MPIC_IRQ_STRIDE 0x00020 | ||
79 | #define MPIC_IRQ_VECTOR_PRI 0x00000 | ||
80 | #define MPIC_VECPRI_MASK 0x80000000 | ||
81 | #define MPIC_VECPRI_ACTIVITY 0x40000000 /* Read Only */ | ||
82 | #define MPIC_VECPRI_PRIORITY_MASK 0x000f0000 | ||
83 | #define MPIC_VECPRI_PRIORITY_SHIFT 16 | ||
84 | #define MPIC_VECPRI_VECTOR_MASK 0x000007ff | ||
85 | #define MPIC_VECPRI_POLARITY_POSITIVE 0x00800000 | ||
86 | #define MPIC_VECPRI_POLARITY_NEGATIVE 0x00000000 | ||
87 | #define MPIC_VECPRI_POLARITY_MASK 0x00800000 | ||
88 | #define MPIC_VECPRI_SENSE_LEVEL 0x00400000 | ||
89 | #define MPIC_VECPRI_SENSE_EDGE 0x00000000 | ||
90 | #define MPIC_VECPRI_SENSE_MASK 0x00400000 | ||
91 | #define MPIC_IRQ_DESTINATION 0x00010 | ||
92 | |||
93 | #define MPIC_MAX_IRQ_SOURCES 2048 | ||
94 | #define MPIC_MAX_CPUS 32 | ||
95 | #define MPIC_MAX_ISU 32 | ||
96 | |||
97 | /* | ||
98 | * Special vector numbers (internal use only) | ||
99 | */ | ||
100 | #define MPIC_VEC_SPURRIOUS 255 | ||
101 | #define MPIC_VEC_IPI_3 254 | ||
102 | #define MPIC_VEC_IPI_2 253 | ||
103 | #define MPIC_VEC_IPI_1 252 | ||
104 | #define MPIC_VEC_IPI_0 251 | ||
105 | |||
106 | /* unused */ | ||
107 | #define MPIC_VEC_TIMER_3 250 | ||
108 | #define MPIC_VEC_TIMER_2 249 | ||
109 | #define MPIC_VEC_TIMER_1 248 | ||
110 | #define MPIC_VEC_TIMER_0 247 | ||
111 | |||
112 | /* Type definition of the cascade handler */ | ||
113 | typedef int (*mpic_cascade_t)(struct pt_regs *regs, void *data); | ||
114 | |||
115 | #ifdef CONFIG_MPIC_BROKEN_U3 | ||
116 | /* Fixup table entry */ | ||
117 | struct mpic_irq_fixup | ||
118 | { | ||
119 | u8 __iomem *base; | ||
120 | unsigned int irq; | ||
121 | }; | ||
122 | #endif /* CONFIG_MPIC_BROKEN_U3 */ | ||
123 | |||
124 | |||
125 | /* The instance data of a given MPIC */ | ||
126 | struct mpic | ||
127 | { | ||
128 | /* The "linux" controller struct */ | ||
129 | hw_irq_controller hc_irq; | ||
130 | #ifdef CONFIG_SMP | ||
131 | hw_irq_controller hc_ipi; | ||
132 | #endif | ||
133 | const char *name; | ||
134 | /* Flags */ | ||
135 | unsigned int flags; | ||
136 | /* How many irq sources in a given ISU */ | ||
137 | unsigned int isu_size; | ||
138 | unsigned int isu_shift; | ||
139 | unsigned int isu_mask; | ||
140 | /* Offset of irq vector numbers */ | ||
141 | unsigned int irq_offset; | ||
142 | unsigned int irq_count; | ||
143 | /* Offset of ipi vector numbers */ | ||
144 | unsigned int ipi_offset; | ||
145 | /* Number of sources */ | ||
146 | unsigned int num_sources; | ||
147 | /* Number of CPUs */ | ||
148 | unsigned int num_cpus; | ||
149 | /* cascade handler */ | ||
150 | mpic_cascade_t cascade; | ||
151 | void *cascade_data; | ||
152 | unsigned int cascade_vec; | ||
153 | /* senses array */ | ||
154 | unsigned char *senses; | ||
155 | unsigned int senses_count; | ||
156 | |||
157 | #ifdef CONFIG_MPIC_BROKEN_U3 | ||
158 | /* The fixup table */ | ||
159 | struct mpic_irq_fixup *fixups; | ||
160 | spinlock_t fixup_lock; | ||
161 | #endif | ||
162 | |||
163 | /* The various ioremap'ed bases */ | ||
164 | volatile u32 __iomem *gregs; | ||
165 | volatile u32 __iomem *tmregs; | ||
166 | volatile u32 __iomem *cpuregs[MPIC_MAX_CPUS]; | ||
167 | volatile u32 __iomem *isus[MPIC_MAX_ISU]; | ||
168 | |||
169 | /* link */ | ||
170 | struct mpic *next; | ||
171 | }; | ||
172 | |||
173 | /* This is the primary controller, only that one has IPIs and | ||
174 | * has afinity control. A non-primary MPIC always uses CPU0 | ||
175 | * registers only | ||
176 | */ | ||
177 | #define MPIC_PRIMARY 0x00000001 | ||
178 | /* Set this for a big-endian MPIC */ | ||
179 | #define MPIC_BIG_ENDIAN 0x00000002 | ||
180 | /* Broken U3 MPIC */ | ||
181 | #define MPIC_BROKEN_U3 0x00000004 | ||
182 | /* Broken IPI registers (autodetected) */ | ||
183 | #define MPIC_BROKEN_IPI 0x00000008 | ||
184 | /* MPIC wants a reset */ | ||
185 | #define MPIC_WANTS_RESET 0x00000010 | ||
186 | |||
187 | /* Allocate the controller structure and setup the linux irq descs | ||
188 | * for the range if interrupts passed in. No HW initialization is | ||
189 | * actually performed. | ||
190 | * | ||
191 | * @phys_addr: physial base address of the MPIC | ||
192 | * @flags: flags, see constants above | ||
193 | * @isu_size: number of interrupts in an ISU. Use 0 to use a | ||
194 | * standard ISU-less setup (aka powermac) | ||
195 | * @irq_offset: first irq number to assign to this mpic | ||
196 | * @irq_count: number of irqs to use with this mpic IRQ sources. Pass 0 | ||
197 | * to match the number of sources | ||
198 | * @ipi_offset: first irq number to assign to this mpic IPI sources, | ||
199 | * used only on primary mpic | ||
200 | * @senses: array of sense values | ||
201 | * @senses_num: number of entries in the array | ||
202 | * | ||
203 | * Note about the sense array. If none is passed, all interrupts are | ||
204 | * setup to be level negative unless MPIC_BROKEN_U3 is set in which | ||
205 | * case they are edge positive (and the array is ignored anyway). | ||
206 | * The values in the array start at the first source of the MPIC, | ||
207 | * that is senses[0] correspond to linux irq "irq_offset". | ||
208 | */ | ||
209 | extern struct mpic *mpic_alloc(unsigned long phys_addr, | ||
210 | unsigned int flags, | ||
211 | unsigned int isu_size, | ||
212 | unsigned int irq_offset, | ||
213 | unsigned int irq_count, | ||
214 | unsigned int ipi_offset, | ||
215 | unsigned char *senses, | ||
216 | unsigned int senses_num, | ||
217 | const char *name); | ||
218 | |||
219 | /* Assign ISUs, to call before mpic_init() | ||
220 | * | ||
221 | * @mpic: controller structure as returned by mpic_alloc() | ||
222 | * @isu_num: ISU number | ||
223 | * @phys_addr: physical address of the ISU | ||
224 | */ | ||
225 | extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, | ||
226 | unsigned long phys_addr); | ||
227 | |||
228 | /* Initialize the controller. After this has been called, none of the above | ||
229 | * should be called again for this mpic | ||
230 | */ | ||
231 | extern void mpic_init(struct mpic *mpic); | ||
232 | |||
233 | /* Setup a cascade. Currently, only one cascade is supported this | ||
234 | * way, though you can always do a normal request_irq() and add | ||
235 | * other cascades this way. You should call this _after_ having | ||
236 | * added all the ISUs | ||
237 | * | ||
238 | * @irq_no: "linux" irq number of the cascade (that is offset'ed vector) | ||
239 | * @handler: cascade handler function | ||
240 | */ | ||
241 | extern void mpic_setup_cascade(unsigned int irq_no, mpic_cascade_t hanlder, | ||
242 | void *data); | ||
243 | |||
244 | /* | ||
245 | * All of the following functions must only be used after the | ||
246 | * ISUs have been assigned and the controller fully initialized | ||
247 | * with mpic_init() | ||
248 | */ | ||
249 | |||
250 | |||
251 | /* Change/Read the priority of an interrupt. Default is 8 for irqs and | ||
252 | * 10 for IPIs. You can call this on both IPIs and IRQ numbers, but the | ||
253 | * IPI number is then the offset'ed (linux irq number mapped to the IPI) | ||
254 | */ | ||
255 | extern void mpic_irq_set_priority(unsigned int irq, unsigned int pri); | ||
256 | extern unsigned int mpic_irq_get_priority(unsigned int irq); | ||
257 | |||
258 | /* Setup a non-boot CPU */ | ||
259 | extern void mpic_setup_this_cpu(void); | ||
260 | |||
261 | /* Clean up for kexec (or cpu offline or ...) */ | ||
262 | extern void mpic_teardown_this_cpu(int secondary); | ||
263 | |||
264 | /* Get the current cpu priority for this cpu (0..15) */ | ||
265 | extern int mpic_cpu_get_priority(void); | ||
266 | |||
267 | /* Set the current cpu priority for this cpu */ | ||
268 | extern void mpic_cpu_set_priority(int prio); | ||
269 | |||
270 | /* Request IPIs on primary mpic */ | ||
271 | extern void mpic_request_ipis(void); | ||
272 | |||
273 | /* Send an IPI (non offseted number 0..3) */ | ||
274 | extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); | ||
275 | |||
276 | /* Send a message (IPI) to a given target (cpu number or MSG_*) */ | ||
277 | void smp_mpic_message_pass(int target, int msg); | ||
278 | |||
279 | /* Fetch interrupt from a given mpic */ | ||
280 | extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); | ||
281 | /* This one gets to the primary mpic */ | ||
282 | extern int mpic_get_irq(struct pt_regs *regs); | ||
283 | |||
284 | /* global mpic for pSeries */ | ||
285 | extern struct mpic *pSeries_mpic; | ||
286 | |||
287 | #endif /* _ASM_POWERPC_MPIC_H */ | ||
diff --git a/include/asm-ppc/of_device.h b/include/asm-powerpc/of_device.h index 575bce418f80..ddb16aae0bd6 100644 --- a/include/asm-ppc/of_device.h +++ b/include/asm-powerpc/of_device.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __OF_DEVICE_H__ | 1 | #ifndef _ASM_POWERPC_OF_DEVICE_H |
2 | #define __OF_DEVICE_H__ | 2 | #define _ASM_POWERPC_OF_DEVICE_H |
3 | 3 | ||
4 | #include <linux/device.h> | 4 | #include <linux/device.h> |
5 | #include <linux/mod_devicetable.h> | 5 | #include <linux/mod_devicetable.h> |
@@ -61,5 +61,4 @@ extern struct of_device *of_platform_device_create(struct device_node *np, | |||
61 | struct device *parent); | 61 | struct device *parent); |
62 | extern void of_release_dev(struct device *dev); | 62 | extern void of_release_dev(struct device *dev); |
63 | 63 | ||
64 | #endif /* __OF_DEVICE_H__ */ | 64 | #endif /* _ASM_POWERPC_OF_DEVICE_H */ |
65 | |||
diff --git a/include/asm-ppc/ohare.h b/include/asm-powerpc/ohare.h index 023b59772231..023b59772231 100644 --- a/include/asm-ppc/ohare.h +++ b/include/asm-powerpc/ohare.h | |||
diff --git a/include/asm-ppc64/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h index b04f1dfb1421..8013cd273ced 100644 --- a/include/asm-ppc64/oprofile_impl.h +++ b/include/asm-powerpc/oprofile_impl.h | |||
@@ -9,39 +9,49 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef OP_IMPL_H | 12 | #ifndef _ASM_POWERPC_OPROFILE_IMPL_H |
13 | #define OP_IMPL_H 1 | 13 | #define _ASM_POWERPC_OPROFILE_IMPL_H |
14 | 14 | ||
15 | #define OP_MAX_COUNTER 8 | 15 | #define OP_MAX_COUNTER 8 |
16 | 16 | ||
17 | /* Per-counter configuration as set via oprofilefs. */ | 17 | /* Per-counter configuration as set via oprofilefs. */ |
18 | struct op_counter_config { | 18 | struct op_counter_config { |
19 | #ifdef __powerpc64__ | ||
19 | unsigned long valid; | 20 | unsigned long valid; |
21 | #endif | ||
20 | unsigned long enabled; | 22 | unsigned long enabled; |
21 | unsigned long event; | 23 | unsigned long event; |
22 | unsigned long count; | 24 | unsigned long count; |
23 | unsigned long kernel; | 25 | unsigned long kernel; |
26 | #ifdef __powerpc64__ | ||
24 | /* We dont support per counter user/kernel selection */ | 27 | /* We dont support per counter user/kernel selection */ |
28 | #endif | ||
25 | unsigned long user; | 29 | unsigned long user; |
26 | unsigned long unit_mask; | 30 | unsigned long unit_mask; |
27 | }; | 31 | }; |
28 | 32 | ||
29 | /* System-wide configuration as set via oprofilefs. */ | 33 | /* System-wide configuration as set via oprofilefs. */ |
30 | struct op_system_config { | 34 | struct op_system_config { |
35 | #ifdef __powerpc64__ | ||
31 | unsigned long mmcr0; | 36 | unsigned long mmcr0; |
32 | unsigned long mmcr1; | 37 | unsigned long mmcr1; |
33 | unsigned long mmcra; | 38 | unsigned long mmcra; |
39 | #endif | ||
34 | unsigned long enable_kernel; | 40 | unsigned long enable_kernel; |
35 | unsigned long enable_user; | 41 | unsigned long enable_user; |
42 | #ifdef __powerpc64__ | ||
36 | unsigned long backtrace_spinlocks; | 43 | unsigned long backtrace_spinlocks; |
44 | #endif | ||
37 | }; | 45 | }; |
38 | 46 | ||
39 | /* Per-arch configuration */ | 47 | /* Per-arch configuration */ |
40 | struct op_ppc64_model { | 48 | struct op_powerpc_model { |
41 | void (*reg_setup) (struct op_counter_config *, | 49 | void (*reg_setup) (struct op_counter_config *, |
42 | struct op_system_config *, | 50 | struct op_system_config *, |
43 | int num_counters); | 51 | int num_counters); |
52 | #ifdef __powerpc64__ | ||
44 | void (*cpu_setup) (void *); | 53 | void (*cpu_setup) (void *); |
54 | #endif | ||
45 | void (*start) (struct op_counter_config *); | 55 | void (*start) (struct op_counter_config *); |
46 | void (*stop) (void); | 56 | void (*stop) (void); |
47 | void (*handle_interrupt) (struct pt_regs *, | 57 | void (*handle_interrupt) (struct pt_regs *, |
@@ -49,8 +59,9 @@ struct op_ppc64_model { | |||
49 | int num_counters; | 59 | int num_counters; |
50 | }; | 60 | }; |
51 | 61 | ||
52 | extern struct op_ppc64_model op_model_rs64; | 62 | #ifdef __powerpc64__ |
53 | extern struct op_ppc64_model op_model_power4; | 63 | extern struct op_powerpc_model op_model_rs64; |
64 | extern struct op_powerpc_model op_model_power4; | ||
54 | 65 | ||
55 | static inline unsigned int ctr_read(unsigned int i) | 66 | static inline unsigned int ctr_read(unsigned int i) |
56 | { | 67 | { |
@@ -107,5 +118,6 @@ static inline void ctr_write(unsigned int i, unsigned int val) | |||
107 | break; | 118 | break; |
108 | } | 119 | } |
109 | } | 120 | } |
121 | #endif /* __powerpc64__ */ | ||
110 | 122 | ||
111 | #endif | 123 | #endif /* _ASM_POWERPC_OPROFILE_IMPL_H */ |
diff --git a/include/asm-ppc64/pSeries_reconfig.h b/include/asm-powerpc/pSeries_reconfig.h index c0db1ea7f7d1..c0db1ea7f7d1 100644 --- a/include/asm-ppc64/pSeries_reconfig.h +++ b/include/asm-powerpc/pSeries_reconfig.h | |||
diff --git a/include/asm-ppc/parport.h b/include/asm-powerpc/parport.h index 11f96d3de5b6..d86b410a6f8b 100644 --- a/include/asm-ppc/parport.h +++ b/include/asm-powerpc/parport.h | |||
@@ -6,8 +6,8 @@ | |||
6 | * This file should only be included by drivers/parport/parport_pc.c. | 6 | * This file should only be included by drivers/parport/parport_pc.c. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifndef _ASM_PPC_PARPORT_H | 9 | #ifndef _ASM_POWERPC_PARPORT_H |
10 | #define _ASM_PPC_PARPORT_H | 10 | #define _ASM_POWERPC_PARPORT_H |
11 | 11 | ||
12 | static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); | 12 | static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); |
13 | static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | 13 | static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) |
@@ -15,4 +15,4 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | |||
15 | return parport_pc_find_isa_ports (autoirq, autodma); | 15 | return parport_pc_find_isa_ports (autoirq, autodma); |
16 | } | 16 | } |
17 | 17 | ||
18 | #endif /* !(_ASM_PPC_PARPORT_H) */ | 18 | #endif /* !(_ASM_POWERPC_PARPORT_H) */ |
diff --git a/include/asm-ppc/pmac_feature.h b/include/asm-powerpc/pmac_feature.h index e9683bcff19b..e9683bcff19b 100644 --- a/include/asm-ppc/pmac_feature.h +++ b/include/asm-powerpc/pmac_feature.h | |||
diff --git a/include/asm-ppc/pmac_low_i2c.h b/include/asm-powerpc/pmac_low_i2c.h index 809a5963d5e7..809a5963d5e7 100644 --- a/include/asm-ppc/pmac_low_i2c.h +++ b/include/asm-powerpc/pmac_low_i2c.h | |||
diff --git a/include/asm-ppc64/pmc.h b/include/asm-powerpc/pmc.h index d1d297dbccfe..2f3c3fc2b796 100644 --- a/include/asm-ppc64/pmc.h +++ b/include/asm-powerpc/pmc.h | |||
@@ -16,8 +16,8 @@ | |||
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ | 18 | */ |
19 | #ifndef _PPC64_PMC_H | 19 | #ifndef _POWERPC_PMC_H |
20 | #define _PPC64_PMC_H | 20 | #define _POWERPC_PMC_H |
21 | 21 | ||
22 | #include <asm/ptrace.h> | 22 | #include <asm/ptrace.h> |
23 | 23 | ||
@@ -26,6 +26,21 @@ typedef void (*perf_irq_t)(struct pt_regs *); | |||
26 | int reserve_pmc_hardware(perf_irq_t new_perf_irq); | 26 | int reserve_pmc_hardware(perf_irq_t new_perf_irq); |
27 | void release_pmc_hardware(void); | 27 | void release_pmc_hardware(void); |
28 | 28 | ||
29 | #ifdef CONFIG_PPC64 | ||
29 | void power4_enable_pmcs(void); | 30 | void power4_enable_pmcs(void); |
31 | #endif | ||
30 | 32 | ||
31 | #endif /* _PPC64_PMC_H */ | 33 | #ifdef CONFIG_FSL_BOOKE |
34 | void init_pmc_stop(int ctr); | ||
35 | void set_pmc_event(int ctr, int event); | ||
36 | void set_pmc_user_kernel(int ctr, int user, int kernel); | ||
37 | void set_pmc_marked(int ctr, int mark0, int mark1); | ||
38 | void pmc_start_ctr(int ctr, int enable); | ||
39 | void pmc_start_ctrs(int enable); | ||
40 | void pmc_stop_ctrs(void); | ||
41 | void dump_pmcs(void); | ||
42 | |||
43 | extern struct op_powerpc_model op_model_fsl_booke; | ||
44 | #endif | ||
45 | |||
46 | #endif /* _POWERPC_PMC_H */ | ||
diff --git a/include/asm-ppc64/posix_types.h b/include/asm-powerpc/posix_types.h index 516de7201b5d..c6391077224f 100644 --- a/include/asm-ppc64/posix_types.h +++ b/include/asm-powerpc/posix_types.h | |||
@@ -1,44 +1,54 @@ | |||
1 | #ifndef _PPC64_POSIX_TYPES_H | 1 | #ifndef _ASM_POWERPC_POSIX_TYPES_H |
2 | #define _PPC64_POSIX_TYPES_H | 2 | #define _ASM_POWERPC_POSIX_TYPES_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * This file is generally used by user-level software, so you need to | 5 | * This file is generally used by user-level software, so you need to |
6 | * be a little careful about namespace pollution etc. Also, we cannot | 6 | * be a little careful about namespace pollution etc. Also, we cannot |
7 | * assume GCC is being used. | 7 | * assume GCC is being used. |
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | 8 | */ |
14 | 9 | ||
15 | typedef unsigned long __kernel_ino_t; | 10 | typedef unsigned long __kernel_ino_t; |
16 | typedef unsigned long __kernel_nlink_t; | ||
17 | typedef unsigned int __kernel_mode_t; | 11 | typedef unsigned int __kernel_mode_t; |
18 | typedef long __kernel_off_t; | 12 | typedef long __kernel_off_t; |
19 | typedef long long __kernel_loff_t; | ||
20 | typedef int __kernel_pid_t; | 13 | typedef int __kernel_pid_t; |
21 | typedef int __kernel_ipc_pid_t; | ||
22 | typedef unsigned int __kernel_uid_t; | 14 | typedef unsigned int __kernel_uid_t; |
23 | typedef unsigned int __kernel_gid_t; | 15 | typedef unsigned int __kernel_gid_t; |
24 | typedef unsigned long __kernel_size_t; | ||
25 | typedef long __kernel_ssize_t; | ||
26 | typedef long __kernel_ptrdiff_t; | 16 | typedef long __kernel_ptrdiff_t; |
27 | typedef long __kernel_time_t; | 17 | typedef long __kernel_time_t; |
18 | typedef long __kernel_clock_t; | ||
28 | typedef int __kernel_timer_t; | 19 | typedef int __kernel_timer_t; |
29 | typedef int __kernel_clockid_t; | 20 | typedef int __kernel_clockid_t; |
30 | typedef long __kernel_suseconds_t; | 21 | typedef long __kernel_suseconds_t; |
31 | typedef long __kernel_clock_t; | ||
32 | typedef int __kernel_daddr_t; | 22 | typedef int __kernel_daddr_t; |
33 | typedef char * __kernel_caddr_t; | 23 | typedef char * __kernel_caddr_t; |
34 | typedef unsigned short __kernel_uid16_t; | 24 | typedef unsigned short __kernel_uid16_t; |
35 | typedef unsigned short __kernel_gid16_t; | 25 | typedef unsigned short __kernel_gid16_t; |
36 | typedef unsigned int __kernel_uid32_t; | 26 | typedef unsigned int __kernel_uid32_t; |
37 | typedef unsigned int __kernel_gid32_t; | 27 | typedef unsigned int __kernel_gid32_t; |
38 | |||
39 | typedef unsigned int __kernel_old_uid_t; | 28 | typedef unsigned int __kernel_old_uid_t; |
40 | typedef unsigned int __kernel_old_gid_t; | 29 | typedef unsigned int __kernel_old_gid_t; |
30 | |||
31 | #ifdef __powerpc64__ | ||
32 | typedef unsigned long __kernel_nlink_t; | ||
33 | typedef int __kernel_ipc_pid_t; | ||
34 | typedef unsigned long __kernel_size_t; | ||
35 | typedef long __kernel_ssize_t; | ||
41 | typedef unsigned long __kernel_old_dev_t; | 36 | typedef unsigned long __kernel_old_dev_t; |
37 | #else | ||
38 | typedef unsigned short __kernel_nlink_t; | ||
39 | typedef short __kernel_ipc_pid_t; | ||
40 | typedef unsigned int __kernel_size_t; | ||
41 | typedef int __kernel_ssize_t; | ||
42 | typedef unsigned int __kernel_old_dev_t; | ||
43 | #endif | ||
44 | |||
45 | #ifdef __powerpc64__ | ||
46 | typedef long long __kernel_loff_t; | ||
47 | #else | ||
48 | #ifdef __GNUC__ | ||
49 | typedef long long __kernel_loff_t; | ||
50 | #endif | ||
51 | #endif | ||
42 | 52 | ||
43 | typedef struct { | 53 | typedef struct { |
44 | int val[2]; | 54 | int val[2]; |
@@ -116,4 +126,4 @@ static __inline__ void __FD_ZERO(__kernel_fd_set *p) | |||
116 | 126 | ||
117 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | 127 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ |
118 | #endif /* __GNUC__ */ | 128 | #endif /* __GNUC__ */ |
119 | #endif /* _PPC64_POSIX_TYPES_H */ | 129 | #endif /* _ASM_POWERPC_POSIX_TYPES_H */ |
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h new file mode 100644 index 000000000000..a88728fba8f6 --- /dev/null +++ b/include/asm-powerpc/ppc-pci.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * c 2001 PPC 64 Team, IBM Corp | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | #ifndef _ASM_POWERPC_PPC_PCI_H | ||
10 | #define _ASM_POWERPC_PPC_PCI_H | ||
11 | |||
12 | #include <linux/pci.h> | ||
13 | #include <asm/pci-bridge.h> | ||
14 | |||
15 | extern unsigned long isa_io_base; | ||
16 | |||
17 | extern void pci_setup_pci_controller(struct pci_controller *hose); | ||
18 | extern void pci_setup_phb_io(struct pci_controller *hose, int primary); | ||
19 | extern void pci_setup_phb_io_dynamic(struct pci_controller *hose, int primary); | ||
20 | |||
21 | |||
22 | extern struct list_head hose_list; | ||
23 | extern int global_phb_number; | ||
24 | |||
25 | extern unsigned long find_and_init_phbs(void); | ||
26 | |||
27 | extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */ | ||
28 | |||
29 | /* PCI device_node operations */ | ||
30 | struct device_node; | ||
31 | typedef void *(*traverse_func)(struct device_node *me, void *data); | ||
32 | void *traverse_pci_devices(struct device_node *start, traverse_func pre, | ||
33 | void *data); | ||
34 | |||
35 | void pci_devs_phb_init(void); | ||
36 | void pci_devs_phb_init_dynamic(struct pci_controller *phb); | ||
37 | |||
38 | /* PCI address cache management routines */ | ||
39 | void pci_addr_cache_insert_device(struct pci_dev *dev); | ||
40 | void pci_addr_cache_remove_device(struct pci_dev *dev); | ||
41 | |||
42 | /* From rtas_pci.h */ | ||
43 | void init_pci_config_tokens (void); | ||
44 | unsigned long get_phb_buid (struct device_node *); | ||
45 | |||
46 | /* From pSeries_pci.h */ | ||
47 | extern void pSeries_final_fixup(void); | ||
48 | extern void pSeries_irq_bus_setup(struct pci_bus *bus); | ||
49 | |||
50 | extern unsigned long pci_probe_only; | ||
51 | extern unsigned long pci_assign_all_buses; | ||
52 | extern int pci_read_irq_line(struct pci_dev *pci_dev); | ||
53 | |||
54 | #endif /* _ASM_POWERPC_PPC_PCI_H */ | ||
diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h index bb53e2def363..f99f2af82ca5 100644 --- a/include/asm-ppc/ppc_asm.h +++ b/include/asm-powerpc/ppc_asm.h | |||
@@ -1,38 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-ppc/ppc_asm.h | ||
3 | * | ||
4 | * Definitions used by various bits of low-level assembly code on PowerPC. | ||
5 | * | ||
6 | * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan. | 2 | * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan. |
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | 3 | */ |
4 | #ifndef _ASM_POWERPC_PPC_ASM_H | ||
5 | #define _ASM_POWERPC_PPC_ASM_H | ||
13 | 6 | ||
7 | #include <linux/stringify.h> | ||
14 | #include <linux/config.h> | 8 | #include <linux/config.h> |
15 | 9 | ||
10 | #ifdef __ASSEMBLY__ | ||
11 | |||
16 | /* | 12 | /* |
17 | * Macros for storing registers into and loading registers from | 13 | * Macros for storing registers into and loading registers from |
18 | * exception frames. | 14 | * exception frames. |
19 | */ | 15 | */ |
16 | #ifdef __powerpc64__ | ||
17 | #define SAVE_GPR(n, base) std n,GPR0+8*(n)(base) | ||
18 | #define REST_GPR(n, base) ld n,GPR0+8*(n)(base) | ||
19 | #define SAVE_NVGPRS(base) SAVE_8GPRS(14, base); SAVE_10GPRS(22, base) | ||
20 | #define REST_NVGPRS(base) REST_8GPRS(14, base); REST_10GPRS(22, base) | ||
21 | #else | ||
20 | #define SAVE_GPR(n, base) stw n,GPR0+4*(n)(base) | 22 | #define SAVE_GPR(n, base) stw n,GPR0+4*(n)(base) |
23 | #define REST_GPR(n, base) lwz n,GPR0+4*(n)(base) | ||
24 | #define SAVE_NVGPRS(base) SAVE_GPR(13, base); SAVE_8GPRS(14, base); \ | ||
25 | SAVE_10GPRS(22, base) | ||
26 | #define REST_NVGPRS(base) REST_GPR(13, base); REST_8GPRS(14, base); \ | ||
27 | REST_10GPRS(22, base) | ||
28 | #endif | ||
29 | |||
30 | |||
21 | #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) | 31 | #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) |
22 | #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) | 32 | #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) |
23 | #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) | 33 | #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) |
24 | #define SAVE_10GPRS(n, base) SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base) | 34 | #define SAVE_10GPRS(n, base) SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base) |
25 | #define REST_GPR(n, base) lwz n,GPR0+4*(n)(base) | ||
26 | #define REST_2GPRS(n, base) REST_GPR(n, base); REST_GPR(n+1, base) | 35 | #define REST_2GPRS(n, base) REST_GPR(n, base); REST_GPR(n+1, base) |
27 | #define REST_4GPRS(n, base) REST_2GPRS(n, base); REST_2GPRS(n+2, base) | 36 | #define REST_4GPRS(n, base) REST_2GPRS(n, base); REST_2GPRS(n+2, base) |
28 | #define REST_8GPRS(n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base) | 37 | #define REST_8GPRS(n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base) |
29 | #define REST_10GPRS(n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) | 38 | #define REST_10GPRS(n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) |
30 | 39 | ||
31 | #define SAVE_NVGPRS(base) SAVE_GPR(13, base); SAVE_8GPRS(14, base); \ | ||
32 | SAVE_10GPRS(22, base) | ||
33 | #define REST_NVGPRS(base) REST_GPR(13, base); REST_8GPRS(14, base); \ | ||
34 | REST_10GPRS(22, base) | ||
35 | |||
36 | #define SAVE_FPR(n, base) stfd n,THREAD_FPR0+8*(n)(base) | 40 | #define SAVE_FPR(n, base) stfd n,THREAD_FPR0+8*(n)(base) |
37 | #define SAVE_2FPRS(n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) | 41 | #define SAVE_2FPRS(n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) |
38 | #define SAVE_4FPRS(n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) | 42 | #define SAVE_4FPRS(n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) |
@@ -47,32 +51,170 @@ | |||
47 | #define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) | 51 | #define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) |
48 | 52 | ||
49 | #define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,b,base | 53 | #define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,b,base |
50 | #define SAVE_2VR(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base) | 54 | #define SAVE_2VRS(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base) |
51 | #define SAVE_4VR(n,b,base) SAVE_2VR(n,b,base); SAVE_2VR(n+2,b,base) | 55 | #define SAVE_4VRS(n,b,base) SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base) |
52 | #define SAVE_8VR(n,b,base) SAVE_4VR(n,b,base); SAVE_4VR(n+4,b,base) | 56 | #define SAVE_8VRS(n,b,base) SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base) |
53 | #define SAVE_16VR(n,b,base) SAVE_8VR(n,b,base); SAVE_8VR(n+8,b,base) | 57 | #define SAVE_16VRS(n,b,base) SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base) |
54 | #define SAVE_32VR(n,b,base) SAVE_16VR(n,b,base); SAVE_16VR(n+16,b,base) | 58 | #define SAVE_32VRS(n,b,base) SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base) |
55 | #define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,b,base | 59 | #define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,b,base |
56 | #define REST_2VR(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base) | 60 | #define REST_2VRS(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base) |
57 | #define REST_4VR(n,b,base) REST_2VR(n,b,base); REST_2VR(n+2,b,base) | 61 | #define REST_4VRS(n,b,base) REST_2VRS(n,b,base); REST_2VRS(n+2,b,base) |
58 | #define REST_8VR(n,b,base) REST_4VR(n,b,base); REST_4VR(n+4,b,base) | 62 | #define REST_8VRS(n,b,base) REST_4VRS(n,b,base); REST_4VRS(n+4,b,base) |
59 | #define REST_16VR(n,b,base) REST_8VR(n,b,base); REST_8VR(n+8,b,base) | 63 | #define REST_16VRS(n,b,base) REST_8VRS(n,b,base); REST_8VRS(n+8,b,base) |
60 | #define REST_32VR(n,b,base) REST_16VR(n,b,base); REST_16VR(n+16,b,base) | 64 | #define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base) |
61 | 65 | ||
62 | #define SAVE_EVR(n,s,base) evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base) | 66 | #define SAVE_EVR(n,s,base) evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base) |
63 | #define SAVE_2EVR(n,s,base) SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base) | 67 | #define SAVE_2EVRS(n,s,base) SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base) |
64 | #define SAVE_4EVR(n,s,base) SAVE_2EVR(n,s,base); SAVE_2EVR(n+2,s,base) | 68 | #define SAVE_4EVRS(n,s,base) SAVE_2EVRS(n,s,base); SAVE_2EVRS(n+2,s,base) |
65 | #define SAVE_8EVR(n,s,base) SAVE_4EVR(n,s,base); SAVE_4EVR(n+4,s,base) | 69 | #define SAVE_8EVRS(n,s,base) SAVE_4EVRS(n,s,base); SAVE_4EVRS(n+4,s,base) |
66 | #define SAVE_16EVR(n,s,base) SAVE_8EVR(n,s,base); SAVE_8EVR(n+8,s,base) | 70 | #define SAVE_16EVRS(n,s,base) SAVE_8EVRS(n,s,base); SAVE_8EVRS(n+8,s,base) |
67 | #define SAVE_32EVR(n,s,base) SAVE_16EVR(n,s,base); SAVE_16EVR(n+16,s,base) | 71 | #define SAVE_32EVRS(n,s,base) SAVE_16EVRS(n,s,base); SAVE_16EVRS(n+16,s,base) |
68 | |||
69 | #define REST_EVR(n,s,base) lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n | 72 | #define REST_EVR(n,s,base) lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n |
70 | #define REST_2EVR(n,s,base) REST_EVR(n,s,base); REST_EVR(n+1,s,base) | 73 | #define REST_2EVRS(n,s,base) REST_EVR(n,s,base); REST_EVR(n+1,s,base) |
71 | #define REST_4EVR(n,s,base) REST_2EVR(n,s,base); REST_2EVR(n+2,s,base) | 74 | #define REST_4EVRS(n,s,base) REST_2EVRS(n,s,base); REST_2EVRS(n+2,s,base) |
72 | #define REST_8EVR(n,s,base) REST_4EVR(n,s,base); REST_4EVR(n+4,s,base) | 75 | #define REST_8EVRS(n,s,base) REST_4EVRS(n,s,base); REST_4EVRS(n+4,s,base) |
73 | #define REST_16EVR(n,s,base) REST_8EVR(n,s,base); REST_8EVR(n+8,s,base) | 76 | #define REST_16EVRS(n,s,base) REST_8EVRS(n,s,base); REST_8EVRS(n+8,s,base) |
74 | #define REST_32EVR(n,s,base) REST_16EVR(n,s,base); REST_16EVR(n+16,s,base) | 77 | #define REST_32EVRS(n,s,base) REST_16EVRS(n,s,base); REST_16EVRS(n+16,s,base) |
78 | |||
79 | /* Macros to adjust thread priority for hardware multithreading */ | ||
80 | #define HMT_VERY_LOW or 31,31,31 # very low priority | ||
81 | #define HMT_LOW or 1,1,1 | ||
82 | #define HMT_MEDIUM_LOW or 6,6,6 # medium low priority | ||
83 | #define HMT_MEDIUM or 2,2,2 | ||
84 | #define HMT_MEDIUM_HIGH or 5,5,5 # medium high priority | ||
85 | #define HMT_HIGH or 3,3,3 | ||
86 | |||
87 | /* handle instructions that older assemblers may not know */ | ||
88 | #define RFCI .long 0x4c000066 /* rfci instruction */ | ||
89 | #define RFDI .long 0x4c00004e /* rfdi instruction */ | ||
90 | #define RFMCI .long 0x4c00004c /* rfmci instruction */ | ||
91 | |||
92 | #ifdef CONFIG_PPC64 | ||
93 | |||
94 | #define XGLUE(a,b) a##b | ||
95 | #define GLUE(a,b) XGLUE(a,b) | ||
96 | |||
97 | #define _GLOBAL(name) \ | ||
98 | .section ".text"; \ | ||
99 | .align 2 ; \ | ||
100 | .globl name; \ | ||
101 | .globl GLUE(.,name); \ | ||
102 | .section ".opd","aw"; \ | ||
103 | name: \ | ||
104 | .quad GLUE(.,name); \ | ||
105 | .quad .TOC.@tocbase; \ | ||
106 | .quad 0; \ | ||
107 | .previous; \ | ||
108 | .type GLUE(.,name),@function; \ | ||
109 | GLUE(.,name): | ||
110 | |||
111 | #define _KPROBE(name) \ | ||
112 | .section ".kprobes.text","a"; \ | ||
113 | .align 2 ; \ | ||
114 | .globl name; \ | ||
115 | .globl GLUE(.,name); \ | ||
116 | .section ".opd","aw"; \ | ||
117 | name: \ | ||
118 | .quad GLUE(.,name); \ | ||
119 | .quad .TOC.@tocbase; \ | ||
120 | .quad 0; \ | ||
121 | .previous; \ | ||
122 | .type GLUE(.,name),@function; \ | ||
123 | GLUE(.,name): | ||
124 | |||
125 | #define _STATIC(name) \ | ||
126 | .section ".text"; \ | ||
127 | .align 2 ; \ | ||
128 | .section ".opd","aw"; \ | ||
129 | name: \ | ||
130 | .quad GLUE(.,name); \ | ||
131 | .quad .TOC.@tocbase; \ | ||
132 | .quad 0; \ | ||
133 | .previous; \ | ||
134 | .type GLUE(.,name),@function; \ | ||
135 | GLUE(.,name): | ||
136 | |||
137 | #else /* 32-bit */ | ||
138 | |||
139 | #define _GLOBAL(n) \ | ||
140 | .text; \ | ||
141 | .stabs __stringify(n:F-1),N_FUN,0,0,n;\ | ||
142 | .globl n; \ | ||
143 | n: | ||
144 | |||
145 | #define _KPROBE(n) \ | ||
146 | .section ".kprobes.text","a"; \ | ||
147 | .globl n; \ | ||
148 | n: | ||
149 | |||
150 | #endif | ||
151 | |||
152 | /* | ||
153 | * LOADADDR( rn, name ) | ||
154 | * loads the address of 'name' into 'rn' | ||
155 | * | ||
156 | * LOADBASE( rn, name ) | ||
157 | * loads the address (possibly without the low 16 bits) of 'name' into 'rn' | ||
158 | * suitable for base+disp addressing | ||
159 | */ | ||
160 | #ifdef __powerpc64__ | ||
161 | #define LOADADDR(rn,name) \ | ||
162 | lis rn,name##@highest; \ | ||
163 | ori rn,rn,name##@higher; \ | ||
164 | rldicr rn,rn,32,31; \ | ||
165 | oris rn,rn,name##@h; \ | ||
166 | ori rn,rn,name##@l | ||
167 | |||
168 | #define LOADBASE(rn,name) \ | ||
169 | ld rn,name@got(r2) | ||
170 | |||
171 | #define OFF(name) 0 | ||
172 | |||
173 | #define SET_REG_TO_CONST(reg, value) \ | ||
174 | lis reg,(((value)>>48)&0xFFFF); \ | ||
175 | ori reg,reg,(((value)>>32)&0xFFFF); \ | ||
176 | rldicr reg,reg,32,31; \ | ||
177 | oris reg,reg,(((value)>>16)&0xFFFF); \ | ||
178 | ori reg,reg,((value)&0xFFFF); | ||
179 | |||
180 | #define SET_REG_TO_LABEL(reg, label) \ | ||
181 | lis reg,(label)@highest; \ | ||
182 | ori reg,reg,(label)@higher; \ | ||
183 | rldicr reg,reg,32,31; \ | ||
184 | oris reg,reg,(label)@h; \ | ||
185 | ori reg,reg,(label)@l; | ||
186 | |||
187 | /* operations for longs and pointers */ | ||
188 | #define LDL ld | ||
189 | #define STL std | ||
190 | #define CMPI cmpdi | ||
191 | #define SZL 8 | ||
192 | |||
193 | /* offsets for stack frame layout */ | ||
194 | #define LRSAVE 16 | ||
195 | |||
196 | #else /* 32-bit */ | ||
197 | #define LOADADDR(rn,name) \ | ||
198 | lis rn,name@ha; \ | ||
199 | addi rn,rn,name@l | ||
200 | |||
201 | #define LOADBASE(rn,name) \ | ||
202 | lis rn,name@ha | ||
203 | |||
204 | #define OFF(name) name@l | ||
205 | |||
206 | /* operations for longs and pointers */ | ||
207 | #define LDL lwz | ||
208 | #define STL stw | ||
209 | #define CMPI cmpwi | ||
210 | #define SZL 4 | ||
211 | |||
212 | /* offsets for stack frame layout */ | ||
213 | #define LRSAVE 4 | ||
214 | |||
215 | #endif | ||
75 | 216 | ||
217 | /* various errata or part fixups */ | ||
76 | #ifdef CONFIG_PPC601_SYNC_FIX | 218 | #ifdef CONFIG_PPC601_SYNC_FIX |
77 | #define SYNC \ | 219 | #define SYNC \ |
78 | BEGIN_FTR_SECTION \ | 220 | BEGIN_FTR_SECTION \ |
@@ -93,6 +235,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_601) | |||
93 | #define ISYNC_601 | 235 | #define ISYNC_601 |
94 | #endif | 236 | #endif |
95 | 237 | ||
238 | |||
96 | #ifndef CONFIG_SMP | 239 | #ifndef CONFIG_SMP |
97 | #define TLBSYNC | 240 | #define TLBSYNC |
98 | #else /* CONFIG_SMP */ | 241 | #else /* CONFIG_SMP */ |
@@ -104,6 +247,7 @@ BEGIN_FTR_SECTION \ | |||
104 | END_FTR_SECTION_IFCLR(CPU_FTR_601) | 247 | END_FTR_SECTION_IFCLR(CPU_FTR_601) |
105 | #endif | 248 | #endif |
106 | 249 | ||
250 | |||
107 | /* | 251 | /* |
108 | * This instruction is not implemented on the PPC 603 or 601; however, on | 252 | * This instruction is not implemented on the PPC 603 or 601; however, on |
109 | * the 403GCX and 405GP tlbia IS defined and tlbie is not. | 253 | * the 403GCX and 405GP tlbia IS defined and tlbie is not. |
@@ -121,18 +265,52 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
121 | bdnz 0b | 265 | bdnz 0b |
122 | #endif | 266 | #endif |
123 | 267 | ||
124 | #ifdef CONFIG_BOOKE | 268 | |
269 | #ifdef CONFIG_IBM405_ERR77 | ||
270 | #define PPC405_ERR77(ra,rb) dcbt ra, rb; | ||
271 | #define PPC405_ERR77_SYNC sync; | ||
272 | #else | ||
273 | #define PPC405_ERR77(ra,rb) | ||
274 | #define PPC405_ERR77_SYNC | ||
275 | #endif | ||
276 | |||
277 | |||
278 | #ifdef CONFIG_IBM440EP_ERR42 | ||
279 | #define PPC440EP_ERR42 isync | ||
280 | #else | ||
281 | #define PPC440EP_ERR42 | ||
282 | #endif | ||
283 | |||
284 | |||
285 | #if defined(CONFIG_BOOKE) | ||
286 | #define toreal(rd) | ||
287 | #define fromreal(rd) | ||
288 | |||
125 | #define tophys(rd,rs) \ | 289 | #define tophys(rd,rs) \ |
126 | addis rd,rs,0 | 290 | addis rd,rs,0 |
127 | 291 | ||
128 | #define tovirt(rd,rs) \ | 292 | #define tovirt(rd,rs) \ |
129 | addis rd,rs,0 | 293 | addis rd,rs,0 |
130 | 294 | ||
131 | #else /* CONFIG_BOOKE */ | 295 | #elif defined(CONFIG_PPC64) |
296 | #define toreal(rd) /* we can access c000... in real mode */ | ||
297 | #define fromreal(rd) | ||
298 | |||
299 | #define tophys(rd,rs) \ | ||
300 | clrldi rd,rs,2 | ||
301 | |||
302 | #define tovirt(rd,rs) \ | ||
303 | rotldi rd,rs,16; \ | ||
304 | ori rd,rd,((KERNELBASE>>48)&0xFFFF);\ | ||
305 | rotldi rd,rd,48 | ||
306 | #else | ||
132 | /* | 307 | /* |
133 | * On APUS (Amiga PowerPC cpu upgrade board), we don't know the | 308 | * On APUS (Amiga PowerPC cpu upgrade board), we don't know the |
134 | * physical base address of RAM at compile time. | 309 | * physical base address of RAM at compile time. |
135 | */ | 310 | */ |
311 | #define toreal(rd) tophys(rd,rd) | ||
312 | #define fromreal(rd) tovirt(rd,rd) | ||
313 | |||
136 | #define tophys(rd,rs) \ | 314 | #define tophys(rd,rs) \ |
137 | 0: addis rd,rs,-KERNELBASE@h; \ | 315 | 0: addis rd,rs,-KERNELBASE@h; \ |
138 | .section ".vtop_fixup","aw"; \ | 316 | .section ".vtop_fixup","aw"; \ |
@@ -146,22 +324,11 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
146 | .align 1; \ | 324 | .align 1; \ |
147 | .long 0b; \ | 325 | .long 0b; \ |
148 | .previous | 326 | .previous |
149 | #endif /* CONFIG_BOOKE */ | 327 | #endif |
150 | 328 | ||
151 | /* | 329 | #ifdef CONFIG_PPC64 |
152 | * On 64-bit cpus, we use the rfid instruction instead of rfi, but | 330 | #define RFI rfid |
153 | * we then have to make sure we preserve the top 32 bits except for | 331 | #define MTMSRD(r) mtmsrd r |
154 | * the 64-bit mode bit, which we clear. | ||
155 | */ | ||
156 | #ifdef CONFIG_PPC64BRIDGE | ||
157 | #define FIX_SRR1(ra, rb) \ | ||
158 | mr rb,ra; \ | ||
159 | mfmsr ra; \ | ||
160 | clrldi ra,ra,1; /* turn off 64-bit mode */ \ | ||
161 | rldimi ra,rb,0,32 | ||
162 | #define RFI .long 0x4c000024 /* rfid instruction */ | ||
163 | #define MTMSRD(r) .long (0x7c000164 + ((r) << 21)) /* mtmsrd */ | ||
164 | #define CLR_TOP32(r) rlwinm (r),(r),0,0,31 /* clear top 32 bits */ | ||
165 | 332 | ||
166 | #else | 333 | #else |
167 | #define FIX_SRR1(ra, rb) | 334 | #define FIX_SRR1(ra, rb) |
@@ -172,24 +339,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
172 | #endif | 339 | #endif |
173 | #define MTMSRD(r) mtmsr r | 340 | #define MTMSRD(r) mtmsr r |
174 | #define CLR_TOP32(r) | 341 | #define CLR_TOP32(r) |
175 | #endif /* CONFIG_PPC64BRIDGE */ | ||
176 | |||
177 | #define RFCI .long 0x4c000066 /* rfci instruction */ | ||
178 | #define RFDI .long 0x4c00004e /* rfdi instruction */ | ||
179 | #define RFMCI .long 0x4c00004c /* rfmci instruction */ | ||
180 | |||
181 | #ifdef CONFIG_IBM405_ERR77 | ||
182 | #define PPC405_ERR77(ra,rb) dcbt ra, rb; | ||
183 | #define PPC405_ERR77_SYNC sync; | ||
184 | #else | ||
185 | #define PPC405_ERR77(ra,rb) | ||
186 | #define PPC405_ERR77_SYNC | ||
187 | #endif | ||
188 | |||
189 | #ifdef CONFIG_IBM440EP_ERR42 | ||
190 | #define PPC440EP_ERR42 isync | ||
191 | #else | ||
192 | #define PPC440EP_ERR42 | ||
193 | #endif | 342 | #endif |
194 | 343 | ||
195 | /* The boring bits... */ | 344 | /* The boring bits... */ |
@@ -277,6 +426,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
277 | #define fr30 30 | 426 | #define fr30 30 |
278 | #define fr31 31 | 427 | #define fr31 31 |
279 | 428 | ||
429 | /* AltiVec Registers (VPRs) */ | ||
430 | |||
280 | #define vr0 0 | 431 | #define vr0 0 |
281 | #define vr1 1 | 432 | #define vr1 1 |
282 | #define vr2 2 | 433 | #define vr2 2 |
@@ -310,6 +461,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
310 | #define vr30 30 | 461 | #define vr30 30 |
311 | #define vr31 31 | 462 | #define vr31 31 |
312 | 463 | ||
464 | /* SPE Registers (EVPRs) */ | ||
465 | |||
313 | #define evr0 0 | 466 | #define evr0 0 |
314 | #define evr1 1 | 467 | #define evr1 1 |
315 | #define evr2 2 | 468 | #define evr2 2 |
@@ -348,3 +501,11 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601) | |||
348 | #define N_RSYM 64 | 501 | #define N_RSYM 64 |
349 | #define N_SLINE 68 | 502 | #define N_SLINE 68 |
350 | #define N_SO 100 | 503 | #define N_SO 100 |
504 | |||
505 | #define ASM_CONST(x) x | ||
506 | #else | ||
507 | #define __ASM_CONST(x) x##UL | ||
508 | #define ASM_CONST(x) __ASM_CONST(x) | ||
509 | #endif /* __ASSEMBLY__ */ | ||
510 | |||
511 | #endif /* _ASM_POWERPC_PPC_ASM_H */ | ||
diff --git a/include/asm-ppc/processor.h b/include/asm-powerpc/processor.h index b05b5d9cae20..eee954a001fd 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -1,21 +1,28 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifndef _ASM_POWERPC_PROCESSOR_H |
2 | #ifndef __ASM_PPC_PROCESSOR_H | 2 | #define _ASM_POWERPC_PROCESSOR_H |
3 | #define __ASM_PPC_PROCESSOR_H | ||
4 | 3 | ||
5 | /* | 4 | /* |
6 | * Default implementation of macro that returns current | 5 | * Copyright (C) 2001 PPC 64 Team, IBM Corp |
7 | * instruction pointer ("program counter"). | 6 | * |
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | 11 | */ |
9 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | ||
10 | 12 | ||
11 | #include <linux/config.h> | 13 | #include <linux/config.h> |
12 | #include <linux/stringify.h> | 14 | #include <asm/reg.h> |
13 | 15 | ||
16 | #ifndef __ASSEMBLY__ | ||
17 | #include <linux/compiler.h> | ||
14 | #include <asm/ptrace.h> | 18 | #include <asm/ptrace.h> |
15 | #include <asm/types.h> | 19 | #include <asm/types.h> |
16 | #include <asm/mpc8xx.h> | 20 | #ifdef CONFIG_PPC64 |
17 | #include <asm/reg.h> | 21 | #include <asm/systemcfg.h> |
22 | #endif | ||
18 | 23 | ||
24 | #ifdef CONFIG_PPC32 | ||
25 | /* 32-bit platform types */ | ||
19 | /* We only need to define a new _MACH_xxx for machines which are part of | 26 | /* We only need to define a new _MACH_xxx for machines which are part of |
20 | * a configuration which supports more than one type of different machine. | 27 | * a configuration which supports more than one type of different machine. |
21 | * This is currently limited to CONFIG_PPC_MULTIPLATFORM and CHRP/PReP/PMac. | 28 | * This is currently limited to CONFIG_PPC_MULTIPLATFORM and CHRP/PReP/PMac. |
@@ -36,20 +43,6 @@ | |||
36 | #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ | 43 | #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ |
37 | #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ | 44 | #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ |
38 | 45 | ||
39 | #define _GLOBAL(n)\ | ||
40 | .stabs __stringify(n:F-1),N_FUN,0,0,n;\ | ||
41 | .globl n;\ | ||
42 | n: | ||
43 | |||
44 | /* | ||
45 | * this is the minimum allowable io space due to the location | ||
46 | * of the io areas on prep (first one at 0x80000000) but | ||
47 | * as soon as I get around to remapping the io areas with the BATs | ||
48 | * to match the mac we can raise this. -- Cort | ||
49 | */ | ||
50 | #define TASK_SIZE (CONFIG_TASK_SIZE) | ||
51 | |||
52 | #ifndef __ASSEMBLY__ | ||
53 | #ifdef CONFIG_PPC_MULTIPLATFORM | 46 | #ifdef CONFIG_PPC_MULTIPLATFORM |
54 | extern int _machine; | 47 | extern int _machine; |
55 | 48 | ||
@@ -67,17 +60,49 @@ extern unsigned char ucBoardRevMaj, ucBoardRevMin; | |||
67 | #else | 60 | #else |
68 | #define _machine 0 | 61 | #define _machine 0 |
69 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 62 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
63 | #endif /* CONFIG_PPC32 */ | ||
64 | |||
65 | #ifdef CONFIG_PPC64 | ||
66 | /* Platforms supported by PPC64 */ | ||
67 | #define PLATFORM_PSERIES 0x0100 | ||
68 | #define PLATFORM_PSERIES_LPAR 0x0101 | ||
69 | #define PLATFORM_ISERIES_LPAR 0x0201 | ||
70 | #define PLATFORM_LPAR 0x0001 | ||
71 | #define PLATFORM_POWERMAC 0x0400 | ||
72 | #define PLATFORM_MAPLE 0x0500 | ||
73 | #define PLATFORM_BPA 0x1000 | ||
74 | |||
75 | /* Compatibility with drivers coming from PPC32 world */ | ||
76 | #define _machine (systemcfg->platform) | ||
77 | #define _MACH_Pmac PLATFORM_POWERMAC | ||
78 | #endif | ||
79 | |||
80 | /* | ||
81 | * Default implementation of macro that returns current | ||
82 | * instruction pointer ("program counter"). | ||
83 | */ | ||
84 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | ||
85 | |||
86 | /* Macros for adjusting thread priority (hardware multi-threading) */ | ||
87 | #define HMT_very_low() asm volatile("or 31,31,31 # very low priority") | ||
88 | #define HMT_low() asm volatile("or 1,1,1 # low priority") | ||
89 | #define HMT_medium_low() asm volatile("or 6,6,6 # medium low priority") | ||
90 | #define HMT_medium() asm volatile("or 2,2,2 # medium priority") | ||
91 | #define HMT_medium_high() asm volatile("or 5,5,5 # medium high priority") | ||
92 | #define HMT_high() asm volatile("or 3,3,3 # high priority") | ||
93 | |||
94 | #ifdef __KERNEL__ | ||
95 | |||
96 | extern int have_of; | ||
70 | 97 | ||
71 | struct task_struct; | 98 | struct task_struct; |
72 | void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp); | 99 | void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp); |
73 | void release_thread(struct task_struct *); | 100 | void release_thread(struct task_struct *); |
74 | 101 | ||
75 | /* Prepare to copy thread state - unlazy all lazy status */ | 102 | /* Prepare to copy thread state - unlazy all lazy status */ |
76 | extern void prepare_to_copy(struct task_struct *tsk); | 103 | extern void prepare_to_copy(struct task_struct *tsk); |
77 | 104 | ||
78 | /* | 105 | /* Create a new kernel thread. */ |
79 | * Create a new kernel thread. | ||
80 | */ | ||
81 | extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 106 | extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
82 | 107 | ||
83 | /* Lazy FPU handling on uni-processor */ | 108 | /* Lazy FPU handling on uni-processor */ |
@@ -85,10 +110,37 @@ extern struct task_struct *last_task_used_math; | |||
85 | extern struct task_struct *last_task_used_altivec; | 110 | extern struct task_struct *last_task_used_altivec; |
86 | extern struct task_struct *last_task_used_spe; | 111 | extern struct task_struct *last_task_used_spe; |
87 | 112 | ||
113 | #ifdef CONFIG_PPC32 | ||
114 | #define TASK_SIZE (CONFIG_TASK_SIZE) | ||
115 | |||
88 | /* This decides where the kernel will search for a free chunk of vm | 116 | /* This decides where the kernel will search for a free chunk of vm |
89 | * space during mmap's. | 117 | * space during mmap's. |
90 | */ | 118 | */ |
91 | #define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3) | 119 | #define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3) |
120 | #endif | ||
121 | |||
122 | #ifdef CONFIG_PPC64 | ||
123 | /* 64-bit user address space is 44-bits (16TB user VM) */ | ||
124 | #define TASK_SIZE_USER64 (0x0000100000000000UL) | ||
125 | |||
126 | /* | ||
127 | * 32-bit user address space is 4GB - 1 page | ||
128 | * (this 1 page is needed so referencing of 0xFFFFFFFF generates EFAULT | ||
129 | */ | ||
130 | #define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE)) | ||
131 | |||
132 | #define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ | ||
133 | TASK_SIZE_USER32 : TASK_SIZE_USER64) | ||
134 | |||
135 | /* This decides where the kernel will search for a free chunk of vm | ||
136 | * space during mmap's. | ||
137 | */ | ||
138 | #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4)) | ||
139 | #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_USER64 / 4)) | ||
140 | |||
141 | #define TASK_UNMAPPED_BASE ((test_thread_flag(TIF_32BIT)) ? \ | ||
142 | TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) | ||
143 | #endif | ||
92 | 144 | ||
93 | typedef struct { | 145 | typedef struct { |
94 | unsigned long seg; | 146 | unsigned long seg; |
@@ -96,18 +148,32 @@ typedef struct { | |||
96 | 148 | ||
97 | struct thread_struct { | 149 | struct thread_struct { |
98 | unsigned long ksp; /* Kernel stack pointer */ | 150 | unsigned long ksp; /* Kernel stack pointer */ |
151 | #ifdef CONFIG_PPC64 | ||
152 | unsigned long ksp_vsid; | ||
153 | #endif | ||
99 | struct pt_regs *regs; /* Pointer to saved register state */ | 154 | struct pt_regs *regs; /* Pointer to saved register state */ |
100 | mm_segment_t fs; /* for get_fs() validation */ | 155 | mm_segment_t fs; /* for get_fs() validation */ |
156 | #ifdef CONFIG_PPC32 | ||
101 | void *pgdir; /* root of page-table tree */ | 157 | void *pgdir; /* root of page-table tree */ |
102 | int fpexc_mode; /* floating-point exception mode */ | ||
103 | signed long last_syscall; | 158 | signed long last_syscall; |
159 | #endif | ||
104 | #if defined(CONFIG_4xx) || defined (CONFIG_BOOKE) | 160 | #if defined(CONFIG_4xx) || defined (CONFIG_BOOKE) |
105 | unsigned long dbcr0; /* debug control register values */ | 161 | unsigned long dbcr0; /* debug control register values */ |
106 | unsigned long dbcr1; | 162 | unsigned long dbcr1; |
107 | #endif | 163 | #endif |
108 | double fpr[32]; /* Complete floating point set */ | 164 | double fpr[32]; /* Complete floating point set */ |
109 | unsigned long fpscr_pad; /* fpr ... fpscr must be contiguous */ | 165 | struct { /* fpr ... fpscr must be contiguous */ |
110 | unsigned long fpscr; /* Floating point status */ | 166 | |
167 | unsigned int pad; | ||
168 | unsigned int val; /* Floating point status */ | ||
169 | } fpscr; | ||
170 | int fpexc_mode; /* floating-point exception mode */ | ||
171 | #ifdef CONFIG_PPC64 | ||
172 | unsigned long start_tb; /* Start purr when proc switched in */ | ||
173 | unsigned long accum_tb; /* Total accumilated purr for process */ | ||
174 | unsigned long vdso_base; /* base of the vDSO library */ | ||
175 | #endif | ||
176 | unsigned long dabr; /* Data address breakpoint register */ | ||
111 | #ifdef CONFIG_ALTIVEC | 177 | #ifdef CONFIG_ALTIVEC |
112 | /* Complete AltiVec register set */ | 178 | /* Complete AltiVec register set */ |
113 | vector128 vr[32] __attribute((aligned(16))); | 179 | vector128 vr[32] __attribute((aligned(16))); |
@@ -128,51 +194,58 @@ struct thread_struct { | |||
128 | 194 | ||
129 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) | 195 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) |
130 | 196 | ||
197 | |||
198 | #ifdef CONFIG_PPC32 | ||
131 | #define INIT_THREAD { \ | 199 | #define INIT_THREAD { \ |
132 | .ksp = INIT_SP, \ | 200 | .ksp = INIT_SP, \ |
133 | .fs = KERNEL_DS, \ | 201 | .fs = KERNEL_DS, \ |
134 | .pgdir = swapper_pg_dir, \ | 202 | .pgdir = swapper_pg_dir, \ |
135 | .fpexc_mode = MSR_FE0 | MSR_FE1, \ | 203 | .fpexc_mode = MSR_FE0 | MSR_FE1, \ |
136 | } | 204 | } |
205 | #else | ||
206 | #define INIT_THREAD { \ | ||
207 | .ksp = INIT_SP, \ | ||
208 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ | ||
209 | .fs = KERNEL_DS, \ | ||
210 | .fpr = {0}, \ | ||
211 | .fpscr = { .val = 0, }, \ | ||
212 | .fpexc_mode = MSR_FE0|MSR_FE1, \ | ||
213 | } | ||
214 | #endif | ||
137 | 215 | ||
138 | /* | 216 | /* |
139 | * Return saved PC of a blocked thread. For now, this is the "user" PC | 217 | * Return saved PC of a blocked thread. For now, this is the "user" PC |
140 | */ | 218 | */ |
141 | #define thread_saved_pc(tsk) \ | 219 | #define thread_saved_pc(tsk) \ |
142 | ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) | 220 | ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) |
143 | 221 | ||
144 | unsigned long get_wchan(struct task_struct *p); | 222 | unsigned long get_wchan(struct task_struct *p); |
145 | 223 | ||
146 | #define KSTK_EIP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) | 224 | #define KSTK_EIP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) |
147 | #define KSTK_ESP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->gpr[1]: 0) | 225 | #define KSTK_ESP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->gpr[1]: 0) |
148 | 226 | ||
149 | /* Get/set floating-point exception mode */ | 227 | /* Get/set floating-point exception mode */ |
150 | #define GET_FPEXC_CTL(tsk, adr) get_fpexc_mode((tsk), (adr)) | 228 | #define GET_FPEXC_CTL(tsk, adr) get_fpexc_mode((tsk), (adr)) |
151 | #define SET_FPEXC_CTL(tsk, val) set_fpexc_mode((tsk), (val)) | 229 | #define SET_FPEXC_CTL(tsk, val) set_fpexc_mode((tsk), (val)) |
152 | 230 | ||
153 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); | 231 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); |
154 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); | 232 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); |
155 | 233 | ||
156 | static inline unsigned int __unpack_fe01(unsigned int msr_bits) | 234 | static inline unsigned int __unpack_fe01(unsigned long msr_bits) |
157 | { | 235 | { |
158 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); | 236 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); |
159 | } | 237 | } |
160 | 238 | ||
161 | static inline unsigned int __pack_fe01(unsigned int fpmode) | 239 | static inline unsigned long __pack_fe01(unsigned int fpmode) |
162 | { | 240 | { |
163 | return ((fpmode << 10) & MSR_FE0) | ((fpmode << 8) & MSR_FE1); | 241 | return ((fpmode << 10) & MSR_FE0) | ((fpmode << 8) & MSR_FE1); |
164 | } | 242 | } |
165 | 243 | ||
166 | /* in process.c - for early bootup debug -- Cort */ | 244 | #ifdef CONFIG_PPC64 |
167 | int ll_printk(const char *, ...); | 245 | #define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0) |
168 | void ll_puts(const char *); | 246 | #else |
169 | |||
170 | /* In misc.c */ | ||
171 | void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); | ||
172 | |||
173 | #define have_of (_machine == _MACH_chrp || _machine == _MACH_Pmac) | ||
174 | |||
175 | #define cpu_relax() barrier() | 247 | #define cpu_relax() barrier() |
248 | #endif | ||
176 | 249 | ||
177 | /* | 250 | /* |
178 | * Prefetch macros. | 251 | * Prefetch macros. |
@@ -181,21 +254,28 @@ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); | |||
181 | #define ARCH_HAS_PREFETCHW | 254 | #define ARCH_HAS_PREFETCHW |
182 | #define ARCH_HAS_SPINLOCK_PREFETCH | 255 | #define ARCH_HAS_SPINLOCK_PREFETCH |
183 | 256 | ||
184 | extern inline void prefetch(const void *x) | 257 | static inline void prefetch(const void *x) |
185 | { | 258 | { |
186 | __asm__ __volatile__ ("dcbt 0,%0" : : "r" (x)); | 259 | if (unlikely(!x)) |
260 | return; | ||
261 | |||
262 | __asm__ __volatile__ ("dcbt 0,%0" : : "r" (x)); | ||
187 | } | 263 | } |
188 | 264 | ||
189 | extern inline void prefetchw(const void *x) | 265 | static inline void prefetchw(const void *x) |
190 | { | 266 | { |
191 | __asm__ __volatile__ ("dcbtst 0,%0" : : "r" (x)); | 267 | if (unlikely(!x)) |
268 | return; | ||
269 | |||
270 | __asm__ __volatile__ ("dcbtst 0,%0" : : "r" (x)); | ||
192 | } | 271 | } |
193 | 272 | ||
194 | #define spin_lock_prefetch(x) prefetchw(x) | 273 | #define spin_lock_prefetch(x) prefetchw(x) |
195 | 274 | ||
196 | extern int emulate_altivec(struct pt_regs *regs); | 275 | #ifdef CONFIG_PPC64 |
197 | 276 | #define HAVE_ARCH_PICK_MMAP_LAYOUT | |
198 | #endif /* !__ASSEMBLY__ */ | 277 | #endif |
199 | 278 | ||
200 | #endif /* __ASM_PPC_PROCESSOR_H */ | ||
201 | #endif /* __KERNEL__ */ | 279 | #endif /* __KERNEL__ */ |
280 | #endif /* __ASSEMBLY__ */ | ||
281 | #endif /* _ASM_POWERPC_PROCESSOR_H */ | ||
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h new file mode 100644 index 000000000000..3a0104fa0462 --- /dev/null +++ b/include/asm-powerpc/prom.h | |||
@@ -0,0 +1,219 @@ | |||
1 | #ifndef _POWERPC_PROM_H | ||
2 | #define _POWERPC_PROM_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | /* | ||
6 | * Definitions for talking to the Open Firmware PROM on | ||
7 | * Power Macintosh computers. | ||
8 | * | ||
9 | * Copyright (C) 1996-2005 Paul Mackerras. | ||
10 | * | ||
11 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version | ||
16 | * 2 of the License, or (at your option) any later version. | ||
17 | */ | ||
18 | #include <linux/config.h> | ||
19 | #include <linux/types.h> | ||
20 | #include <linux/proc_fs.h> | ||
21 | #include <asm/atomic.h> | ||
22 | |||
23 | /* Definitions used by the flattened device tree */ | ||
24 | #define OF_DT_HEADER 0xd00dfeed /* marker */ | ||
25 | #define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ | ||
26 | #define OF_DT_END_NODE 0x2 /* End node */ | ||
27 | #define OF_DT_PROP 0x3 /* Property: name off, size, | ||
28 | * content */ | ||
29 | #define OF_DT_NOP 0x4 /* nop */ | ||
30 | #define OF_DT_END 0x9 | ||
31 | |||
32 | #define OF_DT_VERSION 0x10 | ||
33 | |||
34 | /* | ||
35 | * This is what gets passed to the kernel by prom_init or kexec | ||
36 | * | ||
37 | * The dt struct contains the device tree structure, full pathes and | ||
38 | * property contents. The dt strings contain a separate block with just | ||
39 | * the strings for the property names, and is fully page aligned and | ||
40 | * self contained in a page, so that it can be kept around by the kernel, | ||
41 | * each property name appears only once in this page (cheap compression) | ||
42 | * | ||
43 | * the mem_rsvmap contains a map of reserved ranges of physical memory, | ||
44 | * passing it here instead of in the device-tree itself greatly simplifies | ||
45 | * the job of everybody. It's just a list of u64 pairs (base/size) that | ||
46 | * ends when size is 0 | ||
47 | */ | ||
48 | struct boot_param_header | ||
49 | { | ||
50 | u32 magic; /* magic word OF_DT_HEADER */ | ||
51 | u32 totalsize; /* total size of DT block */ | ||
52 | u32 off_dt_struct; /* offset to structure */ | ||
53 | u32 off_dt_strings; /* offset to strings */ | ||
54 | u32 off_mem_rsvmap; /* offset to memory reserve map */ | ||
55 | u32 version; /* format version */ | ||
56 | u32 last_comp_version; /* last compatible version */ | ||
57 | /* version 2 fields below */ | ||
58 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | ||
59 | /* version 3 fields below */ | ||
60 | u32 dt_strings_size; /* size of the DT strings block */ | ||
61 | }; | ||
62 | |||
63 | |||
64 | |||
65 | typedef u32 phandle; | ||
66 | typedef u32 ihandle; | ||
67 | |||
68 | struct address_range { | ||
69 | unsigned long space; | ||
70 | unsigned long address; | ||
71 | unsigned long size; | ||
72 | }; | ||
73 | |||
74 | struct interrupt_info { | ||
75 | int line; | ||
76 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
77 | }; | ||
78 | |||
79 | struct pci_address { | ||
80 | u32 a_hi; | ||
81 | u32 a_mid; | ||
82 | u32 a_lo; | ||
83 | }; | ||
84 | |||
85 | struct isa_address { | ||
86 | u32 a_hi; | ||
87 | u32 a_lo; | ||
88 | }; | ||
89 | |||
90 | struct isa_range { | ||
91 | struct isa_address isa_addr; | ||
92 | struct pci_address pci_addr; | ||
93 | unsigned int size; | ||
94 | }; | ||
95 | |||
96 | struct reg_property { | ||
97 | unsigned long address; | ||
98 | unsigned long size; | ||
99 | }; | ||
100 | |||
101 | struct reg_property32 { | ||
102 | unsigned int address; | ||
103 | unsigned int size; | ||
104 | }; | ||
105 | |||
106 | struct reg_property64 { | ||
107 | u64 address; | ||
108 | u64 size; | ||
109 | }; | ||
110 | |||
111 | struct property { | ||
112 | char *name; | ||
113 | int length; | ||
114 | unsigned char *value; | ||
115 | struct property *next; | ||
116 | }; | ||
117 | |||
118 | struct device_node { | ||
119 | char *name; | ||
120 | char *type; | ||
121 | phandle node; | ||
122 | phandle linux_phandle; | ||
123 | int n_addrs; | ||
124 | struct address_range *addrs; | ||
125 | int n_intrs; | ||
126 | struct interrupt_info *intrs; | ||
127 | char *full_name; | ||
128 | |||
129 | struct property *properties; | ||
130 | struct device_node *parent; | ||
131 | struct device_node *child; | ||
132 | struct device_node *sibling; | ||
133 | struct device_node *next; /* next device of same type */ | ||
134 | struct device_node *allnext; /* next in list of all nodes */ | ||
135 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
136 | struct kref kref; | ||
137 | unsigned long _flags; | ||
138 | void *data; | ||
139 | }; | ||
140 | |||
141 | extern struct device_node *of_chosen; | ||
142 | |||
143 | /* flag descriptions */ | ||
144 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
145 | |||
146 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
147 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
148 | |||
149 | #define HAVE_ARCH_DEVTREE_FIXUPS | ||
150 | |||
151 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
152 | { | ||
153 | dn->pde = de; | ||
154 | } | ||
155 | |||
156 | |||
157 | /* OBSOLETE: Old style node lookup */ | ||
158 | extern struct device_node *find_devices(const char *name); | ||
159 | extern struct device_node *find_type_devices(const char *type); | ||
160 | extern struct device_node *find_path_device(const char *path); | ||
161 | extern struct device_node *find_compatible_devices(const char *type, | ||
162 | const char *compat); | ||
163 | extern struct device_node *find_all_nodes(void); | ||
164 | |||
165 | /* New style node lookup */ | ||
166 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
167 | const char *name); | ||
168 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
169 | const char *type); | ||
170 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
171 | const char *type, const char *compat); | ||
172 | extern struct device_node *of_find_node_by_path(const char *path); | ||
173 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
174 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | ||
175 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
176 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
177 | struct device_node *prev); | ||
178 | extern struct device_node *of_node_get(struct device_node *node); | ||
179 | extern void of_node_put(struct device_node *node); | ||
180 | |||
181 | /* For updating the device tree at runtime */ | ||
182 | extern void of_attach_node(struct device_node *); | ||
183 | extern void of_detach_node(const struct device_node *); | ||
184 | |||
185 | /* Other Prototypes */ | ||
186 | extern void finish_device_tree(void); | ||
187 | extern void unflatten_device_tree(void); | ||
188 | extern void early_init_devtree(void *); | ||
189 | extern int device_is_compatible(struct device_node *device, const char *); | ||
190 | extern int machine_is_compatible(const char *compat); | ||
191 | extern unsigned char *get_property(struct device_node *node, const char *name, | ||
192 | int *lenp); | ||
193 | extern void print_properties(struct device_node *node); | ||
194 | extern int prom_n_addr_cells(struct device_node* np); | ||
195 | extern int prom_n_size_cells(struct device_node* np); | ||
196 | extern int prom_n_intr_cells(struct device_node* np); | ||
197 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | ||
198 | extern void prom_add_property(struct device_node* np, struct property* prop); | ||
199 | |||
200 | #ifdef CONFIG_PPC32 | ||
201 | /* | ||
202 | * PCI <-> OF matching functions | ||
203 | * (XXX should these be here?) | ||
204 | */ | ||
205 | struct pci_bus; | ||
206 | struct pci_dev; | ||
207 | extern int pci_device_from_OF_node(struct device_node *node, | ||
208 | u8* bus, u8* devfn); | ||
209 | extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int); | ||
210 | extern struct device_node* pci_device_to_OF_node(struct pci_dev *); | ||
211 | extern void pci_create_OF_bus_map(void); | ||
212 | #endif | ||
213 | |||
214 | extern struct resource *request_OF_resource(struct device_node* node, | ||
215 | int index, const char* name_postfix); | ||
216 | extern int release_OF_resource(struct device_node* node, int index); | ||
217 | |||
218 | #endif /* __KERNEL__ */ | ||
219 | #endif /* _POWERPC_PROM_H */ | ||
diff --git a/include/asm-ppc/reg.h b/include/asm-powerpc/reg.h index 73c33e3ef9c6..da848412f11b 100644 --- a/include/asm-ppc/reg.h +++ b/include/asm-powerpc/reg.h | |||
@@ -6,53 +6,107 @@ | |||
6 | * Implementations of the PowerPC Architecture (a.k.a. Green Book) here. | 6 | * Implementations of the PowerPC Architecture (a.k.a. Green Book) here. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifndef _ASM_POWERPC_REG_H | ||
10 | #define _ASM_POWERPC_REG_H | ||
9 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
10 | #ifndef __ASM_PPC_REGS_H__ | ||
11 | #define __ASM_PPC_REGS_H__ | ||
12 | 12 | ||
13 | #include <linux/stringify.h> | 13 | #include <linux/stringify.h> |
14 | #include <asm/cputable.h> | ||
14 | 15 | ||
15 | /* Pickup Book E specific registers. */ | 16 | /* Pickup Book E specific registers. */ |
16 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) | 17 | #if defined(CONFIG_BOOKE) || defined(CONFIG_40x) |
17 | #include <asm/reg_booke.h> | 18 | #include <asm/reg_booke.h> |
18 | #endif | 19 | #endif |
19 | 20 | ||
20 | /* Machine State Register (MSR) Fields */ | 21 | #define MSR_SF_LG 63 /* Enable 64 bit mode */ |
21 | #define MSR_SF (1<<63) | 22 | #define MSR_ISF_LG 61 /* Interrupt 64b mode valid on 630 */ |
22 | #define MSR_ISF (1<<61) | 23 | #define MSR_HV_LG 60 /* Hypervisor state */ |
23 | #define MSR_VEC (1<<25) /* Enable AltiVec */ | 24 | #define MSR_VEC_LG 25 /* Enable AltiVec */ |
24 | #define MSR_POW (1<<18) /* Enable Power Management */ | 25 | #define MSR_POW_LG 18 /* Enable Power Management */ |
25 | #define MSR_WE (1<<18) /* Wait State Enable */ | 26 | #define MSR_WE_LG 18 /* Wait State Enable */ |
26 | #define MSR_TGPR (1<<17) /* TLB Update registers in use */ | 27 | #define MSR_TGPR_LG 17 /* TLB Update registers in use */ |
27 | #define MSR_CE (1<<17) /* Critical Interrupt Enable */ | 28 | #define MSR_CE_LG 17 /* Critical Interrupt Enable */ |
28 | #define MSR_ILE (1<<16) /* Interrupt Little Endian */ | 29 | #define MSR_ILE_LG 16 /* Interrupt Little Endian */ |
29 | #define MSR_EE (1<<15) /* External Interrupt Enable */ | 30 | #define MSR_EE_LG 15 /* External Interrupt Enable */ |
30 | #define MSR_PR (1<<14) /* Problem State / Privilege Level */ | 31 | #define MSR_PR_LG 14 /* Problem State / Privilege Level */ |
31 | #define MSR_FP (1<<13) /* Floating Point enable */ | 32 | #define MSR_FP_LG 13 /* Floating Point enable */ |
32 | #define MSR_ME (1<<12) /* Machine Check Enable */ | 33 | #define MSR_ME_LG 12 /* Machine Check Enable */ |
33 | #define MSR_FE0 (1<<11) /* Floating Exception mode 0 */ | 34 | #define MSR_FE0_LG 11 /* Floating Exception mode 0 */ |
34 | #define MSR_SE (1<<10) /* Single Step */ | 35 | #define MSR_SE_LG 10 /* Single Step */ |
35 | #define MSR_BE (1<<9) /* Branch Trace */ | 36 | #define MSR_BE_LG 9 /* Branch Trace */ |
36 | #define MSR_DE (1<<9) /* Debug Exception Enable */ | 37 | #define MSR_DE_LG 9 /* Debug Exception Enable */ |
37 | #define MSR_FE1 (1<<8) /* Floating Exception mode 1 */ | 38 | #define MSR_FE1_LG 8 /* Floating Exception mode 1 */ |
38 | #define MSR_IP (1<<6) /* Exception prefix 0x000/0xFFF */ | 39 | #define MSR_IP_LG 6 /* Exception prefix 0x000/0xFFF */ |
39 | #define MSR_IR (1<<5) /* Instruction Relocate */ | 40 | #define MSR_IR_LG 5 /* Instruction Relocate */ |
40 | #define MSR_DR (1<<4) /* Data Relocate */ | 41 | #define MSR_DR_LG 4 /* Data Relocate */ |
41 | #define MSR_PE (1<<3) /* Protection Enable */ | 42 | #define MSR_PE_LG 3 /* Protection Enable */ |
42 | #define MSR_PX (1<<2) /* Protection Exclusive Mode */ | 43 | #define MSR_PX_LG 2 /* Protection Exclusive Mode */ |
43 | #define MSR_RI (1<<1) /* Recoverable Exception */ | 44 | #define MSR_PMM_LG 2 /* Performance monitor */ |
44 | #define MSR_LE (1<<0) /* Little Endian */ | 45 | #define MSR_RI_LG 1 /* Recoverable Exception */ |
46 | #define MSR_LE_LG 0 /* Little Endian */ | ||
45 | 47 | ||
48 | #ifdef __ASSEMBLY__ | ||
49 | #define __MASK(X) (1<<(X)) | ||
50 | #else | ||
51 | #define __MASK(X) (1UL<<(X)) | ||
52 | #endif | ||
53 | |||
54 | #ifdef CONFIG_PPC64 | ||
55 | #define MSR_SF __MASK(MSR_SF_LG) /* Enable 64 bit mode */ | ||
56 | #define MSR_ISF __MASK(MSR_ISF_LG) /* Interrupt 64b mode valid on 630 */ | ||
57 | #define MSR_HV __MASK(MSR_HV_LG) /* Hypervisor state */ | ||
58 | #else | ||
59 | /* so tests for these bits fail on 32-bit */ | ||
60 | #define MSR_SF 0 | ||
61 | #define MSR_ISF 0 | ||
62 | #define MSR_HV 0 | ||
63 | #endif | ||
64 | |||
65 | #define MSR_VEC __MASK(MSR_VEC_LG) /* Enable AltiVec */ | ||
66 | #define MSR_POW __MASK(MSR_POW_LG) /* Enable Power Management */ | ||
67 | #define MSR_WE __MASK(MSR_WE_LG) /* Wait State Enable */ | ||
68 | #define MSR_TGPR __MASK(MSR_TGPR_LG) /* TLB Update registers in use */ | ||
69 | #define MSR_CE __MASK(MSR_CE_LG) /* Critical Interrupt Enable */ | ||
70 | #define MSR_ILE __MASK(MSR_ILE_LG) /* Interrupt Little Endian */ | ||
71 | #define MSR_EE __MASK(MSR_EE_LG) /* External Interrupt Enable */ | ||
72 | #define MSR_PR __MASK(MSR_PR_LG) /* Problem State / Privilege Level */ | ||
73 | #define MSR_FP __MASK(MSR_FP_LG) /* Floating Point enable */ | ||
74 | #define MSR_ME __MASK(MSR_ME_LG) /* Machine Check Enable */ | ||
75 | #define MSR_FE0 __MASK(MSR_FE0_LG) /* Floating Exception mode 0 */ | ||
76 | #define MSR_SE __MASK(MSR_SE_LG) /* Single Step */ | ||
77 | #define MSR_BE __MASK(MSR_BE_LG) /* Branch Trace */ | ||
78 | #define MSR_DE __MASK(MSR_DE_LG) /* Debug Exception Enable */ | ||
79 | #define MSR_FE1 __MASK(MSR_FE1_LG) /* Floating Exception mode 1 */ | ||
80 | #define MSR_IP __MASK(MSR_IP_LG) /* Exception prefix 0x000/0xFFF */ | ||
81 | #define MSR_IR __MASK(MSR_IR_LG) /* Instruction Relocate */ | ||
82 | #define MSR_DR __MASK(MSR_DR_LG) /* Data Relocate */ | ||
83 | #define MSR_PE __MASK(MSR_PE_LG) /* Protection Enable */ | ||
84 | #define MSR_PX __MASK(MSR_PX_LG) /* Protection Exclusive Mode */ | ||
85 | #ifndef MSR_PMM | ||
86 | #define MSR_PMM __MASK(MSR_PMM_LG) /* Performance monitor */ | ||
87 | #endif | ||
88 | #define MSR_RI __MASK(MSR_RI_LG) /* Recoverable Exception */ | ||
89 | #define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */ | ||
90 | |||
91 | #ifdef CONFIG_PPC64 | ||
92 | #define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF | ||
93 | #define MSR_KERNEL MSR_ | MSR_SF | MSR_HV | ||
94 | |||
95 | #define MSR_USER32 MSR_ | MSR_PR | MSR_EE | ||
96 | #define MSR_USER64 MSR_USER32 | MSR_SF | ||
97 | |||
98 | #else /* 32-bit */ | ||
46 | /* Default MSR for kernel mode. */ | 99 | /* Default MSR for kernel mode. */ |
100 | #ifndef MSR_KERNEL /* reg_booke.h also defines this */ | ||
47 | #ifdef CONFIG_APUS_FAST_EXCEPT | 101 | #ifdef CONFIG_APUS_FAST_EXCEPT |
48 | #define MSR_KERNEL (MSR_ME|MSR_IP|MSR_RI|MSR_IR|MSR_DR) | 102 | #define MSR_KERNEL (MSR_ME|MSR_IP|MSR_RI|MSR_IR|MSR_DR) |
49 | #endif | 103 | #else |
50 | |||
51 | #ifndef MSR_KERNEL | ||
52 | #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR) | 104 | #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR) |
53 | #endif | 105 | #endif |
106 | #endif | ||
54 | 107 | ||
55 | #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) | 108 | #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) |
109 | #endif | ||
56 | 110 | ||
57 | /* Floating Point Status and Control Register (FPSCR) Fields */ | 111 | /* Floating Point Status and Control Register (FPSCR) Fields */ |
58 | #define FPSCR_FX 0x80000000 /* FPU exception summary */ | 112 | #define FPSCR_FX 0x80000000 /* FPU exception summary */ |
@@ -60,7 +114,7 @@ | |||
60 | #define FPSCR_VX 0x20000000 /* Invalid operation summary */ | 114 | #define FPSCR_VX 0x20000000 /* Invalid operation summary */ |
61 | #define FPSCR_OX 0x10000000 /* Overflow exception summary */ | 115 | #define FPSCR_OX 0x10000000 /* Overflow exception summary */ |
62 | #define FPSCR_UX 0x08000000 /* Underflow exception summary */ | 116 | #define FPSCR_UX 0x08000000 /* Underflow exception summary */ |
63 | #define FPSCR_ZX 0x04000000 /* Zero-devide exception summary */ | 117 | #define FPSCR_ZX 0x04000000 /* Zero-divide exception summary */ |
64 | #define FPSCR_XX 0x02000000 /* Inexact exception summary */ | 118 | #define FPSCR_XX 0x02000000 /* Inexact exception summary */ |
65 | #define FPSCR_VXSNAN 0x01000000 /* Invalid op for SNaN */ | 119 | #define FPSCR_VXSNAN 0x01000000 /* Invalid op for SNaN */ |
66 | #define FPSCR_VXISI 0x00800000 /* Invalid op for Inv - Inv */ | 120 | #define FPSCR_VXISI 0x00800000 /* Invalid op for Inv - Inv */ |
@@ -85,8 +139,18 @@ | |||
85 | 139 | ||
86 | /* Special Purpose Registers (SPRNs)*/ | 140 | /* Special Purpose Registers (SPRNs)*/ |
87 | #define SPRN_CTR 0x009 /* Count Register */ | 141 | #define SPRN_CTR 0x009 /* Count Register */ |
142 | #define SPRN_CTRLF 0x088 | ||
143 | #define SPRN_CTRLT 0x098 | ||
144 | #define CTRL_RUNLATCH 0x1 | ||
88 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ | 145 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ |
146 | #define DABR_TRANSLATION (1UL << 2) | ||
89 | #define SPRN_DAR 0x013 /* Data Address Register */ | 147 | #define SPRN_DAR 0x013 /* Data Address Register */ |
148 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ | ||
149 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ | ||
150 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ | ||
151 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ | ||
152 | #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ | ||
153 | #define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ | ||
90 | #define SPRN_TBRL 0x10C /* Time Base Read Lower Register (user, R/O) */ | 154 | #define SPRN_TBRL 0x10C /* Time Base Read Lower Register (user, R/O) */ |
91 | #define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ | 155 | #define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ |
92 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */ | 156 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */ |
@@ -131,7 +195,6 @@ | |||
131 | #define DER_EBRKE 0x00000002 /* External Breakpoint Interrupt */ | 195 | #define DER_EBRKE 0x00000002 /* External Breakpoint Interrupt */ |
132 | #define DER_DPIE 0x00000001 /* Dev. Port Nonmaskable Request */ | 196 | #define DER_DPIE 0x00000001 /* Dev. Port Nonmaskable Request */ |
133 | #define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */ | 197 | #define SPRN_DMISS 0x3D0 /* Data TLB Miss Register */ |
134 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ | ||
135 | #define SPRN_EAR 0x11A /* External Address Register */ | 198 | #define SPRN_EAR 0x11A /* External Address Register */ |
136 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ | 199 | #define SPRN_HASH1 0x3D2 /* Primary Hash Address Register */ |
137 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ | 200 | #define SPRN_HASH2 0x3D3 /* Secondary Hash Address Resgister */ |
@@ -187,6 +250,16 @@ | |||
187 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | 250 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ |
188 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ | 251 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ |
189 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | 252 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ |
253 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ | ||
254 | #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ | ||
255 | #define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */ | ||
256 | #define SPRN_TSCR 0x399 /* Thread switch control on BE */ | ||
257 | #define SPRN_TTR 0x39A /* Thread switch timeout on BE */ | ||
258 | #define TSCR_DEC_ENABLE 0x200000 /* Decrementer Interrupt */ | ||
259 | #define TSCR_EE_ENABLE 0x100000 /* External Interrupt */ | ||
260 | #define TSCR_EE_BOOST 0x080000 /* External Interrupt Boost */ | ||
261 | #define SPRN_TSC 0x3FD /* Thread switch control on others */ | ||
262 | #define SPRN_TST 0x3FC /* Thread switch timeout on others */ | ||
190 | #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2) | 263 | #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2) |
191 | #define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ | 264 | #define SPRN_IAC1 0x3F4 /* Instruction Address Compare 1 */ |
192 | #define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ | 265 | #define SPRN_IAC2 0x3F5 /* Instruction Address Compare 2 */ |
@@ -270,22 +343,18 @@ | |||
270 | #define L3CR_L3DO 0x00000040 /* L3 data only mode */ | 343 | #define L3CR_L3DO 0x00000040 /* L3 data only mode */ |
271 | #define L3CR_PMEN 0x00000004 /* L3 private memory enable */ | 344 | #define L3CR_PMEN 0x00000004 /* L3 private memory enable */ |
272 | #define L3CR_PMSIZ 0x00000001 /* L3 private memory size */ | 345 | #define L3CR_PMSIZ 0x00000001 /* L3 private memory size */ |
346 | |||
273 | #define SPRN_MSSCR0 0x3f6 /* Memory Subsystem Control Register 0 */ | 347 | #define SPRN_MSSCR0 0x3f6 /* Memory Subsystem Control Register 0 */ |
274 | #define SPRN_MSSSR0 0x3f7 /* Memory Subsystem Status Register 1 */ | 348 | #define SPRN_MSSSR0 0x3f7 /* Memory Subsystem Status Register 1 */ |
275 | #define SPRN_LDSTCR 0x3f8 /* Load/Store control register */ | 349 | #define SPRN_LDSTCR 0x3f8 /* Load/Store control register */ |
276 | #define SPRN_LDSTDB 0x3f4 /* */ | 350 | #define SPRN_LDSTDB 0x3f4 /* */ |
277 | #define SPRN_LR 0x008 /* Link Register */ | 351 | #define SPRN_LR 0x008 /* Link Register */ |
278 | #define SPRN_MMCR0 0x3B8 /* Monitor Mode Control Register 0 */ | ||
279 | #define SPRN_MMCR1 0x3BC /* Monitor Mode Control Register 1 */ | ||
280 | #ifndef SPRN_PIR | 352 | #ifndef SPRN_PIR |
281 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ | 353 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ |
282 | #endif | 354 | #endif |
283 | #define SPRN_PMC1 0x3B9 /* Performance Counter Register 1 */ | ||
284 | #define SPRN_PMC2 0x3BA /* Performance Counter Register 2 */ | ||
285 | #define SPRN_PMC3 0x3BD /* Performance Counter Register 3 */ | ||
286 | #define SPRN_PMC4 0x3BE /* Performance Counter Register 4 */ | ||
287 | #define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ | 355 | #define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */ |
288 | #define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ | 356 | #define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */ |
357 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Reg */ | ||
289 | #define SPRN_PVR 0x11F /* Processor Version Register */ | 358 | #define SPRN_PVR 0x11F /* Processor Version Register */ |
290 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ | 359 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ |
291 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ | 360 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ |
@@ -327,6 +396,52 @@ | |||
327 | #define SPRN_VRSAVE 0x100 /* Vector Register Save Register */ | 396 | #define SPRN_VRSAVE 0x100 /* Vector Register Save Register */ |
328 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ | 397 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ |
329 | 398 | ||
399 | /* Performance monitor SPRs */ | ||
400 | #ifdef CONFIG_PPC64 | ||
401 | #define SPRN_MMCR0 795 | ||
402 | #define MMCR0_FC 0x80000000UL /* freeze counters */ | ||
403 | #define MMCR0_FCS 0x40000000UL /* freeze in supervisor state */ | ||
404 | #define MMCR0_KERNEL_DISABLE MMCR0_FCS | ||
405 | #define MMCR0_FCP 0x20000000UL /* freeze in problem state */ | ||
406 | #define MMCR0_PROBLEM_DISABLE MMCR0_FCP | ||
407 | #define MMCR0_FCM1 0x10000000UL /* freeze counters while MSR mark = 1 */ | ||
408 | #define MMCR0_FCM0 0x08000000UL /* freeze counters while MSR mark = 0 */ | ||
409 | #define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */ | ||
410 | #define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */ | ||
411 | #define MMCR0_TBEE 0x00400000UL /* time base exception enable */ | ||
412 | #define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/ | ||
413 | #define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/ | ||
414 | #define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */ | ||
415 | #define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */ | ||
416 | #define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */ | ||
417 | #define MMCR0_FCTI 0x00000008UL /* freeze counters in tags inactive mode */ | ||
418 | #define MMCR0_FCTA 0x00000004UL /* freeze counters in tags active mode */ | ||
419 | #define MMCR0_FCWAIT 0x00000002UL /* freeze counter in WAIT state */ | ||
420 | #define MMCR0_FCHV 0x00000001UL /* freeze conditions in hypervisor mode */ | ||
421 | #define SPRN_MMCR1 798 | ||
422 | #define SPRN_MMCRA 0x312 | ||
423 | #define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ | ||
424 | #define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ | ||
425 | #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ | ||
426 | #define SPRN_PMC1 787 | ||
427 | #define SPRN_PMC2 788 | ||
428 | #define SPRN_PMC3 789 | ||
429 | #define SPRN_PMC4 790 | ||
430 | #define SPRN_PMC5 791 | ||
431 | #define SPRN_PMC6 792 | ||
432 | #define SPRN_PMC7 793 | ||
433 | #define SPRN_PMC8 794 | ||
434 | #define SPRN_SIAR 780 | ||
435 | #define SPRN_SDAR 781 | ||
436 | |||
437 | #else /* 32-bit */ | ||
438 | #define SPRN_MMCR0 0x3B8 /* Monitor Mode Control Register 0 */ | ||
439 | #define SPRN_MMCR1 0x3BC /* Monitor Mode Control Register 1 */ | ||
440 | #define SPRN_PMC1 0x3B9 /* Performance Counter Register 1 */ | ||
441 | #define SPRN_PMC2 0x3BA /* Performance Counter Register 2 */ | ||
442 | #define SPRN_PMC3 0x3BD /* Performance Counter Register 3 */ | ||
443 | #define SPRN_PMC4 0x3BE /* Performance Counter Register 4 */ | ||
444 | |||
330 | /* Bit definitions for MMCR0 and PMC1 / PMC2. */ | 445 | /* Bit definitions for MMCR0 and PMC1 / PMC2. */ |
331 | #define MMCR0_PMC1_CYCLES (1 << 7) | 446 | #define MMCR0_PMC1_CYCLES (1 << 7) |
332 | #define MMCR0_PMC1_ICACHEMISS (5 << 7) | 447 | #define MMCR0_PMC1_ICACHEMISS (5 << 7) |
@@ -336,14 +451,15 @@ | |||
336 | #define MMCR0_PMC2_ITLB 0x7 | 451 | #define MMCR0_PMC2_ITLB 0x7 |
337 | #define MMCR0_PMC2_LOADMISSTIME 0x5 | 452 | #define MMCR0_PMC2_LOADMISSTIME 0x5 |
338 | #define MMCR0_PMXE (1 << 26) | 453 | #define MMCR0_PMXE (1 << 26) |
339 | 454 | #endif | |
340 | /* Processor Version Register */ | ||
341 | 455 | ||
342 | /* Processor Version Register (PVR) field extraction */ | 456 | /* Processor Version Register (PVR) field extraction */ |
343 | 457 | ||
344 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ | 458 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ |
345 | #define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */ | 459 | #define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */ |
346 | 460 | ||
461 | #define __is_processor(pv) (PVR_VER(mfspr(SPRN_PVR)) == (pv)) | ||
462 | |||
347 | /* | 463 | /* |
348 | * IBM has further subdivided the standard PowerPC 16-bit version and | 464 | * IBM has further subdivided the standard PowerPC 16-bit version and |
349 | * revision subfields of the PVR for the PowerPC 403s into the following: | 465 | * revision subfields of the PVR for the PowerPC 403s into the following: |
@@ -399,42 +515,99 @@ | |||
399 | #define PVR_8245 0x80811014 | 515 | #define PVR_8245 0x80811014 |
400 | #define PVR_8260 PVR_8240 | 516 | #define PVR_8260 PVR_8240 |
401 | 517 | ||
402 | #if 0 | 518 | /* 64-bit processors */ |
403 | /* Segment Registers */ | 519 | /* XXX the prefix should be PVR_, we'll do a global sweep to fix it one day */ |
404 | #define SR0 0 | 520 | #define PV_NORTHSTAR 0x0033 |
405 | #define SR1 1 | 521 | #define PV_PULSAR 0x0034 |
406 | #define SR2 2 | 522 | #define PV_POWER4 0x0035 |
407 | #define SR3 3 | 523 | #define PV_ICESTAR 0x0036 |
408 | #define SR4 4 | 524 | #define PV_SSTAR 0x0037 |
409 | #define SR5 5 | 525 | #define PV_POWER4p 0x0038 |
410 | #define SR6 6 | 526 | #define PV_970 0x0039 |
411 | #define SR7 7 | 527 | #define PV_POWER5 0x003A |
412 | #define SR8 8 | 528 | #define PV_POWER5p 0x003B |
413 | #define SR9 9 | 529 | #define PV_970FX 0x003C |
414 | #define SR10 10 | 530 | #define PV_630 0x0040 |
415 | #define SR11 11 | 531 | #define PV_630p 0x0041 |
416 | #define SR12 12 | 532 | #define PV_970MP 0x0044 |
417 | #define SR13 13 | 533 | #define PV_BE 0x0070 |
418 | #define SR14 14 | 534 | |
419 | #define SR15 15 | 535 | /* |
420 | #endif | 536 | * Number of entries in the SLB. If this ever changes we should handle |
537 | * it with a use a cpu feature fixup. | ||
538 | */ | ||
539 | #define SLB_NUM_ENTRIES 64 | ||
421 | 540 | ||
422 | /* Macros for setting and retrieving special purpose registers */ | 541 | /* Macros for setting and retrieving special purpose registers */ |
423 | #ifndef __ASSEMBLY__ | 542 | #ifndef __ASSEMBLY__ |
424 | #define mfmsr() ({unsigned int rval; \ | 543 | #define mfmsr() ({unsigned long rval; \ |
425 | asm volatile("mfmsr %0" : "=r" (rval)); rval;}) | 544 | asm volatile("mfmsr %0" : "=r" (rval)); rval;}) |
545 | #ifdef CONFIG_PPC64 | ||
546 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ | ||
547 | : : "r" (v)) | ||
548 | #define mtmsrd(v) __mtmsrd((v), 0) | ||
549 | #define mtmsr(v) mtmsrd(v) | ||
550 | #else | ||
426 | #define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v)) | 551 | #define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v)) |
552 | #endif | ||
427 | 553 | ||
428 | #define mfspr(rn) ({unsigned int rval; \ | 554 | #define mfspr(rn) ({unsigned long rval; \ |
429 | asm volatile("mfspr %0," __stringify(rn) \ | 555 | asm volatile("mfspr %0," __stringify(rn) \ |
430 | : "=r" (rval)); rval;}) | 556 | : "=r" (rval)); rval;}) |
431 | #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) | 557 | #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) |
432 | 558 | ||
559 | #define mftb() ({unsigned long rval; \ | ||
560 | asm volatile("mftb %0" : "=r" (rval)); rval;}) | ||
561 | #define mftbl() ({unsigned long rval; \ | ||
562 | asm volatile("mftbl %0" : "=r" (rval)); rval;}) | ||
563 | |||
564 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) | ||
565 | #define mttbu(v) asm volatile("mttbu %0":: "r"(v)) | ||
566 | |||
567 | #ifdef CONFIG_PPC32 | ||
433 | #define mfsrin(v) ({unsigned int rval; \ | 568 | #define mfsrin(v) ({unsigned int rval; \ |
434 | asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \ | 569 | asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \ |
435 | rval;}) | 570 | rval;}) |
571 | #endif | ||
436 | 572 | ||
437 | #define proc_trap() asm volatile("trap") | 573 | #define proc_trap() asm volatile("trap") |
574 | |||
575 | #ifdef CONFIG_PPC64 | ||
576 | static inline void ppc64_runlatch_on(void) | ||
577 | { | ||
578 | unsigned long ctrl; | ||
579 | |||
580 | if (cpu_has_feature(CPU_FTR_CTRL)) { | ||
581 | ctrl = mfspr(SPRN_CTRLF); | ||
582 | ctrl |= CTRL_RUNLATCH; | ||
583 | mtspr(SPRN_CTRLT, ctrl); | ||
584 | } | ||
585 | } | ||
586 | |||
587 | static inline void ppc64_runlatch_off(void) | ||
588 | { | ||
589 | unsigned long ctrl; | ||
590 | |||
591 | if (cpu_has_feature(CPU_FTR_CTRL)) { | ||
592 | ctrl = mfspr(SPRN_CTRLF); | ||
593 | ctrl &= ~CTRL_RUNLATCH; | ||
594 | mtspr(SPRN_CTRLT, ctrl); | ||
595 | } | ||
596 | } | ||
597 | #endif | ||
598 | |||
599 | #define __get_SP() ({unsigned long sp; \ | ||
600 | asm volatile("mr %0,1": "=r" (sp)); sp;}) | ||
601 | |||
602 | #else /* __ASSEMBLY__ */ | ||
603 | |||
604 | #define RUNLATCH_ON(REG) \ | ||
605 | BEGIN_FTR_SECTION \ | ||
606 | mfspr (REG),SPRN_CTRLF; \ | ||
607 | ori (REG),(REG),CTRL_RUNLATCH; \ | ||
608 | mtspr SPRN_CTRLT,(REG); \ | ||
609 | END_FTR_SECTION_IFSET(CPU_FTR_CTRL) | ||
610 | |||
438 | #endif /* __ASSEMBLY__ */ | 611 | #endif /* __ASSEMBLY__ */ |
439 | #endif /* __ASM_PPC_REGS_H__ */ | ||
440 | #endif /* __KERNEL__ */ | 612 | #endif /* __KERNEL__ */ |
613 | #endif /* _ASM_POWERPC_REG_H */ | ||
diff --git a/include/asm-ppc64/rtas.h b/include/asm-powerpc/rtas.h index e7d1b5222802..2c050332471d 100644 --- a/include/asm-ppc64/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_RTAS_H | 1 | #ifndef _POWERPC_RTAS_H |
2 | #define _PPC64_RTAS_H | 2 | #define _POWERPC_RTAS_H |
3 | 3 | ||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <asm/page.h> | 5 | #include <asm/page.h> |
@@ -190,7 +190,7 @@ extern void rtas_progress(char *s, unsigned short hex); | |||
190 | extern void rtas_initialize(void); | 190 | extern void rtas_initialize(void); |
191 | 191 | ||
192 | struct rtc_time; | 192 | struct rtc_time; |
193 | extern void rtas_get_boot_time(struct rtc_time *rtc_time); | 193 | extern unsigned long rtas_get_boot_time(void); |
194 | extern void rtas_get_rtc_time(struct rtc_time *rtc_time); | 194 | extern void rtas_get_rtc_time(struct rtc_time *rtc_time); |
195 | extern int rtas_set_rtc_time(struct rtc_time *rtc_time); | 195 | extern int rtas_set_rtc_time(struct rtc_time *rtc_time); |
196 | 196 | ||
@@ -246,4 +246,4 @@ extern unsigned long rtas_rmo_buf; | |||
246 | 246 | ||
247 | #define GLOBAL_INTERRUPT_QUEUE 9005 | 247 | #define GLOBAL_INTERRUPT_QUEUE 9005 |
248 | 248 | ||
249 | #endif /* _PPC64_RTAS_H */ | 249 | #endif /* _POWERPC_RTAS_H */ |
diff --git a/include/asm-powerpc/rtc.h b/include/asm-powerpc/rtc.h new file mode 100644 index 000000000000..f5802926b6c0 --- /dev/null +++ b/include/asm-powerpc/rtc.h | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Real-time clock definitions and interfaces | ||
3 | * | ||
4 | * Author: Tom Rini <trini@mvista.com> | ||
5 | * | ||
6 | * 2002 (c) MontaVista, Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | * | ||
11 | * Based on: | ||
12 | * include/asm-m68k/rtc.h | ||
13 | * | ||
14 | * Copyright Richard Zidlicky | ||
15 | * implementation details for genrtc/q40rtc driver | ||
16 | * | ||
17 | * And the old drivers/macintosh/rtc.c which was heavily based on: | ||
18 | * Linux/SPARC Real Time Clock Driver | ||
19 | * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) | ||
20 | * | ||
21 | * With additional work by Paul Mackerras and Franz Sirl. | ||
22 | */ | ||
23 | |||
24 | #ifndef __ASM_POWERPC_RTC_H__ | ||
25 | #define __ASM_POWERPC_RTC_H__ | ||
26 | |||
27 | #ifdef __KERNEL__ | ||
28 | |||
29 | #include <linux/rtc.h> | ||
30 | |||
31 | #include <asm/machdep.h> | ||
32 | #include <asm/time.h> | ||
33 | |||
34 | #define RTC_PIE 0x40 /* periodic interrupt enable */ | ||
35 | #define RTC_AIE 0x20 /* alarm interrupt enable */ | ||
36 | #define RTC_UIE 0x10 /* update-finished interrupt enable */ | ||
37 | |||
38 | /* some dummy definitions */ | ||
39 | #define RTC_BATT_BAD 0x100 /* battery bad */ | ||
40 | #define RTC_SQWE 0x08 /* enable square-wave output */ | ||
41 | #define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */ | ||
42 | #define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ | ||
43 | #define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ | ||
44 | |||
45 | static inline unsigned int get_rtc_time(struct rtc_time *time) | ||
46 | { | ||
47 | if (ppc_md.get_rtc_time) | ||
48 | ppc_md.get_rtc_time(time); | ||
49 | return RTC_24H; | ||
50 | } | ||
51 | |||
52 | /* Set the current date and time in the real time clock. */ | ||
53 | static inline int set_rtc_time(struct rtc_time *time) | ||
54 | { | ||
55 | if (ppc_md.set_rtc_time) | ||
56 | return ppc_md.set_rtc_time(time); | ||
57 | return -EINVAL; | ||
58 | } | ||
59 | |||
60 | static inline unsigned int get_rtc_ss(void) | ||
61 | { | ||
62 | struct rtc_time h; | ||
63 | |||
64 | get_rtc_time(&h); | ||
65 | return h.tm_sec; | ||
66 | } | ||
67 | |||
68 | static inline int get_rtc_pll(struct rtc_pll_info *pll) | ||
69 | { | ||
70 | return -EINVAL; | ||
71 | } | ||
72 | static inline int set_rtc_pll(struct rtc_pll_info *pll) | ||
73 | { | ||
74 | return -EINVAL; | ||
75 | } | ||
76 | |||
77 | #endif /* __KERNEL__ */ | ||
78 | #endif /* __ASM_POWERPC_RTC_H__ */ | ||
diff --git a/include/asm-ppc64/rwsem.h b/include/asm-powerpc/rwsem.h index bd5c2f093575..79bae4933b73 100644 --- a/include/asm-ppc64/rwsem.h +++ b/include/asm-powerpc/rwsem.h | |||
@@ -1,18 +1,14 @@ | |||
1 | #ifndef _ASM_POWERPC_RWSEM_H | ||
2 | #define _ASM_POWERPC_RWSEM_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
1 | /* | 6 | /* |
2 | * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff | 7 | * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff |
3 | * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h | 8 | * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h |
4 | * by Paul Mackerras <paulus@samba.org>. | 9 | * by Paul Mackerras <paulus@samba.org>. |
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef _PPC64_RWSEM_H | ||
13 | #define _PPC64_RWSEM_H | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | #include <linux/list.h> | 12 | #include <linux/list.h> |
17 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
18 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
@@ -163,5 +159,10 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
163 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 159 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
164 | } | 160 | } |
165 | 161 | ||
166 | #endif /* __KERNEL__ */ | 162 | static inline int rwsem_is_locked(struct rw_semaphore *sem) |
167 | #endif /* _PPC_RWSEM_XADD_H */ | 163 | { |
164 | return (sem->count != 0); | ||
165 | } | ||
166 | |||
167 | #endif /* __KERNEL__ */ | ||
168 | #endif /* _ASM_POWERPC_RWSEM_H */ | ||
diff --git a/include/asm-ppc64/scatterlist.h b/include/asm-powerpc/scatterlist.h index cecce6c6dfbb..8c992d1491d4 100644 --- a/include/asm-ppc64/scatterlist.h +++ b/include/asm-powerpc/scatterlist.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #ifndef _PPC64_SCATTERLIST_H | 1 | #ifndef _ASM_POWERPC_SCATTERLIST_H |
2 | #define _PPC64_SCATTERLIST_H | 2 | #define _ASM_POWERPC_SCATTERLIST_H |
3 | |||
4 | /* | 3 | /* |
5 | * Copyright (C) 2001 PPC64 Team, IBM Corp | 4 | * Copyright (C) 2001 PPC64 Team, IBM Corp |
6 | * | 5 | * |
@@ -10,6 +9,7 @@ | |||
10 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
11 | */ | 10 | */ |
12 | 11 | ||
12 | #ifdef __KERNEL__ | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <asm/dma.h> | 14 | #include <asm/dma.h> |
15 | 15 | ||
@@ -19,13 +19,27 @@ struct scatterlist { | |||
19 | unsigned int length; | 19 | unsigned int length; |
20 | 20 | ||
21 | /* For TCE support */ | 21 | /* For TCE support */ |
22 | u32 dma_address; | 22 | dma_addr_t dma_address; |
23 | u32 dma_length; | 23 | u32 dma_length; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | /* | ||
27 | * These macros should be used after a dma_map_sg call has been done | ||
28 | * to get bus addresses of each of the SG entries and their lengths. | ||
29 | * You should only work with the number of sg entries pci_map_sg | ||
30 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
31 | * is 0. | ||
32 | */ | ||
26 | #define sg_dma_address(sg) ((sg)->dma_address) | 33 | #define sg_dma_address(sg) ((sg)->dma_address) |
34 | #ifdef __powerpc64__ | ||
27 | #define sg_dma_len(sg) ((sg)->dma_length) | 35 | #define sg_dma_len(sg) ((sg)->dma_length) |
36 | #else | ||
37 | #define sg_dma_len(sg) ((sg)->length) | ||
38 | #endif | ||
28 | 39 | ||
40 | #ifdef __powerpc64__ | ||
29 | #define ISA_DMA_THRESHOLD (~0UL) | 41 | #define ISA_DMA_THRESHOLD (~0UL) |
42 | #endif | ||
30 | 43 | ||
31 | #endif /* !(_PPC64_SCATTERLIST_H) */ | 44 | #endif /* __KERNEL__ */ |
45 | #endif /* _ASM_POWERPC_SCATTERLIST_H */ | ||
diff --git a/include/asm-ppc64/seccomp.h b/include/asm-powerpc/seccomp.h index c130c334bda1..1e1cfe12882b 100644 --- a/include/asm-ppc64/seccomp.h +++ b/include/asm-powerpc/seccomp.h | |||
@@ -1,11 +1,6 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | 1 | #ifndef _ASM_POWERPC_SECCOMP_H |
2 | |||
3 | #include <linux/thread_info.h> /* already defines TIF_32BIT */ | ||
4 | |||
5 | #ifndef TIF_32BIT | ||
6 | #error "unexpected TIF_32BIT on ppc64" | ||
7 | #endif | ||
8 | 2 | ||
3 | #include <linux/thread_info.h> | ||
9 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
10 | 5 | ||
11 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
@@ -18,4 +13,4 @@ | |||
18 | #define __NR_seccomp_exit_32 __NR_exit | 13 | #define __NR_seccomp_exit_32 __NR_exit |
19 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn | 14 | #define __NR_seccomp_sigreturn_32 __NR_sigreturn |
20 | 15 | ||
21 | #endif /* _ASM_SECCOMP_H */ | 16 | #endif /* _ASM_POWERPC_SECCOMP_H */ |
diff --git a/include/asm-ppc64/sections.h b/include/asm-powerpc/sections.h index 308ca6f5ced2..47be2ac2a925 100644 --- a/include/asm-ppc64/sections.h +++ b/include/asm-powerpc/sections.h | |||
@@ -1,22 +1,11 @@ | |||
1 | #ifndef _PPC64_SECTIONS_H | 1 | #ifndef _ASM_POWERPC_SECTIONS_H |
2 | #define _PPC64_SECTIONS_H | 2 | #define _ASM_POWERPC_SECTIONS_H |
3 | |||
4 | extern char _end[]; | ||
5 | 3 | ||
6 | #include <asm-generic/sections.h> | 4 | #include <asm-generic/sections.h> |
7 | 5 | ||
8 | #define __pmac | 6 | #ifdef __powerpc64__ |
9 | #define __pmacdata | ||
10 | |||
11 | #define __prep | ||
12 | #define __prepdata | ||
13 | |||
14 | #define __chrp | ||
15 | #define __chrpdata | ||
16 | |||
17 | #define __openfirmware | ||
18 | #define __openfirmwaredata | ||
19 | 7 | ||
8 | extern char _end[]; | ||
20 | 9 | ||
21 | static inline int in_kernel_text(unsigned long addr) | 10 | static inline int in_kernel_text(unsigned long addr) |
22 | { | 11 | { |
@@ -27,3 +16,5 @@ static inline int in_kernel_text(unsigned long addr) | |||
27 | } | 16 | } |
28 | 17 | ||
29 | #endif | 18 | #endif |
19 | |||
20 | #endif /* _ASM_POWERPC_SECTIONS_H */ | ||
diff --git a/include/asm-ppc64/semaphore.h b/include/asm-powerpc/semaphore.h index aefe7753ea41..57369d2cadef 100644 --- a/include/asm-ppc64/semaphore.h +++ b/include/asm-powerpc/semaphore.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_SEMAPHORE_H | 1 | #ifndef _ASM_POWERPC_SEMAPHORE_H |
2 | #define _PPC64_SEMAPHORE_H | 2 | #define _ASM_POWERPC_SEMAPHORE_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * Remove spinlock-based RW semaphores; RW semaphore definitions are | 5 | * Remove spinlock-based RW semaphores; RW semaphore definitions are |
@@ -31,9 +31,6 @@ struct semaphore { | |||
31 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 31 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
32 | } | 32 | } |
33 | 33 | ||
34 | #define __MUTEX_INITIALIZER(name) \ | ||
35 | __SEMAPHORE_INITIALIZER(name, 1) | ||
36 | |||
37 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ | 34 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ |
38 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 35 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
39 | 36 | ||
@@ -95,4 +92,4 @@ static inline void up(struct semaphore * sem) | |||
95 | 92 | ||
96 | #endif /* __KERNEL__ */ | 93 | #endif /* __KERNEL__ */ |
97 | 94 | ||
98 | #endif /* !(_PPC64_SEMAPHORE_H) */ | 95 | #endif /* _ASM_POWERPC_SEMAPHORE_H */ |
diff --git a/include/asm-ppc64/smu.h b/include/asm-powerpc/smu.h index dee8eefe47bc..dee8eefe47bc 100644 --- a/include/asm-ppc64/smu.h +++ b/include/asm-powerpc/smu.h | |||
diff --git a/include/asm-ppc64/spinlock_types.h b/include/asm-powerpc/spinlock_types.h index a37c8eabb9f2..74236c9f05b1 100644 --- a/include/asm-ppc64/spinlock_types.h +++ b/include/asm-powerpc/spinlock_types.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __ASM_SPINLOCK_TYPES_H | 1 | #ifndef _ASM_POWERPC_SPINLOCK_TYPES_H |
2 | #define __ASM_SPINLOCK_TYPES_H | 2 | #define _ASM_POWERPC_SPINLOCK_TYPES_H |
3 | 3 | ||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | 4 | #ifndef __LINUX_SPINLOCK_TYPES_H |
5 | # error "please don't include this file directly" | 5 | # error "please don't include this file directly" |
diff --git a/include/asm-ppc64/sstep.h b/include/asm-powerpc/sstep.h index 4a68db50ee6f..630a9889c07c 100644 --- a/include/asm-ppc64/sstep.h +++ b/include/asm-powerpc/sstep.h | |||
@@ -16,8 +16,10 @@ struct pt_regs; | |||
16 | * we don't allow putting a breakpoint on an mtmsrd instruction. | 16 | * we don't allow putting a breakpoint on an mtmsrd instruction. |
17 | * Similarly we don't allow breakpoints on rfid instructions. | 17 | * Similarly we don't allow breakpoints on rfid instructions. |
18 | * These macros tell us if an instruction is a mtmsrd or rfid. | 18 | * These macros tell us if an instruction is a mtmsrd or rfid. |
19 | * Note that IS_MTMSRD returns true for both an mtmsr (32-bit) | ||
20 | * and an mtmsrd (64-bit). | ||
19 | */ | 21 | */ |
20 | #define IS_MTMSRD(instr) (((instr) & 0xfc0007fe) == 0x7c000164) | 22 | #define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124) |
21 | #define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) | 23 | #define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) |
22 | 24 | ||
23 | /* Emulate instructions that cause a transfer of control. */ | 25 | /* Emulate instructions that cause a transfer of control. */ |
diff --git a/include/asm-ppc64/statfs.h b/include/asm-powerpc/statfs.h index 3c985e5246a7..67024026c10d 100644 --- a/include/asm-ppc64/statfs.h +++ b/include/asm-powerpc/statfs.h | |||
@@ -1,12 +1,11 @@ | |||
1 | #ifndef _PPC64_STATFS_H | 1 | #ifndef _ASM_POWERPC_STATFS_H |
2 | #define _PPC64_STATFS_H | 2 | #define _ASM_POWERPC_STATFS_H |
3 | 3 | ||
4 | /* | 4 | /* For ppc32 we just use the generic definitions, not so simple on ppc64 */ |
5 | * This program is free software; you can redistribute it and/or | 5 | |
6 | * modify it under the terms of the GNU General Public License | 6 | #ifndef __powerpc64__ |
7 | * as published by the Free Software Foundation; either version | 7 | #include <asm-generic/statfs.h> |
8 | * 2 of the License, or (at your option) any later version. | 8 | #else |
9 | */ | ||
10 | 9 | ||
11 | #ifndef __KERNEL_STRICT_NAMES | 10 | #ifndef __KERNEL_STRICT_NAMES |
12 | #include <linux/types.h> | 11 | #include <linux/types.h> |
@@ -57,5 +56,5 @@ struct compat_statfs64 { | |||
57 | __u32 f_frsize; | 56 | __u32 f_frsize; |
58 | __u32 f_spare[5]; | 57 | __u32 f_spare[5]; |
59 | }; | 58 | }; |
60 | 59 | #endif /* ! __powerpc64__ */ | |
61 | #endif /* _PPC64_STATFS_H */ | 60 | #endif |
diff --git a/include/asm-powerpc/synch.h b/include/asm-powerpc/synch.h new file mode 100644 index 000000000000..4660c0394a77 --- /dev/null +++ b/include/asm-powerpc/synch.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef _ASM_POWERPC_SYNCH_H | ||
2 | #define _ASM_POWERPC_SYNCH_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef __powerpc64__ | ||
7 | #define __SUBARCH_HAS_LWSYNC | ||
8 | #endif | ||
9 | |||
10 | #ifdef __SUBARCH_HAS_LWSYNC | ||
11 | # define LWSYNC lwsync | ||
12 | #else | ||
13 | # define LWSYNC sync | ||
14 | #endif | ||
15 | |||
16 | |||
17 | /* | ||
18 | * Arguably the bitops and *xchg operations don't imply any memory barrier | ||
19 | * or SMP ordering, but in fact a lot of drivers expect them to imply | ||
20 | * both, since they do on x86 cpus. | ||
21 | */ | ||
22 | #ifdef CONFIG_SMP | ||
23 | #define EIEIO_ON_SMP "eieio\n" | ||
24 | #define ISYNC_ON_SMP "\n\tisync" | ||
25 | #define SYNC_ON_SMP __stringify(LWSYNC) "\n" | ||
26 | #else | ||
27 | #define EIEIO_ON_SMP | ||
28 | #define ISYNC_ON_SMP | ||
29 | #define SYNC_ON_SMP | ||
30 | #endif | ||
31 | |||
32 | static inline void eieio(void) | ||
33 | { | ||
34 | __asm__ __volatile__ ("eieio" : : : "memory"); | ||
35 | } | ||
36 | |||
37 | static inline void isync(void) | ||
38 | { | ||
39 | __asm__ __volatile__ ("isync" : : : "memory"); | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_SMP | ||
43 | #define eieio_on_smp() eieio() | ||
44 | #define isync_on_smp() isync() | ||
45 | #else | ||
46 | #define eieio_on_smp() __asm__ __volatile__("": : :"memory") | ||
47 | #define isync_on_smp() __asm__ __volatile__("": : :"memory") | ||
48 | #endif | ||
49 | |||
50 | #endif /* _ASM_POWERPC_SYNCH_H */ | ||
51 | |||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h new file mode 100644 index 000000000000..5b2ecbc47907 --- /dev/null +++ b/include/asm-powerpc/system.h | |||
@@ -0,0 +1,363 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> | ||
3 | */ | ||
4 | #ifndef _ASM_POWERPC_SYSTEM_H | ||
5 | #define _ASM_POWERPC_SYSTEM_H | ||
6 | |||
7 | #include <linux/config.h> | ||
8 | #include <linux/kernel.h> | ||
9 | |||
10 | #include <asm/hw_irq.h> | ||
11 | #include <asm/ppc_asm.h> | ||
12 | #include <asm/atomic.h> | ||
13 | |||
14 | /* | ||
15 | * Memory barrier. | ||
16 | * The sync instruction guarantees that all memory accesses initiated | ||
17 | * by this processor have been performed (with respect to all other | ||
18 | * mechanisms that access memory). The eieio instruction is a barrier | ||
19 | * providing an ordering (separately) for (a) cacheable stores and (b) | ||
20 | * loads and stores to non-cacheable memory (e.g. I/O devices). | ||
21 | * | ||
22 | * mb() prevents loads and stores being reordered across this point. | ||
23 | * rmb() prevents loads being reordered across this point. | ||
24 | * wmb() prevents stores being reordered across this point. | ||
25 | * read_barrier_depends() prevents data-dependent loads being reordered | ||
26 | * across this point (nop on PPC). | ||
27 | * | ||
28 | * We have to use the sync instructions for mb(), since lwsync doesn't | ||
29 | * order loads with respect to previous stores. Lwsync is fine for | ||
30 | * rmb(), though. Note that lwsync is interpreted as sync by | ||
31 | * 32-bit and older 64-bit CPUs. | ||
32 | * | ||
33 | * For wmb(), we use sync since wmb is used in drivers to order | ||
34 | * stores to system memory with respect to writes to the device. | ||
35 | * However, smp_wmb() can be a lighter-weight eieio barrier on | ||
36 | * SMP since it is only used to order updates to system memory. | ||
37 | */ | ||
38 | #define mb() __asm__ __volatile__ ("sync" : : : "memory") | ||
39 | #define rmb() __asm__ __volatile__ ("lwsync" : : : "memory") | ||
40 | #define wmb() __asm__ __volatile__ ("sync" : : : "memory") | ||
41 | #define read_barrier_depends() do { } while(0) | ||
42 | |||
43 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
44 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
45 | |||
46 | #ifdef CONFIG_SMP | ||
47 | #define smp_mb() mb() | ||
48 | #define smp_rmb() rmb() | ||
49 | #define smp_wmb() __asm__ __volatile__ ("eieio" : : : "memory") | ||
50 | #define smp_read_barrier_depends() read_barrier_depends() | ||
51 | #else | ||
52 | #define smp_mb() barrier() | ||
53 | #define smp_rmb() barrier() | ||
54 | #define smp_wmb() barrier() | ||
55 | #define smp_read_barrier_depends() do { } while(0) | ||
56 | #endif /* CONFIG_SMP */ | ||
57 | |||
58 | #ifdef __KERNEL__ | ||
59 | struct task_struct; | ||
60 | struct pt_regs; | ||
61 | |||
62 | #ifdef CONFIG_DEBUGGER | ||
63 | |||
64 | extern int (*__debugger)(struct pt_regs *regs); | ||
65 | extern int (*__debugger_ipi)(struct pt_regs *regs); | ||
66 | extern int (*__debugger_bpt)(struct pt_regs *regs); | ||
67 | extern int (*__debugger_sstep)(struct pt_regs *regs); | ||
68 | extern int (*__debugger_iabr_match)(struct pt_regs *regs); | ||
69 | extern int (*__debugger_dabr_match)(struct pt_regs *regs); | ||
70 | extern int (*__debugger_fault_handler)(struct pt_regs *regs); | ||
71 | |||
72 | #define DEBUGGER_BOILERPLATE(__NAME) \ | ||
73 | static inline int __NAME(struct pt_regs *regs) \ | ||
74 | { \ | ||
75 | if (unlikely(__ ## __NAME)) \ | ||
76 | return __ ## __NAME(regs); \ | ||
77 | return 0; \ | ||
78 | } | ||
79 | |||
80 | DEBUGGER_BOILERPLATE(debugger) | ||
81 | DEBUGGER_BOILERPLATE(debugger_ipi) | ||
82 | DEBUGGER_BOILERPLATE(debugger_bpt) | ||
83 | DEBUGGER_BOILERPLATE(debugger_sstep) | ||
84 | DEBUGGER_BOILERPLATE(debugger_iabr_match) | ||
85 | DEBUGGER_BOILERPLATE(debugger_dabr_match) | ||
86 | DEBUGGER_BOILERPLATE(debugger_fault_handler) | ||
87 | |||
88 | #ifdef CONFIG_XMON | ||
89 | extern void xmon_init(int enable); | ||
90 | #endif | ||
91 | |||
92 | #else | ||
93 | static inline int debugger(struct pt_regs *regs) { return 0; } | ||
94 | static inline int debugger_ipi(struct pt_regs *regs) { return 0; } | ||
95 | static inline int debugger_bpt(struct pt_regs *regs) { return 0; } | ||
96 | static inline int debugger_sstep(struct pt_regs *regs) { return 0; } | ||
97 | static inline int debugger_iabr_match(struct pt_regs *regs) { return 0; } | ||
98 | static inline int debugger_dabr_match(struct pt_regs *regs) { return 0; } | ||
99 | static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; } | ||
100 | #endif | ||
101 | |||
102 | extern int set_dabr(unsigned long dabr); | ||
103 | extern void print_backtrace(unsigned long *); | ||
104 | extern void show_regs(struct pt_regs * regs); | ||
105 | extern void flush_instruction_cache(void); | ||
106 | extern void hard_reset_now(void); | ||
107 | extern void poweroff_now(void); | ||
108 | |||
109 | #ifdef CONFIG_6xx | ||
110 | extern long _get_L2CR(void); | ||
111 | extern long _get_L3CR(void); | ||
112 | extern void _set_L2CR(unsigned long); | ||
113 | extern void _set_L3CR(unsigned long); | ||
114 | #else | ||
115 | #define _get_L2CR() 0L | ||
116 | #define _get_L3CR() 0L | ||
117 | #define _set_L2CR(val) do { } while(0) | ||
118 | #define _set_L3CR(val) do { } while(0) | ||
119 | #endif | ||
120 | |||
121 | extern void via_cuda_init(void); | ||
122 | extern void read_rtc_time(void); | ||
123 | extern void pmac_find_display(void); | ||
124 | extern void giveup_fpu(struct task_struct *); | ||
125 | extern void disable_kernel_fp(void); | ||
126 | extern void enable_kernel_fp(void); | ||
127 | extern void flush_fp_to_thread(struct task_struct *); | ||
128 | extern void enable_kernel_altivec(void); | ||
129 | extern void giveup_altivec(struct task_struct *); | ||
130 | extern void load_up_altivec(struct task_struct *); | ||
131 | extern int emulate_altivec(struct pt_regs *); | ||
132 | extern void giveup_spe(struct task_struct *); | ||
133 | extern void load_up_spe(struct task_struct *); | ||
134 | extern int fix_alignment(struct pt_regs *); | ||
135 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); | ||
136 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); | ||
137 | |||
138 | #ifdef CONFIG_ALTIVEC | ||
139 | extern void flush_altivec_to_thread(struct task_struct *); | ||
140 | #else | ||
141 | static inline void flush_altivec_to_thread(struct task_struct *t) | ||
142 | { | ||
143 | } | ||
144 | #endif | ||
145 | |||
146 | #ifdef CONFIG_SPE | ||
147 | extern void flush_spe_to_thread(struct task_struct *); | ||
148 | #else | ||
149 | static inline void flush_spe_to_thread(struct task_struct *t) | ||
150 | { | ||
151 | } | ||
152 | #endif | ||
153 | |||
154 | extern int call_rtas(const char *, int, int, unsigned long *, ...); | ||
155 | extern void cacheable_memzero(void *p, unsigned int nb); | ||
156 | extern void *cacheable_memcpy(void *, const void *, unsigned int); | ||
157 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); | ||
158 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); | ||
159 | extern int die(const char *, struct pt_regs *, long); | ||
160 | extern void _exception(int, struct pt_regs *, int, unsigned long); | ||
161 | #ifdef CONFIG_BOOKE_WDT | ||
162 | extern u32 booke_wdt_enabled; | ||
163 | extern u32 booke_wdt_period; | ||
164 | #endif /* CONFIG_BOOKE_WDT */ | ||
165 | |||
166 | /* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ | ||
167 | extern unsigned char e2a(unsigned char); | ||
168 | |||
169 | struct device_node; | ||
170 | extern void note_scsi_host(struct device_node *, void *); | ||
171 | |||
172 | extern struct task_struct *__switch_to(struct task_struct *, | ||
173 | struct task_struct *); | ||
174 | #define switch_to(prev, next, last) ((last) = __switch_to((prev), (next))) | ||
175 | |||
176 | struct thread_struct; | ||
177 | extern struct task_struct *_switch(struct thread_struct *prev, | ||
178 | struct thread_struct *next); | ||
179 | |||
180 | extern unsigned int rtas_data; | ||
181 | extern int mem_init_done; /* set on boot once kmalloc can be called */ | ||
182 | extern unsigned long memory_limit; | ||
183 | |||
184 | extern int powersave_nap; /* set if nap mode can be used in idle loop */ | ||
185 | |||
186 | /* | ||
187 | * Atomic exchange | ||
188 | * | ||
189 | * Changes the memory location '*ptr' to be val and returns | ||
190 | * the previous value stored there. | ||
191 | */ | ||
192 | static __inline__ unsigned long | ||
193 | __xchg_u32(volatile void *p, unsigned long val) | ||
194 | { | ||
195 | unsigned long prev; | ||
196 | |||
197 | __asm__ __volatile__( | ||
198 | EIEIO_ON_SMP | ||
199 | "1: lwarx %0,0,%2 \n" | ||
200 | PPC405_ERR77(0,%2) | ||
201 | " stwcx. %3,0,%2 \n\ | ||
202 | bne- 1b" | ||
203 | ISYNC_ON_SMP | ||
204 | : "=&r" (prev), "=m" (*(volatile unsigned int *)p) | ||
205 | : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) | ||
206 | : "cc", "memory"); | ||
207 | |||
208 | return prev; | ||
209 | } | ||
210 | |||
211 | #ifdef CONFIG_PPC64 | ||
212 | static __inline__ unsigned long | ||
213 | __xchg_u64(volatile void *p, unsigned long val) | ||
214 | { | ||
215 | unsigned long prev; | ||
216 | |||
217 | __asm__ __volatile__( | ||
218 | EIEIO_ON_SMP | ||
219 | "1: ldarx %0,0,%2 \n" | ||
220 | PPC405_ERR77(0,%2) | ||
221 | " stdcx. %3,0,%2 \n\ | ||
222 | bne- 1b" | ||
223 | ISYNC_ON_SMP | ||
224 | : "=&r" (prev), "=m" (*(volatile unsigned long *)p) | ||
225 | : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) | ||
226 | : "cc", "memory"); | ||
227 | |||
228 | return prev; | ||
229 | } | ||
230 | #endif | ||
231 | |||
232 | /* | ||
233 | * This function doesn't exist, so you'll get a linker error | ||
234 | * if something tries to do an invalid xchg(). | ||
235 | */ | ||
236 | extern void __xchg_called_with_bad_pointer(void); | ||
237 | |||
238 | static __inline__ unsigned long | ||
239 | __xchg(volatile void *ptr, unsigned long x, unsigned int size) | ||
240 | { | ||
241 | switch (size) { | ||
242 | case 4: | ||
243 | return __xchg_u32(ptr, x); | ||
244 | #ifdef CONFIG_PPC64 | ||
245 | case 8: | ||
246 | return __xchg_u64(ptr, x); | ||
247 | #endif | ||
248 | } | ||
249 | __xchg_called_with_bad_pointer(); | ||
250 | return x; | ||
251 | } | ||
252 | |||
253 | #define xchg(ptr,x) \ | ||
254 | ({ \ | ||
255 | __typeof__(*(ptr)) _x_ = (x); \ | ||
256 | (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \ | ||
257 | }) | ||
258 | |||
259 | #define tas(ptr) (xchg((ptr),1)) | ||
260 | |||
261 | /* | ||
262 | * Compare and exchange - if *p == old, set it to new, | ||
263 | * and return the old value of *p. | ||
264 | */ | ||
265 | #define __HAVE_ARCH_CMPXCHG 1 | ||
266 | |||
267 | static __inline__ unsigned long | ||
268 | __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | ||
269 | { | ||
270 | unsigned int prev; | ||
271 | |||
272 | __asm__ __volatile__ ( | ||
273 | EIEIO_ON_SMP | ||
274 | "1: lwarx %0,0,%2 # __cmpxchg_u32\n\ | ||
275 | cmpw 0,%0,%3\n\ | ||
276 | bne- 2f\n" | ||
277 | PPC405_ERR77(0,%2) | ||
278 | " stwcx. %4,0,%2\n\ | ||
279 | bne- 1b" | ||
280 | ISYNC_ON_SMP | ||
281 | "\n\ | ||
282 | 2:" | ||
283 | : "=&r" (prev), "=m" (*p) | ||
284 | : "r" (p), "r" (old), "r" (new), "m" (*p) | ||
285 | : "cc", "memory"); | ||
286 | |||
287 | return prev; | ||
288 | } | ||
289 | |||
290 | #ifdef CONFIG_PPC64 | ||
291 | static __inline__ unsigned long | ||
292 | __cmpxchg_u64(volatile long *p, unsigned long old, unsigned long new) | ||
293 | { | ||
294 | unsigned long prev; | ||
295 | |||
296 | __asm__ __volatile__ ( | ||
297 | EIEIO_ON_SMP | ||
298 | "1: ldarx %0,0,%2 # __cmpxchg_u64\n\ | ||
299 | cmpd 0,%0,%3\n\ | ||
300 | bne- 2f\n\ | ||
301 | stdcx. %4,0,%2\n\ | ||
302 | bne- 1b" | ||
303 | ISYNC_ON_SMP | ||
304 | "\n\ | ||
305 | 2:" | ||
306 | : "=&r" (prev), "=m" (*p) | ||
307 | : "r" (p), "r" (old), "r" (new), "m" (*p) | ||
308 | : "cc", "memory"); | ||
309 | |||
310 | return prev; | ||
311 | } | ||
312 | #endif | ||
313 | |||
314 | /* This function doesn't exist, so you'll get a linker error | ||
315 | if something tries to do an invalid cmpxchg(). */ | ||
316 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
317 | |||
318 | static __inline__ unsigned long | ||
319 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, | ||
320 | unsigned int size) | ||
321 | { | ||
322 | switch (size) { | ||
323 | case 4: | ||
324 | return __cmpxchg_u32(ptr, old, new); | ||
325 | #ifdef CONFIG_PPC64 | ||
326 | case 8: | ||
327 | return __cmpxchg_u64(ptr, old, new); | ||
328 | #endif | ||
329 | } | ||
330 | __cmpxchg_called_with_bad_pointer(); | ||
331 | return old; | ||
332 | } | ||
333 | |||
334 | #define cmpxchg(ptr,o,n) \ | ||
335 | ({ \ | ||
336 | __typeof__(*(ptr)) _o_ = (o); \ | ||
337 | __typeof__(*(ptr)) _n_ = (n); \ | ||
338 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | ||
339 | (unsigned long)_n_, sizeof(*(ptr))); \ | ||
340 | }) | ||
341 | |||
342 | #ifdef CONFIG_PPC64 | ||
343 | /* | ||
344 | * We handle most unaligned accesses in hardware. On the other hand | ||
345 | * unaligned DMA can be very expensive on some ppc64 IO chips (it does | ||
346 | * powers of 2 writes until it reaches sufficient alignment). | ||
347 | * | ||
348 | * Based on this we disable the IP header alignment in network drivers. | ||
349 | */ | ||
350 | #define NET_IP_ALIGN 0 | ||
351 | #endif | ||
352 | |||
353 | #define arch_align_stack(x) (x) | ||
354 | |||
355 | /* Used in very early kernel initialization. */ | ||
356 | extern unsigned long reloc_offset(void); | ||
357 | extern unsigned long add_reloc_offset(unsigned long); | ||
358 | extern void reloc_got2(unsigned long); | ||
359 | |||
360 | #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) | ||
361 | |||
362 | #endif /* __KERNEL__ */ | ||
363 | #endif /* _ASM_POWERPC_SYSTEM_H */ | ||
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-powerpc/thread_info.h index 0494df6fca74..ab17db79f69d 100644 --- a/include/asm-ppc64/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
@@ -1,15 +1,25 @@ | |||
1 | /* thread_info.h: PPC low-level thread information | 1 | /* thread_info.h: PowerPC low-level thread information |
2 | * adapted from the i386 version by Paul Mackerras | 2 | * adapted from the i386 version by Paul Mackerras |
3 | * | 3 | * |
4 | * Copyright (C) 2002 David Howells (dhowells@redhat.com) | 4 | * Copyright (C) 2002 David Howells (dhowells@redhat.com) |
5 | * - Incorporating suggestions made by Linus Torvalds and Dave Miller | 5 | * - Incorporating suggestions made by Linus Torvalds and Dave Miller |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef _ASM_THREAD_INFO_H | 8 | #ifndef _ASM_POWERPC_THREAD_INFO_H |
9 | #define _ASM_THREAD_INFO_H | 9 | #define _ASM_POWERPC_THREAD_INFO_H |
10 | 10 | ||
11 | #ifdef __KERNEL__ | 11 | #ifdef __KERNEL__ |
12 | 12 | ||
13 | /* We have 8k stacks on ppc32 and 16k on ppc64 */ | ||
14 | |||
15 | #ifdef CONFIG_PPC64 | ||
16 | #define THREAD_SHIFT 14 | ||
17 | #else | ||
18 | #define THREAD_SHIFT 13 | ||
19 | #endif | ||
20 | |||
21 | #define THREAD_SIZE (1 << THREAD_SHIFT) | ||
22 | |||
13 | #ifndef __ASSEMBLY__ | 23 | #ifndef __ASSEMBLY__ |
14 | #include <linux/config.h> | 24 | #include <linux/config.h> |
15 | #include <linux/cache.h> | 25 | #include <linux/cache.h> |
@@ -24,7 +34,8 @@ struct thread_info { | |||
24 | struct task_struct *task; /* main task structure */ | 34 | struct task_struct *task; /* main task structure */ |
25 | struct exec_domain *exec_domain; /* execution domain */ | 35 | struct exec_domain *exec_domain; /* execution domain */ |
26 | int cpu; /* cpu we're on */ | 36 | int cpu; /* cpu we're on */ |
27 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 37 | int preempt_count; /* 0 => preemptable, |
38 | <0 => BUG */ | ||
28 | struct restart_block restart_block; | 39 | struct restart_block restart_block; |
29 | /* set by force_successful_syscall_return */ | 40 | /* set by force_successful_syscall_return */ |
30 | unsigned char syscall_noerror; | 41 | unsigned char syscall_noerror; |
@@ -54,32 +65,38 @@ struct thread_info { | |||
54 | 65 | ||
55 | /* thread information allocation */ | 66 | /* thread information allocation */ |
56 | 67 | ||
57 | #define THREAD_ORDER 2 | ||
58 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) | ||
59 | #define THREAD_SHIFT (PAGE_SHIFT + THREAD_ORDER) | ||
60 | #ifdef CONFIG_DEBUG_STACK_USAGE | 68 | #ifdef CONFIG_DEBUG_STACK_USAGE |
61 | #define alloc_thread_info(tsk) \ | 69 | #define THREAD_INFO_GFP GFP_KERNEL | __GFP_ZERO |
62 | ({ \ | ||
63 | struct thread_info *ret; \ | ||
64 | \ | ||
65 | ret = kmalloc(THREAD_SIZE, GFP_KERNEL); \ | ||
66 | if (ret) \ | ||
67 | memset(ret, 0, THREAD_SIZE); \ | ||
68 | ret; \ | ||
69 | }) | ||
70 | #else | 70 | #else |
71 | #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) | 71 | #define THREAD_INFO_GFP GFP_KERNEL |
72 | #endif | 72 | #endif |
73 | |||
74 | #if THREAD_SHIFT >= PAGE_SHIFT | ||
75 | |||
76 | #define THREAD_ORDER (THREAD_SHIFT - PAGE_SHIFT) | ||
77 | |||
78 | #define alloc_thread_info(tsk) \ | ||
79 | ((struct thread_info *)__get_free_pages(THREAD_INFO_GFP, THREAD_ORDER)) | ||
80 | #define free_thread_info(ti) free_pages((unsigned long)ti, THREAD_ORDER) | ||
81 | |||
82 | #else /* THREAD_SHIFT < PAGE_SHIFT */ | ||
83 | |||
84 | #define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, THREAD_INFO_GFP) | ||
73 | #define free_thread_info(ti) kfree(ti) | 85 | #define free_thread_info(ti) kfree(ti) |
86 | |||
87 | #endif /* THREAD_SHIFT < PAGE_SHIFT */ | ||
88 | |||
74 | #define get_thread_info(ti) get_task_struct((ti)->task) | 89 | #define get_thread_info(ti) get_task_struct((ti)->task) |
75 | #define put_thread_info(ti) put_task_struct((ti)->task) | 90 | #define put_thread_info(ti) put_task_struct((ti)->task) |
76 | 91 | ||
77 | /* how to get the thread information struct from C */ | 92 | /* how to get the thread information struct from C */ |
78 | static inline struct thread_info *current_thread_info(void) | 93 | static inline struct thread_info *current_thread_info(void) |
79 | { | 94 | { |
80 | struct thread_info *ti; | 95 | register unsigned long sp asm("r1"); |
81 | __asm__("clrrdi %0,1,%1" : "=r"(ti) : "i" (THREAD_SHIFT)); | 96 | |
82 | return ti; | 97 | /* gcc4, at least, is smart enough to turn this into a single |
98 | * rlwinm for ppc32 and clrrdi for ppc64 */ | ||
99 | return (struct thread_info *)(sp & ~(THREAD_SIZE-1)); | ||
83 | } | 100 | } |
84 | 101 | ||
85 | #endif /* __ASSEMBLY__ */ | 102 | #endif /* __ASSEMBLY__ */ |
@@ -122,4 +139,4 @@ static inline struct thread_info *current_thread_info(void) | |||
122 | 139 | ||
123 | #endif /* __KERNEL__ */ | 140 | #endif /* __KERNEL__ */ |
124 | 141 | ||
125 | #endif /* _ASM_THREAD_INFO_H */ | 142 | #endif /* _ASM_POWERPC_THREAD_INFO_H */ |
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h new file mode 100644 index 000000000000..410e795f7d43 --- /dev/null +++ b/include/asm-powerpc/time.h | |||
@@ -0,0 +1,226 @@ | |||
1 | /* | ||
2 | * Common time prototypes and such for all ppc machines. | ||
3 | * | ||
4 | * Written by Cort Dougan (cort@cs.nmt.edu) to merge | ||
5 | * Paul Mackerras' version and mine for PReP and Pmac. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __POWERPC_TIME_H | ||
14 | #define __POWERPC_TIME_H | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | #include <linux/config.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/percpu.h> | ||
20 | |||
21 | #include <asm/processor.h> | ||
22 | #ifdef CONFIG_PPC64 | ||
23 | #include <asm/paca.h> | ||
24 | #include <asm/iSeries/HvCall.h> | ||
25 | #endif | ||
26 | |||
27 | /* time.c */ | ||
28 | extern unsigned long tb_ticks_per_jiffy; | ||
29 | extern unsigned long tb_ticks_per_usec; | ||
30 | extern unsigned long tb_ticks_per_sec; | ||
31 | extern u64 tb_to_xs; | ||
32 | extern unsigned tb_to_us; | ||
33 | extern unsigned long tb_last_stamp; | ||
34 | extern u64 tb_last_jiffy; | ||
35 | |||
36 | DECLARE_PER_CPU(unsigned long, last_jiffy); | ||
37 | |||
38 | struct rtc_time; | ||
39 | extern void to_tm(int tim, struct rtc_time * tm); | ||
40 | extern time_t last_rtc_update; | ||
41 | |||
42 | extern void generic_calibrate_decr(void); | ||
43 | extern void wakeup_decrementer(void); | ||
44 | |||
45 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ | ||
46 | extern unsigned long ppc_proc_freq; | ||
47 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) | ||
48 | extern unsigned long ppc_tb_freq; | ||
49 | #define DEFAULT_TB_FREQ 125000000UL | ||
50 | |||
51 | /* | ||
52 | * By putting all of this stuff into a single struct we | ||
53 | * reduce the number of cache lines touched by do_gettimeofday. | ||
54 | * Both by collecting all of the data in one cache line and | ||
55 | * by touching only one TOC entry on ppc64. | ||
56 | */ | ||
57 | struct gettimeofday_vars { | ||
58 | u64 tb_to_xs; | ||
59 | u64 stamp_xsec; | ||
60 | u64 tb_orig_stamp; | ||
61 | }; | ||
62 | |||
63 | struct gettimeofday_struct { | ||
64 | unsigned long tb_ticks_per_sec; | ||
65 | struct gettimeofday_vars vars[2]; | ||
66 | struct gettimeofday_vars * volatile varp; | ||
67 | unsigned var_idx; | ||
68 | unsigned tb_to_us; | ||
69 | }; | ||
70 | |||
71 | struct div_result { | ||
72 | u64 result_high; | ||
73 | u64 result_low; | ||
74 | }; | ||
75 | |||
76 | /* Accessor functions for the timebase (RTC on 601) registers. */ | ||
77 | /* If one day CONFIG_POWER is added just define __USE_RTC as 1 */ | ||
78 | #ifdef CONFIG_6xx | ||
79 | #define __USE_RTC() (!cpu_has_feature(CPU_FTR_USE_TB)) | ||
80 | #else | ||
81 | #define __USE_RTC() 0 | ||
82 | #endif | ||
83 | |||
84 | /* On ppc64 this gets us the whole timebase; on ppc32 just the lower half */ | ||
85 | static inline unsigned long get_tbl(void) | ||
86 | { | ||
87 | unsigned long tbl; | ||
88 | |||
89 | #if defined(CONFIG_403GCX) | ||
90 | asm volatile("mfspr %0, 0x3dd" : "=r" (tbl)); | ||
91 | #else | ||
92 | asm volatile("mftb %0" : "=r" (tbl)); | ||
93 | #endif | ||
94 | return tbl; | ||
95 | } | ||
96 | |||
97 | static inline unsigned int get_tbu(void) | ||
98 | { | ||
99 | unsigned int tbu; | ||
100 | |||
101 | #if defined(CONFIG_403GCX) | ||
102 | asm volatile("mfspr %0, 0x3dc" : "=r" (tbu)); | ||
103 | #else | ||
104 | asm volatile("mftbu %0" : "=r" (tbu)); | ||
105 | #endif | ||
106 | return tbu; | ||
107 | } | ||
108 | |||
109 | static inline unsigned int get_rtcl(void) | ||
110 | { | ||
111 | unsigned int rtcl; | ||
112 | |||
113 | asm volatile("mfrtcl %0" : "=r" (rtcl)); | ||
114 | return rtcl; | ||
115 | } | ||
116 | |||
117 | static inline u64 get_rtc(void) | ||
118 | { | ||
119 | unsigned int hi, lo, hi2; | ||
120 | |||
121 | do { | ||
122 | asm volatile("mfrtcu %0; mfrtcl %1; mfrtcu %2" | ||
123 | : "=r" (hi), "=r" (lo), "=r" (hi2)); | ||
124 | } while (hi2 != hi); | ||
125 | return (u64)hi * 1000000000 + lo; | ||
126 | } | ||
127 | |||
128 | #ifdef CONFIG_PPC64 | ||
129 | static inline u64 get_tb(void) | ||
130 | { | ||
131 | return mftb(); | ||
132 | } | ||
133 | #else | ||
134 | static inline u64 get_tb(void) | ||
135 | { | ||
136 | unsigned int tbhi, tblo, tbhi2; | ||
137 | |||
138 | do { | ||
139 | tbhi = get_tbu(); | ||
140 | tblo = get_tbl(); | ||
141 | tbhi2 = get_tbu(); | ||
142 | } while (tbhi != tbhi2); | ||
143 | |||
144 | return ((u64)tbhi << 32) | tblo; | ||
145 | } | ||
146 | #endif | ||
147 | |||
148 | static inline void set_tb(unsigned int upper, unsigned int lower) | ||
149 | { | ||
150 | mtspr(SPRN_TBWL, 0); | ||
151 | mtspr(SPRN_TBWU, upper); | ||
152 | mtspr(SPRN_TBWL, lower); | ||
153 | } | ||
154 | |||
155 | /* Accessor functions for the decrementer register. | ||
156 | * The 4xx doesn't even have a decrementer. I tried to use the | ||
157 | * generic timer interrupt code, which seems OK, with the 4xx PIT | ||
158 | * in auto-reload mode. The problem is PIT stops counting when it | ||
159 | * hits zero. If it would wrap, we could use it just like a decrementer. | ||
160 | */ | ||
161 | static inline unsigned int get_dec(void) | ||
162 | { | ||
163 | #if defined(CONFIG_40x) | ||
164 | return (mfspr(SPRN_PIT)); | ||
165 | #else | ||
166 | return (mfspr(SPRN_DEC)); | ||
167 | #endif | ||
168 | } | ||
169 | |||
170 | static inline void set_dec(int val) | ||
171 | { | ||
172 | #if defined(CONFIG_40x) | ||
173 | return; /* Have to let it auto-reload */ | ||
174 | #elif defined(CONFIG_8xx_CPU6) | ||
175 | set_dec_cpu6(val); | ||
176 | #else | ||
177 | #ifdef CONFIG_PPC_ISERIES | ||
178 | struct paca_struct *lpaca = get_paca(); | ||
179 | int cur_dec; | ||
180 | |||
181 | if (lpaca->lppaca.shared_proc) { | ||
182 | lpaca->lppaca.virtual_decr = val; | ||
183 | cur_dec = get_dec(); | ||
184 | if (cur_dec > val) | ||
185 | HvCall_setVirtualDecr(); | ||
186 | } else | ||
187 | #endif | ||
188 | mtspr(SPRN_DEC, val); | ||
189 | #endif /* not 40x or 8xx_CPU6 */ | ||
190 | } | ||
191 | |||
192 | static inline unsigned long tb_ticks_since(unsigned long tstamp) | ||
193 | { | ||
194 | if (__USE_RTC()) { | ||
195 | int delta = get_rtcl() - (unsigned int) tstamp; | ||
196 | return delta < 0 ? delta + 1000000000 : delta; | ||
197 | } | ||
198 | return get_tbl() - tstamp; | ||
199 | } | ||
200 | |||
201 | #define mulhwu(x,y) \ | ||
202 | ({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;}) | ||
203 | |||
204 | #ifdef CONFIG_PPC64 | ||
205 | #define mulhdu(x,y) \ | ||
206 | ({unsigned long z; asm ("mulhdu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;}) | ||
207 | #else | ||
208 | extern u64 mulhdu(u64, u64); | ||
209 | #endif | ||
210 | |||
211 | extern void smp_space_timers(unsigned int); | ||
212 | |||
213 | extern unsigned mulhwu_scale_factor(unsigned, unsigned); | ||
214 | extern void div128_by_32(u64 dividend_high, u64 dividend_low, | ||
215 | unsigned divisor, struct div_result *dr); | ||
216 | |||
217 | /* Used to store Processor Utilization register (purr) values */ | ||
218 | |||
219 | struct cpu_usage { | ||
220 | u64 current_tb; /* Holds the current purr register values */ | ||
221 | }; | ||
222 | |||
223 | DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array); | ||
224 | |||
225 | #endif /* __KERNEL__ */ | ||
226 | #endif /* __PPC64_TIME_H */ | ||
diff --git a/include/asm-ppc64/types.h b/include/asm-powerpc/types.h index bf294c1761b2..ec3c2ee8bf86 100644 --- a/include/asm-ppc64/types.h +++ b/include/asm-powerpc/types.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _PPC64_TYPES_H | 1 | #ifndef _ASM_POWERPC_TYPES_H |
2 | #define _PPC64_TYPES_H | 2 | #define _ASM_POWERPC_TYPES_H |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
5 | 5 | ||
@@ -16,7 +16,11 @@ | |||
16 | * 2 of the License, or (at your option) any later version. | 16 | * 2 of the License, or (at your option) any later version. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #ifdef __powerpc64__ | ||
19 | typedef unsigned int umode_t; | 20 | typedef unsigned int umode_t; |
21 | #else | ||
22 | typedef unsigned short umode_t; | ||
23 | #endif | ||
20 | 24 | ||
21 | /* | 25 | /* |
22 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the | 26 | * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the |
@@ -32,8 +36,15 @@ typedef unsigned short __u16; | |||
32 | typedef __signed__ int __s32; | 36 | typedef __signed__ int __s32; |
33 | typedef unsigned int __u32; | 37 | typedef unsigned int __u32; |
34 | 38 | ||
39 | #ifdef __powerpc64__ | ||
35 | typedef __signed__ long __s64; | 40 | typedef __signed__ long __s64; |
36 | typedef unsigned long __u64; | 41 | typedef unsigned long __u64; |
42 | #else | ||
43 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) | ||
44 | typedef __signed__ long long __s64; | ||
45 | typedef unsigned long long __u64; | ||
46 | #endif | ||
47 | #endif /* __powerpc64__ */ | ||
37 | 48 | ||
38 | typedef struct { | 49 | typedef struct { |
39 | __u32 u[4]; | 50 | __u32 u[4]; |
@@ -45,10 +56,16 @@ typedef struct { | |||
45 | /* | 56 | /* |
46 | * These aren't exported outside the kernel to avoid name space clashes | 57 | * These aren't exported outside the kernel to avoid name space clashes |
47 | */ | 58 | */ |
59 | #ifdef __powerpc64__ | ||
48 | #define BITS_PER_LONG 64 | 60 | #define BITS_PER_LONG 64 |
61 | #else | ||
62 | #define BITS_PER_LONG 32 | ||
63 | #endif | ||
49 | 64 | ||
50 | #ifndef __ASSEMBLY__ | 65 | #ifndef __ASSEMBLY__ |
51 | 66 | ||
67 | #include <linux/config.h> | ||
68 | |||
52 | typedef signed char s8; | 69 | typedef signed char s8; |
53 | typedef unsigned char u8; | 70 | typedef unsigned char u8; |
54 | 71 | ||
@@ -58,12 +75,21 @@ typedef unsigned short u16; | |||
58 | typedef signed int s32; | 75 | typedef signed int s32; |
59 | typedef unsigned int u32; | 76 | typedef unsigned int u32; |
60 | 77 | ||
78 | #ifdef __powerpc64__ | ||
61 | typedef signed long s64; | 79 | typedef signed long s64; |
62 | typedef unsigned long u64; | 80 | typedef unsigned long u64; |
81 | #else | ||
82 | typedef signed long long s64; | ||
83 | typedef unsigned long long u64; | ||
84 | #endif | ||
63 | 85 | ||
64 | typedef __vector128 vector128; | 86 | typedef __vector128 vector128; |
65 | 87 | ||
88 | #ifdef __powerpc64__ | ||
89 | typedef u64 dma_addr_t; | ||
90 | #else | ||
66 | typedef u32 dma_addr_t; | 91 | typedef u32 dma_addr_t; |
92 | #endif | ||
67 | typedef u64 dma64_addr_t; | 93 | typedef u64 dma64_addr_t; |
68 | 94 | ||
69 | typedef struct { | 95 | typedef struct { |
@@ -72,8 +98,13 @@ typedef struct { | |||
72 | unsigned long env; | 98 | unsigned long env; |
73 | } func_descr_t; | 99 | } func_descr_t; |
74 | 100 | ||
101 | #ifdef CONFIG_LBD | ||
102 | typedef u64 sector_t; | ||
103 | #define HAVE_SECTOR_T | ||
104 | #endif | ||
105 | |||
75 | #endif /* __ASSEMBLY__ */ | 106 | #endif /* __ASSEMBLY__ */ |
76 | 107 | ||
77 | #endif /* __KERNEL__ */ | 108 | #endif /* __KERNEL__ */ |
78 | 109 | ||
79 | #endif /* _PPC64_TYPES_H */ | 110 | #endif /* _ASM_POWERPC_TYPES_H */ |
diff --git a/include/asm-ppc/uninorth.h b/include/asm-powerpc/uninorth.h index f737732c3861..f737732c3861 100644 --- a/include/asm-ppc/uninorth.h +++ b/include/asm-powerpc/uninorth.h | |||
diff --git a/include/asm-ppc/unistd.h b/include/asm-powerpc/unistd.h index 3173ab3d2eb9..0991dfceef1d 100644 --- a/include/asm-ppc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -3,7 +3,13 @@ | |||
3 | 3 | ||
4 | /* | 4 | /* |
5 | * This file contains the system call numbers. | 5 | * This file contains the system call numbers. |
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
6 | */ | 11 | */ |
12 | |||
7 | #define __NR_restart_syscall 0 | 13 | #define __NR_restart_syscall 0 |
8 | #define __NR_exit 1 | 14 | #define __NR_exit 1 |
9 | #define __NR_fork 2 | 15 | #define __NR_fork 2 |
@@ -196,19 +202,23 @@ | |||
196 | #define __NR_vfork 189 | 202 | #define __NR_vfork 189 |
197 | #define __NR_ugetrlimit 190 /* SuS compliant getrlimit */ | 203 | #define __NR_ugetrlimit 190 /* SuS compliant getrlimit */ |
198 | #define __NR_readahead 191 | 204 | #define __NR_readahead 191 |
205 | #ifndef __powerpc64__ /* these are 32-bit only */ | ||
199 | #define __NR_mmap2 192 | 206 | #define __NR_mmap2 192 |
200 | #define __NR_truncate64 193 | 207 | #define __NR_truncate64 193 |
201 | #define __NR_ftruncate64 194 | 208 | #define __NR_ftruncate64 194 |
202 | #define __NR_stat64 195 | 209 | #define __NR_stat64 195 |
203 | #define __NR_lstat64 196 | 210 | #define __NR_lstat64 196 |
204 | #define __NR_fstat64 197 | 211 | #define __NR_fstat64 197 |
212 | #endif | ||
205 | #define __NR_pciconfig_read 198 | 213 | #define __NR_pciconfig_read 198 |
206 | #define __NR_pciconfig_write 199 | 214 | #define __NR_pciconfig_write 199 |
207 | #define __NR_pciconfig_iobase 200 | 215 | #define __NR_pciconfig_iobase 200 |
208 | #define __NR_multiplexer 201 | 216 | #define __NR_multiplexer 201 |
209 | #define __NR_getdents64 202 | 217 | #define __NR_getdents64 202 |
210 | #define __NR_pivot_root 203 | 218 | #define __NR_pivot_root 203 |
219 | #ifndef __powerpc64__ | ||
211 | #define __NR_fcntl64 204 | 220 | #define __NR_fcntl64 204 |
221 | #endif | ||
212 | #define __NR_madvise 205 | 222 | #define __NR_madvise 205 |
213 | #define __NR_mincore 206 | 223 | #define __NR_mincore 206 |
214 | #define __NR_gettid 207 | 224 | #define __NR_gettid 207 |
@@ -230,7 +240,9 @@ | |||
230 | #define __NR_sched_getaffinity 223 | 240 | #define __NR_sched_getaffinity 223 |
231 | /* 224 currently unused */ | 241 | /* 224 currently unused */ |
232 | #define __NR_tuxcall 225 | 242 | #define __NR_tuxcall 225 |
243 | #ifndef __powerpc64__ | ||
233 | #define __NR_sendfile64 226 | 244 | #define __NR_sendfile64 226 |
245 | #endif | ||
234 | #define __NR_io_setup 227 | 246 | #define __NR_io_setup 227 |
235 | #define __NR_io_destroy 228 | 247 | #define __NR_io_destroy 228 |
236 | #define __NR_io_getevents 229 | 248 | #define __NR_io_getevents 229 |
@@ -258,14 +270,16 @@ | |||
258 | #define __NR_utimes 251 | 270 | #define __NR_utimes 251 |
259 | #define __NR_statfs64 252 | 271 | #define __NR_statfs64 252 |
260 | #define __NR_fstatfs64 253 | 272 | #define __NR_fstatfs64 253 |
273 | #ifndef __powerpc64__ | ||
261 | #define __NR_fadvise64_64 254 | 274 | #define __NR_fadvise64_64 254 |
275 | #endif | ||
262 | #define __NR_rtas 255 | 276 | #define __NR_rtas 255 |
263 | #define __NR_sys_debug_setcontext 256 | 277 | #define __NR_sys_debug_setcontext 256 |
264 | /* Number 257 is reserved for vserver */ | 278 | /* Number 257 is reserved for vserver */ |
265 | /* 258 currently unused */ | 279 | /* 258 currently unused */ |
266 | /* Number 259 is reserved for new sys_mbind */ | 280 | #define __NR_mbind 259 |
267 | /* Number 260 is reserved for new sys_get_mempolicy */ | 281 | #define __NR_get_mempolicy 260 |
268 | /* Number 261 is reserved for new sys_set_mempolicy */ | 282 | #define __NR_set_mempolicy 261 |
269 | #define __NR_mq_open 262 | 283 | #define __NR_mq_open 262 |
270 | #define __NR_mq_unlink 263 | 284 | #define __NR_mq_unlink 263 |
271 | #define __NR_mq_timedsend 264 | 285 | #define __NR_mq_timedsend 264 |
@@ -285,7 +299,12 @@ | |||
285 | 299 | ||
286 | #define __NR_syscalls 278 | 300 | #define __NR_syscalls 278 |
287 | 301 | ||
288 | #define __NR(n) #n | 302 | #ifdef __KERNEL__ |
303 | #define __NR__exit __NR_exit | ||
304 | #define NR_syscalls __NR_syscalls | ||
305 | #endif | ||
306 | |||
307 | #ifndef __ASSEMBLY__ | ||
289 | 308 | ||
290 | /* On powerpc a system call basically clobbers the same registers like a | 309 | /* On powerpc a system call basically clobbers the same registers like a |
291 | * function call, with the exception of LR (which is needed for the | 310 | * function call, with the exception of LR (which is needed for the |
@@ -389,7 +408,6 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | |||
389 | { \ | 408 | { \ |
390 | __syscall_nr(5, type, name, arg1, arg2, arg3, arg4, arg5); \ | 409 | __syscall_nr(5, type, name, arg1, arg2, arg3, arg4, arg5); \ |
391 | } | 410 | } |
392 | |||
393 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ | 411 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ |
394 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ | 412 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ |
395 | { \ | 413 | { \ |
@@ -398,12 +416,13 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
398 | 416 | ||
399 | #ifdef __KERNEL__ | 417 | #ifdef __KERNEL__ |
400 | 418 | ||
401 | #define __NR__exit __NR_exit | 419 | #include <linux/config.h> |
402 | #define NR_syscalls __NR_syscalls | 420 | #include <linux/types.h> |
421 | #include <linux/compiler.h> | ||
422 | #include <linux/linkage.h> | ||
403 | 423 | ||
404 | #define __ARCH_WANT_IPC_PARSE_VERSION | 424 | #define __ARCH_WANT_IPC_PARSE_VERSION |
405 | #define __ARCH_WANT_OLD_READDIR | 425 | #define __ARCH_WANT_OLD_READDIR |
406 | #define __ARCH_WANT_OLD_STAT | ||
407 | #define __ARCH_WANT_STAT64 | 426 | #define __ARCH_WANT_STAT64 |
408 | #define __ARCH_WANT_SYS_ALARM | 427 | #define __ARCH_WANT_SYS_ALARM |
409 | #define __ARCH_WANT_SYS_GETHOSTNAME | 428 | #define __ARCH_WANT_SYS_GETHOSTNAME |
@@ -423,23 +442,17 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
423 | #define __ARCH_WANT_SYS_SIGPENDING | 442 | #define __ARCH_WANT_SYS_SIGPENDING |
424 | #define __ARCH_WANT_SYS_SIGPROCMASK | 443 | #define __ARCH_WANT_SYS_SIGPROCMASK |
425 | #define __ARCH_WANT_SYS_RT_SIGACTION | 444 | #define __ARCH_WANT_SYS_RT_SIGACTION |
426 | 445 | #ifdef CONFIG_PPC32 | |
427 | /* | 446 | #define __ARCH_WANT_OLD_STAT |
428 | * Forking from kernel space will result in the child getting a new, | 447 | #endif |
429 | * empty kernel stack area. Thus the child cannot access automatic | 448 | #ifdef CONFIG_PPC64 |
430 | * variables set in the parent unless they are in registers, and the | 449 | #define __ARCH_WANT_COMPAT_SYS_TIME |
431 | * procedure where the fork was done cannot return to its caller in | 450 | #endif |
432 | * the child. | ||
433 | */ | ||
434 | |||
435 | #ifdef __KERNEL_SYSCALLS__ | ||
436 | |||
437 | #include <linux/compiler.h> | ||
438 | #include <linux/types.h> | ||
439 | 451 | ||
440 | /* | 452 | /* |
441 | * System call prototypes. | 453 | * System call prototypes. |
442 | */ | 454 | */ |
455 | #ifdef __KERNEL_SYSCALLS__ | ||
443 | extern pid_t setsid(void); | 456 | extern pid_t setsid(void); |
444 | extern int write(int fd, const char *buf, off_t count); | 457 | extern int write(int fd, const char *buf, off_t count); |
445 | extern int read(int fd, char *buf, off_t count); | 458 | extern int read(int fd, char *buf, off_t count); |
@@ -449,10 +462,13 @@ extern int execve(const char *file, char **argv, char **envp); | |||
449 | extern int open(const char *file, int flag, int mode); | 462 | extern int open(const char *file, int flag, int mode); |
450 | extern int close(int fd); | 463 | extern int close(int fd); |
451 | extern pid_t waitpid(pid_t pid, int *wait_stat, int options); | 464 | extern pid_t waitpid(pid_t pid, int *wait_stat, int options); |
465 | #endif /* __KERNEL_SYSCALLS__ */ | ||
452 | 466 | ||
453 | unsigned long sys_mmap(unsigned long addr, size_t len, | 467 | /* |
454 | unsigned long prot, unsigned long flags, | 468 | * Functions that implement syscalls. |
455 | unsigned long fd, off_t offset); | 469 | */ |
470 | unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot, | ||
471 | unsigned long flags, unsigned long fd, off_t offset); | ||
456 | unsigned long sys_mmap2(unsigned long addr, size_t len, | 472 | unsigned long sys_mmap2(unsigned long addr, size_t len, |
457 | unsigned long prot, unsigned long flags, | 473 | unsigned long prot, unsigned long flags, |
458 | unsigned long fd, unsigned long pgoff); | 474 | unsigned long fd, unsigned long pgoff); |
@@ -461,22 +477,18 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, | |||
461 | unsigned long a3, unsigned long a4, unsigned long a5, | 477 | unsigned long a3, unsigned long a4, unsigned long a5, |
462 | struct pt_regs *regs); | 478 | struct pt_regs *regs); |
463 | int sys_clone(unsigned long clone_flags, unsigned long usp, | 479 | int sys_clone(unsigned long clone_flags, unsigned long usp, |
464 | int __user *parent_tidp, void __user *child_threadptr, | 480 | int __user *parent_tidp, void __user *child_threadptr, |
465 | int __user *child_tidp, int p6, | 481 | int __user *child_tidp, int p6, struct pt_regs *regs); |
466 | struct pt_regs *regs); | 482 | int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, |
467 | int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6, | 483 | unsigned long p4, unsigned long p5, unsigned long p6, |
468 | struct pt_regs *regs); | 484 | struct pt_regs *regs); |
469 | int sys_vfork(int p1, int p2, int p3, int p4, int p5, int p6, | 485 | int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, |
486 | unsigned long p4, unsigned long p5, unsigned long p6, | ||
470 | struct pt_regs *regs); | 487 | struct pt_regs *regs); |
471 | int sys_pipe(int __user *fildes); | 488 | int sys_pipe(int __user *fildes); |
472 | int sys_ptrace(long request, long pid, long addr, long data); | ||
473 | struct sigaction; | 489 | struct sigaction; |
474 | long sys_rt_sigaction(int sig, | 490 | long sys_rt_sigaction(int sig, const struct sigaction __user *act, |
475 | const struct sigaction __user *act, | 491 | struct sigaction __user *oact, size_t sigsetsize); |
476 | struct sigaction __user *oact, | ||
477 | size_t sigsetsize); | ||
478 | |||
479 | #endif /* __KERNEL_SYSCALLS__ */ | ||
480 | 492 | ||
481 | /* | 493 | /* |
482 | * "Conditional" syscalls | 494 | * "Conditional" syscalls |
@@ -484,10 +496,14 @@ long sys_rt_sigaction(int sig, | |||
484 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | 496 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), |
485 | * but it doesn't work on all toolchains, so we just do it by hand | 497 | * but it doesn't work on all toolchains, so we just do it by hand |
486 | */ | 498 | */ |
487 | #ifndef cond_syscall | 499 | #ifdef CONFIG_PPC32 |
488 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | 500 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") |
501 | #else | ||
502 | #define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall") | ||
489 | #endif | 503 | #endif |
490 | 504 | ||
491 | #endif /* __KERNEL__ */ | 505 | #endif /* __KERNEL__ */ |
506 | |||
507 | #endif /* __ASSEMBLY__ */ | ||
492 | 508 | ||
493 | #endif /* _ASM_PPC_UNISTD_H_ */ | 509 | #endif /* _ASM_PPC_UNISTD_H_ */ |
diff --git a/include/asm-ppc64/vga.h b/include/asm-powerpc/vga.h index c09849743f45..f8d350aabf1a 100644 --- a/include/asm-ppc64/vga.h +++ b/include/asm-powerpc/vga.h | |||
@@ -1,16 +1,14 @@ | |||
1 | #ifndef _ASM_POWERPC_VGA_H_ | ||
2 | #define _ASM_POWERPC_VGA_H_ | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
1 | /* | 6 | /* |
2 | * Access to VGA videoram | 7 | * Access to VGA videoram |
3 | * | 8 | * |
4 | * (c) 1998 Martin Mares <mj@ucw.cz> | 9 | * (c) 1998 Martin Mares <mj@ucw.cz> |
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef _LINUX_ASM_VGA_H_ | ||
13 | #define _LINUX_ASM_VGA_H_ | ||
14 | 12 | ||
15 | #include <asm/io.h> | 13 | #include <asm/io.h> |
16 | 14 | ||
@@ -42,9 +40,15 @@ static inline u16 scr_readw(volatile const u16 *addr) | |||
42 | #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */ | 40 | #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */ |
43 | 41 | ||
44 | extern unsigned long vgacon_remap_base; | 42 | extern unsigned long vgacon_remap_base; |
43 | |||
44 | #ifdef __powerpc64__ | ||
45 | #define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) | 45 | #define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) |
46 | #else | ||
47 | #define VGA_MAP_MEM(x) (x + vgacon_remap_base) | ||
48 | #endif | ||
46 | 49 | ||
47 | #define vga_readb(x) (*(x)) | 50 | #define vga_readb(x) (*(x)) |
48 | #define vga_writeb(x,y) (*(y) = (x)) | 51 | #define vga_writeb(x,y) (*(y) = (x)) |
49 | 52 | ||
50 | #endif | 53 | #endif /* __KERNEL__ */ |
54 | #endif /* _ASM_POWERPC_VGA_H_ */ | ||
diff --git a/include/asm-ppc64/vio.h b/include/asm-powerpc/vio.h index 03f1b95f433b..e0ccf108277c 100644 --- a/include/asm-ppc64/vio.h +++ b/include/asm-powerpc/vio.h | |||
@@ -1,18 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * IBM PowerPC Virtual I/O Infrastructure Support. | 2 | * IBM PowerPC Virtual I/O Infrastructure Support. |
3 | * | 3 | * |
4 | * Copyright (c) 2003 IBM Corp. | 4 | * Copyright (c) 2003 IBM Corp. |
5 | * Dave Engebretsen engebret@us.ibm.com | 5 | * Dave Engebretsen engebret@us.ibm.com |
6 | * Santiago Leon santil@us.ibm.com | 6 | * Santiago Leon santil@us.ibm.com |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or | 8 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License | 9 | * modify it under the terms of the GNU General Public License |
10 | * as published by the Free Software Foundation; either version | 10 | * as published by the Free Software Foundation; either version |
11 | * 2 of the License, or (at your option) any later version. | 11 | * 2 of the License, or (at your option) any later version. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef _ASM_VIO_H | 14 | #ifndef _ASM_POWERPC_VIO_H |
15 | #define _ASM_VIO_H | 15 | #define _ASM_POWERPC_VIO_H |
16 | 16 | ||
17 | #include <linux/config.h> | 17 | #include <linux/config.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
@@ -55,10 +55,10 @@ struct vio_dev { | |||
55 | 55 | ||
56 | struct vio_driver { | 56 | struct vio_driver { |
57 | struct list_head node; | 57 | struct list_head node; |
58 | char *name; | ||
59 | const struct vio_device_id *id_table; | 58 | const struct vio_device_id *id_table; |
60 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 59 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
61 | int (*remove)(struct vio_dev *dev); | 60 | int (*remove)(struct vio_dev *dev); |
61 | void (*shutdown)(struct vio_dev *dev); | ||
62 | unsigned long driver_data; | 62 | unsigned long driver_data; |
63 | struct device_driver driver; | 63 | struct device_driver driver; |
64 | }; | 64 | }; |
@@ -103,4 +103,4 @@ static inline struct vio_dev *to_vio_dev(struct device *dev) | |||
103 | return container_of(dev, struct vio_dev, dev); | 103 | return container_of(dev, struct vio_dev, dev); |
104 | } | 104 | } |
105 | 105 | ||
106 | #endif /* _ASM_VIO_H */ | 106 | #endif /* _ASM_POWERPC_VIO_H */ |
diff --git a/include/asm-powerpc/xmon.h b/include/asm-powerpc/xmon.h new file mode 100644 index 000000000000..43f7129984c7 --- /dev/null +++ b/include/asm-powerpc/xmon.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __PPC_XMON_H | ||
2 | #define __PPC_XMON_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | struct pt_regs; | ||
6 | |||
7 | extern int xmon(struct pt_regs *excp); | ||
8 | extern void xmon_printf(const char *fmt, ...); | ||
9 | extern void xmon_init(int); | ||
10 | |||
11 | #endif | ||
12 | #endif | ||
diff --git a/include/asm-ppc/a.out.h b/include/asm-ppc/a.out.h deleted file mode 100644 index 8979a94c4a81..000000000000 --- a/include/asm-ppc/a.out.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #ifndef __PPC_A_OUT_H__ | ||
2 | #define __PPC_A_OUT_H__ | ||
3 | |||
4 | /* grabbed from the intel stuff */ | ||
5 | #define STACK_TOP TASK_SIZE | ||
6 | |||
7 | |||
8 | struct exec | ||
9 | { | ||
10 | unsigned long a_info; /* Use macros N_MAGIC, etc for access */ | ||
11 | unsigned a_text; /* length of text, in bytes */ | ||
12 | unsigned a_data; /* length of data, in bytes */ | ||
13 | unsigned a_bss; /* length of uninitialized data area for file, in bytes */ | ||
14 | unsigned a_syms; /* length of symbol table data in file, in bytes */ | ||
15 | unsigned a_entry; /* start address */ | ||
16 | unsigned a_trsize; /* length of relocation info for text, in bytes */ | ||
17 | unsigned a_drsize; /* length of relocation info for data, in bytes */ | ||
18 | }; | ||
19 | |||
20 | |||
21 | #define N_TRSIZE(a) ((a).a_trsize) | ||
22 | #define N_DRSIZE(a) ((a).a_drsize) | ||
23 | #define N_SYMSIZE(a) ((a).a_syms) | ||
24 | |||
25 | |||
26 | #endif | ||
diff --git a/include/asm-ppc/auxvec.h b/include/asm-ppc/auxvec.h deleted file mode 100644 index 172358df29c8..000000000000 --- a/include/asm-ppc/auxvec.h +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #ifndef __PPC_AUXVEC_H | ||
2 | #define __PPC_AUXVEC_H | ||
3 | |||
4 | /* | ||
5 | * We need to put in some extra aux table entries to tell glibc what | ||
6 | * the cache block size is, so it can use the dcbz instruction safely. | ||
7 | */ | ||
8 | #define AT_DCACHEBSIZE 19 | ||
9 | #define AT_ICACHEBSIZE 20 | ||
10 | #define AT_UCACHEBSIZE 21 | ||
11 | /* A special ignored type value for PPC, for glibc compatibility. */ | ||
12 | #define AT_IGNOREPPC 22 | ||
13 | |||
14 | #endif | ||
diff --git a/include/asm-ppc/bug.h b/include/asm-ppc/bug.h deleted file mode 100644 index 8b34fd682b0d..000000000000 --- a/include/asm-ppc/bug.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | #ifndef _PPC_BUG_H | ||
2 | #define _PPC_BUG_H | ||
3 | |||
4 | struct bug_entry { | ||
5 | unsigned long bug_addr; | ||
6 | int line; | ||
7 | const char *file; | ||
8 | const char *function; | ||
9 | }; | ||
10 | |||
11 | /* | ||
12 | * If this bit is set in the line number it means that the trap | ||
13 | * is for WARN_ON rather than BUG or BUG_ON. | ||
14 | */ | ||
15 | #define BUG_WARNING_TRAP 0x1000000 | ||
16 | |||
17 | #ifdef CONFIG_BUG | ||
18 | #define BUG() do { \ | ||
19 | __asm__ __volatile__( \ | ||
20 | "1: twi 31,0,0\n" \ | ||
21 | ".section __bug_table,\"a\"\n\t" \ | ||
22 | " .long 1b,%0,%1,%2\n" \ | ||
23 | ".previous" \ | ||
24 | : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ | ||
25 | } while (0) | ||
26 | |||
27 | #define BUG_ON(x) do { \ | ||
28 | if (!__builtin_constant_p(x) || (x)) { \ | ||
29 | __asm__ __volatile__( \ | ||
30 | "1: twnei %0,0\n" \ | ||
31 | ".section __bug_table,\"a\"\n\t" \ | ||
32 | " .long 1b,%1,%2,%3\n" \ | ||
33 | ".previous" \ | ||
34 | : : "r" (x), "i" (__LINE__), "i" (__FILE__), \ | ||
35 | "i" (__FUNCTION__)); \ | ||
36 | } \ | ||
37 | } while (0) | ||
38 | |||
39 | #define WARN_ON(x) do { \ | ||
40 | if (!__builtin_constant_p(x) || (x)) { \ | ||
41 | __asm__ __volatile__( \ | ||
42 | "1: twnei %0,0\n" \ | ||
43 | ".section __bug_table,\"a\"\n\t" \ | ||
44 | " .long 1b,%1,%2,%3\n" \ | ||
45 | ".previous" \ | ||
46 | : : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \ | ||
47 | "i" (__FILE__), "i" (__FUNCTION__)); \ | ||
48 | } \ | ||
49 | } while (0) | ||
50 | |||
51 | #define HAVE_ARCH_BUG | ||
52 | #define HAVE_ARCH_BUG_ON | ||
53 | #define HAVE_ARCH_WARN_ON | ||
54 | #endif | ||
55 | |||
56 | #include <asm-generic/bug.h> | ||
57 | |||
58 | #endif | ||
diff --git a/include/asm-ppc/byteorder.h b/include/asm-ppc/byteorder.h deleted file mode 100644 index c63c81ec7968..000000000000 --- a/include/asm-ppc/byteorder.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | #ifndef _PPC_BYTEORDER_H | ||
2 | #define _PPC_BYTEORDER_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | #include <linux/compiler.h> | ||
6 | |||
7 | #ifdef __GNUC__ | ||
8 | #ifdef __KERNEL__ | ||
9 | |||
10 | extern __inline__ unsigned ld_le16(const volatile unsigned short *addr) | ||
11 | { | ||
12 | unsigned val; | ||
13 | |||
14 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); | ||
15 | return val; | ||
16 | } | ||
17 | |||
18 | extern __inline__ void st_le16(volatile unsigned short *addr, const unsigned val) | ||
19 | { | ||
20 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); | ||
21 | } | ||
22 | |||
23 | extern __inline__ unsigned ld_le32(const volatile unsigned *addr) | ||
24 | { | ||
25 | unsigned val; | ||
26 | |||
27 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); | ||
28 | return val; | ||
29 | } | ||
30 | |||
31 | extern __inline__ void st_le32(volatile unsigned *addr, const unsigned val) | ||
32 | { | ||
33 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); | ||
34 | } | ||
35 | |||
36 | static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value) | ||
37 | { | ||
38 | __u16 result; | ||
39 | |||
40 | __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (value >> 8), "r" (value)); | ||
41 | return result; | ||
42 | } | ||
43 | |||
44 | static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value) | ||
45 | { | ||
46 | __u32 result; | ||
47 | |||
48 | __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (value>>24), "r" (value)); | ||
49 | __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (value)); | ||
50 | __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (value)); | ||
51 | |||
52 | return result; | ||
53 | } | ||
54 | #define __arch__swab32(x) ___arch__swab32(x) | ||
55 | #define __arch__swab16(x) ___arch__swab16(x) | ||
56 | |||
57 | /* The same, but returns converted value from the location pointer by addr. */ | ||
58 | #define __arch__swab16p(addr) ld_le16(addr) | ||
59 | #define __arch__swab32p(addr) ld_le32(addr) | ||
60 | |||
61 | /* The same, but do the conversion in situ, ie. put the value back to addr. */ | ||
62 | #define __arch__swab16s(addr) st_le16(addr,*addr) | ||
63 | #define __arch__swab32s(addr) st_le32(addr,*addr) | ||
64 | |||
65 | #endif /* __KERNEL__ */ | ||
66 | |||
67 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
68 | # define __BYTEORDER_HAS_U64__ | ||
69 | # define __SWAB_64_THRU_32__ | ||
70 | #endif | ||
71 | |||
72 | #endif /* __GNUC__ */ | ||
73 | |||
74 | #include <linux/byteorder/big_endian.h> | ||
75 | |||
76 | #endif /* _PPC_BYTEORDER_H */ | ||
diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h index 38f2f1be4a87..7a157d0f4b5f 100644 --- a/include/asm-ppc/cache.h +++ b/include/asm-ppc/cache.h | |||
@@ -9,21 +9,18 @@ | |||
9 | 9 | ||
10 | /* bytes per L1 cache line */ | 10 | /* bytes per L1 cache line */ |
11 | #if defined(CONFIG_8xx) || defined(CONFIG_403GCX) | 11 | #if defined(CONFIG_8xx) || defined(CONFIG_403GCX) |
12 | #define L1_CACHE_LINE_SIZE 16 | 12 | #define L1_CACHE_SHIFT 4 |
13 | #define LG_L1_CACHE_LINE_SIZE 4 | ||
14 | #define MAX_COPY_PREFETCH 1 | 13 | #define MAX_COPY_PREFETCH 1 |
15 | #elif defined(CONFIG_PPC64BRIDGE) | 14 | #elif defined(CONFIG_PPC64BRIDGE) |
16 | #define L1_CACHE_LINE_SIZE 128 | 15 | #define L1_CACHE_SHIFT 7 |
17 | #define LG_L1_CACHE_LINE_SIZE 7 | ||
18 | #define MAX_COPY_PREFETCH 1 | 16 | #define MAX_COPY_PREFETCH 1 |
19 | #else | 17 | #else |
20 | #define L1_CACHE_LINE_SIZE 32 | 18 | #define L1_CACHE_SHIFT 5 |
21 | #define LG_L1_CACHE_LINE_SIZE 5 | ||
22 | #define MAX_COPY_PREFETCH 4 | 19 | #define MAX_COPY_PREFETCH 4 |
23 | #endif | 20 | #endif |
24 | 21 | ||
25 | #define L1_CACHE_BYTES L1_CACHE_LINE_SIZE | 22 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
26 | #define L1_CACHE_SHIFT LG_L1_CACHE_LINE_SIZE | 23 | |
27 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 24 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
28 | #define L1_CACHE_SHIFT_MAX 7 /* largest L1 which this arch supports */ | 25 | #define L1_CACHE_SHIFT_MAX 7 /* largest L1 which this arch supports */ |
29 | 26 | ||
diff --git a/include/asm-ppc/checksum.h b/include/asm-ppc/checksum.h deleted file mode 100644 index cf953a92c7ab..000000000000 --- a/include/asm-ppc/checksum.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _PPC_CHECKSUM_H | ||
3 | #define _PPC_CHECKSUM_H | ||
4 | |||
5 | |||
6 | /* | ||
7 | * computes the checksum of a memory block at buff, length len, | ||
8 | * and adds in "sum" (32-bit) | ||
9 | * | ||
10 | * returns a 32-bit number suitable for feeding into itself | ||
11 | * or csum_tcpudp_magic | ||
12 | * | ||
13 | * this function must be called with even lengths, except | ||
14 | * for the last fragment, which may be odd | ||
15 | * | ||
16 | * it's best to have buff aligned on a 32-bit boundary | ||
17 | */ | ||
18 | extern unsigned int csum_partial(const unsigned char * buff, int len, | ||
19 | unsigned int sum); | ||
20 | |||
21 | /* | ||
22 | * Computes the checksum of a memory block at src, length len, | ||
23 | * and adds in "sum" (32-bit), while copying the block to dst. | ||
24 | * If an access exception occurs on src or dst, it stores -EFAULT | ||
25 | * to *src_err or *dst_err respectively (if that pointer is not | ||
26 | * NULL), and, for an error on src, zeroes the rest of dst. | ||
27 | * | ||
28 | * Like csum_partial, this must be called with even lengths, | ||
29 | * except for the last fragment. | ||
30 | */ | ||
31 | extern unsigned int csum_partial_copy_generic(const char *src, char *dst, | ||
32 | int len, unsigned int sum, | ||
33 | int *src_err, int *dst_err); | ||
34 | |||
35 | #define csum_partial_copy_from_user(src, dst, len, sum, errp) \ | ||
36 | csum_partial_copy_generic((__force void *)(src), (dst), (len), (sum), (errp), NULL) | ||
37 | |||
38 | /* FIXME: this needs to be written to really do no check -- Cort */ | ||
39 | #define csum_partial_copy_nocheck(src, dst, len, sum) \ | ||
40 | csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL) | ||
41 | |||
42 | /* | ||
43 | * turns a 32-bit partial checksum (e.g. from csum_partial) into a | ||
44 | * 1's complement 16-bit checksum. | ||
45 | */ | ||
46 | static inline unsigned int csum_fold(unsigned int sum) | ||
47 | { | ||
48 | unsigned int tmp; | ||
49 | |||
50 | /* swap the two 16-bit halves of sum */ | ||
51 | __asm__("rlwinm %0,%1,16,0,31" : "=r" (tmp) : "r" (sum)); | ||
52 | /* if there is a carry from adding the two 16-bit halves, | ||
53 | it will carry from the lower half into the upper half, | ||
54 | giving us the correct sum in the upper half. */ | ||
55 | sum = ~(sum + tmp) >> 16; | ||
56 | return sum; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * this routine is used for miscellaneous IP-like checksums, mainly | ||
61 | * in icmp.c | ||
62 | */ | ||
63 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | ||
64 | { | ||
65 | return csum_fold(csum_partial(buff, len, 0)); | ||
66 | } | ||
67 | |||
68 | /* | ||
69 | * FIXME: I swiped this one from the sparc and made minor modifications. | ||
70 | * It may not be correct. -- Cort | ||
71 | */ | ||
72 | static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, | ||
73 | unsigned long daddr, | ||
74 | unsigned short len, | ||
75 | unsigned short proto, | ||
76 | unsigned int sum) | ||
77 | { | ||
78 | __asm__("\n\ | ||
79 | addc %0,%0,%1 \n\ | ||
80 | adde %0,%0,%2 \n\ | ||
81 | adde %0,%0,%3 \n\ | ||
82 | addze %0,%0 \n\ | ||
83 | " | ||
84 | : "=r" (sum) | ||
85 | : "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum)); | ||
86 | return sum; | ||
87 | } | ||
88 | |||
89 | /* | ||
90 | * This is a version of ip_compute_csum() optimized for IP headers, | ||
91 | * which always checksum on 4 octet boundaries. ihl is the number | ||
92 | * of 32-bit words and is always >= 5. | ||
93 | */ | ||
94 | extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl); | ||
95 | |||
96 | /* | ||
97 | * computes the checksum of the TCP/UDP pseudo-header | ||
98 | * returns a 16-bit checksum, already complemented | ||
99 | */ | ||
100 | extern unsigned short csum_tcpudp_magic(unsigned long saddr, | ||
101 | unsigned long daddr, | ||
102 | unsigned short len, | ||
103 | unsigned short proto, | ||
104 | unsigned int sum); | ||
105 | |||
106 | #endif | ||
107 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index 9483d4bfacf7..43d2ebbc7748 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
@@ -1087,6 +1087,9 @@ typedef struct im_idma { | |||
1087 | #define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */ | 1087 | #define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */ |
1088 | #define SCCR_PCIDF_SHIFT 3 | 1088 | #define SCCR_PCIDF_SHIFT 3 |
1089 | 1089 | ||
1090 | #ifndef CPM_IMMR_OFFSET | ||
1091 | #define CPM_IMMR_OFFSET 0x101a8 | ||
1092 | #endif | ||
1090 | 1093 | ||
1091 | #endif /* __CPM2__ */ | 1094 | #endif /* __CPM2__ */ |
1092 | #endif /* __KERNEL__ */ | 1095 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h deleted file mode 100644 index e17c492c870b..000000000000 --- a/include/asm-ppc/cputable.h +++ /dev/null | |||
@@ -1,129 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-ppc/cputable.h | ||
3 | * | ||
4 | * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ASM_PPC_CPUTABLE_H | ||
13 | #define __ASM_PPC_CPUTABLE_H | ||
14 | |||
15 | /* Exposed to userland CPU features */ | ||
16 | #define PPC_FEATURE_32 0x80000000 | ||
17 | #define PPC_FEATURE_64 0x40000000 | ||
18 | #define PPC_FEATURE_601_INSTR 0x20000000 | ||
19 | #define PPC_FEATURE_HAS_ALTIVEC 0x10000000 | ||
20 | #define PPC_FEATURE_HAS_FPU 0x08000000 | ||
21 | #define PPC_FEATURE_HAS_MMU 0x04000000 | ||
22 | #define PPC_FEATURE_HAS_4xxMAC 0x02000000 | ||
23 | #define PPC_FEATURE_UNIFIED_CACHE 0x01000000 | ||
24 | #define PPC_FEATURE_HAS_SPE 0x00800000 | ||
25 | #define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000 | ||
26 | #define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000 | ||
27 | #define PPC_FEATURE_NO_TB 0x00100000 | ||
28 | |||
29 | #ifdef __KERNEL__ | ||
30 | |||
31 | #ifndef __ASSEMBLY__ | ||
32 | |||
33 | /* This structure can grow, it's real size is used by head.S code | ||
34 | * via the mkdefs mecanism. | ||
35 | */ | ||
36 | struct cpu_spec; | ||
37 | |||
38 | typedef void (*cpu_setup_t)(unsigned long offset, int cpu_nr, struct cpu_spec* spec); | ||
39 | |||
40 | struct cpu_spec { | ||
41 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ | ||
42 | unsigned int pvr_mask; | ||
43 | unsigned int pvr_value; | ||
44 | |||
45 | char *cpu_name; | ||
46 | unsigned int cpu_features; /* Kernel features */ | ||
47 | unsigned int cpu_user_features; /* Userland features */ | ||
48 | |||
49 | /* cache line sizes */ | ||
50 | unsigned int icache_bsize; | ||
51 | unsigned int dcache_bsize; | ||
52 | |||
53 | /* number of performance monitor counters */ | ||
54 | unsigned int num_pmcs; | ||
55 | |||
56 | /* this is called to initialize various CPU bits like L1 cache, | ||
57 | * BHT, SPD, etc... from head.S before branching to identify_machine | ||
58 | */ | ||
59 | cpu_setup_t cpu_setup; | ||
60 | }; | ||
61 | |||
62 | extern struct cpu_spec cpu_specs[]; | ||
63 | extern struct cpu_spec *cur_cpu_spec[]; | ||
64 | |||
65 | static inline unsigned int cpu_has_feature(unsigned int feature) | ||
66 | { | ||
67 | return cur_cpu_spec[0]->cpu_features & feature; | ||
68 | } | ||
69 | |||
70 | #endif /* __ASSEMBLY__ */ | ||
71 | |||
72 | /* CPU kernel features */ | ||
73 | #define CPU_FTR_SPLIT_ID_CACHE 0x00000001 | ||
74 | #define CPU_FTR_L2CR 0x00000002 | ||
75 | #define CPU_FTR_SPEC7450 0x00000004 | ||
76 | #define CPU_FTR_ALTIVEC 0x00000008 | ||
77 | #define CPU_FTR_TAU 0x00000010 | ||
78 | #define CPU_FTR_CAN_DOZE 0x00000020 | ||
79 | #define CPU_FTR_USE_TB 0x00000040 | ||
80 | #define CPU_FTR_604_PERF_MON 0x00000080 | ||
81 | #define CPU_FTR_601 0x00000100 | ||
82 | #define CPU_FTR_HPTE_TABLE 0x00000200 | ||
83 | #define CPU_FTR_CAN_NAP 0x00000400 | ||
84 | #define CPU_FTR_L3CR 0x00000800 | ||
85 | #define CPU_FTR_L3_DISABLE_NAP 0x00001000 | ||
86 | #define CPU_FTR_NAP_DISABLE_L2_PR 0x00002000 | ||
87 | #define CPU_FTR_DUAL_PLL_750FX 0x00004000 | ||
88 | #define CPU_FTR_NO_DPM 0x00008000 | ||
89 | #define CPU_FTR_HAS_HIGH_BATS 0x00010000 | ||
90 | #define CPU_FTR_NEED_COHERENT 0x00020000 | ||
91 | #define CPU_FTR_NO_BTIC 0x00040000 | ||
92 | #define CPU_FTR_BIG_PHYS 0x00080000 | ||
93 | |||
94 | #ifdef __ASSEMBLY__ | ||
95 | |||
96 | #define BEGIN_FTR_SECTION 98: | ||
97 | |||
98 | #define END_FTR_SECTION(msk, val) \ | ||
99 | 99: \ | ||
100 | .section __ftr_fixup,"a"; \ | ||
101 | .align 2; \ | ||
102 | .long msk; \ | ||
103 | .long val; \ | ||
104 | .long 98b; \ | ||
105 | .long 99b; \ | ||
106 | .previous | ||
107 | |||
108 | #else | ||
109 | |||
110 | #define BEGIN_FTR_SECTION "98:\n" | ||
111 | #define END_FTR_SECTION(msk, val) \ | ||
112 | "99:\n" \ | ||
113 | " .section __ftr_fixup,\"a\";\n" \ | ||
114 | " .align 2;\n" \ | ||
115 | " .long "#msk";\n" \ | ||
116 | " .long "#val";\n" \ | ||
117 | " .long 98b;\n" \ | ||
118 | " .long 99b;\n" \ | ||
119 | " .previous\n" | ||
120 | |||
121 | |||
122 | #endif /* __ASSEMBLY__ */ | ||
123 | |||
124 | #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) | ||
125 | #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) | ||
126 | |||
127 | #endif /* __ASM_PPC_CPUTABLE_H */ | ||
128 | #endif /* __KERNEL__ */ | ||
129 | |||
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h index 061bfcac1bf1..6e9635114433 100644 --- a/include/asm-ppc/dma-mapping.h +++ b/include/asm-ppc/dma-mapping.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * allocate the space "normally" and use the cache management functions | 19 | * allocate the space "normally" and use the cache management functions |
20 | * to ensure it is consistent. | 20 | * to ensure it is consistent. |
21 | */ | 21 | */ |
22 | extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, int gfp); | 22 | extern void *__dma_alloc_coherent(size_t size, dma_addr_t *handle, gfp_t gfp); |
23 | extern void __dma_free_coherent(size_t size, void *vaddr); | 23 | extern void __dma_free_coherent(size_t size, void *vaddr); |
24 | extern void __dma_sync(void *vaddr, size_t size, int direction); | 24 | extern void __dma_sync(void *vaddr, size_t size, int direction); |
25 | extern void __dma_sync_page(struct page *page, unsigned long offset, | 25 | extern void __dma_sync_page(struct page *page, unsigned long offset, |
diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h deleted file mode 100644 index c25cc35e6ab5..000000000000 --- a/include/asm-ppc/elf.h +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | #ifndef __PPC_ELF_H | ||
2 | #define __PPC_ELF_H | ||
3 | |||
4 | /* | ||
5 | * ELF register definitions.. | ||
6 | */ | ||
7 | #include <asm/types.h> | ||
8 | #include <asm/ptrace.h> | ||
9 | #include <asm/cputable.h> | ||
10 | #include <asm/auxvec.h> | ||
11 | |||
12 | /* PowerPC relocations defined by the ABIs */ | ||
13 | #define R_PPC_NONE 0 | ||
14 | #define R_PPC_ADDR32 1 /* 32bit absolute address */ | ||
15 | #define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ | ||
16 | #define R_PPC_ADDR16 3 /* 16bit absolute address */ | ||
17 | #define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ | ||
18 | #define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ | ||
19 | #define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ | ||
20 | #define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ | ||
21 | #define R_PPC_ADDR14_BRTAKEN 8 | ||
22 | #define R_PPC_ADDR14_BRNTAKEN 9 | ||
23 | #define R_PPC_REL24 10 /* PC relative 26 bit */ | ||
24 | #define R_PPC_REL14 11 /* PC relative 16 bit */ | ||
25 | #define R_PPC_REL14_BRTAKEN 12 | ||
26 | #define R_PPC_REL14_BRNTAKEN 13 | ||
27 | #define R_PPC_GOT16 14 | ||
28 | #define R_PPC_GOT16_LO 15 | ||
29 | #define R_PPC_GOT16_HI 16 | ||
30 | #define R_PPC_GOT16_HA 17 | ||
31 | #define R_PPC_PLTREL24 18 | ||
32 | #define R_PPC_COPY 19 | ||
33 | #define R_PPC_GLOB_DAT 20 | ||
34 | #define R_PPC_JMP_SLOT 21 | ||
35 | #define R_PPC_RELATIVE 22 | ||
36 | #define R_PPC_LOCAL24PC 23 | ||
37 | #define R_PPC_UADDR32 24 | ||
38 | #define R_PPC_UADDR16 25 | ||
39 | #define R_PPC_REL32 26 | ||
40 | #define R_PPC_PLT32 27 | ||
41 | #define R_PPC_PLTREL32 28 | ||
42 | #define R_PPC_PLT16_LO 29 | ||
43 | #define R_PPC_PLT16_HI 30 | ||
44 | #define R_PPC_PLT16_HA 31 | ||
45 | #define R_PPC_SDAREL16 32 | ||
46 | #define R_PPC_SECTOFF 33 | ||
47 | #define R_PPC_SECTOFF_LO 34 | ||
48 | #define R_PPC_SECTOFF_HI 35 | ||
49 | #define R_PPC_SECTOFF_HA 36 | ||
50 | /* Keep this the last entry. */ | ||
51 | #define R_PPC_NUM 37 | ||
52 | |||
53 | #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ | ||
54 | #define ELF_NFPREG 33 /* includes fpscr */ | ||
55 | #define ELF_NVRREG 33 /* includes vscr */ | ||
56 | #define ELF_NEVRREG 34 /* includes acc (as 2) */ | ||
57 | |||
58 | /* | ||
59 | * These are used to set parameters in the core dumps. | ||
60 | */ | ||
61 | #define ELF_ARCH EM_PPC | ||
62 | #define ELF_CLASS ELFCLASS32 | ||
63 | #define ELF_DATA ELFDATA2MSB | ||
64 | |||
65 | /* General registers */ | ||
66 | typedef unsigned long elf_greg_t; | ||
67 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
68 | |||
69 | /* Floating point registers */ | ||
70 | typedef double elf_fpreg_t; | ||
71 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | ||
72 | |||
73 | /* Altivec registers */ | ||
74 | typedef __vector128 elf_vrreg_t; | ||
75 | typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; | ||
76 | |||
77 | #ifdef __KERNEL__ | ||
78 | |||
79 | struct task_struct; | ||
80 | |||
81 | /* | ||
82 | * This is used to ensure we don't load something for the wrong architecture. | ||
83 | */ | ||
84 | |||
85 | #define elf_check_arch(x) ((x)->e_machine == EM_PPC) | ||
86 | |||
87 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | ||
88 | use of this is to invoke "./ld.so someprog" to test out a new version of | ||
89 | the loader. We need to make sure that it is out of the way of the program | ||
90 | that it will "exec", and that there is sufficient room for the brk. */ | ||
91 | |||
92 | #define ELF_ET_DYN_BASE (0x08000000) | ||
93 | |||
94 | #define USE_ELF_CORE_DUMP | ||
95 | #define ELF_EXEC_PAGESIZE 4096 | ||
96 | |||
97 | #define ELF_CORE_COPY_REGS(gregs, regs) \ | ||
98 | memcpy((gregs), (regs), sizeof(struct pt_regs)); \ | ||
99 | memset((char *)(gregs) + sizeof(struct pt_regs), 0, \ | ||
100 | sizeof(elf_gregset_t) - sizeof(struct pt_regs)); | ||
101 | |||
102 | #define ELF_CORE_COPY_TASK_REGS(t, elfregs) \ | ||
103 | ((t)->thread.regs? \ | ||
104 | ({ ELF_CORE_COPY_REGS((elfregs), (t)->thread.regs); 1; }): 0) | ||
105 | |||
106 | extern int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpu); | ||
107 | #define ELF_CORE_COPY_FPREGS(t, fpu) dump_task_fpu((t), (fpu)) | ||
108 | |||
109 | /* This yields a mask that user programs can use to figure out what | ||
110 | instruction set this cpu supports. This could be done in userspace, | ||
111 | but it's not easy, and we've already done it here. */ | ||
112 | |||
113 | #define ELF_HWCAP (cur_cpu_spec[0]->cpu_user_features) | ||
114 | |||
115 | /* This yields a string that ld.so will use to load implementation | ||
116 | specific libraries for optimization. This is more specific in | ||
117 | intent than poking at uname or /proc/cpuinfo. | ||
118 | |||
119 | For the moment, we have only optimizations for the Intel generations, | ||
120 | but that could change... */ | ||
121 | |||
122 | #define ELF_PLATFORM (NULL) | ||
123 | |||
124 | #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) | ||
125 | |||
126 | extern int dcache_bsize; | ||
127 | extern int icache_bsize; | ||
128 | extern int ucache_bsize; | ||
129 | |||
130 | /* | ||
131 | * The requirements here are: | ||
132 | * - keep the final alignment of sp (sp & 0xf) | ||
133 | * - make sure the 32-bit value at the first 16 byte aligned position of | ||
134 | * AUXV is greater than 16 for glibc compatibility. | ||
135 | * AT_IGNOREPPC is used for that. | ||
136 | * - for compatibility with glibc ARCH_DLINFO must always be defined on PPC, | ||
137 | * even if DLINFO_ARCH_ITEMS goes to zero or is undefined. | ||
138 | */ | ||
139 | #define ARCH_DLINFO \ | ||
140 | do { \ | ||
141 | /* Handle glibc compatibility. */ \ | ||
142 | NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ | ||
143 | NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ | ||
144 | /* Cache size items */ \ | ||
145 | NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ | ||
146 | NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ | ||
147 | NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ | ||
148 | } while (0) | ||
149 | |||
150 | #endif /* __KERNEL__ */ | ||
151 | #endif | ||
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h deleted file mode 100644 index 47dc7990fb26..000000000000 --- a/include/asm-ppc/hw_irq.h +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> | ||
3 | */ | ||
4 | #ifdef __KERNEL__ | ||
5 | #ifndef _PPC_HW_IRQ_H | ||
6 | #define _PPC_HW_IRQ_H | ||
7 | |||
8 | #include <asm/ptrace.h> | ||
9 | #include <asm/reg.h> | ||
10 | |||
11 | extern void timer_interrupt(struct pt_regs *); | ||
12 | |||
13 | #define INLINE_IRQS | ||
14 | |||
15 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) | ||
16 | |||
17 | #ifdef INLINE_IRQS | ||
18 | |||
19 | static inline void local_irq_disable(void) | ||
20 | { | ||
21 | unsigned long msr; | ||
22 | msr = mfmsr(); | ||
23 | mtmsr(msr & ~MSR_EE); | ||
24 | __asm__ __volatile__("": : :"memory"); | ||
25 | } | ||
26 | |||
27 | static inline void local_irq_enable(void) | ||
28 | { | ||
29 | unsigned long msr; | ||
30 | __asm__ __volatile__("": : :"memory"); | ||
31 | msr = mfmsr(); | ||
32 | mtmsr(msr | MSR_EE); | ||
33 | } | ||
34 | |||
35 | static inline void local_irq_save_ptr(unsigned long *flags) | ||
36 | { | ||
37 | unsigned long msr; | ||
38 | msr = mfmsr(); | ||
39 | *flags = msr; | ||
40 | mtmsr(msr & ~MSR_EE); | ||
41 | __asm__ __volatile__("": : :"memory"); | ||
42 | } | ||
43 | |||
44 | #define local_save_flags(flags) ((flags) = mfmsr()) | ||
45 | #define local_irq_save(flags) local_irq_save_ptr(&flags) | ||
46 | #define local_irq_restore(flags) mtmsr(flags) | ||
47 | |||
48 | #else | ||
49 | |||
50 | extern void local_irq_enable(void); | ||
51 | extern void local_irq_disable(void); | ||
52 | extern void local_irq_restore(unsigned long); | ||
53 | extern void local_save_flags_ptr(unsigned long *); | ||
54 | |||
55 | #define local_save_flags(flags) local_save_flags_ptr(&flags) | ||
56 | #define local_irq_save(flags) ({local_save_flags(flags);local_irq_disable();}) | ||
57 | |||
58 | #endif | ||
59 | |||
60 | extern void do_lost_interrupts(unsigned long); | ||
61 | |||
62 | #define mask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->disable) irq_desc[irq].handler->disable(irq);}) | ||
63 | #define unmask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->enable) irq_desc[irq].handler->enable(irq);}) | ||
64 | #define ack_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->ack) irq_desc[irq].handler->ack(irq);}) | ||
65 | |||
66 | /* Should we handle this via lost interrupts and IPIs or should we don't care like | ||
67 | * we do now ? --BenH. | ||
68 | */ | ||
69 | struct hw_interrupt_type; | ||
70 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
71 | |||
72 | |||
73 | #endif /* _PPC_HW_IRQ_H */ | ||
74 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/i8259.h b/include/asm-ppc/i8259.h deleted file mode 100644 index 091b71295de4..000000000000 --- a/include/asm-ppc/i8259.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _PPC_KERNEL_i8259_H | ||
2 | #define _PPC_KERNEL_i8259_H | ||
3 | |||
4 | #include <linux/irq.h> | ||
5 | |||
6 | extern struct hw_interrupt_type i8259_pic; | ||
7 | |||
8 | extern void i8259_init(long intack_addr); | ||
9 | extern int i8259_irq(struct pt_regs *regs); | ||
10 | |||
11 | #endif /* _PPC_KERNEL_i8259_H */ | ||
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 94d83998a759..f7f614dfc648 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <asm/page.h> | 9 | #include <asm/page.h> |
10 | #include <asm/byteorder.h> | 10 | #include <asm/byteorder.h> |
11 | #include <asm/synch.h> | ||
11 | #include <asm/mmu.h> | 12 | #include <asm/mmu.h> |
12 | 13 | ||
13 | #define SIO_CONFIG_RA 0x398 | 14 | #define SIO_CONFIG_RA 0x398 |
@@ -440,16 +441,6 @@ extern inline void * phys_to_virt(unsigned long address) | |||
440 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 441 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
441 | #define page_to_bus(page) (page_to_phys(page) + PCI_DRAM_OFFSET) | 442 | #define page_to_bus(page) (page_to_phys(page) + PCI_DRAM_OFFSET) |
442 | 443 | ||
443 | /* | ||
444 | * Enforce In-order Execution of I/O: | ||
445 | * Acts as a barrier to ensure all previous I/O accesses have | ||
446 | * completed before any further ones are issued. | ||
447 | */ | ||
448 | extern inline void eieio(void) | ||
449 | { | ||
450 | __asm__ __volatile__ ("eieio" : : : "memory"); | ||
451 | } | ||
452 | |||
453 | /* Enforce in-order execution of data I/O. | 444 | /* Enforce in-order execution of data I/O. |
454 | * No distinction between read/write on PPC; use eieio for all three. | 445 | * No distinction between read/write on PPC; use eieio for all three. |
455 | */ | 446 | */ |
diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h deleted file mode 100644 index 6d6fc78731e5..000000000000 --- a/include/asm-ppc/kmap_types.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _ASM_KMAP_TYPES_H | ||
3 | #define _ASM_KMAP_TYPES_H | ||
4 | |||
5 | enum km_type { | ||
6 | KM_BOUNCE_READ, | ||
7 | KM_SKB_SUNRPC_DATA, | ||
8 | KM_SKB_DATA_SOFTIRQ, | ||
9 | KM_USER0, | ||
10 | KM_USER1, | ||
11 | KM_BIO_SRC_IRQ, | ||
12 | KM_BIO_DST_IRQ, | ||
13 | KM_PTE0, | ||
14 | KM_PTE1, | ||
15 | KM_IRQ0, | ||
16 | KM_IRQ1, | ||
17 | KM_SOFTIRQ0, | ||
18 | KM_SOFTIRQ1, | ||
19 | KM_PPC_SYNC_PAGE, | ||
20 | KM_PPC_SYNC_ICACHE, | ||
21 | KM_TYPE_NR | ||
22 | }; | ||
23 | |||
24 | #endif | ||
25 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index 1d4ab70a56f3..f01255bd1dc3 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h | |||
@@ -98,7 +98,7 @@ struct machdep_calls { | |||
98 | 98 | ||
99 | /* Get access protection for /dev/mem */ | 99 | /* Get access protection for /dev/mem */ |
100 | pgprot_t (*phys_mem_access_prot)(struct file *file, | 100 | pgprot_t (*phys_mem_access_prot)(struct file *file, |
101 | unsigned long offset, | 101 | unsigned long pfn, |
102 | unsigned long size, | 102 | unsigned long size, |
103 | pgprot_t vma_prot); | 103 | pgprot_t vma_prot); |
104 | 104 | ||
@@ -167,7 +167,7 @@ extern sys_ctrler_t sys_ctrler; | |||
167 | 167 | ||
168 | #ifdef CONFIG_SMP | 168 | #ifdef CONFIG_SMP |
169 | struct smp_ops_t { | 169 | struct smp_ops_t { |
170 | void (*message_pass)(int target, int msg, unsigned long data, int wait); | 170 | void (*message_pass)(int target, int msg); |
171 | int (*probe)(void); | 171 | int (*probe)(void); |
172 | void (*kick_cpu)(int nr); | 172 | void (*kick_cpu)(int nr); |
173 | void (*setup_cpu)(int nr); | 173 | void (*setup_cpu)(int nr); |
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h index afe26ffc2e2d..4f152cca13c1 100644 --- a/include/asm-ppc/mmu_context.h +++ b/include/asm-ppc/mmu_context.h | |||
@@ -164,13 +164,11 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
164 | struct task_struct *tsk) | 164 | struct task_struct *tsk) |
165 | { | 165 | { |
166 | #ifdef CONFIG_ALTIVEC | 166 | #ifdef CONFIG_ALTIVEC |
167 | asm volatile ( | 167 | if (cpu_has_feature(CPU_FTR_ALTIVEC)) |
168 | BEGIN_FTR_SECTION | 168 | asm volatile ("dssall;\n" |
169 | "dssall;\n" | ||
170 | #ifndef CONFIG_POWER4 | 169 | #ifndef CONFIG_POWER4 |
171 | "sync;\n" /* G4 needs a sync here, G5 apparently not */ | 170 | "sync;\n" /* G4 needs a sync here, G5 apparently not */ |
172 | #endif | 171 | #endif |
173 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | ||
174 | : : ); | 172 | : : ); |
175 | #endif /* CONFIG_ALTIVEC */ | 173 | #endif /* CONFIG_ALTIVEC */ |
176 | 174 | ||
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h index 9694eca16e92..321452695039 100644 --- a/include/asm-ppc/mpc8260.h +++ b/include/asm-ppc/mpc8260.h | |||
@@ -92,6 +92,10 @@ enum ppc_sys_devices { | |||
92 | extern unsigned char __res[]; | 92 | extern unsigned char __res[]; |
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | #ifndef BOARD_CHIP_NAME | ||
96 | #define BOARD_CHIP_NAME "" | ||
97 | #endif | ||
98 | |||
95 | #endif /* CONFIG_8260 */ | 99 | #endif /* CONFIG_8260 */ |
96 | #endif /* !__ASM_PPC_MPC8260_H__ */ | 100 | #endif /* !__ASM_PPC_MPC8260_H__ */ |
97 | #endif /* __KERNEL__ */ | 101 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h index 516984ee14b5..d98db980cd49 100644 --- a/include/asm-ppc/mpc85xx.h +++ b/include/asm-ppc/mpc85xx.h | |||
@@ -67,6 +67,8 @@ extern unsigned char __res[]; | |||
67 | #define MPC85xx_DMA3_SIZE (0x00080) | 67 | #define MPC85xx_DMA3_SIZE (0x00080) |
68 | #define MPC85xx_ENET1_OFFSET (0x24000) | 68 | #define MPC85xx_ENET1_OFFSET (0x24000) |
69 | #define MPC85xx_ENET1_SIZE (0x01000) | 69 | #define MPC85xx_ENET1_SIZE (0x01000) |
70 | #define MPC85xx_MIIM_OFFSET (0x24520) | ||
71 | #define MPC85xx_MIIM_SIZE (0x00018) | ||
70 | #define MPC85xx_ENET2_OFFSET (0x25000) | 72 | #define MPC85xx_ENET2_OFFSET (0x25000) |
71 | #define MPC85xx_ENET2_SIZE (0x01000) | 73 | #define MPC85xx_ENET2_SIZE (0x01000) |
72 | #define MPC85xx_ENET3_OFFSET (0x26000) | 74 | #define MPC85xx_ENET3_OFFSET (0x26000) |
@@ -132,6 +134,7 @@ enum ppc_sys_devices { | |||
132 | MPC85xx_eTSEC3, | 134 | MPC85xx_eTSEC3, |
133 | MPC85xx_eTSEC4, | 135 | MPC85xx_eTSEC4, |
134 | MPC85xx_IIC2, | 136 | MPC85xx_IIC2, |
137 | MPC85xx_MDIO, | ||
135 | }; | 138 | }; |
136 | 139 | ||
137 | /* Internal interrupts are all Level Sensitive, and Positive Polarity */ | 140 | /* Internal interrupts are all Level Sensitive, and Positive Polarity */ |
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h index 208a2e11daee..46f159cf589e 100644 --- a/include/asm-ppc/mpc8xx.h +++ b/include/asm-ppc/mpc8xx.h | |||
@@ -113,6 +113,10 @@ enum ppc_sys_devices { | |||
113 | MPC8xx_CPM_USB, | 113 | MPC8xx_CPM_USB, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | #ifndef BOARD_CHIP_NAME | ||
117 | #define BOARD_CHIP_NAME "" | ||
118 | #endif | ||
119 | |||
116 | #endif /* !__ASSEMBLY__ */ | 120 | #endif /* !__ASSEMBLY__ */ |
117 | #endif /* CONFIG_8xx */ | 121 | #endif /* CONFIG_8xx */ |
118 | #endif /* __CONFIG_8xx_DEFS */ | 122 | #endif /* __CONFIG_8xx_DEFS */ |
diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h index 7848aa610c05..ec2f46629ca2 100644 --- a/include/asm-ppc/open_pic.h +++ b/include/asm-ppc/open_pic.h | |||
@@ -58,8 +58,7 @@ extern int openpic_get_irq(struct pt_regs *regs); | |||
58 | extern void openpic_reset_processor_phys(u_int cpumask); | 58 | extern void openpic_reset_processor_phys(u_int cpumask); |
59 | extern void openpic_setup_ISU(int isu_num, unsigned long addr); | 59 | extern void openpic_setup_ISU(int isu_num, unsigned long addr); |
60 | extern void openpic_cause_IPI(u_int ipi, cpumask_t cpumask); | 60 | extern void openpic_cause_IPI(u_int ipi, cpumask_t cpumask); |
61 | extern void smp_openpic_message_pass(int target, int msg, unsigned long data, | 61 | extern void smp_openpic_message_pass(int target, int msg); |
62 | int wait); | ||
63 | extern void openpic_set_k2_cascade(int irq); | 62 | extern void openpic_set_k2_cascade(int irq); |
64 | extern void openpic_set_priority(u_int pri); | 63 | extern void openpic_set_priority(u_int pri); |
65 | extern u_int openpic_get_priority(void); | 64 | extern u_int openpic_get_priority(void); |
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index 4789dc024240..fc44f7ca62d7 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h | |||
@@ -34,6 +34,17 @@ typedef unsigned long pte_basic_t; | |||
34 | #define PTE_FMT "%.8lx" | 34 | #define PTE_FMT "%.8lx" |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | /* align addr on a size boundary - adjust address up/down if needed */ | ||
38 | #define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) | ||
39 | #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) | ||
40 | |||
41 | /* align addr on a size boundary - adjust address up if needed */ | ||
42 | #define _ALIGN(addr,size) _ALIGN_UP(addr,size) | ||
43 | |||
44 | /* to align the pointer to the (next) page boundary */ | ||
45 | #define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE) | ||
46 | |||
47 | |||
37 | #undef STRICT_MM_TYPECHECKS | 48 | #undef STRICT_MM_TYPECHECKS |
38 | 49 | ||
39 | #ifdef STRICT_MM_TYPECHECKS | 50 | #ifdef STRICT_MM_TYPECHECKS |
@@ -76,13 +87,6 @@ typedef unsigned long pgprot_t; | |||
76 | 87 | ||
77 | #endif | 88 | #endif |
78 | 89 | ||
79 | |||
80 | /* align addr on a size boundary - adjust address up if needed -- Cort */ | ||
81 | #define _ALIGN(addr,size) (((addr)+(size)-1)&(~((size)-1))) | ||
82 | |||
83 | /* to align the pointer to the (next) page boundary */ | ||
84 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | ||
85 | |||
86 | struct page; | 90 | struct page; |
87 | extern void clear_pages(void *page, int order); | 91 | extern void clear_pages(void *page, int order); |
88 | static inline void clear_page(void *page) { clear_pages(page, 0); } | 92 | static inline void clear_page(void *page) { clear_pages(page, 0); } |
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h index ffa423456c2b..e58c78f90a5a 100644 --- a/include/asm-ppc/pci-bridge.h +++ b/include/asm-ppc/pci-bridge.h | |||
@@ -79,6 +79,11 @@ struct pci_controller { | |||
79 | struct resource mem_space; | 79 | struct resource mem_space; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) | ||
83 | { | ||
84 | return bus->sysdata; | ||
85 | } | ||
86 | |||
82 | /* These are used for config access before all the PCI probing | 87 | /* These are used for config access before all the PCI probing |
83 | has been done. */ | 88 | has been done. */ |
84 | int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, | 89 | int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn, |
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 9dd06cd40096..61434edbad7b 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h | |||
@@ -24,9 +24,9 @@ struct pci_dev; | |||
24 | * Set this to 1 if you want the kernel to re-assign all PCI | 24 | * Set this to 1 if you want the kernel to re-assign all PCI |
25 | * bus numbers | 25 | * bus numbers |
26 | */ | 26 | */ |
27 | extern int pci_assign_all_busses; | 27 | extern int pci_assign_all_buses; |
28 | 28 | ||
29 | #define pcibios_assign_all_busses() (pci_assign_all_busses) | 29 | #define pcibios_assign_all_busses() (pci_assign_all_buses) |
30 | #define pcibios_scan_all_fns(a, b) 0 | 30 | #define pcibios_scan_all_fns(a, b) 0 |
31 | 31 | ||
32 | #define PCIBIOS_MIN_IO 0x1000 | 32 | #define PCIBIOS_MIN_IO 0x1000 |
@@ -126,7 +126,7 @@ extern void pcibios_add_platform_entries(struct pci_dev *dev); | |||
126 | 126 | ||
127 | struct file; | 127 | struct file; |
128 | extern pgprot_t pci_phys_mem_access_prot(struct file *file, | 128 | extern pgprot_t pci_phys_mem_access_prot(struct file *file, |
129 | unsigned long offset, | 129 | unsigned long pfn, |
130 | unsigned long size, | 130 | unsigned long size, |
131 | pgprot_t prot); | 131 | pgprot_t prot); |
132 | 132 | ||
diff --git a/include/asm-ppc/perfmon.h b/include/asm-ppc/perfmon.h deleted file mode 100644 index 5e7a89c47b5b..000000000000 --- a/include/asm-ppc/perfmon.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #ifndef __PERFMON_H | ||
2 | #define __PERFMON_H | ||
3 | |||
4 | extern void (*perf_irq)(struct pt_regs *); | ||
5 | |||
6 | int request_perfmon_irq(void (*handler)(struct pt_regs *)); | ||
7 | void free_perfmon_irq(void); | ||
8 | |||
9 | #ifdef CONFIG_FSL_BOOKE | ||
10 | void init_pmc_stop(int ctr); | ||
11 | void set_pmc_event(int ctr, int event); | ||
12 | void set_pmc_user_kernel(int ctr, int user, int kernel); | ||
13 | void set_pmc_marked(int ctr, int mark0, int mark1); | ||
14 | void pmc_start_ctr(int ctr, int enable); | ||
15 | void pmc_start_ctrs(int enable); | ||
16 | void pmc_stop_ctrs(void); | ||
17 | void dump_pmcs(void); | ||
18 | |||
19 | extern struct op_ppc32_model op_model_fsl_booke; | ||
20 | #endif | ||
21 | |||
22 | #endif /* __PERFMON_H */ | ||
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index eee601bb9ada..b28a713ba862 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -705,7 +705,7 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) | |||
705 | #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED)) | 705 | #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED)) |
706 | 706 | ||
707 | struct file; | 707 | struct file; |
708 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr, | 708 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
709 | unsigned long size, pgprot_t vma_prot); | 709 | unsigned long size, pgprot_t vma_prot); |
710 | #define __HAVE_PHYS_MEM_ACCESS_PROT | 710 | #define __HAVE_PHYS_MEM_ACCESS_PROT |
711 | 711 | ||
diff --git a/include/asm-ppc/posix_types.h b/include/asm-ppc/posix_types.h deleted file mode 100644 index a14a82abe8d2..000000000000 --- a/include/asm-ppc/posix_types.h +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | #ifndef _PPC_POSIX_TYPES_H | ||
2 | #define _PPC_POSIX_TYPES_H | ||
3 | |||
4 | /* | ||
5 | * This file is generally used by user-level software, so you need to | ||
6 | * be a little careful about namespace pollution etc. Also, we cannot | ||
7 | * assume GCC is being used. | ||
8 | */ | ||
9 | |||
10 | typedef unsigned long __kernel_ino_t; | ||
11 | typedef unsigned int __kernel_mode_t; | ||
12 | typedef unsigned short __kernel_nlink_t; | ||
13 | typedef long __kernel_off_t; | ||
14 | typedef int __kernel_pid_t; | ||
15 | typedef unsigned int __kernel_uid_t; | ||
16 | typedef unsigned int __kernel_gid_t; | ||
17 | typedef unsigned int __kernel_size_t; | ||
18 | typedef int __kernel_ssize_t; | ||
19 | typedef long __kernel_ptrdiff_t; | ||
20 | typedef long __kernel_time_t; | ||
21 | typedef long __kernel_suseconds_t; | ||
22 | typedef long __kernel_clock_t; | ||
23 | typedef int __kernel_timer_t; | ||
24 | typedef int __kernel_clockid_t; | ||
25 | typedef int __kernel_daddr_t; | ||
26 | typedef char * __kernel_caddr_t; | ||
27 | typedef short __kernel_ipc_pid_t; | ||
28 | typedef unsigned short __kernel_uid16_t; | ||
29 | typedef unsigned short __kernel_gid16_t; | ||
30 | typedef unsigned int __kernel_uid32_t; | ||
31 | typedef unsigned int __kernel_gid32_t; | ||
32 | |||
33 | typedef unsigned int __kernel_old_uid_t; | ||
34 | typedef unsigned int __kernel_old_gid_t; | ||
35 | typedef unsigned int __kernel_old_dev_t; | ||
36 | |||
37 | #ifdef __GNUC__ | ||
38 | typedef long long __kernel_loff_t; | ||
39 | #endif | ||
40 | |||
41 | typedef struct { | ||
42 | int val[2]; | ||
43 | } __kernel_fsid_t; | ||
44 | |||
45 | #ifndef __GNUC__ | ||
46 | |||
47 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | ||
48 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | ||
49 | #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) | ||
50 | #define __FD_ZERO(set) \ | ||
51 | ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set))) | ||
52 | |||
53 | #else /* __GNUC__ */ | ||
54 | |||
55 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \ | ||
56 | || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0) | ||
57 | /* With GNU C, use inline functions instead so args are evaluated only once: */ | ||
58 | |||
59 | #undef __FD_SET | ||
60 | static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) | ||
61 | { | ||
62 | unsigned long _tmp = fd / __NFDBITS; | ||
63 | unsigned long _rem = fd % __NFDBITS; | ||
64 | fdsetp->fds_bits[_tmp] |= (1UL<<_rem); | ||
65 | } | ||
66 | |||
67 | #undef __FD_CLR | ||
68 | static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) | ||
69 | { | ||
70 | unsigned long _tmp = fd / __NFDBITS; | ||
71 | unsigned long _rem = fd % __NFDBITS; | ||
72 | fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); | ||
73 | } | ||
74 | |||
75 | #undef __FD_ISSET | ||
76 | static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p) | ||
77 | { | ||
78 | unsigned long _tmp = fd / __NFDBITS; | ||
79 | unsigned long _rem = fd % __NFDBITS; | ||
80 | return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | * This will unroll the loop for the normal constant case (8 ints, | ||
85 | * for a 256-bit fd_set) | ||
86 | */ | ||
87 | #undef __FD_ZERO | ||
88 | static __inline__ void __FD_ZERO(__kernel_fd_set *p) | ||
89 | { | ||
90 | unsigned int *tmp = (unsigned int *)p->fds_bits; | ||
91 | int i; | ||
92 | |||
93 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
94 | switch (__FDSET_LONGS) { | ||
95 | case 8: | ||
96 | tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0; | ||
97 | tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0; | ||
98 | return; | ||
99 | } | ||
100 | } | ||
101 | i = __FDSET_LONGS; | ||
102 | while (i) { | ||
103 | i--; | ||
104 | *tmp = 0; | ||
105 | tmp++; | ||
106 | } | ||
107 | } | ||
108 | |||
109 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | ||
110 | #endif /* __GNUC__ */ | ||
111 | #endif /* _PPC_POSIX_TYPES_H */ | ||
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h index 549f44843c5e..bba5305c29ed 100644 --- a/include/asm-ppc/ppc_sys.h +++ b/include/asm-ppc/ppc_sys.h | |||
@@ -18,7 +18,7 @@ | |||
18 | #define __ASM_PPC_SYS_H | 18 | #define __ASM_PPC_SYS_H |
19 | 19 | ||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | 23 | ||
24 | #if defined(CONFIG_8260) | 24 | #if defined(CONFIG_8260) |
diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h index 7043c164b537..c34fb4e37a97 100644 --- a/include/asm-ppc/ptrace.h +++ b/include/asm-ppc/ptrace.h | |||
@@ -57,7 +57,7 @@ extern unsigned long profile_pc(struct pt_regs *regs); | |||
57 | 57 | ||
58 | #define force_successful_syscall_return() \ | 58 | #define force_successful_syscall_return() \ |
59 | do { \ | 59 | do { \ |
60 | current_thread_info()->local_flags |= _TIFL_FORCE_NOERROR; \ | 60 | current_thread_info()->syscall_noerror = 1; \ |
61 | } while(0) | 61 | } while(0) |
62 | 62 | ||
63 | /* | 63 | /* |
diff --git a/include/asm-ppc/rwsem.h b/include/asm-ppc/rwsem.h deleted file mode 100644 index 3e738f483c11..000000000000 --- a/include/asm-ppc/rwsem.h +++ /dev/null | |||
@@ -1,172 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-ppc/rwsem.h: R/W semaphores for PPC using the stuff | ||
3 | * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h | ||
4 | * by Paul Mackerras <paulus@samba.org>. | ||
5 | */ | ||
6 | |||
7 | #ifndef _PPC_RWSEM_H | ||
8 | #define _PPC_RWSEM_H | ||
9 | |||
10 | #ifdef __KERNEL__ | ||
11 | #include <linux/list.h> | ||
12 | #include <linux/spinlock.h> | ||
13 | #include <asm/atomic.h> | ||
14 | #include <asm/system.h> | ||
15 | |||
16 | /* | ||
17 | * the semaphore definition | ||
18 | */ | ||
19 | struct rw_semaphore { | ||
20 | /* XXX this should be able to be an atomic_t -- paulus */ | ||
21 | signed long count; | ||
22 | #define RWSEM_UNLOCKED_VALUE 0x00000000 | ||
23 | #define RWSEM_ACTIVE_BIAS 0x00000001 | ||
24 | #define RWSEM_ACTIVE_MASK 0x0000ffff | ||
25 | #define RWSEM_WAITING_BIAS (-0x00010000) | ||
26 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS | ||
27 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | ||
28 | spinlock_t wait_lock; | ||
29 | struct list_head wait_list; | ||
30 | #if RWSEM_DEBUG | ||
31 | int debug; | ||
32 | #endif | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * initialisation | ||
37 | */ | ||
38 | #if RWSEM_DEBUG | ||
39 | #define __RWSEM_DEBUG_INIT , 0 | ||
40 | #else | ||
41 | #define __RWSEM_DEBUG_INIT /* */ | ||
42 | #endif | ||
43 | |||
44 | #define __RWSEM_INITIALIZER(name) \ | ||
45 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | ||
46 | LIST_HEAD_INIT((name).wait_list) \ | ||
47 | __RWSEM_DEBUG_INIT } | ||
48 | |||
49 | #define DECLARE_RWSEM(name) \ | ||
50 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | ||
51 | |||
52 | extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); | ||
53 | extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); | ||
54 | extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem); | ||
55 | extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); | ||
56 | |||
57 | static inline void init_rwsem(struct rw_semaphore *sem) | ||
58 | { | ||
59 | sem->count = RWSEM_UNLOCKED_VALUE; | ||
60 | spin_lock_init(&sem->wait_lock); | ||
61 | INIT_LIST_HEAD(&sem->wait_list); | ||
62 | #if RWSEM_DEBUG | ||
63 | sem->debug = 0; | ||
64 | #endif | ||
65 | } | ||
66 | |||
67 | /* | ||
68 | * lock for reading | ||
69 | */ | ||
70 | static inline void __down_read(struct rw_semaphore *sem) | ||
71 | { | ||
72 | if (atomic_inc_return((atomic_t *)(&sem->count)) > 0) | ||
73 | smp_wmb(); | ||
74 | else | ||
75 | rwsem_down_read_failed(sem); | ||
76 | } | ||
77 | |||
78 | static inline int __down_read_trylock(struct rw_semaphore *sem) | ||
79 | { | ||
80 | int tmp; | ||
81 | |||
82 | while ((tmp = sem->count) >= 0) { | ||
83 | if (tmp == cmpxchg(&sem->count, tmp, | ||
84 | tmp + RWSEM_ACTIVE_READ_BIAS)) { | ||
85 | smp_wmb(); | ||
86 | return 1; | ||
87 | } | ||
88 | } | ||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * lock for writing | ||
94 | */ | ||
95 | static inline void __down_write(struct rw_semaphore *sem) | ||
96 | { | ||
97 | int tmp; | ||
98 | |||
99 | tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS, | ||
100 | (atomic_t *)(&sem->count)); | ||
101 | if (tmp == RWSEM_ACTIVE_WRITE_BIAS) | ||
102 | smp_wmb(); | ||
103 | else | ||
104 | rwsem_down_write_failed(sem); | ||
105 | } | ||
106 | |||
107 | static inline int __down_write_trylock(struct rw_semaphore *sem) | ||
108 | { | ||
109 | int tmp; | ||
110 | |||
111 | tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE, | ||
112 | RWSEM_ACTIVE_WRITE_BIAS); | ||
113 | smp_wmb(); | ||
114 | return tmp == RWSEM_UNLOCKED_VALUE; | ||
115 | } | ||
116 | |||
117 | /* | ||
118 | * unlock after reading | ||
119 | */ | ||
120 | static inline void __up_read(struct rw_semaphore *sem) | ||
121 | { | ||
122 | int tmp; | ||
123 | |||
124 | smp_wmb(); | ||
125 | tmp = atomic_dec_return((atomic_t *)(&sem->count)); | ||
126 | if (tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0) | ||
127 | rwsem_wake(sem); | ||
128 | } | ||
129 | |||
130 | /* | ||
131 | * unlock after writing | ||
132 | */ | ||
133 | static inline void __up_write(struct rw_semaphore *sem) | ||
134 | { | ||
135 | smp_wmb(); | ||
136 | if (atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS, | ||
137 | (atomic_t *)(&sem->count)) < 0) | ||
138 | rwsem_wake(sem); | ||
139 | } | ||
140 | |||
141 | /* | ||
142 | * implement atomic add functionality | ||
143 | */ | ||
144 | static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) | ||
145 | { | ||
146 | atomic_add(delta, (atomic_t *)(&sem->count)); | ||
147 | } | ||
148 | |||
149 | /* | ||
150 | * downgrade write lock to read lock | ||
151 | */ | ||
152 | static inline void __downgrade_write(struct rw_semaphore *sem) | ||
153 | { | ||
154 | int tmp; | ||
155 | |||
156 | smp_wmb(); | ||
157 | tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count)); | ||
158 | if (tmp < 0) | ||
159 | rwsem_downgrade_wake(sem); | ||
160 | } | ||
161 | |||
162 | /* | ||
163 | * implement exchange and add functionality | ||
164 | */ | ||
165 | static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | ||
166 | { | ||
167 | smp_mb(); | ||
168 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | ||
169 | } | ||
170 | |||
171 | #endif /* __KERNEL__ */ | ||
172 | #endif /* _PPC_RWSEM_XADD_H */ | ||
diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h deleted file mode 100644 index f21f18f56548..000000000000 --- a/include/asm-ppc/scatterlist.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _PPC_SCATTERLIST_H | ||
3 | #define _PPC_SCATTERLIST_H | ||
4 | |||
5 | #include <asm/dma.h> | ||
6 | |||
7 | struct scatterlist { | ||
8 | struct page *page; | ||
9 | unsigned int offset; | ||
10 | dma_addr_t dma_address; | ||
11 | unsigned int length; | ||
12 | }; | ||
13 | |||
14 | /* | ||
15 | * These macros should be used after a pci_map_sg call has been done | ||
16 | * to get bus addresses of each of the SG entries and their lengths. | ||
17 | * You should only work with the number of sg entries pci_map_sg | ||
18 | * returns, or alternatively stop on the first sg_dma_len(sg) which | ||
19 | * is 0. | ||
20 | */ | ||
21 | #define sg_dma_address(sg) ((sg)->dma_address) | ||
22 | #define sg_dma_len(sg) ((sg)->length) | ||
23 | |||
24 | #endif /* !(_PPC_SCATTERLIST_H) */ | ||
25 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/seccomp.h b/include/asm-ppc/seccomp.h deleted file mode 100644 index 666c4da96d87..000000000000 --- a/include/asm-ppc/seccomp.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | ||
2 | |||
3 | #include <linux/unistd.h> | ||
4 | |||
5 | #define __NR_seccomp_read __NR_read | ||
6 | #define __NR_seccomp_write __NR_write | ||
7 | #define __NR_seccomp_exit __NR_exit | ||
8 | #define __NR_seccomp_sigreturn __NR_rt_sigreturn | ||
9 | |||
10 | #endif /* _ASM_SECCOMP_H */ | ||
diff --git a/include/asm-ppc/sections.h b/include/asm-ppc/sections.h deleted file mode 100644 index ba8f43ac9bf3..000000000000 --- a/include/asm-ppc/sections.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _PPC_SECTIONS_H | ||
3 | #define _PPC_SECTIONS_H | ||
4 | |||
5 | #include <asm-generic/sections.h> | ||
6 | |||
7 | #define __pmac __attribute__ ((__section__ (".pmac.text"))) | ||
8 | #define __pmacdata __attribute__ ((__section__ (".pmac.data"))) | ||
9 | #define __pmacfunc(__argpmac) \ | ||
10 | __argpmac __pmac; \ | ||
11 | __argpmac | ||
12 | |||
13 | #define __prep __attribute__ ((__section__ (".prep.text"))) | ||
14 | #define __prepdata __attribute__ ((__section__ (".prep.data"))) | ||
15 | #define __prepfunc(__argprep) \ | ||
16 | __argprep __prep; \ | ||
17 | __argprep | ||
18 | |||
19 | #define __chrp __attribute__ ((__section__ (".chrp.text"))) | ||
20 | #define __chrpdata __attribute__ ((__section__ (".chrp.data"))) | ||
21 | #define __chrpfunc(__argchrp) \ | ||
22 | __argchrp __chrp; \ | ||
23 | __argchrp | ||
24 | |||
25 | /* this is actually just common chrp/pmac code, not OF code -- Cort */ | ||
26 | #define __openfirmware __attribute__ ((__section__ (".openfirmware.text"))) | ||
27 | #define __openfirmwaredata __attribute__ ((__section__ (".openfirmware.data"))) | ||
28 | #define __openfirmwarefunc(__argopenfirmware) \ | ||
29 | __argopenfirmware __openfirmware; \ | ||
30 | __argopenfirmware | ||
31 | |||
32 | #endif /* _PPC_SECTIONS_H */ | ||
33 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/semaphore.h b/include/asm-ppc/semaphore.h deleted file mode 100644 index 89e6e73be08c..000000000000 --- a/include/asm-ppc/semaphore.h +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | #ifndef _PPC_SEMAPHORE_H | ||
2 | #define _PPC_SEMAPHORE_H | ||
3 | |||
4 | /* | ||
5 | * Swiped from asm-sparc/semaphore.h and modified | ||
6 | * -- Cort (cort@cs.nmt.edu) | ||
7 | * | ||
8 | * Stole some rw spinlock-based semaphore stuff from asm-alpha/semaphore.h | ||
9 | * -- Ani Joshi (ajoshi@unixbox.com) | ||
10 | * | ||
11 | * Remove spinlock-based RW semaphores; RW semaphore definitions are | ||
12 | * now in rwsem.h and we use the generic lib/rwsem.c implementation. | ||
13 | * Rework semaphores to use atomic_dec_if_positive. | ||
14 | * -- Paul Mackerras (paulus@samba.org) | ||
15 | */ | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <asm/atomic.h> | ||
20 | #include <asm/system.h> | ||
21 | #include <linux/wait.h> | ||
22 | #include <linux/rwsem.h> | ||
23 | |||
24 | struct semaphore { | ||
25 | /* | ||
26 | * Note that any negative value of count is equivalent to 0, | ||
27 | * but additionally indicates that some process(es) might be | ||
28 | * sleeping on `wait'. | ||
29 | */ | ||
30 | atomic_t count; | ||
31 | wait_queue_head_t wait; | ||
32 | }; | ||
33 | |||
34 | #define __SEMAPHORE_INITIALIZER(name, n) \ | ||
35 | { \ | ||
36 | .count = ATOMIC_INIT(n), \ | ||
37 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | ||
38 | } | ||
39 | |||
40 | #define __MUTEX_INITIALIZER(name) \ | ||
41 | __SEMAPHORE_INITIALIZER(name, 1) | ||
42 | |||
43 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ | ||
44 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | ||
45 | |||
46 | #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1) | ||
47 | #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0) | ||
48 | |||
49 | static inline void sema_init (struct semaphore *sem, int val) | ||
50 | { | ||
51 | atomic_set(&sem->count, val); | ||
52 | init_waitqueue_head(&sem->wait); | ||
53 | } | ||
54 | |||
55 | static inline void init_MUTEX (struct semaphore *sem) | ||
56 | { | ||
57 | sema_init(sem, 1); | ||
58 | } | ||
59 | |||
60 | static inline void init_MUTEX_LOCKED (struct semaphore *sem) | ||
61 | { | ||
62 | sema_init(sem, 0); | ||
63 | } | ||
64 | |||
65 | extern void __down(struct semaphore * sem); | ||
66 | extern int __down_interruptible(struct semaphore * sem); | ||
67 | extern void __up(struct semaphore * sem); | ||
68 | |||
69 | extern inline void down(struct semaphore * sem) | ||
70 | { | ||
71 | might_sleep(); | ||
72 | |||
73 | /* | ||
74 | * Try to get the semaphore, take the slow path if we fail. | ||
75 | */ | ||
76 | if (atomic_dec_return(&sem->count) < 0) | ||
77 | __down(sem); | ||
78 | smp_wmb(); | ||
79 | } | ||
80 | |||
81 | extern inline int down_interruptible(struct semaphore * sem) | ||
82 | { | ||
83 | int ret = 0; | ||
84 | |||
85 | might_sleep(); | ||
86 | |||
87 | if (atomic_dec_return(&sem->count) < 0) | ||
88 | ret = __down_interruptible(sem); | ||
89 | smp_wmb(); | ||
90 | return ret; | ||
91 | } | ||
92 | |||
93 | extern inline int down_trylock(struct semaphore * sem) | ||
94 | { | ||
95 | int ret; | ||
96 | |||
97 | ret = atomic_dec_if_positive(&sem->count) < 0; | ||
98 | smp_wmb(); | ||
99 | return ret; | ||
100 | } | ||
101 | |||
102 | extern inline void up(struct semaphore * sem) | ||
103 | { | ||
104 | smp_wmb(); | ||
105 | if (atomic_inc_return(&sem->count) <= 0) | ||
106 | __up(sem); | ||
107 | } | ||
108 | |||
109 | #endif /* __KERNEL__ */ | ||
110 | |||
111 | #endif /* !(_PPC_SEMAPHORE_H) */ | ||
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index 829481c0a9dc..30e9268a888c 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h | |||
@@ -35,6 +35,7 @@ extern cpumask_t cpu_possible_map; | |||
35 | extern unsigned long smp_proc_in_lock[]; | 35 | extern unsigned long smp_proc_in_lock[]; |
36 | extern volatile unsigned long cpu_callin_map[]; | 36 | extern volatile unsigned long cpu_callin_map[]; |
37 | extern int smp_tb_synchronized; | 37 | extern int smp_tb_synchronized; |
38 | extern struct smp_ops_t *smp_ops; | ||
38 | 39 | ||
39 | extern void smp_send_tlb_invalidate(int); | 40 | extern void smp_send_tlb_invalidate(int); |
40 | extern void smp_send_xmon_break(int cpu); | 41 | extern void smp_send_xmon_break(int cpu); |
@@ -45,32 +46,31 @@ extern int __cpu_disable(void); | |||
45 | extern void __cpu_die(unsigned int cpu); | 46 | extern void __cpu_die(unsigned int cpu); |
46 | extern void cpu_die(void) __attribute__((noreturn)); | 47 | extern void cpu_die(void) __attribute__((noreturn)); |
47 | 48 | ||
48 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | ||
49 | #define PROC_CHANGE_PENALTY 20 | ||
50 | |||
51 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 49 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
52 | 50 | ||
53 | extern int __cpu_up(unsigned int cpu); | 51 | extern int __cpu_up(unsigned int cpu); |
54 | 52 | ||
55 | extern int smp_hw_index[]; | 53 | extern int smp_hw_index[]; |
56 | #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) | 54 | #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) |
57 | 55 | #define get_hard_smp_processor_id(cpu) (smp_hw_index[(cpu)]) | |
58 | struct klock_info_struct { | 56 | #define set_hard_smp_processor_id(cpu, phys)\ |
59 | unsigned long kernel_flag; | 57 | (smp_hw_index[(cpu)] = (phys)) |
60 | unsigned char akp; | 58 | |
61 | }; | ||
62 | |||
63 | extern struct klock_info_struct klock_info; | ||
64 | #define KLOCK_HELD 0xffffffff | ||
65 | #define KLOCK_CLEAR 0x0 | ||
66 | |||
67 | #endif /* __ASSEMBLY__ */ | 59 | #endif /* __ASSEMBLY__ */ |
68 | 60 | ||
69 | #else /* !(CONFIG_SMP) */ | 61 | #else /* !(CONFIG_SMP) */ |
70 | 62 | ||
71 | static inline void cpu_die(void) { } | 63 | static inline void cpu_die(void) { } |
64 | #define get_hard_smp_processor_id(cpu) 0 | ||
65 | #define set_hard_smp_processor_id(cpu, phys) | ||
66 | #define hard_smp_processor_id() 0 | ||
72 | 67 | ||
73 | #endif /* !(CONFIG_SMP) */ | 68 | #endif /* !(CONFIG_SMP) */ |
74 | 69 | ||
70 | #ifndef __ASSEMBLY__ | ||
71 | extern int boot_cpuid; | ||
72 | extern int boot_cpuid_phys; | ||
73 | #endif | ||
74 | |||
75 | #endif /* !(_PPC_SMP_H) */ | 75 | #endif /* !(_PPC_SMP_H) */ |
76 | #endif /* __KERNEL__ */ | 76 | #endif /* __KERNEL__ */ |
diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index 20edcf2a6e0c..5c64b75f0295 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * (the type definitions are in asm/raw_spinlock_types.h) | 9 | * (the type definitions are in asm/raw_spinlock_types.h) |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define __raw_spin_is_locked(x) ((x)->lock != 0) | 12 | #define __raw_spin_is_locked(x) ((x)->slock != 0) |
13 | #define __raw_spin_unlock_wait(lock) \ | 13 | #define __raw_spin_unlock_wait(lock) \ |
14 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) | 14 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) |
15 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 15 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) |
@@ -31,17 +31,17 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) | |||
31 | bne- 2b\n\ | 31 | bne- 2b\n\ |
32 | isync" | 32 | isync" |
33 | : "=&r"(tmp) | 33 | : "=&r"(tmp) |
34 | : "r"(&lock->lock), "r"(1) | 34 | : "r"(&lock->slock), "r"(1) |
35 | : "cr0", "memory"); | 35 | : "cr0", "memory"); |
36 | } | 36 | } |
37 | 37 | ||
38 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | 38 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) |
39 | { | 39 | { |
40 | __asm__ __volatile__("eieio # __raw_spin_unlock": : :"memory"); | 40 | __asm__ __volatile__("eieio # __raw_spin_unlock": : :"memory"); |
41 | lock->lock = 0; | 41 | lock->slock = 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | #define __raw_spin_trylock(l) (!test_and_set_bit(0,&(l)->lock)) | 44 | #define __raw_spin_trylock(l) (!test_and_set_bit(0,(volatile unsigned long *)(&(l)->slock))) |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * Read-write spinlocks, allowing multiple readers | 47 | * Read-write spinlocks, allowing multiple readers |
diff --git a/include/asm-ppc/spinlock_types.h b/include/asm-ppc/spinlock_types.h deleted file mode 100644 index 7919ccc75b8a..000000000000 --- a/include/asm-ppc/spinlock_types.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef __ASM_SPINLOCK_TYPES_H | ||
2 | #define __ASM_SPINLOCK_TYPES_H | ||
3 | |||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | ||
5 | # error "please don't include this file directly" | ||
6 | #endif | ||
7 | |||
8 | typedef struct { | ||
9 | volatile unsigned long lock; | ||
10 | } raw_spinlock_t; | ||
11 | |||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | ||
13 | |||
14 | typedef struct { | ||
15 | volatile signed int lock; | ||
16 | } raw_rwlock_t; | ||
17 | |||
18 | #define __RAW_RW_LOCK_UNLOCKED { 0 } | ||
19 | |||
20 | #endif | ||
diff --git a/include/asm-ppc/statfs.h b/include/asm-ppc/statfs.h deleted file mode 100644 index 807c69954a1b..000000000000 --- a/include/asm-ppc/statfs.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef _PPC_STATFS_H | ||
2 | #define _PPC_STATFS_H | ||
3 | |||
4 | #include <asm-generic/statfs.h> | ||
5 | #endif | ||
6 | |||
7 | |||
8 | |||
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index d754ab570fe0..bd99cb53a19f 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h | |||
@@ -70,25 +70,47 @@ extern void _set_L3CR(unsigned long); | |||
70 | #endif | 70 | #endif |
71 | extern void via_cuda_init(void); | 71 | extern void via_cuda_init(void); |
72 | extern void pmac_nvram_init(void); | 72 | extern void pmac_nvram_init(void); |
73 | extern void chrp_nvram_init(void); | ||
73 | extern void read_rtc_time(void); | 74 | extern void read_rtc_time(void); |
74 | extern void pmac_find_display(void); | 75 | extern void pmac_find_display(void); |
75 | extern void giveup_fpu(struct task_struct *); | 76 | extern void giveup_fpu(struct task_struct *); |
76 | extern void enable_kernel_fp(void); | 77 | extern void enable_kernel_fp(void); |
78 | extern void flush_fp_to_thread(struct task_struct *); | ||
77 | extern void enable_kernel_altivec(void); | 79 | extern void enable_kernel_altivec(void); |
78 | extern void giveup_altivec(struct task_struct *); | 80 | extern void giveup_altivec(struct task_struct *); |
79 | extern void load_up_altivec(struct task_struct *); | 81 | extern void load_up_altivec(struct task_struct *); |
82 | extern int emulate_altivec(struct pt_regs *); | ||
80 | extern void giveup_spe(struct task_struct *); | 83 | extern void giveup_spe(struct task_struct *); |
81 | extern void load_up_spe(struct task_struct *); | 84 | extern void load_up_spe(struct task_struct *); |
82 | extern int fix_alignment(struct pt_regs *); | 85 | extern int fix_alignment(struct pt_regs *); |
83 | extern void cvt_fd(float *from, double *to, unsigned long *fpscr); | 86 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); |
84 | extern void cvt_df(double *from, float *to, unsigned long *fpscr); | 87 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); |
88 | |||
89 | #ifdef CONFIG_ALTIVEC | ||
90 | extern void flush_altivec_to_thread(struct task_struct *); | ||
91 | #else | ||
92 | static inline void flush_altivec_to_thread(struct task_struct *t) | ||
93 | { | ||
94 | } | ||
95 | #endif | ||
96 | |||
97 | #ifdef CONFIG_SPE | ||
98 | extern void flush_spe_to_thread(struct task_struct *); | ||
99 | #else | ||
100 | static inline void flush_spe_to_thread(struct task_struct *t) | ||
101 | { | ||
102 | } | ||
103 | #endif | ||
104 | |||
85 | extern int call_rtas(const char *, int, int, unsigned long *, ...); | 105 | extern int call_rtas(const char *, int, int, unsigned long *, ...); |
86 | extern void cacheable_memzero(void *p, unsigned int nb); | 106 | extern void cacheable_memzero(void *p, unsigned int nb); |
87 | extern void *cacheable_memcpy(void *, const void *, unsigned int); | 107 | extern void *cacheable_memcpy(void *, const void *, unsigned int); |
88 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); | 108 | extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); |
89 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); | 109 | extern void bad_page_fault(struct pt_regs *, unsigned long, int); |
90 | extern void die(const char *, struct pt_regs *, long); | 110 | extern int die(const char *, struct pt_regs *, long); |
91 | extern void _exception(int, struct pt_regs *, int, unsigned long); | 111 | extern void _exception(int, struct pt_regs *, int, unsigned long); |
112 | void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); | ||
113 | |||
92 | #ifdef CONFIG_BOOKE_WDT | 114 | #ifdef CONFIG_BOOKE_WDT |
93 | extern u32 booke_wdt_enabled; | 115 | extern u32 booke_wdt_enabled; |
94 | extern u32 booke_wdt_period; | 116 | extern u32 booke_wdt_period; |
diff --git a/include/asm-ppc/thread_info.h b/include/asm-ppc/thread_info.h deleted file mode 100644 index 27903db42efc..000000000000 --- a/include/asm-ppc/thread_info.h +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* thread_info.h: PPC low-level thread information | ||
2 | * adapted from the i386 version by Paul Mackerras | ||
3 | * | ||
4 | * Copyright (C) 2002 David Howells (dhowells@redhat.com) | ||
5 | * - Incorporating suggestions made by Linus Torvalds and Dave Miller | ||
6 | */ | ||
7 | |||
8 | #ifndef _ASM_THREAD_INFO_H | ||
9 | #define _ASM_THREAD_INFO_H | ||
10 | |||
11 | #ifdef __KERNEL__ | ||
12 | #ifndef __ASSEMBLY__ | ||
13 | /* | ||
14 | * low level task data. | ||
15 | * If you change this, change the TI_* offsets below to match. | ||
16 | */ | ||
17 | struct thread_info { | ||
18 | struct task_struct *task; /* main task structure */ | ||
19 | struct exec_domain *exec_domain; /* execution domain */ | ||
20 | unsigned long flags; /* low level flags */ | ||
21 | unsigned long local_flags; /* non-racy flags */ | ||
22 | int cpu; /* cpu we're on */ | ||
23 | int preempt_count; /* 0 => preemptable, | ||
24 | <0 => BUG */ | ||
25 | struct restart_block restart_block; | ||
26 | }; | ||
27 | |||
28 | #define INIT_THREAD_INFO(tsk) \ | ||
29 | { \ | ||
30 | .task = &tsk, \ | ||
31 | .exec_domain = &default_exec_domain, \ | ||
32 | .flags = 0, \ | ||
33 | .local_flags = 0, \ | ||
34 | .cpu = 0, \ | ||
35 | .preempt_count = 1, \ | ||
36 | .restart_block = { \ | ||
37 | .fn = do_no_restart_syscall, \ | ||
38 | }, \ | ||
39 | } | ||
40 | |||
41 | #define init_thread_info (init_thread_union.thread_info) | ||
42 | #define init_stack (init_thread_union.stack) | ||
43 | |||
44 | /* | ||
45 | * macros/functions for gaining access to the thread information structure | ||
46 | */ | ||
47 | |||
48 | /* how to get the thread information struct from C */ | ||
49 | static inline struct thread_info *current_thread_info(void) | ||
50 | { | ||
51 | struct thread_info *ti; | ||
52 | __asm__("rlwinm %0,1,0,0,18" : "=r"(ti)); | ||
53 | return ti; | ||
54 | } | ||
55 | |||
56 | /* thread information allocation */ | ||
57 | #define alloc_thread_info(tsk) ((struct thread_info *) \ | ||
58 | __get_free_pages(GFP_KERNEL, 1)) | ||
59 | #define free_thread_info(ti) free_pages((unsigned long) (ti), 1) | ||
60 | #define get_thread_info(ti) get_task_struct((ti)->task) | ||
61 | #define put_thread_info(ti) put_task_struct((ti)->task) | ||
62 | #endif /* __ASSEMBLY__ */ | ||
63 | |||
64 | /* | ||
65 | * Size of kernel stack for each process. | ||
66 | */ | ||
67 | #define THREAD_SIZE 8192 /* 2 pages */ | ||
68 | |||
69 | #define PREEMPT_ACTIVE 0x10000000 | ||
70 | |||
71 | /* | ||
72 | * thread information flag bit numbers | ||
73 | */ | ||
74 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | ||
75 | #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ | ||
76 | #define TIF_SIGPENDING 2 /* signal pending */ | ||
77 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | ||
78 | #define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling | ||
79 | TIF_NEED_RESCHED */ | ||
80 | #define TIF_MEMDIE 5 | ||
81 | #define TIF_SYSCALL_AUDIT 6 /* syscall auditing active */ | ||
82 | #define TIF_SECCOMP 7 /* secure computing */ | ||
83 | |||
84 | /* as above, but as bit values */ | ||
85 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | ||
86 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | ||
87 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | ||
88 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | ||
89 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
90 | #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) | ||
91 | #define _TIF_SECCOMP (1<<TIF_SECCOMP) | ||
92 | |||
93 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | ||
94 | |||
95 | /* | ||
96 | * Non racy (local) flags bit numbers | ||
97 | */ | ||
98 | #define TIFL_FORCE_NOERROR 0 /* don't return error from current | ||
99 | syscall even if result < 0 */ | ||
100 | |||
101 | /* as above, but as bit values */ | ||
102 | #define _TIFL_FORCE_NOERROR (1<<TIFL_FORCE_NOERROR) | ||
103 | |||
104 | |||
105 | #endif /* __KERNEL__ */ | ||
106 | |||
107 | #endif /* _ASM_THREAD_INFO_H */ | ||
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h deleted file mode 100644 index 77dc24d7d2ad..000000000000 --- a/include/asm-ppc/types.h +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | #ifndef _PPC_TYPES_H | ||
2 | #define _PPC_TYPES_H | ||
3 | |||
4 | #ifndef __ASSEMBLY__ | ||
5 | |||
6 | typedef __signed__ char __s8; | ||
7 | typedef unsigned char __u8; | ||
8 | |||
9 | typedef __signed__ short __s16; | ||
10 | typedef unsigned short __u16; | ||
11 | |||
12 | typedef __signed__ int __s32; | ||
13 | typedef unsigned int __u32; | ||
14 | |||
15 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) | ||
16 | typedef __signed__ long long __s64; | ||
17 | typedef unsigned long long __u64; | ||
18 | #endif | ||
19 | |||
20 | typedef struct { | ||
21 | __u32 u[4]; | ||
22 | } __vector128; | ||
23 | |||
24 | /* | ||
25 | * XXX allowed outside of __KERNEL__ for now, until glibc gets | ||
26 | * a proper set of asm headers of its own. -- paulus | ||
27 | */ | ||
28 | typedef unsigned short umode_t; | ||
29 | |||
30 | #endif /* __ASSEMBLY__ */ | ||
31 | |||
32 | #ifdef __KERNEL__ | ||
33 | /* | ||
34 | * These aren't exported outside the kernel to avoid name space clashes | ||
35 | */ | ||
36 | #define BITS_PER_LONG 32 | ||
37 | |||
38 | #ifndef __ASSEMBLY__ | ||
39 | |||
40 | #include <linux/config.h> | ||
41 | |||
42 | typedef signed char s8; | ||
43 | typedef unsigned char u8; | ||
44 | |||
45 | typedef signed short s16; | ||
46 | typedef unsigned short u16; | ||
47 | |||
48 | typedef signed int s32; | ||
49 | typedef unsigned int u32; | ||
50 | |||
51 | typedef signed long long s64; | ||
52 | typedef unsigned long long u64; | ||
53 | |||
54 | typedef __vector128 vector128; | ||
55 | |||
56 | /* DMA addresses are 32-bits wide */ | ||
57 | typedef u32 dma_addr_t; | ||
58 | typedef u64 dma64_addr_t; | ||
59 | |||
60 | #ifdef CONFIG_LBD | ||
61 | typedef u64 sector_t; | ||
62 | #define HAVE_SECTOR_T | ||
63 | #endif | ||
64 | |||
65 | #endif /* __ASSEMBLY__ */ | ||
66 | |||
67 | #endif /* __KERNEL__ */ | ||
68 | |||
69 | #endif | ||
diff --git a/include/asm-ppc/vga.h b/include/asm-ppc/vga.h deleted file mode 100644 index c5864734e3e1..000000000000 --- a/include/asm-ppc/vga.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * Access to VGA videoram | ||
3 | * | ||
4 | * (c) 1998 Martin Mares <mj@ucw.cz> | ||
5 | */ | ||
6 | |||
7 | #ifdef __KERNEL__ | ||
8 | #ifndef _LINUX_ASM_VGA_H_ | ||
9 | #define _LINUX_ASM_VGA_H_ | ||
10 | |||
11 | #include <asm/io.h> | ||
12 | |||
13 | #include <linux/config.h> | ||
14 | |||
15 | #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) | ||
16 | |||
17 | #define VT_BUF_HAVE_RW | ||
18 | /* | ||
19 | * These are only needed for supporting VGA or MDA text mode, which use little | ||
20 | * endian byte ordering. | ||
21 | * In other cases, we can optimize by using native byte ordering and | ||
22 | * <linux/vt_buffer.h> has already done the right job for us. | ||
23 | */ | ||
24 | |||
25 | extern inline void scr_writew(u16 val, volatile u16 *addr) | ||
26 | { | ||
27 | st_le16(addr, val); | ||
28 | } | ||
29 | |||
30 | extern inline u16 scr_readw(volatile const u16 *addr) | ||
31 | { | ||
32 | return ld_le16(addr); | ||
33 | } | ||
34 | |||
35 | #define VT_BUF_HAVE_MEMCPYW | ||
36 | #define scr_memcpyw memcpy | ||
37 | |||
38 | #endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */ | ||
39 | |||
40 | extern unsigned long vgacon_remap_base; | ||
41 | #define VGA_MAP_MEM(x) (x + vgacon_remap_base) | ||
42 | #define vga_readb(x) (*(x)) | ||
43 | #define vga_writeb(x,y) (*(y) = (x)) | ||
44 | |||
45 | #endif | ||
46 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/xmon.h b/include/asm-ppc/xmon.h deleted file mode 100644 index 042b83e6680d..000000000000 --- a/include/asm-ppc/xmon.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | #ifndef __PPC_XMON_H | ||
2 | #define __PPC_XMON_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | struct pt_regs; | ||
6 | |||
7 | extern void xmon(struct pt_regs *excp); | ||
8 | extern void xmon_printf(const char *fmt, ...); | ||
9 | extern void xmon_map_scc(void); | ||
10 | extern int xmon_bpt(struct pt_regs *regs); | ||
11 | extern int xmon_sstep(struct pt_regs *regs); | ||
12 | extern int xmon_iabr_match(struct pt_regs *regs); | ||
13 | extern int xmon_dabr_match(struct pt_regs *regs); | ||
14 | extern void (*xmon_fault_handler)(struct pt_regs *regs); | ||
15 | |||
16 | #endif | ||
17 | #endif | ||
diff --git a/include/asm-ppc64/abs_addr.h b/include/asm-ppc64/abs_addr.h index 84c24d4cdb71..dc3fc3fefef2 100644 --- a/include/asm-ppc64/abs_addr.h +++ b/include/asm-ppc64/abs_addr.h | |||
@@ -63,4 +63,11 @@ static inline unsigned long phys_to_abs(unsigned long pa) | |||
63 | #define virt_to_abs(va) phys_to_abs(__pa(va)) | 63 | #define virt_to_abs(va) phys_to_abs(__pa(va)) |
64 | #define abs_to_virt(aa) __va(aa) | 64 | #define abs_to_virt(aa) __va(aa) |
65 | 65 | ||
66 | /* | ||
67 | * Converts Virtual Address to Real Address for | ||
68 | * Legacy iSeries Hypervisor calls | ||
69 | */ | ||
70 | #define iseries_hv_addr(virtaddr) \ | ||
71 | (0x8000000000000000 | virt_to_abs(virtaddr)) | ||
72 | |||
66 | #endif /* _ABS_ADDR_H */ | 73 | #endif /* _ABS_ADDR_H */ |
diff --git a/include/asm-ppc64/atomic.h b/include/asm-ppc64/atomic.h deleted file mode 100644 index 0e5f25e83bc0..000000000000 --- a/include/asm-ppc64/atomic.h +++ /dev/null | |||
@@ -1,197 +0,0 @@ | |||
1 | /* | ||
2 | * PowerPC64 atomic operations | ||
3 | * | ||
4 | * Copyright (C) 2001 Paul Mackerras <paulus@au.ibm.com>, IBM | ||
5 | * Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef _ASM_PPC64_ATOMIC_H_ | ||
14 | #define _ASM_PPC64_ATOMIC_H_ | ||
15 | |||
16 | #include <asm/memory.h> | ||
17 | |||
18 | typedef struct { volatile int counter; } atomic_t; | ||
19 | |||
20 | #define ATOMIC_INIT(i) { (i) } | ||
21 | |||
22 | #define atomic_read(v) ((v)->counter) | ||
23 | #define atomic_set(v,i) (((v)->counter) = (i)) | ||
24 | |||
25 | static __inline__ void atomic_add(int a, atomic_t *v) | ||
26 | { | ||
27 | int t; | ||
28 | |||
29 | __asm__ __volatile__( | ||
30 | "1: lwarx %0,0,%3 # atomic_add\n\ | ||
31 | add %0,%2,%0\n\ | ||
32 | stwcx. %0,0,%3\n\ | ||
33 | bne- 1b" | ||
34 | : "=&r" (t), "=m" (v->counter) | ||
35 | : "r" (a), "r" (&v->counter), "m" (v->counter) | ||
36 | : "cc"); | ||
37 | } | ||
38 | |||
39 | static __inline__ int atomic_add_return(int a, atomic_t *v) | ||
40 | { | ||
41 | int t; | ||
42 | |||
43 | __asm__ __volatile__( | ||
44 | EIEIO_ON_SMP | ||
45 | "1: lwarx %0,0,%2 # atomic_add_return\n\ | ||
46 | add %0,%1,%0\n\ | ||
47 | stwcx. %0,0,%2\n\ | ||
48 | bne- 1b" | ||
49 | ISYNC_ON_SMP | ||
50 | : "=&r" (t) | ||
51 | : "r" (a), "r" (&v->counter) | ||
52 | : "cc", "memory"); | ||
53 | |||
54 | return t; | ||
55 | } | ||
56 | |||
57 | #define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) | ||
58 | |||
59 | static __inline__ void atomic_sub(int a, atomic_t *v) | ||
60 | { | ||
61 | int t; | ||
62 | |||
63 | __asm__ __volatile__( | ||
64 | "1: lwarx %0,0,%3 # atomic_sub\n\ | ||
65 | subf %0,%2,%0\n\ | ||
66 | stwcx. %0,0,%3\n\ | ||
67 | bne- 1b" | ||
68 | : "=&r" (t), "=m" (v->counter) | ||
69 | : "r" (a), "r" (&v->counter), "m" (v->counter) | ||
70 | : "cc"); | ||
71 | } | ||
72 | |||
73 | static __inline__ int atomic_sub_return(int a, atomic_t *v) | ||
74 | { | ||
75 | int t; | ||
76 | |||
77 | __asm__ __volatile__( | ||
78 | EIEIO_ON_SMP | ||
79 | "1: lwarx %0,0,%2 # atomic_sub_return\n\ | ||
80 | subf %0,%1,%0\n\ | ||
81 | stwcx. %0,0,%2\n\ | ||
82 | bne- 1b" | ||
83 | ISYNC_ON_SMP | ||
84 | : "=&r" (t) | ||
85 | : "r" (a), "r" (&v->counter) | ||
86 | : "cc", "memory"); | ||
87 | |||
88 | return t; | ||
89 | } | ||
90 | |||
91 | static __inline__ void atomic_inc(atomic_t *v) | ||
92 | { | ||
93 | int t; | ||
94 | |||
95 | __asm__ __volatile__( | ||
96 | "1: lwarx %0,0,%2 # atomic_inc\n\ | ||
97 | addic %0,%0,1\n\ | ||
98 | stwcx. %0,0,%2\n\ | ||
99 | bne- 1b" | ||
100 | : "=&r" (t), "=m" (v->counter) | ||
101 | : "r" (&v->counter), "m" (v->counter) | ||
102 | : "cc"); | ||
103 | } | ||
104 | |||
105 | static __inline__ int atomic_inc_return(atomic_t *v) | ||
106 | { | ||
107 | int t; | ||
108 | |||
109 | __asm__ __volatile__( | ||
110 | EIEIO_ON_SMP | ||
111 | "1: lwarx %0,0,%1 # atomic_inc_return\n\ | ||
112 | addic %0,%0,1\n\ | ||
113 | stwcx. %0,0,%1\n\ | ||
114 | bne- 1b" | ||
115 | ISYNC_ON_SMP | ||
116 | : "=&r" (t) | ||
117 | : "r" (&v->counter) | ||
118 | : "cc", "memory"); | ||
119 | |||
120 | return t; | ||
121 | } | ||
122 | |||
123 | /* | ||
124 | * atomic_inc_and_test - increment and test | ||
125 | * @v: pointer of type atomic_t | ||
126 | * | ||
127 | * Atomically increments @v by 1 | ||
128 | * and returns true if the result is zero, or false for all | ||
129 | * other cases. | ||
130 | */ | ||
131 | #define atomic_inc_and_test(v) (atomic_inc_return(v) == 0) | ||
132 | |||
133 | static __inline__ void atomic_dec(atomic_t *v) | ||
134 | { | ||
135 | int t; | ||
136 | |||
137 | __asm__ __volatile__( | ||
138 | "1: lwarx %0,0,%2 # atomic_dec\n\ | ||
139 | addic %0,%0,-1\n\ | ||
140 | stwcx. %0,0,%2\n\ | ||
141 | bne- 1b" | ||
142 | : "=&r" (t), "=m" (v->counter) | ||
143 | : "r" (&v->counter), "m" (v->counter) | ||
144 | : "cc"); | ||
145 | } | ||
146 | |||
147 | static __inline__ int atomic_dec_return(atomic_t *v) | ||
148 | { | ||
149 | int t; | ||
150 | |||
151 | __asm__ __volatile__( | ||
152 | EIEIO_ON_SMP | ||
153 | "1: lwarx %0,0,%1 # atomic_dec_return\n\ | ||
154 | addic %0,%0,-1\n\ | ||
155 | stwcx. %0,0,%1\n\ | ||
156 | bne- 1b" | ||
157 | ISYNC_ON_SMP | ||
158 | : "=&r" (t) | ||
159 | : "r" (&v->counter) | ||
160 | : "cc", "memory"); | ||
161 | |||
162 | return t; | ||
163 | } | ||
164 | |||
165 | #define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) | ||
166 | #define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0) | ||
167 | |||
168 | /* | ||
169 | * Atomically test *v and decrement if it is greater than 0. | ||
170 | * The function returns the old value of *v minus 1. | ||
171 | */ | ||
172 | static __inline__ int atomic_dec_if_positive(atomic_t *v) | ||
173 | { | ||
174 | int t; | ||
175 | |||
176 | __asm__ __volatile__( | ||
177 | EIEIO_ON_SMP | ||
178 | "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ | ||
179 | addic. %0,%0,-1\n\ | ||
180 | blt- 2f\n\ | ||
181 | stwcx. %0,0,%1\n\ | ||
182 | bne- 1b" | ||
183 | ISYNC_ON_SMP | ||
184 | "\n\ | ||
185 | 2:" : "=&r" (t) | ||
186 | : "r" (&v->counter) | ||
187 | : "cc", "memory"); | ||
188 | |||
189 | return t; | ||
190 | } | ||
191 | |||
192 | #define smp_mb__before_atomic_dec() smp_mb() | ||
193 | #define smp_mb__after_atomic_dec() smp_mb() | ||
194 | #define smp_mb__before_atomic_inc() smp_mb() | ||
195 | #define smp_mb__after_atomic_inc() smp_mb() | ||
196 | |||
197 | #endif /* _ASM_PPC64_ATOMIC_H_ */ | ||
diff --git a/include/asm-ppc64/bitops.h b/include/asm-ppc64/bitops.h index a0f831224f96..dbfa42ef4a99 100644 --- a/include/asm-ppc64/bitops.h +++ b/include/asm-ppc64/bitops.h | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
44 | 44 | ||
45 | #include <asm/memory.h> | 45 | #include <asm/synch.h> |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * clear_bit doesn't imply a memory barrier | 48 | * clear_bit doesn't imply a memory barrier |
diff --git a/include/asm-ppc64/bootinfo.h b/include/asm-ppc64/bootinfo.h deleted file mode 100644 index f55e7cb48f46..000000000000 --- a/include/asm-ppc64/bootinfo.h +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* | ||
2 | * Non-machine dependent bootinfo structure. Basic idea | ||
3 | * borrowed from the m68k. | ||
4 | * | ||
5 | * Copyright (C) 1999 Cort Dougan <cort@ppc.kernel.org> | ||
6 | * Copyright (c) 2001 PPC64 Team, IBM Corp | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | |||
15 | #ifndef _PPC64_BOOTINFO_H | ||
16 | #define _PPC64_BOOTINFO_H | ||
17 | |||
18 | #include <asm/types.h> | ||
19 | |||
20 | /* We use a u32 for the type of the fields since they're written by | ||
21 | * the bootloader which is a 32-bit process and read by the kernel | ||
22 | * which is a 64-bit process. This way they can both agree on the | ||
23 | * size of the type. | ||
24 | */ | ||
25 | typedef u32 bi_rec_field; | ||
26 | |||
27 | struct bi_record { | ||
28 | bi_rec_field tag; /* tag ID */ | ||
29 | bi_rec_field size; /* size of record (in bytes) */ | ||
30 | bi_rec_field data[0]; /* data */ | ||
31 | }; | ||
32 | |||
33 | #define BI_FIRST 0x1010 /* first record - marker */ | ||
34 | #define BI_LAST 0x1011 /* last record - marker */ | ||
35 | #define BI_CMD_LINE 0x1012 | ||
36 | #define BI_BOOTLOADER_ID 0x1013 | ||
37 | #define BI_INITRD 0x1014 | ||
38 | #define BI_SYSMAP 0x1015 | ||
39 | #define BI_MACHTYPE 0x1016 | ||
40 | |||
41 | static __inline__ struct bi_record * bi_rec_init(unsigned long addr) | ||
42 | { | ||
43 | struct bi_record *bi_recs; | ||
44 | bi_recs = (struct bi_record *)_ALIGN(addr, PAGE_SIZE); | ||
45 | bi_recs->size = 0; | ||
46 | return bi_recs; | ||
47 | } | ||
48 | |||
49 | static __inline__ struct bi_record * bi_rec_alloc(struct bi_record *rec, | ||
50 | unsigned long args) | ||
51 | { | ||
52 | rec = (struct bi_record *)((unsigned long)rec + rec->size); | ||
53 | rec->size = sizeof(struct bi_record) + args*sizeof(bi_rec_field); | ||
54 | return rec; | ||
55 | } | ||
56 | |||
57 | static __inline__ struct bi_record * bi_rec_alloc_bytes(struct bi_record *rec, | ||
58 | unsigned long bytes) | ||
59 | { | ||
60 | rec = (struct bi_record *)((unsigned long)rec + rec->size); | ||
61 | rec->size = sizeof(struct bi_record) + bytes; | ||
62 | return rec; | ||
63 | } | ||
64 | |||
65 | static __inline__ struct bi_record * bi_rec_next(struct bi_record *rec) | ||
66 | { | ||
67 | return (struct bi_record *)((unsigned long)rec + rec->size); | ||
68 | } | ||
69 | |||
70 | #endif /* _PPC64_BOOTINFO_H */ | ||
diff --git a/include/asm-ppc64/btext.h b/include/asm-ppc64/btext.h index 67aef0cc72c0..71cce36bc630 100644 --- a/include/asm-ppc64/btext.h +++ b/include/asm-ppc64/btext.h | |||
@@ -15,6 +15,7 @@ extern int boot_text_mapped; | |||
15 | extern int btext_initialize(struct device_node *np); | 15 | extern int btext_initialize(struct device_node *np); |
16 | 16 | ||
17 | extern void map_boot_text(void); | 17 | extern void map_boot_text(void); |
18 | extern void init_boot_display(void); | ||
18 | extern void btext_update_display(unsigned long phys, int width, int height, | 19 | extern void btext_update_display(unsigned long phys, int width, int height, |
19 | int depth, int pitch); | 20 | int depth, int pitch); |
20 | 21 | ||
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h deleted file mode 100644 index acc9b4d6c168..000000000000 --- a/include/asm-ppc64/cputable.h +++ /dev/null | |||
@@ -1,167 +0,0 @@ | |||
1 | /* | ||
2 | * include/asm-ppc64/cputable.h | ||
3 | * | ||
4 | * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) | ||
5 | * | ||
6 | * Modifications for ppc64: | ||
7 | * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | ||
14 | |||
15 | #ifndef __ASM_PPC_CPUTABLE_H | ||
16 | #define __ASM_PPC_CPUTABLE_H | ||
17 | |||
18 | #include <linux/config.h> | ||
19 | #include <asm/page.h> /* for ASM_CONST */ | ||
20 | |||
21 | /* Exposed to userland CPU features - Must match ppc32 definitions */ | ||
22 | #define PPC_FEATURE_32 0x80000000 | ||
23 | #define PPC_FEATURE_64 0x40000000 | ||
24 | #define PPC_FEATURE_601_INSTR 0x20000000 | ||
25 | #define PPC_FEATURE_HAS_ALTIVEC 0x10000000 | ||
26 | #define PPC_FEATURE_HAS_FPU 0x08000000 | ||
27 | #define PPC_FEATURE_HAS_MMU 0x04000000 | ||
28 | #define PPC_FEATURE_HAS_4xxMAC 0x02000000 | ||
29 | #define PPC_FEATURE_UNIFIED_CACHE 0x01000000 | ||
30 | |||
31 | #ifdef __KERNEL__ | ||
32 | |||
33 | #ifndef __ASSEMBLY__ | ||
34 | |||
35 | /* This structure can grow, it's real size is used by head.S code | ||
36 | * via the mkdefs mechanism. | ||
37 | */ | ||
38 | struct cpu_spec; | ||
39 | struct op_ppc64_model; | ||
40 | |||
41 | typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); | ||
42 | |||
43 | struct cpu_spec { | ||
44 | /* CPU is matched via (PVR & pvr_mask) == pvr_value */ | ||
45 | unsigned int pvr_mask; | ||
46 | unsigned int pvr_value; | ||
47 | |||
48 | char *cpu_name; | ||
49 | unsigned long cpu_features; /* Kernel features */ | ||
50 | unsigned int cpu_user_features; /* Userland features */ | ||
51 | |||
52 | /* cache line sizes */ | ||
53 | unsigned int icache_bsize; | ||
54 | unsigned int dcache_bsize; | ||
55 | |||
56 | /* number of performance monitor counters */ | ||
57 | unsigned int num_pmcs; | ||
58 | |||
59 | /* this is called to initialize various CPU bits like L1 cache, | ||
60 | * BHT, SPD, etc... from head.S before branching to identify_machine | ||
61 | */ | ||
62 | cpu_setup_t cpu_setup; | ||
63 | |||
64 | /* Used by oprofile userspace to select the right counters */ | ||
65 | char *oprofile_cpu_type; | ||
66 | |||
67 | /* Processor specific oprofile operations */ | ||
68 | struct op_ppc64_model *oprofile_model; | ||
69 | }; | ||
70 | |||
71 | extern struct cpu_spec cpu_specs[]; | ||
72 | extern struct cpu_spec *cur_cpu_spec; | ||
73 | |||
74 | static inline unsigned long cpu_has_feature(unsigned long feature) | ||
75 | { | ||
76 | return cur_cpu_spec->cpu_features & feature; | ||
77 | } | ||
78 | |||
79 | #endif /* __ASSEMBLY__ */ | ||
80 | |||
81 | /* CPU kernel features */ | ||
82 | |||
83 | /* Retain the 32b definitions for the time being - use bottom half of word */ | ||
84 | #define CPU_FTR_SPLIT_ID_CACHE ASM_CONST(0x0000000000000001) | ||
85 | #define CPU_FTR_L2CR ASM_CONST(0x0000000000000002) | ||
86 | #define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004) | ||
87 | #define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008) | ||
88 | #define CPU_FTR_TAU ASM_CONST(0x0000000000000010) | ||
89 | #define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020) | ||
90 | #define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) | ||
91 | #define CPU_FTR_604_PERF_MON ASM_CONST(0x0000000000000080) | ||
92 | #define CPU_FTR_601 ASM_CONST(0x0000000000000100) | ||
93 | #define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200) | ||
94 | #define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) | ||
95 | #define CPU_FTR_L3CR ASM_CONST(0x0000000000000800) | ||
96 | #define CPU_FTR_L3_DISABLE_NAP ASM_CONST(0x0000000000001000) | ||
97 | #define CPU_FTR_NAP_DISABLE_L2_PR ASM_CONST(0x0000000000002000) | ||
98 | #define CPU_FTR_DUAL_PLL_750FX ASM_CONST(0x0000000000004000) | ||
99 | |||
100 | /* Add the 64b processor unique features in the top half of the word */ | ||
101 | #define CPU_FTR_SLB ASM_CONST(0x0000000100000000) | ||
102 | #define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) | ||
103 | #define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) | ||
104 | #define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) | ||
105 | #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000) | ||
106 | #define CPU_FTR_IABR ASM_CONST(0x0000002000000000) | ||
107 | #define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) | ||
108 | /* unused ASM_CONST(0x0000008000000000) */ | ||
109 | #define CPU_FTR_SMT ASM_CONST(0x0000010000000000) | ||
110 | #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) | ||
111 | #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) | ||
112 | #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) | ||
113 | #define CPU_FTR_CTRL ASM_CONST(0x0000100000000000) | ||
114 | |||
115 | #ifndef __ASSEMBLY__ | ||
116 | |||
117 | #define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \ | ||
118 | PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_MMU) | ||
119 | |||
120 | #define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ | ||
121 | CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \ | ||
122 | CPU_FTR_NODSISRALIGN | CPU_FTR_CTRL) | ||
123 | |||
124 | /* iSeries doesn't support large pages */ | ||
125 | #ifdef CONFIG_PPC_ISERIES | ||
126 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE) | ||
127 | #else | ||
128 | #define CPU_FTR_PPCAS_ARCH_V2 (CPU_FTR_PPCAS_ARCH_V2_BASE | CPU_FTR_16M_PAGE) | ||
129 | #endif /* CONFIG_PPC_ISERIES */ | ||
130 | |||
131 | #endif /* __ASSEMBLY */ | ||
132 | |||
133 | #ifdef __ASSEMBLY__ | ||
134 | |||
135 | #define BEGIN_FTR_SECTION 98: | ||
136 | |||
137 | #define END_FTR_SECTION(msk, val) \ | ||
138 | 99: \ | ||
139 | .section __ftr_fixup,"a"; \ | ||
140 | .align 3; \ | ||
141 | .llong msk; \ | ||
142 | .llong val; \ | ||
143 | .llong 98b; \ | ||
144 | .llong 99b; \ | ||
145 | .previous | ||
146 | |||
147 | #else | ||
148 | |||
149 | #define BEGIN_FTR_SECTION "98:\n" | ||
150 | #define END_FTR_SECTION(msk, val) \ | ||
151 | "99:\n" \ | ||
152 | " .section __ftr_fixup,\"a\";\n" \ | ||
153 | " .align 3;\n" \ | ||
154 | " .llong "#msk";\n" \ | ||
155 | " .llong "#val";\n" \ | ||
156 | " .llong 98b;\n" \ | ||
157 | " .llong 99b;\n" \ | ||
158 | " .previous\n" | ||
159 | |||
160 | #endif /* __ASSEMBLY__ */ | ||
161 | |||
162 | #define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) | ||
163 | #define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) | ||
164 | |||
165 | #endif /* __ASM_PPC_CPUTABLE_H */ | ||
166 | #endif /* __KERNEL__ */ | ||
167 | |||
diff --git a/include/asm-ppc64/dart.h b/include/asm-ppc64/dart.h new file mode 100644 index 000000000000..cdf8a2dec05f --- /dev/null +++ b/include/asm-ppc64/dart.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef _ASM_DART_H | ||
20 | #define _ASM_DART_H | ||
21 | |||
22 | |||
23 | /* physical base of DART registers */ | ||
24 | #define DART_BASE 0xf8033000UL | ||
25 | |||
26 | /* Offset from base to control register */ | ||
27 | #define DARTCNTL 0 | ||
28 | /* Offset from base to exception register */ | ||
29 | #define DARTEXCP 0x10 | ||
30 | /* Offset from base to TLB tag registers */ | ||
31 | #define DARTTAG 0x1000 | ||
32 | |||
33 | |||
34 | /* Control Register fields */ | ||
35 | |||
36 | /* base address of table (pfn) */ | ||
37 | #define DARTCNTL_BASE_MASK 0xfffff | ||
38 | #define DARTCNTL_BASE_SHIFT 12 | ||
39 | |||
40 | #define DARTCNTL_FLUSHTLB 0x400 | ||
41 | #define DARTCNTL_ENABLE 0x200 | ||
42 | |||
43 | /* size of table in pages */ | ||
44 | #define DARTCNTL_SIZE_MASK 0x1ff | ||
45 | #define DARTCNTL_SIZE_SHIFT 0 | ||
46 | |||
47 | |||
48 | /* DART table fields */ | ||
49 | |||
50 | #define DARTMAP_VALID 0x80000000 | ||
51 | #define DARTMAP_RPNMASK 0x00ffffff | ||
52 | |||
53 | |||
54 | #define DART_PAGE_SHIFT 12 | ||
55 | #define DART_PAGE_SIZE (1 << DART_PAGE_SHIFT) | ||
56 | #define DART_PAGE_FACTOR (PAGE_SHIFT - DART_PAGE_SHIFT) | ||
57 | |||
58 | |||
59 | #endif | ||
diff --git a/include/asm-ppc64/dbdma.h b/include/asm-ppc64/dbdma.h deleted file mode 100644 index f2d5d5dc3377..000000000000 --- a/include/asm-ppc64/dbdma.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/dbdma.h> | ||
2 | |||
diff --git a/include/asm-ppc64/dma.h b/include/asm-ppc64/dma.h deleted file mode 100644 index dfd1f69059ba..000000000000 --- a/include/asm-ppc64/dma.h +++ /dev/null | |||
@@ -1,329 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm/dma.h: Defines for using and allocating dma channels. | ||
3 | * Written by Hennus Bergman, 1992. | ||
4 | * High DMA channel support & info by Hannu Savolainen | ||
5 | * and John Boyd, Nov. 1992. | ||
6 | * Changes for ppc sound by Christoph Nadig | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef _ASM_DMA_H | ||
15 | #define _ASM_DMA_H | ||
16 | |||
17 | #include <linux/config.h> | ||
18 | #include <asm/io.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <asm/system.h> | ||
21 | |||
22 | #ifndef MAX_DMA_CHANNELS | ||
23 | #define MAX_DMA_CHANNELS 8 | ||
24 | #endif | ||
25 | |||
26 | /* The maximum address that we can perform a DMA transfer to on this platform */ | ||
27 | /* Doesn't really apply... */ | ||
28 | #define MAX_DMA_ADDRESS (~0UL) | ||
29 | |||
30 | #if !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) | ||
31 | |||
32 | #define dma_outb outb | ||
33 | #define dma_inb inb | ||
34 | |||
35 | /* | ||
36 | * NOTES about DMA transfers: | ||
37 | * | ||
38 | * controller 1: channels 0-3, byte operations, ports 00-1F | ||
39 | * controller 2: channels 4-7, word operations, ports C0-DF | ||
40 | * | ||
41 | * - ALL registers are 8 bits only, regardless of transfer size | ||
42 | * - channel 4 is not used - cascades 1 into 2. | ||
43 | * - channels 0-3 are byte - addresses/counts are for physical bytes | ||
44 | * - channels 5-7 are word - addresses/counts are for physical words | ||
45 | * - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries | ||
46 | * - transfer count loaded to registers is 1 less than actual count | ||
47 | * - controller 2 offsets are all even (2x offsets for controller 1) | ||
48 | * - page registers for 5-7 don't use data bit 0, represent 128K pages | ||
49 | * - page registers for 0-3 use bit 0, represent 64K pages | ||
50 | * | ||
51 | * On PReP, DMA transfers are limited to the lower 16MB of _physical_ memory. | ||
52 | * On CHRP, the W83C553F (and VLSI Tollgate?) support full 32 bit addressing. | ||
53 | * Note that addresses loaded into registers must be _physical_ addresses, | ||
54 | * not logical addresses (which may differ if paging is active). | ||
55 | * | ||
56 | * Address mapping for channels 0-3: | ||
57 | * | ||
58 | * A23 ... A16 A15 ... A8 A7 ... A0 (Physical addresses) | ||
59 | * | ... | | ... | | ... | | ||
60 | * | ... | | ... | | ... | | ||
61 | * | ... | | ... | | ... | | ||
62 | * P7 ... P0 A7 ... A0 A7 ... A0 | ||
63 | * | Page | Addr MSB | Addr LSB | (DMA registers) | ||
64 | * | ||
65 | * Address mapping for channels 5-7: | ||
66 | * | ||
67 | * A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0 (Physical addresses) | ||
68 | * | ... | \ \ ... \ \ \ ... \ \ | ||
69 | * | ... | \ \ ... \ \ \ ... \ (not used) | ||
70 | * | ... | \ \ ... \ \ \ ... \ | ||
71 | * P7 ... P1 (0) A7 A6 ... A0 A7 A6 ... A0 | ||
72 | * | Page | Addr MSB | Addr LSB | (DMA registers) | ||
73 | * | ||
74 | * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses | ||
75 | * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at | ||
76 | * the hardware level, so odd-byte transfers aren't possible). | ||
77 | * | ||
78 | * Transfer count (_not # bytes_) is limited to 64K, represented as actual | ||
79 | * count - 1 : 64K => 0xFFFF, 1 => 0x0000. Thus, count is always 1 or more, | ||
80 | * and up to 128K bytes may be transferred on channels 5-7 in one operation. | ||
81 | * | ||
82 | */ | ||
83 | |||
84 | /* 8237 DMA controllers */ | ||
85 | #define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ | ||
86 | #define IO_DMA2_BASE 0xC0 /* 16 bit master DMA, ch 4(=slave input)..7 */ | ||
87 | |||
88 | /* DMA controller registers */ | ||
89 | #define DMA1_CMD_REG 0x08 /* command register (w) */ | ||
90 | #define DMA1_STAT_REG 0x08 /* status register (r) */ | ||
91 | #define DMA1_REQ_REG 0x09 /* request register (w) */ | ||
92 | #define DMA1_MASK_REG 0x0A /* single-channel mask (w) */ | ||
93 | #define DMA1_MODE_REG 0x0B /* mode register (w) */ | ||
94 | #define DMA1_CLEAR_FF_REG 0x0C /* clear pointer flip-flop (w) */ | ||
95 | #define DMA1_TEMP_REG 0x0D /* Temporary Register (r) */ | ||
96 | #define DMA1_RESET_REG 0x0D /* Master Clear (w) */ | ||
97 | #define DMA1_CLR_MASK_REG 0x0E /* Clear Mask */ | ||
98 | #define DMA1_MASK_ALL_REG 0x0F /* all-channels mask (w) */ | ||
99 | |||
100 | #define DMA2_CMD_REG 0xD0 /* command register (w) */ | ||
101 | #define DMA2_STAT_REG 0xD0 /* status register (r) */ | ||
102 | #define DMA2_REQ_REG 0xD2 /* request register (w) */ | ||
103 | #define DMA2_MASK_REG 0xD4 /* single-channel mask (w) */ | ||
104 | #define DMA2_MODE_REG 0xD6 /* mode register (w) */ | ||
105 | #define DMA2_CLEAR_FF_REG 0xD8 /* clear pointer flip-flop (w) */ | ||
106 | #define DMA2_TEMP_REG 0xDA /* Temporary Register (r) */ | ||
107 | #define DMA2_RESET_REG 0xDA /* Master Clear (w) */ | ||
108 | #define DMA2_CLR_MASK_REG 0xDC /* Clear Mask */ | ||
109 | #define DMA2_MASK_ALL_REG 0xDE /* all-channels mask (w) */ | ||
110 | |||
111 | #define DMA_ADDR_0 0x00 /* DMA address registers */ | ||
112 | #define DMA_ADDR_1 0x02 | ||
113 | #define DMA_ADDR_2 0x04 | ||
114 | #define DMA_ADDR_3 0x06 | ||
115 | #define DMA_ADDR_4 0xC0 | ||
116 | #define DMA_ADDR_5 0xC4 | ||
117 | #define DMA_ADDR_6 0xC8 | ||
118 | #define DMA_ADDR_7 0xCC | ||
119 | |||
120 | #define DMA_CNT_0 0x01 /* DMA count registers */ | ||
121 | #define DMA_CNT_1 0x03 | ||
122 | #define DMA_CNT_2 0x05 | ||
123 | #define DMA_CNT_3 0x07 | ||
124 | #define DMA_CNT_4 0xC2 | ||
125 | #define DMA_CNT_5 0xC6 | ||
126 | #define DMA_CNT_6 0xCA | ||
127 | #define DMA_CNT_7 0xCE | ||
128 | |||
129 | #define DMA_LO_PAGE_0 0x87 /* DMA page registers */ | ||
130 | #define DMA_LO_PAGE_1 0x83 | ||
131 | #define DMA_LO_PAGE_2 0x81 | ||
132 | #define DMA_LO_PAGE_3 0x82 | ||
133 | #define DMA_LO_PAGE_5 0x8B | ||
134 | #define DMA_LO_PAGE_6 0x89 | ||
135 | #define DMA_LO_PAGE_7 0x8A | ||
136 | |||
137 | #define DMA_HI_PAGE_0 0x487 /* DMA page registers */ | ||
138 | #define DMA_HI_PAGE_1 0x483 | ||
139 | #define DMA_HI_PAGE_2 0x481 | ||
140 | #define DMA_HI_PAGE_3 0x482 | ||
141 | #define DMA_HI_PAGE_5 0x48B | ||
142 | #define DMA_HI_PAGE_6 0x489 | ||
143 | #define DMA_HI_PAGE_7 0x48A | ||
144 | |||
145 | #define DMA1_EXT_REG 0x40B | ||
146 | #define DMA2_EXT_REG 0x4D6 | ||
147 | |||
148 | #define DMA_MODE_READ 0x44 /* I/O to memory, no autoinit, increment, single mode */ | ||
149 | #define DMA_MODE_WRITE 0x48 /* memory to I/O, no autoinit, increment, single mode */ | ||
150 | #define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */ | ||
151 | |||
152 | #define DMA_AUTOINIT 0x10 | ||
153 | |||
154 | extern spinlock_t dma_spin_lock; | ||
155 | |||
156 | static __inline__ unsigned long claim_dma_lock(void) | ||
157 | { | ||
158 | unsigned long flags; | ||
159 | spin_lock_irqsave(&dma_spin_lock, flags); | ||
160 | return flags; | ||
161 | } | ||
162 | |||
163 | static __inline__ void release_dma_lock(unsigned long flags) | ||
164 | { | ||
165 | spin_unlock_irqrestore(&dma_spin_lock, flags); | ||
166 | } | ||
167 | |||
168 | /* enable/disable a specific DMA channel */ | ||
169 | static __inline__ void enable_dma(unsigned int dmanr) | ||
170 | { | ||
171 | unsigned char ucDmaCmd=0x00; | ||
172 | |||
173 | if (dmanr != 4) | ||
174 | { | ||
175 | dma_outb(0, DMA2_MASK_REG); /* This may not be enabled */ | ||
176 | dma_outb(ucDmaCmd, DMA2_CMD_REG); /* Enable group */ | ||
177 | } | ||
178 | if (dmanr<=3) | ||
179 | { | ||
180 | dma_outb(dmanr, DMA1_MASK_REG); | ||
181 | dma_outb(ucDmaCmd, DMA1_CMD_REG); /* Enable group */ | ||
182 | } else | ||
183 | { | ||
184 | dma_outb(dmanr & 3, DMA2_MASK_REG); | ||
185 | } | ||
186 | } | ||
187 | |||
188 | static __inline__ void disable_dma(unsigned int dmanr) | ||
189 | { | ||
190 | if (dmanr<=3) | ||
191 | dma_outb(dmanr | 4, DMA1_MASK_REG); | ||
192 | else | ||
193 | dma_outb((dmanr & 3) | 4, DMA2_MASK_REG); | ||
194 | } | ||
195 | |||
196 | /* Clear the 'DMA Pointer Flip Flop'. | ||
197 | * Write 0 for LSB/MSB, 1 for MSB/LSB access. | ||
198 | * Use this once to initialize the FF to a known state. | ||
199 | * After that, keep track of it. :-) | ||
200 | * --- In order to do that, the DMA routines below should --- | ||
201 | * --- only be used while interrupts are disabled! --- | ||
202 | */ | ||
203 | static __inline__ void clear_dma_ff(unsigned int dmanr) | ||
204 | { | ||
205 | if (dmanr<=3) | ||
206 | dma_outb(0, DMA1_CLEAR_FF_REG); | ||
207 | else | ||
208 | dma_outb(0, DMA2_CLEAR_FF_REG); | ||
209 | } | ||
210 | |||
211 | /* set mode (above) for a specific DMA channel */ | ||
212 | static __inline__ void set_dma_mode(unsigned int dmanr, char mode) | ||
213 | { | ||
214 | if (dmanr<=3) | ||
215 | dma_outb(mode | dmanr, DMA1_MODE_REG); | ||
216 | else | ||
217 | dma_outb(mode | (dmanr&3), DMA2_MODE_REG); | ||
218 | } | ||
219 | |||
220 | /* Set only the page register bits of the transfer address. | ||
221 | * This is used for successive transfers when we know the contents of | ||
222 | * the lower 16 bits of the DMA current address register, but a 64k boundary | ||
223 | * may have been crossed. | ||
224 | */ | ||
225 | static __inline__ void set_dma_page(unsigned int dmanr, int pagenr) | ||
226 | { | ||
227 | switch(dmanr) { | ||
228 | case 0: | ||
229 | dma_outb(pagenr, DMA_LO_PAGE_0); | ||
230 | dma_outb(pagenr>>8, DMA_HI_PAGE_0); | ||
231 | break; | ||
232 | case 1: | ||
233 | dma_outb(pagenr, DMA_LO_PAGE_1); | ||
234 | dma_outb(pagenr>>8, DMA_HI_PAGE_1); | ||
235 | break; | ||
236 | case 2: | ||
237 | dma_outb(pagenr, DMA_LO_PAGE_2); | ||
238 | dma_outb(pagenr>>8, DMA_HI_PAGE_2); | ||
239 | break; | ||
240 | case 3: | ||
241 | dma_outb(pagenr, DMA_LO_PAGE_3); | ||
242 | dma_outb(pagenr>>8, DMA_HI_PAGE_3); | ||
243 | break; | ||
244 | case 5: | ||
245 | dma_outb(pagenr & 0xfe, DMA_LO_PAGE_5); | ||
246 | dma_outb(pagenr>>8, DMA_HI_PAGE_5); | ||
247 | break; | ||
248 | case 6: | ||
249 | dma_outb(pagenr & 0xfe, DMA_LO_PAGE_6); | ||
250 | dma_outb(pagenr>>8, DMA_HI_PAGE_6); | ||
251 | break; | ||
252 | case 7: | ||
253 | dma_outb(pagenr & 0xfe, DMA_LO_PAGE_7); | ||
254 | dma_outb(pagenr>>8, DMA_HI_PAGE_7); | ||
255 | break; | ||
256 | } | ||
257 | } | ||
258 | |||
259 | |||
260 | /* Set transfer address & page bits for specific DMA channel. | ||
261 | * Assumes dma flipflop is clear. | ||
262 | */ | ||
263 | static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int phys) | ||
264 | { | ||
265 | if (dmanr <= 3) { | ||
266 | dma_outb( phys & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); | ||
267 | dma_outb( (phys>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); | ||
268 | } else { | ||
269 | dma_outb( (phys>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); | ||
270 | dma_outb( (phys>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); | ||
271 | } | ||
272 | set_dma_page(dmanr, phys>>16); | ||
273 | } | ||
274 | |||
275 | |||
276 | /* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for | ||
277 | * a specific DMA channel. | ||
278 | * You must ensure the parameters are valid. | ||
279 | * NOTE: from a manual: "the number of transfers is one more | ||
280 | * than the initial word count"! This is taken into account. | ||
281 | * Assumes dma flip-flop is clear. | ||
282 | * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7. | ||
283 | */ | ||
284 | static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) | ||
285 | { | ||
286 | count--; | ||
287 | if (dmanr <= 3) { | ||
288 | dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); | ||
289 | dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); | ||
290 | } else { | ||
291 | dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); | ||
292 | dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); | ||
293 | } | ||
294 | } | ||
295 | |||
296 | |||
297 | /* Get DMA residue count. After a DMA transfer, this | ||
298 | * should return zero. Reading this while a DMA transfer is | ||
299 | * still in progress will return unpredictable results. | ||
300 | * If called before the channel has been used, it may return 1. | ||
301 | * Otherwise, it returns the number of _bytes_ left to transfer. | ||
302 | * | ||
303 | * Assumes DMA flip-flop is clear. | ||
304 | */ | ||
305 | static __inline__ int get_dma_residue(unsigned int dmanr) | ||
306 | { | ||
307 | unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE | ||
308 | : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE; | ||
309 | |||
310 | /* using short to get 16-bit wrap around */ | ||
311 | unsigned short count; | ||
312 | |||
313 | count = 1 + dma_inb(io_port); | ||
314 | count += dma_inb(io_port) << 8; | ||
315 | |||
316 | return (dmanr <= 3)? count : (count<<1); | ||
317 | } | ||
318 | |||
319 | /* These are in kernel/dma.c: */ | ||
320 | extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */ | ||
321 | extern void free_dma(unsigned int dmanr); /* release it again */ | ||
322 | |||
323 | #ifdef CONFIG_PCI | ||
324 | extern int isa_dma_bridge_buggy; | ||
325 | #else | ||
326 | #define isa_dma_bridge_buggy (0) | ||
327 | #endif | ||
328 | #endif /* !defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI) */ | ||
329 | #endif /* _ASM_DMA_H */ | ||
diff --git a/include/asm-ppc64/futex.h b/include/asm-ppc64/futex.h index cb2640b3a408..266b460de44e 100644 --- a/include/asm-ppc64/futex.h +++ b/include/asm-ppc64/futex.h | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | #include <linux/futex.h> | 6 | #include <linux/futex.h> |
7 | #include <asm/errno.h> | 7 | #include <asm/errno.h> |
8 | #include <asm/memory.h> | 8 | #include <asm/synch.h> |
9 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
10 | 10 | ||
11 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 11 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
diff --git a/include/asm-ppc64/hardirq.h b/include/asm-ppc64/hardirq.h deleted file mode 100644 index 4ee72bb1fd48..000000000000 --- a/include/asm-ppc64/hardirq.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #ifndef __ASM_HARDIRQ_H | ||
2 | #define __ASM_HARDIRQ_H | ||
3 | |||
4 | /* | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version | ||
8 | * 2 of the License, or (at your option) any later version. | ||
9 | */ | ||
10 | |||
11 | #include <linux/config.h> | ||
12 | #include <linux/cache.h> | ||
13 | #include <linux/preempt.h> | ||
14 | |||
15 | typedef struct { | ||
16 | unsigned int __softirq_pending; | ||
17 | } ____cacheline_aligned irq_cpustat_t; | ||
18 | |||
19 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | ||
20 | |||
21 | static inline void ack_bad_irq(int irq) | ||
22 | { | ||
23 | printk(KERN_CRIT "illegal vector %d received!\n", irq); | ||
24 | BUG(); | ||
25 | } | ||
26 | |||
27 | #endif /* __ASM_HARDIRQ_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h deleted file mode 100644 index 43a1969230b8..000000000000 --- a/include/asm-ppc64/iSeries/HvCallHpt.h +++ /dev/null | |||
@@ -1,102 +0,0 @@ | |||
1 | /* | ||
2 | * HvCallHpt.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVCALLHPT_H | ||
20 | #define _HVCALLHPT_H | ||
21 | |||
22 | /* | ||
23 | * This file contains the "hypervisor call" interface which is used to | ||
24 | * drive the hypervisor from the OS. | ||
25 | */ | ||
26 | |||
27 | #include <asm/iSeries/HvCallSc.h> | ||
28 | #include <asm/iSeries/HvTypes.h> | ||
29 | #include <asm/mmu.h> | ||
30 | |||
31 | #define HvCallHptGetHptAddress HvCallHpt + 0 | ||
32 | #define HvCallHptGetHptPages HvCallHpt + 1 | ||
33 | #define HvCallHptSetPp HvCallHpt + 5 | ||
34 | #define HvCallHptSetSwBits HvCallHpt + 6 | ||
35 | #define HvCallHptUpdate HvCallHpt + 7 | ||
36 | #define HvCallHptInvalidateNoSyncICache HvCallHpt + 8 | ||
37 | #define HvCallHptGet HvCallHpt + 11 | ||
38 | #define HvCallHptFindNextValid HvCallHpt + 12 | ||
39 | #define HvCallHptFindValid HvCallHpt + 13 | ||
40 | #define HvCallHptAddValidate HvCallHpt + 16 | ||
41 | #define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18 | ||
42 | |||
43 | |||
44 | static inline u64 HvCallHpt_getHptAddress(void) | ||
45 | { | ||
46 | return HvCall0(HvCallHptGetHptAddress); | ||
47 | } | ||
48 | |||
49 | static inline u64 HvCallHpt_getHptPages(void) | ||
50 | { | ||
51 | return HvCall0(HvCallHptGetHptPages); | ||
52 | } | ||
53 | |||
54 | static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value) | ||
55 | { | ||
56 | HvCall2(HvCallHptSetPp, hpteIndex, value); | ||
57 | } | ||
58 | |||
59 | static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff) | ||
60 | { | ||
61 | HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff); | ||
62 | } | ||
63 | |||
64 | static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex) | ||
65 | { | ||
66 | HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); | ||
67 | } | ||
68 | |||
69 | static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson, | ||
70 | u8 bitsoff) | ||
71 | { | ||
72 | u64 compressedStatus; | ||
73 | |||
74 | compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet, | ||
75 | hpteIndex, bitson, bitsoff, 1); | ||
76 | HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex); | ||
77 | return compressedStatus; | ||
78 | } | ||
79 | |||
80 | static inline u64 HvCallHpt_findValid(hpte_t *hpte, u64 vpn) | ||
81 | { | ||
82 | return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0); | ||
83 | } | ||
84 | |||
85 | static inline u64 HvCallHpt_findNextValid(hpte_t *hpte, u32 hpteIndex, | ||
86 | u8 bitson, u8 bitsoff) | ||
87 | { | ||
88 | return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex, | ||
89 | bitson, bitsoff); | ||
90 | } | ||
91 | |||
92 | static inline void HvCallHpt_get(hpte_t *hpte, u32 hpteIndex) | ||
93 | { | ||
94 | HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0); | ||
95 | } | ||
96 | |||
97 | static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, hpte_t *hpte) | ||
98 | { | ||
99 | HvCall4(HvCallHptAddValidate, hpteIndex, hBit, hpte->v, hpte->r); | ||
100 | } | ||
101 | |||
102 | #endif /* _HVCALLHPT_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallPci.h b/include/asm-ppc64/iSeries/HvCallPci.h deleted file mode 100644 index c8d675c40f5e..000000000000 --- a/include/asm-ppc64/iSeries/HvCallPci.h +++ /dev/null | |||
@@ -1,533 +0,0 @@ | |||
1 | /* | ||
2 | * Provides the Hypervisor PCI calls for iSeries Linux Parition. | ||
3 | * Copyright (C) 2001 <Wayne G Holm> <IBM Corporation> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the: | ||
17 | * Free Software Foundation, Inc., | ||
18 | * 59 Temple Place, Suite 330, | ||
19 | * Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | * Change Activity: | ||
22 | * Created, Jan 9, 2001 | ||
23 | */ | ||
24 | |||
25 | #ifndef _HVCALLPCI_H | ||
26 | #define _HVCALLPCI_H | ||
27 | |||
28 | #include <asm/iSeries/HvCallSc.h> | ||
29 | #include <asm/iSeries/HvTypes.h> | ||
30 | |||
31 | /* | ||
32 | * DSA == Direct Select Address | ||
33 | * this struct must be 64 bits in total | ||
34 | */ | ||
35 | struct HvCallPci_DsaAddr { | ||
36 | u16 busNumber; /* PHB index? */ | ||
37 | u8 subBusNumber; /* PCI bus number? */ | ||
38 | u8 deviceId; /* device and function? */ | ||
39 | u8 barNumber; | ||
40 | u8 reserved[3]; | ||
41 | }; | ||
42 | |||
43 | union HvDsaMap { | ||
44 | u64 DsaAddr; | ||
45 | struct HvCallPci_DsaAddr Dsa; | ||
46 | }; | ||
47 | |||
48 | struct HvCallPci_LoadReturn { | ||
49 | u64 rc; | ||
50 | u64 value; | ||
51 | }; | ||
52 | |||
53 | enum HvCallPci_DeviceType { | ||
54 | HvCallPci_NodeDevice = 1, | ||
55 | HvCallPci_SpDevice = 2, | ||
56 | HvCallPci_IopDevice = 3, | ||
57 | HvCallPci_BridgeDevice = 4, | ||
58 | HvCallPci_MultiFunctionDevice = 5, | ||
59 | HvCallPci_IoaDevice = 6 | ||
60 | }; | ||
61 | |||
62 | |||
63 | struct HvCallPci_DeviceInfo { | ||
64 | u32 deviceType; /* See DeviceType enum for values */ | ||
65 | }; | ||
66 | |||
67 | struct HvCallPci_BusUnitInfo { | ||
68 | u32 sizeReturned; /* length of data returned */ | ||
69 | u32 deviceType; /* see DeviceType enum for values */ | ||
70 | }; | ||
71 | |||
72 | struct HvCallPci_BridgeInfo { | ||
73 | struct HvCallPci_BusUnitInfo busUnitInfo; /* Generic bus unit info */ | ||
74 | u8 subBusNumber; /* Bus number of secondary bus */ | ||
75 | u8 maxAgents; /* Max idsels on secondary bus */ | ||
76 | u8 maxSubBusNumber; /* Max Sub Bus */ | ||
77 | u8 logicalSlotNumber; /* Logical Slot Number for IOA */ | ||
78 | }; | ||
79 | |||
80 | |||
81 | /* | ||
82 | * Maximum BusUnitInfo buffer size. Provided for clients so | ||
83 | * they can allocate a buffer big enough for any type of bus | ||
84 | * unit. Increase as needed. | ||
85 | */ | ||
86 | enum {HvCallPci_MaxBusUnitInfoSize = 128}; | ||
87 | |||
88 | struct HvCallPci_BarParms { | ||
89 | u64 vaddr; | ||
90 | u64 raddr; | ||
91 | u64 size; | ||
92 | u64 protectStart; | ||
93 | u64 protectEnd; | ||
94 | u64 relocationOffset; | ||
95 | u64 pciAddress; | ||
96 | u64 reserved[3]; | ||
97 | }; | ||
98 | |||
99 | enum HvCallPci_VpdType { | ||
100 | HvCallPci_BusVpd = 1, | ||
101 | HvCallPci_BusAdapterVpd = 2 | ||
102 | }; | ||
103 | |||
104 | #define HvCallPciConfigLoad8 HvCallPci + 0 | ||
105 | #define HvCallPciConfigLoad16 HvCallPci + 1 | ||
106 | #define HvCallPciConfigLoad32 HvCallPci + 2 | ||
107 | #define HvCallPciConfigStore8 HvCallPci + 3 | ||
108 | #define HvCallPciConfigStore16 HvCallPci + 4 | ||
109 | #define HvCallPciConfigStore32 HvCallPci + 5 | ||
110 | #define HvCallPciEoi HvCallPci + 16 | ||
111 | #define HvCallPciGetBarParms HvCallPci + 18 | ||
112 | #define HvCallPciMaskFisr HvCallPci + 20 | ||
113 | #define HvCallPciUnmaskFisr HvCallPci + 21 | ||
114 | #define HvCallPciSetSlotReset HvCallPci + 25 | ||
115 | #define HvCallPciGetDeviceInfo HvCallPci + 27 | ||
116 | #define HvCallPciGetCardVpd HvCallPci + 28 | ||
117 | #define HvCallPciBarLoad8 HvCallPci + 40 | ||
118 | #define HvCallPciBarLoad16 HvCallPci + 41 | ||
119 | #define HvCallPciBarLoad32 HvCallPci + 42 | ||
120 | #define HvCallPciBarLoad64 HvCallPci + 43 | ||
121 | #define HvCallPciBarStore8 HvCallPci + 44 | ||
122 | #define HvCallPciBarStore16 HvCallPci + 45 | ||
123 | #define HvCallPciBarStore32 HvCallPci + 46 | ||
124 | #define HvCallPciBarStore64 HvCallPci + 47 | ||
125 | #define HvCallPciMaskInterrupts HvCallPci + 48 | ||
126 | #define HvCallPciUnmaskInterrupts HvCallPci + 49 | ||
127 | #define HvCallPciGetBusUnitInfo HvCallPci + 50 | ||
128 | |||
129 | static inline u64 HvCallPci_configLoad8(u16 busNumber, u8 subBusNumber, | ||
130 | u8 deviceId, u32 offset, u8 *value) | ||
131 | { | ||
132 | struct HvCallPci_DsaAddr dsa; | ||
133 | struct HvCallPci_LoadReturn retVal; | ||
134 | |||
135 | *((u64*)&dsa) = 0; | ||
136 | |||
137 | dsa.busNumber = busNumber; | ||
138 | dsa.subBusNumber = subBusNumber; | ||
139 | dsa.deviceId = deviceId; | ||
140 | |||
141 | HvCall3Ret16(HvCallPciConfigLoad8, &retVal, *(u64 *)&dsa, offset, 0); | ||
142 | |||
143 | *value = retVal.value; | ||
144 | |||
145 | return retVal.rc; | ||
146 | } | ||
147 | |||
148 | static inline u64 HvCallPci_configLoad16(u16 busNumber, u8 subBusNumber, | ||
149 | u8 deviceId, u32 offset, u16 *value) | ||
150 | { | ||
151 | struct HvCallPci_DsaAddr dsa; | ||
152 | struct HvCallPci_LoadReturn retVal; | ||
153 | |||
154 | *((u64*)&dsa) = 0; | ||
155 | |||
156 | dsa.busNumber = busNumber; | ||
157 | dsa.subBusNumber = subBusNumber; | ||
158 | dsa.deviceId = deviceId; | ||
159 | |||
160 | HvCall3Ret16(HvCallPciConfigLoad16, &retVal, *(u64 *)&dsa, offset, 0); | ||
161 | |||
162 | *value = retVal.value; | ||
163 | |||
164 | return retVal.rc; | ||
165 | } | ||
166 | |||
167 | static inline u64 HvCallPci_configLoad32(u16 busNumber, u8 subBusNumber, | ||
168 | u8 deviceId, u32 offset, u32 *value) | ||
169 | { | ||
170 | struct HvCallPci_DsaAddr dsa; | ||
171 | struct HvCallPci_LoadReturn retVal; | ||
172 | |||
173 | *((u64*)&dsa) = 0; | ||
174 | |||
175 | dsa.busNumber = busNumber; | ||
176 | dsa.subBusNumber = subBusNumber; | ||
177 | dsa.deviceId = deviceId; | ||
178 | |||
179 | HvCall3Ret16(HvCallPciConfigLoad32, &retVal, *(u64 *)&dsa, offset, 0); | ||
180 | |||
181 | *value = retVal.value; | ||
182 | |||
183 | return retVal.rc; | ||
184 | } | ||
185 | |||
186 | static inline u64 HvCallPci_configStore8(u16 busNumber, u8 subBusNumber, | ||
187 | u8 deviceId, u32 offset, u8 value) | ||
188 | { | ||
189 | struct HvCallPci_DsaAddr dsa; | ||
190 | |||
191 | *((u64*)&dsa) = 0; | ||
192 | |||
193 | dsa.busNumber = busNumber; | ||
194 | dsa.subBusNumber = subBusNumber; | ||
195 | dsa.deviceId = deviceId; | ||
196 | |||
197 | return HvCall4(HvCallPciConfigStore8, *(u64 *)&dsa, offset, value, 0); | ||
198 | } | ||
199 | |||
200 | static inline u64 HvCallPci_configStore16(u16 busNumber, u8 subBusNumber, | ||
201 | u8 deviceId, u32 offset, u16 value) | ||
202 | { | ||
203 | struct HvCallPci_DsaAddr dsa; | ||
204 | |||
205 | *((u64*)&dsa) = 0; | ||
206 | |||
207 | dsa.busNumber = busNumber; | ||
208 | dsa.subBusNumber = subBusNumber; | ||
209 | dsa.deviceId = deviceId; | ||
210 | |||
211 | return HvCall4(HvCallPciConfigStore16, *(u64 *)&dsa, offset, value, 0); | ||
212 | } | ||
213 | |||
214 | static inline u64 HvCallPci_configStore32(u16 busNumber, u8 subBusNumber, | ||
215 | u8 deviceId, u32 offset, u32 value) | ||
216 | { | ||
217 | struct HvCallPci_DsaAddr dsa; | ||
218 | |||
219 | *((u64*)&dsa) = 0; | ||
220 | |||
221 | dsa.busNumber = busNumber; | ||
222 | dsa.subBusNumber = subBusNumber; | ||
223 | dsa.deviceId = deviceId; | ||
224 | |||
225 | return HvCall4(HvCallPciConfigStore32, *(u64 *)&dsa, offset, value, 0); | ||
226 | } | ||
227 | |||
228 | static inline u64 HvCallPci_barLoad8(u16 busNumberParm, u8 subBusParm, | ||
229 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
230 | u8 *valueParm) | ||
231 | { | ||
232 | struct HvCallPci_DsaAddr dsa; | ||
233 | struct HvCallPci_LoadReturn retVal; | ||
234 | |||
235 | *((u64*)&dsa) = 0; | ||
236 | |||
237 | dsa.busNumber = busNumberParm; | ||
238 | dsa.subBusNumber = subBusParm; | ||
239 | dsa.deviceId = deviceIdParm; | ||
240 | dsa.barNumber = barNumberParm; | ||
241 | |||
242 | HvCall3Ret16(HvCallPciBarLoad8, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
243 | |||
244 | *valueParm = retVal.value; | ||
245 | |||
246 | return retVal.rc; | ||
247 | } | ||
248 | |||
249 | static inline u64 HvCallPci_barLoad16(u16 busNumberParm, u8 subBusParm, | ||
250 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
251 | u16 *valueParm) | ||
252 | { | ||
253 | struct HvCallPci_DsaAddr dsa; | ||
254 | struct HvCallPci_LoadReturn retVal; | ||
255 | |||
256 | *((u64*)&dsa) = 0; | ||
257 | |||
258 | dsa.busNumber = busNumberParm; | ||
259 | dsa.subBusNumber = subBusParm; | ||
260 | dsa.deviceId = deviceIdParm; | ||
261 | dsa.barNumber = barNumberParm; | ||
262 | |||
263 | HvCall3Ret16(HvCallPciBarLoad16, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
264 | |||
265 | *valueParm = retVal.value; | ||
266 | |||
267 | return retVal.rc; | ||
268 | } | ||
269 | |||
270 | static inline u64 HvCallPci_barLoad32(u16 busNumberParm, u8 subBusParm, | ||
271 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
272 | u32 *valueParm) | ||
273 | { | ||
274 | struct HvCallPci_DsaAddr dsa; | ||
275 | struct HvCallPci_LoadReturn retVal; | ||
276 | |||
277 | *((u64*)&dsa) = 0; | ||
278 | |||
279 | dsa.busNumber = busNumberParm; | ||
280 | dsa.subBusNumber = subBusParm; | ||
281 | dsa.deviceId = deviceIdParm; | ||
282 | dsa.barNumber = barNumberParm; | ||
283 | |||
284 | HvCall3Ret16(HvCallPciBarLoad32, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
285 | |||
286 | *valueParm = retVal.value; | ||
287 | |||
288 | return retVal.rc; | ||
289 | } | ||
290 | |||
291 | static inline u64 HvCallPci_barLoad64(u16 busNumberParm, u8 subBusParm, | ||
292 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
293 | u64 *valueParm) | ||
294 | { | ||
295 | struct HvCallPci_DsaAddr dsa; | ||
296 | struct HvCallPci_LoadReturn retVal; | ||
297 | |||
298 | *((u64*)&dsa) = 0; | ||
299 | |||
300 | dsa.busNumber = busNumberParm; | ||
301 | dsa.subBusNumber = subBusParm; | ||
302 | dsa.deviceId = deviceIdParm; | ||
303 | dsa.barNumber = barNumberParm; | ||
304 | |||
305 | HvCall3Ret16(HvCallPciBarLoad64, &retVal, *(u64 *)&dsa, offsetParm, 0); | ||
306 | |||
307 | *valueParm = retVal.value; | ||
308 | |||
309 | return retVal.rc; | ||
310 | } | ||
311 | |||
312 | static inline u64 HvCallPci_barStore8(u16 busNumberParm, u8 subBusParm, | ||
313 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
314 | u8 valueParm) | ||
315 | { | ||
316 | struct HvCallPci_DsaAddr dsa; | ||
317 | |||
318 | *((u64*)&dsa) = 0; | ||
319 | |||
320 | dsa.busNumber = busNumberParm; | ||
321 | dsa.subBusNumber = subBusParm; | ||
322 | dsa.deviceId = deviceIdParm; | ||
323 | dsa.barNumber = barNumberParm; | ||
324 | |||
325 | return HvCall4(HvCallPciBarStore8, *(u64 *)&dsa, offsetParm, | ||
326 | valueParm, 0); | ||
327 | } | ||
328 | |||
329 | static inline u64 HvCallPci_barStore16(u16 busNumberParm, u8 subBusParm, | ||
330 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
331 | u16 valueParm) | ||
332 | { | ||
333 | struct HvCallPci_DsaAddr dsa; | ||
334 | |||
335 | *((u64*)&dsa) = 0; | ||
336 | |||
337 | dsa.busNumber = busNumberParm; | ||
338 | dsa.subBusNumber = subBusParm; | ||
339 | dsa.deviceId = deviceIdParm; | ||
340 | dsa.barNumber = barNumberParm; | ||
341 | |||
342 | return HvCall4(HvCallPciBarStore16, *(u64 *)&dsa, offsetParm, | ||
343 | valueParm, 0); | ||
344 | } | ||
345 | |||
346 | static inline u64 HvCallPci_barStore32(u16 busNumberParm, u8 subBusParm, | ||
347 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
348 | u32 valueParm) | ||
349 | { | ||
350 | struct HvCallPci_DsaAddr dsa; | ||
351 | |||
352 | *((u64*)&dsa) = 0; | ||
353 | |||
354 | dsa.busNumber = busNumberParm; | ||
355 | dsa.subBusNumber = subBusParm; | ||
356 | dsa.deviceId = deviceIdParm; | ||
357 | dsa.barNumber = barNumberParm; | ||
358 | |||
359 | return HvCall4(HvCallPciBarStore32, *(u64 *)&dsa, offsetParm, | ||
360 | valueParm, 0); | ||
361 | } | ||
362 | |||
363 | static inline u64 HvCallPci_barStore64(u16 busNumberParm, u8 subBusParm, | ||
364 | u8 deviceIdParm, u8 barNumberParm, u64 offsetParm, | ||
365 | u64 valueParm) | ||
366 | { | ||
367 | struct HvCallPci_DsaAddr dsa; | ||
368 | |||
369 | *((u64*)&dsa) = 0; | ||
370 | |||
371 | dsa.busNumber = busNumberParm; | ||
372 | dsa.subBusNumber = subBusParm; | ||
373 | dsa.deviceId = deviceIdParm; | ||
374 | dsa.barNumber = barNumberParm; | ||
375 | |||
376 | return HvCall4(HvCallPciBarStore64, *(u64 *)&dsa, offsetParm, | ||
377 | valueParm, 0); | ||
378 | } | ||
379 | |||
380 | static inline u64 HvCallPci_eoi(u16 busNumberParm, u8 subBusParm, | ||
381 | u8 deviceIdParm) | ||
382 | { | ||
383 | struct HvCallPci_DsaAddr dsa; | ||
384 | struct HvCallPci_LoadReturn retVal; | ||
385 | |||
386 | *((u64*)&dsa) = 0; | ||
387 | |||
388 | dsa.busNumber = busNumberParm; | ||
389 | dsa.subBusNumber = subBusParm; | ||
390 | dsa.deviceId = deviceIdParm; | ||
391 | |||
392 | HvCall1Ret16(HvCallPciEoi, &retVal, *(u64*)&dsa); | ||
393 | |||
394 | return retVal.rc; | ||
395 | } | ||
396 | |||
397 | static inline u64 HvCallPci_getBarParms(u16 busNumberParm, u8 subBusParm, | ||
398 | u8 deviceIdParm, u8 barNumberParm, u64 parms, u32 sizeofParms) | ||
399 | { | ||
400 | struct HvCallPci_DsaAddr dsa; | ||
401 | |||
402 | *((u64*)&dsa) = 0; | ||
403 | |||
404 | dsa.busNumber = busNumberParm; | ||
405 | dsa.subBusNumber = subBusParm; | ||
406 | dsa.deviceId = deviceIdParm; | ||
407 | dsa.barNumber = barNumberParm; | ||
408 | |||
409 | return HvCall3(HvCallPciGetBarParms, *(u64*)&dsa, parms, sizeofParms); | ||
410 | } | ||
411 | |||
412 | static inline u64 HvCallPci_maskFisr(u16 busNumberParm, u8 subBusParm, | ||
413 | u8 deviceIdParm, u64 fisrMask) | ||
414 | { | ||
415 | struct HvCallPci_DsaAddr dsa; | ||
416 | |||
417 | *((u64*)&dsa) = 0; | ||
418 | |||
419 | dsa.busNumber = busNumberParm; | ||
420 | dsa.subBusNumber = subBusParm; | ||
421 | dsa.deviceId = deviceIdParm; | ||
422 | |||
423 | return HvCall2(HvCallPciMaskFisr, *(u64*)&dsa, fisrMask); | ||
424 | } | ||
425 | |||
426 | static inline u64 HvCallPci_unmaskFisr(u16 busNumberParm, u8 subBusParm, | ||
427 | u8 deviceIdParm, u64 fisrMask) | ||
428 | { | ||
429 | struct HvCallPci_DsaAddr dsa; | ||
430 | |||
431 | *((u64*)&dsa) = 0; | ||
432 | |||
433 | dsa.busNumber = busNumberParm; | ||
434 | dsa.subBusNumber = subBusParm; | ||
435 | dsa.deviceId = deviceIdParm; | ||
436 | |||
437 | return HvCall2(HvCallPciUnmaskFisr, *(u64*)&dsa, fisrMask); | ||
438 | } | ||
439 | |||
440 | static inline u64 HvCallPci_setSlotReset(u16 busNumberParm, u8 subBusParm, | ||
441 | u8 deviceIdParm, u64 onNotOff) | ||
442 | { | ||
443 | struct HvCallPci_DsaAddr dsa; | ||
444 | |||
445 | *((u64*)&dsa) = 0; | ||
446 | |||
447 | dsa.busNumber = busNumberParm; | ||
448 | dsa.subBusNumber = subBusParm; | ||
449 | dsa.deviceId = deviceIdParm; | ||
450 | |||
451 | return HvCall2(HvCallPciSetSlotReset, *(u64*)&dsa, onNotOff); | ||
452 | } | ||
453 | |||
454 | static inline u64 HvCallPci_getDeviceInfo(u16 busNumberParm, u8 subBusParm, | ||
455 | u8 deviceNumberParm, u64 parms, u32 sizeofParms) | ||
456 | { | ||
457 | struct HvCallPci_DsaAddr dsa; | ||
458 | |||
459 | *((u64*)&dsa) = 0; | ||
460 | |||
461 | dsa.busNumber = busNumberParm; | ||
462 | dsa.subBusNumber = subBusParm; | ||
463 | dsa.deviceId = deviceNumberParm << 4; | ||
464 | |||
465 | return HvCall3(HvCallPciGetDeviceInfo, *(u64*)&dsa, parms, sizeofParms); | ||
466 | } | ||
467 | |||
468 | static inline u64 HvCallPci_maskInterrupts(u16 busNumberParm, u8 subBusParm, | ||
469 | u8 deviceIdParm, u64 interruptMask) | ||
470 | { | ||
471 | struct HvCallPci_DsaAddr dsa; | ||
472 | |||
473 | *((u64*)&dsa) = 0; | ||
474 | |||
475 | dsa.busNumber = busNumberParm; | ||
476 | dsa.subBusNumber = subBusParm; | ||
477 | dsa.deviceId = deviceIdParm; | ||
478 | |||
479 | return HvCall2(HvCallPciMaskInterrupts, *(u64*)&dsa, interruptMask); | ||
480 | } | ||
481 | |||
482 | static inline u64 HvCallPci_unmaskInterrupts(u16 busNumberParm, u8 subBusParm, | ||
483 | u8 deviceIdParm, u64 interruptMask) | ||
484 | { | ||
485 | struct HvCallPci_DsaAddr dsa; | ||
486 | |||
487 | *((u64*)&dsa) = 0; | ||
488 | |||
489 | dsa.busNumber = busNumberParm; | ||
490 | dsa.subBusNumber = subBusParm; | ||
491 | dsa.deviceId = deviceIdParm; | ||
492 | |||
493 | return HvCall2(HvCallPciUnmaskInterrupts, *(u64*)&dsa, interruptMask); | ||
494 | } | ||
495 | |||
496 | static inline u64 HvCallPci_getBusUnitInfo(u16 busNumberParm, u8 subBusParm, | ||
497 | u8 deviceIdParm, u64 parms, u32 sizeofParms) | ||
498 | { | ||
499 | struct HvCallPci_DsaAddr dsa; | ||
500 | |||
501 | *((u64*)&dsa) = 0; | ||
502 | |||
503 | dsa.busNumber = busNumberParm; | ||
504 | dsa.subBusNumber = subBusParm; | ||
505 | dsa.deviceId = deviceIdParm; | ||
506 | |||
507 | return HvCall3(HvCallPciGetBusUnitInfo, *(u64*)&dsa, parms, | ||
508 | sizeofParms); | ||
509 | } | ||
510 | |||
511 | static inline int HvCallPci_getBusVpd(u16 busNumParm, u64 destParm, | ||
512 | u16 sizeParm) | ||
513 | { | ||
514 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, | ||
515 | sizeParm, HvCallPci_BusVpd); | ||
516 | if (xRc == -1) | ||
517 | return -1; | ||
518 | else | ||
519 | return xRc & 0xFFFF; | ||
520 | } | ||
521 | |||
522 | static inline int HvCallPci_getBusAdapterVpd(u16 busNumParm, u64 destParm, | ||
523 | u16 sizeParm) | ||
524 | { | ||
525 | u64 xRc = HvCall4(HvCallPciGetCardVpd, busNumParm, destParm, | ||
526 | sizeParm, HvCallPci_BusAdapterVpd); | ||
527 | if (xRc == -1) | ||
528 | return -1; | ||
529 | else | ||
530 | return xRc & 0xFFFF; | ||
531 | } | ||
532 | |||
533 | #endif /* _HVCALLPCI_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvCallSm.h b/include/asm-ppc64/iSeries/HvCallSm.h deleted file mode 100644 index 8a3dbb071a43..000000000000 --- a/include/asm-ppc64/iSeries/HvCallSm.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * HvCallSm.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVCALLSM_H | ||
20 | #define _HVCALLSM_H | ||
21 | |||
22 | /* | ||
23 | * This file contains the "hypervisor call" interface which is used to | ||
24 | * drive the hypervisor from the OS. | ||
25 | */ | ||
26 | |||
27 | #include <asm/iSeries/HvCallSc.h> | ||
28 | #include <asm/iSeries/HvTypes.h> | ||
29 | |||
30 | #define HvCallSmGet64BitsOfAccessMap HvCallSm + 11 | ||
31 | |||
32 | static inline u64 HvCallSm_get64BitsOfAccessMap(HvLpIndex lpIndex, | ||
33 | u64 indexIntoBitMap) | ||
34 | { | ||
35 | return HvCall2(HvCallSmGet64BitsOfAccessMap, lpIndex, indexIntoBitMap); | ||
36 | } | ||
37 | |||
38 | #endif /* _HVCALLSM_H */ | ||
diff --git a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h deleted file mode 100644 index c8162e5ccb21..000000000000 --- a/include/asm-ppc64/iSeries/HvReleaseData.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * HvReleaseData.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _HVRELEASEDATA_H | ||
20 | #define _HVRELEASEDATA_H | ||
21 | |||
22 | /* | ||
23 | * This control block contains the critical information about the | ||
24 | * release so that it can be changed in the future (ie, the virtual | ||
25 | * address of the OS's NACA). | ||
26 | */ | ||
27 | #include <asm/types.h> | ||
28 | #include <asm/naca.h> | ||
29 | |||
30 | /* | ||
31 | * When we IPL a secondary partition, we will check if if the | ||
32 | * secondary xMinPlicVrmIndex > the primary xVrmIndex. | ||
33 | * If it is then this tells PLIC that this secondary is not | ||
34 | * supported running on this "old" of a level of PLIC. | ||
35 | * | ||
36 | * Likewise, we will compare the primary xMinSlicVrmIndex to | ||
37 | * the secondary xVrmIndex. | ||
38 | * If the primary xMinSlicVrmDelta > secondary xVrmDelta then we | ||
39 | * know that this PLIC does not support running an OS "that old". | ||
40 | */ | ||
41 | |||
42 | #define HVREL_TAGSINACTIVE 0x8000 | ||
43 | #define HVREL_32BIT 0x4000 | ||
44 | #define HVREL_NOSHAREDPROCS 0x2000 | ||
45 | #define HVREL_NOHMT 0x1000 | ||
46 | |||
47 | struct HvReleaseData { | ||
48 | u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */ | ||
49 | u16 xSize; /* Size of this control block x04-x05 */ | ||
50 | u16 xVpdAreasPtrOffset; /* Offset in NACA of ItVpdAreas x06-x07 */ | ||
51 | struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */ | ||
52 | u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */ | ||
53 | u32 xRsvd1; /* Reserved x14-x17 */ | ||
54 | u16 xFlags; | ||
55 | u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */ | ||
56 | u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */ | ||
57 | u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */ | ||
58 | char xVrmName[12]; /* Displayable name x20-x2B */ | ||
59 | char xRsvd3[20]; /* Reserved x2C-x3F */ | ||
60 | }; | ||
61 | |||
62 | extern struct HvReleaseData hvReleaseData; | ||
63 | |||
64 | #endif /* _HVRELEASEDATA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/IoHriMainStore.h b/include/asm-ppc64/iSeries/IoHriMainStore.h deleted file mode 100644 index 45ed3ea67d06..000000000000 --- a/include/asm-ppc64/iSeries/IoHriMainStore.h +++ /dev/null | |||
@@ -1,166 +0,0 @@ | |||
1 | /* | ||
2 | * IoHriMainStore.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef _IOHRIMAINSTORE_H | ||
21 | #define _IOHRIMAINSTORE_H | ||
22 | |||
23 | /* Main Store Vpd for Condor,iStar,sStar */ | ||
24 | struct IoHriMainStoreSegment4 { | ||
25 | u8 msArea0Exists:1; | ||
26 | u8 msArea1Exists:1; | ||
27 | u8 msArea2Exists:1; | ||
28 | u8 msArea3Exists:1; | ||
29 | u8 reserved1:4; | ||
30 | u8 reserved2; | ||
31 | |||
32 | u8 msArea0Functional:1; | ||
33 | u8 msArea1Functional:1; | ||
34 | u8 msArea2Functional:1; | ||
35 | u8 msArea3Functional:1; | ||
36 | u8 reserved3:4; | ||
37 | u8 reserved4; | ||
38 | |||
39 | u32 totalMainStore; | ||
40 | |||
41 | u64 msArea0Ptr; | ||
42 | u64 msArea1Ptr; | ||
43 | u64 msArea2Ptr; | ||
44 | u64 msArea3Ptr; | ||
45 | |||
46 | u32 cardProductionLevel; | ||
47 | |||
48 | u32 msAdrHole; | ||
49 | |||
50 | u8 msArea0HasRiserVpd:1; | ||
51 | u8 msArea1HasRiserVpd:1; | ||
52 | u8 msArea2HasRiserVpd:1; | ||
53 | u8 msArea3HasRiserVpd:1; | ||
54 | u8 reserved5:4; | ||
55 | u8 reserved6; | ||
56 | u16 reserved7; | ||
57 | |||
58 | u8 reserved8[28]; | ||
59 | |||
60 | u64 nonInterleavedBlocksStartAdr; | ||
61 | u64 nonInterleavedBlocksEndAdr; | ||
62 | }; | ||
63 | |||
64 | /* Main Store VPD for Power4 */ | ||
65 | struct IoHriMainStoreChipInfo1 { | ||
66 | u32 chipMfgID __attribute((packed)); | ||
67 | char chipECLevel[4] __attribute((packed)); | ||
68 | }; | ||
69 | |||
70 | struct IoHriMainStoreVpdIdData { | ||
71 | char typeNumber[4]; | ||
72 | char modelNumber[4]; | ||
73 | char partNumber[12]; | ||
74 | char serialNumber[12]; | ||
75 | }; | ||
76 | |||
77 | struct IoHriMainStoreVpdFruData { | ||
78 | char fruLabel[8] __attribute((packed)); | ||
79 | u8 numberOfSlots __attribute((packed)); | ||
80 | u8 pluggingType __attribute((packed)); | ||
81 | u16 slotMapIndex __attribute((packed)); | ||
82 | }; | ||
83 | |||
84 | struct IoHriMainStoreAdrRangeBlock { | ||
85 | void *blockStart __attribute((packed)); | ||
86 | void *blockEnd __attribute((packed)); | ||
87 | u32 blockProcChipId __attribute((packed)); | ||
88 | }; | ||
89 | |||
90 | #define MaxAreaAdrRangeBlocks 4 | ||
91 | |||
92 | struct IoHriMainStoreArea4 { | ||
93 | u32 msVpdFormat __attribute((packed)); | ||
94 | u8 containedVpdType __attribute((packed)); | ||
95 | u8 reserved1 __attribute((packed)); | ||
96 | u16 reserved2 __attribute((packed)); | ||
97 | |||
98 | u64 msExists __attribute((packed)); | ||
99 | u64 msFunctional __attribute((packed)); | ||
100 | |||
101 | u32 memorySize __attribute((packed)); | ||
102 | u32 procNodeId __attribute((packed)); | ||
103 | |||
104 | u32 numAdrRangeBlocks __attribute((packed)); | ||
105 | struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed)); | ||
106 | |||
107 | struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed)); | ||
108 | struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed)); | ||
109 | struct IoHriMainStoreChipInfo1 chipInfo2 __attribute((packed)); | ||
110 | struct IoHriMainStoreChipInfo1 chipInfo3 __attribute((packed)); | ||
111 | struct IoHriMainStoreChipInfo1 chipInfo4 __attribute((packed)); | ||
112 | struct IoHriMainStoreChipInfo1 chipInfo5 __attribute((packed)); | ||
113 | struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed)); | ||
114 | struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed)); | ||
115 | |||
116 | void *msRamAreaArray __attribute((packed)); | ||
117 | u32 msRamAreaArrayNumEntries __attribute((packed)); | ||
118 | u32 msRamAreaArrayEntrySize __attribute((packed)); | ||
119 | |||
120 | u32 numaDimmExists __attribute((packed)); | ||
121 | u32 numaDimmFunctional __attribute((packed)); | ||
122 | void *numaDimmArray __attribute((packed)); | ||
123 | u32 numaDimmArrayNumEntries __attribute((packed)); | ||
124 | u32 numaDimmArrayEntrySize __attribute((packed)); | ||
125 | |||
126 | struct IoHriMainStoreVpdIdData idData __attribute((packed)); | ||
127 | |||
128 | u64 powerData __attribute((packed)); | ||
129 | u64 cardAssemblyPartNum __attribute((packed)); | ||
130 | u64 chipSerialNum __attribute((packed)); | ||
131 | |||
132 | u64 reserved3 __attribute((packed)); | ||
133 | char reserved4[16] __attribute((packed)); | ||
134 | |||
135 | struct IoHriMainStoreVpdFruData fruData __attribute((packed)); | ||
136 | |||
137 | u8 vpdPortNum __attribute((packed)); | ||
138 | u8 reserved5 __attribute((packed)); | ||
139 | u8 frameId __attribute((packed)); | ||
140 | u8 rackUnit __attribute((packed)); | ||
141 | char asciiKeywordVpd[256] __attribute((packed)); | ||
142 | u32 reserved6 __attribute((packed)); | ||
143 | }; | ||
144 | |||
145 | |||
146 | struct IoHriMainStoreSegment5 { | ||
147 | u16 reserved1; | ||
148 | u8 reserved2; | ||
149 | u8 msVpdFormat; | ||
150 | |||
151 | u32 totalMainStore; | ||
152 | u64 maxConfiguredMsAdr; | ||
153 | |||
154 | struct IoHriMainStoreArea4 *msAreaArray; | ||
155 | u32 msAreaArrayNumEntries; | ||
156 | u32 msAreaArrayEntrySize; | ||
157 | |||
158 | u32 msAreaExists; | ||
159 | u32 msAreaFunctional; | ||
160 | |||
161 | u64 reserved3; | ||
162 | }; | ||
163 | |||
164 | extern u64 xMsVpd[]; | ||
165 | |||
166 | #endif /* _IOHRIMAINSTORE_H */ | ||
diff --git a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h b/include/asm-ppc64/iSeries/IoHriProcessorVpd.h deleted file mode 100644 index 73b73d80b8b1..000000000000 --- a/include/asm-ppc64/iSeries/IoHriProcessorVpd.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * IoHriProcessorVpd.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _IOHRIPROCESSORVPD_H | ||
20 | #define _IOHRIPROCESSORVPD_H | ||
21 | |||
22 | #include <asm/types.h> | ||
23 | |||
24 | /* | ||
25 | * This struct maps Processor Vpd that is DMAd to SLIC by CSP | ||
26 | */ | ||
27 | struct IoHriProcessorVpd { | ||
28 | u8 xFormat; // VPD format indicator x00-x00 | ||
29 | u8 xProcStatus:8; // Processor State x01-x01 | ||
30 | u8 xSecondaryThreadCount; // Secondary thread cnt x02-x02 | ||
31 | u8 xSrcType:1; // Src Type x03-x03 | ||
32 | u8 xSrcSoft:1; // Src stay soft ... | ||
33 | u8 xSrcParable:1; // Src parable ... | ||
34 | u8 xRsvd1:5; // Reserved ... | ||
35 | u16 xHvPhysicalProcIndex; // Hypervisor physical proc index04-x05 | ||
36 | u16 xRsvd2; // Reserved x06-x07 | ||
37 | u32 xHwNodeId; // Hardware node id x08-x0B | ||
38 | u32 xHwProcId; // Hardware processor id x0C-x0F | ||
39 | |||
40 | u32 xTypeNum; // Card Type/CCIN number x10-x13 | ||
41 | u32 xModelNum; // Model/Feature number x14-x17 | ||
42 | u64 xSerialNum; // Serial number x18-x1F | ||
43 | char xPartNum[12]; // Book Part or FPU number x20-x2B | ||
44 | char xMfgID[4]; // Manufacturing ID x2C-x2F | ||
45 | |||
46 | u32 xProcFreq; // Processor Frequency x30-x33 | ||
47 | u32 xTimeBaseFreq; // Time Base Frequency x34-x37 | ||
48 | |||
49 | u32 xChipEcLevel; // Chip EC Levels x38-x3B | ||
50 | u32 xProcIdReg; // PIR SPR value x3C-x3F | ||
51 | u32 xPVR; // PVR value x40-x43 | ||
52 | u8 xRsvd3[12]; // Reserved x44-x4F | ||
53 | |||
54 | u32 xInstCacheSize; // Instruction cache size in KB x50-x53 | ||
55 | u32 xInstBlockSize; // Instruction cache block size x54-x57 | ||
56 | u32 xDataCacheOperandSize; // Data cache operand size x58-x5B | ||
57 | u32 xInstCacheOperandSize; // Inst cache operand size x5C-x5F | ||
58 | |||
59 | u32 xDataL1CacheSizeKB; // L1 data cache size in KB x60-x63 | ||
60 | u32 xDataL1CacheLineSize; // L1 data cache block size x64-x67 | ||
61 | u64 xRsvd4; // Reserved x68-x6F | ||
62 | |||
63 | u32 xDataL2CacheSizeKB; // L2 data cache size in KB x70-x73 | ||
64 | u32 xDataL2CacheLineSize; // L2 data cache block size x74-x77 | ||
65 | u64 xRsvd5; // Reserved x78-x7F | ||
66 | |||
67 | u32 xDataL3CacheSizeKB; // L3 data cache size in KB x80-x83 | ||
68 | u32 xDataL3CacheLineSize; // L3 data cache block size x84-x87 | ||
69 | u64 xRsvd6; // Reserved x88-x8F | ||
70 | |||
71 | u64 xFruLabel; // Card Location Label x90-x97 | ||
72 | u8 xSlotsOnCard; // Slots on card (0=no slots) x98-x98 | ||
73 | u8 xPartLocFlag; // Location flag (0-pluggable 1-imbedded) x99-x99 | ||
74 | u16 xSlotMapIndex; // Index in slot map table x9A-x9B | ||
75 | u8 xSmartCardPortNo; // Smart card port number x9C-x9C | ||
76 | u8 xRsvd7; // Reserved x9D-x9D | ||
77 | u16 xFrameIdAndRackUnit; // Frame ID and rack unit adr x9E-x9F | ||
78 | |||
79 | u8 xRsvd8[24]; // Reserved xA0-xB7 | ||
80 | |||
81 | char xProcSrc[72]; // CSP format SRC xB8-xFF | ||
82 | }; | ||
83 | |||
84 | extern struct IoHriProcessorVpd xIoHriProcessorVpd[]; | ||
85 | |||
86 | #endif /* _IOHRIPROCESSORVPD_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItIplParmsReal.h b/include/asm-ppc64/iSeries/ItIplParmsReal.h deleted file mode 100644 index ae3417dc599e..000000000000 --- a/include/asm-ppc64/iSeries/ItIplParmsReal.h +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * ItIplParmsReal.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITIPLPARMSREAL_H | ||
20 | #define _ITIPLPARMSREAL_H | ||
21 | |||
22 | /* | ||
23 | * This struct maps the IPL Parameters DMA'd from the SP. | ||
24 | * | ||
25 | * Warning: | ||
26 | * This data must map in exactly 64 bytes and match the architecture for | ||
27 | * the IPL parms | ||
28 | */ | ||
29 | |||
30 | #include <asm/types.h> | ||
31 | |||
32 | struct ItIplParmsReal { | ||
33 | u8 xFormat; // Defines format of IplParms x00-x00 | ||
34 | u8 xRsvd01:6; // Reserved x01-x01 | ||
35 | u8 xAlternateSearch:1; // Alternate search indicator ... | ||
36 | u8 xUaSupplied:1; // UA Supplied on programmed IPL... | ||
37 | u8 xLsUaFormat; // Format byte for UA x02-x02 | ||
38 | u8 xRsvd02; // Reserved x03-x03 | ||
39 | u32 xLsUa; // LS UA x04-x07 | ||
40 | u32 xUnusedLsLid; // First OS LID to load x08-x0B | ||
41 | u16 xLsBusNumber; // LS Bus Number x0C-x0D | ||
42 | u8 xLsCardAdr; // LS Card Address x0E-x0E | ||
43 | u8 xLsBoardAdr; // LS Board Address x0F-x0F | ||
44 | u32 xRsvd03; // Reserved x10-x13 | ||
45 | u8 xSpcnPresent:1; // SPCN present x14-x14 | ||
46 | u8 xCpmPresent:1; // CPM present ... | ||
47 | u8 xRsvd04:6; // Reserved ... | ||
48 | u8 xRsvd05:4; // Reserved x15-x15 | ||
49 | u8 xKeyLock:4; // Keylock setting ... | ||
50 | u8 xRsvd06:6; // Reserved x16-x16 | ||
51 | u8 xIplMode:2; // Ipl mode (A|B|C|D) ... | ||
52 | u8 xHwIplType; // Fast v slow v slow EC HW IPL x17-x17 | ||
53 | u16 xCpmEnabledIpl:1; // CPM in effect when IPL initiatedx18-x19 | ||
54 | u16 xPowerOnResetIpl:1; // Indicate POR condition ... | ||
55 | u16 xMainStorePreserved:1; // Main Storage is preserved ... | ||
56 | u16 xRsvd07:13; // Reserved ... | ||
57 | u16 xIplSource:16; // Ipl source x1A-x1B | ||
58 | u8 xIplReason:8; // Reason for this IPL x1C-x1C | ||
59 | u8 xRsvd08; // Reserved x1D-x1D | ||
60 | u16 xRsvd09; // Reserved x1E-x1F | ||
61 | u16 xSysBoxType; // System Box Type x20-x21 | ||
62 | u16 xSysProcType; // System Processor Type x22-x23 | ||
63 | u32 xRsvd10; // Reserved x24-x27 | ||
64 | u64 xRsvd11; // Reserved x28-x2F | ||
65 | u64 xRsvd12; // Reserved x30-x37 | ||
66 | u64 xRsvd13; // Reserved x38-x3F | ||
67 | }; | ||
68 | |||
69 | extern struct ItIplParmsReal xItIplParmsReal; | ||
70 | |||
71 | #endif /* _ITIPLPARMSREAL_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItSpCommArea.h b/include/asm-ppc64/iSeries/ItSpCommArea.h deleted file mode 100644 index 5535f8271c9f..000000000000 --- a/include/asm-ppc64/iSeries/ItSpCommArea.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * ItSpCommArea.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef _ITSPCOMMAREA_H | ||
21 | #define _ITSPCOMMAREA_H | ||
22 | |||
23 | |||
24 | struct SpCommArea { | ||
25 | u32 xDesc; // Descriptor (only in new formats) 000-003 | ||
26 | u8 xFormat; // Format (only in new formats) 004-004 | ||
27 | u8 xRsvd1[11]; // Reserved 005-00F | ||
28 | u64 xRawTbAtIplStart; // Raw HW TB value when IPL is started 010-017 | ||
29 | u64 xRawTodAtIplStart; // Raw HW TOD value when IPL is started 018-01F | ||
30 | u64 xBcdTimeAtIplStart; // BCD time when IPL is started 020-027 | ||
31 | u64 xBcdTimeAtOsStart; // BCD time when OS passed control 028-02F | ||
32 | u8 xRsvd2[80]; // Reserved 030-07F | ||
33 | }; | ||
34 | |||
35 | extern struct SpCommArea xSpCommArea; | ||
36 | |||
37 | #endif /* _ITSPCOMMAREA_H */ | ||
diff --git a/include/asm-ppc64/iSeries/ItVpdAreas.h b/include/asm-ppc64/iSeries/ItVpdAreas.h deleted file mode 100644 index 71b3ad24f95a..000000000000 --- a/include/asm-ppc64/iSeries/ItVpdAreas.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | /* | ||
2 | * ItVpdAreas.h | ||
3 | * Copyright (C) 2001 Mike Corrigan IBM Corporation | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | #ifndef _ITVPDAREAS_H | ||
20 | #define _ITVPDAREAS_H | ||
21 | |||
22 | /* | ||
23 | * This file defines the address and length of all of the VPD area passed to | ||
24 | * the OS from PLIC (most of which start from the SP). | ||
25 | */ | ||
26 | |||
27 | #include <asm/types.h> | ||
28 | |||
29 | /* VPD Entry index is carved in stone - cannot be changed (easily). */ | ||
30 | #define ItVpdCecVpd 0 | ||
31 | #define ItVpdDynamicSpace 1 | ||
32 | #define ItVpdExtVpd 2 | ||
33 | #define ItVpdExtVpdOnPanel 3 | ||
34 | #define ItVpdFirstPaca 4 | ||
35 | #define ItVpdIoVpd 5 | ||
36 | #define ItVpdIplParms 6 | ||
37 | #define ItVpdMsVpd 7 | ||
38 | #define ItVpdPanelVpd 8 | ||
39 | #define ItVpdLpNaca 9 | ||
40 | #define ItVpdBackplaneAndMaybeClockCardVpd 10 | ||
41 | #define ItVpdRecoveryLogBuffer 11 | ||
42 | #define ItVpdSpCommArea 12 | ||
43 | #define ItVpdSpLogBuffer 13 | ||
44 | #define ItVpdSpLogBufferSave 14 | ||
45 | #define ItVpdSpCardVpd 15 | ||
46 | #define ItVpdFirstProcVpd 16 | ||
47 | #define ItVpdApModelVpd 17 | ||
48 | #define ItVpdClockCardVpd 18 | ||
49 | #define ItVpdBusExtCardVpd 19 | ||
50 | #define ItVpdProcCapacityVpd 20 | ||
51 | #define ItVpdInteractiveCapacityVpd 21 | ||
52 | #define ItVpdFirstSlotLabel 22 | ||
53 | #define ItVpdFirstLpQueue 23 | ||
54 | #define ItVpdFirstL3CacheVpd 24 | ||
55 | #define ItVpdFirstProcFruVpd 25 | ||
56 | |||
57 | #define ItVpdMaxEntries 26 | ||
58 | |||
59 | #define ItDmaMaxEntries 10 | ||
60 | |||
61 | #define ItVpdAreasMaxSlotLabels 192 | ||
62 | |||
63 | |||
64 | struct ItVpdAreas { | ||
65 | u32 xSlicDesc; // Descriptor 000-003 | ||
66 | u16 xSlicSize; // Size of this control block 004-005 | ||
67 | u16 xPlicAdjustVpdLens:1; // Flag to indicate new interface006-007 | ||
68 | u16 xRsvd1:15; // Reserved bits ... | ||
69 | u16 xSlicVpdEntries; // Number of VPD entries 008-009 | ||
70 | u16 xSlicDmaEntries; // Number of DMA entries 00A-00B | ||
71 | u16 xSlicMaxLogicalProcs; // Maximum logical processors 00C-00D | ||
72 | u16 xSlicMaxPhysicalProcs; // Maximum physical processors 00E-00F | ||
73 | u16 xSlicDmaToksOffset; // Offset into this of array 010-011 | ||
74 | u16 xSlicVpdAdrsOffset; // Offset into this of array 012-013 | ||
75 | u16 xSlicDmaLensOffset; // Offset into this of array 014-015 | ||
76 | u16 xSlicVpdLensOffset; // Offset into this of array 016-017 | ||
77 | u16 xSlicMaxSlotLabels; // Maximum number of slot labels018-019 | ||
78 | u16 xSlicMaxLpQueues; // Maximum number of LP Queues 01A-01B | ||
79 | u8 xRsvd2[4]; // Reserved 01C-01F | ||
80 | u64 xRsvd3[12]; // Reserved 020-07F | ||
81 | u32 xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths 080-0A7 | ||
82 | u32 xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens 0A8-0CF | ||
83 | u32 xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths 0D0-12F | ||
84 | void *xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers 130-1EF | ||
85 | }; | ||
86 | |||
87 | extern struct ItVpdAreas itVpdAreas; | ||
88 | |||
89 | #endif /* _ITVPDAREAS_H */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_irq.h b/include/asm-ppc64/iSeries/iSeries_irq.h deleted file mode 100644 index 6c9767ac1302..000000000000 --- a/include/asm-ppc64/iSeries/iSeries_irq.h +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #ifndef __ISERIES_IRQ_H__ | ||
2 | #define __ISERIES_IRQ_H__ | ||
3 | |||
4 | extern void iSeries_init_IRQ(void); | ||
5 | extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, HvAgentId); | ||
6 | extern void iSeries_activate_IRQs(void); | ||
7 | |||
8 | #endif /* __ISERIES_IRQ_H__ */ | ||
diff --git a/include/asm-ppc64/iSeries/iSeries_pci.h b/include/asm-ppc64/iSeries/iSeries_pci.h deleted file mode 100644 index 575f611f8b33..000000000000 --- a/include/asm-ppc64/iSeries/iSeries_pci.h +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | #ifndef _ISERIES_64_PCI_H | ||
2 | #define _ISERIES_64_PCI_H | ||
3 | |||
4 | /* | ||
5 | * File iSeries_pci.h created by Allan Trautman on Tue Feb 20, 2001. | ||
6 | * | ||
7 | * Define some useful macros for the iSeries pci routines. | ||
8 | * Copyright (C) 2001 Allan H Trautman, IBM Corporation | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the: | ||
22 | * Free Software Foundation, Inc., | ||
23 | * 59 Temple Place, Suite 330, | ||
24 | * Boston, MA 02111-1307 USA | ||
25 | * | ||
26 | * Change Activity: | ||
27 | * Created Feb 20, 2001 | ||
28 | * Added device reset, March 22, 2001 | ||
29 | * Ported to ppc64, May 25, 2001 | ||
30 | * End Change Activity | ||
31 | */ | ||
32 | |||
33 | #include <asm/iSeries/HvCallPci.h> | ||
34 | #include <asm/abs_addr.h> | ||
35 | |||
36 | struct pci_dev; /* For Forward Reference */ | ||
37 | struct iSeries_Device_Node; | ||
38 | |||
39 | /* | ||
40 | * Gets iSeries Bus, SubBus, DevFn using iSeries_Device_Node structure | ||
41 | */ | ||
42 | |||
43 | #define ISERIES_BUS(DevPtr) DevPtr->DsaAddr.Dsa.busNumber | ||
44 | #define ISERIES_SUBBUS(DevPtr) DevPtr->DsaAddr.Dsa.subBusNumber | ||
45 | #define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.Dsa.deviceId | ||
46 | #define ISERIES_DSA(DevPtr) DevPtr->DsaAddr.DsaAddr | ||
47 | #define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node *)PciDev->sysdata) | ||
48 | |||
49 | #define EADsMaxAgents 7 | ||
50 | |||
51 | /* | ||
52 | * Decodes Linux DevFn to iSeries DevFn, bridge device, or function. | ||
53 | * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h | ||
54 | */ | ||
55 | |||
56 | #define ISERIES_PCI_AGENTID(idsel, func) \ | ||
57 | (((idsel & 0x0F) << 4) | (func & 0x07)) | ||
58 | #define ISERIES_ENCODE_DEVICE(agentid) \ | ||
59 | ((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07)) | ||
60 | |||
61 | #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7) | ||
62 | #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7) | ||
63 | |||
64 | /* | ||
65 | * Converts Virtual Address to Real Address for Hypervisor calls | ||
66 | */ | ||
67 | #define ISERIES_HV_ADDR(virtaddr) \ | ||
68 | (0x8000000000000000 | virt_to_abs(virtaddr)) | ||
69 | |||
70 | /* | ||
71 | * iSeries Device Information | ||
72 | */ | ||
73 | struct iSeries_Device_Node { | ||
74 | struct list_head Device_List; | ||
75 | struct pci_dev *PciDev; | ||
76 | union HvDsaMap DsaAddr; /* Direct Select Address */ | ||
77 | /* busNumber, subBusNumber, */ | ||
78 | /* deviceId, barNumber */ | ||
79 | int DevFn; /* Linux devfn */ | ||
80 | int Irq; /* Assigned IRQ */ | ||
81 | int Flags; /* Possible flags(disable/bist)*/ | ||
82 | u8 LogicalSlot; /* Hv Slot Index for Tces */ | ||
83 | struct iommu_table *iommu_table;/* Device TCE Table */ | ||
84 | }; | ||
85 | |||
86 | extern void iSeries_Device_Information(struct pci_dev*, int); | ||
87 | |||
88 | #endif /* _ISERIES_64_PCI_H */ | ||
diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h index 59c958aea4db..bd7c9532d77b 100644 --- a/include/asm-ppc64/io.h +++ b/include/asm-ppc64/io.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #ifdef CONFIG_PPC_ISERIES | 15 | #ifdef CONFIG_PPC_ISERIES |
16 | #include <asm/iSeries/iSeries_io.h> | 16 | #include <asm/iSeries/iSeries_io.h> |
17 | #endif | 17 | #endif |
18 | #include <asm/memory.h> | 18 | #include <asm/synch.h> |
19 | #include <asm/delay.h> | 19 | #include <asm/delay.h> |
20 | 20 | ||
21 | #include <asm-generic/iomap.h> | 21 | #include <asm-generic/iomap.h> |
diff --git a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h deleted file mode 100644 index 99782afb4cde..000000000000 --- a/include/asm-ppc64/irq.h +++ /dev/null | |||
@@ -1,120 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _ASM_IRQ_H | ||
3 | #define _ASM_IRQ_H | ||
4 | |||
5 | /* | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/config.h> | ||
13 | #include <linux/threads.h> | ||
14 | |||
15 | /* | ||
16 | * Maximum number of interrupt sources that we can handle. | ||
17 | */ | ||
18 | #define NR_IRQS 512 | ||
19 | |||
20 | /* this number is used when no interrupt has been assigned */ | ||
21 | #define NO_IRQ (-1) | ||
22 | |||
23 | /* | ||
24 | * These constants are used for passing information about interrupt | ||
25 | * signal polarity and level/edge sensing to the low-level PIC chip | ||
26 | * drivers. | ||
27 | */ | ||
28 | #define IRQ_SENSE_MASK 0x1 | ||
29 | #define IRQ_SENSE_LEVEL 0x1 /* interrupt on active level */ | ||
30 | #define IRQ_SENSE_EDGE 0x0 /* interrupt triggered by edge */ | ||
31 | |||
32 | #define IRQ_POLARITY_MASK 0x2 | ||
33 | #define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ | ||
34 | #define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ | ||
35 | |||
36 | /* | ||
37 | * IRQ line status macro IRQ_PER_CPU is used | ||
38 | */ | ||
39 | #define ARCH_HAS_IRQ_PER_CPU | ||
40 | |||
41 | #define get_irq_desc(irq) (&irq_desc[(irq)]) | ||
42 | |||
43 | /* Define a way to iterate across irqs. */ | ||
44 | #define for_each_irq(i) \ | ||
45 | for ((i) = 0; (i) < NR_IRQS; ++(i)) | ||
46 | |||
47 | /* Interrupt numbers are virtual in case they are sparsely | ||
48 | * distributed by the hardware. | ||
49 | */ | ||
50 | extern unsigned int virt_irq_to_real_map[NR_IRQS]; | ||
51 | |||
52 | /* Create a mapping for a real_irq if it doesn't already exist. | ||
53 | * Return the virtual irq as a convenience. | ||
54 | */ | ||
55 | int virt_irq_create_mapping(unsigned int real_irq); | ||
56 | void virt_irq_init(void); | ||
57 | |||
58 | static inline unsigned int virt_irq_to_real(unsigned int virt_irq) | ||
59 | { | ||
60 | return virt_irq_to_real_map[virt_irq]; | ||
61 | } | ||
62 | |||
63 | extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq); | ||
64 | |||
65 | /* | ||
66 | * Because many systems have two overlapping names spaces for | ||
67 | * interrupts (ISA and XICS for example), and the ISA interrupts | ||
68 | * have historically not been easy to renumber, we allow ISA | ||
69 | * interrupts to take values 0 - 15, and shift up the remaining | ||
70 | * interrupts by 0x10. | ||
71 | */ | ||
72 | #define NUM_ISA_INTERRUPTS 0x10 | ||
73 | extern int __irq_offset_value; | ||
74 | |||
75 | static inline int irq_offset_up(int irq) | ||
76 | { | ||
77 | return(irq + __irq_offset_value); | ||
78 | } | ||
79 | |||
80 | static inline int irq_offset_down(int irq) | ||
81 | { | ||
82 | return(irq - __irq_offset_value); | ||
83 | } | ||
84 | |||
85 | static inline int irq_offset_value(void) | ||
86 | { | ||
87 | return __irq_offset_value; | ||
88 | } | ||
89 | |||
90 | static __inline__ int irq_canonicalize(int irq) | ||
91 | { | ||
92 | return irq; | ||
93 | } | ||
94 | |||
95 | extern int distribute_irqs; | ||
96 | |||
97 | struct irqaction; | ||
98 | struct pt_regs; | ||
99 | |||
100 | #ifdef CONFIG_IRQSTACKS | ||
101 | /* | ||
102 | * Per-cpu stacks for handling hard and soft interrupts. | ||
103 | */ | ||
104 | extern struct thread_info *hardirq_ctx[NR_CPUS]; | ||
105 | extern struct thread_info *softirq_ctx[NR_CPUS]; | ||
106 | |||
107 | extern void irq_ctx_init(void); | ||
108 | extern void call_do_softirq(struct thread_info *tp); | ||
109 | extern int call_handle_IRQ_event(int irq, struct pt_regs *regs, | ||
110 | struct irqaction *action, struct thread_info *tp); | ||
111 | |||
112 | #define __ARCH_HAS_DO_SOFTIRQ | ||
113 | |||
114 | #else | ||
115 | #define irq_ctx_init() | ||
116 | |||
117 | #endif /* CONFIG_IRQSTACKS */ | ||
118 | |||
119 | #endif /* _ASM_IRQ_H */ | ||
120 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc64/keylargo.h b/include/asm-ppc64/keylargo.h deleted file mode 100644 index 4d78e3d0314c..000000000000 --- a/include/asm-ppc64/keylargo.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/keylargo.h> | ||
2 | |||
diff --git a/include/asm-ppc64/kmap_types.h b/include/asm-ppc64/kmap_types.h deleted file mode 100644 index fd1574648223..000000000000 --- a/include/asm-ppc64/kmap_types.h +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _ASM_KMAP_TYPES_H | ||
3 | #define _ASM_KMAP_TYPES_H | ||
4 | |||
5 | enum km_type { | ||
6 | KM_BOUNCE_READ, | ||
7 | KM_SKB_SUNRPC_DATA, | ||
8 | KM_SKB_DATA_SOFTIRQ, | ||
9 | KM_USER0, | ||
10 | KM_USER1, | ||
11 | KM_BIO_SRC_IRQ, | ||
12 | KM_BIO_DST_IRQ, | ||
13 | KM_PTE0, | ||
14 | KM_PTE1, | ||
15 | KM_IRQ0, | ||
16 | KM_IRQ1, | ||
17 | KM_SOFTIRQ0, | ||
18 | KM_SOFTIRQ1, | ||
19 | KM_TYPE_NR | ||
20 | }; | ||
21 | |||
22 | #endif | ||
23 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc64/macio.h b/include/asm-ppc64/macio.h deleted file mode 100644 index a3028b364f70..000000000000 --- a/include/asm-ppc64/macio.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/macio.h> | ||
2 | |||
diff --git a/include/asm-ppc64/memory.h b/include/asm-ppc64/memory.h deleted file mode 100644 index af53ffb55726..000000000000 --- a/include/asm-ppc64/memory.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | #ifndef _ASM_PPC64_MEMORY_H_ | ||
2 | #define _ASM_PPC64_MEMORY_H_ | ||
3 | |||
4 | /* | ||
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version | ||
8 | * 2 of the License, or (at your option) any later version. | ||
9 | */ | ||
10 | |||
11 | #include <linux/config.h> | ||
12 | |||
13 | /* | ||
14 | * Arguably the bitops and *xchg operations don't imply any memory barrier | ||
15 | * or SMP ordering, but in fact a lot of drivers expect them to imply | ||
16 | * both, since they do on x86 cpus. | ||
17 | */ | ||
18 | #ifdef CONFIG_SMP | ||
19 | #define EIEIO_ON_SMP "eieio\n" | ||
20 | #define ISYNC_ON_SMP "\n\tisync" | ||
21 | #define SYNC_ON_SMP "lwsync\n\t" | ||
22 | #else | ||
23 | #define EIEIO_ON_SMP | ||
24 | #define ISYNC_ON_SMP | ||
25 | #define SYNC_ON_SMP | ||
26 | #endif | ||
27 | |||
28 | static inline void eieio(void) | ||
29 | { | ||
30 | __asm__ __volatile__ ("eieio" : : : "memory"); | ||
31 | } | ||
32 | |||
33 | static inline void isync(void) | ||
34 | { | ||
35 | __asm__ __volatile__ ("isync" : : : "memory"); | ||
36 | } | ||
37 | |||
38 | #ifdef CONFIG_SMP | ||
39 | #define eieio_on_smp() eieio() | ||
40 | #define isync_on_smp() isync() | ||
41 | #else | ||
42 | #define eieio_on_smp() __asm__ __volatile__("": : :"memory") | ||
43 | #define isync_on_smp() __asm__ __volatile__("": : :"memory") | ||
44 | #endif | ||
45 | |||
46 | /* Macros for adjusting thread priority (hardware multi-threading) */ | ||
47 | #define HMT_very_low() asm volatile("or 31,31,31 # very low priority") | ||
48 | #define HMT_low() asm volatile("or 1,1,1 # low priority") | ||
49 | #define HMT_medium_low() asm volatile("or 6,6,6 # medium low priority") | ||
50 | #define HMT_medium() asm volatile("or 2,2,2 # medium priority") | ||
51 | #define HMT_medium_high() asm volatile("or 5,5,5 # medium high priority") | ||
52 | #define HMT_high() asm volatile("or 3,3,3 # high priority") | ||
53 | |||
54 | #define HMT_VERY_LOW "\tor 31,31,31 # very low priority\n" | ||
55 | #define HMT_LOW "\tor 1,1,1 # low priority\n" | ||
56 | #define HMT_MEDIUM_LOW "\tor 6,6,6 # medium low priority\n" | ||
57 | #define HMT_MEDIUM "\tor 2,2,2 # medium priority\n" | ||
58 | #define HMT_MEDIUM_HIGH "\tor 5,5,5 # medium high priority\n" | ||
59 | #define HMT_HIGH "\tor 3,3,3 # high priority\n" | ||
60 | |||
61 | #endif | ||
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h index 7bc42eb087ad..e0505acb77d9 100644 --- a/include/asm-ppc64/mmu.h +++ b/include/asm-ppc64/mmu.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #define _PPC64_MMU_H_ | 14 | #define _PPC64_MMU_H_ |
15 | 15 | ||
16 | #include <linux/config.h> | 16 | #include <linux/config.h> |
17 | #include <asm/ppc_asm.h> /* for ASM_CONST */ | ||
17 | #include <asm/page.h> | 18 | #include <asm/page.h> |
18 | 19 | ||
19 | /* | 20 | /* |
@@ -29,7 +30,7 @@ | |||
29 | 30 | ||
30 | /* Location of cpu0's segment table */ | 31 | /* Location of cpu0's segment table */ |
31 | #define STAB0_PAGE 0x6 | 32 | #define STAB0_PAGE 0x6 |
32 | #define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT) | 33 | #define STAB0_PHYS_ADDR (STAB0_PAGE<<12) |
33 | 34 | ||
34 | #ifndef __ASSEMBLY__ | 35 | #ifndef __ASSEMBLY__ |
35 | extern char initial_stab[]; | 36 | extern char initial_stab[]; |
@@ -205,6 +206,10 @@ extern long native_hpte_insert(unsigned long hpte_group, unsigned long va, | |||
205 | unsigned long prpn, | 206 | unsigned long prpn, |
206 | unsigned long vflags, unsigned long rflags); | 207 | unsigned long vflags, unsigned long rflags); |
207 | 208 | ||
209 | extern long iSeries_hpte_bolt_or_insert(unsigned long hpte_group, | ||
210 | unsigned long va, unsigned long prpn, | ||
211 | unsigned long vflags, unsigned long rflags); | ||
212 | |||
208 | extern void stabs_alloc(void); | 213 | extern void stabs_alloc(void); |
209 | 214 | ||
210 | #endif /* __ASSEMBLY__ */ | 215 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h index ed473f4b0152..80a708e7093a 100644 --- a/include/asm-ppc64/mmzone.h +++ b/include/asm-ppc64/mmzone.h | |||
@@ -67,9 +67,6 @@ static inline int pa_to_nid(unsigned long pa) | |||
67 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 67 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
68 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn) | 68 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn) |
69 | 69 | ||
70 | #define local_mapnr(kvaddr) \ | ||
71 | ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) | ||
72 | |||
73 | #ifdef CONFIG_DISCONTIGMEM | 70 | #ifdef CONFIG_DISCONTIGMEM |
74 | 71 | ||
75 | /* | 72 | /* |
diff --git a/include/asm-ppc64/of_device.h b/include/asm-ppc64/of_device.h deleted file mode 100644 index 7bc136e22590..000000000000 --- a/include/asm-ppc64/of_device.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/of_device.h> | ||
2 | |||
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index a15422bcf30d..d404431f0a9a 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h | |||
@@ -11,13 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
14 | 14 | #include <asm/ppc_asm.h> /* for ASM_CONST */ | |
15 | #ifdef __ASSEMBLY__ | ||
16 | #define ASM_CONST(x) x | ||
17 | #else | ||
18 | #define __ASM_CONST(x) x##UL | ||
19 | #define ASM_CONST(x) __ASM_CONST(x) | ||
20 | #endif | ||
21 | 15 | ||
22 | /* PAGE_SHIFT determines the page size */ | 16 | /* PAGE_SHIFT determines the page size */ |
23 | #define PAGE_SHIFT 12 | 17 | #define PAGE_SHIFT 12 |
diff --git a/include/asm-ppc64/parport.h b/include/asm-ppc64/parport.h deleted file mode 100644 index 2f8874c581cc..000000000000 --- a/include/asm-ppc64/parport.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | /* | ||
2 | * parport.h: platform-specific PC-style parport initialisation | ||
3 | * | ||
4 | * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> | ||
5 | * | ||
6 | * This file should only be included by drivers/parport/parport_pc.c. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ASM_PPC64_PARPORT_H | ||
10 | #define _ASM_PPC64_PARPORT_H | ||
11 | |||
12 | static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); | ||
13 | static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | ||
14 | { | ||
15 | return parport_pc_find_isa_ports (autoirq, autodma); | ||
16 | } | ||
17 | |||
18 | #endif /* !(_ASM_PPC_PARPORT_H) */ | ||
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h index d8991389ab39..60cf8c838af0 100644 --- a/include/asm-ppc64/pci-bridge.h +++ b/include/asm-ppc64/pci-bridge.h | |||
@@ -2,7 +2,9 @@ | |||
2 | #ifndef _ASM_PCI_BRIDGE_H | 2 | #ifndef _ASM_PCI_BRIDGE_H |
3 | #define _ASM_PCI_BRIDGE_H | 3 | #define _ASM_PCI_BRIDGE_H |
4 | 4 | ||
5 | #include <linux/config.h> | ||
5 | #include <linux/pci.h> | 6 | #include <linux/pci.h> |
7 | #include <linux/list.h> | ||
6 | 8 | ||
7 | /* | 9 | /* |
8 | * This program is free software; you can redistribute it and/or | 10 | * This program is free software; you can redistribute it and/or |
@@ -34,7 +36,7 @@ struct pci_controller { | |||
34 | 36 | ||
35 | struct pci_ops *ops; | 37 | struct pci_ops *ops; |
36 | volatile unsigned int __iomem *cfg_addr; | 38 | volatile unsigned int __iomem *cfg_addr; |
37 | volatile unsigned char __iomem *cfg_data; | 39 | volatile void __iomem *cfg_data; |
38 | 40 | ||
39 | /* Currently, we limit ourselves to 1 IO range and 3 mem | 41 | /* Currently, we limit ourselves to 1 IO range and 3 mem |
40 | * ranges since the common pci_bus structure can't handle more | 42 | * ranges since the common pci_bus structure can't handle more |
@@ -71,6 +73,12 @@ struct pci_dn { | |||
71 | struct iommu_table *iommu_table; /* for phb's or bridges */ | 73 | struct iommu_table *iommu_table; /* for phb's or bridges */ |
72 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | 74 | struct pci_dev *pcidev; /* back-pointer to the pci device */ |
73 | struct device_node *node; /* back-pointer to the device_node */ | 75 | struct device_node *node; /* back-pointer to the device_node */ |
76 | #ifdef CONFIG_PPC_ISERIES | ||
77 | struct list_head Device_List; | ||
78 | int Irq; /* Assigned IRQ */ | ||
79 | int Flags; /* Possible flags(disable/bist)*/ | ||
80 | u8 LogicalSlot; /* Hv Slot Index for Tces */ | ||
81 | #endif | ||
74 | u32 config_space[16]; /* saved PCI config space */ | 82 | u32 config_space[16]; /* saved PCI config space */ |
75 | }; | 83 | }; |
76 | 84 | ||
@@ -96,6 +104,16 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) | |||
96 | return fetch_dev_dn(dev); | 104 | return fetch_dev_dn(dev); |
97 | } | 105 | } |
98 | 106 | ||
107 | static inline int pci_device_from_OF_node(struct device_node *np, | ||
108 | u8 *bus, u8 *devfn) | ||
109 | { | ||
110 | if (!PCI_DN(np)) | ||
111 | return -ENODEV; | ||
112 | *bus = PCI_DN(np)->busno; | ||
113 | *devfn = PCI_DN(np)->devfn; | ||
114 | return 0; | ||
115 | } | ||
116 | |||
99 | static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) | 117 | static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) |
100 | { | 118 | { |
101 | if (bus->self) | 119 | if (bus->self) |
@@ -105,7 +123,7 @@ static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) | |||
105 | } | 123 | } |
106 | 124 | ||
107 | extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, | 125 | extern void pci_process_bridge_OF_ranges(struct pci_controller *hose, |
108 | struct device_node *dev); | 126 | struct device_node *dev, int primary); |
109 | 127 | ||
110 | extern int pcibios_remove_root_bus(struct pci_controller *phb); | 128 | extern int pcibios_remove_root_bus(struct pci_controller *phb); |
111 | 129 | ||
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index a88bbfc26967..342e2d755550 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h | |||
@@ -168,7 +168,7 @@ extern void pcibios_add_platform_entries(struct pci_dev *dev); | |||
168 | 168 | ||
169 | struct file; | 169 | struct file; |
170 | extern pgprot_t pci_phys_mem_access_prot(struct file *file, | 170 | extern pgprot_t pci_phys_mem_access_prot(struct file *file, |
171 | unsigned long offset, | 171 | unsigned long pfn, |
172 | unsigned long size, | 172 | unsigned long size, |
173 | pgprot_t prot); | 173 | pgprot_t prot); |
174 | 174 | ||
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h index c83679c9d2b0..8c3f574046b6 100644 --- a/include/asm-ppc64/pgtable.h +++ b/include/asm-ppc64/pgtable.h | |||
@@ -471,17 +471,19 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty) | |||
471 | #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED)) | 471 | #define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) | _PAGE_NO_CACHE | _PAGE_GUARDED)) |
472 | 472 | ||
473 | struct file; | 473 | struct file; |
474 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr, | 474 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
475 | unsigned long size, pgprot_t vma_prot); | 475 | unsigned long size, pgprot_t vma_prot); |
476 | #define __HAVE_PHYS_MEM_ACCESS_PROT | 476 | #define __HAVE_PHYS_MEM_ACCESS_PROT |
477 | 477 | ||
478 | #define __HAVE_ARCH_PTE_SAME | 478 | #define __HAVE_ARCH_PTE_SAME |
479 | #define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) | 479 | #define pte_same(A,B) (((pte_val(A) ^ pte_val(B)) & ~_PAGE_HPTEFLAGS) == 0) |
480 | 480 | ||
481 | #define pte_ERROR(e) \ | ||
482 | printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) | ||
481 | #define pmd_ERROR(e) \ | 483 | #define pmd_ERROR(e) \ |
482 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) | 484 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pmd_val(e)) |
483 | #define pud_ERROR(e) \ | 485 | #define pud_ERROR(e) \ |
484 | printk("%s:%d: bad pmd %08lx.\n", __FILE__, __LINE__, pud_val(e)) | 486 | printk("%s:%d: bad pud %08lx.\n", __FILE__, __LINE__, pud_val(e)) |
485 | #define pgd_ERROR(e) \ | 487 | #define pgd_ERROR(e) \ |
486 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) | 488 | printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e)) |
487 | 489 | ||
diff --git a/include/asm-ppc64/pmac_feature.h b/include/asm-ppc64/pmac_feature.h deleted file mode 100644 index e07e36c4cbb2..000000000000 --- a/include/asm-ppc64/pmac_feature.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/pmac_feature.h> | ||
2 | |||
diff --git a/include/asm-ppc64/pmac_low_i2c.h b/include/asm-ppc64/pmac_low_i2c.h deleted file mode 100644 index 7bcfc72c5c8a..000000000000 --- a/include/asm-ppc64/pmac_low_i2c.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/pmac_low_i2c.h> | ||
2 | |||
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h index 6b44a8caf395..3945a55d112a 100644 --- a/include/asm-ppc64/ppc32.h +++ b/include/asm-ppc64/ppc32.h | |||
@@ -70,18 +70,18 @@ typedef struct compat_siginfo { | |||
70 | #define __old_sigaction32 old_sigaction32 | 70 | #define __old_sigaction32 old_sigaction32 |
71 | 71 | ||
72 | struct __old_sigaction32 { | 72 | struct __old_sigaction32 { |
73 | unsigned sa_handler; | 73 | compat_uptr_t sa_handler; |
74 | compat_old_sigset_t sa_mask; | 74 | compat_old_sigset_t sa_mask; |
75 | unsigned int sa_flags; | 75 | unsigned int sa_flags; |
76 | unsigned sa_restorer; /* not used by Linux/SPARC yet */ | 76 | compat_uptr_t sa_restorer; /* not used by Linux/SPARC yet */ |
77 | }; | 77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | struct sigaction32 { | 81 | struct sigaction32 { |
82 | unsigned int sa_handler; /* Really a pointer, but need to deal with 32 bits */ | 82 | compat_uptr_t sa_handler; /* Really a pointer, but need to deal with 32 bits */ |
83 | unsigned int sa_flags; | 83 | unsigned int sa_flags; |
84 | unsigned int sa_restorer; /* Another 32 bit pointer */ | 84 | compat_uptr_t sa_restorer; /* Another 32 bit pointer */ |
85 | compat_sigset_t sa_mask; /* A 32 bit mask */ | 85 | compat_sigset_t sa_mask; /* A 32 bit mask */ |
86 | }; | 86 | }; |
87 | 87 | ||
@@ -94,9 +94,9 @@ typedef struct sigaltstack_32 { | |||
94 | struct sigcontext32 { | 94 | struct sigcontext32 { |
95 | unsigned int _unused[4]; | 95 | unsigned int _unused[4]; |
96 | int signal; | 96 | int signal; |
97 | unsigned int handler; | 97 | compat_uptr_t handler; |
98 | unsigned int oldmask; | 98 | unsigned int oldmask; |
99 | u32 regs; /* 4 byte pointer to the pt_regs32 structure. */ | 99 | compat_uptr_t regs; /* 4 byte pointer to the pt_regs32 structure. */ |
100 | }; | 100 | }; |
101 | 101 | ||
102 | struct mcontext32 { | 102 | struct mcontext32 { |
@@ -111,7 +111,7 @@ struct ucontext32 { | |||
111 | unsigned int uc_link; | 111 | unsigned int uc_link; |
112 | stack_32_t uc_stack; | 112 | stack_32_t uc_stack; |
113 | int uc_pad[7]; | 113 | int uc_pad[7]; |
114 | u32 uc_regs; /* points to uc_mcontext field */ | 114 | compat_uptr_t uc_regs; /* points to uc_mcontext field */ |
115 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ | 115 | compat_sigset_t uc_sigmask; /* mask last for extensibility */ |
116 | /* glibc has 1024-bit signal masks, ours are 64-bit */ | 116 | /* glibc has 1024-bit signal masks, ours are 64-bit */ |
117 | int uc_maskext[30]; | 117 | int uc_maskext[30]; |
diff --git a/include/asm-ppc64/ppc_asm.h b/include/asm-ppc64/ppc_asm.h deleted file mode 100644 index 9031d8a29aca..000000000000 --- a/include/asm-ppc64/ppc_asm.h +++ /dev/null | |||
@@ -1,242 +0,0 @@ | |||
1 | /* | ||
2 | * arch/ppc64/kernel/ppc_asm.h | ||
3 | * | ||
4 | * Definitions used by various bits of low-level assembly code on PowerPC. | ||
5 | * | ||
6 | * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef _PPC64_PPC_ASM_H | ||
15 | #define _PPC64_PPC_ASM_H | ||
16 | /* | ||
17 | * Macros for storing registers into and loading registers from | ||
18 | * exception frames. | ||
19 | */ | ||
20 | #define SAVE_GPR(n, base) std n,GPR0+8*(n)(base) | ||
21 | #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) | ||
22 | #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) | ||
23 | #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) | ||
24 | #define SAVE_10GPRS(n, base) SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base) | ||
25 | #define REST_GPR(n, base) ld n,GPR0+8*(n)(base) | ||
26 | #define REST_2GPRS(n, base) REST_GPR(n, base); REST_GPR(n+1, base) | ||
27 | #define REST_4GPRS(n, base) REST_2GPRS(n, base); REST_2GPRS(n+2, base) | ||
28 | #define REST_8GPRS(n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base) | ||
29 | #define REST_10GPRS(n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) | ||
30 | |||
31 | #define SAVE_NVGPRS(base) SAVE_8GPRS(14, base); SAVE_10GPRS(22, base) | ||
32 | #define REST_NVGPRS(base) REST_8GPRS(14, base); REST_10GPRS(22, base) | ||
33 | |||
34 | #define SAVE_FPR(n, base) stfd n,THREAD_FPR0+8*(n)(base) | ||
35 | #define SAVE_2FPRS(n, base) SAVE_FPR(n, base); SAVE_FPR(n+1, base) | ||
36 | #define SAVE_4FPRS(n, base) SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base) | ||
37 | #define SAVE_8FPRS(n, base) SAVE_4FPRS(n, base); SAVE_4FPRS(n+4, base) | ||
38 | #define SAVE_16FPRS(n, base) SAVE_8FPRS(n, base); SAVE_8FPRS(n+8, base) | ||
39 | #define SAVE_32FPRS(n, base) SAVE_16FPRS(n, base); SAVE_16FPRS(n+16, base) | ||
40 | #define REST_FPR(n, base) lfd n,THREAD_FPR0+8*(n)(base) | ||
41 | #define REST_2FPRS(n, base) REST_FPR(n, base); REST_FPR(n+1, base) | ||
42 | #define REST_4FPRS(n, base) REST_2FPRS(n, base); REST_2FPRS(n+2, base) | ||
43 | #define REST_8FPRS(n, base) REST_4FPRS(n, base); REST_4FPRS(n+4, base) | ||
44 | #define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) | ||
45 | #define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) | ||
46 | |||
47 | #define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); stvx n,b,base | ||
48 | #define SAVE_2VRS(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base) | ||
49 | #define SAVE_4VRS(n,b,base) SAVE_2VRS(n,b,base); SAVE_2VRS(n+2,b,base) | ||
50 | #define SAVE_8VRS(n,b,base) SAVE_4VRS(n,b,base); SAVE_4VRS(n+4,b,base) | ||
51 | #define SAVE_16VRS(n,b,base) SAVE_8VRS(n,b,base); SAVE_8VRS(n+8,b,base) | ||
52 | #define SAVE_32VRS(n,b,base) SAVE_16VRS(n,b,base); SAVE_16VRS(n+16,b,base) | ||
53 | #define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); lvx n,b,base | ||
54 | #define REST_2VRS(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base) | ||
55 | #define REST_4VRS(n,b,base) REST_2VRS(n,b,base); REST_2VRS(n+2,b,base) | ||
56 | #define REST_8VRS(n,b,base) REST_4VRS(n,b,base); REST_4VRS(n+4,b,base) | ||
57 | #define REST_16VRS(n,b,base) REST_8VRS(n,b,base); REST_8VRS(n+8,b,base) | ||
58 | #define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base) | ||
59 | |||
60 | /* Macros to adjust thread priority for Iseries hardware multithreading */ | ||
61 | #define HMT_LOW or 1,1,1 | ||
62 | #define HMT_MEDIUM or 2,2,2 | ||
63 | #define HMT_HIGH or 3,3,3 | ||
64 | |||
65 | /* Insert the high 32 bits of the MSR into what will be the new | ||
66 | MSR (via SRR1 and rfid) This preserves the MSR.SF and MSR.ISF | ||
67 | bits. */ | ||
68 | |||
69 | #define FIX_SRR1(ra, rb) \ | ||
70 | mr rb,ra; \ | ||
71 | mfmsr ra; \ | ||
72 | rldimi ra,rb,0,32 | ||
73 | |||
74 | #define CLR_TOP32(r) rlwinm (r),(r),0,0,31 /* clear top 32 bits */ | ||
75 | |||
76 | /* | ||
77 | * LOADADDR( rn, name ) | ||
78 | * loads the address of 'name' into 'rn' | ||
79 | * | ||
80 | * LOADBASE( rn, name ) | ||
81 | * loads the address (less the low 16 bits) of 'name' into 'rn' | ||
82 | * suitable for base+disp addressing | ||
83 | */ | ||
84 | #define LOADADDR(rn,name) \ | ||
85 | lis rn,name##@highest; \ | ||
86 | ori rn,rn,name##@higher; \ | ||
87 | rldicr rn,rn,32,31; \ | ||
88 | oris rn,rn,name##@h; \ | ||
89 | ori rn,rn,name##@l | ||
90 | |||
91 | #define LOADBASE(rn,name) \ | ||
92 | lis rn,name@highest; \ | ||
93 | ori rn,rn,name@higher; \ | ||
94 | rldicr rn,rn,32,31; \ | ||
95 | oris rn,rn,name@ha | ||
96 | |||
97 | |||
98 | #define SET_REG_TO_CONST(reg, value) \ | ||
99 | lis reg,(((value)>>48)&0xFFFF); \ | ||
100 | ori reg,reg,(((value)>>32)&0xFFFF); \ | ||
101 | rldicr reg,reg,32,31; \ | ||
102 | oris reg,reg,(((value)>>16)&0xFFFF); \ | ||
103 | ori reg,reg,((value)&0xFFFF); | ||
104 | |||
105 | #define SET_REG_TO_LABEL(reg, label) \ | ||
106 | lis reg,(label)@highest; \ | ||
107 | ori reg,reg,(label)@higher; \ | ||
108 | rldicr reg,reg,32,31; \ | ||
109 | oris reg,reg,(label)@h; \ | ||
110 | ori reg,reg,(label)@l; | ||
111 | |||
112 | |||
113 | /* PPPBBB - DRENG If KERNELBASE is always 0xC0..., | ||
114 | * Then we can easily do this with one asm insn. -Peter | ||
115 | */ | ||
116 | #define tophys(rd,rs) \ | ||
117 | lis rd,((KERNELBASE>>48)&0xFFFF); \ | ||
118 | rldicr rd,rd,32,31; \ | ||
119 | sub rd,rs,rd | ||
120 | |||
121 | #define tovirt(rd,rs) \ | ||
122 | lis rd,((KERNELBASE>>48)&0xFFFF); \ | ||
123 | rldicr rd,rd,32,31; \ | ||
124 | add rd,rs,rd | ||
125 | |||
126 | /* Condition Register Bit Fields */ | ||
127 | |||
128 | #define cr0 0 | ||
129 | #define cr1 1 | ||
130 | #define cr2 2 | ||
131 | #define cr3 3 | ||
132 | #define cr4 4 | ||
133 | #define cr5 5 | ||
134 | #define cr6 6 | ||
135 | #define cr7 7 | ||
136 | |||
137 | |||
138 | /* General Purpose Registers (GPRs) */ | ||
139 | |||
140 | #define r0 0 | ||
141 | #define r1 1 | ||
142 | #define r2 2 | ||
143 | #define r3 3 | ||
144 | #define r4 4 | ||
145 | #define r5 5 | ||
146 | #define r6 6 | ||
147 | #define r7 7 | ||
148 | #define r8 8 | ||
149 | #define r9 9 | ||
150 | #define r10 10 | ||
151 | #define r11 11 | ||
152 | #define r12 12 | ||
153 | #define r13 13 | ||
154 | #define r14 14 | ||
155 | #define r15 15 | ||
156 | #define r16 16 | ||
157 | #define r17 17 | ||
158 | #define r18 18 | ||
159 | #define r19 19 | ||
160 | #define r20 20 | ||
161 | #define r21 21 | ||
162 | #define r22 22 | ||
163 | #define r23 23 | ||
164 | #define r24 24 | ||
165 | #define r25 25 | ||
166 | #define r26 26 | ||
167 | #define r27 27 | ||
168 | #define r28 28 | ||
169 | #define r29 29 | ||
170 | #define r30 30 | ||
171 | #define r31 31 | ||
172 | |||
173 | |||
174 | /* Floating Point Registers (FPRs) */ | ||
175 | |||
176 | #define fr0 0 | ||
177 | #define fr1 1 | ||
178 | #define fr2 2 | ||
179 | #define fr3 3 | ||
180 | #define fr4 4 | ||
181 | #define fr5 5 | ||
182 | #define fr6 6 | ||
183 | #define fr7 7 | ||
184 | #define fr8 8 | ||
185 | #define fr9 9 | ||
186 | #define fr10 10 | ||
187 | #define fr11 11 | ||
188 | #define fr12 12 | ||
189 | #define fr13 13 | ||
190 | #define fr14 14 | ||
191 | #define fr15 15 | ||
192 | #define fr16 16 | ||
193 | #define fr17 17 | ||
194 | #define fr18 18 | ||
195 | #define fr19 19 | ||
196 | #define fr20 20 | ||
197 | #define fr21 21 | ||
198 | #define fr22 22 | ||
199 | #define fr23 23 | ||
200 | #define fr24 24 | ||
201 | #define fr25 25 | ||
202 | #define fr26 26 | ||
203 | #define fr27 27 | ||
204 | #define fr28 28 | ||
205 | #define fr29 29 | ||
206 | #define fr30 30 | ||
207 | #define fr31 31 | ||
208 | |||
209 | #define vr0 0 | ||
210 | #define vr1 1 | ||
211 | #define vr2 2 | ||
212 | #define vr3 3 | ||
213 | #define vr4 4 | ||
214 | #define vr5 5 | ||
215 | #define vr6 6 | ||
216 | #define vr7 7 | ||
217 | #define vr8 8 | ||
218 | #define vr9 9 | ||
219 | #define vr10 10 | ||
220 | #define vr11 11 | ||
221 | #define vr12 12 | ||
222 | #define vr13 13 | ||
223 | #define vr14 14 | ||
224 | #define vr15 15 | ||
225 | #define vr16 16 | ||
226 | #define vr17 17 | ||
227 | #define vr18 18 | ||
228 | #define vr19 19 | ||
229 | #define vr20 20 | ||
230 | #define vr21 21 | ||
231 | #define vr22 22 | ||
232 | #define vr23 23 | ||
233 | #define vr24 24 | ||
234 | #define vr25 25 | ||
235 | #define vr26 26 | ||
236 | #define vr27 27 | ||
237 | #define vr28 28 | ||
238 | #define vr29 29 | ||
239 | #define vr30 30 | ||
240 | #define vr31 31 | ||
241 | |||
242 | #endif /* _PPC64_PPC_ASM_H */ | ||
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h deleted file mode 100644 index 4146189006e3..000000000000 --- a/include/asm-ppc64/processor.h +++ /dev/null | |||
@@ -1,558 +0,0 @@ | |||
1 | #ifndef __ASM_PPC64_PROCESSOR_H | ||
2 | #define __ASM_PPC64_PROCESSOR_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2001 PPC 64 Team, IBM Corp | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <linux/stringify.h> | ||
14 | #ifndef __ASSEMBLY__ | ||
15 | #include <linux/config.h> | ||
16 | #include <asm/atomic.h> | ||
17 | #include <asm/ppcdebug.h> | ||
18 | #include <asm/a.out.h> | ||
19 | #endif | ||
20 | #include <asm/ptrace.h> | ||
21 | #include <asm/types.h> | ||
22 | #include <asm/systemcfg.h> | ||
23 | #include <asm/cputable.h> | ||
24 | |||
25 | /* Machine State Register (MSR) Fields */ | ||
26 | #define MSR_SF_LG 63 /* Enable 64 bit mode */ | ||
27 | #define MSR_ISF_LG 61 /* Interrupt 64b mode valid on 630 */ | ||
28 | #define MSR_HV_LG 60 /* Hypervisor state */ | ||
29 | #define MSR_VEC_LG 25 /* Enable AltiVec */ | ||
30 | #define MSR_POW_LG 18 /* Enable Power Management */ | ||
31 | #define MSR_WE_LG 18 /* Wait State Enable */ | ||
32 | #define MSR_TGPR_LG 17 /* TLB Update registers in use */ | ||
33 | #define MSR_CE_LG 17 /* Critical Interrupt Enable */ | ||
34 | #define MSR_ILE_LG 16 /* Interrupt Little Endian */ | ||
35 | #define MSR_EE_LG 15 /* External Interrupt Enable */ | ||
36 | #define MSR_PR_LG 14 /* Problem State / Privilege Level */ | ||
37 | #define MSR_FP_LG 13 /* Floating Point enable */ | ||
38 | #define MSR_ME_LG 12 /* Machine Check Enable */ | ||
39 | #define MSR_FE0_LG 11 /* Floating Exception mode 0 */ | ||
40 | #define MSR_SE_LG 10 /* Single Step */ | ||
41 | #define MSR_BE_LG 9 /* Branch Trace */ | ||
42 | #define MSR_DE_LG 9 /* Debug Exception Enable */ | ||
43 | #define MSR_FE1_LG 8 /* Floating Exception mode 1 */ | ||
44 | #define MSR_IP_LG 6 /* Exception prefix 0x000/0xFFF */ | ||
45 | #define MSR_IR_LG 5 /* Instruction Relocate */ | ||
46 | #define MSR_DR_LG 4 /* Data Relocate */ | ||
47 | #define MSR_PE_LG 3 /* Protection Enable */ | ||
48 | #define MSR_PX_LG 2 /* Protection Exclusive Mode */ | ||
49 | #define MSR_PMM_LG 2 /* Performance monitor */ | ||
50 | #define MSR_RI_LG 1 /* Recoverable Exception */ | ||
51 | #define MSR_LE_LG 0 /* Little Endian */ | ||
52 | |||
53 | #ifdef __ASSEMBLY__ | ||
54 | #define __MASK(X) (1<<(X)) | ||
55 | #else | ||
56 | #define __MASK(X) (1UL<<(X)) | ||
57 | #endif | ||
58 | |||
59 | #define MSR_SF __MASK(MSR_SF_LG) /* Enable 64 bit mode */ | ||
60 | #define MSR_ISF __MASK(MSR_ISF_LG) /* Interrupt 64b mode valid on 630 */ | ||
61 | #define MSR_HV __MASK(MSR_HV_LG) /* Hypervisor state */ | ||
62 | #define MSR_VEC __MASK(MSR_VEC_LG) /* Enable AltiVec */ | ||
63 | #define MSR_POW __MASK(MSR_POW_LG) /* Enable Power Management */ | ||
64 | #define MSR_WE __MASK(MSR_WE_LG) /* Wait State Enable */ | ||
65 | #define MSR_TGPR __MASK(MSR_TGPR_LG) /* TLB Update registers in use */ | ||
66 | #define MSR_CE __MASK(MSR_CE_LG) /* Critical Interrupt Enable */ | ||
67 | #define MSR_ILE __MASK(MSR_ILE_LG) /* Interrupt Little Endian */ | ||
68 | #define MSR_EE __MASK(MSR_EE_LG) /* External Interrupt Enable */ | ||
69 | #define MSR_PR __MASK(MSR_PR_LG) /* Problem State / Privilege Level */ | ||
70 | #define MSR_FP __MASK(MSR_FP_LG) /* Floating Point enable */ | ||
71 | #define MSR_ME __MASK(MSR_ME_LG) /* Machine Check Enable */ | ||
72 | #define MSR_FE0 __MASK(MSR_FE0_LG) /* Floating Exception mode 0 */ | ||
73 | #define MSR_SE __MASK(MSR_SE_LG) /* Single Step */ | ||
74 | #define MSR_BE __MASK(MSR_BE_LG) /* Branch Trace */ | ||
75 | #define MSR_DE __MASK(MSR_DE_LG) /* Debug Exception Enable */ | ||
76 | #define MSR_FE1 __MASK(MSR_FE1_LG) /* Floating Exception mode 1 */ | ||
77 | #define MSR_IP __MASK(MSR_IP_LG) /* Exception prefix 0x000/0xFFF */ | ||
78 | #define MSR_IR __MASK(MSR_IR_LG) /* Instruction Relocate */ | ||
79 | #define MSR_DR __MASK(MSR_DR_LG) /* Data Relocate */ | ||
80 | #define MSR_PE __MASK(MSR_PE_LG) /* Protection Enable */ | ||
81 | #define MSR_PX __MASK(MSR_PX_LG) /* Protection Exclusive Mode */ | ||
82 | #define MSR_PMM __MASK(MSR_PMM_LG) /* Performance monitor */ | ||
83 | #define MSR_RI __MASK(MSR_RI_LG) /* Recoverable Exception */ | ||
84 | #define MSR_LE __MASK(MSR_LE_LG) /* Little Endian */ | ||
85 | |||
86 | #define MSR_ MSR_ME | MSR_RI | MSR_IR | MSR_DR | MSR_ISF | ||
87 | #define MSR_KERNEL MSR_ | MSR_SF | MSR_HV | ||
88 | |||
89 | #define MSR_USER32 MSR_ | MSR_PR | MSR_EE | ||
90 | #define MSR_USER64 MSR_USER32 | MSR_SF | ||
91 | |||
92 | /* Floating Point Status and Control Register (FPSCR) Fields */ | ||
93 | |||
94 | #define FPSCR_FX 0x80000000 /* FPU exception summary */ | ||
95 | #define FPSCR_FEX 0x40000000 /* FPU enabled exception summary */ | ||
96 | #define FPSCR_VX 0x20000000 /* Invalid operation summary */ | ||
97 | #define FPSCR_OX 0x10000000 /* Overflow exception summary */ | ||
98 | #define FPSCR_UX 0x08000000 /* Underflow exception summary */ | ||
99 | #define FPSCR_ZX 0x04000000 /* Zero-divide exception summary */ | ||
100 | #define FPSCR_XX 0x02000000 /* Inexact exception summary */ | ||
101 | #define FPSCR_VXSNAN 0x01000000 /* Invalid op for SNaN */ | ||
102 | #define FPSCR_VXISI 0x00800000 /* Invalid op for Inv - Inv */ | ||
103 | #define FPSCR_VXIDI 0x00400000 /* Invalid op for Inv / Inv */ | ||
104 | #define FPSCR_VXZDZ 0x00200000 /* Invalid op for Zero / Zero */ | ||
105 | #define FPSCR_VXIMZ 0x00100000 /* Invalid op for Inv * Zero */ | ||
106 | #define FPSCR_VXVC 0x00080000 /* Invalid op for Compare */ | ||
107 | #define FPSCR_FR 0x00040000 /* Fraction rounded */ | ||
108 | #define FPSCR_FI 0x00020000 /* Fraction inexact */ | ||
109 | #define FPSCR_FPRF 0x0001f000 /* FPU Result Flags */ | ||
110 | #define FPSCR_FPCC 0x0000f000 /* FPU Condition Codes */ | ||
111 | #define FPSCR_VXSOFT 0x00000400 /* Invalid op for software request */ | ||
112 | #define FPSCR_VXSQRT 0x00000200 /* Invalid op for square root */ | ||
113 | #define FPSCR_VXCVI 0x00000100 /* Invalid op for integer convert */ | ||
114 | #define FPSCR_VE 0x00000080 /* Invalid op exception enable */ | ||
115 | #define FPSCR_OE 0x00000040 /* IEEE overflow exception enable */ | ||
116 | #define FPSCR_UE 0x00000020 /* IEEE underflow exception enable */ | ||
117 | #define FPSCR_ZE 0x00000010 /* IEEE zero divide exception enable */ | ||
118 | #define FPSCR_XE 0x00000008 /* FP inexact exception enable */ | ||
119 | #define FPSCR_NI 0x00000004 /* FPU non IEEE-Mode */ | ||
120 | #define FPSCR_RN 0x00000003 /* FPU rounding control */ | ||
121 | |||
122 | /* Special Purpose Registers (SPRNs)*/ | ||
123 | |||
124 | #define SPRN_CTR 0x009 /* Count Register */ | ||
125 | #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ | ||
126 | #define DABR_TRANSLATION (1UL << 2) | ||
127 | #define SPRN_DAR 0x013 /* Data Address Register */ | ||
128 | #define SPRN_DEC 0x016 /* Decrement Register */ | ||
129 | #define SPRN_DSISR 0x012 /* Data Storage Interrupt Status Register */ | ||
130 | #define DSISR_NOHPTE 0x40000000 /* no translation found */ | ||
131 | #define DSISR_PROTFAULT 0x08000000 /* protection fault */ | ||
132 | #define DSISR_ISSTORE 0x02000000 /* access was a store */ | ||
133 | #define DSISR_DABRMATCH 0x00400000 /* hit data breakpoint */ | ||
134 | #define DSISR_NOSEGMENT 0x00200000 /* STAB/SLB miss */ | ||
135 | #define SPRN_HID0 0x3F0 /* Hardware Implementation Register 0 */ | ||
136 | #define SPRN_MSRDORM 0x3F1 /* Hardware Implementation Register 1 */ | ||
137 | #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ | ||
138 | #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ | ||
139 | #define SPRN_NIADORM 0x3F3 /* Hardware Implementation Register 2 */ | ||
140 | #define SPRN_HID4 0x3F4 /* 970 HID4 */ | ||
141 | #define SPRN_HID5 0x3F6 /* 970 HID5 */ | ||
142 | #define SPRN_HID6 0x3F9 /* BE HID 6 */ | ||
143 | #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ | ||
144 | #define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */ | ||
145 | #define SPRN_TSCR 0x399 /* Thread switch control on BE */ | ||
146 | #define SPRN_TTR 0x39A /* Thread switch timeout on BE */ | ||
147 | #define TSCR_DEC_ENABLE 0x200000 /* Decrementer Interrupt */ | ||
148 | #define TSCR_EE_ENABLE 0x100000 /* External Interrupt */ | ||
149 | #define TSCR_EE_BOOST 0x080000 /* External Interrupt Boost */ | ||
150 | #define SPRN_TSC 0x3FD /* Thread switch control on others */ | ||
151 | #define SPRN_TST 0x3FC /* Thread switch timeout on others */ | ||
152 | #define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ | ||
153 | #define SPRN_LR 0x008 /* Link Register */ | ||
154 | #define SPRN_PIR 0x3FF /* Processor Identification Register */ | ||
155 | #define SPRN_PIT 0x3DB /* Programmable Interval Timer */ | ||
156 | #define SPRN_PURR 0x135 /* Processor Utilization of Resources Register */ | ||
157 | #define SPRN_PVR 0x11F /* Processor Version Register */ | ||
158 | #define SPRN_RPA 0x3D6 /* Required Physical Address Register */ | ||
159 | #define SPRN_SDA 0x3BF /* Sampled Data Address Register */ | ||
160 | #define SPRN_SDR1 0x019 /* MMU Hash Base Register */ | ||
161 | #define SPRN_SIA 0x3BB /* Sampled Instruction Address Register */ | ||
162 | #define SPRN_SPRG0 0x110 /* Special Purpose Register General 0 */ | ||
163 | #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ | ||
164 | #define SPRN_SPRG2 0x112 /* Special Purpose Register General 2 */ | ||
165 | #define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ | ||
166 | #define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ | ||
167 | #define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ | ||
168 | #define SPRN_TBRL 0x10C /* Time Base Read Lower Register (user, R/O) */ | ||
169 | #define SPRN_TBRU 0x10D /* Time Base Read Upper Register (user, R/O) */ | ||
170 | #define SPRN_TBWL 0x11C /* Time Base Lower Register (super, W/O) */ | ||
171 | #define SPRN_TBWU 0x11D /* Time Base Write Upper Register (super, W/O) */ | ||
172 | #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ | ||
173 | #define SPRN_USIA 0x3AB /* User Sampled Instruction Address Register */ | ||
174 | #define SPRN_XER 0x001 /* Fixed Point Exception Register */ | ||
175 | #define SPRN_VRSAVE 0x100 /* Vector save */ | ||
176 | #define SPRN_CTRLF 0x088 | ||
177 | #define SPRN_CTRLT 0x098 | ||
178 | #define CTRL_RUNLATCH 0x1 | ||
179 | |||
180 | /* Performance monitor SPRs */ | ||
181 | #define SPRN_SIAR 780 | ||
182 | #define SPRN_SDAR 781 | ||
183 | #define SPRN_MMCRA 786 | ||
184 | #define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ | ||
185 | #define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ | ||
186 | #define MMCRA_SAMPLE_ENABLE 0x00000001UL /* enable sampling */ | ||
187 | #define SPRN_PMC1 787 | ||
188 | #define SPRN_PMC2 788 | ||
189 | #define SPRN_PMC3 789 | ||
190 | #define SPRN_PMC4 790 | ||
191 | #define SPRN_PMC5 791 | ||
192 | #define SPRN_PMC6 792 | ||
193 | #define SPRN_PMC7 793 | ||
194 | #define SPRN_PMC8 794 | ||
195 | #define SPRN_MMCR0 795 | ||
196 | #define MMCR0_FC 0x80000000UL /* freeze counters. set to 1 on a perfmon exception */ | ||
197 | #define MMCR0_FCS 0x40000000UL /* freeze in supervisor state */ | ||
198 | #define MMCR0_KERNEL_DISABLE MMCR0_FCS | ||
199 | #define MMCR0_FCP 0x20000000UL /* freeze in problem state */ | ||
200 | #define MMCR0_PROBLEM_DISABLE MMCR0_FCP | ||
201 | #define MMCR0_FCM1 0x10000000UL /* freeze counters while MSR mark = 1 */ | ||
202 | #define MMCR0_FCM0 0x08000000UL /* freeze counters while MSR mark = 0 */ | ||
203 | #define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */ | ||
204 | #define MMCR0_FCECE 0x02000000UL /* freeze counters on enabled condition or event */ | ||
205 | /* time base exception enable */ | ||
206 | #define MMCR0_TBEE 0x00400000UL /* time base exception enable */ | ||
207 | #define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/ | ||
208 | #define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/ | ||
209 | #define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */ | ||
210 | #define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */ | ||
211 | #define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */ | ||
212 | #define MMCR0_FCTI 0x00000008UL /* freeze counters in tags inactive mode */ | ||
213 | #define MMCR0_FCTA 0x00000004UL /* freeze counters in tags active mode */ | ||
214 | #define MMCR0_FCWAIT 0x00000002UL /* freeze counter in WAIT state */ | ||
215 | #define MMCR0_FCHV 0x00000001UL /* freeze conditions in hypervisor mode */ | ||
216 | #define SPRN_MMCR1 798 | ||
217 | |||
218 | /* Short-hand versions for a number of the above SPRNs */ | ||
219 | |||
220 | #define CTR SPRN_CTR /* Counter Register */ | ||
221 | #define DAR SPRN_DAR /* Data Address Register */ | ||
222 | #define DABR SPRN_DABR /* Data Address Breakpoint Register */ | ||
223 | #define DEC SPRN_DEC /* Decrement Register */ | ||
224 | #define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */ | ||
225 | #define HID0 SPRN_HID0 /* Hardware Implementation Register 0 */ | ||
226 | #define MSRDORM SPRN_MSRDORM /* MSR Dormant Register */ | ||
227 | #define NIADORM SPRN_NIADORM /* NIA Dormant Register */ | ||
228 | #define TSC SPRN_TSC /* Thread switch control */ | ||
229 | #define TST SPRN_TST /* Thread switch timeout */ | ||
230 | #define IABR SPRN_IABR /* Instruction Address Breakpoint Register */ | ||
231 | #define L2CR SPRN_L2CR /* PPC 750 L2 control register */ | ||
232 | #define __LR SPRN_LR | ||
233 | #define PVR SPRN_PVR /* Processor Version */ | ||
234 | #define PIR SPRN_PIR /* Processor ID */ | ||
235 | #define PURR SPRN_PURR /* Processor Utilization of Resource Register */ | ||
236 | #define SDR1 SPRN_SDR1 /* MMU hash base register */ | ||
237 | #define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */ | ||
238 | #define SPR1 SPRN_SPRG1 | ||
239 | #define SPR2 SPRN_SPRG2 | ||
240 | #define SPR3 SPRN_SPRG3 | ||
241 | #define SPRG0 SPRN_SPRG0 | ||
242 | #define SPRG1 SPRN_SPRG1 | ||
243 | #define SPRG2 SPRN_SPRG2 | ||
244 | #define SPRG3 SPRN_SPRG3 | ||
245 | #define SRR0 SPRN_SRR0 /* Save and Restore Register 0 */ | ||
246 | #define SRR1 SPRN_SRR1 /* Save and Restore Register 1 */ | ||
247 | #define TBRL SPRN_TBRL /* Time Base Read Lower Register */ | ||
248 | #define TBRU SPRN_TBRU /* Time Base Read Upper Register */ | ||
249 | #define TBWL SPRN_TBWL /* Time Base Write Lower Register */ | ||
250 | #define TBWU SPRN_TBWU /* Time Base Write Upper Register */ | ||
251 | #define XER SPRN_XER | ||
252 | |||
253 | /* Processor Version Register (PVR) field extraction */ | ||
254 | |||
255 | #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ | ||
256 | #define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */ | ||
257 | |||
258 | /* Processor Version Numbers */ | ||
259 | #define PV_NORTHSTAR 0x0033 | ||
260 | #define PV_PULSAR 0x0034 | ||
261 | #define PV_POWER4 0x0035 | ||
262 | #define PV_ICESTAR 0x0036 | ||
263 | #define PV_SSTAR 0x0037 | ||
264 | #define PV_POWER4p 0x0038 | ||
265 | #define PV_970 0x0039 | ||
266 | #define PV_POWER5 0x003A | ||
267 | #define PV_POWER5p 0x003B | ||
268 | #define PV_970FX 0x003C | ||
269 | #define PV_630 0x0040 | ||
270 | #define PV_630p 0x0041 | ||
271 | #define PV_970MP 0x0044 | ||
272 | #define PV_BE 0x0070 | ||
273 | |||
274 | /* Platforms supported by PPC64 */ | ||
275 | #define PLATFORM_PSERIES 0x0100 | ||
276 | #define PLATFORM_PSERIES_LPAR 0x0101 | ||
277 | #define PLATFORM_ISERIES_LPAR 0x0201 | ||
278 | #define PLATFORM_LPAR 0x0001 | ||
279 | #define PLATFORM_POWERMAC 0x0400 | ||
280 | #define PLATFORM_MAPLE 0x0500 | ||
281 | #define PLATFORM_BPA 0x1000 | ||
282 | |||
283 | /* Compatibility with drivers coming from PPC32 world */ | ||
284 | #define _machine (systemcfg->platform) | ||
285 | #define _MACH_Pmac PLATFORM_POWERMAC | ||
286 | |||
287 | /* | ||
288 | * List of interrupt controllers. | ||
289 | */ | ||
290 | #define IC_INVALID 0 | ||
291 | #define IC_OPEN_PIC 1 | ||
292 | #define IC_PPC_XIC 2 | ||
293 | #define IC_BPA_IIC 3 | ||
294 | |||
295 | #define XGLUE(a,b) a##b | ||
296 | #define GLUE(a,b) XGLUE(a,b) | ||
297 | |||
298 | #ifdef __ASSEMBLY__ | ||
299 | |||
300 | #define _GLOBAL(name) \ | ||
301 | .section ".text"; \ | ||
302 | .align 2 ; \ | ||
303 | .globl name; \ | ||
304 | .globl GLUE(.,name); \ | ||
305 | .section ".opd","aw"; \ | ||
306 | name: \ | ||
307 | .quad GLUE(.,name); \ | ||
308 | .quad .TOC.@tocbase; \ | ||
309 | .quad 0; \ | ||
310 | .previous; \ | ||
311 | .type GLUE(.,name),@function; \ | ||
312 | GLUE(.,name): | ||
313 | |||
314 | #define _KPROBE(name) \ | ||
315 | .section ".kprobes.text","a"; \ | ||
316 | .align 2 ; \ | ||
317 | .globl name; \ | ||
318 | .globl GLUE(.,name); \ | ||
319 | .section ".opd","aw"; \ | ||
320 | name: \ | ||
321 | .quad GLUE(.,name); \ | ||
322 | .quad .TOC.@tocbase; \ | ||
323 | .quad 0; \ | ||
324 | .previous; \ | ||
325 | .type GLUE(.,name),@function; \ | ||
326 | GLUE(.,name): | ||
327 | |||
328 | #define _STATIC(name) \ | ||
329 | .section ".text"; \ | ||
330 | .align 2 ; \ | ||
331 | .section ".opd","aw"; \ | ||
332 | name: \ | ||
333 | .quad GLUE(.,name); \ | ||
334 | .quad .TOC.@tocbase; \ | ||
335 | .quad 0; \ | ||
336 | .previous; \ | ||
337 | .type GLUE(.,name),@function; \ | ||
338 | GLUE(.,name): | ||
339 | |||
340 | #else /* __ASSEMBLY__ */ | ||
341 | |||
342 | /* | ||
343 | * Default implementation of macro that returns current | ||
344 | * instruction pointer ("program counter"). | ||
345 | */ | ||
346 | #define current_text_addr() ({ __label__ _l; _l: &&_l;}) | ||
347 | |||
348 | /* Macros for setting and retrieving special purpose registers */ | ||
349 | |||
350 | #define mfmsr() ({unsigned long rval; \ | ||
351 | asm volatile("mfmsr %0" : "=r" (rval)); rval;}) | ||
352 | |||
353 | #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ | ||
354 | : : "r" (v)) | ||
355 | #define mtmsrd(v) __mtmsrd((v), 0) | ||
356 | |||
357 | #define mfspr(rn) ({unsigned long rval; \ | ||
358 | asm volatile("mfspr %0," __stringify(rn) \ | ||
359 | : "=r" (rval)); rval;}) | ||
360 | #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v)) | ||
361 | |||
362 | #define mftb() ({unsigned long rval; \ | ||
363 | asm volatile("mftb %0" : "=r" (rval)); rval;}) | ||
364 | |||
365 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) | ||
366 | #define mttbu(v) asm volatile("mttbu %0":: "r"(v)) | ||
367 | |||
368 | #define mfasr() ({unsigned long rval; \ | ||
369 | asm volatile("mfasr %0" : "=r" (rval)); rval;}) | ||
370 | |||
371 | static inline void set_tb(unsigned int upper, unsigned int lower) | ||
372 | { | ||
373 | mttbl(0); | ||
374 | mttbu(upper); | ||
375 | mttbl(lower); | ||
376 | } | ||
377 | |||
378 | #define __get_SP() ({unsigned long sp; \ | ||
379 | asm volatile("mr %0,1": "=r" (sp)); sp;}) | ||
380 | |||
381 | #ifdef __KERNEL__ | ||
382 | |||
383 | extern int have_of; | ||
384 | extern u64 ppc64_interrupt_controller; | ||
385 | |||
386 | struct task_struct; | ||
387 | void start_thread(struct pt_regs *regs, unsigned long fdptr, unsigned long sp); | ||
388 | void release_thread(struct task_struct *); | ||
389 | |||
390 | /* Prepare to copy thread state - unlazy all lazy status */ | ||
391 | extern void prepare_to_copy(struct task_struct *tsk); | ||
392 | |||
393 | /* Create a new kernel thread. */ | ||
394 | extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | ||
395 | |||
396 | /* Lazy FPU handling on uni-processor */ | ||
397 | extern struct task_struct *last_task_used_math; | ||
398 | extern struct task_struct *last_task_used_altivec; | ||
399 | |||
400 | /* 64-bit user address space is 44-bits (16TB user VM) */ | ||
401 | #define TASK_SIZE_USER64 (0x0000100000000000UL) | ||
402 | |||
403 | /* | ||
404 | * 32-bit user address space is 4GB - 1 page | ||
405 | * (this 1 page is needed so referencing of 0xFFFFFFFF generates EFAULT | ||
406 | */ | ||
407 | #define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE)) | ||
408 | |||
409 | #define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ | ||
410 | TASK_SIZE_USER32 : TASK_SIZE_USER64) | ||
411 | |||
412 | /* This decides where the kernel will search for a free chunk of vm | ||
413 | * space during mmap's. | ||
414 | */ | ||
415 | #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4)) | ||
416 | #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_USER64 / 4)) | ||
417 | |||
418 | #define TASK_UNMAPPED_BASE ((test_thread_flag(TIF_32BIT)||(ppcdebugset(PPCDBG_BINFMT_32ADDR))) ? \ | ||
419 | TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) | ||
420 | |||
421 | typedef struct { | ||
422 | unsigned long seg; | ||
423 | } mm_segment_t; | ||
424 | |||
425 | struct thread_struct { | ||
426 | unsigned long ksp; /* Kernel stack pointer */ | ||
427 | unsigned long ksp_vsid; | ||
428 | struct pt_regs *regs; /* Pointer to saved register state */ | ||
429 | mm_segment_t fs; /* for get_fs() validation */ | ||
430 | double fpr[32]; /* Complete floating point set */ | ||
431 | unsigned long fpscr; /* Floating point status (plus pad) */ | ||
432 | unsigned long fpexc_mode; /* Floating-point exception mode */ | ||
433 | unsigned long start_tb; /* Start purr when proc switched in */ | ||
434 | unsigned long accum_tb; /* Total accumilated purr for process */ | ||
435 | unsigned long vdso_base; /* base of the vDSO library */ | ||
436 | unsigned long dabr; /* Data address breakpoint register */ | ||
437 | #ifdef CONFIG_ALTIVEC | ||
438 | /* Complete AltiVec register set */ | ||
439 | vector128 vr[32] __attribute((aligned(16))); | ||
440 | /* AltiVec status */ | ||
441 | vector128 vscr __attribute((aligned(16))); | ||
442 | unsigned long vrsave; | ||
443 | int used_vr; /* set if process has used altivec */ | ||
444 | #endif /* CONFIG_ALTIVEC */ | ||
445 | }; | ||
446 | |||
447 | #define ARCH_MIN_TASKALIGN 16 | ||
448 | |||
449 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) | ||
450 | |||
451 | #define INIT_THREAD { \ | ||
452 | .ksp = INIT_SP, \ | ||
453 | .regs = (struct pt_regs *)INIT_SP - 1, \ | ||
454 | .fs = KERNEL_DS, \ | ||
455 | .fpr = {0}, \ | ||
456 | .fpscr = 0, \ | ||
457 | .fpexc_mode = MSR_FE0|MSR_FE1, \ | ||
458 | } | ||
459 | |||
460 | /* | ||
461 | * Return saved PC of a blocked thread. For now, this is the "user" PC | ||
462 | */ | ||
463 | #define thread_saved_pc(tsk) \ | ||
464 | ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) | ||
465 | |||
466 | unsigned long get_wchan(struct task_struct *p); | ||
467 | |||
468 | #define KSTK_EIP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->nip: 0) | ||
469 | #define KSTK_ESP(tsk) ((tsk)->thread.regs? (tsk)->thread.regs->gpr[1]: 0) | ||
470 | |||
471 | /* Get/set floating-point exception mode */ | ||
472 | #define GET_FPEXC_CTL(tsk, adr) get_fpexc_mode((tsk), (adr)) | ||
473 | #define SET_FPEXC_CTL(tsk, val) set_fpexc_mode((tsk), (val)) | ||
474 | |||
475 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); | ||
476 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); | ||
477 | |||
478 | static inline unsigned int __unpack_fe01(unsigned long msr_bits) | ||
479 | { | ||
480 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); | ||
481 | } | ||
482 | |||
483 | static inline unsigned long __pack_fe01(unsigned int fpmode) | ||
484 | { | ||
485 | return ((fpmode << 10) & MSR_FE0) | ((fpmode << 8) & MSR_FE1); | ||
486 | } | ||
487 | |||
488 | #define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0) | ||
489 | |||
490 | /* | ||
491 | * Prefetch macros. | ||
492 | */ | ||
493 | #define ARCH_HAS_PREFETCH | ||
494 | #define ARCH_HAS_PREFETCHW | ||
495 | #define ARCH_HAS_SPINLOCK_PREFETCH | ||
496 | |||
497 | static inline void prefetch(const void *x) | ||
498 | { | ||
499 | if (unlikely(!x)) | ||
500 | return; | ||
501 | |||
502 | __asm__ __volatile__ ("dcbt 0,%0" : : "r" (x)); | ||
503 | } | ||
504 | |||
505 | static inline void prefetchw(const void *x) | ||
506 | { | ||
507 | if (unlikely(!x)) | ||
508 | return; | ||
509 | |||
510 | __asm__ __volatile__ ("dcbtst 0,%0" : : "r" (x)); | ||
511 | } | ||
512 | |||
513 | #define spin_lock_prefetch(x) prefetchw(x) | ||
514 | |||
515 | #define HAVE_ARCH_PICK_MMAP_LAYOUT | ||
516 | |||
517 | static inline void ppc64_runlatch_on(void) | ||
518 | { | ||
519 | unsigned long ctrl; | ||
520 | |||
521 | if (cpu_has_feature(CPU_FTR_CTRL)) { | ||
522 | ctrl = mfspr(SPRN_CTRLF); | ||
523 | ctrl |= CTRL_RUNLATCH; | ||
524 | mtspr(SPRN_CTRLT, ctrl); | ||
525 | } | ||
526 | } | ||
527 | |||
528 | static inline void ppc64_runlatch_off(void) | ||
529 | { | ||
530 | unsigned long ctrl; | ||
531 | |||
532 | if (cpu_has_feature(CPU_FTR_CTRL)) { | ||
533 | ctrl = mfspr(SPRN_CTRLF); | ||
534 | ctrl &= ~CTRL_RUNLATCH; | ||
535 | mtspr(SPRN_CTRLT, ctrl); | ||
536 | } | ||
537 | } | ||
538 | |||
539 | #endif /* __KERNEL__ */ | ||
540 | |||
541 | #endif /* __ASSEMBLY__ */ | ||
542 | |||
543 | #ifdef __KERNEL__ | ||
544 | #define RUNLATCH_ON(REG) \ | ||
545 | BEGIN_FTR_SECTION \ | ||
546 | mfspr (REG),SPRN_CTRLF; \ | ||
547 | ori (REG),(REG),CTRL_RUNLATCH; \ | ||
548 | mtspr SPRN_CTRLT,(REG); \ | ||
549 | END_FTR_SECTION_IFSET(CPU_FTR_CTRL) | ||
550 | #endif | ||
551 | |||
552 | /* | ||
553 | * Number of entries in the SLB. If this ever changes we should handle | ||
554 | * it with a use a cpu feature fixup. | ||
555 | */ | ||
556 | #define SLB_NUM_ENTRIES 64 | ||
557 | |||
558 | #endif /* __ASM_PPC64_PROCESSOR_H */ | ||
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h index c02ec1d6b909..e8d0d2ab4c0f 100644 --- a/include/asm-ppc64/prom.h +++ b/include/asm-ppc64/prom.h | |||
@@ -14,6 +14,7 @@ | |||
14 | * as published by the Free Software Foundation; either version | 14 | * as published by the Free Software Foundation; either version |
15 | * 2 of the License, or (at your option) any later version. | 15 | * 2 of the License, or (at your option) any later version. |
16 | */ | 16 | */ |
17 | #include <linux/config.h> | ||
17 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_fs.h> |
18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
19 | 20 | ||
@@ -137,6 +138,9 @@ struct device_node { | |||
137 | struct kref kref; | 138 | struct kref kref; |
138 | unsigned long _flags; | 139 | unsigned long _flags; |
139 | void *data; | 140 | void *data; |
141 | #ifdef CONFIG_PPC_ISERIES | ||
142 | struct list_head Device_List; | ||
143 | #endif | ||
140 | }; | 144 | }; |
141 | 145 | ||
142 | extern struct device_node *of_chosen; | 146 | extern struct device_node *of_chosen; |
diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h index d86f742e9a21..c5e9052e7967 100644 --- a/include/asm-ppc64/smp.h +++ b/include/asm-ppc64/smp.h | |||
@@ -77,7 +77,6 @@ extern int smt_enabled_at_boot; | |||
77 | 77 | ||
78 | extern int smp_mpic_probe(void); | 78 | extern int smp_mpic_probe(void); |
79 | extern void smp_mpic_setup_cpu(int cpu); | 79 | extern void smp_mpic_setup_cpu(int cpu); |
80 | extern void smp_mpic_message_pass(int target, int msg); | ||
81 | extern void smp_generic_kick_cpu(int nr); | 80 | extern void smp_generic_kick_cpu(int nr); |
82 | 81 | ||
83 | extern void smp_generic_give_timebase(void); | 82 | extern void smp_generic_give_timebase(void); |
diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h index 375015c62f20..99b8ca52f101 100644 --- a/include/asm-ppc64/system.h +++ b/include/asm-ppc64/system.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <asm/page.h> | 13 | #include <asm/page.h> |
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/hw_irq.h> | 15 | #include <asm/hw_irq.h> |
16 | #include <asm/memory.h> | 16 | #include <asm/synch.h> |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Memory barrier. | 19 | * Memory barrier. |
@@ -48,7 +48,7 @@ | |||
48 | #ifdef CONFIG_SMP | 48 | #ifdef CONFIG_SMP |
49 | #define smp_mb() mb() | 49 | #define smp_mb() mb() |
50 | #define smp_rmb() rmb() | 50 | #define smp_rmb() rmb() |
51 | #define smp_wmb() __asm__ __volatile__ ("eieio" : : : "memory") | 51 | #define smp_wmb() eieio() |
52 | #define smp_read_barrier_depends() read_barrier_depends() | 52 | #define smp_read_barrier_depends() read_barrier_depends() |
53 | #else | 53 | #else |
54 | #define smp_mb() __asm__ __volatile__("": : :"memory") | 54 | #define smp_mb() __asm__ __volatile__("": : :"memory") |
@@ -120,8 +120,8 @@ extern void giveup_altivec(struct task_struct *); | |||
120 | extern void disable_kernel_altivec(void); | 120 | extern void disable_kernel_altivec(void); |
121 | extern void enable_kernel_altivec(void); | 121 | extern void enable_kernel_altivec(void); |
122 | extern int emulate_altivec(struct pt_regs *); | 122 | extern int emulate_altivec(struct pt_regs *); |
123 | extern void cvt_fd(float *from, double *to, unsigned long *fpscr); | 123 | extern void cvt_fd(float *from, double *to, struct thread_struct *thread); |
124 | extern void cvt_df(double *from, float *to, unsigned long *fpscr); | 124 | extern void cvt_df(double *from, float *to, struct thread_struct *thread); |
125 | 125 | ||
126 | #ifdef CONFIG_ALTIVEC | 126 | #ifdef CONFIG_ALTIVEC |
127 | extern void flush_altivec_to_thread(struct task_struct *); | 127 | extern void flush_altivec_to_thread(struct task_struct *); |
@@ -131,7 +131,12 @@ static inline void flush_altivec_to_thread(struct task_struct *t) | |||
131 | } | 131 | } |
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | static inline void flush_spe_to_thread(struct task_struct *t) | ||
135 | { | ||
136 | } | ||
137 | |||
134 | extern int mem_init_done; /* set on boot once kmalloc can be called */ | 138 | extern int mem_init_done; /* set on boot once kmalloc can be called */ |
139 | extern unsigned long memory_limit; | ||
135 | 140 | ||
136 | /* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ | 141 | /* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ |
137 | extern unsigned char e2a(unsigned char); | 142 | extern unsigned char e2a(unsigned char); |
@@ -144,12 +149,7 @@ struct thread_struct; | |||
144 | extern struct task_struct * _switch(struct thread_struct *prev, | 149 | extern struct task_struct * _switch(struct thread_struct *prev, |
145 | struct thread_struct *next); | 150 | struct thread_struct *next); |
146 | 151 | ||
147 | static inline int __is_processor(unsigned long pv) | 152 | extern int powersave_nap; /* set if nap mode can be used in idle loop */ |
148 | { | ||
149 | unsigned long pvr; | ||
150 | asm("mfspr %0, 0x11F" : "=r" (pvr)); | ||
151 | return(PVR_VER(pvr) == pv); | ||
152 | } | ||
153 | 153 | ||
154 | /* | 154 | /* |
155 | * Atomic exchange | 155 | * Atomic exchange |
diff --git a/include/asm-ppc64/tce.h b/include/asm-ppc64/tce.h new file mode 100644 index 000000000000..d40b6b42ab35 --- /dev/null +++ b/include/asm-ppc64/tce.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation | ||
3 | * Rewrite, cleanup: | ||
4 | * Copyright (C) 2004 Olof Johansson <olof@austin.ibm.com>, IBM Corporation | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef _ASM_TCE_H | ||
22 | #define _ASM_TCE_H | ||
23 | |||
24 | /* | ||
25 | * Tces come in two formats, one for the virtual bus and a different | ||
26 | * format for PCI | ||
27 | */ | ||
28 | #define TCE_VB 0 | ||
29 | #define TCE_PCI 1 | ||
30 | |||
31 | /* TCE page size is 4096 bytes (1 << 12) */ | ||
32 | |||
33 | #define TCE_SHIFT 12 | ||
34 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) | ||
35 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) | ||
36 | |||
37 | |||
38 | /* tce_entry | ||
39 | * Used by pSeries (SMP) and iSeries/pSeries LPAR, but there it's | ||
40 | * abstracted so layout is irrelevant. | ||
41 | */ | ||
42 | union tce_entry { | ||
43 | unsigned long te_word; | ||
44 | struct { | ||
45 | unsigned int tb_cacheBits :6; /* Cache hash bits - not used */ | ||
46 | unsigned int tb_rsvd :6; | ||
47 | unsigned long tb_rpn :40; /* Real page number */ | ||
48 | unsigned int tb_valid :1; /* Tce is valid (vb only) */ | ||
49 | unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */ | ||
50 | unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */ | ||
51 | unsigned int tb_pciwr :1; /* Write allowed (pci only) */ | ||
52 | unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */ | ||
53 | } te_bits; | ||
54 | #define te_cacheBits te_bits.tb_cacheBits | ||
55 | #define te_rpn te_bits.tb_rpn | ||
56 | #define te_valid te_bits.tb_valid | ||
57 | #define te_allio te_bits.tb_allio | ||
58 | #define te_lpindex te_bits.tb_lpindex | ||
59 | #define te_pciwr te_bits.tb_pciwr | ||
60 | #define te_rdwr te_bits.tb_rdwr | ||
61 | }; | ||
62 | |||
63 | |||
64 | #endif | ||
diff --git a/include/asm-ppc64/time.h b/include/asm-ppc64/time.h deleted file mode 100644 index c6c762cad8b0..000000000000 --- a/include/asm-ppc64/time.h +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* | ||
2 | * Common time prototypes and such for all ppc machines. | ||
3 | * | ||
4 | * Written by Cort Dougan (cort@cs.nmt.edu) to merge | ||
5 | * Paul Mackerras' version and mine for PReP and Pmac. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __PPC64_TIME_H | ||
14 | #define __PPC64_TIME_H | ||
15 | |||
16 | #ifdef __KERNEL__ | ||
17 | #include <linux/config.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <linux/mc146818rtc.h> | ||
20 | |||
21 | #include <asm/processor.h> | ||
22 | #include <asm/paca.h> | ||
23 | #include <asm/iSeries/HvCall.h> | ||
24 | |||
25 | /* time.c */ | ||
26 | extern unsigned long tb_ticks_per_jiffy; | ||
27 | extern unsigned long tb_ticks_per_usec; | ||
28 | extern unsigned long tb_ticks_per_sec; | ||
29 | extern unsigned long tb_to_xs; | ||
30 | extern unsigned tb_to_us; | ||
31 | extern unsigned long tb_last_stamp; | ||
32 | |||
33 | struct rtc_time; | ||
34 | extern void to_tm(int tim, struct rtc_time * tm); | ||
35 | extern time_t last_rtc_update; | ||
36 | |||
37 | void generic_calibrate_decr(void); | ||
38 | void setup_default_decr(void); | ||
39 | |||
40 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ | ||
41 | extern unsigned long ppc_proc_freq; | ||
42 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) | ||
43 | extern unsigned long ppc_tb_freq; | ||
44 | #define DEFAULT_TB_FREQ 125000000UL | ||
45 | |||
46 | /* | ||
47 | * By putting all of this stuff into a single struct we | ||
48 | * reduce the number of cache lines touched by do_gettimeofday. | ||
49 | * Both by collecting all of the data in one cache line and | ||
50 | * by touching only one TOC entry | ||
51 | */ | ||
52 | struct gettimeofday_vars { | ||
53 | unsigned long tb_to_xs; | ||
54 | unsigned long stamp_xsec; | ||
55 | unsigned long tb_orig_stamp; | ||
56 | }; | ||
57 | |||
58 | struct gettimeofday_struct { | ||
59 | unsigned long tb_ticks_per_sec; | ||
60 | struct gettimeofday_vars vars[2]; | ||
61 | struct gettimeofday_vars * volatile varp; | ||
62 | unsigned var_idx; | ||
63 | unsigned tb_to_us; | ||
64 | }; | ||
65 | |||
66 | struct div_result { | ||
67 | unsigned long result_high; | ||
68 | unsigned long result_low; | ||
69 | }; | ||
70 | |||
71 | int via_calibrate_decr(void); | ||
72 | |||
73 | static __inline__ unsigned long get_tb(void) | ||
74 | { | ||
75 | return mftb(); | ||
76 | } | ||
77 | |||
78 | /* Accessor functions for the decrementer register. */ | ||
79 | static __inline__ unsigned int get_dec(void) | ||
80 | { | ||
81 | return (mfspr(SPRN_DEC)); | ||
82 | } | ||
83 | |||
84 | static __inline__ void set_dec(int val) | ||
85 | { | ||
86 | #ifdef CONFIG_PPC_ISERIES | ||
87 | struct paca_struct *lpaca = get_paca(); | ||
88 | int cur_dec; | ||
89 | |||
90 | if (lpaca->lppaca.shared_proc) { | ||
91 | lpaca->lppaca.virtual_decr = val; | ||
92 | cur_dec = get_dec(); | ||
93 | if (cur_dec > val) | ||
94 | HvCall_setVirtualDecr(); | ||
95 | } else | ||
96 | #endif | ||
97 | mtspr(SPRN_DEC, val); | ||
98 | } | ||
99 | |||
100 | static inline unsigned long tb_ticks_since(unsigned long tstamp) | ||
101 | { | ||
102 | return get_tb() - tstamp; | ||
103 | } | ||
104 | |||
105 | #define mulhwu(x,y) \ | ||
106 | ({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;}) | ||
107 | #define mulhdu(x,y) \ | ||
108 | ({unsigned long z; asm ("mulhdu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;}) | ||
109 | |||
110 | |||
111 | unsigned mulhwu_scale_factor(unsigned, unsigned); | ||
112 | void div128_by_32( unsigned long dividend_high, unsigned long dividend_low, | ||
113 | unsigned divisor, struct div_result *dr ); | ||
114 | |||
115 | /* Used to store Processor Utilization register (purr) values */ | ||
116 | |||
117 | struct cpu_usage { | ||
118 | u64 current_tb; /* Holds the current purr register values */ | ||
119 | }; | ||
120 | |||
121 | DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array); | ||
122 | |||
123 | #endif /* __KERNEL__ */ | ||
124 | #endif /* __PPC64_TIME_H */ | ||
diff --git a/include/asm-ppc64/tlbflush.h b/include/asm-ppc64/tlbflush.h index 74271d7c1d16..626f505c6ee3 100644 --- a/include/asm-ppc64/tlbflush.h +++ b/include/asm-ppc64/tlbflush.h | |||
@@ -20,10 +20,8 @@ | |||
20 | struct mm_struct; | 20 | struct mm_struct; |
21 | struct ppc64_tlb_batch { | 21 | struct ppc64_tlb_batch { |
22 | unsigned long index; | 22 | unsigned long index; |
23 | unsigned long context; | ||
24 | struct mm_struct *mm; | 23 | struct mm_struct *mm; |
25 | pte_t pte[PPC64_TLB_BATCH_NR]; | 24 | pte_t pte[PPC64_TLB_BATCH_NR]; |
26 | unsigned long addr[PPC64_TLB_BATCH_NR]; | ||
27 | unsigned long vaddr[PPC64_TLB_BATCH_NR]; | 25 | unsigned long vaddr[PPC64_TLB_BATCH_NR]; |
28 | unsigned int large; | 26 | unsigned int large; |
29 | }; | 27 | }; |
@@ -48,8 +46,7 @@ static inline void flush_tlb_pending(void) | |||
48 | #define flush_tlb_kernel_range(start, end) flush_tlb_pending() | 46 | #define flush_tlb_kernel_range(start, end) flush_tlb_pending() |
49 | #define flush_tlb_pgtables(mm, start, end) do { } while (0) | 47 | #define flush_tlb_pgtables(mm, start, end) do { } while (0) |
50 | 48 | ||
51 | extern void flush_hash_page(unsigned long context, unsigned long ea, pte_t pte, | 49 | extern void flush_hash_page(unsigned long va, pte_t pte, int local); |
52 | int local); | 50 | void flush_hash_range(unsigned long number, int local); |
53 | void flush_hash_range(unsigned long context, unsigned long number, int local); | ||
54 | 51 | ||
55 | #endif /* _PPC64_TLBFLUSH_H */ | 52 | #endif /* _PPC64_TLBFLUSH_H */ |
diff --git a/include/asm-ppc64/udbg.h b/include/asm-ppc64/udbg.h index c786604aef02..8192fb8541cc 100644 --- a/include/asm-ppc64/udbg.h +++ b/include/asm-ppc64/udbg.h | |||
@@ -28,4 +28,7 @@ extern unsigned long udbg_ifdebug(unsigned long flags); | |||
28 | extern void __init ppcdbg_initialize(void); | 28 | extern void __init ppcdbg_initialize(void); |
29 | 29 | ||
30 | extern void udbg_init_uart(void __iomem *comport, unsigned int speed); | 30 | extern void udbg_init_uart(void __iomem *comport, unsigned int speed); |
31 | |||
32 | struct device_node; | ||
33 | extern void udbg_init_scc(struct device_node *np); | ||
31 | #endif | 34 | #endif |
diff --git a/include/asm-ppc64/uninorth.h b/include/asm-ppc64/uninorth.h deleted file mode 100644 index 7ad7059f2c80..000000000000 --- a/include/asm-ppc64/uninorth.h +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #include <asm-ppc/uninorth.h> | ||
2 | |||
diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h deleted file mode 100644 index 977bc980c1af..000000000000 --- a/include/asm-ppc64/unistd.h +++ /dev/null | |||
@@ -1,487 +0,0 @@ | |||
1 | #ifndef _ASM_PPC_UNISTD_H_ | ||
2 | #define _ASM_PPC_UNISTD_H_ | ||
3 | |||
4 | /* | ||
5 | * This file contains the system call numbers. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #define __NR_restart_syscall 0 | ||
14 | #define __NR_exit 1 | ||
15 | #define __NR_fork 2 | ||
16 | #define __NR_read 3 | ||
17 | #define __NR_write 4 | ||
18 | #define __NR_open 5 | ||
19 | #define __NR_close 6 | ||
20 | #define __NR_waitpid 7 | ||
21 | #define __NR_creat 8 | ||
22 | #define __NR_link 9 | ||
23 | #define __NR_unlink 10 | ||
24 | #define __NR_execve 11 | ||
25 | #define __NR_chdir 12 | ||
26 | #define __NR_time 13 | ||
27 | #define __NR_mknod 14 | ||
28 | #define __NR_chmod 15 | ||
29 | #define __NR_lchown 16 | ||
30 | #define __NR_break 17 | ||
31 | #define __NR_oldstat 18 | ||
32 | #define __NR_lseek 19 | ||
33 | #define __NR_getpid 20 | ||
34 | #define __NR_mount 21 | ||
35 | #define __NR_umount 22 | ||
36 | #define __NR_setuid 23 | ||
37 | #define __NR_getuid 24 | ||
38 | #define __NR_stime 25 | ||
39 | #define __NR_ptrace 26 | ||
40 | #define __NR_alarm 27 | ||
41 | #define __NR_oldfstat 28 | ||
42 | #define __NR_pause 29 | ||
43 | #define __NR_utime 30 | ||
44 | #define __NR_stty 31 | ||
45 | #define __NR_gtty 32 | ||
46 | #define __NR_access 33 | ||
47 | #define __NR_nice 34 | ||
48 | #define __NR_ftime 35 | ||
49 | #define __NR_sync 36 | ||
50 | #define __NR_kill 37 | ||
51 | #define __NR_rename 38 | ||
52 | #define __NR_mkdir 39 | ||
53 | #define __NR_rmdir 40 | ||
54 | #define __NR_dup 41 | ||
55 | #define __NR_pipe 42 | ||
56 | #define __NR_times 43 | ||
57 | #define __NR_prof 44 | ||
58 | #define __NR_brk 45 | ||
59 | #define __NR_setgid 46 | ||
60 | #define __NR_getgid 47 | ||
61 | #define __NR_signal 48 | ||
62 | #define __NR_geteuid 49 | ||
63 | #define __NR_getegid 50 | ||
64 | #define __NR_acct 51 | ||
65 | #define __NR_umount2 52 | ||
66 | #define __NR_lock 53 | ||
67 | #define __NR_ioctl 54 | ||
68 | #define __NR_fcntl 55 | ||
69 | #define __NR_mpx 56 | ||
70 | #define __NR_setpgid 57 | ||
71 | #define __NR_ulimit 58 | ||
72 | #define __NR_oldolduname 59 | ||
73 | #define __NR_umask 60 | ||
74 | #define __NR_chroot 61 | ||
75 | #define __NR_ustat 62 | ||
76 | #define __NR_dup2 63 | ||
77 | #define __NR_getppid 64 | ||
78 | #define __NR_getpgrp 65 | ||
79 | #define __NR_setsid 66 | ||
80 | #define __NR_sigaction 67 | ||
81 | #define __NR_sgetmask 68 | ||
82 | #define __NR_ssetmask 69 | ||
83 | #define __NR_setreuid 70 | ||
84 | #define __NR_setregid 71 | ||
85 | #define __NR_sigsuspend 72 | ||
86 | #define __NR_sigpending 73 | ||
87 | #define __NR_sethostname 74 | ||
88 | #define __NR_setrlimit 75 | ||
89 | #define __NR_getrlimit 76 | ||
90 | #define __NR_getrusage 77 | ||
91 | #define __NR_gettimeofday 78 | ||
92 | #define __NR_settimeofday 79 | ||
93 | #define __NR_getgroups 80 | ||
94 | #define __NR_setgroups 81 | ||
95 | #define __NR_select 82 | ||
96 | #define __NR_symlink 83 | ||
97 | #define __NR_oldlstat 84 | ||
98 | #define __NR_readlink 85 | ||
99 | #define __NR_uselib 86 | ||
100 | #define __NR_swapon 87 | ||
101 | #define __NR_reboot 88 | ||
102 | #define __NR_readdir 89 | ||
103 | #define __NR_mmap 90 | ||
104 | #define __NR_munmap 91 | ||
105 | #define __NR_truncate 92 | ||
106 | #define __NR_ftruncate 93 | ||
107 | #define __NR_fchmod 94 | ||
108 | #define __NR_fchown 95 | ||
109 | #define __NR_getpriority 96 | ||
110 | #define __NR_setpriority 97 | ||
111 | #define __NR_profil 98 | ||
112 | #define __NR_statfs 99 | ||
113 | #define __NR_fstatfs 100 | ||
114 | #define __NR_ioperm 101 | ||
115 | #define __NR_socketcall 102 | ||
116 | #define __NR_syslog 103 | ||
117 | #define __NR_setitimer 104 | ||
118 | #define __NR_getitimer 105 | ||
119 | #define __NR_stat 106 | ||
120 | #define __NR_lstat 107 | ||
121 | #define __NR_fstat 108 | ||
122 | #define __NR_olduname 109 | ||
123 | #define __NR_iopl 110 | ||
124 | #define __NR_vhangup 111 | ||
125 | #define __NR_idle 112 | ||
126 | #define __NR_vm86 113 | ||
127 | #define __NR_wait4 114 | ||
128 | #define __NR_swapoff 115 | ||
129 | #define __NR_sysinfo 116 | ||
130 | #define __NR_ipc 117 | ||
131 | #define __NR_fsync 118 | ||
132 | #define __NR_sigreturn 119 | ||
133 | #define __NR_clone 120 | ||
134 | #define __NR_setdomainname 121 | ||
135 | #define __NR_uname 122 | ||
136 | #define __NR_modify_ldt 123 | ||
137 | #define __NR_adjtimex 124 | ||
138 | #define __NR_mprotect 125 | ||
139 | #define __NR_sigprocmask 126 | ||
140 | #define __NR_create_module 127 | ||
141 | #define __NR_init_module 128 | ||
142 | #define __NR_delete_module 129 | ||
143 | #define __NR_get_kernel_syms 130 | ||
144 | #define __NR_quotactl 131 | ||
145 | #define __NR_getpgid 132 | ||
146 | #define __NR_fchdir 133 | ||
147 | #define __NR_bdflush 134 | ||
148 | #define __NR_sysfs 135 | ||
149 | #define __NR_personality 136 | ||
150 | #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ | ||
151 | #define __NR_setfsuid 138 | ||
152 | #define __NR_setfsgid 139 | ||
153 | #define __NR__llseek 140 | ||
154 | #define __NR_getdents 141 | ||
155 | #define __NR__newselect 142 | ||
156 | #define __NR_flock 143 | ||
157 | #define __NR_msync 144 | ||
158 | #define __NR_readv 145 | ||
159 | #define __NR_writev 146 | ||
160 | #define __NR_getsid 147 | ||
161 | #define __NR_fdatasync 148 | ||
162 | #define __NR__sysctl 149 | ||
163 | #define __NR_mlock 150 | ||
164 | #define __NR_munlock 151 | ||
165 | #define __NR_mlockall 152 | ||
166 | #define __NR_munlockall 153 | ||
167 | #define __NR_sched_setparam 154 | ||
168 | #define __NR_sched_getparam 155 | ||
169 | #define __NR_sched_setscheduler 156 | ||
170 | #define __NR_sched_getscheduler 157 | ||
171 | #define __NR_sched_yield 158 | ||
172 | #define __NR_sched_get_priority_max 159 | ||
173 | #define __NR_sched_get_priority_min 160 | ||
174 | #define __NR_sched_rr_get_interval 161 | ||
175 | #define __NR_nanosleep 162 | ||
176 | #define __NR_mremap 163 | ||
177 | #define __NR_setresuid 164 | ||
178 | #define __NR_getresuid 165 | ||
179 | #define __NR_query_module 166 | ||
180 | #define __NR_poll 167 | ||
181 | #define __NR_nfsservctl 168 | ||
182 | #define __NR_setresgid 169 | ||
183 | #define __NR_getresgid 170 | ||
184 | #define __NR_prctl 171 | ||
185 | #define __NR_rt_sigreturn 172 | ||
186 | #define __NR_rt_sigaction 173 | ||
187 | #define __NR_rt_sigprocmask 174 | ||
188 | #define __NR_rt_sigpending 175 | ||
189 | #define __NR_rt_sigtimedwait 176 | ||
190 | #define __NR_rt_sigqueueinfo 177 | ||
191 | #define __NR_rt_sigsuspend 178 | ||
192 | #define __NR_pread64 179 | ||
193 | #define __NR_pwrite64 180 | ||
194 | #define __NR_chown 181 | ||
195 | #define __NR_getcwd 182 | ||
196 | #define __NR_capget 183 | ||
197 | #define __NR_capset 184 | ||
198 | #define __NR_sigaltstack 185 | ||
199 | #define __NR_sendfile 186 | ||
200 | #define __NR_getpmsg 187 /* some people actually want streams */ | ||
201 | #define __NR_putpmsg 188 /* some people actually want streams */ | ||
202 | #define __NR_vfork 189 | ||
203 | #define __NR_ugetrlimit 190 /* SuS compliant getrlimit */ | ||
204 | #define __NR_readahead 191 | ||
205 | /* #define __NR_mmap2 192 32bit only */ | ||
206 | /* #define __NR_truncate64 193 32bit only */ | ||
207 | /* #define __NR_ftruncate64 194 32bit only */ | ||
208 | /* #define __NR_stat64 195 32bit only */ | ||
209 | /* #define __NR_lstat64 196 32bit only */ | ||
210 | /* #define __NR_fstat64 197 32bit only */ | ||
211 | #define __NR_pciconfig_read 198 | ||
212 | #define __NR_pciconfig_write 199 | ||
213 | #define __NR_pciconfig_iobase 200 | ||
214 | #define __NR_multiplexer 201 | ||
215 | #define __NR_getdents64 202 | ||
216 | #define __NR_pivot_root 203 | ||
217 | /* #define __NR_fcntl64 204 32bit only */ | ||
218 | #define __NR_madvise 205 | ||
219 | #define __NR_mincore 206 | ||
220 | #define __NR_gettid 207 | ||
221 | #define __NR_tkill 208 | ||
222 | #define __NR_setxattr 209 | ||
223 | #define __NR_lsetxattr 210 | ||
224 | #define __NR_fsetxattr 211 | ||
225 | #define __NR_getxattr 212 | ||
226 | #define __NR_lgetxattr 213 | ||
227 | #define __NR_fgetxattr 214 | ||
228 | #define __NR_listxattr 215 | ||
229 | #define __NR_llistxattr 216 | ||
230 | #define __NR_flistxattr 217 | ||
231 | #define __NR_removexattr 218 | ||
232 | #define __NR_lremovexattr 219 | ||
233 | #define __NR_fremovexattr 220 | ||
234 | #define __NR_futex 221 | ||
235 | #define __NR_sched_setaffinity 222 | ||
236 | #define __NR_sched_getaffinity 223 | ||
237 | /* 224 currently unused */ | ||
238 | #define __NR_tuxcall 225 | ||
239 | /* #define __NR_sendfile64 226 32bit only */ | ||
240 | #define __NR_io_setup 227 | ||
241 | #define __NR_io_destroy 228 | ||
242 | #define __NR_io_getevents 229 | ||
243 | #define __NR_io_submit 230 | ||
244 | #define __NR_io_cancel 231 | ||
245 | #define __NR_set_tid_address 232 | ||
246 | #define __NR_fadvise64 233 | ||
247 | #define __NR_exit_group 234 | ||
248 | #define __NR_lookup_dcookie 235 | ||
249 | #define __NR_epoll_create 236 | ||
250 | #define __NR_epoll_ctl 237 | ||
251 | #define __NR_epoll_wait 238 | ||
252 | #define __NR_remap_file_pages 239 | ||
253 | #define __NR_timer_create 240 | ||
254 | #define __NR_timer_settime 241 | ||
255 | #define __NR_timer_gettime 242 | ||
256 | #define __NR_timer_getoverrun 243 | ||
257 | #define __NR_timer_delete 244 | ||
258 | #define __NR_clock_settime 245 | ||
259 | #define __NR_clock_gettime 246 | ||
260 | #define __NR_clock_getres 247 | ||
261 | #define __NR_clock_nanosleep 248 | ||
262 | #define __NR_swapcontext 249 | ||
263 | #define __NR_tgkill 250 | ||
264 | #define __NR_utimes 251 | ||
265 | #define __NR_statfs64 252 | ||
266 | #define __NR_fstatfs64 253 | ||
267 | /* #define __NR_fadvise64_64 254 32bit only */ | ||
268 | #define __NR_rtas 255 | ||
269 | /* Number 256 is reserved for sys_debug_setcontext */ | ||
270 | /* Number 257 is reserved for vserver */ | ||
271 | /* 258 currently unused */ | ||
272 | #define __NR_mbind 259 | ||
273 | #define __NR_get_mempolicy 260 | ||
274 | #define __NR_set_mempolicy 261 | ||
275 | #define __NR_mq_open 262 | ||
276 | #define __NR_mq_unlink 263 | ||
277 | #define __NR_mq_timedsend 264 | ||
278 | #define __NR_mq_timedreceive 265 | ||
279 | #define __NR_mq_notify 266 | ||
280 | #define __NR_mq_getsetattr 267 | ||
281 | #define __NR_kexec_load 268 | ||
282 | #define __NR_add_key 269 | ||
283 | #define __NR_request_key 270 | ||
284 | #define __NR_keyctl 271 | ||
285 | #define __NR_waitid 272 | ||
286 | #define __NR_ioprio_set 273 | ||
287 | #define __NR_ioprio_get 274 | ||
288 | #define __NR_inotify_init 275 | ||
289 | #define __NR_inotify_add_watch 276 | ||
290 | #define __NR_inotify_rm_watch 277 | ||
291 | |||
292 | #define __NR_syscalls 278 | ||
293 | #ifdef __KERNEL__ | ||
294 | #define NR_syscalls __NR_syscalls | ||
295 | #endif | ||
296 | |||
297 | #ifndef __ASSEMBLY__ | ||
298 | |||
299 | /* On powerpc a system call basically clobbers the same registers like a | ||
300 | * function call, with the exception of LR (which is needed for the | ||
301 | * "sc; bnslr" sequence) and CR (where only CR0.SO is clobbered to signal | ||
302 | * an error return status). | ||
303 | */ | ||
304 | |||
305 | #define __syscall_nr(nr, type, name, args...) \ | ||
306 | unsigned long __sc_ret, __sc_err; \ | ||
307 | { \ | ||
308 | register unsigned long __sc_0 __asm__ ("r0"); \ | ||
309 | register unsigned long __sc_3 __asm__ ("r3"); \ | ||
310 | register unsigned long __sc_4 __asm__ ("r4"); \ | ||
311 | register unsigned long __sc_5 __asm__ ("r5"); \ | ||
312 | register unsigned long __sc_6 __asm__ ("r6"); \ | ||
313 | register unsigned long __sc_7 __asm__ ("r7"); \ | ||
314 | register unsigned long __sc_8 __asm__ ("r8"); \ | ||
315 | \ | ||
316 | __sc_loadargs_##nr(name, args); \ | ||
317 | __asm__ __volatile__ \ | ||
318 | ("sc \n\t" \ | ||
319 | "mfcr %0 " \ | ||
320 | : "=&r" (__sc_0), \ | ||
321 | "=&r" (__sc_3), "=&r" (__sc_4), \ | ||
322 | "=&r" (__sc_5), "=&r" (__sc_6), \ | ||
323 | "=&r" (__sc_7), "=&r" (__sc_8) \ | ||
324 | : __sc_asm_input_##nr \ | ||
325 | : "cr0", "ctr", "memory", \ | ||
326 | "r9", "r10","r11", "r12"); \ | ||
327 | __sc_ret = __sc_3; \ | ||
328 | __sc_err = __sc_0; \ | ||
329 | } \ | ||
330 | if (__sc_err & 0x10000000) \ | ||
331 | { \ | ||
332 | errno = __sc_ret; \ | ||
333 | __sc_ret = -1; \ | ||
334 | } \ | ||
335 | return (type) __sc_ret | ||
336 | |||
337 | #define __sc_loadargs_0(name, dummy...) \ | ||
338 | __sc_0 = __NR_##name | ||
339 | #define __sc_loadargs_1(name, arg1) \ | ||
340 | __sc_loadargs_0(name); \ | ||
341 | __sc_3 = (unsigned long) (arg1) | ||
342 | #define __sc_loadargs_2(name, arg1, arg2) \ | ||
343 | __sc_loadargs_1(name, arg1); \ | ||
344 | __sc_4 = (unsigned long) (arg2) | ||
345 | #define __sc_loadargs_3(name, arg1, arg2, arg3) \ | ||
346 | __sc_loadargs_2(name, arg1, arg2); \ | ||
347 | __sc_5 = (unsigned long) (arg3) | ||
348 | #define __sc_loadargs_4(name, arg1, arg2, arg3, arg4) \ | ||
349 | __sc_loadargs_3(name, arg1, arg2, arg3); \ | ||
350 | __sc_6 = (unsigned long) (arg4) | ||
351 | #define __sc_loadargs_5(name, arg1, arg2, arg3, arg4, arg5) \ | ||
352 | __sc_loadargs_4(name, arg1, arg2, arg3, arg4); \ | ||
353 | __sc_7 = (unsigned long) (arg5) | ||
354 | #define __sc_loadargs_6(name, arg1, arg2, arg3, arg4, arg5, arg6) \ | ||
355 | __sc_loadargs_5(name, arg1, arg2, arg3, arg4, arg5); \ | ||
356 | __sc_8 = (unsigned long) (arg6) | ||
357 | |||
358 | #define __sc_asm_input_0 "0" (__sc_0) | ||
359 | #define __sc_asm_input_1 __sc_asm_input_0, "1" (__sc_3) | ||
360 | #define __sc_asm_input_2 __sc_asm_input_1, "2" (__sc_4) | ||
361 | #define __sc_asm_input_3 __sc_asm_input_2, "3" (__sc_5) | ||
362 | #define __sc_asm_input_4 __sc_asm_input_3, "4" (__sc_6) | ||
363 | #define __sc_asm_input_5 __sc_asm_input_4, "5" (__sc_7) | ||
364 | #define __sc_asm_input_6 __sc_asm_input_5, "6" (__sc_8) | ||
365 | |||
366 | #define _syscall0(type,name) \ | ||
367 | type name(void) \ | ||
368 | { \ | ||
369 | __syscall_nr(0, type, name); \ | ||
370 | } | ||
371 | |||
372 | #define _syscall1(type,name,type1,arg1) \ | ||
373 | type name(type1 arg1) \ | ||
374 | { \ | ||
375 | __syscall_nr(1, type, name, arg1); \ | ||
376 | } | ||
377 | |||
378 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | ||
379 | type name(type1 arg1, type2 arg2) \ | ||
380 | { \ | ||
381 | __syscall_nr(2, type, name, arg1, arg2); \ | ||
382 | } | ||
383 | |||
384 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ | ||
385 | type name(type1 arg1, type2 arg2, type3 arg3) \ | ||
386 | { \ | ||
387 | __syscall_nr(3, type, name, arg1, arg2, arg3); \ | ||
388 | } | ||
389 | |||
390 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | ||
391 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ | ||
392 | { \ | ||
393 | __syscall_nr(4, type, name, arg1, arg2, arg3, arg4); \ | ||
394 | } | ||
395 | |||
396 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ | ||
397 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | ||
398 | { \ | ||
399 | __syscall_nr(5, type, name, arg1, arg2, arg3, arg4, arg5); \ | ||
400 | } | ||
401 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ | ||
402 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ | ||
403 | { \ | ||
404 | __syscall_nr(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6); \ | ||
405 | } | ||
406 | |||
407 | #ifdef __KERNEL_SYSCALLS__ | ||
408 | |||
409 | /* | ||
410 | * Forking from kernel space will result in the child getting a new, | ||
411 | * empty kernel stack area. Thus the child cannot access automatic | ||
412 | * variables set in the parent unless they are in registers, and the | ||
413 | * procedure where the fork was done cannot return to its caller in | ||
414 | * the child. | ||
415 | */ | ||
416 | |||
417 | /* | ||
418 | * System call prototypes. | ||
419 | */ | ||
420 | static inline _syscall3(int, execve, __const__ char *, file, char **, argv, | ||
421 | char **,envp) | ||
422 | |||
423 | #endif /* __KERNEL_SYSCALLS__ */ | ||
424 | |||
425 | #ifdef __KERNEL__ | ||
426 | |||
427 | #include <linux/types.h> | ||
428 | #include <linux/compiler.h> | ||
429 | #include <linux/linkage.h> | ||
430 | |||
431 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
432 | #define __ARCH_WANT_OLD_READDIR | ||
433 | #define __ARCH_WANT_STAT64 | ||
434 | #define __ARCH_WANT_SYS_ALARM | ||
435 | #define __ARCH_WANT_SYS_GETHOSTNAME | ||
436 | #define __ARCH_WANT_SYS_PAUSE | ||
437 | #define __ARCH_WANT_SYS_SGETMASK | ||
438 | #define __ARCH_WANT_SYS_SIGNAL | ||
439 | #define __ARCH_WANT_SYS_TIME | ||
440 | #define __ARCH_WANT_COMPAT_SYS_TIME | ||
441 | #define __ARCH_WANT_SYS_UTIME | ||
442 | #define __ARCH_WANT_SYS_WAITPID | ||
443 | #define __ARCH_WANT_SYS_SOCKETCALL | ||
444 | #define __ARCH_WANT_SYS_FADVISE64 | ||
445 | #define __ARCH_WANT_SYS_GETPGRP | ||
446 | #define __ARCH_WANT_SYS_LLSEEK | ||
447 | #define __ARCH_WANT_SYS_NICE | ||
448 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
449 | #define __ARCH_WANT_SYS_OLDUMOUNT | ||
450 | #define __ARCH_WANT_SYS_SIGPENDING | ||
451 | #define __ARCH_WANT_SYS_SIGPROCMASK | ||
452 | #define __ARCH_WANT_SYS_RT_SIGACTION | ||
453 | |||
454 | unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot, | ||
455 | unsigned long flags, unsigned long fd, off_t offset); | ||
456 | struct pt_regs; | ||
457 | int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, | ||
458 | unsigned long a3, unsigned long a4, unsigned long a5, | ||
459 | struct pt_regs *regs); | ||
460 | int sys_clone(unsigned long clone_flags, unsigned long p2, unsigned long p3, | ||
461 | unsigned long p4, unsigned long p5, unsigned long p6, | ||
462 | struct pt_regs *regs); | ||
463 | int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, | ||
464 | unsigned long p4, unsigned long p5, unsigned long p6, | ||
465 | struct pt_regs *regs); | ||
466 | int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, | ||
467 | unsigned long p4, unsigned long p5, unsigned long p6, | ||
468 | struct pt_regs *regs); | ||
469 | int sys_pipe(int __user *fildes); | ||
470 | int sys_ptrace(long request, long pid, long addr, long data); | ||
471 | struct sigaction; | ||
472 | long sys_rt_sigaction(int sig, const struct sigaction __user *act, | ||
473 | struct sigaction __user *oact, size_t sigsetsize); | ||
474 | |||
475 | /* | ||
476 | * "Conditional" syscalls | ||
477 | * | ||
478 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
479 | * but it doesn't work on all toolchains, so we just do it by hand | ||
480 | */ | ||
481 | #define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall") | ||
482 | |||
483 | #endif /* __KERNEL__ */ | ||
484 | |||
485 | #endif /* __ASSEMBLY__ */ | ||
486 | |||
487 | #endif /* _ASM_PPC_UNISTD_H_ */ | ||
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h deleted file mode 100644 index 1092af55d707..000000000000 --- a/include/asm-ppc64/xics.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * arch/ppc64/kernel/xics.h | ||
3 | * | ||
4 | * Copyright 2000 IBM Corporation. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _PPC64_KERNEL_XICS_H | ||
13 | #define _PPC64_KERNEL_XICS_H | ||
14 | |||
15 | #include <linux/cache.h> | ||
16 | |||
17 | void xics_init_IRQ(void); | ||
18 | int xics_get_irq(struct pt_regs *); | ||
19 | void xics_setup_cpu(void); | ||
20 | void xics_teardown_cpu(int secondary); | ||
21 | void xics_cause_IPI(int cpu); | ||
22 | void xics_request_IPIs(void); | ||
23 | void xics_migrate_irqs_away(void); | ||
24 | |||
25 | /* first argument is ignored for now*/ | ||
26 | void pSeriesLP_cppr_info(int n_cpu, u8 value); | ||
27 | |||
28 | struct xics_ipi_struct { | ||
29 | volatile unsigned long value; | ||
30 | } ____cacheline_aligned; | ||
31 | |||
32 | extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; | ||
33 | |||
34 | #endif /* _PPC64_KERNEL_XICS_H */ | ||
diff --git a/include/asm-s390/rwsem.h b/include/asm-s390/rwsem.h index 8c0cebbfc034..0422a085dd56 100644 --- a/include/asm-s390/rwsem.h +++ b/include/asm-s390/rwsem.h | |||
@@ -351,5 +351,10 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) | |||
351 | return new; | 351 | return new; |
352 | } | 352 | } |
353 | 353 | ||
354 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
355 | { | ||
356 | return (sem->count != 0); | ||
357 | } | ||
358 | |||
354 | #endif /* __KERNEL__ */ | 359 | #endif /* __KERNEL__ */ |
355 | #endif /* _S390_RWSEM_H */ | 360 | #endif /* _S390_RWSEM_H */ |
diff --git a/include/asm-s390/semaphore.h b/include/asm-s390/semaphore.h index 873def6f363a..702cf436698c 100644 --- a/include/asm-s390/semaphore.h +++ b/include/asm-s390/semaphore.h | |||
@@ -29,9 +29,6 @@ struct semaphore { | |||
29 | #define __SEMAPHORE_INITIALIZER(name,count) \ | 29 | #define __SEMAPHORE_INITIALIZER(name,count) \ |
30 | { ATOMIC_INIT(count), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) } | 30 | { ATOMIC_INIT(count), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) } |
31 | 31 | ||
32 | #define __MUTEX_INITIALIZER(name) \ | ||
33 | __SEMAPHORE_INITIALIZER(name,1) | ||
34 | |||
35 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 32 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
36 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 33 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
37 | 34 | ||
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h index 0d51c484c2ea..348a88137445 100644 --- a/include/asm-s390/setup.h +++ b/include/asm-s390/setup.h | |||
@@ -8,11 +8,14 @@ | |||
8 | #ifndef _ASM_S390_SETUP_H | 8 | #ifndef _ASM_S390_SETUP_H |
9 | #define _ASM_S390_SETUP_H | 9 | #define _ASM_S390_SETUP_H |
10 | 10 | ||
11 | #include <asm/types.h> | ||
12 | |||
11 | #define PARMAREA 0x10400 | 13 | #define PARMAREA 0x10400 |
12 | #define COMMAND_LINE_SIZE 896 | 14 | #define COMMAND_LINE_SIZE 896 |
13 | #define RAMDISK_ORIGIN 0x800000 | 15 | #define RAMDISK_ORIGIN 0x800000 |
14 | #define RAMDISK_SIZE 0x800000 | 16 | #define RAMDISK_SIZE 0x800000 |
15 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ | 17 | #define MEMORY_CHUNKS 16 /* max 0x7fff */ |
18 | #define IPL_PARMBLOCK_ORIGIN 0x2000 | ||
16 | 19 | ||
17 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
18 | 21 | ||
@@ -64,6 +67,53 @@ extern unsigned int console_irq; | |||
64 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) | 67 | #define SET_CONSOLE_3215 do { console_mode = 2; } while (0) |
65 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) | 68 | #define SET_CONSOLE_3270 do { console_mode = 3; } while (0) |
66 | 69 | ||
70 | struct ipl_list_header { | ||
71 | u32 length; | ||
72 | u8 reserved[3]; | ||
73 | u8 version; | ||
74 | } __attribute__((packed)); | ||
75 | |||
76 | struct ipl_block_fcp { | ||
77 | u32 length; | ||
78 | u8 pbt; | ||
79 | u8 reserved1[322-1]; | ||
80 | u16 devno; | ||
81 | u8 reserved2[4]; | ||
82 | u64 wwpn; | ||
83 | u64 lun; | ||
84 | u32 bootprog; | ||
85 | u8 reserved3[12]; | ||
86 | u64 br_lba; | ||
87 | u32 scp_data_len; | ||
88 | u8 reserved4[260]; | ||
89 | u8 scp_data[]; | ||
90 | } __attribute__((packed)); | ||
91 | |||
92 | struct ipl_parameter_block { | ||
93 | union { | ||
94 | u32 length; | ||
95 | struct ipl_list_header header; | ||
96 | } hdr; | ||
97 | struct ipl_block_fcp fcp; | ||
98 | } __attribute__((packed)); | ||
99 | |||
100 | #define IPL_MAX_SUPPORTED_VERSION (0) | ||
101 | |||
102 | #define IPL_TYPE_FCP (0) | ||
103 | |||
104 | /* | ||
105 | * IPL validity flags and parameters as detected in head.S | ||
106 | */ | ||
107 | extern u32 ipl_parameter_flags; | ||
108 | extern u16 ipl_devno; | ||
109 | |||
110 | #define IPL_DEVNO_VALID (ipl_parameter_flags & 1) | ||
111 | #define IPL_PARMBLOCK_VALID (ipl_parameter_flags & 2) | ||
112 | |||
113 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ | ||
114 | IPL_PARMBLOCK_ORIGIN) | ||
115 | #define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.length) | ||
116 | |||
67 | #else | 117 | #else |
68 | 118 | ||
69 | #ifndef __s390x__ | 119 | #ifndef __s390x__ |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 221e965da924..f97d92691f17 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -590,7 +590,6 @@ asmlinkage long sys_clone(struct pt_regs regs); | |||
590 | asmlinkage long sys_fork(struct pt_regs regs); | 590 | asmlinkage long sys_fork(struct pt_regs regs); |
591 | asmlinkage long sys_vfork(struct pt_regs regs); | 591 | asmlinkage long sys_vfork(struct pt_regs regs); |
592 | asmlinkage long sys_pipe(unsigned long __user *fildes); | 592 | asmlinkage long sys_pipe(unsigned long __user *fildes); |
593 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data); | ||
594 | struct sigaction; | 593 | struct sigaction; |
595 | asmlinkage long sys_rt_sigaction(int sig, | 594 | asmlinkage long sys_rt_sigaction(int sig, |
596 | const struct sigaction __user *act, | 595 | const struct sigaction __user *act, |
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index 80d164c1529e..d3fa5c2b889d 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h | |||
@@ -9,7 +9,7 @@ | |||
9 | extern struct bus_type pci_bus_type; | 9 | extern struct bus_type pci_bus_type; |
10 | 10 | ||
11 | /* arch/sh/mm/consistent.c */ | 11 | /* arch/sh/mm/consistent.c */ |
12 | extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle); | 12 | extern void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *handle); |
13 | extern void consistent_free(void *vaddr, size_t size); | 13 | extern void consistent_free(void *vaddr, size_t size); |
14 | extern void consistent_sync(void *vaddr, size_t size, int direction); | 14 | extern void consistent_sync(void *vaddr, size_t size, int direction); |
15 | 15 | ||
@@ -26,7 +26,7 @@ static inline int dma_set_mask(struct device *dev, u64 mask) | |||
26 | } | 26 | } |
27 | 27 | ||
28 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 28 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
29 | dma_addr_t *dma_handle, int flag) | 29 | dma_addr_t *dma_handle, gfp_t flag) |
30 | { | 30 | { |
31 | if (sh_mv.mv_consistent_alloc) { | 31 | if (sh_mv.mv_consistent_alloc) { |
32 | void *ret; | 32 | void *ret; |
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h index 5771f4baa478..3f18aa180516 100644 --- a/include/asm-sh/machvec.h +++ b/include/asm-sh/machvec.h | |||
@@ -64,7 +64,7 @@ struct sh_machine_vector | |||
64 | 64 | ||
65 | void (*mv_heartbeat)(void); | 65 | void (*mv_heartbeat)(void); |
66 | 66 | ||
67 | void *(*mv_consistent_alloc)(struct device *, size_t, dma_addr_t *, int); | 67 | void *(*mv_consistent_alloc)(struct device *, size_t, dma_addr_t *, gfp_t); |
68 | int (*mv_consistent_free)(struct device *, size_t, void *, dma_addr_t); | 68 | int (*mv_consistent_free)(struct device *, size_t, void *, dma_addr_t); |
69 | }; | 69 | }; |
70 | 70 | ||
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index 0f4bcaae61bd..aef8ae43de13 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
@@ -224,8 +224,6 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot) | |||
224 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 224 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
225 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } | 225 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } |
226 | 226 | ||
227 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
228 | |||
229 | #define pmd_page_kernel(pmd) \ | 227 | #define pmd_page_kernel(pmd) \ |
230 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) | 228 | ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) |
231 | 229 | ||
diff --git a/include/asm-sh/rwsem.h b/include/asm-sh/rwsem.h index 1be4337f5259..0262d3d1e5e0 100644 --- a/include/asm-sh/rwsem.h +++ b/include/asm-sh/rwsem.h | |||
@@ -166,5 +166,10 @@ static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem) | |||
166 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); | 166 | return atomic_add_return(delta, (atomic_t *)(&sem->count)); |
167 | } | 167 | } |
168 | 168 | ||
169 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
170 | { | ||
171 | return (sem->count != 0); | ||
172 | } | ||
173 | |||
169 | #endif /* __KERNEL__ */ | 174 | #endif /* __KERNEL__ */ |
170 | #endif /* _ASM_SH_RWSEM_H */ | 175 | #endif /* _ASM_SH_RWSEM_H */ |
diff --git a/include/asm-sh/semaphore.h b/include/asm-sh/semaphore.h index b923a77a8a7e..489f7847c5d9 100644 --- a/include/asm-sh/semaphore.h +++ b/include/asm-sh/semaphore.h | |||
@@ -33,9 +33,6 @@ struct semaphore { | |||
33 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 33 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
34 | } | 34 | } |
35 | 35 | ||
36 | #define __MUTEX_INITIALIZER(name) \ | ||
37 | __SEMAPHORE_INITIALIZER(name,1) | ||
38 | |||
39 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 36 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
40 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 37 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
41 | 38 | ||
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index ea89e8f223ea..f2c8e14d1fd9 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -503,7 +503,6 @@ asmlinkage int sys_vfork(unsigned long r4, unsigned long r5, | |||
503 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | 503 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, |
504 | unsigned long r6, unsigned long r7, | 504 | unsigned long r6, unsigned long r7, |
505 | struct pt_regs regs); | 505 | struct pt_regs regs); |
506 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
507 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf, | 506 | asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char *buf, |
508 | size_t count, long dummy, loff_t pos); | 507 | size_t count, long dummy, loff_t pos); |
509 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf, | 508 | asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char *buf, |
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index b8d26fe677f4..cc9a2e86f5b4 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h | |||
@@ -25,7 +25,7 @@ static inline int dma_set_mask(struct device *dev, u64 mask) | |||
25 | } | 25 | } |
26 | 26 | ||
27 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 27 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
28 | dma_addr_t *dma_handle, int flag) | 28 | dma_addr_t *dma_handle, gfp_t flag) |
29 | { | 29 | { |
30 | return consistent_alloc(NULL, size, dma_handle); | 30 | return consistent_alloc(NULL, size, dma_handle); |
31 | } | 31 | } |
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index 51db4307bfaf..51b05818e4eb 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h | |||
@@ -457,9 +457,6 @@ extern inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _ | |||
457 | extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 457 | extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
458 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } | 458 | { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } |
459 | 459 | ||
460 | #define page_pte_prot(page, prot) mk_pte(page, prot) | ||
461 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
462 | |||
463 | typedef pte_t *pte_addr_t; | 460 | typedef pte_t *pte_addr_t; |
464 | #define pgtable_cache_init() do { } while (0) | 461 | #define pgtable_cache_init() do { } while (0) |
465 | 462 | ||
diff --git a/include/asm-sh64/semaphore.h b/include/asm-sh64/semaphore.h index fce22bb9a546..469526459149 100644 --- a/include/asm-sh64/semaphore.h +++ b/include/asm-sh64/semaphore.h | |||
@@ -40,9 +40,6 @@ struct semaphore { | |||
40 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 40 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
41 | } | 41 | } |
42 | 42 | ||
43 | #define __MUTEX_INITIALIZER(name) \ | ||
44 | __SEMAPHORE_INITIALIZER(name,1) | ||
45 | |||
46 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 43 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
47 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 44 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
48 | 45 | ||
diff --git a/include/asm-sparc/dma-mapping.h b/include/asm-sparc/dma-mapping.h index 2dc5bb8effa6..d7c3b0f0a901 100644 --- a/include/asm-sparc/dma-mapping.h +++ b/include/asm-sparc/dma-mapping.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #else | 8 | #else |
9 | 9 | ||
10 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 10 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
11 | dma_addr_t *dma_handle, int flag) | 11 | dma_addr_t *dma_handle, gfp_t flag) |
12 | { | 12 | { |
13 | BUG(); | 13 | BUG(); |
14 | return NULL; | 14 | return NULL; |
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h index caf926116506..7a941b800b6b 100644 --- a/include/asm-sparc/floppy.h +++ b/include/asm-sparc/floppy.h | |||
@@ -17,10 +17,8 @@ | |||
17 | 17 | ||
18 | /* We don't need no stinkin' I/O port allocation crap. */ | 18 | /* We don't need no stinkin' I/O port allocation crap. */ |
19 | #undef release_region | 19 | #undef release_region |
20 | #undef check_region | ||
21 | #undef request_region | 20 | #undef request_region |
22 | #define release_region(X, Y) do { } while(0) | 21 | #define release_region(X, Y) do { } while(0) |
23 | #define check_region(X, Y) (0) | ||
24 | #define request_region(X, Y, Z) (1) | 22 | #define request_region(X, Y, Z) (1) |
25 | 23 | ||
26 | /* References: | 24 | /* References: |
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index a14e98677500..b33c35411e82 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h | |||
@@ -255,8 +255,6 @@ BTFIXUPDEF_CALL_CONST(pte_t, pte_mkyoung, pte_t) | |||
255 | #define pte_mkdirty(pte) BTFIXUP_CALL(pte_mkdirty)(pte) | 255 | #define pte_mkdirty(pte) BTFIXUP_CALL(pte_mkdirty)(pte) |
256 | #define pte_mkyoung(pte) BTFIXUP_CALL(pte_mkyoung)(pte) | 256 | #define pte_mkyoung(pte) BTFIXUP_CALL(pte_mkyoung)(pte) |
257 | 257 | ||
258 | #define page_pte_prot(page, prot) mk_pte(page, prot) | ||
259 | #define page_pte(page) mk_pte(page, __pgprot(0)) | ||
260 | #define pfn_pte(pfn, prot) mk_pte(pfn_to_page(pfn), prot) | 258 | #define pfn_pte(pfn, prot) mk_pte(pfn_to_page(pfn), prot) |
261 | 259 | ||
262 | BTFIXUPDEF_CALL(unsigned long, pte_pfn, pte_t) | 260 | BTFIXUPDEF_CALL(unsigned long, pte_pfn, pte_t) |
diff --git a/include/asm-sparc/semaphore.h b/include/asm-sparc/semaphore.h index 60ac5fd9eb48..f74ba31e265b 100644 --- a/include/asm-sparc/semaphore.h +++ b/include/asm-sparc/semaphore.h | |||
@@ -22,9 +22,6 @@ struct semaphore { | |||
22 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 22 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
23 | } | 23 | } |
24 | 24 | ||
25 | #define __MUTEX_INITIALIZER(name) \ | ||
26 | __SEMAPHORE_INITIALIZER(name,1) | ||
27 | |||
28 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 25 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
29 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 26 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
30 | 27 | ||
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index 1c5da41653a4..c7d5804ba76d 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -10,7 +10,7 @@ | |||
10 | struct device; | 10 | struct device; |
11 | 11 | ||
12 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 12 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, |
13 | dma_addr_t *dma_handle, int flag) | 13 | dma_addr_t *dma_handle, gfp_t flag) |
14 | { | 14 | { |
15 | BUG(); | 15 | BUG(); |
16 | return NULL; | 16 | return NULL; |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 8c6dfc6c7af6..9a02879b235d 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -231,9 +231,6 @@ extern struct page *mem_map_zero; | |||
231 | #define pte_pfn(x) ((pte_val(x) & _PAGE_PADDR)>>PAGE_SHIFT) | 231 | #define pte_pfn(x) ((pte_val(x) & _PAGE_PADDR)>>PAGE_SHIFT) |
232 | #define pte_page(x) pfn_to_page(pte_pfn(x)) | 232 | #define pte_page(x) pfn_to_page(pte_pfn(x)) |
233 | 233 | ||
234 | #define page_pte_prot(page, prot) mk_pte(page, prot) | ||
235 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
236 | |||
237 | static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) | 234 | static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot) |
238 | { | 235 | { |
239 | pte_t __pte; | 236 | pte_t __pte; |
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h index 4568ee4022df..cef5e8270421 100644 --- a/include/asm-sparc64/rwsem.h +++ b/include/asm-sparc64/rwsem.h | |||
@@ -56,6 +56,11 @@ static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem) | |||
56 | atomic_add(delta, (atomic_t *)(&sem->count)); | 56 | atomic_add(delta, (atomic_t *)(&sem->count)); |
57 | } | 57 | } |
58 | 58 | ||
59 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
60 | { | ||
61 | return (sem->count != 0); | ||
62 | } | ||
63 | |||
59 | #endif /* __KERNEL__ */ | 64 | #endif /* __KERNEL__ */ |
60 | 65 | ||
61 | #endif /* _SPARC64_RWSEM_H */ | 66 | #endif /* _SPARC64_RWSEM_H */ |
diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h index 7419dd88b49e..093dcc6788db 100644 --- a/include/asm-sparc64/semaphore.h +++ b/include/asm-sparc64/semaphore.h | |||
@@ -22,9 +22,6 @@ struct semaphore { | |||
22 | { ATOMIC_INIT(count), \ | 22 | { ATOMIC_INIT(count), \ |
23 | __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) } | 23 | __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) } |
24 | 24 | ||
25 | #define __MUTEX_INITIALIZER(name) \ | ||
26 | __SEMAPHORE_INITIALIZER(name, 1) | ||
27 | |||
28 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ | 25 | #define __DECLARE_SEMAPHORE_GENERIC(name, count) \ |
29 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 26 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
30 | 27 | ||
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h index 9baf57db01d2..66138d959df5 100644 --- a/include/asm-sparc64/tlb.h +++ b/include/asm-sparc64/tlb.h | |||
@@ -25,9 +25,8 @@ struct mmu_gather { | |||
25 | struct mm_struct *mm; | 25 | struct mm_struct *mm; |
26 | unsigned int pages_nr; | 26 | unsigned int pages_nr; |
27 | unsigned int need_flush; | 27 | unsigned int need_flush; |
28 | unsigned int tlb_frozen; | 28 | unsigned int fullmm; |
29 | unsigned int tlb_nr; | 29 | unsigned int tlb_nr; |
30 | unsigned long freed; | ||
31 | unsigned long vaddrs[TLB_BATCH_NR]; | 30 | unsigned long vaddrs[TLB_BATCH_NR]; |
32 | struct page *pages[FREE_PTE_NR]; | 31 | struct page *pages[FREE_PTE_NR]; |
33 | }; | 32 | }; |
@@ -44,14 +43,13 @@ extern void flush_tlb_pending(void); | |||
44 | 43 | ||
45 | static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 44 | static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) |
46 | { | 45 | { |
47 | struct mmu_gather *mp = &__get_cpu_var(mmu_gathers); | 46 | struct mmu_gather *mp = &get_cpu_var(mmu_gathers); |
48 | 47 | ||
49 | BUG_ON(mp->tlb_nr); | 48 | BUG_ON(mp->tlb_nr); |
50 | 49 | ||
51 | mp->mm = mm; | 50 | mp->mm = mm; |
52 | mp->pages_nr = num_online_cpus() > 1 ? 0U : ~0U; | 51 | mp->pages_nr = num_online_cpus() > 1 ? 0U : ~0U; |
53 | mp->tlb_frozen = full_mm_flush; | 52 | mp->fullmm = full_mm_flush; |
54 | mp->freed = 0; | ||
55 | 53 | ||
56 | return mp; | 54 | return mp; |
57 | } | 55 | } |
@@ -78,30 +76,19 @@ extern void smp_flush_tlb_mm(struct mm_struct *mm); | |||
78 | 76 | ||
79 | static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, unsigned long end) | 77 | static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, unsigned long end) |
80 | { | 78 | { |
81 | unsigned long freed = mp->freed; | ||
82 | struct mm_struct *mm = mp->mm; | ||
83 | unsigned long rss = get_mm_counter(mm, rss); | ||
84 | |||
85 | if (rss < freed) | ||
86 | freed = rss; | ||
87 | add_mm_counter(mm, rss, -freed); | ||
88 | |||
89 | tlb_flush_mmu(mp); | 79 | tlb_flush_mmu(mp); |
90 | 80 | ||
91 | if (mp->tlb_frozen) { | 81 | if (mp->fullmm) { |
92 | if (CTX_VALID(mm->context)) | 82 | if (CTX_VALID(mp->mm->context)) |
93 | do_flush_tlb_mm(mm); | 83 | do_flush_tlb_mm(mp->mm); |
94 | mp->tlb_frozen = 0; | 84 | mp->fullmm = 0; |
95 | } else | 85 | } else |
96 | flush_tlb_pending(); | 86 | flush_tlb_pending(); |
97 | 87 | ||
98 | /* keep the page table cache within bounds */ | 88 | /* keep the page table cache within bounds */ |
99 | check_pgt_cache(); | 89 | check_pgt_cache(); |
100 | } | ||
101 | 90 | ||
102 | static inline unsigned int tlb_is_full_mm(struct mmu_gather *mp) | 91 | put_cpu_var(mmu_gathers); |
103 | { | ||
104 | return mp->tlb_frozen; | ||
105 | } | 92 | } |
106 | 93 | ||
107 | static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page) | 94 | static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page) |
diff --git a/include/asm-um/cache.h b/include/asm-um/cache.h index 4b134fe8504e..a10602a5b2d6 100644 --- a/include/asm-um/cache.h +++ b/include/asm-um/cache.h | |||
@@ -1,10 +1,21 @@ | |||
1 | #ifndef __UM_CACHE_H | 1 | #ifndef __UM_CACHE_H |
2 | #define __UM_CACHE_H | 2 | #define __UM_CACHE_H |
3 | 3 | ||
4 | /* These are x86 numbers */ | 4 | #include <linux/config.h> |
5 | #define L1_CACHE_SHIFT 5 | ||
6 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | ||
7 | 5 | ||
8 | #define L1_CACHE_SHIFT_MAX 7 /* largest L1 which this arch supports */ | 6 | #if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT) |
7 | # define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) | ||
8 | #elif defined(CONFIG_UML_X86) /* 64-bit */ | ||
9 | # define L1_CACHE_SHIFT 6 /* Should be 7 on Intel */ | ||
10 | #else | ||
11 | /* XXX: this was taken from x86, now it's completely random. Luckily only | ||
12 | * affects SMP padding. */ | ||
13 | # define L1_CACHE_SHIFT 5 | ||
14 | #endif | ||
15 | |||
16 | /* XXX: this is valid for x86 and x86_64. */ | ||
17 | #define L1_CACHE_SHIFT_MAX 7 /* largest L1 which this arch supports */ | ||
18 | |||
19 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | ||
9 | 20 | ||
10 | #endif | 21 | #endif |
diff --git a/include/asm-um/dma-mapping.h b/include/asm-um/dma-mapping.h index 13e6291f7151..babd29895114 100644 --- a/include/asm-um/dma-mapping.h +++ b/include/asm-um/dma-mapping.h | |||
@@ -19,7 +19,7 @@ dma_set_mask(struct device *dev, u64 dma_mask) | |||
19 | 19 | ||
20 | static inline void * | 20 | static inline void * |
21 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 21 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
22 | int flag) | 22 | gfp_t flag) |
23 | { | 23 | { |
24 | BUG(); | 24 | BUG(); |
25 | return((void *) 0); | 25 | return((void *) 0); |
diff --git a/include/asm-um/linkage.h b/include/asm-um/linkage.h index 7dfce37adc8b..e3d62dcbd356 100644 --- a/include/asm-um/linkage.h +++ b/include/asm-um/linkage.h | |||
@@ -3,4 +3,12 @@ | |||
3 | 3 | ||
4 | #include "asm/arch/linkage.h" | 4 | #include "asm/arch/linkage.h" |
5 | 5 | ||
6 | #include <linux/config.h> | ||
7 | |||
8 | /* <linux/linkage.h> will pick sane defaults */ | ||
9 | #ifdef CONFIG_GPROF | ||
10 | #undef FASTCALL | ||
11 | #undef fastcall | ||
12 | #endif | ||
13 | |||
6 | #endif | 14 | #endif |
diff --git a/include/asm-um/page.h b/include/asm-um/page.h index 2c192abe9aeb..0229814af31e 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h | |||
@@ -115,7 +115,7 @@ extern unsigned long uml_physmem; | |||
115 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 115 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
116 | #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) | 116 | #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) |
117 | 117 | ||
118 | extern struct page *arch_validate(struct page *page, int mask, int order); | 118 | extern struct page *arch_validate(struct page *page, gfp_t mask, int order); |
119 | #define HAVE_ARCH_VALIDATE | 119 | #define HAVE_ARCH_VALIDATE |
120 | 120 | ||
121 | extern void arch_free_page(struct page *page, int order); | 121 | extern void arch_free_page(struct page *page, int order); |
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index 616d02b57ea9..ac64eb955868 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h | |||
@@ -138,7 +138,7 @@ extern unsigned long pg0[1024]; | |||
138 | 138 | ||
139 | #define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) | 139 | #define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) |
140 | 140 | ||
141 | #define pmd_none(x) (!(pmd_val(x) & ~_PAGE_NEWPAGE)) | 141 | #define pmd_none(x) (!((unsigned long)pmd_val(x) & ~_PAGE_NEWPAGE)) |
142 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) | 142 | #define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) |
143 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) | 143 | #define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) |
144 | #define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0) | 144 | #define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0) |
diff --git a/include/asm-v850/semaphore.h b/include/asm-v850/semaphore.h index c514062bb69e..df6cdecf6c1f 100644 --- a/include/asm-v850/semaphore.h +++ b/include/asm-v850/semaphore.h | |||
@@ -18,9 +18,6 @@ struct semaphore { | |||
18 | { ATOMIC_INIT (count), 0, \ | 18 | { ATOMIC_INIT (count), 0, \ |
19 | __WAIT_QUEUE_HEAD_INITIALIZER ((name).wait) } | 19 | __WAIT_QUEUE_HEAD_INITIALIZER ((name).wait) } |
20 | 20 | ||
21 | #define __MUTEX_INITIALIZER(name) \ | ||
22 | __SEMAPHORE_INITIALIZER (name,1) | ||
23 | |||
24 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 21 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
25 | struct semaphore name = __SEMAPHORE_INITIALIZER (name,count) | 22 | struct semaphore name = __SEMAPHORE_INITIALIZER (name,count) |
26 | 23 | ||
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h index 3b552096c0e8..5a86f8e976ec 100644 --- a/include/asm-v850/unistd.h +++ b/include/asm-v850/unistd.h | |||
@@ -452,7 +452,6 @@ unsigned long sys_mmap2(unsigned long addr, size_t len, | |||
452 | struct pt_regs; | 452 | struct pt_regs; |
453 | int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs); | 453 | int sys_execve (char *name, char **argv, char **envp, struct pt_regs *regs); |
454 | int sys_pipe (int *fildes); | 454 | int sys_pipe (int *fildes); |
455 | int sys_ptrace(long request, long pid, long addr, long data); | ||
456 | struct sigaction; | 455 | struct sigaction; |
457 | asmlinkage long sys_rt_sigaction(int sig, | 456 | asmlinkage long sys_rt_sigaction(int sig, |
458 | const struct sigaction __user *act, | 457 | const struct sigaction __user *act, |
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h index 45ca88c875c0..36d16dfbac88 100644 --- a/include/asm-x86_64/dma-mapping.h +++ b/include/asm-x86_64/dma-mapping.h | |||
@@ -17,7 +17,7 @@ extern dma_addr_t bad_dma_address; | |||
17 | (swiotlb ? swiotlb_dma_mapping_error(x) : ((x) == bad_dma_address)) | 17 | (swiotlb ? swiotlb_dma_mapping_error(x) : ((x) == bad_dma_address)) |
18 | 18 | ||
19 | void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 19 | void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
20 | unsigned gfp); | 20 | gfp_t gfp); |
21 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | 21 | void dma_free_coherent(struct device *dev, size_t size, void *vaddr, |
22 | dma_addr_t dma_handle); | 22 | dma_addr_t dma_handle); |
23 | 23 | ||
diff --git a/include/asm-x86_64/mtrr.h b/include/asm-x86_64/mtrr.h index c5959d6418bb..66ac1c0f27e1 100644 --- a/include/asm-x86_64/mtrr.h +++ b/include/asm-x86_64/mtrr.h | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <linux/config.h> | 26 | #include <linux/config.h> |
27 | #include <linux/ioctl.h> | 27 | #include <linux/ioctl.h> |
28 | #include <linux/compat.h> | ||
28 | 29 | ||
29 | #define MTRR_IOCTL_BASE 'M' | 30 | #define MTRR_IOCTL_BASE 'M' |
30 | 31 | ||
@@ -105,4 +106,36 @@ static __inline__ int mtrr_del_page (int reg, unsigned long base, | |||
105 | 106 | ||
106 | #endif | 107 | #endif |
107 | 108 | ||
109 | #ifdef CONFIG_COMPAT | ||
110 | |||
111 | struct mtrr_sentry32 | ||
112 | { | ||
113 | compat_ulong_t base; /* Base address */ | ||
114 | compat_uint_t size; /* Size of region */ | ||
115 | compat_uint_t type; /* Type of region */ | ||
116 | }; | ||
117 | |||
118 | struct mtrr_gentry32 | ||
119 | { | ||
120 | compat_ulong_t regnum; /* Register number */ | ||
121 | compat_uint_t base; /* Base address */ | ||
122 | compat_uint_t size; /* Size of region */ | ||
123 | compat_uint_t type; /* Type of region */ | ||
124 | }; | ||
125 | |||
126 | #define MTRR_IOCTL_BASE 'M' | ||
127 | |||
128 | #define MTRRIOC32_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry32) | ||
129 | #define MTRRIOC32_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry32) | ||
130 | #define MTRRIOC32_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry32) | ||
131 | #define MTRRIOC32_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry32) | ||
132 | #define MTRRIOC32_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry32) | ||
133 | #define MTRRIOC32_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry32) | ||
134 | #define MTRRIOC32_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry32) | ||
135 | #define MTRRIOC32_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry32) | ||
136 | #define MTRRIOC32_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry32) | ||
137 | #define MTRRIOC32_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry32) | ||
138 | |||
139 | #endif /* CONFIG_COMPAT */ | ||
140 | |||
108 | #endif /* _LINUX_MTRR_H */ | 141 | #endif /* _LINUX_MTRR_H */ |
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index 5a82a6762c21..eeb3088a1c9e 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h | |||
@@ -50,10 +50,10 @@ extern int iommu_setup(char *opt); | |||
50 | * address space. The networking and block device layers use | 50 | * address space. The networking and block device layers use |
51 | * this boolean for bounce buffer decisions | 51 | * this boolean for bounce buffer decisions |
52 | * | 52 | * |
53 | * On x86-64 it mostly equals, but we set it to zero to tell some subsystems | 53 | * On AMD64 it mostly equals, but we set it to zero to tell some subsystems |
54 | * that an hard or soft IOMMU is available. | 54 | * that an IOMMU is available. |
55 | */ | 55 | */ |
56 | #define PCI_DMA_BUS_IS_PHYS 0 | 56 | #define PCI_DMA_BUS_IS_PHYS (no_iommu ? 1 : 0) |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * x86-64 always supports DAC, but sometimes it is useful to force | 59 | * x86-64 always supports DAC, but sometimes it is useful to force |
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index dd8711ecaf2f..7a07196a7202 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h | |||
@@ -318,8 +318,6 @@ static inline int pmd_large(pmd_t pte) { | |||
318 | * and a page entry and page directory to the page they refer to. | 318 | * and a page entry and page directory to the page they refer to. |
319 | */ | 319 | */ |
320 | 320 | ||
321 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | ||
322 | |||
323 | /* | 321 | /* |
324 | * Level 4 access. | 322 | * Level 4 access. |
325 | */ | 323 | */ |
diff --git a/include/asm-x86_64/rwsem.h b/include/asm-x86_64/rwsem.h index c002175b6e82..46077e9c1910 100644 --- a/include/asm-x86_64/rwsem.h +++ b/include/asm-x86_64/rwsem.h | |||
@@ -274,5 +274,10 @@ LOCK_PREFIX "xaddl %0,(%2)" | |||
274 | return tmp+delta; | 274 | return tmp+delta; |
275 | } | 275 | } |
276 | 276 | ||
277 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
278 | { | ||
279 | return (sem->count != 0); | ||
280 | } | ||
281 | |||
277 | #endif /* __KERNEL__ */ | 282 | #endif /* __KERNEL__ */ |
278 | #endif /* _X8664_RWSEM_H */ | 283 | #endif /* _X8664_RWSEM_H */ |
diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86_64/semaphore.h index f325e39bf3b9..a389aa6fe80f 100644 --- a/include/asm-x86_64/semaphore.h +++ b/include/asm-x86_64/semaphore.h | |||
@@ -56,9 +56,6 @@ struct semaphore { | |||
56 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 56 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
57 | } | 57 | } |
58 | 58 | ||
59 | #define __MUTEX_INITIALIZER(name) \ | ||
60 | __SEMAPHORE_INITIALIZER(name,1) | ||
61 | |||
62 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 59 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
63 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 60 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
64 | 61 | ||
diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86_64/swiotlb.h index 9b011dd8d19d..dddf1b218681 100644 --- a/include/asm-x86_64/swiotlb.h +++ b/include/asm-x86_64/swiotlb.h | |||
@@ -35,7 +35,7 @@ extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, | |||
35 | int nents, int direction); | 35 | int nents, int direction); |
36 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); | 36 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); |
37 | extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size, | 37 | extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size, |
38 | dma_addr_t *dma_handle, int flags); | 38 | dma_addr_t *dma_handle, gfp_t flags); |
39 | extern void swiotlb_free_coherent (struct device *hwdev, size_t size, | 39 | extern void swiotlb_free_coherent (struct device *hwdev, size_t size, |
40 | void *vaddr, dma_addr_t dma_handle); | 40 | void *vaddr, dma_addr_t dma_handle); |
41 | 41 | ||
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 11ba931cf82f..3c494b65d33a 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h | |||
@@ -780,8 +780,6 @@ asmlinkage long sys_pipe(int *fildes); | |||
780 | #include <linux/types.h> | 780 | #include <linux/types.h> |
781 | #include <asm/ptrace.h> | 781 | #include <asm/ptrace.h> |
782 | 782 | ||
783 | asmlinkage long sys_ptrace(long request, long pid, | ||
784 | unsigned long addr, long data); | ||
785 | asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs); | 783 | asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs); |
786 | asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on); | 784 | asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on); |
787 | struct sigaction; | 785 | struct sigaction; |
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h index e86a206f1209..c425f10d086a 100644 --- a/include/asm-xtensa/dma-mapping.h +++ b/include/asm-xtensa/dma-mapping.h | |||
@@ -28,7 +28,7 @@ extern void consistent_sync(void*, size_t, int); | |||
28 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 28 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
29 | 29 | ||
30 | void *dma_alloc_coherent(struct device *dev, size_t size, | 30 | void *dma_alloc_coherent(struct device *dev, size_t size, |
31 | dma_addr_t *dma_handle, int flag); | 31 | dma_addr_t *dma_handle, gfp_t flag); |
32 | 32 | ||
33 | void dma_free_coherent(struct device *dev, size_t size, | 33 | void dma_free_coherent(struct device *dev, size_t size, |
34 | void *vaddr, dma_addr_t dma_handle); | 34 | void *vaddr, dma_addr_t dma_handle); |
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h index 09e89ab3eb61..2a10e193b929 100644 --- a/include/asm-xtensa/semaphore.h +++ b/include/asm-xtensa/semaphore.h | |||
@@ -29,9 +29,6 @@ struct semaphore { | |||
29 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ | 29 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ |
30 | } | 30 | } |
31 | 31 | ||
32 | #define __MUTEX_INITIALIZER(name) \ | ||
33 | __SEMAPHORE_INITIALIZER(name, 1) | ||
34 | |||
35 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 32 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
36 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) | 33 | struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) |
37 | 34 | ||
diff --git a/include/keys/user-type.h b/include/keys/user-type.h new file mode 100644 index 000000000000..26f6ec38577a --- /dev/null +++ b/include/keys/user-type.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* user-type.h: User-defined key type | ||
2 | * | ||
3 | * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _KEYS_USER_TYPE_H | ||
13 | #define _KEYS_USER_TYPE_H | ||
14 | |||
15 | #include <linux/key.h> | ||
16 | #include <linux/rcupdate.h> | ||
17 | |||
18 | /*****************************************************************************/ | ||
19 | /* | ||
20 | * the payload for a key of type "user" | ||
21 | * - once filled in and attached to a key: | ||
22 | * - the payload struct is invariant may not be changed, only replaced | ||
23 | * - the payload must be read with RCU procedures or with the key semaphore | ||
24 | * held | ||
25 | * - the payload may only be replaced with the key semaphore write-locked | ||
26 | * - the key's data length is the size of the actual data, not including the | ||
27 | * payload wrapper | ||
28 | */ | ||
29 | struct user_key_payload { | ||
30 | struct rcu_head rcu; /* RCU destructor */ | ||
31 | unsigned short datalen; /* length of this data */ | ||
32 | char data[0]; /* actual data */ | ||
33 | }; | ||
34 | |||
35 | extern struct key_type key_type_user; | ||
36 | |||
37 | extern int user_instantiate(struct key *key, const void *data, size_t datalen); | ||
38 | extern int user_duplicate(struct key *key, const struct key *source); | ||
39 | extern int user_update(struct key *key, const void *data, size_t datalen); | ||
40 | extern int user_match(const struct key *key, const void *criterion); | ||
41 | extern void user_destroy(struct key *key); | ||
42 | extern void user_describe(const struct key *user, struct seq_file *m); | ||
43 | extern long user_read(const struct key *key, | ||
44 | char __user *buffer, size_t buflen); | ||
45 | |||
46 | |||
47 | #endif /* _KEYS_USER_TYPE_H */ | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index a5b74efab067..d2873b732bb1 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -42,13 +42,18 @@ enum { | |||
42 | ATA_SECT_SIZE = 512, | 42 | ATA_SECT_SIZE = 512, |
43 | 43 | ||
44 | ATA_ID_WORDS = 256, | 44 | ATA_ID_WORDS = 256, |
45 | ATA_ID_PROD_OFS = 27, | ||
46 | ATA_ID_FW_REV_OFS = 23, | ||
47 | ATA_ID_SERNO_OFS = 10, | 45 | ATA_ID_SERNO_OFS = 10, |
48 | ATA_ID_MAJOR_VER = 80, | 46 | ATA_ID_FW_REV_OFS = 23, |
49 | ATA_ID_PIO_MODES = 64, | 47 | ATA_ID_PROD_OFS = 27, |
48 | ATA_ID_OLD_PIO_MODES = 51, | ||
49 | ATA_ID_FIELD_VALID = 53, | ||
50 | ATA_ID_MWDMA_MODES = 63, | 50 | ATA_ID_MWDMA_MODES = 63, |
51 | ATA_ID_PIO_MODES = 64, | ||
52 | ATA_ID_EIDE_DMA_MIN = 65, | ||
53 | ATA_ID_EIDE_PIO = 67, | ||
54 | ATA_ID_EIDE_PIO_IORDY = 68, | ||
51 | ATA_ID_UDMA_MODES = 88, | 55 | ATA_ID_UDMA_MODES = 88, |
56 | ATA_ID_MAJOR_VER = 80, | ||
52 | ATA_ID_PIO4 = (1 << 1), | 57 | ATA_ID_PIO4 = (1 << 1), |
53 | 58 | ||
54 | ATA_PCI_CTL_OFS = 2, | 59 | ATA_PCI_CTL_OFS = 2, |
@@ -128,10 +133,15 @@ enum { | |||
128 | ATA_CMD_PIO_READ_EXT = 0x24, | 133 | ATA_CMD_PIO_READ_EXT = 0x24, |
129 | ATA_CMD_PIO_WRITE = 0x30, | 134 | ATA_CMD_PIO_WRITE = 0x30, |
130 | ATA_CMD_PIO_WRITE_EXT = 0x34, | 135 | ATA_CMD_PIO_WRITE_EXT = 0x34, |
136 | ATA_CMD_READ_MULTI = 0xC4, | ||
137 | ATA_CMD_READ_MULTI_EXT = 0x29, | ||
138 | ATA_CMD_WRITE_MULTI = 0xC5, | ||
139 | ATA_CMD_WRITE_MULTI_EXT = 0x39, | ||
131 | ATA_CMD_SET_FEATURES = 0xEF, | 140 | ATA_CMD_SET_FEATURES = 0xEF, |
132 | ATA_CMD_PACKET = 0xA0, | 141 | ATA_CMD_PACKET = 0xA0, |
133 | ATA_CMD_VERIFY = 0x40, | 142 | ATA_CMD_VERIFY = 0x40, |
134 | ATA_CMD_VERIFY_EXT = 0x42, | 143 | ATA_CMD_VERIFY_EXT = 0x42, |
144 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | ||
135 | 145 | ||
136 | /* SETFEATURES stuff */ | 146 | /* SETFEATURES stuff */ |
137 | SETFEATURES_XFER = 0x03, | 147 | SETFEATURES_XFER = 0x03, |
@@ -146,14 +156,14 @@ enum { | |||
146 | XFER_MW_DMA_2 = 0x22, | 156 | XFER_MW_DMA_2 = 0x22, |
147 | XFER_MW_DMA_1 = 0x21, | 157 | XFER_MW_DMA_1 = 0x21, |
148 | XFER_MW_DMA_0 = 0x20, | 158 | XFER_MW_DMA_0 = 0x20, |
159 | XFER_SW_DMA_2 = 0x12, | ||
160 | XFER_SW_DMA_1 = 0x11, | ||
161 | XFER_SW_DMA_0 = 0x10, | ||
149 | XFER_PIO_4 = 0x0C, | 162 | XFER_PIO_4 = 0x0C, |
150 | XFER_PIO_3 = 0x0B, | 163 | XFER_PIO_3 = 0x0B, |
151 | XFER_PIO_2 = 0x0A, | 164 | XFER_PIO_2 = 0x0A, |
152 | XFER_PIO_1 = 0x09, | 165 | XFER_PIO_1 = 0x09, |
153 | XFER_PIO_0 = 0x08, | 166 | XFER_PIO_0 = 0x08, |
154 | XFER_SW_DMA_2 = 0x12, | ||
155 | XFER_SW_DMA_1 = 0x11, | ||
156 | XFER_SW_DMA_0 = 0x10, | ||
157 | XFER_PIO_SLOW = 0x00, | 167 | XFER_PIO_SLOW = 0x00, |
158 | 168 | ||
159 | /* ATAPI stuff */ | 169 | /* ATAPI stuff */ |
@@ -181,6 +191,7 @@ enum { | |||
181 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ | 191 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ |
182 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ | 192 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ |
183 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ | 193 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ |
194 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ | ||
184 | }; | 195 | }; |
185 | 196 | ||
186 | enum ata_tf_protocols { | 197 | enum ata_tf_protocols { |
@@ -250,7 +261,19 @@ struct ata_taskfile { | |||
250 | ((u64) (id)[(n) + 1] << 16) | \ | 261 | ((u64) (id)[(n) + 1] << 16) | \ |
251 | ((u64) (id)[(n) + 0]) ) | 262 | ((u64) (id)[(n) + 0]) ) |
252 | 263 | ||
253 | static inline int atapi_cdb_len(u16 *dev_id) | 264 | static inline int ata_id_current_chs_valid(const u16 *id) |
265 | { | ||
266 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | ||
267 | has not been issued to the device then the values of | ||
268 | id[54] to id[56] are vendor specific. */ | ||
269 | return (id[53] & 0x01) && /* Current translation valid */ | ||
270 | id[54] && /* cylinders in current translation */ | ||
271 | id[55] && /* heads in current translation */ | ||
272 | id[55] <= 16 && | ||
273 | id[56]; /* sectors in current translation */ | ||
274 | } | ||
275 | |||
276 | static inline int atapi_cdb_len(const u16 *dev_id) | ||
254 | { | 277 | { |
255 | u16 tmp = dev_id[0] & 0x3; | 278 | u16 tmp = dev_id[0] & 0x3; |
256 | switch (tmp) { | 279 | switch (tmp) { |
@@ -260,7 +283,7 @@ static inline int atapi_cdb_len(u16 *dev_id) | |||
260 | } | 283 | } |
261 | } | 284 | } |
262 | 285 | ||
263 | static inline int is_atapi_taskfile(struct ata_taskfile *tf) | 286 | static inline int is_atapi_taskfile(const struct ata_taskfile *tf) |
264 | { | 287 | { |
265 | return (tf->protocol == ATA_PROT_ATAPI) || | 288 | return (tf->protocol == ATA_PROT_ATAPI) || |
266 | (tf->protocol == ATA_PROT_ATAPI_NODATA) || | 289 | (tf->protocol == ATA_PROT_ATAPI_NODATA) || |
diff --git a/include/linux/audit.h b/include/linux/audit.h index b2a2509bd7ea..da3c01955f3d 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -260,11 +260,11 @@ extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | |||
260 | #ifdef CONFIG_AUDIT | 260 | #ifdef CONFIG_AUDIT |
261 | /* These are defined in audit.c */ | 261 | /* These are defined in audit.c */ |
262 | /* Public API */ | 262 | /* Public API */ |
263 | extern void audit_log(struct audit_context *ctx, int gfp_mask, | 263 | extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask, |
264 | int type, const char *fmt, ...) | 264 | int type, const char *fmt, ...) |
265 | __attribute__((format(printf,4,5))); | 265 | __attribute__((format(printf,4,5))); |
266 | 266 | ||
267 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask, int type); | 267 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type); |
268 | extern void audit_log_format(struct audit_buffer *ab, | 268 | extern void audit_log_format(struct audit_buffer *ab, |
269 | const char *fmt, ...) | 269 | const char *fmt, ...) |
270 | __attribute__((format(printf,2,3))); | 270 | __attribute__((format(printf,2,3))); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 3344b4e8e43a..685fd3720df5 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -301,7 +301,7 @@ extern struct bio *bio_map_user_iov(struct request_queue *, | |||
301 | struct sg_iovec *, int, int); | 301 | struct sg_iovec *, int, int); |
302 | extern void bio_unmap_user(struct bio *); | 302 | extern void bio_unmap_user(struct bio *); |
303 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | 303 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, |
304 | unsigned int); | 304 | gfp_t); |
305 | extern void bio_set_pages_dirty(struct bio *bio); | 305 | extern void bio_set_pages_dirty(struct bio *bio); |
306 | extern void bio_check_pages_dirty(struct bio *bio); | 306 | extern void bio_check_pages_dirty(struct bio *bio); |
307 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); | 307 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 86dd5502b05c..7d8ff97b3e92 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -40,6 +40,8 @@ | |||
40 | * bitmap_weight(src, nbits) Hamming Weight: number set bits | 40 | * bitmap_weight(src, nbits) Hamming Weight: number set bits |
41 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n | 41 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n |
42 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n | 42 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n |
43 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) | ||
44 | * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit) | ||
43 | * bitmap_scnprintf(buf, len, src, nbits) Print bitmap src to buf | 45 | * bitmap_scnprintf(buf, len, src, nbits) Print bitmap src to buf |
44 | * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf | 46 | * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
45 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf | 47 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf |
@@ -104,6 +106,10 @@ extern int bitmap_scnlistprintf(char *buf, unsigned int len, | |||
104 | const unsigned long *src, int nbits); | 106 | const unsigned long *src, int nbits); |
105 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, | 107 | extern int bitmap_parselist(const char *buf, unsigned long *maskp, |
106 | int nmaskbits); | 108 | int nmaskbits); |
109 | extern void bitmap_remap(unsigned long *dst, const unsigned long *src, | ||
110 | const unsigned long *old, const unsigned long *new, int bits); | ||
111 | extern int bitmap_bitremap(int oldbit, | ||
112 | const unsigned long *old, const unsigned long *new, int bits); | ||
107 | extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); | 113 | extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); |
108 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); | 114 | extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); |
109 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); | 115 | extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index efdc9b5bc05c..025a7f084dbd 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -96,8 +96,8 @@ struct io_context { | |||
96 | 96 | ||
97 | void put_io_context(struct io_context *ioc); | 97 | void put_io_context(struct io_context *ioc); |
98 | void exit_io_context(void); | 98 | void exit_io_context(void); |
99 | struct io_context *current_io_context(int gfp_flags); | 99 | struct io_context *current_io_context(gfp_t gfp_flags); |
100 | struct io_context *get_io_context(int gfp_flags); | 100 | struct io_context *get_io_context(gfp_t gfp_flags); |
101 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 101 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
102 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | 102 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); |
103 | 103 | ||
@@ -107,9 +107,9 @@ typedef void (rq_end_io_fn)(struct request *); | |||
107 | struct request_list { | 107 | struct request_list { |
108 | int count[2]; | 108 | int count[2]; |
109 | int starved[2]; | 109 | int starved[2]; |
110 | int elvpriv; | ||
110 | mempool_t *rq_pool; | 111 | mempool_t *rq_pool; |
111 | wait_queue_head_t wait[2]; | 112 | wait_queue_head_t wait[2]; |
112 | wait_queue_head_t drain; | ||
113 | }; | 113 | }; |
114 | 114 | ||
115 | #define BLK_MAX_CDB 16 | 115 | #define BLK_MAX_CDB 16 |
@@ -203,6 +203,7 @@ struct request { | |||
203 | enum rq_flag_bits { | 203 | enum rq_flag_bits { |
204 | __REQ_RW, /* not set, read. set, write */ | 204 | __REQ_RW, /* not set, read. set, write */ |
205 | __REQ_FAILFAST, /* no low level driver retries */ | 205 | __REQ_FAILFAST, /* no low level driver retries */ |
206 | __REQ_SORTED, /* elevator knows about this request */ | ||
206 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 207 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
207 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | 208 | __REQ_HARDBARRIER, /* may not be passed by drive either */ |
208 | __REQ_CMD, /* is a regular fs rw request */ | 209 | __REQ_CMD, /* is a regular fs rw request */ |
@@ -210,6 +211,7 @@ enum rq_flag_bits { | |||
210 | __REQ_STARTED, /* drive already may have started this one */ | 211 | __REQ_STARTED, /* drive already may have started this one */ |
211 | __REQ_DONTPREP, /* don't call prep for this one */ | 212 | __REQ_DONTPREP, /* don't call prep for this one */ |
212 | __REQ_QUEUED, /* uses queueing */ | 213 | __REQ_QUEUED, /* uses queueing */ |
214 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
213 | /* | 215 | /* |
214 | * for ATA/ATAPI devices | 216 | * for ATA/ATAPI devices |
215 | */ | 217 | */ |
@@ -235,6 +237,7 @@ enum rq_flag_bits { | |||
235 | 237 | ||
236 | #define REQ_RW (1 << __REQ_RW) | 238 | #define REQ_RW (1 << __REQ_RW) |
237 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | 239 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) |
240 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
238 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | 241 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) |
239 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | 242 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) |
240 | #define REQ_CMD (1 << __REQ_CMD) | 243 | #define REQ_CMD (1 << __REQ_CMD) |
@@ -242,6 +245,7 @@ enum rq_flag_bits { | |||
242 | #define REQ_STARTED (1 << __REQ_STARTED) | 245 | #define REQ_STARTED (1 << __REQ_STARTED) |
243 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | 246 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) |
244 | #define REQ_QUEUED (1 << __REQ_QUEUED) | 247 | #define REQ_QUEUED (1 << __REQ_QUEUED) |
248 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
245 | #define REQ_PC (1 << __REQ_PC) | 249 | #define REQ_PC (1 << __REQ_PC) |
246 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) | 250 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) |
247 | #define REQ_SENSE (1 << __REQ_SENSE) | 251 | #define REQ_SENSE (1 << __REQ_SENSE) |
@@ -333,6 +337,12 @@ struct request_queue | |||
333 | end_flush_fn *end_flush_fn; | 337 | end_flush_fn *end_flush_fn; |
334 | 338 | ||
335 | /* | 339 | /* |
340 | * Dispatch queue sorting | ||
341 | */ | ||
342 | sector_t end_sector; | ||
343 | struct request *boundary_rq; | ||
344 | |||
345 | /* | ||
336 | * Auto-unplugging state | 346 | * Auto-unplugging state |
337 | */ | 347 | */ |
338 | struct timer_list unplug_timer; | 348 | struct timer_list unplug_timer; |
@@ -354,7 +364,7 @@ struct request_queue | |||
354 | * queue needs bounce pages for pages above this limit | 364 | * queue needs bounce pages for pages above this limit |
355 | */ | 365 | */ |
356 | unsigned long bounce_pfn; | 366 | unsigned long bounce_pfn; |
357 | unsigned int bounce_gfp; | 367 | gfp_t bounce_gfp; |
358 | 368 | ||
359 | /* | 369 | /* |
360 | * various queue flags, see QUEUE_* below | 370 | * various queue flags, see QUEUE_* below |
@@ -405,8 +415,6 @@ struct request_queue | |||
405 | unsigned int sg_reserved_size; | 415 | unsigned int sg_reserved_size; |
406 | int node; | 416 | int node; |
407 | 417 | ||
408 | struct list_head drain_list; | ||
409 | |||
410 | /* | 418 | /* |
411 | * reserved for flush operations | 419 | * reserved for flush operations |
412 | */ | 420 | */ |
@@ -434,7 +442,7 @@ enum { | |||
434 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 442 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
435 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 443 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
436 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 444 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ |
437 | #define QUEUE_FLAG_DRAIN 8 /* draining queue for sched switch */ | 445 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ |
438 | #define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ | 446 | #define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ |
439 | 447 | ||
440 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 448 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
@@ -454,6 +462,7 @@ enum { | |||
454 | #define blk_pm_request(rq) \ | 462 | #define blk_pm_request(rq) \ |
455 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) | 463 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) |
456 | 464 | ||
465 | #define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) | ||
457 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) | 466 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) |
458 | #define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) | 467 | #define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) |
459 | #define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) | 468 | #define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) |
@@ -550,7 +559,7 @@ extern void generic_make_request(struct bio *bio); | |||
550 | extern void blk_put_request(struct request *); | 559 | extern void blk_put_request(struct request *); |
551 | extern void blk_end_sync_rq(struct request *rq); | 560 | extern void blk_end_sync_rq(struct request *rq); |
552 | extern void blk_attempt_remerge(request_queue_t *, struct request *); | 561 | extern void blk_attempt_remerge(request_queue_t *, struct request *); |
553 | extern struct request *blk_get_request(request_queue_t *, int, int); | 562 | extern struct request *blk_get_request(request_queue_t *, int, gfp_t); |
554 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); | 563 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); |
555 | extern void blk_requeue_request(request_queue_t *, struct request *); | 564 | extern void blk_requeue_request(request_queue_t *, struct request *); |
556 | extern void blk_plug_device(request_queue_t *); | 565 | extern void blk_plug_device(request_queue_t *); |
@@ -565,7 +574,7 @@ extern void blk_run_queue(request_queue_t *); | |||
565 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 574 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
566 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); | 575 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); |
567 | extern int blk_rq_unmap_user(struct bio *, unsigned int); | 576 | extern int blk_rq_unmap_user(struct bio *, unsigned int); |
568 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); | 577 | extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); |
569 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); | 578 | extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); |
570 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, | 579 | extern int blk_execute_rq(request_queue_t *, struct gendisk *, |
571 | struct request *, int); | 580 | struct request *, int); |
@@ -611,12 +620,21 @@ extern void end_request(struct request *req, int uptodate); | |||
611 | 620 | ||
612 | static inline void blkdev_dequeue_request(struct request *req) | 621 | static inline void blkdev_dequeue_request(struct request *req) |
613 | { | 622 | { |
614 | BUG_ON(list_empty(&req->queuelist)); | 623 | elv_dequeue_request(req->q, req); |
624 | } | ||
615 | 625 | ||
616 | list_del_init(&req->queuelist); | 626 | /* |
627 | * This should be in elevator.h, but that requires pulling in rq and q | ||
628 | */ | ||
629 | static inline void elv_dispatch_add_tail(struct request_queue *q, | ||
630 | struct request *rq) | ||
631 | { | ||
632 | if (q->last_merge == rq) | ||
633 | q->last_merge = NULL; | ||
617 | 634 | ||
618 | if (req->rl) | 635 | q->end_sector = rq_end_sector(rq); |
619 | elv_remove_request(req->q, req); | 636 | q->boundary_rq = rq; |
637 | list_add_tail(&rq->queuelist, &q->queue_head); | ||
620 | } | 638 | } |
621 | 639 | ||
622 | /* | 640 | /* |
@@ -650,12 +668,10 @@ extern void blk_dump_rq_flags(struct request *, char *); | |||
650 | extern void generic_unplug_device(request_queue_t *); | 668 | extern void generic_unplug_device(request_queue_t *); |
651 | extern void __generic_unplug_device(request_queue_t *); | 669 | extern void __generic_unplug_device(request_queue_t *); |
652 | extern long nr_blockdev_pages(void); | 670 | extern long nr_blockdev_pages(void); |
653 | extern void blk_wait_queue_drained(request_queue_t *, int); | ||
654 | extern void blk_finish_queue_drain(request_queue_t *); | ||
655 | 671 | ||
656 | int blk_get_queue(request_queue_t *); | 672 | int blk_get_queue(request_queue_t *); |
657 | request_queue_t *blk_alloc_queue(int gfp_mask); | 673 | request_queue_t *blk_alloc_queue(gfp_t); |
658 | request_queue_t *blk_alloc_queue_node(int,int); | 674 | request_queue_t *blk_alloc_queue_node(gfp_t, int); |
659 | #define blk_put_queue(q) blk_cleanup_queue((q)) | 675 | #define blk_put_queue(q) blk_cleanup_queue((q)) |
660 | 676 | ||
661 | /* | 677 | /* |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 6a1d154c0825..1db061bb6b08 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -126,8 +126,8 @@ BUFFER_FNS(Eopnotsupp, eopnotsupp) | |||
126 | /* If we *know* page->private refers to buffer_heads */ | 126 | /* If we *know* page->private refers to buffer_heads */ |
127 | #define page_buffers(page) \ | 127 | #define page_buffers(page) \ |
128 | ({ \ | 128 | ({ \ |
129 | BUG_ON(!PagePrivate(page)); \ | 129 | BUG_ON(!PagePrivate(page)); \ |
130 | ((struct buffer_head *)(page)->private); \ | 130 | ((struct buffer_head *)page_private(page)); \ |
131 | }) | 131 | }) |
132 | #define page_has_buffers(page) PagePrivate(page) | 132 | #define page_has_buffers(page) PagePrivate(page) |
133 | 133 | ||
@@ -188,8 +188,9 @@ extern int buffer_heads_over_limit; | |||
188 | * Generic address_space_operations implementations for buffer_head-backed | 188 | * Generic address_space_operations implementations for buffer_head-backed |
189 | * address_spaces. | 189 | * address_spaces. |
190 | */ | 190 | */ |
191 | int try_to_release_page(struct page * page, int gfp_mask); | 191 | int try_to_release_page(struct page * page, gfp_t gfp_mask); |
192 | int block_invalidatepage(struct page *page, unsigned long offset); | 192 | int block_invalidatepage(struct page *page, unsigned long offset); |
193 | int do_invalidatepage(struct page *page, unsigned long offset); | ||
193 | int block_write_full_page(struct page *page, get_block_t *get_block, | 194 | int block_write_full_page(struct page *page, get_block_t *get_block, |
194 | struct writeback_control *wbc); | 195 | struct writeback_control *wbc); |
195 | int block_read_full_page(struct page*, get_block_t*); | 196 | int block_read_full_page(struct page*, get_block_t*); |
@@ -219,7 +220,7 @@ static inline void attach_page_buffers(struct page *page, | |||
219 | { | 220 | { |
220 | page_cache_get(page); | 221 | page_cache_get(page); |
221 | SetPagePrivate(page); | 222 | SetPagePrivate(page); |
222 | page->private = (unsigned long)head; | 223 | set_page_private(page, (unsigned long)head); |
223 | } | 224 | } |
224 | 225 | ||
225 | static inline void get_bh(struct buffer_head *bh) | 226 | static inline void get_bh(struct buffer_head *bh) |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 86980c68234a..1f7b2c097503 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -32,6 +32,7 @@ struct cpu { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern int register_cpu(struct cpu *, int, struct node *); | 34 | extern int register_cpu(struct cpu *, int, struct node *); |
35 | extern struct sys_device *get_cpu_sysdev(int cpu); | ||
35 | #ifdef CONFIG_HOTPLUG_CPU | 36 | #ifdef CONFIG_HOTPLUG_CPU |
36 | extern void unregister_cpu(struct cpu *, struct node *); | 37 | extern void unregister_cpu(struct cpu *, struct node *); |
37 | #endif | 38 | #endif |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index ff7f80f48df1..d068176b7ad7 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/completion.h> | 23 | #include <linux/completion.h> |
24 | #include <linux/workqueue.h> | 24 | #include <linux/workqueue.h> |
25 | #include <linux/cpumask.h> | 25 | #include <linux/cpumask.h> |
26 | #include <asm/div64.h> | ||
26 | 27 | ||
27 | #define CPUFREQ_NAME_LEN 16 | 28 | #define CPUFREQ_NAME_LEN 16 |
28 | 29 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 9bdba8169b41..13e9f4a3ab26 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -12,6 +12,8 @@ | |||
12 | * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c. | 12 | * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c. |
13 | * For details of cpulist_scnprintf() and cpulist_parse(), see | 13 | * For details of cpulist_scnprintf() and cpulist_parse(), see |
14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | 14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. |
15 | * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c | ||
16 | * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c. | ||
15 | * | 17 | * |
16 | * The available cpumask operations are: | 18 | * The available cpumask operations are: |
17 | * | 19 | * |
@@ -50,6 +52,8 @@ | |||
50 | * int cpumask_parse(ubuf, ulen, mask) Parse ascii string as cpumask | 52 | * int cpumask_parse(ubuf, ulen, mask) Parse ascii string as cpumask |
51 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing | 53 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing |
52 | * int cpulist_parse(buf, map) Parse ascii string as cpulist | 54 | * int cpulist_parse(buf, map) Parse ascii string as cpulist |
55 | * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | ||
56 | * int cpus_remap(dst, src, old, new) *dst = map(old, new)(src) | ||
53 | * | 57 | * |
54 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask | 58 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask |
55 | * | 59 | * |
@@ -294,6 +298,22 @@ static inline int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits) | |||
294 | return bitmap_parselist(buf, dstp->bits, nbits); | 298 | return bitmap_parselist(buf, dstp->bits, nbits); |
295 | } | 299 | } |
296 | 300 | ||
301 | #define cpu_remap(oldbit, old, new) \ | ||
302 | __cpu_remap((oldbit), &(old), &(new), NR_CPUS) | ||
303 | static inline int __cpu_remap(int oldbit, | ||
304 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
305 | { | ||
306 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | ||
307 | } | ||
308 | |||
309 | #define cpus_remap(dst, src, old, new) \ | ||
310 | __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS) | ||
311 | static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | ||
312 | const cpumask_t *oldp, const cpumask_t *newp, int nbits) | ||
313 | { | ||
314 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | ||
315 | } | ||
316 | |||
297 | #if NR_CPUS > 1 | 317 | #if NR_CPUS > 1 |
298 | #define for_each_cpu_mask(cpu, mask) \ | 318 | #define for_each_cpu_mask(cpu, mask) \ |
299 | for ((cpu) = first_cpu(mask); \ | 319 | for ((cpu) = first_cpu(mask); \ |
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h index 04fa7dff079c..300d704bdb9a 100644 --- a/include/linux/cyclomx.h +++ b/include/linux/cyclomx.h | |||
@@ -37,8 +37,6 @@ | |||
37 | #include <linux/cycx_x25.h> | 37 | #include <linux/cycx_x25.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) | ||
41 | |||
42 | /* Adapter Data Space. | 40 | /* Adapter Data Space. |
43 | * This structure is needed because we handle multiple cards, otherwise | 41 | * This structure is needed because we handle multiple cards, otherwise |
44 | * static data would do it. | 42 | * static data would do it. |
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h index 6621df86a748..12fe6b0bfcff 100644 --- a/include/linux/cycx_drv.h +++ b/include/linux/cycx_drv.h | |||
@@ -60,6 +60,5 @@ extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | |||
60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); | 60 | extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); |
61 | extern int cycx_exec(void __iomem *addr); | 61 | extern int cycx_exec(void __iomem *addr); |
62 | 62 | ||
63 | extern void cycx_inten(struct cycx_hw *hw); | ||
64 | extern void cycx_intr(struct cycx_hw *hw); | 63 | extern void cycx_intr(struct cycx_hw *hw); |
65 | #endif /* _CYCX_DRV_H */ | 64 | #endif /* _CYCX_DRV_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 95d607a48f06..17cbc6db67b4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -28,19 +28,6 @@ | |||
28 | #define BUS_ID_SIZE KOBJ_NAME_LEN | 28 | #define BUS_ID_SIZE KOBJ_NAME_LEN |
29 | 29 | ||
30 | 30 | ||
31 | enum { | ||
32 | SUSPEND_NOTIFY, | ||
33 | SUSPEND_SAVE_STATE, | ||
34 | SUSPEND_DISABLE, | ||
35 | SUSPEND_POWER_DOWN, | ||
36 | }; | ||
37 | |||
38 | enum { | ||
39 | RESUME_POWER_ON, | ||
40 | RESUME_RESTORE_STATE, | ||
41 | RESUME_ENABLE, | ||
42 | }; | ||
43 | |||
44 | struct device; | 31 | struct device; |
45 | struct device_driver; | 32 | struct device_driver; |
46 | struct class; | 33 | struct class; |
@@ -115,8 +102,8 @@ struct device_driver { | |||
115 | int (*probe) (struct device * dev); | 102 | int (*probe) (struct device * dev); |
116 | int (*remove) (struct device * dev); | 103 | int (*remove) (struct device * dev); |
117 | void (*shutdown) (struct device * dev); | 104 | void (*shutdown) (struct device * dev); |
118 | int (*suspend) (struct device * dev, pm_message_t state, u32 level); | 105 | int (*suspend) (struct device * dev, pm_message_t state); |
119 | int (*resume) (struct device * dev, u32 level); | 106 | int (*resume) (struct device * dev); |
120 | }; | 107 | }; |
121 | 108 | ||
122 | 109 | ||
@@ -190,7 +177,43 @@ struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) | |||
190 | extern int class_create_file(struct class *, const struct class_attribute *); | 177 | extern int class_create_file(struct class *, const struct class_attribute *); |
191 | extern void class_remove_file(struct class *, const struct class_attribute *); | 178 | extern void class_remove_file(struct class *, const struct class_attribute *); |
192 | 179 | ||
180 | struct class_device_attribute { | ||
181 | struct attribute attr; | ||
182 | ssize_t (*show)(struct class_device *, char * buf); | ||
183 | ssize_t (*store)(struct class_device *, const char * buf, size_t count); | ||
184 | }; | ||
193 | 185 | ||
186 | #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
187 | struct class_device_attribute class_device_attr_##_name = \ | ||
188 | __ATTR(_name,_mode,_show,_store) | ||
189 | |||
190 | extern int class_device_create_file(struct class_device *, | ||
191 | const struct class_device_attribute *); | ||
192 | |||
193 | /** | ||
194 | * struct class_device - class devices | ||
195 | * @class: pointer to the parent class for this class device. This is required. | ||
196 | * @devt: for internal use by the driver core only. | ||
197 | * @node: for internal use by the driver core only. | ||
198 | * @kobj: for internal use by the driver core only. | ||
199 | * @devt_attr: for internal use by the driver core only. | ||
200 | * @dev: if set, a symlink to the struct device is created in the sysfs | ||
201 | * directory for this struct class device. | ||
202 | * @class_data: pointer to whatever you want to store here for this struct | ||
203 | * class_device. Use class_get_devdata() and class_set_devdata() to get and | ||
204 | * set this pointer. | ||
205 | * @parent: pointer to a struct class_device that is the parent of this struct | ||
206 | * class_device. If NULL, this class_device will show up at the root of the | ||
207 | * struct class in sysfs (which is probably what you want to have happen.) | ||
208 | * @release: pointer to a release function for this struct class_device. If | ||
209 | * set, this will be called instead of the class specific release function. | ||
210 | * Only use this if you want to override the default release function, like | ||
211 | * when you are nesting class_device structures. | ||
212 | * @hotplug: pointer to a hotplug function for this struct class_device. If | ||
213 | * set, this will be called instead of the class specific hotplug function. | ||
214 | * Only use this if you want to override the default hotplug function, like | ||
215 | * when you are nesting class_device structures. | ||
216 | */ | ||
194 | struct class_device { | 217 | struct class_device { |
195 | struct list_head node; | 218 | struct list_head node; |
196 | 219 | ||
@@ -198,9 +221,14 @@ struct class_device { | |||
198 | struct class * class; /* required */ | 221 | struct class * class; /* required */ |
199 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 222 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
200 | struct class_device_attribute *devt_attr; | 223 | struct class_device_attribute *devt_attr; |
224 | struct class_device_attribute uevent_attr; | ||
201 | struct device * dev; /* not necessary, but nice to have */ | 225 | struct device * dev; /* not necessary, but nice to have */ |
202 | void * class_data; /* class-specific data */ | 226 | void * class_data; /* class-specific data */ |
227 | struct class_device *parent; /* parent of this child device, if there is one */ | ||
203 | 228 | ||
229 | void (*release)(struct class_device *dev); | ||
230 | int (*hotplug)(struct class_device *dev, char **envp, | ||
231 | int num_envp, char *buffer, int buffer_size); | ||
204 | char class_id[BUS_ID_SIZE]; /* unique to this class */ | 232 | char class_id[BUS_ID_SIZE]; /* unique to this class */ |
205 | }; | 233 | }; |
206 | 234 | ||
@@ -228,18 +256,6 @@ extern int class_device_rename(struct class_device *, char *); | |||
228 | extern struct class_device * class_device_get(struct class_device *); | 256 | extern struct class_device * class_device_get(struct class_device *); |
229 | extern void class_device_put(struct class_device *); | 257 | extern void class_device_put(struct class_device *); |
230 | 258 | ||
231 | struct class_device_attribute { | ||
232 | struct attribute attr; | ||
233 | ssize_t (*show)(struct class_device *, char * buf); | ||
234 | ssize_t (*store)(struct class_device *, const char * buf, size_t count); | ||
235 | }; | ||
236 | |||
237 | #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
238 | struct class_device_attribute class_device_attr_##_name = \ | ||
239 | __ATTR(_name,_mode,_show,_store) | ||
240 | |||
241 | extern int class_device_create_file(struct class_device *, | ||
242 | const struct class_device_attribute *); | ||
243 | extern void class_device_remove_file(struct class_device *, | 259 | extern void class_device_remove_file(struct class_device *, |
244 | const struct class_device_attribute *); | 260 | const struct class_device_attribute *); |
245 | extern int class_device_create_bin_file(struct class_device *, | 261 | extern int class_device_create_bin_file(struct class_device *, |
@@ -251,8 +267,8 @@ struct class_interface { | |||
251 | struct list_head node; | 267 | struct list_head node; |
252 | struct class *class; | 268 | struct class *class; |
253 | 269 | ||
254 | int (*add) (struct class_device *); | 270 | int (*add) (struct class_device *, struct class_interface *); |
255 | void (*remove) (struct class_device *); | 271 | void (*remove) (struct class_device *, struct class_interface *); |
256 | }; | 272 | }; |
257 | 273 | ||
258 | extern int class_interface_register(struct class_interface *); | 274 | extern int class_interface_register(struct class_interface *); |
@@ -260,12 +276,29 @@ extern void class_interface_unregister(struct class_interface *); | |||
260 | 276 | ||
261 | extern struct class *class_create(struct module *owner, char *name); | 277 | extern struct class *class_create(struct module *owner, char *name); |
262 | extern void class_destroy(struct class *cls); | 278 | extern void class_destroy(struct class *cls); |
263 | extern struct class_device *class_device_create(struct class *cls, dev_t devt, | 279 | extern struct class_device *class_device_create(struct class *cls, |
264 | struct device *device, char *fmt, ...) | 280 | struct class_device *parent, |
265 | __attribute__((format(printf,4,5))); | 281 | dev_t devt, |
282 | struct device *device, | ||
283 | char *fmt, ...) | ||
284 | __attribute__((format(printf,5,6))); | ||
266 | extern void class_device_destroy(struct class *cls, dev_t devt); | 285 | extern void class_device_destroy(struct class *cls, dev_t devt); |
267 | 286 | ||
268 | 287 | ||
288 | /* interface for exporting device attributes */ | ||
289 | struct device_attribute { | ||
290 | struct attribute attr; | ||
291 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, | ||
292 | char *buf); | ||
293 | ssize_t (*store)(struct device *dev, struct device_attribute *attr, | ||
294 | const char *buf, size_t count); | ||
295 | }; | ||
296 | |||
297 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
298 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | ||
299 | |||
300 | extern int device_create_file(struct device *device, struct device_attribute * entry); | ||
301 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | ||
269 | struct device { | 302 | struct device { |
270 | struct klist klist_children; | 303 | struct klist klist_children; |
271 | struct klist_node knode_parent; /* node in sibling list */ | 304 | struct klist_node knode_parent; /* node in sibling list */ |
@@ -275,6 +308,7 @@ struct device { | |||
275 | 308 | ||
276 | struct kobject kobj; | 309 | struct kobject kobj; |
277 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 310 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
311 | struct device_attribute uevent_attr; | ||
278 | 312 | ||
279 | struct semaphore sem; /* semaphore to synchronize calls to | 313 | struct semaphore sem; /* semaphore to synchronize calls to |
280 | * its driver. | 314 | * its driver. |
@@ -343,23 +377,6 @@ extern int device_attach(struct device * dev); | |||
343 | extern void driver_attach(struct device_driver * drv); | 377 | extern void driver_attach(struct device_driver * drv); |
344 | 378 | ||
345 | 379 | ||
346 | /* driverfs interface for exporting device attributes */ | ||
347 | |||
348 | struct device_attribute { | ||
349 | struct attribute attr; | ||
350 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, | ||
351 | char *buf); | ||
352 | ssize_t (*store)(struct device *dev, struct device_attribute *attr, | ||
353 | const char *buf, size_t count); | ||
354 | }; | ||
355 | |||
356 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | ||
357 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | ||
358 | |||
359 | |||
360 | extern int device_create_file(struct device *device, struct device_attribute * entry); | ||
361 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | ||
362 | |||
363 | /* | 380 | /* |
364 | * Platform "fixup" functions - allow the platform to have their say | 381 | * Platform "fixup" functions - allow the platform to have their say |
365 | * about devices and actions that the general device layer doesn't | 382 | * about devices and actions that the general device layer doesn't |
@@ -379,32 +396,6 @@ extern struct device * get_device(struct device * dev); | |||
379 | extern void put_device(struct device * dev); | 396 | extern void put_device(struct device * dev); |
380 | 397 | ||
381 | 398 | ||
382 | /* drivers/base/platform.c */ | ||
383 | |||
384 | struct platform_device { | ||
385 | const char * name; | ||
386 | u32 id; | ||
387 | struct device dev; | ||
388 | u32 num_resources; | ||
389 | struct resource * resource; | ||
390 | }; | ||
391 | |||
392 | #define to_platform_device(x) container_of((x), struct platform_device, dev) | ||
393 | |||
394 | extern int platform_device_register(struct platform_device *); | ||
395 | extern void platform_device_unregister(struct platform_device *); | ||
396 | |||
397 | extern struct bus_type platform_bus_type; | ||
398 | extern struct device platform_bus; | ||
399 | |||
400 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); | ||
401 | extern int platform_get_irq(struct platform_device *, unsigned int); | ||
402 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *); | ||
403 | extern int platform_get_irq_byname(struct platform_device *, char *); | ||
404 | extern int platform_add_devices(struct platform_device **, int); | ||
405 | |||
406 | extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); | ||
407 | |||
408 | /* drivers/base/power.c */ | 399 | /* drivers/base/power.c */ |
409 | extern void device_shutdown(void); | 400 | extern void device_shutdown(void); |
410 | 401 | ||
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index a415f1d93e9a..05f4132622fc 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -60,7 +60,7 @@ struct dmi_device { | |||
60 | void *device_data; /* Type specific data */ | 60 | void *device_data; /* Type specific data */ |
61 | }; | 61 | }; |
62 | 62 | ||
63 | #if defined(CONFIG_X86) && !defined(CONFIG_X86_64) | 63 | #if defined(CONFIG_X86_32) |
64 | 64 | ||
65 | extern int dmi_check_system(struct dmi_system_id *list); | 65 | extern int dmi_check_system(struct dmi_system_id *list); |
66 | extern char * dmi_get_system_info(int field); | 66 | extern char * dmi_get_system_info(int field); |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index ea6bbc2d7407..a74c27e460ba 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -8,18 +8,17 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc | |||
8 | 8 | ||
9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); | 9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); |
10 | 10 | ||
11 | typedef struct request *(elevator_next_req_fn) (request_queue_t *); | 11 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); |
12 | 12 | ||
13 | typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, int); | 13 | typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); |
14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); | 14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); |
15 | typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *); | ||
16 | typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *); | ||
17 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); | 15 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); |
18 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | 16 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); |
19 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); | 17 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); |
20 | 18 | ||
21 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int); | 19 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); |
22 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | 20 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); |
21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | ||
23 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
24 | 23 | ||
25 | typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); | 24 | typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); |
@@ -31,10 +30,9 @@ struct elevator_ops | |||
31 | elevator_merged_fn *elevator_merged_fn; | 30 | elevator_merged_fn *elevator_merged_fn; |
32 | elevator_merge_req_fn *elevator_merge_req_fn; | 31 | elevator_merge_req_fn *elevator_merge_req_fn; |
33 | 32 | ||
34 | elevator_next_req_fn *elevator_next_req_fn; | 33 | elevator_dispatch_fn *elevator_dispatch_fn; |
35 | elevator_add_req_fn *elevator_add_req_fn; | 34 | elevator_add_req_fn *elevator_add_req_fn; |
36 | elevator_remove_req_fn *elevator_remove_req_fn; | 35 | elevator_activate_req_fn *elevator_activate_req_fn; |
37 | elevator_requeue_req_fn *elevator_requeue_req_fn; | ||
38 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; | 36 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; |
39 | 37 | ||
40 | elevator_queue_empty_fn *elevator_queue_empty_fn; | 38 | elevator_queue_empty_fn *elevator_queue_empty_fn; |
@@ -81,15 +79,15 @@ struct elevator_queue | |||
81 | /* | 79 | /* |
82 | * block elevator interface | 80 | * block elevator interface |
83 | */ | 81 | */ |
82 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | ||
84 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 83 | extern void elv_add_request(request_queue_t *, struct request *, int, int); |
85 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 84 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); |
86 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 85 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); |
87 | extern void elv_merge_requests(request_queue_t *, struct request *, | 86 | extern void elv_merge_requests(request_queue_t *, struct request *, |
88 | struct request *); | 87 | struct request *); |
89 | extern void elv_merged_request(request_queue_t *, struct request *); | 88 | extern void elv_merged_request(request_queue_t *, struct request *); |
90 | extern void elv_remove_request(request_queue_t *, struct request *); | 89 | extern void elv_dequeue_request(request_queue_t *, struct request *); |
91 | extern void elv_requeue_request(request_queue_t *, struct request *); | 90 | extern void elv_requeue_request(request_queue_t *, struct request *); |
92 | extern void elv_deactivate_request(request_queue_t *, struct request *); | ||
93 | extern int elv_queue_empty(request_queue_t *); | 91 | extern int elv_queue_empty(request_queue_t *); |
94 | extern struct request *elv_next_request(struct request_queue *q); | 92 | extern struct request *elv_next_request(struct request_queue *q); |
95 | extern struct request *elv_former_request(request_queue_t *, struct request *); | 93 | extern struct request *elv_former_request(request_queue_t *, struct request *); |
@@ -98,7 +96,7 @@ extern int elv_register_queue(request_queue_t *q); | |||
98 | extern void elv_unregister_queue(request_queue_t *q); | 96 | extern void elv_unregister_queue(request_queue_t *q); |
99 | extern int elv_may_queue(request_queue_t *, int, struct bio *); | 97 | extern int elv_may_queue(request_queue_t *, int, struct bio *); |
100 | extern void elv_completed_request(request_queue_t *, struct request *); | 98 | extern void elv_completed_request(request_queue_t *, struct request *); |
101 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int); | 99 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); |
102 | extern void elv_put_request(request_queue_t *, struct request *); | 100 | extern void elv_put_request(request_queue_t *, struct request *); |
103 | 101 | ||
104 | /* | 102 | /* |
@@ -142,4 +140,6 @@ enum { | |||
142 | ELV_MQUEUE_MUST, | 140 | ELV_MQUEUE_MUST, |
143 | }; | 141 | }; |
144 | 142 | ||
143 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) | ||
144 | |||
145 | #endif | 145 | #endif |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 4522c7186bf3..cc84934f9059 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -104,6 +104,22 @@ static inline void random_ether_addr(u8 *addr) | |||
104 | addr [0] &= 0xfe; /* clear multicast bit */ | 104 | addr [0] &= 0xfe; /* clear multicast bit */ |
105 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ | 105 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ |
106 | } | 106 | } |
107 | |||
108 | /** | ||
109 | * compare_ether_addr - Compare two Ethernet addresses | ||
110 | * @addr1: Pointer to a six-byte array containing the Ethernet address | ||
111 | * @addr2 Pointer other six-byte array containing the Ethernet address | ||
112 | * | ||
113 | * Compare two ethernet addresses, returns 0 if equal | ||
114 | */ | ||
115 | static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b) | ||
116 | { | ||
117 | const u16 *a = (const u16 *) _a; | ||
118 | const u16 *b = (const u16 *) _b; | ||
119 | |||
120 | BUILD_BUG_ON(ETH_ALEN != 6); | ||
121 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; | ||
122 | } | ||
107 | #endif /* __KERNEL__ */ | 123 | #endif /* __KERNEL__ */ |
108 | 124 | ||
109 | #endif /* _LINUX_ETHERDEVICE_H */ | 125 | #endif /* _LINUX_ETHERDEVICE_H */ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ed1440ea4c91..d2c390eff1b2 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -269,6 +269,8 @@ u32 ethtool_op_get_tso(struct net_device *dev); | |||
269 | int ethtool_op_set_tso(struct net_device *dev, u32 data); | 269 | int ethtool_op_set_tso(struct net_device *dev, u32 data); |
270 | int ethtool_op_get_perm_addr(struct net_device *dev, | 270 | int ethtool_op_get_perm_addr(struct net_device *dev, |
271 | struct ethtool_perm_addr *addr, u8 *data); | 271 | struct ethtool_perm_addr *addr, u8 *data); |
272 | u32 ethtool_op_get_ufo(struct net_device *dev); | ||
273 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | ||
272 | 274 | ||
273 | /** | 275 | /** |
274 | * ðtool_ops - Alter and report network device settings | 276 | * ðtool_ops - Alter and report network device settings |
@@ -298,6 +300,8 @@ int ethtool_op_get_perm_addr(struct net_device *dev, | |||
298 | * set_sg: Turn scatter-gather on or off | 300 | * set_sg: Turn scatter-gather on or off |
299 | * get_tso: Report whether TCP segmentation offload is enabled | 301 | * get_tso: Report whether TCP segmentation offload is enabled |
300 | * set_tso: Turn TCP segmentation offload on or off | 302 | * set_tso: Turn TCP segmentation offload on or off |
303 | * get_ufo: Report whether UDP fragmentation offload is enabled | ||
304 | * set_ufo: Turn UDP fragmentation offload on or off | ||
301 | * self_test: Run specified self-tests | 305 | * self_test: Run specified self-tests |
302 | * get_strings: Return a set of strings that describe the requested objects | 306 | * get_strings: Return a set of strings that describe the requested objects |
303 | * phys_id: Identify the device | 307 | * phys_id: Identify the device |
@@ -364,6 +368,8 @@ struct ethtool_ops { | |||
364 | int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); | 368 | int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); |
365 | int (*begin)(struct net_device *); | 369 | int (*begin)(struct net_device *); |
366 | void (*complete)(struct net_device *); | 370 | void (*complete)(struct net_device *); |
371 | u32 (*get_ufo)(struct net_device *); | ||
372 | int (*set_ufo)(struct net_device *, u32); | ||
367 | }; | 373 | }; |
368 | 374 | ||
369 | /* CMDs currently supported */ | 375 | /* CMDs currently supported */ |
@@ -400,6 +406,8 @@ struct ethtool_ops { | |||
400 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ | 406 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ |
401 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ | 407 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ |
402 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ | 408 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ |
409 | #define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */ | ||
410 | #define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */ | ||
403 | 411 | ||
404 | /* compatibility with older code */ | 412 | /* compatibility with older code */ |
405 | #define SPARC_ETH_GSET ETHTOOL_GSET | 413 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e0b77c5af9a0..6d6226732c93 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -320,7 +320,7 @@ struct address_space_operations { | |||
320 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 320 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
321 | sector_t (*bmap)(struct address_space *, sector_t); | 321 | sector_t (*bmap)(struct address_space *, sector_t); |
322 | int (*invalidatepage) (struct page *, unsigned long); | 322 | int (*invalidatepage) (struct page *, unsigned long); |
323 | int (*releasepage) (struct page *, int); | 323 | int (*releasepage) (struct page *, gfp_t); |
324 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 324 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
325 | loff_t offset, unsigned long nr_segs); | 325 | loff_t offset, unsigned long nr_segs); |
326 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 326 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
@@ -574,7 +574,14 @@ struct file_ra_state { | |||
574 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ | 574 | #define RA_FLAG_INCACHE 0x02 /* file is already in cache */ |
575 | 575 | ||
576 | struct file { | 576 | struct file { |
577 | struct list_head f_list; | 577 | /* |
578 | * fu_list becomes invalid after file_free is called and queued via | ||
579 | * fu_rcuhead for RCU freeing | ||
580 | */ | ||
581 | union { | ||
582 | struct list_head fu_list; | ||
583 | struct rcu_head fu_rcuhead; | ||
584 | } f_u; | ||
578 | struct dentry *f_dentry; | 585 | struct dentry *f_dentry; |
579 | struct vfsmount *f_vfsmnt; | 586 | struct vfsmount *f_vfsmnt; |
580 | struct file_operations *f_op; | 587 | struct file_operations *f_op; |
@@ -598,7 +605,6 @@ struct file { | |||
598 | spinlock_t f_ep_lock; | 605 | spinlock_t f_ep_lock; |
599 | #endif /* #ifdef CONFIG_EPOLL */ | 606 | #endif /* #ifdef CONFIG_EPOLL */ |
600 | struct address_space *f_mapping; | 607 | struct address_space *f_mapping; |
601 | struct rcu_head f_rcuhead; | ||
602 | }; | 608 | }; |
603 | extern spinlock_t files_lock; | 609 | extern spinlock_t files_lock; |
604 | #define file_list_lock() spin_lock(&files_lock); | 610 | #define file_list_lock() spin_lock(&files_lock); |
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h new file mode 100644 index 000000000000..bef23bbf8690 --- /dev/null +++ b/include/linux/fs_enet_pd.h | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * Platform information definitions for the | ||
3 | * universal Freescale Ethernet driver. | ||
4 | * | ||
5 | * Copyright (c) 2003 Intracom S.A. | ||
6 | * by Pantelis Antoniou <panto@intracom.gr> | ||
7 | * | ||
8 | * 2005 (c) MontaVista Software, Inc. | ||
9 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
10 | * | ||
11 | * This file is licensed under the terms of the GNU General Public License | ||
12 | * version 2. This program is licensed "as is" without any warranty of any | ||
13 | * kind, whether express or implied. | ||
14 | */ | ||
15 | |||
16 | #ifndef FS_ENET_PD_H | ||
17 | #define FS_ENET_PD_H | ||
18 | |||
19 | #include <linux/version.h> | ||
20 | #include <asm/types.h> | ||
21 | |||
22 | #define FS_ENET_NAME "fs_enet" | ||
23 | |||
24 | enum fs_id { | ||
25 | fsid_fec1, | ||
26 | fsid_fec2, | ||
27 | fsid_fcc1, | ||
28 | fsid_fcc2, | ||
29 | fsid_fcc3, | ||
30 | fsid_scc1, | ||
31 | fsid_scc2, | ||
32 | fsid_scc3, | ||
33 | fsid_scc4, | ||
34 | }; | ||
35 | |||
36 | #define FS_MAX_INDEX 9 | ||
37 | |||
38 | static inline int fs_get_fec_index(enum fs_id id) | ||
39 | { | ||
40 | if (id >= fsid_fec1 && id <= fsid_fec2) | ||
41 | return id - fsid_fec1; | ||
42 | return -1; | ||
43 | } | ||
44 | |||
45 | static inline int fs_get_fcc_index(enum fs_id id) | ||
46 | { | ||
47 | if (id >= fsid_fcc1 && id <= fsid_fcc3) | ||
48 | return id - fsid_fcc1; | ||
49 | return -1; | ||
50 | } | ||
51 | |||
52 | static inline int fs_get_scc_index(enum fs_id id) | ||
53 | { | ||
54 | if (id >= fsid_scc1 && id <= fsid_scc4) | ||
55 | return id - fsid_scc1; | ||
56 | return -1; | ||
57 | } | ||
58 | |||
59 | enum fs_mii_method { | ||
60 | fsmii_fixed, | ||
61 | fsmii_fec, | ||
62 | fsmii_bitbang, | ||
63 | }; | ||
64 | |||
65 | enum fs_ioport { | ||
66 | fsiop_porta, | ||
67 | fsiop_portb, | ||
68 | fsiop_portc, | ||
69 | fsiop_portd, | ||
70 | fsiop_porte, | ||
71 | }; | ||
72 | |||
73 | struct fs_mii_bus_info { | ||
74 | int method; /* mii method */ | ||
75 | int id; /* the id of the mii_bus */ | ||
76 | int disable_aneg; /* if the controller needs to negothiate speed & duplex */ | ||
77 | int lpa; /* the default board-specific vallues will be applied otherwise */ | ||
78 | |||
79 | union { | ||
80 | struct { | ||
81 | int duplex; | ||
82 | int speed; | ||
83 | } fixed; | ||
84 | |||
85 | struct { | ||
86 | /* nothing */ | ||
87 | } fec; | ||
88 | |||
89 | struct { | ||
90 | /* nothing */ | ||
91 | } scc; | ||
92 | |||
93 | struct { | ||
94 | int mdio_port; /* port & bit for MDIO */ | ||
95 | int mdio_bit; | ||
96 | int mdc_port; /* port & bit for MDC */ | ||
97 | int mdc_bit; | ||
98 | int delay; /* delay in us */ | ||
99 | } bitbang; | ||
100 | } i; | ||
101 | }; | ||
102 | |||
103 | struct fs_platform_info { | ||
104 | |||
105 | void(*init_ioports)(void); | ||
106 | /* device specific information */ | ||
107 | int fs_no; /* controller index */ | ||
108 | |||
109 | u32 cp_page; /* CPM page */ | ||
110 | u32 cp_block; /* CPM sblock */ | ||
111 | |||
112 | u32 clk_trx; /* some stuff for pins & mux configuration*/ | ||
113 | u32 clk_route; | ||
114 | u32 clk_mask; | ||
115 | |||
116 | u32 mem_offset; | ||
117 | u32 dpram_offset; | ||
118 | u32 fcc_regs_c; | ||
119 | |||
120 | u32 device_flags; | ||
121 | |||
122 | int phy_addr; /* the phy address (-1 no phy) */ | ||
123 | int phy_irq; /* the phy irq (if it exists) */ | ||
124 | |||
125 | const struct fs_mii_bus_info *bus_info; | ||
126 | |||
127 | int rx_ring, tx_ring; /* number of buffers on rx */ | ||
128 | __u8 macaddr[6]; /* mac address */ | ||
129 | int rx_copybreak; /* limit we copy small frames */ | ||
130 | int use_napi; /* use NAPI */ | ||
131 | int napi_weight; /* NAPI weight */ | ||
132 | |||
133 | int use_rmii; /* use RMII mode */ | ||
134 | }; | ||
135 | |||
136 | #endif | ||
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 70f54af87b9f..114d5d59f695 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -47,16 +47,21 @@ | |||
47 | struct gianfar_platform_data { | 47 | struct gianfar_platform_data { |
48 | /* device specific information */ | 48 | /* device specific information */ |
49 | u32 device_flags; | 49 | u32 device_flags; |
50 | u32 phy_reg_addr; | ||
51 | 50 | ||
52 | /* board specific information */ | 51 | /* board specific information */ |
53 | u32 board_flags; | 52 | u32 board_flags; |
54 | u32 phy_flags; | 53 | const char *bus_id; |
55 | u32 phyid; | ||
56 | u32 interruptPHY; | ||
57 | u8 mac_addr[6]; | 54 | u8 mac_addr[6]; |
58 | }; | 55 | }; |
59 | 56 | ||
57 | struct gianfar_mdio_data { | ||
58 | /* device specific information */ | ||
59 | u32 paddr; | ||
60 | |||
61 | /* board specific information */ | ||
62 | int irq[32]; | ||
63 | }; | ||
64 | |||
60 | /* Flags related to gianfar device features */ | 65 | /* Flags related to gianfar device features */ |
61 | #define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001 | 66 | #define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001 |
62 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 | 67 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index acbeb96a3353..f98854c2abd7 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -61,7 +61,6 @@ struct fuse_kstatfs { | |||
61 | #define FATTR_SIZE (1 << 3) | 61 | #define FATTR_SIZE (1 << 3) |
62 | #define FATTR_ATIME (1 << 4) | 62 | #define FATTR_ATIME (1 << 4) |
63 | #define FATTR_MTIME (1 << 5) | 63 | #define FATTR_MTIME (1 << 5) |
64 | #define FATTR_CTIME (1 << 6) | ||
65 | 64 | ||
66 | /** | 65 | /** |
67 | * Flags returned by the OPEN request | 66 | * Flags returned by the OPEN request |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index cd623eccdbea..2401dea2b867 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <asm/io.h> | 12 | #include <asm/io.h> |
13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/timer.h> | ||
15 | 16 | ||
16 | struct gameport { | 17 | struct gameport { |
17 | 18 | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 01796c41c951..eabdb5cce357 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -119,7 +119,7 @@ struct gendisk { | |||
119 | int policy; | 119 | int policy; |
120 | 120 | ||
121 | atomic_t sync_io; /* RAID */ | 121 | atomic_t sync_io; /* RAID */ |
122 | unsigned long stamp, stamp_idle; | 122 | unsigned long stamp; |
123 | int in_flight; | 123 | int in_flight; |
124 | #ifdef CONFIG_SMP | 124 | #ifdef CONFIG_SMP |
125 | struct disk_stats *dkstats; | 125 | struct disk_stats *dkstats; |
@@ -132,6 +132,7 @@ struct gendisk { | |||
132 | struct disk_attribute { | 132 | struct disk_attribute { |
133 | struct attribute attr; | 133 | struct attribute attr; |
134 | ssize_t (*show)(struct gendisk *, char *); | 134 | ssize_t (*show)(struct gendisk *, char *); |
135 | ssize_t (*store)(struct gendisk *, const char *, size_t); | ||
135 | }; | 136 | }; |
136 | 137 | ||
137 | /* | 138 | /* |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 3010e172394d..c3779432a723 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -12,8 +12,8 @@ struct vm_area_struct; | |||
12 | * GFP bitmasks.. | 12 | * GFP bitmasks.. |
13 | */ | 13 | */ |
14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ | 14 | /* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ |
15 | #define __GFP_DMA 0x01u | 15 | #define __GFP_DMA ((__force gfp_t)0x01u) |
16 | #define __GFP_HIGHMEM 0x02u | 16 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Action modifiers - doesn't change the zoning | 19 | * Action modifiers - doesn't change the zoning |
@@ -26,24 +26,24 @@ struct vm_area_struct; | |||
26 | * | 26 | * |
27 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. | 27 | * __GFP_NORETRY: The VM implementation must not retry indefinitely. |
28 | */ | 28 | */ |
29 | #define __GFP_WAIT 0x10u /* Can wait and reschedule? */ | 29 | #define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ |
30 | #define __GFP_HIGH 0x20u /* Should access emergency pools? */ | 30 | #define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ |
31 | #define __GFP_IO 0x40u /* Can start physical IO? */ | 31 | #define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */ |
32 | #define __GFP_FS 0x80u /* Can call down to low-level FS? */ | 32 | #define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */ |
33 | #define __GFP_COLD 0x100u /* Cache-cold page required */ | 33 | #define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */ |
34 | #define __GFP_NOWARN 0x200u /* Suppress page allocation failure warning */ | 34 | #define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */ |
35 | #define __GFP_REPEAT 0x400u /* Retry the allocation. Might fail */ | 35 | #define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */ |
36 | #define __GFP_NOFAIL 0x800u /* Retry for ever. Cannot fail */ | 36 | #define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */ |
37 | #define __GFP_NORETRY 0x1000u /* Do not retry. Might fail */ | 37 | #define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */ |
38 | #define __GFP_NO_GROW 0x2000u /* Slab internal usage */ | 38 | #define __GFP_NO_GROW ((__force gfp_t)0x2000u)/* Slab internal usage */ |
39 | #define __GFP_COMP 0x4000u /* Add compound page metadata */ | 39 | #define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */ |
40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ | 40 | #define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */ |
41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ | 41 | #define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ |
42 | #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ | 42 | #define __GFP_NORECLAIM ((__force gfp_t)0x20000u) /* No realy zone reclaim during allocation */ |
43 | #define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */ | 43 | #define __GFP_HARDWALL ((__force gfp_t)0x40000u) /* Enforce hardwall cpuset memory allocs */ |
44 | 44 | ||
45 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 45 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
46 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) | 46 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
47 | 47 | ||
48 | /* if you forget to add the bitmask here kernel will crash, period */ | 48 | /* if you forget to add the bitmask here kernel will crash, period */ |
49 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 49 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
@@ -64,6 +64,7 @@ struct vm_area_struct; | |||
64 | 64 | ||
65 | #define GFP_DMA __GFP_DMA | 65 | #define GFP_DMA __GFP_DMA |
66 | 66 | ||
67 | #define gfp_zone(mask) ((__force int)((mask) & (__force gfp_t)GFP_ZONEMASK)) | ||
67 | 68 | ||
68 | /* | 69 | /* |
69 | * There is only one page-allocator function, and two main namespaces to | 70 | * There is only one page-allocator function, and two main namespaces to |
@@ -94,7 +95,7 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | |||
94 | return NULL; | 95 | return NULL; |
95 | 96 | ||
96 | return __alloc_pages(gfp_mask, order, | 97 | return __alloc_pages(gfp_mask, order, |
97 | NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK)); | 98 | NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask)); |
98 | } | 99 | } |
99 | 100 | ||
100 | #ifdef CONFIG_NUMA | 101 | #ifdef CONFIG_NUMA |
diff --git a/include/linux/hil.h b/include/linux/hil.h new file mode 100644 index 000000000000..13352d7d0caf --- /dev/null +++ b/include/linux/hil.h | |||
@@ -0,0 +1,483 @@ | |||
1 | #ifndef _HIL_H_ | ||
2 | #define _HIL_H_ | ||
3 | |||
4 | /* | ||
5 | * Hewlett Packard Human Interface Loop (HP-HIL) Protocol -- header. | ||
6 | * | ||
7 | * Copyright (c) 2001 Brian S. Julin | ||
8 | * All rights reserved. | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * 1. Redistributions of source code must retain the above copyright | ||
14 | * notice, this list of conditions, and the following disclaimer, | ||
15 | * without modification. | ||
16 | * 2. The name of the author may not be used to endorse or promote products | ||
17 | * derived from this software without specific prior written permission. | ||
18 | * | ||
19 | * Alternatively, this software may be distributed under the terms of the | ||
20 | * GNU General Public License ("GPL"). | ||
21 | * | ||
22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | ||
26 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
31 | * | ||
32 | * References: | ||
33 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A | ||
34 | * | ||
35 | * A note of thanks to HP for providing and shipping reference materials | ||
36 | * free of charge to help in the development of HIL support for Linux. | ||
37 | * | ||
38 | */ | ||
39 | |||
40 | #include <asm/types.h> | ||
41 | |||
42 | /* Physical constants relevant to raw loop/device timing. | ||
43 | */ | ||
44 | |||
45 | #define HIL_CLOCK 8MHZ | ||
46 | #define HIL_EK1_CLOCK 30HZ | ||
47 | #define HIL_EK2_CLOCK 60HZ | ||
48 | |||
49 | #define HIL_TIMEOUT_DEV 5 /* ms */ | ||
50 | #define HIL_TIMEOUT_DEVS 10 /* ms */ | ||
51 | #define HIL_TIMEOUT_NORESP 10 /* ms */ | ||
52 | #define HIL_TIMEOUT_DEVS_DATA 16 /* ms */ | ||
53 | #define HIL_TIMEOUT_SELFTEST 200 /* ms */ | ||
54 | |||
55 | |||
56 | /* Actual wire line coding. These will only be useful if someone is | ||
57 | * implementing a software MLC to run HIL devices on a non-parisc machine. | ||
58 | */ | ||
59 | |||
60 | #define HIL_WIRE_PACKET_LEN 15 | ||
61 | enum hil_wire_bitpos { | ||
62 | HIL_WIRE_START = 0, | ||
63 | HIL_WIRE_ADDR2, | ||
64 | HIL_WIRE_ADDR1, | ||
65 | HIL_WIRE_ADDR0, | ||
66 | HIL_WIRE_COMMAND, | ||
67 | HIL_WIRE_DATA7, | ||
68 | HIL_WIRE_DATA6, | ||
69 | HIL_WIRE_DATA5, | ||
70 | HIL_WIRE_DATA4, | ||
71 | HIL_WIRE_DATA3, | ||
72 | HIL_WIRE_DATA2, | ||
73 | HIL_WIRE_DATA1, | ||
74 | HIL_WIRE_DATA0, | ||
75 | HIL_WIRE_PARITY, | ||
76 | HIL_WIRE_STOP | ||
77 | }; | ||
78 | |||
79 | /* HP documentation uses these bit positions to refer to commands; | ||
80 | * we will call these "packets". | ||
81 | */ | ||
82 | enum hil_pkt_bitpos { | ||
83 | HIL_PKT_CMD = 0x00000800, | ||
84 | HIL_PKT_ADDR2 = 0x00000400, | ||
85 | HIL_PKT_ADDR1 = 0x00000200, | ||
86 | HIL_PKT_ADDR0 = 0x00000100, | ||
87 | HIL_PKT_ADDR_MASK = 0x00000700, | ||
88 | HIL_PKT_ADDR_SHIFT = 8, | ||
89 | HIL_PKT_DATA7 = 0x00000080, | ||
90 | HIL_PKT_DATA6 = 0x00000040, | ||
91 | HIL_PKT_DATA5 = 0x00000020, | ||
92 | HIL_PKT_DATA4 = 0x00000010, | ||
93 | HIL_PKT_DATA3 = 0x00000008, | ||
94 | HIL_PKT_DATA2 = 0x00000004, | ||
95 | HIL_PKT_DATA1 = 0x00000002, | ||
96 | HIL_PKT_DATA0 = 0x00000001, | ||
97 | HIL_PKT_DATA_MASK = 0x000000FF, | ||
98 | HIL_PKT_DATA_SHIFT = 0 | ||
99 | }; | ||
100 | |||
101 | /* The HIL MLC also has several error/status/control bits. We extend the | ||
102 | * "packet" to include these when direct access to the MLC is available, | ||
103 | * or emulate them in cases where they are not available. | ||
104 | * | ||
105 | * This way the device driver knows that the underlying MLC driver | ||
106 | * has had to deal with loop errors. | ||
107 | */ | ||
108 | enum hil_error_bitpos { | ||
109 | HIL_ERR_OB = 0x00000800, /* MLC is busy sending an auto-poll, | ||
110 | or we have filled up the output | ||
111 | buffer and must wait. */ | ||
112 | HIL_ERR_INT = 0x00010000, /* A normal interrupt has occurred. */ | ||
113 | HIL_ERR_NMI = 0x00020000, /* An NMI has occurred. */ | ||
114 | HIL_ERR_LERR = 0x00040000, /* A poll didn't come back. */ | ||
115 | HIL_ERR_PERR = 0x01000000, /* There was a Parity Error. */ | ||
116 | HIL_ERR_FERR = 0x02000000, /* There was a Framing Error. */ | ||
117 | HIL_ERR_FOF = 0x04000000 /* Input FIFO Overflowed. */ | ||
118 | }; | ||
119 | |||
120 | enum hil_control_bitpos { | ||
121 | HIL_CTRL_TEST = 0x00010000, | ||
122 | HIL_CTRL_IPF = 0x00040000, | ||
123 | HIL_CTRL_APE = 0x02000000 | ||
124 | }; | ||
125 | |||
126 | /* Bits 30,31 are unused, we use them to control write behavior. */ | ||
127 | #define HIL_DO_ALTER_CTRL 0x40000000 /* Write MSW of packet to control | ||
128 | before writing LSW to loop */ | ||
129 | #define HIL_CTRL_ONLY 0xc0000000 /* *Only* alter the control registers */ | ||
130 | |||
131 | /* This gives us a 32-bit "packet" | ||
132 | */ | ||
133 | typedef u32 hil_packet; | ||
134 | |||
135 | |||
136 | /* HIL Loop commands | ||
137 | */ | ||
138 | enum hil_command { | ||
139 | HIL_CMD_IFC = 0x00, /* Interface Clear */ | ||
140 | HIL_CMD_EPT = 0x01, /* Enter Pass-Thru Mode */ | ||
141 | HIL_CMD_ELB = 0x02, /* Enter Loop-Back Mode */ | ||
142 | HIL_CMD_IDD = 0x03, /* Identify and Describe */ | ||
143 | HIL_CMD_DSR = 0x04, /* Device Soft Reset */ | ||
144 | HIL_CMD_PST = 0x05, /* Perform Self Test */ | ||
145 | HIL_CMD_RRG = 0x06, /* Read Register */ | ||
146 | HIL_CMD_WRG = 0x07, /* Write Register */ | ||
147 | HIL_CMD_ACF = 0x08, /* Auto Configure */ | ||
148 | HIL_CMDID_ACF = 0x07, /* Auto Configure bits with incremented ID */ | ||
149 | HIL_CMD_POL = 0x10, /* Poll */ | ||
150 | HIL_CMDCT_POL = 0x0f, /* Poll command bits with item count */ | ||
151 | HIL_CMD_RPL = 0x20, /* RePoll */ | ||
152 | HIL_CMDCT_RPL = 0x0f, /* RePoll command bits with item count */ | ||
153 | HIL_CMD_RNM = 0x30, /* Report Name */ | ||
154 | HIL_CMD_RST = 0x31, /* Report Status */ | ||
155 | HIL_CMD_EXD = 0x32, /* Extended Describe */ | ||
156 | HIL_CMD_RSC = 0x33, /* Report Security Code */ | ||
157 | |||
158 | /* 0x34 to 0x3c reserved for future use */ | ||
159 | |||
160 | HIL_CMD_DKA = 0x3d, /* Disable Keyswitch Autorepeat */ | ||
161 | HIL_CMD_EK1 = 0x3e, /* Enable Keyswitch Autorepeat 1 */ | ||
162 | HIL_CMD_EK2 = 0x3f, /* Enable Keyswitch Autorepeat 2 */ | ||
163 | HIL_CMD_PR1 = 0x40, /* Prompt1 */ | ||
164 | HIL_CMD_PR2 = 0x41, /* Prompt2 */ | ||
165 | HIL_CMD_PR3 = 0x42, /* Prompt3 */ | ||
166 | HIL_CMD_PR4 = 0x43, /* Prompt4 */ | ||
167 | HIL_CMD_PR5 = 0x44, /* Prompt5 */ | ||
168 | HIL_CMD_PR6 = 0x45, /* Prompt6 */ | ||
169 | HIL_CMD_PR7 = 0x46, /* Prompt7 */ | ||
170 | HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */ | ||
171 | HIL_CMD_AK1 = 0x48, /* Acknowlege1 */ | ||
172 | HIL_CMD_AK2 = 0x49, /* Acknowlege2 */ | ||
173 | HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */ | ||
174 | HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */ | ||
175 | HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */ | ||
176 | HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */ | ||
177 | HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */ | ||
178 | HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */ | ||
179 | |||
180 | /* 0x50 to 0x78 reserved for future use */ | ||
181 | /* 0x80 to 0xEF device-specific commands */ | ||
182 | /* 0xf0 to 0xf9 reserved for future use */ | ||
183 | |||
184 | HIL_CMD_RIO = 0xfa, /* Register I/O Error */ | ||
185 | HIL_CMD_SHR = 0xfb, /* System Hard Reset */ | ||
186 | HIL_CMD_TER = 0xfc, /* Transmission Error */ | ||
187 | HIL_CMD_CAE = 0xfd, /* Configuration Address Error */ | ||
188 | HIL_CMD_DHR = 0xfe, /* Device Hard Reset */ | ||
189 | |||
190 | /* 0xff is prohibited from use. */ | ||
191 | }; | ||
192 | |||
193 | |||
194 | /* | ||
195 | * Response "records" to HIL commands | ||
196 | */ | ||
197 | |||
198 | /* Device ID byte | ||
199 | */ | ||
200 | #define HIL_IDD_DID_TYPE_MASK 0xe0 /* Primary type bits */ | ||
201 | #define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0 /* Integral keyboard */ | ||
202 | #define HIL_IDD_DID_TYPE_KB_ITF 0xc0 /* ITD keyboard */ | ||
203 | #define HIL_IDD_DID_TYPE_KB_RSVD 0xe0 /* Reserved keyboard type */ | ||
204 | #define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f /* Keyboard locale bits */ | ||
205 | #define HIL_IDD_DID_KBLANG_USE_ESD 0x00 /* Use ESD Locale instead */ | ||
206 | #define HIL_IDD_DID_TYPE_ABS 0x80 /* Absolute Positioners */ | ||
207 | #define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8 /* Reserved */ | ||
208 | #define HIL_IDD_DID_ABS_RSVD1 0x98 | ||
209 | #define HIL_IDD_DID_ABS_TABLET_MASK 0xf8 /* Tablets and digitizers */ | ||
210 | #define HIL_IDD_DID_ABS_TABLET 0x90 | ||
211 | #define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc /* Touch screens */ | ||
212 | #define HIL_IDD_DID_ABS_TSCREEN 0x8c | ||
213 | #define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc /* Reserved */ | ||
214 | #define HIL_IDD_DID_ABS_RSVD2 0x88 | ||
215 | #define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc /* Reserved */ | ||
216 | #define HIL_IDD_DID_ABS_RSVD3 0x80 | ||
217 | #define HIL_IDD_DID_TYPE_REL 0x60 /* Relative Positioners */ | ||
218 | #define HIL_IDD_DID_REL_RSVD1_MASK 0xf0 /* Reserved */ | ||
219 | #define HIL_IDD_DID_REL_RSVD1 0x70 | ||
220 | #define HIL_IDD_DID_REL_RSVD2_MASK 0xfc /* Reserved */ | ||
221 | #define HIL_IDD_DID_REL_RSVD2 0x6c | ||
222 | #define HIL_IDD_DID_REL_MOUSE_MASK 0xfc /* Mouse */ | ||
223 | #define HIL_IDD_DID_REL_MOUSE 0x68 | ||
224 | #define HIL_IDD_DID_REL_QUAD_MASK 0xf8 /* Other Quadrature Devices */ | ||
225 | #define HIL_IDD_DID_REL_QUAD 0x60 | ||
226 | #define HIL_IDD_DID_TYPE_CHAR 0x40 /* Character Entry */ | ||
227 | #define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc /* Barcode Reader */ | ||
228 | #define HIL_IDD_DID_CHAR_BARCODE 0x5c | ||
229 | #define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc /* Reserved */ | ||
230 | #define HIL_IDD_DID_CHAR_RSVD1 0x58 | ||
231 | #define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8 /* Reserved */ | ||
232 | #define HIL_IDD_DID_CHAR_RSVD2 0x50 | ||
233 | #define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0 /* Reserved */ | ||
234 | #define HIL_IDD_DID_CHAR_RSVD3 0x40 | ||
235 | #define HIL_IDD_DID_TYPE_OTHER 0x20 /* Miscellaneous */ | ||
236 | #define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0 /* Reserved */ | ||
237 | #define HIL_IDD_DID_OTHER_RSVD1 0x30 | ||
238 | #define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc /* Tone Generator */ | ||
239 | #define HIL_IDD_DID_OTHER_BARCODE 0x2c | ||
240 | #define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc /* Reserved */ | ||
241 | #define HIL_IDD_DID_OTHER_RSVD2 0x28 | ||
242 | #define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8 /* Reserved */ | ||
243 | #define HIL_IDD_DID_OTHER_RSVD3 0x20 | ||
244 | #define HIL_IDD_DID_TYPE_KEYPAD 0x00 /* Vectra Keyboard */ | ||
245 | |||
246 | /* IDD record header | ||
247 | */ | ||
248 | #define HIL_IDD_HEADER_AXSET_MASK 0x03 /* Number of axis in a set */ | ||
249 | #define HIL_IDD_HEADER_RSC 0x04 /* Supports RSC command */ | ||
250 | #define HIL_IDD_HEADER_EXD 0x08 /* Supports EXD command */ | ||
251 | #define HIL_IDD_HEADER_IOD 0x10 /* IOD byte to follow */ | ||
252 | #define HIL_IDD_HEADER_16BIT 0x20 /* 16 (vs. 8) bit resolution */ | ||
253 | #define HIL_IDD_HEADER_ABS 0x40 /* Reports Absolute Position */ | ||
254 | #define HIL_IDD_HEADER_2X_AXIS 0x80 /* Two sets of 1-3 axis */ | ||
255 | |||
256 | /* I/O Descriptor | ||
257 | */ | ||
258 | #define HIL_IDD_IOD_NBUTTON_MASK 0x07 /* Number of buttons */ | ||
259 | #define HIL_IDD_IOD_PROXIMITY 0x08 /* Proximity in/out events */ | ||
260 | #define HIL_IDD_IOD_PROMPT_MASK 0x70 /* Number of prompts/acks */ | ||
261 | #define HIL_IDD_IOD_PROMPT_SHIFT 4 | ||
262 | #define HIL_IDD_IOD_PROMPT 0x80 /* Generic prompt/ack */ | ||
263 | |||
264 | #define HIL_IDD_NUM_AXES_PER_SET(header_packet) \ | ||
265 | ((header_packet) & HIL_IDD_HEADER_AXSET_MASK) | ||
266 | |||
267 | #define HIL_IDD_NUM_AXSETS(header_packet) \ | ||
268 | (2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS)) | ||
269 | |||
270 | #define HIL_IDD_LEN(header_packet) \ | ||
271 | ((4 - !(header_packet & HIL_IDD_HEADER_IOD) - \ | ||
272 | 2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) + \ | ||
273 | 2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) * \ | ||
274 | !!((header_packet) & HIL_IDD_HEADER_ABS)) | ||
275 | |||
276 | /* The following HIL_IDD_* macros assume you have an array of | ||
277 | * packets and/or unpacked 8-bit data in the order that they | ||
278 | * were received. | ||
279 | */ | ||
280 | |||
281 | #define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) \ | ||
282 | (!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 : \ | ||
283 | (((*(header_ptr + 1) & HIL_PKT_DATA_MASK) + \ | ||
284 | ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8) \ | ||
285 | * ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1))) | ||
286 | |||
287 | #define HIL_IDD_AXIS_MAX(header_ptr, __axnum) \ | ||
288 | ((!(*(header_ptr) & HIL_IDD_HEADER_ABS) || \ | ||
289 | (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 : \ | ||
290 | ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) + \ | ||
291 | ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8))) | ||
292 | |||
293 | #define HIL_IDD_IOD(header_ptr) \ | ||
294 | (*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1)) | ||
295 | |||
296 | #define HIL_IDD_HAS_GEN_PROMPT(header_ptr) \ | ||
297 | ((*header_ptr & HIL_IDD_HEADER_IOD) && \ | ||
298 | (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT)) | ||
299 | |||
300 | #define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) \ | ||
301 | ((*header_ptr & HIL_IDD_HEADER_IOD) && \ | ||
302 | (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY)) | ||
303 | |||
304 | #define HIL_IDD_NUM_BUTTONS(header_ptr) \ | ||
305 | ((*header_ptr & HIL_IDD_HEADER_IOD) ? \ | ||
306 | (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0) | ||
307 | |||
308 | #define HIL_IDD_NUM_PROMPTS(header_ptr) \ | ||
309 | ((*header_ptr & HIL_IDD_HEADER_IOD) ? \ | ||
310 | ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK) \ | ||
311 | >> HIL_IDD_IOD_PROMPT_SHIFT) : 0) | ||
312 | |||
313 | /* The response to HIL EXD commands -- the "extended describe record" */ | ||
314 | #define HIL_EXD_HEADER_WRG 0x03 /* Supports type2 WRG */ | ||
315 | #define HIL_EXD_HEADER_WRG_TYPE1 0x01 /* Supports type1 WRG */ | ||
316 | #define HIL_EXD_HEADER_WRG_TYPE2 0x02 /* Supports type2 WRG */ | ||
317 | #define HIL_EXD_HEADER_RRG 0x04 /* Supports RRG command */ | ||
318 | #define HIL_EXD_HEADER_RNM 0x10 /* Supports RNM command */ | ||
319 | #define HIL_EXD_HEADER_RST 0x20 /* Supports RST command */ | ||
320 | #define HIL_EXD_HEADER_LOCALE 0x40 /* Contains locale code */ | ||
321 | |||
322 | #define HIL_EXD_NUM_RRG(header_ptr) \ | ||
323 | ((*header_ptr & HIL_EXD_HEADER_RRG) ? \ | ||
324 | (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0) | ||
325 | |||
326 | #define HIL_EXD_NUM_WWG(header_ptr) \ | ||
327 | ((*header_ptr & HIL_EXD_HEADER_WRG) ? \ | ||
328 | (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) & \ | ||
329 | HIL_PKT_DATA_MASK) : 0) | ||
330 | |||
331 | #define HIL_EXD_LEN(header_ptr) \ | ||
332 | (!!(*header_ptr & HIL_EXD_HEADER_RRG) + \ | ||
333 | !!(*header_ptr & HIL_EXD_HEADER_WRG) + \ | ||
334 | !!(*header_ptr & HIL_EXD_HEADER_LOCALE) + \ | ||
335 | 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1) | ||
336 | |||
337 | #define HIL_EXD_LOCALE(header_ptr) \ | ||
338 | (!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 : \ | ||
339 | (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK)) | ||
340 | |||
341 | #define HIL_EXD_WRG_TYPE2_LEN(header_ptr) \ | ||
342 | (!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 : \ | ||
343 | (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 - \ | ||
344 | !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) + \ | ||
345 | ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 - \ | ||
346 | !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8)) | ||
347 | |||
348 | /* Device locale codes. */ | ||
349 | |||
350 | /* Last defined locale code. Everything above this is "Reserved", | ||
351 | and note that this same table applies to the Device ID Byte where | ||
352 | keyboards may have a nationality code which is only 5 bits. */ | ||
353 | #define HIL_LOCALE_MAX 0x1f | ||
354 | |||
355 | /* Map to hopefully useful strings. I was trying to make these look | ||
356 | like locale.aliases strings do; maybe that isn't the right table to | ||
357 | emulate. In either case, I didn't have much to work on. */ | ||
358 | #define HIL_LOCALE_MAP \ | ||
359 | "", /* 0x00 Reserved */ \ | ||
360 | "", /* 0x01 Reserved */ \ | ||
361 | "", /* 0x02 Reserved */ \ | ||
362 | "swiss.french", /* 0x03 Swiss/French */ \ | ||
363 | "portuguese", /* 0x04 Portuguese */ \ | ||
364 | "arabic", /* 0x05 Arabic */ \ | ||
365 | "hebrew", /* 0x06 Hebrew */ \ | ||
366 | "english.canadian", /* 0x07 Canadian English */ \ | ||
367 | "turkish", /* 0x08 Turkish */ \ | ||
368 | "greek", /* 0x09 Greek */ \ | ||
369 | "thai", /* 0x0a Thai (Thailand) */ \ | ||
370 | "italian", /* 0x0b Italian */ \ | ||
371 | "korean", /* 0x0c Hangul (Korea) */ \ | ||
372 | "dutch", /* 0x0d Dutch */ \ | ||
373 | "swedish", /* 0x0e Swedish */ \ | ||
374 | "german", /* 0x0f German */ \ | ||
375 | "chinese", /* 0x10 Chinese-PRC */ \ | ||
376 | "chinese", /* 0x11 Chinese-ROC */ \ | ||
377 | "swiss.french", /* 0x12 Swiss/French II */ \ | ||
378 | "spanish", /* 0x13 Spanish */ \ | ||
379 | "swiss.german", /* 0x14 Swiss/German II */ \ | ||
380 | "flemish", /* 0x15 Belgian (Flemish) */ \ | ||
381 | "finnish", /* 0x16 Finnish */ \ | ||
382 | "english.uk", /* 0x17 United Kingdom */ \ | ||
383 | "french.canadian", /* 0x18 French/Canadian */ \ | ||
384 | "swiss.german", /* 0x19 Swiss/German */ \ | ||
385 | "norwegian", /* 0x1a Norwegian */ \ | ||
386 | "french", /* 0x1b French */ \ | ||
387 | "danish", /* 0x1c Danish */ \ | ||
388 | "japanese", /* 0x1d Katakana */ \ | ||
389 | "spanish", /* 0x1e Latin American/Spanish*/\ | ||
390 | "english.us" /* 0x1f United States */ \ | ||
391 | |||
392 | |||
393 | /* HIL keycodes */ | ||
394 | #define HIL_KEYCODES_SET1_TBLSIZE 128 | ||
395 | #define HIL_KEYCODES_SET1 \ | ||
396 | KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT, \ | ||
397 | KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ, \ | ||
398 | KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9, \ | ||
399 | KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER, \ | ||
400 | KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS, \ | ||
401 | KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS, \ | ||
402 | KEY_B, KEY_V, KEY_C, KEY_X, \ | ||
403 | KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC, \ | ||
404 | KEY_6, KEY_F10, KEY_3, KEY_F11, \ | ||
405 | KEY_KPDOT, KEY_F9, KEY_TAB /*KP*/, KEY_F12, \ | ||
406 | KEY_H, KEY_G, KEY_F, KEY_D, \ | ||
407 | KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK, \ | ||
408 | KEY_U, KEY_Y, KEY_T, KEY_R, \ | ||
409 | KEY_E, KEY_W, KEY_Q, KEY_TAB, \ | ||
410 | KEY_7, KEY_6, KEY_5, KEY_4, \ | ||
411 | KEY_3, KEY_2, KEY_1, KEY_GRAVE, \ | ||
412 | KEY_F13, KEY_F14, KEY_F15, KEY_F16, \ | ||
413 | KEY_F17, KEY_F18, KEY_F19, KEY_F20, \ | ||
414 | KEY_MENU, KEY_F4, KEY_F3, KEY_F2, \ | ||
415 | KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE, \ | ||
416 | KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7, \ | ||
417 | KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS, \ | ||
418 | KEY_8, KEY_9, KEY_0, KEY_MINUS, \ | ||
419 | KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE, \ | ||
420 | KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, \ | ||
421 | KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE, \ | ||
422 | KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \ | ||
423 | KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP, \ | ||
424 | KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, \ | ||
425 | KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN, \ | ||
426 | KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED, \ | ||
427 | KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT | ||
428 | |||
429 | |||
430 | #define HIL_KEYCODES_SET3_TBLSIZE 128 | ||
431 | #define HIL_KEYCODES_SET3 \ | ||
432 | KEY_RESERVED, KEY_ESC, KEY_1, KEY_2, \ | ||
433 | KEY_3, KEY_4, KEY_5, KEY_6, \ | ||
434 | KEY_7, KEY_8, KEY_9, KEY_0, \ | ||
435 | KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB, \ | ||
436 | KEY_Q, KEY_W, KEY_E, KEY_R, \ | ||
437 | KEY_T, KEY_Y, KEY_U, KEY_I, \ | ||
438 | KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, \ | ||
439 | KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S, \ | ||
440 | KEY_D, KEY_F, KEY_G, KEY_H, \ | ||
441 | KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \ | ||
442 | KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, \ | ||
443 | KEY_Z, KEY_X, KEY_C, KEY_V, \ | ||
444 | KEY_B, KEY_N, KEY_M, KEY_COMMA, \ | ||
445 | KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, \ | ||
446 | KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, \ | ||
447 | KEY_F2, KEY_F3, KEY_F4, KEY_F5, \ | ||
448 | KEY_F6, KEY_F7, KEY_F8, KEY_F9, \ | ||
449 | KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7, \ | ||
450 | KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4, \ | ||
451 | KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1, \ | ||
452 | KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT, \ | ||
453 | KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
454 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
455 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
456 | KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, \ | ||
457 | KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN, \ | ||
458 | KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED, \ | ||
459 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
460 | KEY_F1, KEY_F2, KEY_F3, KEY_F4, \ | ||
461 | KEY_F5, KEY_F6, KEY_F7, KEY_F8, \ | ||
462 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \ | ||
463 | KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED | ||
464 | |||
465 | |||
466 | /* Response to POL command, the "poll record header" */ | ||
467 | |||
468 | #define HIL_POL_NUM_AXES_MASK 0x03 /* Number of axis reported */ | ||
469 | #define HIL_POL_CTS 0x04 /* Device ready to receive data */ | ||
470 | #define HIL_POL_STATUS_PENDING 0x08 /* Device has status to report */ | ||
471 | #define HIL_POL_CHARTYPE_MASK 0x70 /* Type of character data to follow */ | ||
472 | #define HIL_POL_CHARTYPE_NONE 0x00 /* No character data to follow */ | ||
473 | #define HIL_POL_CHARTYPE_RSVD1 0x10 /* Reserved Set 1 */ | ||
474 | #define HIL_POL_CHARTYPE_ASCII 0x20 /* U.S. ASCII */ | ||
475 | #define HIL_POL_CHARTYPE_BINARY 0x30 /* Binary data */ | ||
476 | #define HIL_POL_CHARTYPE_SET1 0x40 /* Keycode Set 1 */ | ||
477 | #define HIL_POL_CHARTYPE_RSVD2 0x50 /* Reserved Set 2 */ | ||
478 | #define HIL_POL_CHARTYPE_SET2 0x60 /* Keycode Set 2 */ | ||
479 | #define HIL_POL_CHARTYPE_SET3 0x70 /* Keycode Set 3 */ | ||
480 | #define HIL_POL_AXIS_ALT 0x80 /* Data is from axis set 2 */ | ||
481 | |||
482 | |||
483 | #endif /* _HIL_H_ */ | ||
diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h new file mode 100644 index 000000000000..8df29ca48a13 --- /dev/null +++ b/include/linux/hil_mlc.h | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * HP Human Interface Loop Master Link Controller driver. | ||
3 | * | ||
4 | * Copyright (c) 2001 Brian S. Julin | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions, and the following disclaimer, | ||
12 | * without modification. | ||
13 | * 2. The name of the author may not be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * Alternatively, this software may be distributed under the terms of the | ||
17 | * GNU General Public License ("GPL"). | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | ||
23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
28 | * | ||
29 | * References: | ||
30 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A | ||
31 | * | ||
32 | */ | ||
33 | |||
34 | #include <linux/hil.h> | ||
35 | #include <linux/time.h> | ||
36 | #include <linux/interrupt.h> | ||
37 | #include <asm/semaphore.h> | ||
38 | #include <linux/serio.h> | ||
39 | #include <linux/list.h> | ||
40 | |||
41 | typedef struct hil_mlc hil_mlc; | ||
42 | |||
43 | /* The HIL has a complicated state engine. | ||
44 | * We define the structure of nodes in the state engine here. | ||
45 | */ | ||
46 | enum hilse_act { | ||
47 | /* HILSE_OUT prepares to receive input if the next node | ||
48 | * is an IN or EXPECT, and then sends the given packet. | ||
49 | */ | ||
50 | HILSE_OUT = 0, | ||
51 | |||
52 | /* HILSE_CTS checks if the loop is busy. */ | ||
53 | HILSE_CTS, | ||
54 | |||
55 | /* HILSE_OUT_LAST sends the given command packet to | ||
56 | * the last configured/running device on the loop. | ||
57 | */ | ||
58 | HILSE_OUT_LAST, | ||
59 | |||
60 | /* HILSE_OUT_DISC sends the given command packet to | ||
61 | * the next device past the last configured/running one. | ||
62 | */ | ||
63 | HILSE_OUT_DISC, | ||
64 | |||
65 | /* HILSE_FUNC runs a callback function with given arguments. | ||
66 | * a positive return value causes the "ugly" branch to be taken. | ||
67 | */ | ||
68 | HILSE_FUNC, | ||
69 | |||
70 | /* HILSE_IN simply expects any non-errored packet to arrive | ||
71 | * within arg usecs. | ||
72 | */ | ||
73 | HILSE_IN = 0x100, | ||
74 | |||
75 | /* HILSE_EXPECT expects a particular packet to arrive | ||
76 | * within arg usecs, any other packet is considered an error. | ||
77 | */ | ||
78 | HILSE_EXPECT, | ||
79 | |||
80 | /* HILSE_EXPECT_LAST as above but dev field should be last | ||
81 | * discovered/operational device. | ||
82 | */ | ||
83 | HILSE_EXPECT_LAST, | ||
84 | |||
85 | /* HILSE_EXPECT_LAST as above but dev field should be first | ||
86 | * undiscovered/inoperational device. | ||
87 | */ | ||
88 | HILSE_EXPECT_DISC | ||
89 | }; | ||
90 | |||
91 | typedef int (hilse_func) (hil_mlc *mlc, int arg); | ||
92 | struct hilse_node { | ||
93 | enum hilse_act act; /* How to process this node */ | ||
94 | union { | ||
95 | hilse_func *func; /* Function to call if HILSE_FUNC */ | ||
96 | hil_packet packet; /* Packet to send or to compare */ | ||
97 | } object; | ||
98 | int arg; /* Timeout in usec or parm for func */ | ||
99 | int good; /* Node to jump to on success */ | ||
100 | int bad; /* Node to jump to on error */ | ||
101 | int ugly; /* Node to jump to on timeout */ | ||
102 | }; | ||
103 | |||
104 | /* Methods for back-end drivers, e.g. hp_sdc_mlc */ | ||
105 | typedef int (hil_mlc_cts) (hil_mlc *mlc); | ||
106 | typedef void (hil_mlc_out) (hil_mlc *mlc); | ||
107 | typedef int (hil_mlc_in) (hil_mlc *mlc, suseconds_t timeout); | ||
108 | |||
109 | struct hil_mlc_devinfo { | ||
110 | uint8_t idd[16]; /* Device ID Byte and Describe Record */ | ||
111 | uint8_t rsc[16]; /* Security Code Header and Record */ | ||
112 | uint8_t exd[16]; /* Extended Describe Record */ | ||
113 | uint8_t rnm[16]; /* Device name as returned by RNM command */ | ||
114 | }; | ||
115 | |||
116 | struct hil_mlc_serio_map { | ||
117 | hil_mlc *mlc; | ||
118 | int di_revmap; | ||
119 | int didx; | ||
120 | }; | ||
121 | |||
122 | /* How many (possibly old/detached) devices the we try to keep track of */ | ||
123 | #define HIL_MLC_DEVMEM 16 | ||
124 | |||
125 | struct hil_mlc { | ||
126 | struct list_head list; /* hil_mlc is organized as linked list */ | ||
127 | |||
128 | rwlock_t lock; | ||
129 | |||
130 | void *priv; /* Data specific to a particular type of MLC */ | ||
131 | |||
132 | int seidx; /* Current node in state engine */ | ||
133 | int istarted, ostarted; | ||
134 | |||
135 | hil_mlc_cts *cts; | ||
136 | struct semaphore csem; /* Raised when loop idle */ | ||
137 | |||
138 | hil_mlc_out *out; | ||
139 | struct semaphore osem; /* Raised when outpacket dispatched */ | ||
140 | hil_packet opacket; | ||
141 | |||
142 | hil_mlc_in *in; | ||
143 | struct semaphore isem; /* Raised when a packet arrives */ | ||
144 | hil_packet ipacket[16]; | ||
145 | hil_packet imatch; | ||
146 | int icount; | ||
147 | struct timeval instart; | ||
148 | suseconds_t intimeout; | ||
149 | |||
150 | int ddi; /* Last operational device id */ | ||
151 | int lcv; /* LCV to throttle loops */ | ||
152 | struct timeval lcv_tv; /* Time loop was started */ | ||
153 | |||
154 | int di_map[7]; /* Maps below items to live devs */ | ||
155 | struct hil_mlc_devinfo di[HIL_MLC_DEVMEM]; | ||
156 | struct serio *serio[HIL_MLC_DEVMEM]; | ||
157 | struct hil_mlc_serio_map serio_map[HIL_MLC_DEVMEM]; | ||
158 | hil_packet serio_opacket[HIL_MLC_DEVMEM]; | ||
159 | int serio_oidx[HIL_MLC_DEVMEM]; | ||
160 | struct hil_mlc_devinfo di_scratch; /* Temporary area */ | ||
161 | |||
162 | int opercnt; | ||
163 | |||
164 | struct tasklet_struct *tasklet; | ||
165 | }; | ||
166 | |||
167 | int hil_mlc_register(hil_mlc *mlc); | ||
168 | int hil_mlc_unregister(hil_mlc *mlc); | ||
diff --git a/include/linux/hp_sdc.h b/include/linux/hp_sdc.h new file mode 100644 index 000000000000..debd71515312 --- /dev/null +++ b/include/linux/hp_sdc.h | |||
@@ -0,0 +1,300 @@ | |||
1 | /* | ||
2 | * HP i8042 System Device Controller -- header | ||
3 | * | ||
4 | * Copyright (c) 2001 Brian S. Julin | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions, and the following disclaimer, | ||
12 | * without modification. | ||
13 | * 2. The name of the author may not be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * Alternatively, this software may be distributed under the terms of the | ||
17 | * GNU General Public License ("GPL"). | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR | ||
23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
28 | * | ||
29 | * References: | ||
30 | * | ||
31 | * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A | ||
32 | * | ||
33 | * System Device Controller Microprocessor Firmware Theory of Operation | ||
34 | * for Part Number 1820-4784 Revision B. Dwg No. A-1820-4784-2 | ||
35 | * | ||
36 | */ | ||
37 | |||
38 | #ifndef _LINUX_HP_SDC_H | ||
39 | #define _LINUX_HP_SDC_H | ||
40 | |||
41 | #include <linux/interrupt.h> | ||
42 | #include <linux/types.h> | ||
43 | #include <linux/time.h> | ||
44 | #include <linux/timer.h> | ||
45 | #if defined(__hppa__) | ||
46 | #include <asm/hardware.h> | ||
47 | #endif | ||
48 | |||
49 | |||
50 | /* No 4X status reads take longer than this (in usec). | ||
51 | */ | ||
52 | #define HP_SDC_MAX_REG_DELAY 20000 | ||
53 | |||
54 | typedef void (hp_sdc_irqhook) (int irq, void *dev_id, | ||
55 | uint8_t status, uint8_t data); | ||
56 | |||
57 | int hp_sdc_request_timer_irq(hp_sdc_irqhook *callback); | ||
58 | int hp_sdc_request_hil_irq(hp_sdc_irqhook *callback); | ||
59 | int hp_sdc_request_cooked_irq(hp_sdc_irqhook *callback); | ||
60 | int hp_sdc_release_timer_irq(hp_sdc_irqhook *callback); | ||
61 | int hp_sdc_release_hil_irq(hp_sdc_irqhook *callback); | ||
62 | int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback); | ||
63 | |||
64 | typedef struct { | ||
65 | int actidx; /* Start of act. Acts are atomic WRT I/O to SDC */ | ||
66 | int idx; /* Index within the act */ | ||
67 | int endidx; /* transaction is over and done if idx == endidx */ | ||
68 | uint8_t *seq; /* commands/data for the transaction */ | ||
69 | union { | ||
70 | hp_sdc_irqhook *irqhook; /* Callback, isr or tasklet context */ | ||
71 | struct semaphore *semaphore; /* Semaphore to sleep on. */ | ||
72 | } act; | ||
73 | } hp_sdc_transaction; | ||
74 | int hp_sdc_enqueue_transaction(hp_sdc_transaction *this); | ||
75 | int hp_sdc_dequeue_transaction(hp_sdc_transaction *this); | ||
76 | |||
77 | /* The HP_SDC_ACT* values are peculiar to this driver. | ||
78 | * Nuance: never HP_SDC_ACT_DATAIN | HP_SDC_ACT_DEALLOC, use another | ||
79 | * act to perform the dealloc. | ||
80 | */ | ||
81 | #define HP_SDC_ACT_PRECMD 0x01 /* Send a command first */ | ||
82 | #define HP_SDC_ACT_DATAREG 0x02 /* Set data registers */ | ||
83 | #define HP_SDC_ACT_DATAOUT 0x04 /* Send data bytes */ | ||
84 | #define HP_SDC_ACT_POSTCMD 0x08 /* Send command after */ | ||
85 | #define HP_SDC_ACT_DATAIN 0x10 /* Collect data after */ | ||
86 | #define HP_SDC_ACT_DURING 0x1f | ||
87 | #define HP_SDC_ACT_SEMAPHORE 0x20 /* Raise semaphore after */ | ||
88 | #define HP_SDC_ACT_CALLBACK 0x40 /* Pass data to IRQ handler */ | ||
89 | #define HP_SDC_ACT_DEALLOC 0x80 /* Destroy transaction after */ | ||
90 | #define HP_SDC_ACT_AFTER 0xe0 | ||
91 | #define HP_SDC_ACT_DEAD 0x60 /* Act timed out. */ | ||
92 | |||
93 | /* Rest of the flags are straightforward representation of the SDC interface */ | ||
94 | #define HP_SDC_STATUS_IBF 0x02 /* Input buffer full */ | ||
95 | |||
96 | #define HP_SDC_STATUS_IRQMASK 0xf0 /* Bits containing "level 1" irq */ | ||
97 | #define HP_SDC_STATUS_PERIODIC 0x10 /* Periodic 10ms timer */ | ||
98 | #define HP_SDC_STATUS_USERTIMER 0x20 /* "Special purpose" timer */ | ||
99 | #define HP_SDC_STATUS_TIMER 0x30 /* Both PERIODIC and USERTIMER */ | ||
100 | #define HP_SDC_STATUS_REG 0x40 /* Data from an i8042 register */ | ||
101 | #define HP_SDC_STATUS_HILCMD 0x50 /* Command from HIL MLC */ | ||
102 | #define HP_SDC_STATUS_HILDATA 0x60 /* Data from HIL MLC */ | ||
103 | #define HP_SDC_STATUS_PUP 0x70 /* Sucessful power-up self test */ | ||
104 | #define HP_SDC_STATUS_KCOOKED 0x80 /* Key from cooked kbd */ | ||
105 | #define HP_SDC_STATUS_KRPG 0xc0 /* Key from Repeat Gen */ | ||
106 | #define HP_SDC_STATUS_KMOD_SUP 0x10 /* Shift key is up */ | ||
107 | #define HP_SDC_STATUS_KMOD_CUP 0x20 /* Control key is up */ | ||
108 | |||
109 | #define HP_SDC_NMISTATUS_FHS 0x40 /* NMI is a fast handshake irq */ | ||
110 | |||
111 | /* Internal i8042 registers (there are more, but they are not too useful). */ | ||
112 | |||
113 | #define HP_SDC_USE 0x02 /* Resource usage (including OB bit) */ | ||
114 | #define HP_SDC_IM 0x04 /* Interrupt mask */ | ||
115 | #define HP_SDC_CFG 0x11 /* Configuration register */ | ||
116 | #define HP_SDC_KBLANGUAGE 0x12 /* Keyboard language */ | ||
117 | |||
118 | #define HP_SDC_D0 0x70 /* General purpose data buffer 0 */ | ||
119 | #define HP_SDC_D1 0x71 /* General purpose data buffer 1 */ | ||
120 | #define HP_SDC_D2 0x72 /* General purpose data buffer 2 */ | ||
121 | #define HP_SDC_D3 0x73 /* General purpose data buffer 3 */ | ||
122 | #define HP_SDC_VT1 0x74 /* Timer for voice 1 */ | ||
123 | #define HP_SDC_VT2 0x75 /* Timer for voice 2 */ | ||
124 | #define HP_SDC_VT3 0x76 /* Timer for voice 3 */ | ||
125 | #define HP_SDC_VT4 0x77 /* Timer for voice 4 */ | ||
126 | #define HP_SDC_KBN 0x78 /* Which HIL devs are Nimitz */ | ||
127 | #define HP_SDC_KBC 0x79 /* Which HIL devs are cooked kbds */ | ||
128 | #define HP_SDC_LPS 0x7a /* i8042's view of HIL status */ | ||
129 | #define HP_SDC_LPC 0x7b /* i8042's view of HIL "control" */ | ||
130 | #define HP_SDC_RSV 0x7c /* Reserved "for testing" */ | ||
131 | #define HP_SDC_LPR 0x7d /* i8042 count of HIL reconfigs */ | ||
132 | #define HP_SDC_XTD 0x7e /* "Extended Configuration" register */ | ||
133 | #define HP_SDC_STR 0x7f /* i8042 self-test result */ | ||
134 | |||
135 | /* Bitfields for above registers */ | ||
136 | #define HP_SDC_USE_LOOP 0x04 /* Command is currently on the loop. */ | ||
137 | |||
138 | #define HP_SDC_IM_MASK 0x1f /* these bits not part of cmd/status */ | ||
139 | #define HP_SDC_IM_FH 0x10 /* Mask the fast handshake irq */ | ||
140 | #define HP_SDC_IM_PT 0x08 /* Mask the periodic timer irq */ | ||
141 | #define HP_SDC_IM_TIMERS 0x04 /* Mask the MT/DT/CT irq */ | ||
142 | #define HP_SDC_IM_RESET 0x02 /* Mask the reset key irq */ | ||
143 | #define HP_SDC_IM_HIL 0x01 /* Mask the HIL MLC irq */ | ||
144 | |||
145 | #define HP_SDC_CFG_ROLLOVER 0x08 /* WTF is "N-key rollover"? */ | ||
146 | #define HP_SDC_CFG_KBD 0x10 /* There is a keyboard */ | ||
147 | #define HP_SDC_CFG_NEW 0x20 /* Supports/uses HIL MLC */ | ||
148 | #define HP_SDC_CFG_KBD_OLD 0x03 /* keyboard code for non-HIL */ | ||
149 | #define HP_SDC_CFG_KBD_NEW 0x07 /* keyboard code from HIL autoconfig */ | ||
150 | #define HP_SDC_CFG_REV 0x40 /* Code revision bit */ | ||
151 | #define HP_SDC_CFG_IDPROM 0x80 /* IDPROM present in kbd (not HIL) */ | ||
152 | |||
153 | #define HP_SDC_LPS_NDEV 0x07 /* # devices autoconfigured on HIL */ | ||
154 | #define HP_SDC_LPS_ACSUCC 0x08 /* loop autoconfigured successfully */ | ||
155 | #define HP_SDC_LPS_ACFAIL 0x80 /* last loop autoconfigure failed */ | ||
156 | |||
157 | #define HP_SDC_LPC_APE_IPF 0x01 /* HIL MLC APE/IPF (autopoll) set */ | ||
158 | #define HP_SDC_LPC_ARCONERR 0x02 /* i8042 autoreconfigs loop on err */ | ||
159 | #define HP_SDC_LPC_ARCQUIET 0x03 /* i8042 doesn't report autoreconfigs*/ | ||
160 | #define HP_SDC_LPC_COOK 0x10 /* i8042 cooks devices in _KBN */ | ||
161 | #define HP_SDC_LPC_RC 0x80 /* causes autoreconfig */ | ||
162 | |||
163 | #define HP_SDC_XTD_REV 0x07 /* contains revision code */ | ||
164 | #define HP_SDC_XTD_REV_STRINGS(val, str) \ | ||
165 | switch (val) { \ | ||
166 | case 0x1: str = "1820-3712"; break; \ | ||
167 | case 0x2: str = "1820-4379"; break; \ | ||
168 | case 0x3: str = "1820-4784"; break; \ | ||
169 | default: str = "unknown"; \ | ||
170 | }; | ||
171 | #define HP_SDC_XTD_BEEPER 0x08 /* TI SN76494 beeper available */ | ||
172 | #define HP_SDC_XTD_BBRTC 0x20 /* OKI MSM-58321 BBRTC present */ | ||
173 | |||
174 | #define HP_SDC_CMD_LOAD_RT 0x31 /* Load real time (from 8042) */ | ||
175 | #define HP_SDC_CMD_LOAD_FHS 0x36 /* Load the fast handshake timer */ | ||
176 | #define HP_SDC_CMD_LOAD_MT 0x38 /* Load the match timer */ | ||
177 | #define HP_SDC_CMD_LOAD_DT 0x3B /* Load the delay timer */ | ||
178 | #define HP_SDC_CMD_LOAD_CT 0x3E /* Load the cycle timer */ | ||
179 | |||
180 | #define HP_SDC_CMD_SET_IM 0x40 /* 010xxxxx == set irq mask */ | ||
181 | |||
182 | /* The documents provided do not explicitly state that all registers betweem | ||
183 | * 0x01 and 0x1f inclusive can be read by sending their register index as a | ||
184 | * command, but this is implied and appears to be the case. | ||
185 | */ | ||
186 | #define HP_SDC_CMD_READ_RAM 0x00 /* Load from i8042 RAM (autoinc) */ | ||
187 | #define HP_SDC_CMD_READ_USE 0x02 /* Undocumented! Load from usage reg */ | ||
188 | #define HP_SDC_CMD_READ_IM 0x04 /* Load current interrupt mask */ | ||
189 | #define HP_SDC_CMD_READ_KCC 0x11 /* Load primary kbd config code */ | ||
190 | #define HP_SDC_CMD_READ_KLC 0x12 /* Load primary kbd language code */ | ||
191 | #define HP_SDC_CMD_READ_T1 0x13 /* Load timer output buffer byte 1 */ | ||
192 | #define HP_SDC_CMD_READ_T2 0x14 /* Load timer output buffer byte 1 */ | ||
193 | #define HP_SDC_CMD_READ_T3 0x15 /* Load timer output buffer byte 1 */ | ||
194 | #define HP_SDC_CMD_READ_T4 0x16 /* Load timer output buffer byte 1 */ | ||
195 | #define HP_SDC_CMD_READ_T5 0x17 /* Load timer output buffer byte 1 */ | ||
196 | #define HP_SDC_CMD_READ_D0 0xf0 /* Load from i8042 RAM location 0x70 */ | ||
197 | #define HP_SDC_CMD_READ_D1 0xf1 /* Load from i8042 RAM location 0x71 */ | ||
198 | #define HP_SDC_CMD_READ_D2 0xf2 /* Load from i8042 RAM location 0x72 */ | ||
199 | #define HP_SDC_CMD_READ_D3 0xf3 /* Load from i8042 RAM location 0x73 */ | ||
200 | #define HP_SDC_CMD_READ_VT1 0xf4 /* Load from i8042 RAM location 0x74 */ | ||
201 | #define HP_SDC_CMD_READ_VT2 0xf5 /* Load from i8042 RAM location 0x75 */ | ||
202 | #define HP_SDC_CMD_READ_VT3 0xf6 /* Load from i8042 RAM location 0x76 */ | ||
203 | #define HP_SDC_CMD_READ_VT4 0xf7 /* Load from i8042 RAM location 0x77 */ | ||
204 | #define HP_SDC_CMD_READ_KBN 0xf8 /* Load from i8042 RAM location 0x78 */ | ||
205 | #define HP_SDC_CMD_READ_KBC 0xf9 /* Load from i8042 RAM location 0x79 */ | ||
206 | #define HP_SDC_CMD_READ_LPS 0xfa /* Load from i8042 RAM location 0x7a */ | ||
207 | #define HP_SDC_CMD_READ_LPC 0xfb /* Load from i8042 RAM location 0x7b */ | ||
208 | #define HP_SDC_CMD_READ_RSV 0xfc /* Load from i8042 RAM location 0x7c */ | ||
209 | #define HP_SDC_CMD_READ_LPR 0xfd /* Load from i8042 RAM location 0x7d */ | ||
210 | #define HP_SDC_CMD_READ_XTD 0xfe /* Load from i8042 RAM location 0x7e */ | ||
211 | #define HP_SDC_CMD_READ_STR 0xff /* Load from i8042 RAM location 0x7f */ | ||
212 | |||
213 | #define HP_SDC_CMD_SET_ARD 0xA0 /* Set emulated autorepeat delay */ | ||
214 | #define HP_SDC_CMD_SET_ARR 0xA2 /* Set emulated autorepeat rate */ | ||
215 | #define HP_SDC_CMD_SET_BELL 0xA3 /* Set voice 3 params for "beep" cmd */ | ||
216 | #define HP_SDC_CMD_SET_RPGR 0xA6 /* Set "RPG" irq rate (doesn't work) */ | ||
217 | #define HP_SDC_CMD_SET_RTMS 0xAD /* Set the RTC time (milliseconds) */ | ||
218 | #define HP_SDC_CMD_SET_RTD 0xAF /* Set the RTC time (days) */ | ||
219 | #define HP_SDC_CMD_SET_FHS 0xB2 /* Set fast handshake timer */ | ||
220 | #define HP_SDC_CMD_SET_MT 0xB4 /* Set match timer */ | ||
221 | #define HP_SDC_CMD_SET_DT 0xB7 /* Set delay timer */ | ||
222 | #define HP_SDC_CMD_SET_CT 0xBA /* Set cycle timer */ | ||
223 | #define HP_SDC_CMD_SET_RAMP 0xC1 /* Reset READ_RAM autoinc counter */ | ||
224 | #define HP_SDC_CMD_SET_D0 0xe0 /* Load to i8042 RAM location 0x70 */ | ||
225 | #define HP_SDC_CMD_SET_D1 0xe1 /* Load to i8042 RAM location 0x71 */ | ||
226 | #define HP_SDC_CMD_SET_D2 0xe2 /* Load to i8042 RAM location 0x72 */ | ||
227 | #define HP_SDC_CMD_SET_D3 0xe3 /* Load to i8042 RAM location 0x73 */ | ||
228 | #define HP_SDC_CMD_SET_VT1 0xe4 /* Load to i8042 RAM location 0x74 */ | ||
229 | #define HP_SDC_CMD_SET_VT2 0xe5 /* Load to i8042 RAM location 0x75 */ | ||
230 | #define HP_SDC_CMD_SET_VT3 0xe6 /* Load to i8042 RAM location 0x76 */ | ||
231 | #define HP_SDC_CMD_SET_VT4 0xe7 /* Load to i8042 RAM location 0x77 */ | ||
232 | #define HP_SDC_CMD_SET_KBN 0xe8 /* Load to i8042 RAM location 0x78 */ | ||
233 | #define HP_SDC_CMD_SET_KBC 0xe9 /* Load to i8042 RAM location 0x79 */ | ||
234 | #define HP_SDC_CMD_SET_LPS 0xea /* Load to i8042 RAM location 0x7a */ | ||
235 | #define HP_SDC_CMD_SET_LPC 0xeb /* Load to i8042 RAM location 0x7b */ | ||
236 | #define HP_SDC_CMD_SET_RSV 0xec /* Load to i8042 RAM location 0x7c */ | ||
237 | #define HP_SDC_CMD_SET_LPR 0xed /* Load to i8042 RAM location 0x7d */ | ||
238 | #define HP_SDC_CMD_SET_XTD 0xee /* Load to i8042 RAM location 0x7e */ | ||
239 | #define HP_SDC_CMD_SET_STR 0xef /* Load to i8042 RAM location 0x7f */ | ||
240 | |||
241 | #define HP_SDC_CMD_DO_RTCW 0xc2 /* i8042 RAM 0x70 --> RTC */ | ||
242 | #define HP_SDC_CMD_DO_RTCR 0xc3 /* RTC[0x70 0:3] --> irq/status/data */ | ||
243 | #define HP_SDC_CMD_DO_BEEP 0xc4 /* i8042 RAM 0x70-74 --> beeper,VT3 */ | ||
244 | #define HP_SDC_CMD_DO_HIL 0xc5 /* i8042 RAM 0x70-73 --> | ||
245 | HIL MLC R0,R1 i8042 HIL watchdog */ | ||
246 | |||
247 | /* Values used to (de)mangle input/output to/from the HIL MLC */ | ||
248 | #define HP_SDC_DATA 0x40 /* Data from an 8042 register */ | ||
249 | #define HP_SDC_HIL_CMD 0x50 /* Data from HIL MLC R1/8042 */ | ||
250 | #define HP_SDC_HIL_R1MASK 0x0f /* Contents of HIL MLC R1 0:3 */ | ||
251 | #define HP_SDC_HIL_AUTO 0x10 /* Set if POL results from i8042 */ | ||
252 | #define HP_SDC_HIL_ISERR 0x80 /* Has meaning as in next 4 values */ | ||
253 | #define HP_SDC_HIL_RC_DONE 0x80 /* i8042 auto-configured loop */ | ||
254 | #define HP_SDC_HIL_ERR 0x81 /* HIL MLC R2 had a bit set */ | ||
255 | #define HP_SDC_HIL_TO 0x82 /* i8042 HIL watchdog expired */ | ||
256 | #define HP_SDC_HIL_RC 0x84 /* i8042 is auto-configuring loop */ | ||
257 | #define HP_SDC_HIL_DAT 0x60 /* Data from HIL MLC R0 */ | ||
258 | |||
259 | |||
260 | typedef struct { | ||
261 | rwlock_t ibf_lock; | ||
262 | rwlock_t lock; /* user/tasklet lock */ | ||
263 | rwlock_t rtq_lock; /* isr/tasklet lock */ | ||
264 | rwlock_t hook_lock; /* isr/user lock for handler add/del */ | ||
265 | |||
266 | unsigned int irq, nmi; /* Our IRQ lines */ | ||
267 | unsigned long base_io, status_io, data_io; /* Our IO ports */ | ||
268 | |||
269 | uint8_t im; /* Interrupt mask */ | ||
270 | int set_im; /* Interrupt mask needs to be set. */ | ||
271 | |||
272 | int ibf; /* Last known status of IBF flag */ | ||
273 | uint8_t wi; /* current i8042 write index */ | ||
274 | uint8_t r7[4]; /* current i8042[0x70 - 0x74] values */ | ||
275 | uint8_t r11, r7e; /* Values from version/revision regs */ | ||
276 | |||
277 | hp_sdc_irqhook *timer, *reg, *hil, *pup, *cooked; | ||
278 | |||
279 | #define HP_SDC_QUEUE_LEN 16 | ||
280 | hp_sdc_transaction *tq[HP_SDC_QUEUE_LEN]; /* All pending read/writes */ | ||
281 | |||
282 | int rcurr, rqty; /* Current read transact in process */ | ||
283 | struct timeval rtv; /* Time when current read started */ | ||
284 | int wcurr; /* Current write transact in process */ | ||
285 | |||
286 | int dev_err; /* carries status from registration */ | ||
287 | #if defined(__hppa__) | ||
288 | struct parisc_device *dev; | ||
289 | #elif defined(__mc68000__) | ||
290 | void *dev; | ||
291 | #else | ||
292 | #error No support for device registration on this arch yet. | ||
293 | #endif | ||
294 | |||
295 | struct timer_list kicker; /* Keeps below task alive */ | ||
296 | struct tasklet_struct task; | ||
297 | |||
298 | } hp_i8042_sdc; | ||
299 | |||
300 | #endif /* _LINUX_HP_SDC_H */ | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index d664330d900e..0cea162b08c0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -16,7 +16,6 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | |||
16 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 16 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); |
17 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 17 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
18 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); | 18 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); |
19 | void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | ||
20 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); | 19 | void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); |
21 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
22 | int hugetlb_report_meminfo(char *); | 21 | int hugetlb_report_meminfo(char *); |
@@ -87,7 +86,6 @@ static inline unsigned long hugetlb_total_pages(void) | |||
87 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) | 86 | #define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) |
88 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 87 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
89 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 88 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
90 | #define zap_hugepage_range(vma, start, len) BUG() | ||
91 | #define unmap_hugepage_range(vma, start, end) BUG() | 89 | #define unmap_hugepage_range(vma, start, end) BUG() |
92 | #define is_hugepage_mem_enough(size) 0 | 90 | #define is_hugepage_mem_enough(size) 0 |
93 | #define hugetlb_report_meminfo(buf) 0 | 91 | #define hugetlb_report_meminfo(buf) 0 |
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index 110904481238..c0e7fab28ce3 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
@@ -21,8 +21,6 @@ | |||
21 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | 21 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even |
22 | Frodo Looijaard <frodol@dds.nl> */ | 22 | Frodo Looijaard <frodol@dds.nl> */ |
23 | 23 | ||
24 | /* $Id: i2c-algo-bit.h,v 1.10 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
25 | |||
26 | #ifndef _LINUX_I2C_ALGO_BIT_H | 24 | #ifndef _LINUX_I2C_ALGO_BIT_H |
27 | #define _LINUX_I2C_ALGO_BIT_H | 25 | #define _LINUX_I2C_ALGO_BIT_H |
28 | 26 | ||
@@ -46,8 +44,6 @@ struct i2c_algo_bit_data { | |||
46 | int timeout; /* in jiffies */ | 44 | int timeout; /* in jiffies */ |
47 | }; | 45 | }; |
48 | 46 | ||
49 | #define I2C_BIT_ADAP_MAX 16 | ||
50 | |||
51 | int i2c_bit_add_bus(struct i2c_adapter *); | 47 | int i2c_bit_add_bus(struct i2c_adapter *); |
52 | int i2c_bit_del_bus(struct i2c_adapter *); | 48 | int i2c_bit_del_bus(struct i2c_adapter *); |
53 | 49 | ||
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h index 941b786c5732..226693e0d88b 100644 --- a/include/linux/i2c-algo-pca.h +++ b/include/linux/i2c-algo-pca.h | |||
@@ -9,8 +9,6 @@ struct i2c_algo_pca_data { | |||
9 | int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); | 9 | int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); |
10 | }; | 10 | }; |
11 | 11 | ||
12 | #define I2C_PCA_ADAP_MAX 16 | ||
13 | |||
14 | int i2c_pca_add_bus(struct i2c_adapter *); | 12 | int i2c_pca_add_bus(struct i2c_adapter *); |
15 | int i2c_pca_del_bus(struct i2c_adapter *); | 13 | int i2c_pca_del_bus(struct i2c_adapter *); |
16 | 14 | ||
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h index 2a508562255f..18b0adf57a3d 100644 --- a/include/linux/i2c-algo-pcf.h +++ b/include/linux/i2c-algo-pcf.h | |||
@@ -22,8 +22,6 @@ | |||
22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even | 22 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even |
23 | Frodo Looijaard <frodol@dds.nl> */ | 23 | Frodo Looijaard <frodol@dds.nl> */ |
24 | 24 | ||
25 | /* $Id: i2c-algo-pcf.h,v 1.8 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
26 | |||
27 | #ifndef _LINUX_I2C_ALGO_PCF_H | 25 | #ifndef _LINUX_I2C_ALGO_PCF_H |
28 | #define _LINUX_I2C_ALGO_PCF_H | 26 | #define _LINUX_I2C_ALGO_PCF_H |
29 | 27 | ||
@@ -41,8 +39,6 @@ struct i2c_algo_pcf_data { | |||
41 | int timeout; | 39 | int timeout; |
42 | }; | 40 | }; |
43 | 41 | ||
44 | #define I2C_PCF_ADAP_MAX 16 | ||
45 | |||
46 | int i2c_pcf_add_bus(struct i2c_adapter *); | 42 | int i2c_pcf_add_bus(struct i2c_adapter *); |
47 | int i2c_pcf_del_bus(struct i2c_adapter *); | 43 | int i2c_pcf_del_bus(struct i2c_adapter *); |
48 | 44 | ||
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index 541695679762..81c229a0fbca 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h | |||
@@ -19,8 +19,6 @@ | |||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* $Id: i2c-dev.h,v 1.13 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
23 | |||
24 | #ifndef _LINUX_I2C_DEV_H | 22 | #ifndef _LINUX_I2C_DEV_H |
25 | #define _LINUX_I2C_DEV_H | 23 | #define _LINUX_I2C_DEV_H |
26 | 24 | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 44f30876a1c9..1ce4b54caa21 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -164,10 +164,7 @@ | |||
164 | 164 | ||
165 | /* --- Bit algorithm adapters */ | 165 | /* --- Bit algorithm adapters */ |
166 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ | 166 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ |
167 | #define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */ | ||
168 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ | 167 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ |
169 | #define I2C_HW_B_ELV 0x010003 /* ELV Card */ | ||
170 | #define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */ | ||
171 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | 168 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ |
172 | #define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ | 169 | #define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ |
173 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ | 170 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3d49a305bf88..5e19a7ba69b2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -23,15 +23,15 @@ | |||
23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and | 23 | /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and |
24 | Frodo Looijaard <frodol@dds.nl> */ | 24 | Frodo Looijaard <frodol@dds.nl> */ |
25 | 25 | ||
26 | /* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */ | ||
27 | |||
28 | #ifndef _LINUX_I2C_H | 26 | #ifndef _LINUX_I2C_H |
29 | #define _LINUX_I2C_H | 27 | #define _LINUX_I2C_H |
30 | 28 | ||
31 | #include <linux/module.h> | 29 | #include <linux/module.h> |
32 | #include <linux/types.h> | 30 | #include <linux/types.h> |
33 | #include <linux/i2c-id.h> | 31 | #include <linux/i2c-id.h> |
32 | #include <linux/mod_devicetable.h> | ||
34 | #include <linux/device.h> /* for struct device */ | 33 | #include <linux/device.h> /* for struct device */ |
34 | #include <linux/sched.h> /* for completion */ | ||
35 | #include <asm/semaphore.h> | 35 | #include <asm/semaphore.h> |
36 | 36 | ||
37 | /* --- For i2c-isa ---------------------------------------------------- */ | 37 | /* --- For i2c-isa ---------------------------------------------------- */ |
@@ -94,10 +94,10 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client, | |||
94 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); | 94 | extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); |
95 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, | 95 | extern s32 i2c_smbus_write_word_data(struct i2c_client * client, |
96 | u8 command, u16 value); | 96 | u8 command, u16 value); |
97 | /* Returns the number of bytes transferred */ | ||
98 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 97 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
99 | u8 command, u8 length, | 98 | u8 command, u8 length, |
100 | u8 *values); | 99 | u8 *values); |
100 | /* Returns the number of read bytes */ | ||
101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | 101 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, |
102 | u8 command, u8 *values); | 102 | u8 command, u8 *values); |
103 | 103 | ||
@@ -391,10 +391,6 @@ struct i2c_msg { | |||
391 | #define I2C_FUNC_10BIT_ADDR 0x00000002 | 391 | #define I2C_FUNC_10BIT_ADDR 0x00000002 |
392 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ | 392 | #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ |
393 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ | 393 | #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ |
394 | #define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */ | ||
395 | #define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */ | ||
396 | #define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */ | ||
397 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */ | ||
398 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ | 394 | #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ |
399 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 | 395 | #define I2C_FUNC_SMBUS_QUICK 0x00010000 |
400 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 | 396 | #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 |
@@ -410,8 +406,6 @@ struct i2c_msg { | |||
410 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ | 406 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ |
411 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ | 407 | #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ |
412 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ | 408 | #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ |
413 | #define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */ | ||
414 | #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */ | ||
415 | 409 | ||
416 | #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ | 410 | #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ |
417 | I2C_FUNC_SMBUS_WRITE_BYTE) | 411 | I2C_FUNC_SMBUS_WRITE_BYTE) |
@@ -425,17 +419,6 @@ struct i2c_msg { | |||
425 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) | 419 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) |
426 | #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ | 420 | #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ |
427 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) | 421 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) |
428 | #define I2C_FUNC_SMBUS_BLOCK_DATA_PEC (I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \ | ||
429 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC) | ||
430 | #define I2C_FUNC_SMBUS_WORD_DATA_PEC (I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \ | ||
431 | I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC) | ||
432 | |||
433 | #define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA | ||
434 | #define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA | ||
435 | #define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA | ||
436 | #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA | ||
437 | #define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA | ||
438 | #define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA | ||
439 | 422 | ||
440 | #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ | 423 | #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ |
441 | I2C_FUNC_SMBUS_BYTE | \ | 424 | I2C_FUNC_SMBUS_BYTE | \ |
@@ -443,20 +426,17 @@ struct i2c_msg { | |||
443 | I2C_FUNC_SMBUS_WORD_DATA | \ | 426 | I2C_FUNC_SMBUS_WORD_DATA | \ |
444 | I2C_FUNC_SMBUS_PROC_CALL | \ | 427 | I2C_FUNC_SMBUS_PROC_CALL | \ |
445 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ | 428 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ |
446 | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \ | ||
447 | I2C_FUNC_SMBUS_I2C_BLOCK) | 429 | I2C_FUNC_SMBUS_I2C_BLOCK) |
448 | 430 | ||
449 | /* | 431 | /* |
450 | * Data for SMBus Messages | 432 | * Data for SMBus Messages |
451 | */ | 433 | */ |
452 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ | 434 | #define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ |
453 | #define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */ | ||
454 | union i2c_smbus_data { | 435 | union i2c_smbus_data { |
455 | __u8 byte; | 436 | __u8 byte; |
456 | __u16 word; | 437 | __u16 word; |
457 | __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */ | 438 | __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ |
458 | /* one more for read length in block process call */ | 439 | /* and one more for user-space compatibility */ |
459 | /* and one more for PEC */ | ||
460 | }; | 440 | }; |
461 | 441 | ||
462 | /* smbus_access read or write markers */ | 442 | /* smbus_access read or write markers */ |
@@ -473,10 +453,6 @@ union i2c_smbus_data { | |||
473 | #define I2C_SMBUS_BLOCK_DATA 5 | 453 | #define I2C_SMBUS_BLOCK_DATA 5 |
474 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 | 454 | #define I2C_SMBUS_I2C_BLOCK_DATA 6 |
475 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ | 455 | #define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ |
476 | #define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */ | ||
477 | #define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */ | ||
478 | #define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */ | ||
479 | #define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */ | ||
480 | 456 | ||
481 | 457 | ||
482 | /* ----- commands for the ioctl like i2c_command call: | 458 | /* ----- commands for the ioctl like i2c_command call: |
@@ -506,11 +482,6 @@ union i2c_smbus_data { | |||
506 | 482 | ||
507 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ | 483 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ |
508 | 484 | ||
509 | /* ... algo-bit.c recognizes */ | ||
510 | #define I2C_UDELAY 0x0705 /* set delay in microsecs between each */ | ||
511 | /* written byte (except address) */ | ||
512 | #define I2C_MDELAY 0x0706 /* millisec delay between written bytes */ | ||
513 | |||
514 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ | 485 | /* ----- I2C-DEV: char device interface stuff ------------------------- */ |
515 | 486 | ||
516 | #define I2C_MAJOR 89 /* Device major number */ | 487 | #define I2C_MAJOR 89 /* Device major number */ |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index bdc286ec947c..d79c8a4bc4f8 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -25,10 +25,14 @@ | |||
25 | /* How many different OSM's are we allowing */ | 25 | /* How many different OSM's are we allowing */ |
26 | #define I2O_MAX_DRIVERS 8 | 26 | #define I2O_MAX_DRIVERS 8 |
27 | 27 | ||
28 | #include <asm/io.h> | ||
29 | #include <asm/semaphore.h> /* Needed for MUTEX init macros */ | ||
30 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
31 | #include <linux/dma-mapping.h> | 29 | #include <linux/dma-mapping.h> |
30 | #include <linux/string.h> | ||
31 | #include <linux/slab.h> | ||
32 | #include <linux/workqueue.h> /* work_struct */ | ||
33 | |||
34 | #include <asm/io.h> | ||
35 | #include <asm/semaphore.h> /* Needed for MUTEX init macros */ | ||
32 | 36 | ||
33 | /* message queue empty */ | 37 | /* message queue empty */ |
34 | #define I2O_QUEUE_EMPTY 0xffffffff | 38 | #define I2O_QUEUE_EMPTY 0xffffffff |
@@ -66,8 +70,6 @@ struct i2o_device { | |||
66 | struct device device; | 70 | struct device device; |
67 | 71 | ||
68 | struct semaphore lock; /* device lock */ | 72 | struct semaphore lock; /* device lock */ |
69 | |||
70 | struct class_device classdev; /* i2o device class */ | ||
71 | }; | 73 | }; |
72 | 74 | ||
73 | /* | 75 | /* |
@@ -194,7 +196,7 @@ struct i2o_controller { | |||
194 | struct resource mem_resource; /* Mem resource allocated to the IOP */ | 196 | struct resource mem_resource; /* Mem resource allocated to the IOP */ |
195 | 197 | ||
196 | struct device device; | 198 | struct device device; |
197 | struct class_device classdev; /* I2O controller class */ | 199 | struct class_device *classdev; /* I2O controller class device */ |
198 | struct i2o_device *exec; /* Executive */ | 200 | struct i2o_device *exec; /* Executive */ |
199 | #if BITS_PER_LONG == 64 | 201 | #if BITS_PER_LONG == 64 |
200 | spinlock_t context_list_lock; /* lock for context_list */ | 202 | spinlock_t context_list_lock; /* lock for context_list */ |
@@ -492,7 +494,7 @@ static inline int i2o_dma_map_sg(struct i2o_controller *c, | |||
492 | * Returns 0 on success or -ENOMEM on failure. | 494 | * Returns 0 on success or -ENOMEM on failure. |
493 | */ | 495 | */ |
494 | static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, | 496 | static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, |
495 | size_t len, unsigned int gfp_mask) | 497 | size_t len, gfp_t gfp_mask) |
496 | { | 498 | { |
497 | struct pci_dev *pdev = to_pci_dev(dev); | 499 | struct pci_dev *pdev = to_pci_dev(dev); |
498 | int dma_64 = 0; | 500 | int dma_64 = 0; |
@@ -551,7 +553,7 @@ static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr) | |||
551 | * Returns the 0 on success or negative error code on failure. | 553 | * Returns the 0 on success or negative error code on failure. |
552 | */ | 554 | */ |
553 | static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, | 555 | static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, |
554 | size_t len, unsigned int gfp_mask) | 556 | size_t len, gfp_t gfp_mask) |
555 | { | 557 | { |
556 | i2o_dma_free(dev, addr); | 558 | i2o_dma_free(dev, addr); |
557 | 559 | ||
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h index 2ef0b21517fb..1c7a0dd5536a 100644 --- a/include/linux/ibmtr.h +++ b/include/linux/ibmtr.h | |||
@@ -7,8 +7,8 @@ | |||
7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ | 7 | /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ |
8 | 8 | ||
9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ | 9 | #define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ |
10 | #define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ | 10 | #define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */ |
11 | #define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ | 11 | #define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */ |
12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ | 12 | #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ |
13 | 13 | ||
14 | #define TR_ISA 1 | 14 | #define TR_ISA 1 |
diff --git a/include/linux/ide.h b/include/linux/ide.h index a6dbb51ecd7b..3461abc1e854 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -218,7 +218,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci, | |||
218 | ide_rz1000, ide_trm290, | 218 | ide_rz1000, ide_trm290, |
219 | ide_cmd646, ide_cy82c693, ide_4drives, | 219 | ide_cmd646, ide_cy82c693, ide_4drives, |
220 | ide_pmac, ide_etrax100, ide_acorn, | 220 | ide_pmac, ide_etrax100, ide_acorn, |
221 | ide_forced | 221 | ide_au1xxx, ide_forced |
222 | } hwif_chipset_t; | 222 | } hwif_chipset_t; |
223 | 223 | ||
224 | /* | 224 | /* |
diff --git a/include/linux/idr.h b/include/linux/idr.h index ca3b7e462576..7fb3ff9c7b0e 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -71,8 +71,9 @@ struct idr { | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | void *idr_find(struct idr *idp, int id); | 73 | void *idr_find(struct idr *idp, int id); |
74 | int idr_pre_get(struct idr *idp, unsigned gfp_mask); | 74 | int idr_pre_get(struct idr *idp, gfp_t gfp_mask); |
75 | int idr_get_new(struct idr *idp, void *ptr, int *id); | 75 | int idr_get_new(struct idr *idp, void *ptr, int *id); |
76 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | 76 | int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); |
77 | void idr_remove(struct idr *idp, int id); | 77 | void idr_remove(struct idr *idp, int id); |
78 | void idr_destroy(struct idr *idp); | ||
78 | void idr_init(struct idr *idp); | 79 | void idr_init(struct idr *idp); |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 0856548a2a08..a8b1a2071838 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -84,6 +84,7 @@ | |||
84 | #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ | 84 | #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ |
85 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ | 85 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
86 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 86 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
87 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | ||
87 | 88 | ||
88 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 89 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
89 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 90 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
diff --git a/include/linux/input.h b/include/linux/input.h index e8c296ff6257..f623c745c21c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #include <linux/time.h> | 13 | #include <linux/time.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/device.h> | ||
15 | #else | 16 | #else |
16 | #include <sys/time.h> | 17 | #include <sys/time.h> |
17 | #include <sys/ioctl.h> | 18 | #include <sys/ioctl.h> |
@@ -644,6 +645,7 @@ struct input_absinfo { | |||
644 | #define BUS_ADB 0x17 | 645 | #define BUS_ADB 0x17 |
645 | #define BUS_I2C 0x18 | 646 | #define BUS_I2C 0x18 |
646 | #define BUS_HOST 0x19 | 647 | #define BUS_HOST 0x19 |
648 | #define BUS_GSC 0x1A | ||
647 | 649 | ||
648 | /* | 650 | /* |
649 | * Values describing the status of an effect | 651 | * Values describing the status of an effect |
@@ -889,11 +891,15 @@ struct input_dev { | |||
889 | struct semaphore sem; /* serializes open and close operations */ | 891 | struct semaphore sem; /* serializes open and close operations */ |
890 | unsigned int users; | 892 | unsigned int users; |
891 | 893 | ||
892 | struct device *dev; | 894 | struct class_device cdev; |
895 | struct device *dev; /* will be removed soon */ | ||
896 | |||
897 | int dynalloc; /* temporarily */ | ||
893 | 898 | ||
894 | struct list_head h_list; | 899 | struct list_head h_list; |
895 | struct list_head node; | 900 | struct list_head node; |
896 | }; | 901 | }; |
902 | #define to_input_dev(d) container_of(d, struct input_dev, cdev) | ||
897 | 903 | ||
898 | /* | 904 | /* |
899 | * Structure for hotplug & device<->driver matching. | 905 | * Structure for hotplug & device<->driver matching. |
@@ -984,6 +990,23 @@ static inline void init_input_dev(struct input_dev *dev) | |||
984 | INIT_LIST_HEAD(&dev->node); | 990 | INIT_LIST_HEAD(&dev->node); |
985 | } | 991 | } |
986 | 992 | ||
993 | struct input_dev *input_allocate_device(void); | ||
994 | |||
995 | static inline void input_free_device(struct input_dev *dev) | ||
996 | { | ||
997 | kfree(dev); | ||
998 | } | ||
999 | |||
1000 | static inline struct input_dev *input_get_device(struct input_dev *dev) | ||
1001 | { | ||
1002 | return to_input_dev(class_device_get(&dev->cdev)); | ||
1003 | } | ||
1004 | |||
1005 | static inline void input_put_device(struct input_dev *dev) | ||
1006 | { | ||
1007 | class_device_put(&dev->cdev); | ||
1008 | } | ||
1009 | |||
987 | void input_register_device(struct input_dev *); | 1010 | void input_register_device(struct input_dev *); |
988 | void input_unregister_device(struct input_dev *); | 1011 | void input_unregister_device(struct input_dev *); |
989 | 1012 | ||
@@ -1052,7 +1075,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1052 | dev->absbit[LONG(axis)] |= BIT(axis); | 1075 | dev->absbit[LONG(axis)] |= BIT(axis); |
1053 | } | 1076 | } |
1054 | 1077 | ||
1055 | extern struct class *input_class; | 1078 | extern struct class input_class; |
1056 | 1079 | ||
1057 | #endif | 1080 | #endif |
1058 | #endif | 1081 | #endif |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index ff853b3173c6..be197eb90077 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -69,7 +69,7 @@ extern int journal_enable_debug; | |||
69 | #define jbd_debug(f, a...) /**/ | 69 | #define jbd_debug(f, a...) /**/ |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | extern void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry); | 72 | extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry); |
73 | #define jbd_kmalloc(size, flags) \ | 73 | #define jbd_kmalloc(size, flags) \ |
74 | __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) | 74 | __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) |
75 | #define jbd_rep_kmalloc(size, flags) \ | 75 | #define jbd_rep_kmalloc(size, flags) \ |
@@ -890,7 +890,7 @@ extern int journal_forget (handle_t *, struct buffer_head *); | |||
890 | extern void journal_sync_buffer (struct buffer_head *); | 890 | extern void journal_sync_buffer (struct buffer_head *); |
891 | extern int journal_invalidatepage(journal_t *, | 891 | extern int journal_invalidatepage(journal_t *, |
892 | struct page *, unsigned long); | 892 | struct page *, unsigned long); |
893 | extern int journal_try_to_free_buffers(journal_t *, struct page *, int); | 893 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
894 | extern int journal_stop(handle_t *); | 894 | extern int journal_stop(handle_t *); |
895 | extern int journal_flush (journal_t *); | 895 | extern int journal_flush (journal_t *); |
896 | extern void journal_lock_updates (journal_t *); | 896 | extern void journal_lock_updates (journal_t *); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4367ce4db52a..f1925ccc9fe1 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -307,7 +307,7 @@ struct sysinfo { | |||
307 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ | 307 | char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ |
308 | }; | 308 | }; |
309 | 309 | ||
310 | /* Force a compilation error if condition is false */ | 310 | /* Force a compilation error if condition is true */ |
311 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 311 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
312 | 312 | ||
313 | #ifdef CONFIG_SYSCTL | 313 | #ifdef CONFIG_SYSCTL |
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h index 7a2e332067c3..e8b8a7a5c496 100644 --- a/include/linux/key-ui.h +++ b/include/linux/key-ui.h | |||
@@ -24,7 +24,8 @@ extern spinlock_t key_serial_lock; | |||
24 | #define KEY_WRITE 0x04 /* require permission to update / modify */ | 24 | #define KEY_WRITE 0x04 /* require permission to update / modify */ |
25 | #define KEY_SEARCH 0x08 /* require permission to search (keyring) or find (key) */ | 25 | #define KEY_SEARCH 0x08 /* require permission to search (keyring) or find (key) */ |
26 | #define KEY_LINK 0x10 /* require permission to link */ | 26 | #define KEY_LINK 0x10 /* require permission to link */ |
27 | #define KEY_ALL 0x1f /* all the above permissions */ | 27 | #define KEY_SETATTR 0x20 /* require permission to change attributes */ |
28 | #define KEY_ALL 0x3f /* all the above permissions */ | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * the keyring payload contains a list of the keys to which the keyring is | 31 | * the keyring payload contains a list of the keys to which the keyring is |
diff --git a/include/linux/key.h b/include/linux/key.h index f1efa016dbf3..53513a3be53b 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -40,28 +40,32 @@ struct key; | |||
40 | #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ | 40 | #define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */ |
41 | #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ | 41 | #define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */ |
42 | #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ | 42 | #define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */ |
43 | #define KEY_POS_ALL 0x1f000000 | 43 | #define KEY_POS_SETATTR 0x20000000 /* possessor can set key attributes */ |
44 | #define KEY_POS_ALL 0x3f000000 | ||
44 | 45 | ||
45 | #define KEY_USR_VIEW 0x00010000 /* user permissions... */ | 46 | #define KEY_USR_VIEW 0x00010000 /* user permissions... */ |
46 | #define KEY_USR_READ 0x00020000 | 47 | #define KEY_USR_READ 0x00020000 |
47 | #define KEY_USR_WRITE 0x00040000 | 48 | #define KEY_USR_WRITE 0x00040000 |
48 | #define KEY_USR_SEARCH 0x00080000 | 49 | #define KEY_USR_SEARCH 0x00080000 |
49 | #define KEY_USR_LINK 0x00100000 | 50 | #define KEY_USR_LINK 0x00100000 |
50 | #define KEY_USR_ALL 0x001f0000 | 51 | #define KEY_USR_SETATTR 0x00200000 |
52 | #define KEY_USR_ALL 0x003f0000 | ||
51 | 53 | ||
52 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ | 54 | #define KEY_GRP_VIEW 0x00000100 /* group permissions... */ |
53 | #define KEY_GRP_READ 0x00000200 | 55 | #define KEY_GRP_READ 0x00000200 |
54 | #define KEY_GRP_WRITE 0x00000400 | 56 | #define KEY_GRP_WRITE 0x00000400 |
55 | #define KEY_GRP_SEARCH 0x00000800 | 57 | #define KEY_GRP_SEARCH 0x00000800 |
56 | #define KEY_GRP_LINK 0x00001000 | 58 | #define KEY_GRP_LINK 0x00001000 |
57 | #define KEY_GRP_ALL 0x00001f00 | 59 | #define KEY_GRP_SETATTR 0x00002000 |
60 | #define KEY_GRP_ALL 0x00003f00 | ||
58 | 61 | ||
59 | #define KEY_OTH_VIEW 0x00000001 /* third party permissions... */ | 62 | #define KEY_OTH_VIEW 0x00000001 /* third party permissions... */ |
60 | #define KEY_OTH_READ 0x00000002 | 63 | #define KEY_OTH_READ 0x00000002 |
61 | #define KEY_OTH_WRITE 0x00000004 | 64 | #define KEY_OTH_WRITE 0x00000004 |
62 | #define KEY_OTH_SEARCH 0x00000008 | 65 | #define KEY_OTH_SEARCH 0x00000008 |
63 | #define KEY_OTH_LINK 0x00000010 | 66 | #define KEY_OTH_LINK 0x00000010 |
64 | #define KEY_OTH_ALL 0x0000001f | 67 | #define KEY_OTH_SETATTR 0x00000020 |
68 | #define KEY_OTH_ALL 0x0000003f | ||
65 | 69 | ||
66 | struct seq_file; | 70 | struct seq_file; |
67 | struct user_struct; | 71 | struct user_struct; |
@@ -119,6 +123,7 @@ struct key { | |||
119 | struct key_type *type; /* type of key */ | 123 | struct key_type *type; /* type of key */ |
120 | struct rw_semaphore sem; /* change vs change sem */ | 124 | struct rw_semaphore sem; /* change vs change sem */ |
121 | struct key_user *user; /* owner of this key */ | 125 | struct key_user *user; /* owner of this key */ |
126 | void *security; /* security data for this key */ | ||
122 | time_t expiry; /* time at which key expires (or 0) */ | 127 | time_t expiry; /* time at which key expires (or 0) */ |
123 | uid_t uid; | 128 | uid_t uid; |
124 | gid_t gid; | 129 | gid_t gid; |
diff --git a/include/linux/kobj_map.h b/include/linux/kobj_map.h index b6cc10bf8dfc..cbe7d8008042 100644 --- a/include/linux/kobj_map.h +++ b/include/linux/kobj_map.h | |||
@@ -1,5 +1,7 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifdef __KERNEL__ |
2 | 2 | ||
3 | #include <asm/semaphore.h> | ||
4 | |||
3 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); | 5 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); |
4 | struct kobj_map; | 6 | struct kobj_map; |
5 | 7 | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 3b22304f12fd..7f7403aa4a41 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -65,7 +65,7 @@ extern void kobject_unregister(struct kobject *); | |||
65 | extern struct kobject * kobject_get(struct kobject *); | 65 | extern struct kobject * kobject_get(struct kobject *); |
66 | extern void kobject_put(struct kobject *); | 66 | extern void kobject_put(struct kobject *); |
67 | 67 | ||
68 | extern char * kobject_get_path(struct kobject *, int); | 68 | extern char * kobject_get_path(struct kobject *, gfp_t); |
69 | 69 | ||
70 | struct kobj_type { | 70 | struct kobj_type { |
71 | void (*release)(struct kobject *); | 71 | void (*release)(struct kobject *); |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 3fa786448db3..ebdd41fd1082 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -70,6 +70,18 @@ void kthread_bind(struct task_struct *k, unsigned int cpu); | |||
70 | int kthread_stop(struct task_struct *k); | 70 | int kthread_stop(struct task_struct *k); |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * kthread_stop_sem: stop a thread created by kthread_create(). | ||
74 | * @k: thread created by kthread_create(). | ||
75 | * @s: semaphore that @k waits on while idle. | ||
76 | * | ||
77 | * Does essentially the same thing as kthread_stop() above, but wakes | ||
78 | * @k by calling up(@s). | ||
79 | * | ||
80 | * Returns the result of threadfn(), or -EINTR if wake_up_process() | ||
81 | * was never called. */ | ||
82 | int kthread_stop_sem(struct task_struct *k, struct semaphore *s); | ||
83 | |||
84 | /** | ||
73 | * kthread_should_stop: should this kthread return now? | 85 | * kthread_should_stop: should this kthread return now? |
74 | * | 86 | * |
75 | * When someone calls kthread_stop on your kthread, it will be woken | 87 | * When someone calls kthread_stop on your kthread, it will be woken |
diff --git a/include/linux/libata.h b/include/linux/libata.h index ceee1fc42c60..0ba3af7a1236 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -91,12 +91,13 @@ enum { | |||
91 | ATA_SHT_EMULATED = 1, | 91 | ATA_SHT_EMULATED = 1, |
92 | ATA_SHT_CMD_PER_LUN = 1, | 92 | ATA_SHT_CMD_PER_LUN = 1, |
93 | ATA_SHT_THIS_ID = -1, | 93 | ATA_SHT_THIS_ID = -1, |
94 | ATA_SHT_USE_CLUSTERING = 0, | 94 | ATA_SHT_USE_CLUSTERING = 1, |
95 | 95 | ||
96 | /* struct ata_device stuff */ | 96 | /* struct ata_device stuff */ |
97 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ | 97 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ |
98 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ | 98 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ |
99 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ | 99 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ |
100 | ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */ | ||
100 | 101 | ||
101 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 102 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
102 | ATA_DEV_ATA = 1, /* ATA device */ | 103 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -154,17 +155,28 @@ enum { | |||
154 | ATA_SHIFT_UDMA = 0, | 155 | ATA_SHIFT_UDMA = 0, |
155 | ATA_SHIFT_MWDMA = 8, | 156 | ATA_SHIFT_MWDMA = 8, |
156 | ATA_SHIFT_PIO = 11, | 157 | ATA_SHIFT_PIO = 11, |
158 | |||
159 | /* Masks for port functions */ | ||
160 | ATA_PORT_PRIMARY = (1 << 0), | ||
161 | ATA_PORT_SECONDARY = (1 << 1), | ||
157 | }; | 162 | }; |
158 | 163 | ||
159 | enum pio_task_states { | 164 | enum hsm_task_states { |
160 | PIO_ST_UNKNOWN, | 165 | HSM_ST_UNKNOWN, |
161 | PIO_ST_IDLE, | 166 | HSM_ST_IDLE, |
162 | PIO_ST_POLL, | 167 | HSM_ST_POLL, |
163 | PIO_ST_TMOUT, | 168 | HSM_ST_TMOUT, |
164 | PIO_ST, | 169 | HSM_ST, |
165 | PIO_ST_LAST, | 170 | HSM_ST_LAST, |
166 | PIO_ST_LAST_POLL, | 171 | HSM_ST_LAST_POLL, |
167 | PIO_ST_ERR, | 172 | HSM_ST_ERR, |
173 | }; | ||
174 | |||
175 | enum ata_completion_errors { | ||
176 | AC_ERR_OTHER = (1 << 0), | ||
177 | AC_ERR_DEV = (1 << 1), | ||
178 | AC_ERR_ATA_BUS = (1 << 2), | ||
179 | AC_ERR_HOST_BUS = (1 << 3), | ||
168 | }; | 180 | }; |
169 | 181 | ||
170 | /* forward declarations */ | 182 | /* forward declarations */ |
@@ -174,7 +186,7 @@ struct ata_port; | |||
174 | struct ata_queued_cmd; | 186 | struct ata_queued_cmd; |
175 | 187 | ||
176 | /* typedefs */ | 188 | /* typedefs */ |
177 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, u8 drv_stat); | 189 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask); |
178 | 190 | ||
179 | struct ata_ioports { | 191 | struct ata_ioports { |
180 | unsigned long cmd_addr; | 192 | unsigned long cmd_addr; |
@@ -197,7 +209,7 @@ struct ata_ioports { | |||
197 | struct ata_probe_ent { | 209 | struct ata_probe_ent { |
198 | struct list_head node; | 210 | struct list_head node; |
199 | struct device *dev; | 211 | struct device *dev; |
200 | struct ata_port_operations *port_ops; | 212 | const struct ata_port_operations *port_ops; |
201 | Scsi_Host_Template *sht; | 213 | Scsi_Host_Template *sht; |
202 | struct ata_ioports port[ATA_MAX_PORTS]; | 214 | struct ata_ioports port[ATA_MAX_PORTS]; |
203 | unsigned int n_ports; | 215 | unsigned int n_ports; |
@@ -220,7 +232,7 @@ struct ata_host_set { | |||
220 | void __iomem *mmio_base; | 232 | void __iomem *mmio_base; |
221 | unsigned int n_ports; | 233 | unsigned int n_ports; |
222 | void *private_data; | 234 | void *private_data; |
223 | struct ata_port_operations *ops; | 235 | const struct ata_port_operations *ops; |
224 | struct ata_port * ports[0]; | 236 | struct ata_port * ports[0]; |
225 | }; | 237 | }; |
226 | 238 | ||
@@ -278,15 +290,18 @@ struct ata_device { | |||
278 | u8 xfer_mode; | 290 | u8 xfer_mode; |
279 | unsigned int xfer_shift; /* ATA_SHIFT_xxx */ | 291 | unsigned int xfer_shift; /* ATA_SHIFT_xxx */ |
280 | 292 | ||
281 | /* cache info about current transfer mode */ | 293 | unsigned int multi_count; /* sectors count for |
282 | u8 xfer_protocol; /* taskfile xfer protocol */ | 294 | READ/WRITE MULTIPLE */ |
283 | u8 read_cmd; /* opcode to use on read */ | 295 | |
284 | u8 write_cmd; /* opcode to use on write */ | 296 | /* for CHS addressing */ |
297 | u16 cylinders; /* Number of cylinders */ | ||
298 | u16 heads; /* Number of heads */ | ||
299 | u16 sectors; /* Number of sectors per track */ | ||
285 | }; | 300 | }; |
286 | 301 | ||
287 | struct ata_port { | 302 | struct ata_port { |
288 | struct Scsi_Host *host; /* our co-allocated scsi host */ | 303 | struct Scsi_Host *host; /* our co-allocated scsi host */ |
289 | struct ata_port_operations *ops; | 304 | const struct ata_port_operations *ops; |
290 | unsigned long flags; /* ATA_FLAG_xxx */ | 305 | unsigned long flags; /* ATA_FLAG_xxx */ |
291 | unsigned int id; /* unique id req'd by scsi midlyr */ | 306 | unsigned int id; /* unique id req'd by scsi midlyr */ |
292 | unsigned int port_no; /* unique port #; from zero */ | 307 | unsigned int port_no; /* unique port #; from zero */ |
@@ -319,7 +334,7 @@ struct ata_port { | |||
319 | struct work_struct packet_task; | 334 | struct work_struct packet_task; |
320 | 335 | ||
321 | struct work_struct pio_task; | 336 | struct work_struct pio_task; |
322 | unsigned int pio_task_state; | 337 | unsigned int hsm_task_state; |
323 | unsigned long pio_task_timeout; | 338 | unsigned long pio_task_timeout; |
324 | 339 | ||
325 | void *private_data; | 340 | void *private_data; |
@@ -333,13 +348,12 @@ struct ata_port_operations { | |||
333 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 348 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
334 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 349 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
335 | 350 | ||
336 | void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); | 351 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); |
337 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | 352 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); |
338 | 353 | ||
339 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | 354 | void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf); |
340 | u8 (*check_status)(struct ata_port *ap); | 355 | u8 (*check_status)(struct ata_port *ap); |
341 | u8 (*check_altstatus)(struct ata_port *ap); | 356 | u8 (*check_altstatus)(struct ata_port *ap); |
342 | u8 (*check_err)(struct ata_port *ap); | ||
343 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 357 | void (*dev_select)(struct ata_port *ap, unsigned int device); |
344 | 358 | ||
345 | void (*phy_reset) (struct ata_port *ap); | 359 | void (*phy_reset) (struct ata_port *ap); |
@@ -377,9 +391,22 @@ struct ata_port_info { | |||
377 | unsigned long pio_mask; | 391 | unsigned long pio_mask; |
378 | unsigned long mwdma_mask; | 392 | unsigned long mwdma_mask; |
379 | unsigned long udma_mask; | 393 | unsigned long udma_mask; |
380 | struct ata_port_operations *port_ops; | 394 | const struct ata_port_operations *port_ops; |
395 | }; | ||
396 | |||
397 | struct ata_timing { | ||
398 | unsigned short mode; /* ATA mode */ | ||
399 | unsigned short setup; /* t1 */ | ||
400 | unsigned short act8b; /* t2 for 8-bit I/O */ | ||
401 | unsigned short rec8b; /* t2i for 8-bit I/O */ | ||
402 | unsigned short cyc8b; /* t0 for 8-bit I/O */ | ||
403 | unsigned short active; /* t2 or tD */ | ||
404 | unsigned short recover; /* t2i or tK */ | ||
405 | unsigned short cycle; /* t0 */ | ||
406 | unsigned short udma; /* t2CYCTYP/2 */ | ||
381 | }; | 407 | }; |
382 | 408 | ||
409 | #define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) | ||
383 | 410 | ||
384 | extern void ata_port_probe(struct ata_port *); | 411 | extern void ata_port_probe(struct ata_port *); |
385 | extern void __sata_phy_reset(struct ata_port *ap); | 412 | extern void __sata_phy_reset(struct ata_port *ap); |
@@ -392,7 +419,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i | |||
392 | unsigned int n_ports); | 419 | unsigned int n_ports); |
393 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 420 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
394 | #endif /* CONFIG_PCI */ | 421 | #endif /* CONFIG_PCI */ |
395 | extern int ata_device_add(struct ata_probe_ent *ent); | 422 | extern int ata_device_add(const struct ata_probe_ent *ent); |
396 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 423 | extern void ata_host_set_remove(struct ata_host_set *host_set); |
397 | extern int ata_scsi_detect(Scsi_Host_Template *sht); | 424 | extern int ata_scsi_detect(Scsi_Host_Template *sht); |
398 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 425 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
@@ -400,19 +427,20 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn | |||
400 | extern int ata_scsi_error(struct Scsi_Host *host); | 427 | extern int ata_scsi_error(struct Scsi_Host *host); |
401 | extern int ata_scsi_release(struct Scsi_Host *host); | 428 | extern int ata_scsi_release(struct Scsi_Host *host); |
402 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 429 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
430 | extern int ata_ratelimit(void); | ||
431 | |||
403 | /* | 432 | /* |
404 | * Default driver ops implementations | 433 | * Default driver ops implementations |
405 | */ | 434 | */ |
406 | extern void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf); | 435 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); |
407 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 436 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
408 | extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp); | 437 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp); |
409 | extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf); | 438 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); |
410 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); | 439 | extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); |
411 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | 440 | extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); |
412 | extern u8 ata_check_status(struct ata_port *ap); | 441 | extern u8 ata_check_status(struct ata_port *ap); |
413 | extern u8 ata_altstatus(struct ata_port *ap); | 442 | extern u8 ata_altstatus(struct ata_port *ap); |
414 | extern u8 ata_chk_err(struct ata_port *ap); | 443 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
415 | extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); | ||
416 | extern int ata_port_start (struct ata_port *ap); | 444 | extern int ata_port_start (struct ata_port *ap); |
417 | extern void ata_port_stop (struct ata_port *ap); | 445 | extern void ata_port_stop (struct ata_port *ap); |
418 | extern void ata_host_stop (struct ata_host_set *host_set); | 446 | extern void ata_host_stop (struct ata_host_set *host_set); |
@@ -423,8 +451,8 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | |||
423 | unsigned int buflen); | 451 | unsigned int buflen); |
424 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 452 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
425 | unsigned int n_elem); | 453 | unsigned int n_elem); |
426 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); | 454 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); |
427 | extern void ata_dev_id_string(u16 *id, unsigned char *s, | 455 | extern void ata_dev_id_string(const u16 *id, unsigned char *s, |
428 | unsigned int ofs, unsigned int len); | 456 | unsigned int ofs, unsigned int len); |
429 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | 457 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); |
430 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 458 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
@@ -432,7 +460,7 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc); | |||
432 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 460 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
433 | extern u8 ata_bmdma_status(struct ata_port *ap); | 461 | extern u8 ata_bmdma_status(struct ata_port *ap); |
434 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 462 | extern void ata_bmdma_irq_clear(struct ata_port *ap); |
435 | extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat); | 463 | extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask); |
436 | extern void ata_eng_timeout(struct ata_port *ap); | 464 | extern void ata_eng_timeout(struct ata_port *ap); |
437 | extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, | 465 | extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, |
438 | void (*done)(struct scsi_cmnd *)); | 466 | void (*done)(struct scsi_cmnd *)); |
@@ -441,6 +469,32 @@ extern int ata_std_bios_param(struct scsi_device *sdev, | |||
441 | sector_t capacity, int geom[]); | 469 | sector_t capacity, int geom[]); |
442 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 470 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
443 | 471 | ||
472 | /* | ||
473 | * Timing helpers | ||
474 | */ | ||
475 | extern int ata_timing_compute(struct ata_device *, unsigned short, | ||
476 | struct ata_timing *, int, int); | ||
477 | extern void ata_timing_merge(const struct ata_timing *, | ||
478 | const struct ata_timing *, struct ata_timing *, | ||
479 | unsigned int); | ||
480 | |||
481 | enum { | ||
482 | ATA_TIMING_SETUP = (1 << 0), | ||
483 | ATA_TIMING_ACT8B = (1 << 1), | ||
484 | ATA_TIMING_REC8B = (1 << 2), | ||
485 | ATA_TIMING_CYC8B = (1 << 3), | ||
486 | ATA_TIMING_8BIT = ATA_TIMING_ACT8B | ATA_TIMING_REC8B | | ||
487 | ATA_TIMING_CYC8B, | ||
488 | ATA_TIMING_ACTIVE = (1 << 4), | ||
489 | ATA_TIMING_RECOVER = (1 << 5), | ||
490 | ATA_TIMING_CYCLE = (1 << 6), | ||
491 | ATA_TIMING_UDMA = (1 << 7), | ||
492 | ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B | | ||
493 | ATA_TIMING_REC8B | ATA_TIMING_CYC8B | | ||
494 | ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER | | ||
495 | ATA_TIMING_CYCLE | ATA_TIMING_UDMA, | ||
496 | }; | ||
497 | |||
444 | 498 | ||
445 | #ifdef CONFIG_PCI | 499 | #ifdef CONFIG_PCI |
446 | struct pci_bits { | 500 | struct pci_bits { |
@@ -452,8 +506,8 @@ struct pci_bits { | |||
452 | 506 | ||
453 | extern void ata_pci_host_stop (struct ata_host_set *host_set); | 507 | extern void ata_pci_host_stop (struct ata_host_set *host_set); |
454 | extern struct ata_probe_ent * | 508 | extern struct ata_probe_ent * |
455 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); | 509 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
456 | extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); | 510 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
457 | 511 | ||
458 | #endif /* CONFIG_PCI */ | 512 | #endif /* CONFIG_PCI */ |
459 | 513 | ||
@@ -463,7 +517,7 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
463 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 517 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
464 | } | 518 | } |
465 | 519 | ||
466 | static inline unsigned int ata_dev_present(struct ata_device *dev) | 520 | static inline unsigned int ata_dev_present(const struct ata_device *dev) |
467 | { | 521 | { |
468 | return ((dev->class == ATA_DEV_ATA) || | 522 | return ((dev->class == ATA_DEV_ATA) || |
469 | (dev->class == ATA_DEV_ATAPI)); | 523 | (dev->class == ATA_DEV_ATAPI)); |
@@ -662,11 +716,28 @@ static inline unsigned int sata_dev_present(struct ata_port *ap) | |||
662 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; | 716 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; |
663 | } | 717 | } |
664 | 718 | ||
665 | static inline int ata_try_flush_cache(struct ata_device *dev) | 719 | static inline int ata_try_flush_cache(const struct ata_device *dev) |
666 | { | 720 | { |
667 | return ata_id_wcache_enabled(dev->id) || | 721 | return ata_id_wcache_enabled(dev->id) || |
668 | ata_id_has_flush(dev->id) || | 722 | ata_id_has_flush(dev->id) || |
669 | ata_id_has_flush_ext(dev->id); | 723 | ata_id_has_flush_ext(dev->id); |
670 | } | 724 | } |
671 | 725 | ||
726 | static inline unsigned int ac_err_mask(u8 status) | ||
727 | { | ||
728 | if (status & ATA_BUSY) | ||
729 | return AC_ERR_ATA_BUS; | ||
730 | if (status & (ATA_ERR | ATA_DF)) | ||
731 | return AC_ERR_DEV; | ||
732 | return 0; | ||
733 | } | ||
734 | |||
735 | static inline unsigned int __ac_err_mask(u8 status) | ||
736 | { | ||
737 | unsigned int mask = ac_err_mask(status); | ||
738 | if (mask == 0) | ||
739 | return AC_ERR_OTHER; | ||
740 | return mask; | ||
741 | } | ||
742 | |||
672 | #endif /* __LINUX_LIBATA_H__ */ | 743 | #endif /* __LINUX_LIBATA_H__ */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h index 53fa51595443..40f63c9879d2 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -52,7 +52,7 @@ struct loop_device { | |||
52 | unsigned lo_blocksize; | 52 | unsigned lo_blocksize; |
53 | void *key_data; | 53 | void *key_data; |
54 | 54 | ||
55 | int old_gfp_mask; | 55 | gfp_t old_gfp_mask; |
56 | 56 | ||
57 | spinlock_t lo_lock; | 57 | spinlock_t lo_lock; |
58 | struct bio *lo_bio; | 58 | struct bio *lo_bio; |
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h index 9263d2db2d67..99e044b4efc6 100644 --- a/include/linux/mbcache.h +++ b/include/linux/mbcache.h | |||
@@ -22,7 +22,7 @@ struct mb_cache_entry { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct mb_cache_op { | 24 | struct mb_cache_op { |
25 | int (*free)(struct mb_cache_entry *, int); | 25 | int (*free)(struct mb_cache_entry *, gfp_t); |
26 | }; | 26 | }; |
27 | 27 | ||
28 | /* Functions on caches */ | 28 | /* Functions on caches */ |
diff --git a/include/linux/memory.h b/include/linux/memory.h new file mode 100644 index 000000000000..0def328ab5cf --- /dev/null +++ b/include/linux/memory.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * include/linux/memory.h - generic memory definition | ||
3 | * | ||
4 | * This is mainly for topological representation. We define the | ||
5 | * basic "struct memory_block" here, which can be embedded in per-arch | ||
6 | * definitions or NUMA information. | ||
7 | * | ||
8 | * Basic handling of the devices is done in drivers/base/memory.c | ||
9 | * and system devices are handled in drivers/base/sys.c. | ||
10 | * | ||
11 | * Memory block are exported via sysfs in the class/memory/devices/ | ||
12 | * directory. | ||
13 | * | ||
14 | */ | ||
15 | #ifndef _LINUX_MEMORY_H_ | ||
16 | #define _LINUX_MEMORY_H_ | ||
17 | |||
18 | #include <linux/sysdev.h> | ||
19 | #include <linux/node.h> | ||
20 | #include <linux/compiler.h> | ||
21 | |||
22 | #include <asm/semaphore.h> | ||
23 | |||
24 | struct memory_block { | ||
25 | unsigned long phys_index; | ||
26 | unsigned long state; | ||
27 | /* | ||
28 | * This serializes all state change requests. It isn't | ||
29 | * held during creation because the control files are | ||
30 | * created long after the critical areas during | ||
31 | * initialization. | ||
32 | */ | ||
33 | struct semaphore state_sem; | ||
34 | int phys_device; /* to which fru does this belong? */ | ||
35 | void *hw; /* optional pointer to fw/hw data */ | ||
36 | int (*phys_callback)(struct memory_block *); | ||
37 | struct sys_device sysdev; | ||
38 | }; | ||
39 | |||
40 | /* These states are exposed to userspace as text strings in sysfs */ | ||
41 | #define MEM_ONLINE (1<<0) /* exposed to userspace */ | ||
42 | #define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ | ||
43 | #define MEM_OFFLINE (1<<2) /* exposed to userspace */ | ||
44 | |||
45 | /* | ||
46 | * All of these states are currently kernel-internal for notifying | ||
47 | * kernel components and architectures. | ||
48 | * | ||
49 | * For MEM_MAPPING_INVALID, all notifier chains with priority >0 | ||
50 | * are called before pfn_to_page() becomes invalid. The priority=0 | ||
51 | * entry is reserved for the function that actually makes | ||
52 | * pfn_to_page() stop working. Any notifiers that want to be called | ||
53 | * after that should have priority <0. | ||
54 | */ | ||
55 | #define MEM_MAPPING_INVALID (1<<3) | ||
56 | |||
57 | #ifndef CONFIG_MEMORY_HOTPLUG | ||
58 | static inline int memory_dev_init(void) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | static inline int register_memory_notifier(struct notifier_block *nb) | ||
63 | { | ||
64 | return 0; | ||
65 | } | ||
66 | static inline void unregister_memory_notifier(struct notifier_block *nb) | ||
67 | { | ||
68 | } | ||
69 | #else | ||
70 | extern int register_memory(struct memory_block *, struct mem_section *section, struct node *); | ||
71 | extern int register_new_memory(struct mem_section *); | ||
72 | extern int unregister_memory_section(struct mem_section *); | ||
73 | extern int memory_dev_init(void); | ||
74 | extern int register_memory_notifier(struct notifier_block *nb); | ||
75 | extern void unregister_memory_notifier(struct notifier_block *nb); | ||
76 | |||
77 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | ||
78 | |||
79 | extern int invalidate_phys_mapping(unsigned long, unsigned long); | ||
80 | struct notifier_block; | ||
81 | |||
82 | extern int register_memory_notifier(struct notifier_block *nb); | ||
83 | extern void unregister_memory_notifier(struct notifier_block *nb); | ||
84 | |||
85 | extern struct sysdev_class memory_sysdev_class; | ||
86 | #endif /* CONFIG_MEMORY_HOTPLUG */ | ||
87 | |||
88 | #define hotplug_memory_notifier(fn, pri) { \ | ||
89 | static struct notifier_block fn##_mem_nb = \ | ||
90 | { .notifier_call = fn, .priority = pri }; \ | ||
91 | register_memory_notifier(&fn##_mem_nb); \ | ||
92 | } | ||
93 | |||
94 | #endif /* _LINUX_MEMORY_H_ */ | ||
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h new file mode 100644 index 000000000000..01f03bc06eff --- /dev/null +++ b/include/linux/memory_hotplug.h | |||
@@ -0,0 +1,104 @@ | |||
1 | #ifndef __LINUX_MEMORY_HOTPLUG_H | ||
2 | #define __LINUX_MEMORY_HOTPLUG_H | ||
3 | |||
4 | #include <linux/mmzone.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/mmzone.h> | ||
7 | #include <linux/notifier.h> | ||
8 | |||
9 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
10 | /* | ||
11 | * pgdat resizing functions | ||
12 | */ | ||
13 | static inline | ||
14 | void pgdat_resize_lock(struct pglist_data *pgdat, unsigned long *flags) | ||
15 | { | ||
16 | spin_lock_irqsave(&pgdat->node_size_lock, *flags); | ||
17 | } | ||
18 | static inline | ||
19 | void pgdat_resize_unlock(struct pglist_data *pgdat, unsigned long *flags) | ||
20 | { | ||
21 | spin_unlock_irqrestore(&pgdat->node_size_lock, *flags); | ||
22 | } | ||
23 | static inline | ||
24 | void pgdat_resize_init(struct pglist_data *pgdat) | ||
25 | { | ||
26 | spin_lock_init(&pgdat->node_size_lock); | ||
27 | } | ||
28 | /* | ||
29 | * Zone resizing functions | ||
30 | */ | ||
31 | static inline unsigned zone_span_seqbegin(struct zone *zone) | ||
32 | { | ||
33 | return read_seqbegin(&zone->span_seqlock); | ||
34 | } | ||
35 | static inline int zone_span_seqretry(struct zone *zone, unsigned iv) | ||
36 | { | ||
37 | return read_seqretry(&zone->span_seqlock, iv); | ||
38 | } | ||
39 | static inline void zone_span_writelock(struct zone *zone) | ||
40 | { | ||
41 | write_seqlock(&zone->span_seqlock); | ||
42 | } | ||
43 | static inline void zone_span_writeunlock(struct zone *zone) | ||
44 | { | ||
45 | write_sequnlock(&zone->span_seqlock); | ||
46 | } | ||
47 | static inline void zone_seqlock_init(struct zone *zone) | ||
48 | { | ||
49 | seqlock_init(&zone->span_seqlock); | ||
50 | } | ||
51 | extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); | ||
52 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); | ||
53 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); | ||
54 | /* need some defines for these for archs that don't support it */ | ||
55 | extern void online_page(struct page *page); | ||
56 | /* VM interface that may be used by firmware interface */ | ||
57 | extern int add_memory(u64 start, u64 size); | ||
58 | extern int remove_memory(u64 start, u64 size); | ||
59 | extern int online_pages(unsigned long, unsigned long); | ||
60 | |||
61 | /* reasonably generic interface to expand the physical pages in a zone */ | ||
62 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, | ||
63 | unsigned long nr_pages); | ||
64 | #else /* ! CONFIG_MEMORY_HOTPLUG */ | ||
65 | /* | ||
66 | * Stub functions for when hotplug is off | ||
67 | */ | ||
68 | static inline void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {} | ||
69 | static inline void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {} | ||
70 | static inline void pgdat_resize_init(struct pglist_data *pgdat) {} | ||
71 | |||
72 | static inline unsigned zone_span_seqbegin(struct zone *zone) | ||
73 | { | ||
74 | return 0; | ||
75 | } | ||
76 | static inline int zone_span_seqretry(struct zone *zone, unsigned iv) | ||
77 | { | ||
78 | return 0; | ||
79 | } | ||
80 | static inline void zone_span_writelock(struct zone *zone) {} | ||
81 | static inline void zone_span_writeunlock(struct zone *zone) {} | ||
82 | static inline void zone_seqlock_init(struct zone *zone) {} | ||
83 | |||
84 | static inline int mhp_notimplemented(const char *func) | ||
85 | { | ||
86 | printk(KERN_WARNING "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func); | ||
87 | dump_stack(); | ||
88 | return -ENOSYS; | ||
89 | } | ||
90 | |||
91 | static inline int __add_pages(struct zone *zone, unsigned long start_pfn, | ||
92 | unsigned long nr_pages) | ||
93 | { | ||
94 | return mhp_notimplemented(__FUNCTION__); | ||
95 | } | ||
96 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | ||
97 | static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | ||
98 | unsigned long nr_pages) | ||
99 | { | ||
100 | printk(KERN_WARNING "%s() called, not yet supported\n", __FUNCTION__); | ||
101 | dump_stack(); | ||
102 | return -ENOSYS; | ||
103 | } | ||
104 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | ||
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 58385ee1c0ac..8b67cf837ca9 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -27,10 +27,10 @@ | |||
27 | 27 | ||
28 | #include <linux/config.h> | 28 | #include <linux/config.h> |
29 | #include <linux/mmzone.h> | 29 | #include <linux/mmzone.h> |
30 | #include <linux/bitmap.h> | ||
31 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
32 | #include <linux/rbtree.h> | 31 | #include <linux/rbtree.h> |
33 | #include <linux/spinlock.h> | 32 | #include <linux/spinlock.h> |
33 | #include <linux/nodemask.h> | ||
34 | 34 | ||
35 | struct vm_area_struct; | 35 | struct vm_area_struct; |
36 | 36 | ||
@@ -47,8 +47,7 @@ struct vm_area_struct; | |||
47 | * Locking policy for interlave: | 47 | * Locking policy for interlave: |
48 | * In process context there is no locking because only the process accesses | 48 | * In process context there is no locking because only the process accesses |
49 | * its own state. All vma manipulation is somewhat protected by a down_read on | 49 | * its own state. All vma manipulation is somewhat protected by a down_read on |
50 | * mmap_sem. For allocating in the interleave policy the page_table_lock | 50 | * mmap_sem. |
51 | * must be also aquired to protect il_next. | ||
52 | * | 51 | * |
53 | * Freeing policy: | 52 | * Freeing policy: |
54 | * When policy is MPOL_BIND v.zonelist is kmalloc'ed and must be kfree'd. | 53 | * When policy is MPOL_BIND v.zonelist is kmalloc'ed and must be kfree'd. |
@@ -63,7 +62,7 @@ struct mempolicy { | |||
63 | union { | 62 | union { |
64 | struct zonelist *zonelist; /* bind */ | 63 | struct zonelist *zonelist; /* bind */ |
65 | short preferred_node; /* preferred */ | 64 | short preferred_node; /* preferred */ |
66 | DECLARE_BITMAP(nodes, MAX_NUMNODES); /* interleave */ | 65 | nodemask_t nodes; /* interleave */ |
67 | /* undefined for default */ | 66 | /* undefined for default */ |
68 | } v; | 67 | } v; |
69 | }; | 68 | }; |
@@ -155,6 +154,7 @@ struct mempolicy *get_vma_policy(struct task_struct *task, | |||
155 | 154 | ||
156 | extern void numa_default_policy(void); | 155 | extern void numa_default_policy(void); |
157 | extern void numa_policy_init(void); | 156 | extern void numa_policy_init(void); |
157 | extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new); | ||
158 | extern struct mempolicy default_policy; | 158 | extern struct mempolicy default_policy; |
159 | 159 | ||
160 | #else | 160 | #else |
@@ -227,6 +227,11 @@ static inline void numa_default_policy(void) | |||
227 | { | 227 | { |
228 | } | 228 | } |
229 | 229 | ||
230 | static inline void numa_policy_rebind(const nodemask_t *old, | ||
231 | const nodemask_t *new) | ||
232 | { | ||
233 | } | ||
234 | |||
230 | #endif /* CONFIG_NUMA */ | 235 | #endif /* CONFIG_NUMA */ |
231 | #endif /* __KERNEL__ */ | 236 | #endif /* __KERNEL__ */ |
232 | 237 | ||
diff --git a/include/linux/mii.h b/include/linux/mii.h index 9b8d0476988a..68f5a0f392dd 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -158,6 +158,7 @@ extern int mii_link_ok (struct mii_if_info *mii); | |||
158 | extern int mii_nway_restart (struct mii_if_info *mii); | 158 | extern int mii_nway_restart (struct mii_if_info *mii); |
159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
161 | extern int mii_check_gmii_support(struct mii_if_info *mii); | ||
161 | extern void mii_check_link (struct mii_if_info *mii); | 162 | extern void mii_check_link (struct mii_if_info *mii); |
162 | extern unsigned int mii_check_media (struct mii_if_info *mii, | 163 | extern unsigned int mii_check_media (struct mii_if_info *mii, |
163 | unsigned int ok_to_print, | 164 | unsigned int ok_to_print, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 097b3a3c693d..5c1fb0a2e806 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -157,7 +157,7 @@ extern unsigned int kobjsize(const void *objp); | |||
157 | 157 | ||
158 | #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ | 158 | #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ |
159 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ | 159 | #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ |
160 | #define VM_RESERVED 0x00080000 /* Don't unmap it from swap_out */ | 160 | #define VM_RESERVED 0x00080000 /* Pages managed in a special way */ |
161 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ | 161 | #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ |
162 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 162 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
163 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | 163 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ |
@@ -226,13 +226,18 @@ struct page { | |||
226 | * to show when page is mapped | 226 | * to show when page is mapped |
227 | * & limit reverse map searches. | 227 | * & limit reverse map searches. |
228 | */ | 228 | */ |
229 | unsigned long private; /* Mapping-private opaque data: | 229 | union { |
230 | unsigned long private; /* Mapping-private opaque data: | ||
230 | * usually used for buffer_heads | 231 | * usually used for buffer_heads |
231 | * if PagePrivate set; used for | 232 | * if PagePrivate set; used for |
232 | * swp_entry_t if PageSwapCache | 233 | * swp_entry_t if PageSwapCache |
233 | * When page is free, this indicates | 234 | * When page is free, this indicates |
234 | * order in the buddy system. | 235 | * order in the buddy system. |
235 | */ | 236 | */ |
237 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
238 | spinlock_t ptl; | ||
239 | #endif | ||
240 | } u; | ||
236 | struct address_space *mapping; /* If low bit clear, points to | 241 | struct address_space *mapping; /* If low bit clear, points to |
237 | * inode address_space, or NULL. | 242 | * inode address_space, or NULL. |
238 | * If page mapped as anonymous | 243 | * If page mapped as anonymous |
@@ -260,6 +265,9 @@ struct page { | |||
260 | #endif /* WANT_PAGE_VIRTUAL */ | 265 | #endif /* WANT_PAGE_VIRTUAL */ |
261 | }; | 266 | }; |
262 | 267 | ||
268 | #define page_private(page) ((page)->u.private) | ||
269 | #define set_page_private(page, v) ((page)->u.private = (v)) | ||
270 | |||
263 | /* | 271 | /* |
264 | * FIXME: take this include out, include page-flags.h in | 272 | * FIXME: take this include out, include page-flags.h in |
265 | * files which need it (119 of them) | 273 | * files which need it (119 of them) |
@@ -311,17 +319,17 @@ extern void FASTCALL(__page_cache_release(struct page *)); | |||
311 | 319 | ||
312 | #ifdef CONFIG_HUGETLB_PAGE | 320 | #ifdef CONFIG_HUGETLB_PAGE |
313 | 321 | ||
314 | static inline int page_count(struct page *p) | 322 | static inline int page_count(struct page *page) |
315 | { | 323 | { |
316 | if (PageCompound(p)) | 324 | if (PageCompound(page)) |
317 | p = (struct page *)p->private; | 325 | page = (struct page *)page_private(page); |
318 | return atomic_read(&(p)->_count) + 1; | 326 | return atomic_read(&page->_count) + 1; |
319 | } | 327 | } |
320 | 328 | ||
321 | static inline void get_page(struct page *page) | 329 | static inline void get_page(struct page *page) |
322 | { | 330 | { |
323 | if (unlikely(PageCompound(page))) | 331 | if (unlikely(PageCompound(page))) |
324 | page = (struct page *)page->private; | 332 | page = (struct page *)page_private(page); |
325 | atomic_inc(&page->_count); | 333 | atomic_inc(&page->_count); |
326 | } | 334 | } |
327 | 335 | ||
@@ -338,7 +346,7 @@ static inline void get_page(struct page *page) | |||
338 | 346 | ||
339 | static inline void put_page(struct page *page) | 347 | static inline void put_page(struct page *page) |
340 | { | 348 | { |
341 | if (!PageReserved(page) && put_page_testzero(page)) | 349 | if (put_page_testzero(page)) |
342 | __page_cache_release(page); | 350 | __page_cache_release(page); |
343 | } | 351 | } |
344 | 352 | ||
@@ -587,7 +595,7 @@ static inline int PageAnon(struct page *page) | |||
587 | static inline pgoff_t page_index(struct page *page) | 595 | static inline pgoff_t page_index(struct page *page) |
588 | { | 596 | { |
589 | if (unlikely(PageSwapCache(page))) | 597 | if (unlikely(PageSwapCache(page))) |
590 | return page->private; | 598 | return page_private(page); |
591 | return page->index; | 599 | return page->index; |
592 | } | 600 | } |
593 | 601 | ||
@@ -682,7 +690,7 @@ struct zap_details { | |||
682 | 690 | ||
683 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, | 691 | unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, |
684 | unsigned long size, struct zap_details *); | 692 | unsigned long size, struct zap_details *); |
685 | unsigned long unmap_vmas(struct mmu_gather **tlb, struct mm_struct *mm, | 693 | unsigned long unmap_vmas(struct mmu_gather **tlb, |
686 | struct vm_area_struct *start_vma, unsigned long start_addr, | 694 | struct vm_area_struct *start_vma, unsigned long start_addr, |
687 | unsigned long end_addr, unsigned long *nr_accounted, | 695 | unsigned long end_addr, unsigned long *nr_accounted, |
688 | struct zap_details *); | 696 | struct zap_details *); |
@@ -704,10 +712,6 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
704 | } | 712 | } |
705 | 713 | ||
706 | extern int vmtruncate(struct inode * inode, loff_t offset); | 714 | extern int vmtruncate(struct inode * inode, loff_t offset); |
707 | extern pud_t *FASTCALL(__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)); | ||
708 | extern pmd_t *FASTCALL(__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)); | ||
709 | extern pte_t *FASTCALL(pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); | ||
710 | extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); | ||
711 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); | 715 | extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); |
712 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); | 716 | extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); |
713 | extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); | 717 | extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); |
@@ -723,6 +727,7 @@ void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); | |||
723 | 727 | ||
724 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, | 728 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, |
725 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 729 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); |
730 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); | ||
726 | 731 | ||
727 | int __set_page_dirty_buffers(struct page *page); | 732 | int __set_page_dirty_buffers(struct page *page); |
728 | int __set_page_dirty_nobuffers(struct page *page); | 733 | int __set_page_dirty_nobuffers(struct page *page); |
@@ -747,7 +752,7 @@ extern unsigned long do_mremap(unsigned long addr, | |||
747 | * The callback will be passed nr_to_scan == 0 when the VM is querying the | 752 | * The callback will be passed nr_to_scan == 0 when the VM is querying the |
748 | * cache size, so a fastpath for that case is appropriate. | 753 | * cache size, so a fastpath for that case is appropriate. |
749 | */ | 754 | */ |
750 | typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); | 755 | typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); |
751 | 756 | ||
752 | /* | 757 | /* |
753 | * Add an aging callback. The int is the number of 'seeks' it takes | 758 | * Add an aging callback. The int is the number of 'seeks' it takes |
@@ -759,38 +764,83 @@ struct shrinker; | |||
759 | extern struct shrinker *set_shrinker(int, shrinker_t); | 764 | extern struct shrinker *set_shrinker(int, shrinker_t); |
760 | extern void remove_shrinker(struct shrinker *shrinker); | 765 | extern void remove_shrinker(struct shrinker *shrinker); |
761 | 766 | ||
762 | /* | 767 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); |
763 | * On a two-level or three-level page table, this ends up being trivial. Thus | 768 | int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); |
764 | * the inlining and the symmetry break with pte_alloc_map() that does all | 769 | int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address); |
765 | * of this out-of-line. | 770 | int __pte_alloc_kernel(pmd_t *pmd, unsigned long address); |
766 | */ | 771 | |
767 | /* | 772 | /* |
768 | * The following ifdef needed to get the 4level-fixup.h header to work. | 773 | * The following ifdef needed to get the 4level-fixup.h header to work. |
769 | * Remove it when 4level-fixup.h has been removed. | 774 | * Remove it when 4level-fixup.h has been removed. |
770 | */ | 775 | */ |
771 | #ifdef CONFIG_MMU | 776 | #if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK) |
772 | #ifndef __ARCH_HAS_4LEVEL_HACK | ||
773 | static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) | 777 | static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) |
774 | { | 778 | { |
775 | if (pgd_none(*pgd)) | 779 | return (unlikely(pgd_none(*pgd)) && __pud_alloc(mm, pgd, address))? |
776 | return __pud_alloc(mm, pgd, address); | 780 | NULL: pud_offset(pgd, address); |
777 | return pud_offset(pgd, address); | ||
778 | } | 781 | } |
779 | 782 | ||
780 | static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) | 783 | static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) |
781 | { | 784 | { |
782 | if (pud_none(*pud)) | 785 | return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))? |
783 | return __pmd_alloc(mm, pud, address); | 786 | NULL: pmd_offset(pud, address); |
784 | return pmd_offset(pud, address); | ||
785 | } | 787 | } |
786 | #endif | 788 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ |
787 | #endif /* CONFIG_MMU */ | 789 | |
790 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
791 | /* | ||
792 | * We tuck a spinlock to guard each pagetable page into its struct page, | ||
793 | * at page->private, with BUILD_BUG_ON to make sure that this will not | ||
794 | * overflow into the next struct page (as it might with DEBUG_SPINLOCK). | ||
795 | * When freeing, reset page->mapping so free_pages_check won't complain. | ||
796 | */ | ||
797 | #define __pte_lockptr(page) &((page)->u.ptl) | ||
798 | #define pte_lock_init(_page) do { \ | ||
799 | spin_lock_init(__pte_lockptr(_page)); \ | ||
800 | } while (0) | ||
801 | #define pte_lock_deinit(page) ((page)->mapping = NULL) | ||
802 | #define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));}) | ||
803 | #else | ||
804 | /* | ||
805 | * We use mm->page_table_lock to guard all pagetable pages of the mm. | ||
806 | */ | ||
807 | #define pte_lock_init(page) do {} while (0) | ||
808 | #define pte_lock_deinit(page) do {} while (0) | ||
809 | #define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) | ||
810 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | ||
811 | |||
812 | #define pte_offset_map_lock(mm, pmd, address, ptlp) \ | ||
813 | ({ \ | ||
814 | spinlock_t *__ptl = pte_lockptr(mm, pmd); \ | ||
815 | pte_t *__pte = pte_offset_map(pmd, address); \ | ||
816 | *(ptlp) = __ptl; \ | ||
817 | spin_lock(__ptl); \ | ||
818 | __pte; \ | ||
819 | }) | ||
820 | |||
821 | #define pte_unmap_unlock(pte, ptl) do { \ | ||
822 | spin_unlock(ptl); \ | ||
823 | pte_unmap(pte); \ | ||
824 | } while (0) | ||
825 | |||
826 | #define pte_alloc_map(mm, pmd, address) \ | ||
827 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | ||
828 | NULL: pte_offset_map(pmd, address)) | ||
829 | |||
830 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ | ||
831 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | ||
832 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) | ||
833 | |||
834 | #define pte_alloc_kernel(pmd, address) \ | ||
835 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ | ||
836 | NULL: pte_offset_kernel(pmd, address)) | ||
788 | 837 | ||
789 | extern void free_area_init(unsigned long * zones_size); | 838 | extern void free_area_init(unsigned long * zones_size); |
790 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | 839 | extern void free_area_init_node(int nid, pg_data_t *pgdat, |
791 | unsigned long * zones_size, unsigned long zone_start_pfn, | 840 | unsigned long * zones_size, unsigned long zone_start_pfn, |
792 | unsigned long *zholes_size); | 841 | unsigned long *zholes_size); |
793 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); | 842 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); |
843 | extern void setup_per_zone_pages_min(void); | ||
794 | extern void mem_init(void); | 844 | extern void mem_init(void); |
795 | extern void show_mem(void); | 845 | extern void show_mem(void); |
796 | extern void si_meminfo(struct sysinfo * val); | 846 | extern void si_meminfo(struct sysinfo * val); |
@@ -834,6 +884,7 @@ extern int split_vma(struct mm_struct *, | |||
834 | extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); | 884 | extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); |
835 | extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *, | 885 | extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *, |
836 | struct rb_node **, struct rb_node *); | 886 | struct rb_node **, struct rb_node *); |
887 | extern void unlink_file_vma(struct vm_area_struct *); | ||
837 | extern struct vm_area_struct *copy_vma(struct vm_area_struct **, | 888 | extern struct vm_area_struct *copy_vma(struct vm_area_struct **, |
838 | unsigned long addr, unsigned long len, pgoff_t pgoff); | 889 | unsigned long addr, unsigned long len, pgoff_t pgoff); |
839 | extern void exit_mmap(struct mm_struct *); | 890 | extern void exit_mmap(struct mm_struct *); |
@@ -894,7 +945,8 @@ void handle_ra_miss(struct address_space *mapping, | |||
894 | unsigned long max_sane_readahead(unsigned long nr); | 945 | unsigned long max_sane_readahead(unsigned long nr); |
895 | 946 | ||
896 | /* Do stack extension */ | 947 | /* Do stack extension */ |
897 | extern int expand_stack(struct vm_area_struct * vma, unsigned long address); | 948 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
949 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | ||
898 | 950 | ||
899 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 951 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
900 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | 952 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); |
@@ -917,40 +969,28 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) | |||
917 | return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 969 | return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
918 | } | 970 | } |
919 | 971 | ||
920 | extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); | 972 | struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); |
973 | struct page *vmalloc_to_page(void *addr); | ||
974 | unsigned long vmalloc_to_pfn(void *addr); | ||
975 | int remap_pfn_range(struct vm_area_struct *, unsigned long addr, | ||
976 | unsigned long pfn, unsigned long size, pgprot_t); | ||
921 | 977 | ||
922 | extern struct page * vmalloc_to_page(void *addr); | 978 | struct page *follow_page(struct mm_struct *, unsigned long address, |
923 | extern unsigned long vmalloc_to_pfn(void *addr); | 979 | unsigned int foll_flags); |
924 | extern struct page * follow_page(struct mm_struct *mm, unsigned long address, | 980 | #define FOLL_WRITE 0x01 /* check pte is writable */ |
925 | int write); | 981 | #define FOLL_TOUCH 0x02 /* mark page accessed */ |
926 | extern int check_user_page_readable(struct mm_struct *mm, unsigned long address); | 982 | #define FOLL_GET 0x04 /* do get_page on page */ |
927 | int remap_pfn_range(struct vm_area_struct *, unsigned long, | 983 | #define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ |
928 | unsigned long, unsigned long, pgprot_t); | ||
929 | 984 | ||
930 | #ifdef CONFIG_PROC_FS | 985 | #ifdef CONFIG_PROC_FS |
931 | void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); | 986 | void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); |
932 | #else | 987 | #else |
933 | static inline void __vm_stat_account(struct mm_struct *mm, | 988 | static inline void vm_stat_account(struct mm_struct *mm, |
934 | unsigned long flags, struct file *file, long pages) | 989 | unsigned long flags, struct file *file, long pages) |
935 | { | 990 | { |
936 | } | 991 | } |
937 | #endif /* CONFIG_PROC_FS */ | 992 | #endif /* CONFIG_PROC_FS */ |
938 | 993 | ||
939 | static inline void vm_stat_account(struct vm_area_struct *vma) | ||
940 | { | ||
941 | __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, | ||
942 | vma_pages(vma)); | ||
943 | } | ||
944 | |||
945 | static inline void vm_stat_unaccount(struct vm_area_struct *vma) | ||
946 | { | ||
947 | __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, | ||
948 | -vma_pages(vma)); | ||
949 | } | ||
950 | |||
951 | /* update per process rss and vm hiwater data */ | ||
952 | extern void update_mem_hiwater(struct task_struct *tsk); | ||
953 | |||
954 | #ifndef CONFIG_DEBUG_PAGEALLOC | 994 | #ifndef CONFIG_DEBUG_PAGEALLOC |
955 | static inline void | 995 | static inline void |
956 | kernel_map_pages(struct page *page, int numpages, int enable) | 996 | kernel_map_pages(struct page *page, int numpages, int enable) |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 1ab78e8d6c53..aef6042f8f0b 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -50,7 +50,7 @@ struct mmc_command { | |||
50 | #define MMC_ERR_INVALID 5 | 50 | #define MMC_ERR_INVALID 5 |
51 | 51 | ||
52 | struct mmc_data *data; /* data segment associated with cmd */ | 52 | struct mmc_data *data; /* data segment associated with cmd */ |
53 | struct mmc_request *mrq; /* assoicated request */ | 53 | struct mmc_request *mrq; /* associated request */ |
54 | }; | 54 | }; |
55 | 55 | ||
56 | struct mmc_data { | 56 | struct mmc_data { |
@@ -68,7 +68,7 @@ struct mmc_data { | |||
68 | unsigned int bytes_xfered; | 68 | unsigned int bytes_xfered; |
69 | 69 | ||
70 | struct mmc_command *stop; /* stop command */ | 70 | struct mmc_command *stop; /* stop command */ |
71 | struct mmc_request *mrq; /* assoicated request */ | 71 | struct mmc_request *mrq; /* associated request */ |
72 | 72 | ||
73 | unsigned int sg_len; /* size of scatter list */ | 73 | unsigned int sg_len; /* size of scatter list */ |
74 | struct scatterlist *sg; /* I/O scatter list */ | 74 | struct scatterlist *sg; /* I/O scatter list */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5ed471b58f4f..f5fa3082fd6a 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
13 | #include <linux/numa.h> | 13 | #include <linux/numa.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/seqlock.h> | ||
15 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
16 | 17 | ||
17 | /* Free memory management - zoned buddy allocator. */ | 18 | /* Free memory management - zoned buddy allocator. */ |
@@ -137,6 +138,10 @@ struct zone { | |||
137 | * free areas of different sizes | 138 | * free areas of different sizes |
138 | */ | 139 | */ |
139 | spinlock_t lock; | 140 | spinlock_t lock; |
141 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
142 | /* see spanned/present_pages for more description */ | ||
143 | seqlock_t span_seqlock; | ||
144 | #endif | ||
140 | struct free_area free_area[MAX_ORDER]; | 145 | struct free_area free_area[MAX_ORDER]; |
141 | 146 | ||
142 | 147 | ||
@@ -220,6 +225,16 @@ struct zone { | |||
220 | /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */ | 225 | /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */ |
221 | unsigned long zone_start_pfn; | 226 | unsigned long zone_start_pfn; |
222 | 227 | ||
228 | /* | ||
229 | * zone_start_pfn, spanned_pages and present_pages are all | ||
230 | * protected by span_seqlock. It is a seqlock because it has | ||
231 | * to be read outside of zone->lock, and it is done in the main | ||
232 | * allocator path. But, it is written quite infrequently. | ||
233 | * | ||
234 | * The lock is declared along with zone->lock because it is | ||
235 | * frequently read in proximity to zone->lock. It's good to | ||
236 | * give them a chance of being in the same cacheline. | ||
237 | */ | ||
223 | unsigned long spanned_pages; /* total size, including holes */ | 238 | unsigned long spanned_pages; /* total size, including holes */ |
224 | unsigned long present_pages; /* amount of memory (excluding holes) */ | 239 | unsigned long present_pages; /* amount of memory (excluding holes) */ |
225 | 240 | ||
@@ -273,6 +288,16 @@ typedef struct pglist_data { | |||
273 | struct page *node_mem_map; | 288 | struct page *node_mem_map; |
274 | #endif | 289 | #endif |
275 | struct bootmem_data *bdata; | 290 | struct bootmem_data *bdata; |
291 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
292 | /* | ||
293 | * Must be held any time you expect node_start_pfn, node_present_pages | ||
294 | * or node_spanned_pages stay constant. Holding this will also | ||
295 | * guarantee that any pfn_valid() stays that way. | ||
296 | * | ||
297 | * Nests above zone->lock and zone->size_seqlock. | ||
298 | */ | ||
299 | spinlock_t node_size_lock; | ||
300 | #endif | ||
276 | unsigned long node_start_pfn; | 301 | unsigned long node_start_pfn; |
277 | unsigned long node_present_pages; /* total number of physical pages */ | 302 | unsigned long node_present_pages; /* total number of physical pages */ |
278 | unsigned long node_spanned_pages; /* total size of physical page | 303 | unsigned long node_spanned_pages; /* total size of physical page |
@@ -293,6 +318,8 @@ typedef struct pglist_data { | |||
293 | #endif | 318 | #endif |
294 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) | 319 | #define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) |
295 | 320 | ||
321 | #include <linux/memory_hotplug.h> | ||
322 | |||
296 | extern struct pglist_data *pgdat_list; | 323 | extern struct pglist_data *pgdat_list; |
297 | 324 | ||
298 | void __get_zone_counts(unsigned long *active, unsigned long *inactive, | 325 | void __get_zone_counts(unsigned long *active, unsigned long *inactive, |
@@ -302,7 +329,7 @@ void get_zone_counts(unsigned long *active, unsigned long *inactive, | |||
302 | void build_all_zonelists(void); | 329 | void build_all_zonelists(void); |
303 | void wakeup_kswapd(struct zone *zone, int order); | 330 | void wakeup_kswapd(struct zone *zone, int order); |
304 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 331 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
305 | int alloc_type, int can_try_harder, int gfp_high); | 332 | int alloc_type, int can_try_harder, gfp_t gfp_high); |
306 | 333 | ||
307 | #ifdef CONFIG_HAVE_MEMORY_PRESENT | 334 | #ifdef CONFIG_HAVE_MEMORY_PRESENT |
308 | void memory_present(int nid, unsigned long start, unsigned long end); | 335 | void memory_present(int nid, unsigned long start, unsigned long end); |
@@ -509,6 +536,7 @@ static inline struct mem_section *__nr_to_section(unsigned long nr) | |||
509 | return NULL; | 536 | return NULL; |
510 | return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; | 537 | return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; |
511 | } | 538 | } |
539 | extern int __section_nr(struct mem_section* ms); | ||
512 | 540 | ||
513 | /* | 541 | /* |
514 | * We use the lower bits of the mem_map pointer to store | 542 | * We use the lower bits of the mem_map pointer to store |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 2f0299a448f6..7b08c11ec4cc 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -244,4 +244,9 @@ struct pcmcia_device_id { | |||
244 | #define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 | 244 | #define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 |
245 | #define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 | 245 | #define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 |
246 | 246 | ||
247 | /* I2C */ | ||
248 | struct i2c_device_id { | ||
249 | __u16 id; | ||
250 | }; | ||
251 | |||
247 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 252 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index f05372b7fe77..84d75f3a8aca 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -554,7 +554,9 @@ static inline void MODULE_PARM_(void) { } | |||
554 | #ifdef MODULE | 554 | #ifdef MODULE |
555 | /* DEPRECATED: Do not use. */ | 555 | /* DEPRECATED: Do not use. */ |
556 | #define MODULE_PARM(var,type) \ | 556 | #define MODULE_PARM(var,type) \ |
557 | struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \ | 557 | extern struct obsolete_modparm __parm_##var \ |
558 | __attribute__((section("__obsparm"))); \ | ||
559 | struct obsolete_modparm __parm_##var = \ | ||
558 | { __stringify(var), type, &MODULE_PARM_ }; \ | 560 | { __stringify(var), type, &MODULE_PARM_ }; \ |
559 | __MODULE_PARM_TYPE(var, type); | 561 | __MODULE_PARM_TYPE(var, type); |
560 | #else | 562 | #else |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 9a3d27257984..941da5c016a0 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -282,6 +282,17 @@ static inline u8 fat_attr(struct inode *inode) | |||
282 | MSDOS_I(inode)->i_attrs; | 282 | MSDOS_I(inode)->i_attrs; |
283 | } | 283 | } |
284 | 284 | ||
285 | static inline unsigned char fat_checksum(const __u8 *name) | ||
286 | { | ||
287 | unsigned char s = name[0]; | ||
288 | s = (s<<7) + (s>>1) + name[1]; s = (s<<7) + (s>>1) + name[2]; | ||
289 | s = (s<<7) + (s>>1) + name[3]; s = (s<<7) + (s>>1) + name[4]; | ||
290 | s = (s<<7) + (s>>1) + name[5]; s = (s<<7) + (s>>1) + name[6]; | ||
291 | s = (s<<7) + (s>>1) + name[7]; s = (s<<7) + (s>>1) + name[8]; | ||
292 | s = (s<<7) + (s>>1) + name[9]; s = (s<<7) + (s>>1) + name[10]; | ||
293 | return s; | ||
294 | } | ||
295 | |||
285 | static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus) | 296 | static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus) |
286 | { | 297 | { |
287 | return ((sector_t)clus - FAT_START_ENT) * sbi->sec_per_clus | 298 | return ((sector_t)clus - FAT_START_ENT) * sbi->sec_per_clus |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 142963f01d29..fc28841f3409 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -8,7 +8,10 @@ | |||
8 | #include <linux/config.h> | 8 | #include <linux/config.h> |
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/list.h> | 10 | #include <linux/list.h> |
11 | #include <linux/string.h> | ||
12 | |||
11 | #include <linux/mtd/compatmac.h> | 13 | #include <linux/mtd/compatmac.h> |
14 | |||
12 | #include <asm/unaligned.h> | 15 | #include <asm/unaligned.h> |
13 | #include <asm/system.h> | 16 | #include <asm/system.h> |
14 | #include <asm/io.h> | 17 | #include <asm/io.h> |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 7db67b008cac..1c975d0d9e94 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -8,6 +8,7 @@ struct vfsmount; | |||
8 | struct open_intent { | 8 | struct open_intent { |
9 | int flags; | 9 | int flags; |
10 | int create_mode; | 10 | int create_mode; |
11 | struct file *file; | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | enum { MAX_NESTED_LINKS = 5 }; | 14 | enum { MAX_NESTED_LINKS = 5 }; |
@@ -65,6 +66,13 @@ extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); | |||
65 | extern void path_release(struct nameidata *); | 66 | extern void path_release(struct nameidata *); |
66 | extern void path_release_on_umount(struct nameidata *); | 67 | extern void path_release_on_umount(struct nameidata *); |
67 | 68 | ||
69 | extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags); | ||
70 | extern int path_lookup_open(const char *, unsigned lookup_flags, struct nameidata *, int open_flags); | ||
71 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | ||
72 | int (*open)(struct inode *, struct file *)); | ||
73 | extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | ||
74 | extern void release_open_intent(struct nameidata *); | ||
75 | |||
68 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | 76 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); |
69 | extern struct dentry * lookup_hash(struct qstr *, struct dentry *); | 77 | extern struct dentry * lookup_hash(struct qstr *, struct dentry *); |
70 | 78 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 368e4c825ff1..c6efce4a04a4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -308,6 +308,7 @@ struct net_device | |||
308 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ | 308 | #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ |
309 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ | 309 | #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ |
310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | 310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ |
311 | #define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ | ||
311 | 312 | ||
312 | struct net_device *next_sched; | 313 | struct net_device *next_sched; |
313 | 314 | ||
@@ -873,11 +874,9 @@ static inline void netif_rx_complete(struct net_device *dev) | |||
873 | 874 | ||
874 | static inline void netif_poll_disable(struct net_device *dev) | 875 | static inline void netif_poll_disable(struct net_device *dev) |
875 | { | 876 | { |
876 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { | 877 | while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) |
877 | /* No hurry. */ | 878 | /* No hurry. */ |
878 | current->state = TASK_INTERRUPTIBLE; | 879 | schedule_timeout_interruptible(1); |
879 | schedule_timeout(1); | ||
880 | } | ||
881 | } | 880 | } |
882 | 881 | ||
883 | static inline void netif_poll_enable(struct net_device *dev) | 882 | static inline void netif_poll_enable(struct net_device *dev) |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 9a6047ff1b25..325fe7ae49bb 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -41,6 +41,10 @@ | |||
41 | #define NFS_MAX_FILE_IO_BUFFER_SIZE 32768 | 41 | #define NFS_MAX_FILE_IO_BUFFER_SIZE 32768 |
42 | #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 | 42 | #define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 |
43 | 43 | ||
44 | /* Default timeout values */ | ||
45 | #define NFS_MAX_UDP_TIMEOUT (60*HZ) | ||
46 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) | ||
47 | |||
44 | /* | 48 | /* |
45 | * superblock magic number for NFS | 49 | * superblock magic number for NFS |
46 | */ | 50 | */ |
@@ -137,6 +141,7 @@ struct nfs_inode { | |||
137 | unsigned long attrtimeo_timestamp; | 141 | unsigned long attrtimeo_timestamp; |
138 | __u64 change_attr; /* v4 only */ | 142 | __u64 change_attr; /* v4 only */ |
139 | 143 | ||
144 | unsigned long last_updated; | ||
140 | /* "Generation counter" for the attribute cache. This is | 145 | /* "Generation counter" for the attribute cache. This is |
141 | * bumped whenever we update the metadata on the | 146 | * bumped whenever we update the metadata on the |
142 | * server. | 147 | * server. |
@@ -236,13 +241,17 @@ static inline int nfs_caches_unstable(struct inode *inode) | |||
236 | return atomic_read(&NFS_I(inode)->data_updates) != 0; | 241 | return atomic_read(&NFS_I(inode)->data_updates) != 0; |
237 | } | 242 | } |
238 | 243 | ||
244 | static inline void nfs_mark_for_revalidate(struct inode *inode) | ||
245 | { | ||
246 | spin_lock(&inode->i_lock); | ||
247 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
248 | spin_unlock(&inode->i_lock); | ||
249 | } | ||
250 | |||
239 | static inline void NFS_CACHEINV(struct inode *inode) | 251 | static inline void NFS_CACHEINV(struct inode *inode) |
240 | { | 252 | { |
241 | if (!nfs_caches_unstable(inode)) { | 253 | if (!nfs_caches_unstable(inode)) |
242 | spin_lock(&inode->i_lock); | 254 | nfs_mark_for_revalidate(inode); |
243 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; | ||
244 | spin_unlock(&inode->i_lock); | ||
245 | } | ||
246 | } | 255 | } |
247 | 256 | ||
248 | static inline int nfs_server_capable(struct inode *inode, int cap) | 257 | static inline int nfs_server_capable(struct inode *inode, int cap) |
@@ -276,7 +285,7 @@ static inline long nfs_save_change_attribute(struct inode *inode) | |||
276 | static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) | 285 | static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) |
277 | { | 286 | { |
278 | return !nfs_caches_unstable(inode) | 287 | return !nfs_caches_unstable(inode) |
279 | && chattr == NFS_I(inode)->cache_change_attribute; | 288 | && time_after_eq(chattr, NFS_I(inode)->cache_change_attribute); |
280 | } | 289 | } |
281 | 290 | ||
282 | /* | 291 | /* |
@@ -286,6 +295,7 @@ extern void nfs_zap_caches(struct inode *); | |||
286 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, | 295 | extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, |
287 | struct nfs_fattr *); | 296 | struct nfs_fattr *); |
288 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); | 297 | extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); |
298 | extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); | ||
289 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 299 | extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
290 | extern int nfs_permission(struct inode *, int, struct nameidata *); | 300 | extern int nfs_permission(struct inode *, int, struct nameidata *); |
291 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); | 301 | extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); |
@@ -312,6 +322,12 @@ extern void nfs_file_clear_open_context(struct file *filp); | |||
312 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 322 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
313 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 323 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ |
314 | 324 | ||
325 | static inline void nfs_fattr_init(struct nfs_fattr *fattr) | ||
326 | { | ||
327 | fattr->valid = 0; | ||
328 | fattr->time_start = jiffies; | ||
329 | } | ||
330 | |||
315 | /* | 331 | /* |
316 | * linux/fs/nfs/file.c | 332 | * linux/fs/nfs/file.c |
317 | */ | 333 | */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index a2bf6914ff1b..40718669b9c8 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -41,7 +41,7 @@ struct nfs_fattr { | |||
41 | __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ | 41 | __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ |
42 | __u64 change_attr; /* NFSv4 change attribute */ | 42 | __u64 change_attr; /* NFSv4 change attribute */ |
43 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ | 43 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ |
44 | unsigned long timestamp; | 44 | unsigned long time_start; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ | 47 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
@@ -96,12 +96,13 @@ struct nfs4_change_info { | |||
96 | u64 after; | 96 | u64 after; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | struct nfs_seqid; | ||
99 | /* | 100 | /* |
100 | * Arguments to the open call. | 101 | * Arguments to the open call. |
101 | */ | 102 | */ |
102 | struct nfs_openargs { | 103 | struct nfs_openargs { |
103 | const struct nfs_fh * fh; | 104 | const struct nfs_fh * fh; |
104 | __u32 seqid; | 105 | struct nfs_seqid * seqid; |
105 | int open_flags; | 106 | int open_flags; |
106 | __u64 clientid; | 107 | __u64 clientid; |
107 | __u32 id; | 108 | __u32 id; |
@@ -123,6 +124,7 @@ struct nfs_openres { | |||
123 | struct nfs4_change_info cinfo; | 124 | struct nfs4_change_info cinfo; |
124 | __u32 rflags; | 125 | __u32 rflags; |
125 | struct nfs_fattr * f_attr; | 126 | struct nfs_fattr * f_attr; |
127 | struct nfs_fattr * dir_attr; | ||
126 | const struct nfs_server *server; | 128 | const struct nfs_server *server; |
127 | int delegation_type; | 129 | int delegation_type; |
128 | nfs4_stateid delegation; | 130 | nfs4_stateid delegation; |
@@ -136,7 +138,7 @@ struct nfs_openres { | |||
136 | struct nfs_open_confirmargs { | 138 | struct nfs_open_confirmargs { |
137 | const struct nfs_fh * fh; | 139 | const struct nfs_fh * fh; |
138 | nfs4_stateid stateid; | 140 | nfs4_stateid stateid; |
139 | __u32 seqid; | 141 | struct nfs_seqid * seqid; |
140 | }; | 142 | }; |
141 | 143 | ||
142 | struct nfs_open_confirmres { | 144 | struct nfs_open_confirmres { |
@@ -148,13 +150,16 @@ struct nfs_open_confirmres { | |||
148 | */ | 150 | */ |
149 | struct nfs_closeargs { | 151 | struct nfs_closeargs { |
150 | struct nfs_fh * fh; | 152 | struct nfs_fh * fh; |
151 | nfs4_stateid stateid; | 153 | nfs4_stateid * stateid; |
152 | __u32 seqid; | 154 | struct nfs_seqid * seqid; |
153 | int open_flags; | 155 | int open_flags; |
156 | const u32 * bitmask; | ||
154 | }; | 157 | }; |
155 | 158 | ||
156 | struct nfs_closeres { | 159 | struct nfs_closeres { |
157 | nfs4_stateid stateid; | 160 | nfs4_stateid stateid; |
161 | struct nfs_fattr * fattr; | ||
162 | const struct nfs_server *server; | ||
158 | }; | 163 | }; |
159 | /* | 164 | /* |
160 | * * Arguments to the lock,lockt, and locku call. | 165 | * * Arguments to the lock,lockt, and locku call. |
@@ -164,30 +169,19 @@ struct nfs_lowner { | |||
164 | u32 id; | 169 | u32 id; |
165 | }; | 170 | }; |
166 | 171 | ||
167 | struct nfs_open_to_lock { | ||
168 | __u32 open_seqid; | ||
169 | nfs4_stateid open_stateid; | ||
170 | __u32 lock_seqid; | ||
171 | struct nfs_lowner lock_owner; | ||
172 | }; | ||
173 | |||
174 | struct nfs_exist_lock { | ||
175 | nfs4_stateid stateid; | ||
176 | __u32 seqid; | ||
177 | }; | ||
178 | |||
179 | struct nfs_lock_opargs { | 172 | struct nfs_lock_opargs { |
173 | struct nfs_seqid * lock_seqid; | ||
174 | nfs4_stateid * lock_stateid; | ||
175 | struct nfs_seqid * open_seqid; | ||
176 | nfs4_stateid * open_stateid; | ||
177 | struct nfs_lowner lock_owner; | ||
180 | __u32 reclaim; | 178 | __u32 reclaim; |
181 | __u32 new_lock_owner; | 179 | __u32 new_lock_owner; |
182 | union { | ||
183 | struct nfs_open_to_lock *open_lock; | ||
184 | struct nfs_exist_lock *exist_lock; | ||
185 | } u; | ||
186 | }; | 180 | }; |
187 | 181 | ||
188 | struct nfs_locku_opargs { | 182 | struct nfs_locku_opargs { |
189 | __u32 seqid; | 183 | struct nfs_seqid * seqid; |
190 | nfs4_stateid stateid; | 184 | nfs4_stateid * stateid; |
191 | }; | 185 | }; |
192 | 186 | ||
193 | struct nfs_lockargs { | 187 | struct nfs_lockargs { |
@@ -262,6 +256,7 @@ struct nfs_writeargs { | |||
262 | enum nfs3_stable_how stable; | 256 | enum nfs3_stable_how stable; |
263 | unsigned int pgbase; | 257 | unsigned int pgbase; |
264 | struct page ** pages; | 258 | struct page ** pages; |
259 | const u32 * bitmask; | ||
265 | }; | 260 | }; |
266 | 261 | ||
267 | struct nfs_writeverf { | 262 | struct nfs_writeverf { |
@@ -273,6 +268,7 @@ struct nfs_writeres { | |||
273 | struct nfs_fattr * fattr; | 268 | struct nfs_fattr * fattr; |
274 | struct nfs_writeverf * verf; | 269 | struct nfs_writeverf * verf; |
275 | __u32 count; | 270 | __u32 count; |
271 | const struct nfs_server *server; | ||
276 | }; | 272 | }; |
277 | 273 | ||
278 | /* | 274 | /* |
@@ -550,6 +546,7 @@ struct nfs4_create_res { | |||
550 | struct nfs_fh * fh; | 546 | struct nfs_fh * fh; |
551 | struct nfs_fattr * fattr; | 547 | struct nfs_fattr * fattr; |
552 | struct nfs4_change_info dir_cinfo; | 548 | struct nfs4_change_info dir_cinfo; |
549 | struct nfs_fattr * dir_fattr; | ||
553 | }; | 550 | }; |
554 | 551 | ||
555 | struct nfs4_fsinfo_arg { | 552 | struct nfs4_fsinfo_arg { |
@@ -571,8 +568,17 @@ struct nfs4_link_arg { | |||
571 | const struct nfs_fh * fh; | 568 | const struct nfs_fh * fh; |
572 | const struct nfs_fh * dir_fh; | 569 | const struct nfs_fh * dir_fh; |
573 | const struct qstr * name; | 570 | const struct qstr * name; |
571 | const u32 * bitmask; | ||
572 | }; | ||
573 | |||
574 | struct nfs4_link_res { | ||
575 | const struct nfs_server * server; | ||
576 | struct nfs_fattr * fattr; | ||
577 | struct nfs4_change_info cinfo; | ||
578 | struct nfs_fattr * dir_attr; | ||
574 | }; | 579 | }; |
575 | 580 | ||
581 | |||
576 | struct nfs4_lookup_arg { | 582 | struct nfs4_lookup_arg { |
577 | const struct nfs_fh * dir_fh; | 583 | const struct nfs_fh * dir_fh; |
578 | const struct qstr * name; | 584 | const struct qstr * name; |
@@ -619,6 +625,13 @@ struct nfs4_readlink { | |||
619 | struct nfs4_remove_arg { | 625 | struct nfs4_remove_arg { |
620 | const struct nfs_fh * fh; | 626 | const struct nfs_fh * fh; |
621 | const struct qstr * name; | 627 | const struct qstr * name; |
628 | const u32 * bitmask; | ||
629 | }; | ||
630 | |||
631 | struct nfs4_remove_res { | ||
632 | const struct nfs_server * server; | ||
633 | struct nfs4_change_info cinfo; | ||
634 | struct nfs_fattr * dir_attr; | ||
622 | }; | 635 | }; |
623 | 636 | ||
624 | struct nfs4_rename_arg { | 637 | struct nfs4_rename_arg { |
@@ -626,11 +639,15 @@ struct nfs4_rename_arg { | |||
626 | const struct nfs_fh * new_dir; | 639 | const struct nfs_fh * new_dir; |
627 | const struct qstr * old_name; | 640 | const struct qstr * old_name; |
628 | const struct qstr * new_name; | 641 | const struct qstr * new_name; |
642 | const u32 * bitmask; | ||
629 | }; | 643 | }; |
630 | 644 | ||
631 | struct nfs4_rename_res { | 645 | struct nfs4_rename_res { |
646 | const struct nfs_server * server; | ||
632 | struct nfs4_change_info old_cinfo; | 647 | struct nfs4_change_info old_cinfo; |
648 | struct nfs_fattr * old_fattr; | ||
633 | struct nfs4_change_info new_cinfo; | 649 | struct nfs4_change_info new_cinfo; |
650 | struct nfs_fattr * new_fattr; | ||
634 | }; | 651 | }; |
635 | 652 | ||
636 | struct nfs4_setclientid { | 653 | struct nfs4_setclientid { |
@@ -722,7 +739,7 @@ struct nfs_rpc_ops { | |||
722 | int (*write) (struct nfs_write_data *); | 739 | int (*write) (struct nfs_write_data *); |
723 | int (*commit) (struct nfs_write_data *); | 740 | int (*commit) (struct nfs_write_data *); |
724 | int (*create) (struct inode *, struct dentry *, | 741 | int (*create) (struct inode *, struct dentry *, |
725 | struct iattr *, int); | 742 | struct iattr *, int, struct nameidata *); |
726 | int (*remove) (struct inode *, struct qstr *); | 743 | int (*remove) (struct inode *, struct qstr *); |
727 | int (*unlink_setup) (struct rpc_message *, | 744 | int (*unlink_setup) (struct rpc_message *, |
728 | struct dentry *, struct qstr *); | 745 | struct dentry *, struct qstr *); |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index e96fe9062500..4726ef7ba8e8 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -12,6 +12,8 @@ | |||
12 | * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c. | 12 | * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c. |
13 | * For details of nodelist_scnprintf() and nodelist_parse(), see | 13 | * For details of nodelist_scnprintf() and nodelist_parse(), see |
14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | 14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. |
15 | * For details of node_remap(), see bitmap_bitremap in lib/bitmap.c. | ||
16 | * For details of nodes_remap(), see bitmap_remap in lib/bitmap.c. | ||
15 | * | 17 | * |
16 | * The available nodemask operations are: | 18 | * The available nodemask operations are: |
17 | * | 19 | * |
@@ -52,6 +54,8 @@ | |||
52 | * int nodemask_parse(ubuf, ulen, mask) Parse ascii string as nodemask | 54 | * int nodemask_parse(ubuf, ulen, mask) Parse ascii string as nodemask |
53 | * int nodelist_scnprintf(buf, len, mask) Format nodemask as list for printing | 55 | * int nodelist_scnprintf(buf, len, mask) Format nodemask as list for printing |
54 | * int nodelist_parse(buf, map) Parse ascii string as nodelist | 56 | * int nodelist_parse(buf, map) Parse ascii string as nodelist |
57 | * int node_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | ||
58 | * int nodes_remap(dst, src, old, new) *dst = map(old, new)(dst) | ||
55 | * | 59 | * |
56 | * for_each_node_mask(node, mask) for-loop node over mask | 60 | * for_each_node_mask(node, mask) for-loop node over mask |
57 | * | 61 | * |
@@ -307,6 +311,22 @@ static inline int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits) | |||
307 | return bitmap_parselist(buf, dstp->bits, nbits); | 311 | return bitmap_parselist(buf, dstp->bits, nbits); |
308 | } | 312 | } |
309 | 313 | ||
314 | #define node_remap(oldbit, old, new) \ | ||
315 | __node_remap((oldbit), &(old), &(new), MAX_NUMNODES) | ||
316 | static inline int __node_remap(int oldbit, | ||
317 | const nodemask_t *oldp, const nodemask_t *newp, int nbits) | ||
318 | { | ||
319 | return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits); | ||
320 | } | ||
321 | |||
322 | #define nodes_remap(dst, src, old, new) \ | ||
323 | __nodes_remap(&(dst), &(src), &(old), &(new), MAX_NUMNODES) | ||
324 | static inline void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp, | ||
325 | const nodemask_t *oldp, const nodemask_t *newp, int nbits) | ||
326 | { | ||
327 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | ||
328 | } | ||
329 | |||
310 | #if MAX_NUMNODES > 1 | 330 | #if MAX_NUMNODES > 1 |
311 | #define for_each_node_mask(node, mask) \ | 331 | #define for_each_node_mask(node, mask) \ |
312 | for ((node) = first_node(mask); \ | 332 | for ((node) = first_node(mask); \ |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index acbf31c154f8..ba6c310a055f 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -21,16 +21,17 @@ | |||
21 | 21 | ||
22 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | 22 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
23 | { | 23 | { |
24 | return mapping->flags & __GFP_BITS_MASK; | 24 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; |
25 | } | 25 | } |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * This is non-atomic. Only to be used before the mapping is activated. | 28 | * This is non-atomic. Only to be used before the mapping is activated. |
29 | * Probably needs a barrier... | 29 | * Probably needs a barrier... |
30 | */ | 30 | */ |
31 | static inline void mapping_set_gfp_mask(struct address_space *m, int mask) | 31 | static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) |
32 | { | 32 | { |
33 | m->flags = (m->flags & ~__GFP_BITS_MASK) | mask; | 33 | m->flags = (m->flags & ~(__force unsigned long)__GFP_BITS_MASK) | |
34 | (__force unsigned long)mask; | ||
34 | } | 35 | } |
35 | 36 | ||
36 | /* | 37 | /* |
@@ -69,7 +70,7 @@ extern struct page * find_lock_page(struct address_space *mapping, | |||
69 | extern struct page * find_trylock_page(struct address_space *mapping, | 70 | extern struct page * find_trylock_page(struct address_space *mapping, |
70 | unsigned long index); | 71 | unsigned long index); |
71 | extern struct page * find_or_create_page(struct address_space *mapping, | 72 | extern struct page * find_or_create_page(struct address_space *mapping, |
72 | unsigned long index, unsigned int gfp_mask); | 73 | unsigned long index, gfp_t gfp_mask); |
73 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, | 74 | unsigned find_get_pages(struct address_space *mapping, pgoff_t start, |
74 | unsigned int nr_pages, struct page **pages); | 75 | unsigned int nr_pages, struct page **pages); |
75 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 76 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, |
@@ -92,9 +93,9 @@ extern int read_cache_pages(struct address_space *mapping, | |||
92 | struct list_head *pages, filler_t *filler, void *data); | 93 | struct list_head *pages, filler_t *filler, void *data); |
93 | 94 | ||
94 | int add_to_page_cache(struct page *page, struct address_space *mapping, | 95 | int add_to_page_cache(struct page *page, struct address_space *mapping, |
95 | unsigned long index, int gfp_mask); | 96 | unsigned long index, gfp_t gfp_mask); |
96 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, | 97 | int add_to_page_cache_lru(struct page *page, struct address_space *mapping, |
97 | unsigned long index, int gfp_mask); | 98 | unsigned long index, gfp_t gfp_mask); |
98 | extern void remove_from_page_cache(struct page *page); | 99 | extern void remove_from_page_cache(struct page *page); |
99 | extern void __remove_from_page_cache(struct page *page); | 100 | extern void __remove_from_page_cache(struct page *page); |
100 | 101 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 7349058ed778..3596ac94ecff 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -132,6 +132,7 @@ struct pci_dev { | |||
132 | unsigned int is_enabled:1; /* pci_enable_device has been called */ | 132 | unsigned int is_enabled:1; /* pci_enable_device has been called */ |
133 | unsigned int is_busmaster:1; /* device is busmaster */ | 133 | unsigned int is_busmaster:1; /* device is busmaster */ |
134 | unsigned int no_msi:1; /* device may not use msi */ | 134 | unsigned int no_msi:1; /* device may not use msi */ |
135 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | ||
135 | 136 | ||
136 | u32 saved_config_space[16]; /* config space saved at suspend time */ | 137 | u32 saved_config_space[16]; /* config space saved at suspend time */ |
137 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ | 138 | struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ |
@@ -490,6 +491,9 @@ extern void pci_disable_msix(struct pci_dev *dev); | |||
490 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 491 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
491 | #endif | 492 | #endif |
492 | 493 | ||
494 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | ||
495 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | ||
496 | |||
493 | /* | 497 | /* |
494 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 498 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
495 | * a PCI domain is defined to be a set of PCI busses which share | 499 | * a PCI domain is defined to be a set of PCI busses which share |
@@ -560,6 +564,9 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en | |||
560 | 564 | ||
561 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | 565 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) |
562 | 566 | ||
567 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } | ||
568 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } | ||
569 | |||
563 | #endif /* CONFIG_PCI */ | 570 | #endif /* CONFIG_PCI */ |
564 | 571 | ||
565 | /* Include architecture-dependent settings and functions */ | 572 | /* Include architecture-dependent settings and functions */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f74ed9462475..56192005fa4d 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -96,6 +96,9 @@ | |||
96 | #define PCI_CLASS_SERIAL_ACCESS 0x0c01 | 96 | #define PCI_CLASS_SERIAL_ACCESS 0x0c01 |
97 | #define PCI_CLASS_SERIAL_SSA 0x0c02 | 97 | #define PCI_CLASS_SERIAL_SSA 0x0c02 |
98 | #define PCI_CLASS_SERIAL_USB 0x0c03 | 98 | #define PCI_CLASS_SERIAL_USB 0x0c03 |
99 | #define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300 | ||
100 | #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 | ||
101 | #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 | ||
99 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 | 102 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 |
100 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 | 103 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 |
101 | 104 | ||
@@ -132,9 +135,6 @@ | |||
132 | 135 | ||
133 | #define PCI_VENDOR_ID_COMPAQ 0x0e11 | 136 | #define PCI_VENDOR_ID_COMPAQ 0x0e11 |
134 | #define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 | 137 | #define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 |
135 | #define PCI_DEVICE_ID_COMPAQ_1280 0x3033 | ||
136 | #define PCI_DEVICE_ID_COMPAQ_TRIFLEX 0x4000 | ||
137 | #define PCI_DEVICE_ID_COMPAQ_6010 0x6010 | ||
138 | #define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc | 138 | #define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc |
139 | #define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10 | 139 | #define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10 |
140 | #define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32 | 140 | #define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32 |
@@ -274,7 +274,6 @@ | |||
274 | #define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050 | 274 | #define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050 |
275 | #define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051 | 275 | #define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051 |
276 | #define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052 | 276 | #define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052 |
277 | #define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452 | ||
278 | #define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053 | 277 | #define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053 |
279 | #define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054 | 278 | #define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054 |
280 | #define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055 | 279 | #define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055 |
@@ -282,8 +281,6 @@ | |||
282 | #define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057 | 281 | #define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057 |
283 | #define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058 | 282 | #define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058 |
284 | /* Rage128 M4 */ | 283 | /* Rage128 M4 */ |
285 | #define PCI_DEVICE_ID_ATI_RADEON_LE 0x4d45 | ||
286 | #define PCI_DEVICE_ID_ATI_RADEON_LF 0x4d46 | ||
287 | /* Radeon R100 */ | 284 | /* Radeon R100 */ |
288 | #define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144 | 285 | #define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144 |
289 | #define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145 | 286 | #define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145 |
@@ -304,32 +301,22 @@ | |||
304 | #define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157 | 301 | #define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157 |
305 | #define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158 | 302 | #define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158 |
306 | /* Radeon NV-100 */ | 303 | /* Radeon NV-100 */ |
307 | #define PCI_DEVICE_ID_ATI_RADEON_N1 0x5159 | ||
308 | #define PCI_DEVICE_ID_ATI_RADEON_N2 0x515a | ||
309 | /* Radeon RV250 (9000) */ | 304 | /* Radeon RV250 (9000) */ |
310 | #define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964 | 305 | #define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964 |
311 | #define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965 | 306 | #define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965 |
312 | #define PCI_DEVICE_ID_ATI_RADEON_If 0x4966 | 307 | #define PCI_DEVICE_ID_ATI_RADEON_If 0x4966 |
313 | #define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967 | 308 | #define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967 |
314 | /* Radeon RV280 (9200) */ | 309 | /* Radeon RV280 (9200) */ |
315 | #define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960 | ||
316 | #define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961 | 310 | #define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961 |
317 | #define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964 | 311 | #define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964 |
318 | /* Radeon R300 (9500) */ | 312 | /* Radeon R300 (9500) */ |
319 | #define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144 | ||
320 | /* Radeon R300 (9700) */ | 313 | /* Radeon R300 (9700) */ |
321 | #define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44 | 314 | #define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44 |
322 | #define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45 | 315 | #define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45 |
323 | #define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46 | 316 | #define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46 |
324 | #define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47 | 317 | #define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47 |
325 | #define PCI_DEVICE_ID_ATI_RADEON_AE 0x4145 | ||
326 | #define PCI_DEVICE_ID_ATI_RADEON_AF 0x4146 | ||
327 | /* Radeon R350 (9800) */ | 318 | /* Radeon R350 (9800) */ |
328 | #define PCI_DEVICE_ID_ATI_RADEON_NH 0x4e48 | ||
329 | #define PCI_DEVICE_ID_ATI_RADEON_NI 0x4e49 | ||
330 | /* Radeon RV350 (9600) */ | 319 | /* Radeon RV350 (9600) */ |
331 | #define PCI_DEVICE_ID_ATI_RADEON_AP 0x4150 | ||
332 | #define PCI_DEVICE_ID_ATI_RADEON_AR 0x4152 | ||
333 | /* Radeon M6 */ | 320 | /* Radeon M6 */ |
334 | #define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59 | 321 | #define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59 |
335 | #define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a | 322 | #define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a |
@@ -342,10 +329,6 @@ | |||
342 | #define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66 | 329 | #define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66 |
343 | #define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67 | 330 | #define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67 |
344 | /* Radeon */ | 331 | /* Radeon */ |
345 | #define PCI_DEVICE_ID_ATI_RADEON_RA 0x5144 | ||
346 | #define PCI_DEVICE_ID_ATI_RADEON_RB 0x5145 | ||
347 | #define PCI_DEVICE_ID_ATI_RADEON_RC 0x5146 | ||
348 | #define PCI_DEVICE_ID_ATI_RADEON_RD 0x5147 | ||
349 | /* RadeonIGP */ | 332 | /* RadeonIGP */ |
350 | #define PCI_DEVICE_ID_ATI_RS100 0xcab0 | 333 | #define PCI_DEVICE_ID_ATI_RS100 0xcab0 |
351 | #define PCI_DEVICE_ID_ATI_RS200 0xcab2 | 334 | #define PCI_DEVICE_ID_ATI_RS200 0xcab2 |
@@ -446,45 +429,28 @@ | |||
446 | #define PCI_DEVICE_ID_CIRRUS_5465 0x00d6 | 429 | #define PCI_DEVICE_ID_CIRRUS_5465 0x00d6 |
447 | #define PCI_DEVICE_ID_CIRRUS_6729 0x1100 | 430 | #define PCI_DEVICE_ID_CIRRUS_6729 0x1100 |
448 | #define PCI_DEVICE_ID_CIRRUS_6832 0x1110 | 431 | #define PCI_DEVICE_ID_CIRRUS_6832 0x1110 |
449 | #define PCI_DEVICE_ID_CIRRUS_7542 0x1200 | ||
450 | #define PCI_DEVICE_ID_CIRRUS_7543 0x1202 | 432 | #define PCI_DEVICE_ID_CIRRUS_7543 0x1202 |
451 | #define PCI_DEVICE_ID_CIRRUS_7541 0x1204 | ||
452 | #define PCI_DEVICE_ID_CIRRUS_4610 0x6001 | 433 | #define PCI_DEVICE_ID_CIRRUS_4610 0x6001 |
453 | #define PCI_DEVICE_ID_CIRRUS_4612 0x6003 | 434 | #define PCI_DEVICE_ID_CIRRUS_4612 0x6003 |
454 | #define PCI_DEVICE_ID_CIRRUS_4615 0x6004 | 435 | #define PCI_DEVICE_ID_CIRRUS_4615 0x6004 |
455 | #define PCI_DEVICE_ID_CIRRUS_4281 0x6005 | ||
456 | 436 | ||
457 | #define PCI_VENDOR_ID_IBM 0x1014 | 437 | #define PCI_VENDOR_ID_IBM 0x1014 |
458 | #define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a | ||
459 | #define PCI_DEVICE_ID_IBM_TR 0x0018 | 438 | #define PCI_DEVICE_ID_IBM_TR 0x0018 |
460 | #define PCI_DEVICE_ID_IBM_82G2675 0x001d | ||
461 | #define PCI_DEVICE_ID_IBM_MCA 0x0020 | ||
462 | #define PCI_DEVICE_ID_IBM_82351 0x0022 | ||
463 | #define PCI_DEVICE_ID_IBM_PYTHON 0x002d | ||
464 | #define PCI_DEVICE_ID_IBM_SERVERAID 0x002e | ||
465 | #define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e | 439 | #define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e |
466 | #define PCI_DEVICE_ID_IBM_MPIC 0x0046 | ||
467 | #define PCI_DEVICE_ID_IBM_3780IDSP 0x007d | ||
468 | #define PCI_DEVICE_ID_IBM_CHUKAR 0x0096 | ||
469 | #define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc | 440 | #define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc |
470 | #define PCI_DEVICE_ID_IBM_CPC710_PCI32 0x0105 | ||
471 | #define PCI_DEVICE_ID_IBM_405GP 0x0156 | ||
472 | #define PCI_DEVICE_ID_IBM_SNIPE 0x0180 | 441 | #define PCI_DEVICE_ID_IBM_SNIPE 0x0180 |
473 | #define PCI_DEVICE_ID_IBM_SERVERAIDI960 0x01bd | ||
474 | #define PCI_DEVICE_ID_IBM_CITRINE 0x028C | 442 | #define PCI_DEVICE_ID_IBM_CITRINE 0x028C |
475 | #define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166 | 443 | #define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166 |
476 | #define PCI_DEVICE_ID_IBM_MPIC_2 0xffff | ||
477 | #define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031 | 444 | #define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031 |
478 | #define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219 | 445 | #define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219 |
479 | #define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A | 446 | #define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A |
480 | #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251 | 447 | #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251 |
481 | #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 | 448 | #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 |
482 | 449 | ||
483 | #define PCI_VENDOR_ID_COMPEX2 0x101a // pci.ids says "AT&T GIS (NCR)" | 450 | #define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ |
484 | #define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 | 451 | #define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 |
485 | 452 | ||
486 | #define PCI_VENDOR_ID_WD 0x101c | 453 | #define PCI_VENDOR_ID_WD 0x101c |
487 | #define PCI_DEVICE_ID_WD_7197 0x3296 | ||
488 | #define PCI_DEVICE_ID_WD_90C 0xc24a | 454 | #define PCI_DEVICE_ID_WD_90C 0xc24a |
489 | 455 | ||
490 | #define PCI_VENDOR_ID_AMI 0x101e | 456 | #define PCI_VENDOR_ID_AMI 0x101e |
@@ -501,33 +467,18 @@ | |||
501 | #define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006 | 467 | #define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006 |
502 | #define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007 | 468 | #define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007 |
503 | #define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C | 469 | #define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C |
504 | #define PCI_DEVICE_ID_AMD_FE_GATE_700D 0x700D | ||
505 | #define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E | 470 | #define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E |
506 | #define PCI_DEVICE_ID_AMD_FE_GATE_700F 0x700F | ||
507 | #define PCI_DEVICE_ID_AMD_COBRA_7400 0x7400 | ||
508 | #define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401 | 471 | #define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401 |
509 | #define PCI_DEVICE_ID_AMD_COBRA_7403 0x7403 | ||
510 | #define PCI_DEVICE_ID_AMD_COBRA_7404 0x7404 | ||
511 | #define PCI_DEVICE_ID_AMD_VIPER_7408 0x7408 | ||
512 | #define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409 | 472 | #define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409 |
513 | #define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B | 473 | #define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B |
514 | #define PCI_DEVICE_ID_AMD_VIPER_740C 0x740C | ||
515 | #define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410 | 474 | #define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410 |
516 | #define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411 | 475 | #define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411 |
517 | #define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413 | 476 | #define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413 |
518 | #define PCI_DEVICE_ID_AMD_VIPER_7414 0x7414 | 477 | #define PCI_DEVICE_ID_AMD_VIPER_7440 0x7440 |
519 | #define PCI_DEVICE_ID_AMD_OPUS_7440 0x7440 | ||
520 | # define PCI_DEVICE_ID_AMD_VIPER_7440 PCI_DEVICE_ID_AMD_OPUS_7440 | ||
521 | #define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441 | 478 | #define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441 |
522 | # define PCI_DEVICE_ID_AMD_VIPER_7441 PCI_DEVICE_ID_AMD_OPUS_7441 | ||
523 | #define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443 | 479 | #define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443 |
524 | # define PCI_DEVICE_ID_AMD_VIPER_7443 PCI_DEVICE_ID_AMD_OPUS_7443 | 480 | #define PCI_DEVICE_ID_AMD_VIPER_7443 0x7443 |
525 | #define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445 | 481 | #define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445 |
526 | #define PCI_DEVICE_ID_AMD_OPUS_7448 0x7448 | ||
527 | # define PCI_DEVICE_ID_AMD_VIPER_7448 PCI_DEVICE_ID_AMD_OPUS_7448 | ||
528 | #define PCI_DEVICE_ID_AMD_OPUS_7449 0x7449 | ||
529 | # define PCI_DEVICE_ID_AMD_VIPER_7449 PCI_DEVICE_ID_AMD_OPUS_7449 | ||
530 | #define PCI_DEVICE_ID_AMD_8111_LAN 0x7462 | ||
531 | #define PCI_DEVICE_ID_AMD_8111_LPC 0x7468 | 482 | #define PCI_DEVICE_ID_AMD_8111_LPC 0x7468 |
532 | #define PCI_DEVICE_ID_AMD_8111_IDE 0x7469 | 483 | #define PCI_DEVICE_ID_AMD_8111_IDE 0x7469 |
533 | #define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a | 484 | #define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a |
@@ -585,7 +536,6 @@ | |||
585 | #define PCI_DEVICE_ID_CT_65550 0x00e0 | 536 | #define PCI_DEVICE_ID_CT_65550 0x00e0 |
586 | #define PCI_DEVICE_ID_CT_65554 0x00e4 | 537 | #define PCI_DEVICE_ID_CT_65554 0x00e4 |
587 | #define PCI_DEVICE_ID_CT_65555 0x00e5 | 538 | #define PCI_DEVICE_ID_CT_65555 0x00e5 |
588 | #define PCI_DEVICE_ID_CT_69000 0x00c0 | ||
589 | 539 | ||
590 | #define PCI_VENDOR_ID_MIRO 0x1031 | 540 | #define PCI_VENDOR_ID_MIRO 0x1031 |
591 | #define PCI_DEVICE_ID_MIRO_36050 0x5601 | 541 | #define PCI_DEVICE_ID_MIRO_36050 0x5601 |
@@ -639,7 +589,6 @@ | |||
639 | #define PCI_DEVICE_ID_SI_550 0x0550 | 589 | #define PCI_DEVICE_ID_SI_550 0x0550 |
640 | #define PCI_DEVICE_ID_SI_540_VGA 0x5300 | 590 | #define PCI_DEVICE_ID_SI_540_VGA 0x5300 |
641 | #define PCI_DEVICE_ID_SI_550_VGA 0x5315 | 591 | #define PCI_DEVICE_ID_SI_550_VGA 0x5315 |
642 | #define PCI_DEVICE_ID_SI_601 0x0601 | ||
643 | #define PCI_DEVICE_ID_SI_620 0x0620 | 592 | #define PCI_DEVICE_ID_SI_620 0x0620 |
644 | #define PCI_DEVICE_ID_SI_630 0x0630 | 593 | #define PCI_DEVICE_ID_SI_630 0x0630 |
645 | #define PCI_DEVICE_ID_SI_633 0x0633 | 594 | #define PCI_DEVICE_ID_SI_633 0x0633 |
@@ -650,30 +599,22 @@ | |||
650 | #define PCI_DEVICE_ID_SI_648 0x0648 | 599 | #define PCI_DEVICE_ID_SI_648 0x0648 |
651 | #define PCI_DEVICE_ID_SI_650 0x0650 | 600 | #define PCI_DEVICE_ID_SI_650 0x0650 |
652 | #define PCI_DEVICE_ID_SI_651 0x0651 | 601 | #define PCI_DEVICE_ID_SI_651 0x0651 |
653 | #define PCI_DEVICE_ID_SI_652 0x0652 | ||
654 | #define PCI_DEVICE_ID_SI_655 0x0655 | 602 | #define PCI_DEVICE_ID_SI_655 0x0655 |
655 | #define PCI_DEVICE_ID_SI_661 0x0661 | 603 | #define PCI_DEVICE_ID_SI_661 0x0661 |
656 | #define PCI_DEVICE_ID_SI_730 0x0730 | 604 | #define PCI_DEVICE_ID_SI_730 0x0730 |
657 | #define PCI_DEVICE_ID_SI_733 0x0733 | 605 | #define PCI_DEVICE_ID_SI_733 0x0733 |
658 | #define PCI_DEVICE_ID_SI_630_VGA 0x6300 | 606 | #define PCI_DEVICE_ID_SI_630_VGA 0x6300 |
659 | #define PCI_DEVICE_ID_SI_730_VGA 0x7300 | ||
660 | #define PCI_DEVICE_ID_SI_735 0x0735 | 607 | #define PCI_DEVICE_ID_SI_735 0x0735 |
661 | #define PCI_DEVICE_ID_SI_740 0x0740 | 608 | #define PCI_DEVICE_ID_SI_740 0x0740 |
662 | #define PCI_DEVICE_ID_SI_741 0x0741 | 609 | #define PCI_DEVICE_ID_SI_741 0x0741 |
663 | #define PCI_DEVICE_ID_SI_745 0x0745 | 610 | #define PCI_DEVICE_ID_SI_745 0x0745 |
664 | #define PCI_DEVICE_ID_SI_746 0x0746 | 611 | #define PCI_DEVICE_ID_SI_746 0x0746 |
665 | #define PCI_DEVICE_ID_SI_748 0x0748 | ||
666 | #define PCI_DEVICE_ID_SI_750 0x0750 | ||
667 | #define PCI_DEVICE_ID_SI_751 0x0751 | ||
668 | #define PCI_DEVICE_ID_SI_752 0x0752 | ||
669 | #define PCI_DEVICE_ID_SI_755 0x0755 | 612 | #define PCI_DEVICE_ID_SI_755 0x0755 |
670 | #define PCI_DEVICE_ID_SI_760 0x0760 | 613 | #define PCI_DEVICE_ID_SI_760 0x0760 |
671 | #define PCI_DEVICE_ID_SI_900 0x0900 | 614 | #define PCI_DEVICE_ID_SI_900 0x0900 |
672 | #define PCI_DEVICE_ID_SI_961 0x0961 | 615 | #define PCI_DEVICE_ID_SI_961 0x0961 |
673 | #define PCI_DEVICE_ID_SI_962 0x0962 | 616 | #define PCI_DEVICE_ID_SI_962 0x0962 |
674 | #define PCI_DEVICE_ID_SI_963 0x0963 | 617 | #define PCI_DEVICE_ID_SI_963 0x0963 |
675 | #define PCI_DEVICE_ID_SI_5107 0x5107 | ||
676 | #define PCI_DEVICE_ID_SI_5300 0x5300 | ||
677 | #define PCI_DEVICE_ID_SI_5511 0x5511 | 618 | #define PCI_DEVICE_ID_SI_5511 0x5511 |
678 | #define PCI_DEVICE_ID_SI_5513 0x5513 | 619 | #define PCI_DEVICE_ID_SI_5513 0x5513 |
679 | #define PCI_DEVICE_ID_SI_5518 0x5518 | 620 | #define PCI_DEVICE_ID_SI_5518 0x5518 |
@@ -685,10 +626,6 @@ | |||
685 | #define PCI_DEVICE_ID_SI_5597 0x5597 | 626 | #define PCI_DEVICE_ID_SI_5597 0x5597 |
686 | #define PCI_DEVICE_ID_SI_5598 0x5598 | 627 | #define PCI_DEVICE_ID_SI_5598 0x5598 |
687 | #define PCI_DEVICE_ID_SI_5600 0x5600 | 628 | #define PCI_DEVICE_ID_SI_5600 0x5600 |
688 | #define PCI_DEVICE_ID_SI_6300 0x6300 | ||
689 | #define PCI_DEVICE_ID_SI_6306 0x6306 | ||
690 | #define PCI_DEVICE_ID_SI_6326 0x6326 | ||
691 | #define PCI_DEVICE_ID_SI_7001 0x7001 | ||
692 | #define PCI_DEVICE_ID_SI_7012 0x7012 | 629 | #define PCI_DEVICE_ID_SI_7012 0x7012 |
693 | #define PCI_DEVICE_ID_SI_7013 0x7013 | 630 | #define PCI_DEVICE_ID_SI_7013 0x7013 |
694 | #define PCI_DEVICE_ID_SI_7016 0x7016 | 631 | #define PCI_DEVICE_ID_SI_7016 0x7016 |
@@ -709,23 +646,19 @@ | |||
709 | #define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 | 646 | #define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 |
710 | #define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A | 647 | #define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A |
711 | #define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B | 648 | #define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B |
712 | #define PCI_DEVICE_ID_HP_PCI_LBA 0x1054 | ||
713 | #define PCI_DEVICE_ID_HP_REO_SBA 0x10f0 | ||
714 | #define PCI_DEVICE_ID_HP_REO_IOC 0x10f1 | 649 | #define PCI_DEVICE_ID_HP_REO_IOC 0x10f1 |
715 | #define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b | 650 | #define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b |
716 | #define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223 | 651 | #define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223 |
717 | #define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226 | 652 | #define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226 |
718 | #define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227 | 653 | #define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227 |
719 | #define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229 | ||
720 | #define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a | 654 | #define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a |
721 | #define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e | 655 | #define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e |
722 | #define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c | 656 | #define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c |
723 | #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 | 657 | #define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 |
724 | #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 | 658 | #define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 |
725 | #define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 | 659 | #define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 |
726 | #define PCI_DEVICE_ID_HP_CISS 0x3210 | 660 | #define PCI_DEVICE_ID_HP_DIVA_HURRICANE 0x132a |
727 | #define PCI_DEVICE_ID_HP_CISSA 0x3220 | 661 | #define PCI_DEVICE_ID_HP_CISSA 0x3220 |
728 | #define PCI_DEVICE_ID_HP_CISSB 0x3222 | ||
729 | #define PCI_DEVICE_ID_HP_CISSC 0x3230 | 662 | #define PCI_DEVICE_ID_HP_CISSC 0x3230 |
730 | #define PCI_DEVICE_ID_HP_CISSD 0x3238 | 663 | #define PCI_DEVICE_ID_HP_CISSD 0x3238 |
731 | #define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 | 664 | #define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 |
@@ -733,8 +666,6 @@ | |||
733 | #define PCI_VENDOR_ID_PCTECH 0x1042 | 666 | #define PCI_VENDOR_ID_PCTECH 0x1042 |
734 | #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 | 667 | #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 |
735 | #define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001 | 668 | #define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001 |
736 | #define PCI_DEVICE_ID_PCTECH_SAMURAI_0 0x3000 | ||
737 | #define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010 | ||
738 | #define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020 | 669 | #define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020 |
739 | 670 | ||
740 | #define PCI_VENDOR_ID_ASUSTEK 0x1043 | 671 | #define PCI_VENDOR_ID_ASUSTEK 0x1043 |
@@ -744,24 +675,15 @@ | |||
744 | #define PCI_DEVICE_ID_DPT 0xa400 | 675 | #define PCI_DEVICE_ID_DPT 0xa400 |
745 | 676 | ||
746 | #define PCI_VENDOR_ID_OPTI 0x1045 | 677 | #define PCI_VENDOR_ID_OPTI 0x1045 |
747 | #define PCI_DEVICE_ID_OPTI_92C178 0xc178 | ||
748 | #define PCI_DEVICE_ID_OPTI_82C557 0xc557 | ||
749 | #define PCI_DEVICE_ID_OPTI_82C558 0xc558 | 678 | #define PCI_DEVICE_ID_OPTI_82C558 0xc558 |
750 | #define PCI_DEVICE_ID_OPTI_82C621 0xc621 | 679 | #define PCI_DEVICE_ID_OPTI_82C621 0xc621 |
751 | #define PCI_DEVICE_ID_OPTI_82C700 0xc700 | 680 | #define PCI_DEVICE_ID_OPTI_82C700 0xc700 |
752 | #define PCI_DEVICE_ID_OPTI_82C701 0xc701 | ||
753 | #define PCI_DEVICE_ID_OPTI_82C814 0xc814 | ||
754 | #define PCI_DEVICE_ID_OPTI_82C822 0xc822 | ||
755 | #define PCI_DEVICE_ID_OPTI_82C861 0xc861 | ||
756 | #define PCI_DEVICE_ID_OPTI_82C825 0xd568 | 681 | #define PCI_DEVICE_ID_OPTI_82C825 0xd568 |
757 | 682 | ||
758 | #define PCI_VENDOR_ID_ELSA 0x1048 | 683 | #define PCI_VENDOR_ID_ELSA 0x1048 |
759 | #define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 | 684 | #define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 |
760 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 | 685 | #define PCI_DEVICE_ID_ELSA_QS3000 0x3000 |
761 | 686 | ||
762 | #define PCI_VENDOR_ID_SGS 0x104a | ||
763 | #define PCI_DEVICE_ID_SGS_2000 0x0008 | ||
764 | #define PCI_DEVICE_ID_SGS_1764 0x0009 | ||
765 | 687 | ||
766 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B | 688 | #define PCI_VENDOR_ID_BUSLOGIC 0x104B |
767 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 | 689 | #define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 |
@@ -769,7 +691,6 @@ | |||
769 | #define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130 | 691 | #define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130 |
770 | 692 | ||
771 | #define PCI_VENDOR_ID_TI 0x104c | 693 | #define PCI_VENDOR_ID_TI 0x104c |
772 | #define PCI_DEVICE_ID_TI_TVP4010 0x3d04 | ||
773 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 | 694 | #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 |
774 | #define PCI_DEVICE_ID_TI_4450 0x8011 | 695 | #define PCI_DEVICE_ID_TI_4450 0x8011 |
775 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 | 696 | #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 |
@@ -803,14 +724,10 @@ | |||
803 | #define PCI_DEVICE_ID_TI_X420 0xac8e | 724 | #define PCI_DEVICE_ID_TI_X420 0xac8e |
804 | 725 | ||
805 | #define PCI_VENDOR_ID_SONY 0x104d | 726 | #define PCI_VENDOR_ID_SONY 0x104d |
806 | #define PCI_DEVICE_ID_SONY_CXD3222 0x8039 | ||
807 | 727 | ||
808 | #define PCI_VENDOR_ID_OAK 0x104e | ||
809 | #define PCI_DEVICE_ID_OAK_OTI107 0x0107 | ||
810 | 728 | ||
811 | /* Winbond have two vendor IDs! See 0x10ad as well */ | 729 | /* Winbond have two vendor IDs! See 0x10ad as well */ |
812 | #define PCI_VENDOR_ID_WINBOND2 0x1050 | 730 | #define PCI_VENDOR_ID_WINBOND2 0x1050 |
813 | #define PCI_DEVICE_ID_WINBOND2_89C940 0x0940 | ||
814 | #define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a | 731 | #define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a |
815 | #define PCI_DEVICE_ID_WINBOND2_6692 0x6692 | 732 | #define PCI_DEVICE_ID_WINBOND2_6692 0x6692 |
816 | 733 | ||
@@ -819,19 +736,15 @@ | |||
819 | 736 | ||
820 | #define PCI_VENDOR_ID_EFAR 0x1055 | 737 | #define PCI_VENDOR_ID_EFAR 0x1055 |
821 | #define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 | 738 | #define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 |
822 | #define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460 | ||
823 | #define PCI_DEVICE_ID_EFAR_SLC90E66_2 0x9462 | ||
824 | #define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 | 739 | #define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 |
825 | 740 | ||
826 | #define PCI_VENDOR_ID_MOTOROLA 0x1057 | 741 | #define PCI_VENDOR_ID_MOTOROLA 0x1057 |
827 | #define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507 | ||
828 | #define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001 | 742 | #define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001 |
829 | #define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 | 743 | #define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 |
830 | #define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004 | 744 | #define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004 |
831 | #define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 | 745 | #define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 |
832 | #define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802 | 746 | #define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802 |
833 | #define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 | 747 | #define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 |
834 | #define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806 | ||
835 | #define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b | 748 | #define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b |
836 | #define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 | 749 | #define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 |
837 | 750 | ||
@@ -842,33 +755,19 @@ | |||
842 | #define PCI_DEVICE_ID_PROMISE_20262 0x4d38 | 755 | #define PCI_DEVICE_ID_PROMISE_20262 0x4d38 |
843 | #define PCI_DEVICE_ID_PROMISE_20263 0x0D38 | 756 | #define PCI_DEVICE_ID_PROMISE_20263 0x0D38 |
844 | #define PCI_DEVICE_ID_PROMISE_20268 0x4d68 | 757 | #define PCI_DEVICE_ID_PROMISE_20268 0x4d68 |
845 | #define PCI_DEVICE_ID_PROMISE_20268R 0x6268 | ||
846 | #define PCI_DEVICE_ID_PROMISE_20269 0x4d69 | 758 | #define PCI_DEVICE_ID_PROMISE_20269 0x4d69 |
847 | #define PCI_DEVICE_ID_PROMISE_20270 0x6268 | 759 | #define PCI_DEVICE_ID_PROMISE_20270 0x6268 |
848 | #define PCI_DEVICE_ID_PROMISE_20271 0x6269 | 760 | #define PCI_DEVICE_ID_PROMISE_20271 0x6269 |
849 | #define PCI_DEVICE_ID_PROMISE_20275 0x1275 | 761 | #define PCI_DEVICE_ID_PROMISE_20275 0x1275 |
850 | #define PCI_DEVICE_ID_PROMISE_20276 0x5275 | 762 | #define PCI_DEVICE_ID_PROMISE_20276 0x5275 |
851 | #define PCI_DEVICE_ID_PROMISE_20277 0x7275 | 763 | #define PCI_DEVICE_ID_PROMISE_20277 0x7275 |
852 | #define PCI_DEVICE_ID_PROMISE_5300 0x5300 | ||
853 | 764 | ||
854 | #define PCI_VENDOR_ID_N9 0x105d | ||
855 | #define PCI_DEVICE_ID_N9_I128 0x2309 | ||
856 | #define PCI_DEVICE_ID_N9_I128_2 0x2339 | ||
857 | #define PCI_DEVICE_ID_N9_I128_T2R 0x493d | ||
858 | 765 | ||
859 | #define PCI_VENDOR_ID_UMC 0x1060 | 766 | #define PCI_VENDOR_ID_UMC 0x1060 |
860 | #define PCI_DEVICE_ID_UMC_UM8673F 0x0101 | 767 | #define PCI_DEVICE_ID_UMC_UM8673F 0x0101 |
861 | #define PCI_DEVICE_ID_UMC_UM8891A 0x0891 | ||
862 | #define PCI_DEVICE_ID_UMC_UM8886BF 0x673a | 768 | #define PCI_DEVICE_ID_UMC_UM8886BF 0x673a |
863 | #define PCI_DEVICE_ID_UMC_UM8886A 0x886a | 769 | #define PCI_DEVICE_ID_UMC_UM8886A 0x886a |
864 | #define PCI_DEVICE_ID_UMC_UM8881F 0x8881 | ||
865 | #define PCI_DEVICE_ID_UMC_UM8886F 0x8886 | ||
866 | #define PCI_DEVICE_ID_UMC_UM9017F 0x9017 | ||
867 | #define PCI_DEVICE_ID_UMC_UM8886N 0xe886 | ||
868 | #define PCI_DEVICE_ID_UMC_UM8891N 0xe891 | ||
869 | 770 | ||
870 | #define PCI_VENDOR_ID_X 0x1061 | ||
871 | #define PCI_DEVICE_ID_X_AGX016 0x0001 | ||
872 | 771 | ||
873 | #define PCI_VENDOR_ID_MYLEX 0x1069 | 772 | #define PCI_VENDOR_ID_MYLEX 0x1069 |
874 | #define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001 | 773 | #define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001 |
@@ -879,37 +778,26 @@ | |||
879 | #define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 | 778 | #define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 |
880 | #define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 | 779 | #define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 |
881 | 780 | ||
882 | #define PCI_VENDOR_ID_PICOP 0x1066 | ||
883 | #define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001 | ||
884 | #define PCI_DEVICE_ID_PICOP_PT80C524 0x8002 | ||
885 | 781 | ||
886 | #define PCI_VENDOR_ID_APPLE 0x106b | 782 | #define PCI_VENDOR_ID_APPLE 0x106b |
887 | #define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 | 783 | #define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 |
888 | #define PCI_DEVICE_ID_APPLE_GC 0x0002 | ||
889 | #define PCI_DEVICE_ID_APPLE_HYDRA 0x000e | 784 | #define PCI_DEVICE_ID_APPLE_HYDRA 0x000e |
890 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018 | 785 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018 |
891 | #define PCI_DEVICE_ID_APPLE_KL_USB 0x0019 | ||
892 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020 | 786 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020 |
893 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021 | 787 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021 |
894 | #define PCI_DEVICE_ID_APPLE_KEYLARGO 0x0022 | ||
895 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024 | 788 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024 |
896 | #define PCI_DEVICE_ID_APPLE_KEYLARGO_P 0x0025 | ||
897 | #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 | ||
898 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 | 789 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 |
899 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d | 790 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d |
900 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e | 791 | #define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e |
901 | #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 | ||
902 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 | 792 | #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 |
903 | #define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033 | 793 | #define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033 |
904 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 | 794 | #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 |
905 | #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b | 795 | #define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b |
906 | #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e | ||
907 | #define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043 | 796 | #define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043 |
908 | #define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b | 797 | #define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b |
909 | #define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c | 798 | #define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c |
910 | #define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050 | 799 | #define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050 |
911 | #define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 | 800 | #define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 |
912 | #define PCI_DEVICE_ID_APPLE_SH_FW 0x0052 | ||
913 | #define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 | 801 | #define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 |
914 | #define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 | 802 | #define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 |
915 | #define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 | 803 | #define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 |
@@ -922,12 +810,9 @@ | |||
922 | #define PCI_DEVICE_ID_YAMAHA_744 0x0010 | 810 | #define PCI_DEVICE_ID_YAMAHA_744 0x0010 |
923 | #define PCI_DEVICE_ID_YAMAHA_754 0x0012 | 811 | #define PCI_DEVICE_ID_YAMAHA_754 0x0012 |
924 | 812 | ||
925 | #define PCI_VENDOR_ID_NEXGEN 0x1074 | ||
926 | #define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78 | ||
927 | 813 | ||
928 | #define PCI_VENDOR_ID_QLOGIC 0x1077 | 814 | #define PCI_VENDOR_ID_QLOGIC 0x1077 |
929 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 | 815 | #define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 |
930 | #define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022 | ||
931 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 | 816 | #define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 |
932 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 | 817 | #define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 |
933 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 | 818 | #define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 |
@@ -945,32 +830,20 @@ | |||
945 | #define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001 | 830 | #define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001 |
946 | #define PCI_DEVICE_ID_CYRIX_5520 0x0002 | 831 | #define PCI_DEVICE_ID_CYRIX_5520 0x0002 |
947 | #define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100 | 832 | #define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100 |
948 | #define PCI_DEVICE_ID_CYRIX_5530_SMI 0x0101 | ||
949 | #define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102 | 833 | #define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102 |
950 | #define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 | 834 | #define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 |
951 | #define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 | 835 | #define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 |
952 | 836 | ||
953 | #define PCI_VENDOR_ID_LEADTEK 0x107d | ||
954 | #define PCI_DEVICE_ID_LEADTEK_805 0x0000 | ||
955 | 837 | ||
956 | #define PCI_VENDOR_ID_INTERPHASE 0x107e | ||
957 | #define PCI_DEVICE_ID_INTERPHASE_5526 0x0004 | ||
958 | #define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005 | ||
959 | #define PCI_DEVICE_ID_INTERPHASE_5575 0x0008 | ||
960 | 838 | ||
961 | #define PCI_VENDOR_ID_CONTAQ 0x1080 | 839 | #define PCI_VENDOR_ID_CONTAQ 0x1080 |
962 | #define PCI_DEVICE_ID_CONTAQ_82C599 0x0600 | ||
963 | #define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 | 840 | #define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 |
964 | 841 | ||
965 | #define PCI_VENDOR_ID_FOREX 0x1083 | ||
966 | 842 | ||
967 | #define PCI_VENDOR_ID_OLICOM 0x108d | 843 | #define PCI_VENDOR_ID_OLICOM 0x108d |
968 | #define PCI_DEVICE_ID_OLICOM_OC3136 0x0001 | ||
969 | #define PCI_DEVICE_ID_OLICOM_OC2315 0x0011 | ||
970 | #define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 | 844 | #define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 |
971 | #define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 | 845 | #define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 |
972 | #define PCI_DEVICE_ID_OLICOM_OC2326 0x0014 | 846 | #define PCI_DEVICE_ID_OLICOM_OC2326 0x0014 |
973 | #define PCI_DEVICE_ID_OLICOM_OC6151 0x0021 | ||
974 | 847 | ||
975 | #define PCI_VENDOR_ID_SUN 0x108e | 848 | #define PCI_VENDOR_ID_SUN 0x108e |
976 | #define PCI_DEVICE_ID_SUN_EBUS 0x1000 | 849 | #define PCI_DEVICE_ID_SUN_EBUS 0x1000 |
@@ -989,49 +862,31 @@ | |||
989 | #define PCI_DEVICE_ID_SUN_CASSINI 0xabba | 862 | #define PCI_DEVICE_ID_SUN_CASSINI 0xabba |
990 | 863 | ||
991 | #define PCI_VENDOR_ID_CMD 0x1095 | 864 | #define PCI_VENDOR_ID_CMD 0x1095 |
992 | #define PCI_DEVICE_ID_CMD_640 0x0640 | ||
993 | #define PCI_DEVICE_ID_CMD_643 0x0643 | 865 | #define PCI_DEVICE_ID_CMD_643 0x0643 |
994 | #define PCI_DEVICE_ID_CMD_646 0x0646 | 866 | #define PCI_DEVICE_ID_CMD_646 0x0646 |
995 | #define PCI_DEVICE_ID_CMD_647 0x0647 | ||
996 | #define PCI_DEVICE_ID_CMD_648 0x0648 | 867 | #define PCI_DEVICE_ID_CMD_648 0x0648 |
997 | #define PCI_DEVICE_ID_CMD_649 0x0649 | 868 | #define PCI_DEVICE_ID_CMD_649 0x0649 |
998 | #define PCI_DEVICE_ID_CMD_670 0x0670 | ||
999 | #define PCI_DEVICE_ID_CMD_680 0x0680 | ||
1000 | 869 | ||
1001 | #define PCI_DEVICE_ID_SII_680 0x0680 | 870 | #define PCI_DEVICE_ID_SII_680 0x0680 |
1002 | #define PCI_DEVICE_ID_SII_3112 0x3112 | 871 | #define PCI_DEVICE_ID_SII_3112 0x3112 |
1003 | #define PCI_DEVICE_ID_SII_1210SA 0x0240 | 872 | #define PCI_DEVICE_ID_SII_1210SA 0x0240 |
1004 | 873 | ||
1005 | #define PCI_VENDOR_ID_VISION 0x1098 | ||
1006 | #define PCI_DEVICE_ID_VISION_QD8500 0x0001 | ||
1007 | #define PCI_DEVICE_ID_VISION_QD8580 0x0002 | ||
1008 | 874 | ||
1009 | #define PCI_VENDOR_ID_BROOKTREE 0x109e | 875 | #define PCI_VENDOR_ID_BROOKTREE 0x109e |
1010 | #define PCI_DEVICE_ID_BROOKTREE_848 0x0350 | ||
1011 | #define PCI_DEVICE_ID_BROOKTREE_849A 0x0351 | ||
1012 | #define PCI_DEVICE_ID_BROOKTREE_878_1 0x036e | ||
1013 | #define PCI_DEVICE_ID_BROOKTREE_878 0x0878 | 876 | #define PCI_DEVICE_ID_BROOKTREE_878 0x0878 |
1014 | #define PCI_DEVICE_ID_BROOKTREE_879 0x0879 | 877 | #define PCI_DEVICE_ID_BROOKTREE_879 0x0879 |
1015 | #define PCI_DEVICE_ID_BROOKTREE_8474 0x8474 | ||
1016 | 878 | ||
1017 | #define PCI_VENDOR_ID_SIERRA 0x10a8 | ||
1018 | #define PCI_DEVICE_ID_SIERRA_STB 0x0000 | ||
1019 | 879 | ||
1020 | #define PCI_VENDOR_ID_SGI 0x10a9 | 880 | #define PCI_VENDOR_ID_SGI 0x10a9 |
1021 | #define PCI_DEVICE_ID_SGI_IOC3 0x0003 | 881 | #define PCI_DEVICE_ID_SGI_IOC3 0x0003 |
1022 | #define PCI_DEVICE_ID_SGI_IOC4 0x100a | 882 | #define PCI_DEVICE_ID_SGI_IOC4 0x100a |
1023 | #define PCI_VENDOR_ID_SGI_LITHIUM 0x1002 | 883 | #define PCI_VENDOR_ID_SGI_LITHIUM 0x1002 |
1024 | 884 | ||
1025 | #define PCI_VENDOR_ID_ACC 0x10aa | ||
1026 | #define PCI_DEVICE_ID_ACC_2056 0x0000 | ||
1027 | 885 | ||
1028 | #define PCI_VENDOR_ID_WINBOND 0x10ad | 886 | #define PCI_VENDOR_ID_WINBOND 0x10ad |
1029 | #define PCI_DEVICE_ID_WINBOND_83769 0x0001 | ||
1030 | #define PCI_DEVICE_ID_WINBOND_82C105 0x0105 | 887 | #define PCI_DEVICE_ID_WINBOND_82C105 0x0105 |
1031 | #define PCI_DEVICE_ID_WINBOND_83C553 0x0565 | 888 | #define PCI_DEVICE_ID_WINBOND_83C553 0x0565 |
1032 | 889 | ||
1033 | #define PCI_VENDOR_ID_DATABOOK 0x10b3 | ||
1034 | #define PCI_DEVICE_ID_DATABOOK_87144 0xb106 | ||
1035 | 890 | ||
1036 | #define PCI_VENDOR_ID_PLX 0x10b5 | 891 | #define PCI_VENDOR_ID_PLX 0x10b5 |
1037 | #define PCI_DEVICE_ID_PLX_R685 0x1030 | 892 | #define PCI_DEVICE_ID_PLX_R685 0x1030 |
@@ -1042,33 +897,19 @@ | |||
1042 | #define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 | 897 | #define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 |
1043 | #define PCI_DEVICE_ID_PLX_R753 0x1152 | 898 | #define PCI_DEVICE_ID_PLX_R753 0x1152 |
1044 | #define PCI_DEVICE_ID_PLX_OLITEC 0x1187 | 899 | #define PCI_DEVICE_ID_PLX_OLITEC 0x1187 |
1045 | #define PCI_DEVICE_ID_PLX_9030 0x9030 | ||
1046 | #define PCI_DEVICE_ID_PLX_9050 0x9050 | 900 | #define PCI_DEVICE_ID_PLX_9050 0x9050 |
1047 | #define PCI_DEVICE_ID_PLX_9060 0x9060 | ||
1048 | #define PCI_DEVICE_ID_PLX_9060ES 0x906E | ||
1049 | #define PCI_DEVICE_ID_PLX_9060SD 0x906D | ||
1050 | #define PCI_DEVICE_ID_PLX_9080 0x9080 | 901 | #define PCI_DEVICE_ID_PLX_9080 0x9080 |
1051 | #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 | 902 | #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 |
1052 | 903 | ||
1053 | #define PCI_VENDOR_ID_MADGE 0x10b6 | 904 | #define PCI_VENDOR_ID_MADGE 0x10b6 |
1054 | #define PCI_DEVICE_ID_MADGE_MK2 0x0002 | 905 | #define PCI_DEVICE_ID_MADGE_MK2 0x0002 |
1055 | #define PCI_DEVICE_ID_MADGE_C155S 0x1001 | ||
1056 | 906 | ||
1057 | #define PCI_VENDOR_ID_3COM 0x10b7 | 907 | #define PCI_VENDOR_ID_3COM 0x10b7 |
1058 | #define PCI_DEVICE_ID_3COM_3C985 0x0001 | 908 | #define PCI_DEVICE_ID_3COM_3C985 0x0001 |
1059 | #define PCI_DEVICE_ID_3COM_3C940 0x1700 | 909 | #define PCI_DEVICE_ID_3COM_3C940 0x1700 |
1060 | #define PCI_DEVICE_ID_3COM_3C339 0x3390 | 910 | #define PCI_DEVICE_ID_3COM_3C339 0x3390 |
1061 | #define PCI_DEVICE_ID_3COM_3C359 0x3590 | 911 | #define PCI_DEVICE_ID_3COM_3C359 0x3590 |
1062 | #define PCI_DEVICE_ID_3COM_3C590 0x5900 | ||
1063 | #define PCI_DEVICE_ID_3COM_3C595TX 0x5950 | ||
1064 | #define PCI_DEVICE_ID_3COM_3C595T4 0x5951 | ||
1065 | #define PCI_DEVICE_ID_3COM_3C595MII 0x5952 | ||
1066 | #define PCI_DEVICE_ID_3COM_3C940B 0x80eb | 912 | #define PCI_DEVICE_ID_3COM_3C940B 0x80eb |
1067 | #define PCI_DEVICE_ID_3COM_3C900TPO 0x9000 | ||
1068 | #define PCI_DEVICE_ID_3COM_3C900COMBO 0x9001 | ||
1069 | #define PCI_DEVICE_ID_3COM_3C905TX 0x9050 | ||
1070 | #define PCI_DEVICE_ID_3COM_3C905T4 0x9051 | ||
1071 | #define PCI_DEVICE_ID_3COM_3C905B_TX 0x9055 | ||
1072 | #define PCI_DEVICE_ID_3COM_3CR990 0x9900 | 913 | #define PCI_DEVICE_ID_3COM_3CR990 0x9900 |
1073 | #define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902 | 914 | #define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902 |
1074 | #define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903 | 915 | #define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903 |
@@ -1078,24 +919,11 @@ | |||
1078 | #define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 | 919 | #define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 |
1079 | #define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a | 920 | #define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a |
1080 | 921 | ||
1081 | #define PCI_VENDOR_ID_SMC 0x10b8 | ||
1082 | #define PCI_DEVICE_ID_SMC_EPIC100 0x0005 | ||
1083 | 922 | ||
1084 | #define PCI_VENDOR_ID_AL 0x10b9 | 923 | #define PCI_VENDOR_ID_AL 0x10b9 |
1085 | #define PCI_DEVICE_ID_AL_M1445 0x1445 | ||
1086 | #define PCI_DEVICE_ID_AL_M1449 0x1449 | ||
1087 | #define PCI_DEVICE_ID_AL_M1451 0x1451 | ||
1088 | #define PCI_DEVICE_ID_AL_M1461 0x1461 | ||
1089 | #define PCI_DEVICE_ID_AL_M1489 0x1489 | ||
1090 | #define PCI_DEVICE_ID_AL_M1511 0x1511 | ||
1091 | #define PCI_DEVICE_ID_AL_M1513 0x1513 | ||
1092 | #define PCI_DEVICE_ID_AL_M1521 0x1521 | ||
1093 | #define PCI_DEVICE_ID_AL_M1523 0x1523 | ||
1094 | #define PCI_DEVICE_ID_AL_M1531 0x1531 | ||
1095 | #define PCI_DEVICE_ID_AL_M1533 0x1533 | 924 | #define PCI_DEVICE_ID_AL_M1533 0x1533 |
1096 | #define PCI_DEVICE_ID_AL_M1535 0x1535 | 925 | #define PCI_DEVICE_ID_AL_M1535 0x1535 |
1097 | #define PCI_DEVICE_ID_AL_M1541 0x1541 | 926 | #define PCI_DEVICE_ID_AL_M1541 0x1541 |
1098 | #define PCI_DEVICE_ID_AL_M1543 0x1543 | ||
1099 | #define PCI_DEVICE_ID_AL_M1563 0x1563 | 927 | #define PCI_DEVICE_ID_AL_M1563 0x1563 |
1100 | #define PCI_DEVICE_ID_AL_M1621 0x1621 | 928 | #define PCI_DEVICE_ID_AL_M1621 0x1621 |
1101 | #define PCI_DEVICE_ID_AL_M1631 0x1631 | 929 | #define PCI_DEVICE_ID_AL_M1631 0x1631 |
@@ -1108,49 +936,23 @@ | |||
1108 | #define PCI_DEVICE_ID_AL_M1681 0x1681 | 936 | #define PCI_DEVICE_ID_AL_M1681 0x1681 |
1109 | #define PCI_DEVICE_ID_AL_M1683 0x1683 | 937 | #define PCI_DEVICE_ID_AL_M1683 0x1683 |
1110 | #define PCI_DEVICE_ID_AL_M1689 0x1689 | 938 | #define PCI_DEVICE_ID_AL_M1689 0x1689 |
1111 | #define PCI_DEVICE_ID_AL_M3307 0x3307 | ||
1112 | #define PCI_DEVICE_ID_AL_M4803 0x5215 | ||
1113 | #define PCI_DEVICE_ID_AL_M5219 0x5219 | 939 | #define PCI_DEVICE_ID_AL_M5219 0x5219 |
1114 | #define PCI_DEVICE_ID_AL_M5228 0x5228 | 940 | #define PCI_DEVICE_ID_AL_M5228 0x5228 |
1115 | #define PCI_DEVICE_ID_AL_M5229 0x5229 | 941 | #define PCI_DEVICE_ID_AL_M5229 0x5229 |
1116 | #define PCI_DEVICE_ID_AL_M5237 0x5237 | ||
1117 | #define PCI_DEVICE_ID_AL_M5243 0x5243 | ||
1118 | #define PCI_DEVICE_ID_AL_M5451 0x5451 | 942 | #define PCI_DEVICE_ID_AL_M5451 0x5451 |
1119 | #define PCI_DEVICE_ID_AL_M7101 0x7101 | 943 | #define PCI_DEVICE_ID_AL_M7101 0x7101 |
1120 | 944 | ||
1121 | #define PCI_VENDOR_ID_MITSUBISHI 0x10ba | ||
1122 | 945 | ||
1123 | #define PCI_VENDOR_ID_SURECOM 0x10bd | ||
1124 | #define PCI_DEVICE_ID_SURECOM_NE34 0x0e34 | ||
1125 | 946 | ||
1126 | #define PCI_VENDOR_ID_NEOMAGIC 0x10c8 | 947 | #define PCI_VENDOR_ID_NEOMAGIC 0x10c8 |
1127 | #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001 | ||
1128 | #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002 | ||
1129 | #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003 | ||
1130 | #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004 | ||
1131 | #define PCI_DEVICE_ID_NEOMAGIC_MAGICMEDIA_256AV 0x0005 | ||
1132 | #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS 0x0083 | ||
1133 | #define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 | 948 | #define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 |
1134 | #define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 | 949 | #define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 |
1135 | #define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 | 950 | #define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 |
1136 | 951 | ||
1137 | #define PCI_VENDOR_ID_ASP 0x10cd | ||
1138 | #define PCI_DEVICE_ID_ASP_ABP940 0x1200 | ||
1139 | #define PCI_DEVICE_ID_ASP_ABP940U 0x1300 | ||
1140 | #define PCI_DEVICE_ID_ASP_ABP940UW 0x2300 | ||
1141 | |||
1142 | #define PCI_VENDOR_ID_MACRONIX 0x10d9 | ||
1143 | #define PCI_DEVICE_ID_MACRONIX_MX98713 0x0512 | ||
1144 | #define PCI_DEVICE_ID_MACRONIX_MX987x5 0x0531 | ||
1145 | 952 | ||
1146 | #define PCI_VENDOR_ID_TCONRAD 0x10da | 953 | #define PCI_VENDOR_ID_TCONRAD 0x10da |
1147 | #define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 | 954 | #define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 |
1148 | 955 | ||
1149 | #define PCI_VENDOR_ID_CERN 0x10dc | ||
1150 | #define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001 | ||
1151 | #define PCI_DEVICE_ID_CERN_SPSB_PCI 0x0002 | ||
1152 | #define PCI_DEVICE_ID_CERN_HIPPI_DST 0x0021 | ||
1153 | #define PCI_DEVICE_ID_CERN_HIPPI_SRC 0x0022 | ||
1154 | 956 | ||
1155 | #define PCI_VENDOR_ID_NVIDIA 0x10de | 957 | #define PCI_VENDOR_ID_NVIDIA 0x10de |
1156 | #define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 | 958 | #define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 |
@@ -1196,7 +998,6 @@ | |||
1196 | #define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc | 998 | #define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc |
1197 | #define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce | 999 | #define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce |
1198 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 | 1000 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 |
1199 | #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da | ||
1200 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 | 1001 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 |
1201 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 | 1002 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 |
1202 | #define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 | 1003 | #define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 |
@@ -1283,7 +1084,6 @@ | |||
1283 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | 1084 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F |
1284 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | 1085 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 |
1285 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | 1086 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 |
1286 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B | ||
1287 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 | 1087 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 |
1288 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 | 1088 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 |
1289 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 | 1089 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 |
@@ -1334,24 +1134,13 @@ | |||
1334 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 | 1134 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 |
1335 | 1135 | ||
1336 | #define PCI_VENDOR_ID_IMS 0x10e0 | 1136 | #define PCI_VENDOR_ID_IMS 0x10e0 |
1337 | #define PCI_DEVICE_ID_IMS_8849 0x8849 | ||
1338 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 | 1137 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 |
1339 | #define PCI_DEVICE_ID_IMS_TT3D 0x9135 | 1138 | #define PCI_DEVICE_ID_IMS_TT3D 0x9135 |
1340 | 1139 | ||
1341 | #define PCI_VENDOR_ID_TEKRAM2 0x10e1 | ||
1342 | #define PCI_DEVICE_ID_TEKRAM2_690c 0x690c | ||
1343 | 1140 | ||
1344 | #define PCI_VENDOR_ID_TUNDRA 0x10e3 | ||
1345 | #define PCI_DEVICE_ID_TUNDRA_CA91C042 0x0000 | ||
1346 | 1141 | ||
1347 | #define PCI_VENDOR_ID_AMCC 0x10e8 | ||
1348 | #define PCI_DEVICE_ID_AMCC_MYRINET 0x8043 | ||
1349 | #define PCI_DEVICE_ID_AMCC_PARASTATION 0x8062 | ||
1350 | #define PCI_DEVICE_ID_AMCC_S5933 0x807d | ||
1351 | #define PCI_DEVICE_ID_AMCC_S5933_HEPC3 0x809c | ||
1352 | 1142 | ||
1353 | #define PCI_VENDOR_ID_INTERG 0x10ea | 1143 | #define PCI_VENDOR_ID_INTERG 0x10ea |
1354 | #define PCI_DEVICE_ID_INTERG_1680 0x1680 | ||
1355 | #define PCI_DEVICE_ID_INTERG_1682 0x1682 | 1144 | #define PCI_DEVICE_ID_INTERG_1682 0x1682 |
1356 | #define PCI_DEVICE_ID_INTERG_2000 0x2000 | 1145 | #define PCI_DEVICE_ID_INTERG_2000 0x2000 |
1357 | #define PCI_DEVICE_ID_INTERG_2010 0x2010 | 1146 | #define PCI_DEVICE_ID_INTERG_2010 0x2010 |
@@ -1359,32 +1148,23 @@ | |||
1359 | #define PCI_DEVICE_ID_INTERG_5050 0x5050 | 1148 | #define PCI_DEVICE_ID_INTERG_5050 0x5050 |
1360 | 1149 | ||
1361 | #define PCI_VENDOR_ID_REALTEK 0x10ec | 1150 | #define PCI_VENDOR_ID_REALTEK 0x10ec |
1362 | #define PCI_DEVICE_ID_REALTEK_8029 0x8029 | ||
1363 | #define PCI_DEVICE_ID_REALTEK_8129 0x8129 | ||
1364 | #define PCI_DEVICE_ID_REALTEK_8139 0x8139 | 1151 | #define PCI_DEVICE_ID_REALTEK_8139 0x8139 |
1365 | #define PCI_DEVICE_ID_REALTEK_8169 0x8169 | ||
1366 | 1152 | ||
1367 | #define PCI_VENDOR_ID_XILINX 0x10ee | 1153 | #define PCI_VENDOR_ID_XILINX 0x10ee |
1368 | #define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 | 1154 | #define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 |
1369 | #define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1 | 1155 | #define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1 |
1370 | #define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2 | 1156 | #define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2 |
1371 | #define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3 | 1157 | #define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3 |
1372 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL 0x3fc4 | ||
1373 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 | 1158 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 |
1374 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 | 1159 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 |
1375 | #define PCI_DEVICE_ID_TURBOPAM 0x4020 | ||
1376 | 1160 | ||
1377 | #define PCI_VENDOR_ID_TRUEVISION 0x10fa | ||
1378 | #define PCI_DEVICE_ID_TRUEVISION_T1000 0x000c | ||
1379 | 1161 | ||
1380 | #define PCI_VENDOR_ID_INIT 0x1101 | 1162 | #define PCI_VENDOR_ID_INIT 0x1101 |
1381 | #define PCI_DEVICE_ID_INIT_320P 0x9100 | ||
1382 | #define PCI_DEVICE_ID_INIT_360P 0x9500 | ||
1383 | 1163 | ||
1384 | #define PCI_VENDOR_ID_CREATIVE 0x1102 // duplicate: ECTIVA | 1164 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ |
1385 | #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 | 1165 | #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 |
1386 | 1166 | ||
1387 | #define PCI_VENDOR_ID_ECTIVA 0x1102 // duplicate: CREATIVE | 1167 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ |
1388 | #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 | 1168 | #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 |
1389 | 1169 | ||
1390 | #define PCI_VENDOR_ID_TTI 0x1103 | 1170 | #define PCI_VENDOR_ID_TTI 0x1103 |
@@ -1394,7 +1174,7 @@ | |||
1394 | #define PCI_DEVICE_ID_TTI_HPT302 0x0006 | 1174 | #define PCI_DEVICE_ID_TTI_HPT302 0x0006 |
1395 | #define PCI_DEVICE_ID_TTI_HPT371 0x0007 | 1175 | #define PCI_DEVICE_ID_TTI_HPT371 0x0007 |
1396 | #define PCI_DEVICE_ID_TTI_HPT374 0x0008 | 1176 | #define PCI_DEVICE_ID_TTI_HPT374 0x0008 |
1397 | #define PCI_DEVICE_ID_TTI_HPT372N 0x0009 // apparently a 372N variant? | 1177 | #define PCI_DEVICE_ID_TTI_HPT372N 0x0009 /* apparently a 372N variant? */ |
1398 | 1178 | ||
1399 | #define PCI_VENDOR_ID_VIA 0x1106 | 1179 | #define PCI_VENDOR_ID_VIA 0x1106 |
1400 | #define PCI_DEVICE_ID_VIA_8763_0 0x0198 | 1180 | #define PCI_DEVICE_ID_VIA_8763_0 0x0198 |
@@ -1407,36 +1187,25 @@ | |||
1407 | #define PCI_DEVICE_ID_VIA_8363_0 0x0305 | 1187 | #define PCI_DEVICE_ID_VIA_8363_0 0x0305 |
1408 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 | 1188 | #define PCI_DEVICE_ID_VIA_8371_0 0x0391 |
1409 | #define PCI_DEVICE_ID_VIA_8501_0 0x0501 | 1189 | #define PCI_DEVICE_ID_VIA_8501_0 0x0501 |
1410 | #define PCI_DEVICE_ID_VIA_82C505 0x0505 | ||
1411 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 | 1190 | #define PCI_DEVICE_ID_VIA_82C561 0x0561 |
1412 | #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 | 1191 | #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 |
1413 | #define PCI_DEVICE_ID_VIA_82C576 0x0576 | 1192 | #define PCI_DEVICE_ID_VIA_82C576 0x0576 |
1414 | #define PCI_DEVICE_ID_VIA_82C585 0x0585 | ||
1415 | #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 | 1193 | #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 |
1416 | #define PCI_DEVICE_ID_VIA_82C595 0x0595 | ||
1417 | #define PCI_DEVICE_ID_VIA_82C596 0x0596 | 1194 | #define PCI_DEVICE_ID_VIA_82C596 0x0596 |
1418 | #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 | 1195 | #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 |
1419 | #define PCI_DEVICE_ID_VIA_82C598_0 0x0598 | 1196 | #define PCI_DEVICE_ID_VIA_82C598_0 0x0598 |
1420 | #define PCI_DEVICE_ID_VIA_8601_0 0x0601 | 1197 | #define PCI_DEVICE_ID_VIA_8601_0 0x0601 |
1421 | #define PCI_DEVICE_ID_VIA_8605_0 0x0605 | 1198 | #define PCI_DEVICE_ID_VIA_8605_0 0x0605 |
1422 | #define PCI_DEVICE_ID_VIA_82C680 0x0680 | ||
1423 | #define PCI_DEVICE_ID_VIA_82C686 0x0686 | 1199 | #define PCI_DEVICE_ID_VIA_82C686 0x0686 |
1424 | #define PCI_DEVICE_ID_VIA_82C691_0 0x0691 | 1200 | #define PCI_DEVICE_ID_VIA_82C691_0 0x0691 |
1425 | #define PCI_DEVICE_ID_VIA_82C693 0x0693 | ||
1426 | #define PCI_DEVICE_ID_VIA_82C693_1 0x0698 | ||
1427 | #define PCI_DEVICE_ID_VIA_82C926 0x0926 | ||
1428 | #define PCI_DEVICE_ID_VIA_82C576_1 0x1571 | 1201 | #define PCI_DEVICE_ID_VIA_82C576_1 0x1571 |
1429 | #define PCI_DEVICE_ID_VIA_82C595_97 0x1595 | ||
1430 | #define PCI_DEVICE_ID_VIA_82C586_2 0x3038 | 1202 | #define PCI_DEVICE_ID_VIA_82C586_2 0x3038 |
1431 | #define PCI_DEVICE_ID_VIA_82C586_3 0x3040 | 1203 | #define PCI_DEVICE_ID_VIA_82C586_3 0x3040 |
1432 | #define PCI_DEVICE_ID_VIA_6305 0x3044 | ||
1433 | #define PCI_DEVICE_ID_VIA_82C596_3 0x3050 | 1204 | #define PCI_DEVICE_ID_VIA_82C596_3 0x3050 |
1434 | #define PCI_DEVICE_ID_VIA_82C596B_3 0x3051 | 1205 | #define PCI_DEVICE_ID_VIA_82C596B_3 0x3051 |
1435 | #define PCI_DEVICE_ID_VIA_82C686_4 0x3057 | 1206 | #define PCI_DEVICE_ID_VIA_82C686_4 0x3057 |
1436 | #define PCI_DEVICE_ID_VIA_82C686_5 0x3058 | 1207 | #define PCI_DEVICE_ID_VIA_82C686_5 0x3058 |
1437 | #define PCI_DEVICE_ID_VIA_8233_5 0x3059 | 1208 | #define PCI_DEVICE_ID_VIA_8233_5 0x3059 |
1438 | #define PCI_DEVICE_ID_VIA_8233_7 0x3065 | ||
1439 | #define PCI_DEVICE_ID_VIA_82C686_6 0x3068 | ||
1440 | #define PCI_DEVICE_ID_VIA_8233_0 0x3074 | 1209 | #define PCI_DEVICE_ID_VIA_8233_0 0x3074 |
1441 | #define PCI_DEVICE_ID_VIA_8633_0 0x3091 | 1210 | #define PCI_DEVICE_ID_VIA_8633_0 0x3091 |
1442 | #define PCI_DEVICE_ID_VIA_8367_0 0x3099 | 1211 | #define PCI_DEVICE_ID_VIA_8367_0 0x3099 |
@@ -1454,38 +1223,23 @@ | |||
1454 | #define PCI_DEVICE_ID_VIA_XN266 0x3156 | 1223 | #define PCI_DEVICE_ID_VIA_XN266 0x3156 |
1455 | #define PCI_DEVICE_ID_VIA_8754C_0 0x3168 | 1224 | #define PCI_DEVICE_ID_VIA_8754C_0 0x3168 |
1456 | #define PCI_DEVICE_ID_VIA_8235 0x3177 | 1225 | #define PCI_DEVICE_ID_VIA_8235 0x3177 |
1457 | #define PCI_DEVICE_ID_VIA_P4N333 0x3178 | ||
1458 | #define PCI_DEVICE_ID_VIA_8385_0 0x3188 | 1226 | #define PCI_DEVICE_ID_VIA_8385_0 0x3188 |
1459 | #define PCI_DEVICE_ID_VIA_8377_0 0x3189 | 1227 | #define PCI_DEVICE_ID_VIA_8377_0 0x3189 |
1460 | #define PCI_DEVICE_ID_VIA_8378_0 0x3205 | 1228 | #define PCI_DEVICE_ID_VIA_8378_0 0x3205 |
1461 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 | 1229 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 |
1462 | #define PCI_DEVICE_ID_VIA_P4M400 0x3209 | ||
1463 | #define PCI_DEVICE_ID_VIA_8237 0x3227 | 1230 | #define PCI_DEVICE_ID_VIA_8237 0x3227 |
1464 | #define PCI_DEVICE_ID_VIA_3296_0 0x0296 | 1231 | #define PCI_DEVICE_ID_VIA_3296_0 0x0296 |
1465 | #define PCI_DEVICE_ID_VIA_86C100A 0x6100 | ||
1466 | #define PCI_DEVICE_ID_VIA_8231 0x8231 | 1232 | #define PCI_DEVICE_ID_VIA_8231 0x8231 |
1467 | #define PCI_DEVICE_ID_VIA_8231_4 0x8235 | 1233 | #define PCI_DEVICE_ID_VIA_8231_4 0x8235 |
1468 | #define PCI_DEVICE_ID_VIA_8365_1 0x8305 | 1234 | #define PCI_DEVICE_ID_VIA_8365_1 0x8305 |
1469 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 | 1235 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 |
1470 | #define PCI_DEVICE_ID_VIA_8501_1 0x8501 | ||
1471 | #define PCI_DEVICE_ID_VIA_82C597_1 0x8597 | ||
1472 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 | 1236 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 |
1473 | #define PCI_DEVICE_ID_VIA_8601_1 0x8601 | ||
1474 | #define PCI_DEVICE_ID_VIA_8505_1 0x8605 | ||
1475 | #define PCI_DEVICE_ID_VIA_8633_1 0xB091 | ||
1476 | #define PCI_DEVICE_ID_VIA_8367_1 0xB099 | ||
1477 | #define PCI_DEVICE_ID_VIA_P4X266_1 0xB101 | ||
1478 | #define PCI_DEVICE_ID_VIA_8615_1 0xB103 | ||
1479 | #define PCI_DEVICE_ID_VIA_8361_1 0xB112 | ||
1480 | #define PCI_DEVICE_ID_VIA_8235_1 0xB168 | ||
1481 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 | 1237 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 |
1482 | #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 | 1238 | #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 |
1483 | 1239 | ||
1484 | #define PCI_VENDOR_ID_SIEMENS 0x110A | 1240 | #define PCI_VENDOR_ID_SIEMENS 0x110A |
1485 | #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 | 1241 | #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 |
1486 | 1242 | ||
1487 | #define PCI_VENDOR_ID_SMC2 0x1113 | ||
1488 | #define PCI_DEVICE_ID_SMC2_1211TX 0x1211 | ||
1489 | 1243 | ||
1490 | #define PCI_VENDOR_ID_VORTEX 0x1119 | 1244 | #define PCI_VENDOR_ID_VORTEX 0x1119 |
1491 | #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 | 1245 | #define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 |
@@ -1508,18 +1262,6 @@ | |||
1508 | #define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103 | 1262 | #define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103 |
1509 | #define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104 | 1263 | #define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104 |
1510 | #define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105 | 1264 | #define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105 |
1511 | #define PCI_DEVICE_ID_VORTEX_GDT6x17RP1 0x0110 | ||
1512 | #define PCI_DEVICE_ID_VORTEX_GDT6x27RP1 0x0111 | ||
1513 | #define PCI_DEVICE_ID_VORTEX_GDT6537RP1 0x0112 | ||
1514 | #define PCI_DEVICE_ID_VORTEX_GDT6557RP1 0x0113 | ||
1515 | #define PCI_DEVICE_ID_VORTEX_GDT6x11RP1 0x0114 | ||
1516 | #define PCI_DEVICE_ID_VORTEX_GDT6x21RP1 0x0115 | ||
1517 | #define PCI_DEVICE_ID_VORTEX_GDT6x17RP2 0x0120 | ||
1518 | #define PCI_DEVICE_ID_VORTEX_GDT6x27RP2 0x0121 | ||
1519 | #define PCI_DEVICE_ID_VORTEX_GDT6537RP2 0x0122 | ||
1520 | #define PCI_DEVICE_ID_VORTEX_GDT6557RP2 0x0123 | ||
1521 | #define PCI_DEVICE_ID_VORTEX_GDT6x11RP2 0x0124 | ||
1522 | #define PCI_DEVICE_ID_VORTEX_GDT6x21RP2 0x0125 | ||
1523 | 1265 | ||
1524 | #define PCI_VENDOR_ID_EF 0x111a | 1266 | #define PCI_VENDOR_ID_EF 0x111a |
1525 | #define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 | 1267 | #define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 |
@@ -1531,21 +1273,15 @@ | |||
1531 | #define PCI_DEVICE_ID_IDT_IDT77201 0x0001 | 1273 | #define PCI_DEVICE_ID_IDT_IDT77201 0x0001 |
1532 | 1274 | ||
1533 | #define PCI_VENDOR_ID_FORE 0x1127 | 1275 | #define PCI_VENDOR_ID_FORE 0x1127 |
1534 | #define PCI_DEVICE_ID_FORE_PCA200PC 0x0210 | ||
1535 | #define PCI_DEVICE_ID_FORE_PCA200E 0x0300 | 1276 | #define PCI_DEVICE_ID_FORE_PCA200E 0x0300 |
1536 | 1277 | ||
1537 | #define PCI_VENDOR_ID_IMAGINGTECH 0x112f | ||
1538 | #define PCI_DEVICE_ID_IMAGINGTECH_ICPCI 0x0000 | ||
1539 | 1278 | ||
1540 | #define PCI_VENDOR_ID_PHILIPS 0x1131 | 1279 | #define PCI_VENDOR_ID_PHILIPS 0x1131 |
1541 | #define PCI_DEVICE_ID_PHILIPS_SAA7145 0x7145 | ||
1542 | #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 | 1280 | #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 |
1543 | #define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 | 1281 | #define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 |
1544 | 1282 | ||
1545 | #define PCI_VENDOR_ID_EICON 0x1133 | 1283 | #define PCI_VENDOR_ID_EICON 0x1133 |
1546 | #define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001 | ||
1547 | #define PCI_DEVICE_ID_EICON_DIVA20 0xe002 | 1284 | #define PCI_DEVICE_ID_EICON_DIVA20 0xe002 |
1548 | #define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003 | ||
1549 | #define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004 | 1285 | #define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004 |
1550 | #define PCI_DEVICE_ID_EICON_DIVA201 0xe005 | 1286 | #define PCI_DEVICE_ID_EICON_DIVA201 0xe005 |
1551 | #define PCI_DEVICE_ID_EICON_DIVA202 0xe00b | 1287 | #define PCI_DEVICE_ID_EICON_DIVA202 0xe00b |
@@ -1557,35 +1293,17 @@ | |||
1557 | #define PCI_VENDOR_ID_ZIATECH 0x1138 | 1293 | #define PCI_VENDOR_ID_ZIATECH 0x1138 |
1558 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 | 1294 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 |
1559 | 1295 | ||
1560 | #define PCI_VENDOR_ID_CYCLONE 0x113c | ||
1561 | #define PCI_DEVICE_ID_CYCLONE_SDK 0x0001 | ||
1562 | 1296 | ||
1563 | #define PCI_VENDOR_ID_ALLIANCE 0x1142 | ||
1564 | #define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210 | ||
1565 | #define PCI_DEVICE_ID_ALLIANCE_PROVIDEO 0x6422 | ||
1566 | #define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424 | ||
1567 | #define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d | ||
1568 | 1297 | ||
1569 | #define PCI_VENDOR_ID_SYSKONNECT 0x1148 | 1298 | #define PCI_VENDOR_ID_SYSKONNECT 0x1148 |
1570 | #define PCI_DEVICE_ID_SYSKONNECT_FP 0x4000 | ||
1571 | #define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 | 1299 | #define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 |
1572 | #define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 | 1300 | #define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 |
1573 | #define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320 | 1301 | #define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320 |
1574 | #define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 | 1302 | #define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 |
1575 | #define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 | 1303 | #define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 |
1576 | 1304 | ||
1577 | #define PCI_VENDOR_ID_VMIC 0x114a | ||
1578 | #define PCI_DEVICE_ID_VMIC_VME 0x7587 | ||
1579 | 1305 | ||
1580 | #define PCI_VENDOR_ID_DIGI 0x114f | 1306 | #define PCI_VENDOR_ID_DIGI 0x114f |
1581 | #define PCI_DEVICE_ID_DIGI_EPC 0x0002 | ||
1582 | #define PCI_DEVICE_ID_DIGI_RIGHTSWITCH 0x0003 | ||
1583 | #define PCI_DEVICE_ID_DIGI_XEM 0x0004 | ||
1584 | #define PCI_DEVICE_ID_DIGI_XR 0x0005 | ||
1585 | #define PCI_DEVICE_ID_DIGI_CX 0x0006 | ||
1586 | #define PCI_DEVICE_ID_DIGI_XRJ 0x0009 | ||
1587 | #define PCI_DEVICE_ID_DIGI_EPCJ 0x000a | ||
1588 | #define PCI_DEVICE_ID_DIGI_XR_920 0x0027 | ||
1589 | #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 | 1307 | #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 |
1590 | #define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 | 1308 | #define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 |
1591 | #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072 | 1309 | #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072 |
@@ -1595,23 +1313,15 @@ | |||
1595 | #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA | 1313 | #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA |
1596 | #define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB | 1314 | #define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB |
1597 | 1315 | ||
1598 | #define PCI_VENDOR_ID_MUTECH 0x1159 | ||
1599 | #define PCI_DEVICE_ID_MUTECH_MV1000 0x0001 | ||
1600 | 1316 | ||
1601 | #define PCI_VENDOR_ID_XIRCOM 0x115d | 1317 | #define PCI_VENDOR_ID_XIRCOM 0x115d |
1602 | #define PCI_DEVICE_ID_XIRCOM_X3201_ETH 0x0003 | ||
1603 | #define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 | 1318 | #define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 |
1604 | #define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 | 1319 | #define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 |
1605 | 1320 | ||
1606 | #define PCI_VENDOR_ID_RENDITION 0x1163 | ||
1607 | #define PCI_DEVICE_ID_RENDITION_VERITE 0x0001 | ||
1608 | #define PCI_DEVICE_ID_RENDITION_VERITE2100 0x2000 | ||
1609 | 1321 | ||
1610 | #define PCI_VENDOR_ID_SERVERWORKS 0x1166 | 1322 | #define PCI_VENDOR_ID_SERVERWORKS 0x1166 |
1611 | #define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 | 1323 | #define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 |
1612 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 | 1324 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 |
1613 | #define PCI_DEVICE_ID_SERVERWORKS_CIOB30 0x0010 | ||
1614 | #define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011 | ||
1615 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 | 1325 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 |
1616 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1326 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
1617 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1327 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
@@ -1621,13 +1331,7 @@ | |||
1621 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 | 1331 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 |
1622 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214 | 1332 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214 |
1623 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 | 1333 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 |
1624 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 | ||
1625 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB | ||
1626 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221 | ||
1627 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227 | 1334 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227 |
1628 | #define PCI_DEVICE_ID_SERVERWORKS_GCLE 0x0225 | ||
1629 | #define PCI_DEVICE_ID_SERVERWORKS_GCLE2 0x0227 | ||
1630 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230 | ||
1631 | 1335 | ||
1632 | #define PCI_VENDOR_ID_SBE 0x1176 | 1336 | #define PCI_VENDOR_ID_SBE 0x1176 |
1633 | #define PCI_DEVICE_ID_SBE_WANXL100 0x0301 | 1337 | #define PCI_DEVICE_ID_SBE_WANXL100 0x0301 |
@@ -1638,17 +1342,12 @@ | |||
1638 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102 | 1342 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102 |
1639 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103 | 1343 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103 |
1640 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105 | 1344 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105 |
1641 | #define PCI_DEVICE_ID_TOSHIBA_601 0x0601 | ||
1642 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a | 1345 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a |
1643 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC95_A 0x0603 | ||
1644 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC95_B 0x060a | ||
1645 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f | 1346 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f |
1646 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 | 1347 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 |
1647 | 1348 | ||
1648 | #define PCI_VENDOR_ID_TOSHIBA_2 0x102f | 1349 | #define PCI_VENDOR_ID_TOSHIBA_2 0x102f |
1649 | #define PCI_DEVICE_ID_TOSHIBA_TX3927 0x000a | ||
1650 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 | 1350 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 |
1651 | #define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 | ||
1652 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 | 1351 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 |
1653 | #define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 | 1352 | #define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 |
1654 | 1353 | ||
@@ -1663,7 +1362,6 @@ | |||
1663 | #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 | 1362 | #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 |
1664 | 1363 | ||
1665 | #define PCI_VENDOR_ID_ARTOP 0x1191 | 1364 | #define PCI_VENDOR_ID_ARTOP 0x1191 |
1666 | #define PCI_DEVICE_ID_ARTOP_ATP8400 0x0004 | ||
1667 | #define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 | 1365 | #define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 |
1668 | #define PCI_DEVICE_ID_ARTOP_ATP860 0x0006 | 1366 | #define PCI_DEVICE_ID_ARTOP_ATP860 0x0006 |
1669 | #define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 | 1367 | #define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 |
@@ -1676,16 +1374,11 @@ | |||
1676 | #define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040 | 1374 | #define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040 |
1677 | #define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050 | 1375 | #define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050 |
1678 | #define PCI_DEVICE_ID_ARTOP_8060 0x8060 | 1376 | #define PCI_DEVICE_ID_ARTOP_8060 0x8060 |
1679 | #define PCI_DEVICE_ID_ARTOP_AEC67160 0x8080 | ||
1680 | #define PCI_DEVICE_ID_ARTOP_AEC67160_2 0x8081 | ||
1681 | #define PCI_DEVICE_ID_ARTOP_AEC67162 0x808a | ||
1682 | 1377 | ||
1683 | #define PCI_VENDOR_ID_ZEITNET 0x1193 | 1378 | #define PCI_VENDOR_ID_ZEITNET 0x1193 |
1684 | #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 | 1379 | #define PCI_DEVICE_ID_ZEITNET_1221 0x0001 |
1685 | #define PCI_DEVICE_ID_ZEITNET_1225 0x0002 | 1380 | #define PCI_DEVICE_ID_ZEITNET_1225 0x0002 |
1686 | 1381 | ||
1687 | #define PCI_VENDOR_ID_OMEGA 0x119b | ||
1688 | #define PCI_DEVICE_ID_OMEGA_82C092G 0x1221 | ||
1689 | 1382 | ||
1690 | #define PCI_VENDOR_ID_FUJITSU_ME 0x119e | 1383 | #define PCI_VENDOR_ID_FUJITSU_ME 0x119e |
1691 | #define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 | 1384 | #define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 |
@@ -1695,61 +1388,41 @@ | |||
1695 | #define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 | 1388 | #define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 |
1696 | 1389 | ||
1697 | #define PCI_VENDOR_ID_MARVELL 0x11ab | 1390 | #define PCI_VENDOR_ID_MARVELL 0x11ab |
1698 | #define PCI_DEVICE_ID_MARVELL_GT64011 0x4146 | ||
1699 | #define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 | ||
1700 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 | 1391 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 |
1701 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 | 1392 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 |
1702 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 | 1393 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 |
1703 | #define PCI_DEVICE_ID_MARVELL_GT96100 0x9652 | 1394 | #define PCI_DEVICE_ID_MARVELL_GT96100 0x9652 |
1704 | #define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653 | 1395 | #define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653 |
1705 | 1396 | ||
1706 | #define PCI_VENDOR_ID_LITEON 0x11ad | ||
1707 | #define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002 | ||
1708 | 1397 | ||
1709 | #define PCI_VENDOR_ID_V3 0x11b0 | 1398 | #define PCI_VENDOR_ID_V3 0x11b0 |
1710 | #define PCI_DEVICE_ID_V3_V960 0x0001 | 1399 | #define PCI_DEVICE_ID_V3_V960 0x0001 |
1711 | #define PCI_DEVICE_ID_V3_V350 0x0001 | ||
1712 | #define PCI_DEVICE_ID_V3_V961 0x0002 | ||
1713 | #define PCI_DEVICE_ID_V3_V351 0x0002 | 1400 | #define PCI_DEVICE_ID_V3_V351 0x0002 |
1714 | 1401 | ||
1715 | #define PCI_VENDOR_ID_NP 0x11bc | ||
1716 | #define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001 | ||
1717 | 1402 | ||
1718 | #define PCI_VENDOR_ID_ATT 0x11c1 | 1403 | #define PCI_VENDOR_ID_ATT 0x11c1 |
1719 | #define PCI_DEVICE_ID_ATT_L56XMF 0x0440 | ||
1720 | #define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 | 1404 | #define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 |
1721 | 1405 | ||
1722 | #define PCI_VENDOR_ID_NEC2 0x11c3 /* NEC (2nd) */ | ||
1723 | 1406 | ||
1724 | #define PCI_VENDOR_ID_SPECIALIX 0x11cb | 1407 | #define PCI_VENDOR_ID_SPECIALIX 0x11cb |
1725 | #define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 | 1408 | #define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 |
1726 | #define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000 | ||
1727 | #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 | 1409 | #define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 |
1728 | #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 | 1410 | #define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 |
1729 | 1411 | ||
1730 | #define PCI_VENDOR_ID_AURAVISION 0x11d1 | ||
1731 | #define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7 | ||
1732 | 1412 | ||
1733 | #define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 | 1413 | #define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 |
1734 | #define PCI_DEVICE_ID_AD1889JS 0x1889 | 1414 | #define PCI_DEVICE_ID_AD1889JS 0x1889 |
1735 | 1415 | ||
1736 | #define PCI_VENDOR_ID_IKON 0x11d5 | ||
1737 | #define PCI_DEVICE_ID_IKON_10115 0x0115 | ||
1738 | #define PCI_DEVICE_ID_IKON_10117 0x0117 | ||
1739 | 1416 | ||
1740 | #define PCI_VENDOR_ID_SEGA 0x11db | ||
1741 | #define PCI_DEVICE_ID_SEGA_BBA 0x1234 | 1417 | #define PCI_DEVICE_ID_SEGA_BBA 0x1234 |
1742 | 1418 | ||
1743 | #define PCI_VENDOR_ID_ZORAN 0x11de | 1419 | #define PCI_VENDOR_ID_ZORAN 0x11de |
1744 | #define PCI_DEVICE_ID_ZORAN_36057 0x6057 | 1420 | #define PCI_DEVICE_ID_ZORAN_36057 0x6057 |
1745 | #define PCI_DEVICE_ID_ZORAN_36120 0x6120 | 1421 | #define PCI_DEVICE_ID_ZORAN_36120 0x6120 |
1746 | 1422 | ||
1747 | #define PCI_VENDOR_ID_KINETIC 0x11f4 | ||
1748 | #define PCI_DEVICE_ID_KINETIC_2915 0x2915 | ||
1749 | 1423 | ||
1750 | #define PCI_VENDOR_ID_COMPEX 0x11f6 | 1424 | #define PCI_VENDOR_ID_COMPEX 0x11f6 |
1751 | #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 | 1425 | #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 |
1752 | #define PCI_DEVICE_ID_COMPEX_RL2000 0x1401 | ||
1753 | 1426 | ||
1754 | #define PCI_VENDOR_ID_RP 0x11fe | 1427 | #define PCI_VENDOR_ID_RP 0x11fe |
1755 | #define PCI_DEVICE_ID_RP32INTF 0x0001 | 1428 | #define PCI_DEVICE_ID_RP32INTF 0x0001 |
@@ -1763,7 +1436,6 @@ | |||
1763 | #define PCI_DEVICE_ID_RP16SNI 0x0009 | 1436 | #define PCI_DEVICE_ID_RP16SNI 0x0009 |
1764 | #define PCI_DEVICE_ID_RPP4 0x000A | 1437 | #define PCI_DEVICE_ID_RPP4 0x000A |
1765 | #define PCI_DEVICE_ID_RPP8 0x000B | 1438 | #define PCI_DEVICE_ID_RPP8 0x000B |
1766 | #define PCI_DEVICE_ID_RP8M 0x000C | ||
1767 | #define PCI_DEVICE_ID_RP4M 0x000D | 1439 | #define PCI_DEVICE_ID_RP4M 0x000D |
1768 | #define PCI_DEVICE_ID_RP2_232 0x000E | 1440 | #define PCI_DEVICE_ID_RP2_232 0x000E |
1769 | #define PCI_DEVICE_ID_RP2_422 0x000F | 1441 | #define PCI_DEVICE_ID_RP2_422 0x000F |
@@ -1791,10 +1463,6 @@ | |||
1791 | #define PCI_DEVICE_ID_PC300_TE_M_2 0x0320 | 1463 | #define PCI_DEVICE_ID_PC300_TE_M_2 0x0320 |
1792 | #define PCI_DEVICE_ID_PC300_TE_M_1 0x0321 | 1464 | #define PCI_DEVICE_ID_PC300_TE_M_1 0x0321 |
1793 | 1465 | ||
1794 | /* Allied Telesyn */ | ||
1795 | #define PCI_VENDOR_ID_AT 0x1259 | ||
1796 | #define PCI_SUBDEVICE_ID_AT_2701FX 0x2703 | ||
1797 | |||
1798 | #define PCI_VENDOR_ID_ESSENTIAL 0x120f | 1466 | #define PCI_VENDOR_ID_ESSENTIAL 0x120f |
1799 | #define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001 | 1467 | #define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001 |
1800 | 1468 | ||
@@ -1811,10 +1479,7 @@ | |||
1811 | #define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 | 1479 | #define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 |
1812 | #define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 | 1480 | #define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 |
1813 | 1481 | ||
1814 | #define PCI_VENDOR_ID_SIGMADES 0x1236 | ||
1815 | #define PCI_DEVICE_ID_SIGMADES_6425 0x6401 | ||
1816 | 1482 | ||
1817 | #define PCI_VENDOR_ID_CCUBE 0x123f | ||
1818 | 1483 | ||
1819 | #define PCI_VENDOR_ID_AVM 0x1244 | 1484 | #define PCI_VENDOR_ID_AVM 0x1244 |
1820 | #define PCI_DEVICE_ID_AVM_B1 0x0700 | 1485 | #define PCI_DEVICE_ID_AVM_B1 0x0700 |
@@ -1824,19 +1489,8 @@ | |||
1824 | #define PCI_DEVICE_ID_AVM_C2 0x1100 | 1489 | #define PCI_DEVICE_ID_AVM_C2 0x1100 |
1825 | #define PCI_DEVICE_ID_AVM_T1 0x1200 | 1490 | #define PCI_DEVICE_ID_AVM_T1 0x1200 |
1826 | 1491 | ||
1827 | #define PCI_VENDOR_ID_DIPIX 0x1246 | ||
1828 | 1492 | ||
1829 | #define PCI_VENDOR_ID_STALLION 0x124d | 1493 | #define PCI_VENDOR_ID_STALLION 0x124d |
1830 | #define PCI_DEVICE_ID_STALLION_ECHPCI832 0x0000 | ||
1831 | #define PCI_DEVICE_ID_STALLION_ECHPCI864 0x0002 | ||
1832 | #define PCI_DEVICE_ID_STALLION_EIOPCI 0x0003 | ||
1833 | |||
1834 | #define PCI_VENDOR_ID_OPTIBASE 0x1255 | ||
1835 | #define PCI_DEVICE_ID_OPTIBASE_FORGE 0x1110 | ||
1836 | #define PCI_DEVICE_ID_OPTIBASE_FUSION 0x1210 | ||
1837 | #define PCI_DEVICE_ID_OPTIBASE_VPLEX 0x2110 | ||
1838 | #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120 | ||
1839 | #define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130 | ||
1840 | 1494 | ||
1841 | /* Allied Telesyn */ | 1495 | /* Allied Telesyn */ |
1842 | #define PCI_VENDOR_ID_AT 0x1259 | 1496 | #define PCI_VENDOR_ID_AT 0x1259 |
@@ -1845,7 +1499,6 @@ | |||
1845 | 1499 | ||
1846 | #define PCI_VENDOR_ID_ESS 0x125d | 1500 | #define PCI_VENDOR_ID_ESS 0x125d |
1847 | #define PCI_DEVICE_ID_ESS_ESS1968 0x1968 | 1501 | #define PCI_DEVICE_ID_ESS_ESS1968 0x1968 |
1848 | #define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969 | ||
1849 | #define PCI_DEVICE_ID_ESS_ESS1978 0x1978 | 1502 | #define PCI_DEVICE_ID_ESS_ESS1978 0x1978 |
1850 | #define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988 | 1503 | #define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988 |
1851 | #define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989 | 1504 | #define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989 |
@@ -1858,11 +1511,7 @@ | |||
1858 | 1511 | ||
1859 | #define PCI_VENDOR_ID_SATSAGEM 0x1267 | 1512 | #define PCI_VENDOR_ID_SATSAGEM 0x1267 |
1860 | #define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 | 1513 | #define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 |
1861 | #define PCI_DEVICE_ID_SATSAGEM_PCR2101 0x5352 | ||
1862 | #define PCI_DEVICE_ID_SATSAGEM_TELSATTURBO 0x5a4b | ||
1863 | 1514 | ||
1864 | #define PCI_VENDOR_ID_HUGHES 0x1273 | ||
1865 | #define PCI_DEVICE_ID_HUGHES_DIRECPC 0x0002 | ||
1866 | 1515 | ||
1867 | #define PCI_VENDOR_ID_ENSONIQ 0x1274 | 1516 | #define PCI_VENDOR_ID_ENSONIQ 0x1274 |
1868 | #define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 | 1517 | #define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 |
@@ -1883,13 +1532,10 @@ | |||
1883 | #define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 | 1532 | #define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 |
1884 | 1533 | ||
1885 | /* formerly Platform Tech */ | 1534 | /* formerly Platform Tech */ |
1886 | #define PCI_VENDOR_ID_ESS_OLD 0x1285 | ||
1887 | #define PCI_DEVICE_ID_ESS_ESS0100 0x0100 | 1535 | #define PCI_DEVICE_ID_ESS_ESS0100 0x0100 |
1888 | 1536 | ||
1889 | #define PCI_VENDOR_ID_ALTEON 0x12ae | 1537 | #define PCI_VENDOR_ID_ALTEON 0x12ae |
1890 | #define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001 | ||
1891 | 1538 | ||
1892 | #define PCI_VENDOR_ID_USR 0x12B9 | ||
1893 | 1539 | ||
1894 | #define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 | 1540 | #define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 |
1895 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 | 1541 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 |
@@ -1904,8 +1550,6 @@ | |||
1904 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A | 1550 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A |
1905 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B | 1551 | #define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B |
1906 | 1552 | ||
1907 | #define PCI_VENDOR_ID_PICTUREL 0x12c5 | ||
1908 | #define PCI_DEVICE_ID_PICTUREL_PCIVST 0x0081 | ||
1909 | 1553 | ||
1910 | #define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 | 1554 | #define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 |
1911 | #define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 | 1555 | #define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 |
@@ -1927,8 +1571,6 @@ | |||
1927 | #define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 | 1571 | #define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 |
1928 | #define PCI_DEVICE_ID_LML_33R10 0x8a02 | 1572 | #define PCI_DEVICE_ID_LML_33R10 0x8a02 |
1929 | 1573 | ||
1930 | #define PCI_VENDOR_ID_CBOARDS 0x1307 | ||
1931 | #define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001 | ||
1932 | 1574 | ||
1933 | #define PCI_VENDOR_ID_SIIG 0x131f | 1575 | #define PCI_VENDOR_ID_SIIG 0x131f |
1934 | #define PCI_SUBVENDOR_ID_SIIG 0x131f | 1576 | #define PCI_SUBVENDOR_ID_SIIG 0x131f |
@@ -1972,7 +1614,6 @@ | |||
1972 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 | 1614 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 |
1973 | 1615 | ||
1974 | #define PCI_VENDOR_ID_RADISYS 0x1331 | 1616 | #define PCI_VENDOR_ID_RADISYS 0x1331 |
1975 | #define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030 | ||
1976 | 1617 | ||
1977 | #define PCI_VENDOR_ID_DOMEX 0x134a | 1618 | #define PCI_VENDOR_ID_DOMEX 0x134a |
1978 | #define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001 | 1619 | #define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001 |
@@ -1980,8 +1621,6 @@ | |||
1980 | #define PCI_VENDOR_ID_QUATECH 0x135C | 1621 | #define PCI_VENDOR_ID_QUATECH 0x135C |
1981 | #define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 | 1622 | #define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 |
1982 | #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 | 1623 | #define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 |
1983 | #define PCI_DEVICE_ID_QUATECH_DSC200 0x0030 | ||
1984 | #define PCI_DEVICE_ID_QUATECH_QSC200 0x0040 | ||
1985 | #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 | 1624 | #define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 |
1986 | #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 | 1625 | #define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 |
1987 | 1626 | ||
@@ -2000,7 +1639,6 @@ | |||
2000 | #define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106 | 1639 | #define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106 |
2001 | #define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 | 1640 | #define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 |
2002 | #define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 | 1641 | #define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 |
2003 | #define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109 | ||
2004 | 1642 | ||
2005 | #define PCI_VENDOR_ID_KAWASAKI 0x136b | 1643 | #define PCI_VENDOR_ID_KAWASAKI 0x136b |
2006 | #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 | 1644 | #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 |
@@ -2014,12 +1652,9 @@ | |||
2014 | #define PCI_DEVICE_ID_LMC_SSI 0x0005 | 1652 | #define PCI_DEVICE_ID_LMC_SSI 0x0005 |
2015 | #define PCI_DEVICE_ID_LMC_T1 0x0006 | 1653 | #define PCI_DEVICE_ID_LMC_T1 0x0006 |
2016 | 1654 | ||
2017 | #define PCI_VENDOR_ID_MARIAN 0x1382 | ||
2018 | #define PCI_DEVICE_ID_MARIAN_PRODIF_PLUS 0x2048 | ||
2019 | 1655 | ||
2020 | #define PCI_VENDOR_ID_NETGEAR 0x1385 | 1656 | #define PCI_VENDOR_ID_NETGEAR 0x1385 |
2021 | #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a | 1657 | #define PCI_DEVICE_ID_NETGEAR_GA620 0x620a |
2022 | #define PCI_DEVICE_ID_NETGEAR_GA622 0x622a | ||
2023 | 1658 | ||
2024 | #define PCI_VENDOR_ID_APPLICOM 0x1389 | 1659 | #define PCI_VENDOR_ID_APPLICOM 0x1389 |
2025 | #define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001 | 1660 | #define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001 |
@@ -2042,9 +1677,6 @@ | |||
2042 | #define PCI_DEVICE_ID_MOXA_CP134U 0x1340 | 1677 | #define PCI_DEVICE_ID_MOXA_CP134U 0x1340 |
2043 | #define PCI_DEVICE_ID_MOXA_C168 0x1680 | 1678 | #define PCI_DEVICE_ID_MOXA_C168 0x1680 |
2044 | #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 | 1679 | #define PCI_DEVICE_ID_MOXA_CP168U 0x1681 |
2045 | #define PCI_DEVICE_ID_MOXA_CP204J 0x2040 | ||
2046 | #define PCI_DEVICE_ID_MOXA_C218 0x2180 | ||
2047 | #define PCI_DEVICE_ID_MOXA_C320 0x3200 | ||
2048 | 1680 | ||
2049 | #define PCI_VENDOR_ID_CCD 0x1397 | 1681 | #define PCI_VENDOR_ID_CCD 0x1397 |
2050 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 | 1682 | #define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 |
@@ -2065,9 +1697,7 @@ | |||
2065 | 1697 | ||
2066 | #define PCI_VENDOR_ID_MICROGATE 0x13c0 | 1698 | #define PCI_VENDOR_ID_MICROGATE 0x13c0 |
2067 | #define PCI_DEVICE_ID_MICROGATE_USC 0x0010 | 1699 | #define PCI_DEVICE_ID_MICROGATE_USC 0x0010 |
2068 | #define PCI_DEVICE_ID_MICROGATE_SCC 0x0020 | ||
2069 | #define PCI_DEVICE_ID_MICROGATE_SCA 0x0030 | 1700 | #define PCI_DEVICE_ID_MICROGATE_SCA 0x0030 |
2070 | #define PCI_DEVICE_ID_MICROGATE_USC2 0x0210 | ||
2071 | 1701 | ||
2072 | #define PCI_VENDOR_ID_3WARE 0x13C1 | 1702 | #define PCI_VENDOR_ID_3WARE 0x13C1 |
2073 | #define PCI_DEVICE_ID_3WARE_1000 0x1000 | 1703 | #define PCI_DEVICE_ID_3WARE_1000 0x1000 |
@@ -2118,10 +1748,6 @@ | |||
2118 | 1748 | ||
2119 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 1749 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
2120 | 1750 | ||
2121 | #define PCI_VENDOR_ID_AIRONET 0x14b9 | ||
2122 | #define PCI_DEVICE_ID_AIRONET_4800_1 0x0001 | ||
2123 | #define PCI_DEVICE_ID_AIRONET_4800 0x4500 // values switched? see | ||
2124 | #define PCI_DEVICE_ID_AIRONET_4500 0x4800 // drivers/net/aironet4500_card.c | ||
2125 | 1751 | ||
2126 | #define PCI_VENDOR_ID_TITAN 0x14D2 | 1752 | #define PCI_VENDOR_ID_TITAN 0x14D2 |
2127 | #define PCI_DEVICE_ID_TITAN_010L 0x8001 | 1753 | #define PCI_DEVICE_ID_TITAN_010L 0x8001 |
@@ -2140,8 +1766,6 @@ | |||
2140 | #define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 | 1766 | #define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 |
2141 | #define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 | 1767 | #define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 |
2142 | 1768 | ||
2143 | #define PCI_VENDOR_ID_SIPACKETS 0x14d9 | ||
2144 | #define PCI_DEVICE_ID_SP_HT 0x0010 | ||
2145 | 1769 | ||
2146 | #define PCI_VENDOR_ID_AFAVLAB 0x14db | 1770 | #define PCI_VENDOR_ID_AFAVLAB 0x14db |
2147 | #define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 | 1771 | #define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 |
@@ -2164,11 +1788,13 @@ | |||
2164 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 | 1788 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 |
2165 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d | 1789 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d |
2166 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e | 1790 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e |
1791 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 | ||
2167 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a | 1792 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a |
2168 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b | 1793 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b |
2169 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1794 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
2170 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1795 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
2171 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1796 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
1797 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | ||
2172 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c | 1798 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c |
2173 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d | 1799 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d |
2174 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e | 1800 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e |
@@ -2206,8 +1832,6 @@ | |||
2206 | 1832 | ||
2207 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | 1833 | #define PCI_VENDOR_ID_CHELSIO 0x1425 |
2208 | 1834 | ||
2209 | #define PCI_VENDOR_ID_MIPS 0x153f | ||
2210 | #define PCI_DEVICE_ID_SOC_IT 0x0001 | ||
2211 | 1835 | ||
2212 | #define PCI_VENDOR_ID_SYBA 0x1592 | 1836 | #define PCI_VENDOR_ID_SYBA 0x1592 |
2213 | #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 | 1837 | #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 |
@@ -2227,15 +1851,7 @@ | |||
2227 | #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 | 1851 | #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 |
2228 | 1852 | ||
2229 | #define PCI_VENDOR_ID_PDC 0x15e9 | 1853 | #define PCI_VENDOR_ID_PDC 0x15e9 |
2230 | #define PCI_DEVICE_ID_PDC_1841 0x1841 | ||
2231 | 1854 | ||
2232 | #define PCI_VENDOR_ID_MACROLINK 0x15ed | ||
2233 | #define PCI_DEVICE_ID_MACROLINK_MCCS8 0x1000 | ||
2234 | #define PCI_DEVICE_ID_MACROLINK_MCCS 0x1001 | ||
2235 | #define PCI_DEVICE_ID_MACROLINK_MCCS8H 0x1002 | ||
2236 | #define PCI_DEVICE_ID_MACROLINK_MCCSH 0x1003 | ||
2237 | #define PCI_DEVICE_ID_MACROLINK_MCCR8 0x2000 | ||
2238 | #define PCI_DEVICE_ID_MACROLINK_MCCR 0x2001 | ||
2239 | 1855 | ||
2240 | #define PCI_VENDOR_ID_FARSITE 0x1619 | 1856 | #define PCI_VENDOR_ID_FARSITE 0x1619 |
2241 | #define PCI_DEVICE_ID_FARSITE_T2P 0x0400 | 1857 | #define PCI_DEVICE_ID_FARSITE_T2P 0x0400 |
@@ -2253,7 +1869,6 @@ | |||
2253 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 | 1869 | #define PCI_DEVICE_ID_REVOLUTION 0x0044 |
2254 | 1870 | ||
2255 | #define PCI_VENDOR_ID_LINKSYS 0x1737 | 1871 | #define PCI_VENDOR_ID_LINKSYS 0x1737 |
2256 | #define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032 | ||
2257 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 | 1872 | #define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 |
2258 | 1873 | ||
2259 | #define PCI_VENDOR_ID_ALTIMA 0x173b | 1874 | #define PCI_VENDOR_ID_ALTIMA 0x173b |
@@ -2268,7 +1883,6 @@ | |||
2268 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 | 1883 | #define PCI_DEVICE_ID_HERC_WIN 0x5732 |
2269 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 | 1884 | #define PCI_DEVICE_ID_HERC_UNI 0x5832 |
2270 | 1885 | ||
2271 | #define PCI_VENDOR_ID_INFINICON 0x1820 | ||
2272 | 1886 | ||
2273 | #define PCI_VENDOR_ID_SITECOM 0x182d | 1887 | #define PCI_VENDOR_ID_SITECOM 0x182d |
2274 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 | 1888 | #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 |
@@ -2278,8 +1892,6 @@ | |||
2278 | #define PCI_VENDOR_ID_TDI 0x192E | 1892 | #define PCI_VENDOR_ID_TDI 0x192E |
2279 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 1893 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
2280 | 1894 | ||
2281 | #define PCI_VENDOR_ID_SYMPHONY 0x1c1c | ||
2282 | #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 | ||
2283 | 1895 | ||
2284 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 | 1896 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 |
2285 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 | 1897 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 |
@@ -2288,70 +1900,33 @@ | |||
2288 | #define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013 | 1900 | #define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013 |
2289 | 1901 | ||
2290 | #define PCI_VENDOR_ID_3DLABS 0x3d3d | 1902 | #define PCI_VENDOR_ID_3DLABS 0x3d3d |
2291 | #define PCI_DEVICE_ID_3DLABS_300SX 0x0001 | ||
2292 | #define PCI_DEVICE_ID_3DLABS_500TX 0x0002 | ||
2293 | #define PCI_DEVICE_ID_3DLABS_DELTA 0x0003 | ||
2294 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA 0x0004 | ||
2295 | #define PCI_DEVICE_ID_3DLABS_MX 0x0006 | ||
2296 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 | 1903 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 |
2297 | #define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008 | ||
2298 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 | 1904 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 |
2299 | 1905 | ||
2300 | #define PCI_VENDOR_ID_AVANCE 0x4005 | ||
2301 | #define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064 | ||
2302 | #define PCI_DEVICE_ID_AVANCE_2302 0x2302 | ||
2303 | 1906 | ||
2304 | #define PCI_VENDOR_ID_AKS 0x416c | 1907 | #define PCI_VENDOR_ID_AKS 0x416c |
2305 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 | 1908 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 |
2306 | #define PCI_DEVICE_ID_AKS_CPC 0x0200 | ||
2307 | 1909 | ||
2308 | #define PCI_VENDOR_ID_REDCREEK 0x4916 | ||
2309 | #define PCI_DEVICE_ID_RC45 0x1960 | ||
2310 | 1910 | ||
2311 | #define PCI_VENDOR_ID_NETVIN 0x4a14 | ||
2312 | #define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000 | ||
2313 | 1911 | ||
2314 | #define PCI_VENDOR_ID_S3 0x5333 | 1912 | #define PCI_VENDOR_ID_S3 0x5333 |
2315 | #define PCI_DEVICE_ID_S3_PLATO_PXS 0x0551 | ||
2316 | #define PCI_DEVICE_ID_S3_ViRGE 0x5631 | ||
2317 | #define PCI_DEVICE_ID_S3_TRIO 0x8811 | 1913 | #define PCI_DEVICE_ID_S3_TRIO 0x8811 |
2318 | #define PCI_DEVICE_ID_S3_AURORA64VP 0x8812 | ||
2319 | #define PCI_DEVICE_ID_S3_TRIO64UVP 0x8814 | ||
2320 | #define PCI_DEVICE_ID_S3_ViRGE_VX 0x883d | ||
2321 | #define PCI_DEVICE_ID_S3_868 0x8880 | 1914 | #define PCI_DEVICE_ID_S3_868 0x8880 |
2322 | #define PCI_DEVICE_ID_S3_928 0x88b0 | ||
2323 | #define PCI_DEVICE_ID_S3_864_1 0x88c0 | ||
2324 | #define PCI_DEVICE_ID_S3_864_2 0x88c1 | ||
2325 | #define PCI_DEVICE_ID_S3_964_1 0x88d0 | ||
2326 | #define PCI_DEVICE_ID_S3_964_2 0x88d1 | ||
2327 | #define PCI_DEVICE_ID_S3_968 0x88f0 | 1915 | #define PCI_DEVICE_ID_S3_968 0x88f0 |
2328 | #define PCI_DEVICE_ID_S3_TRIO64V2 0x8901 | ||
2329 | #define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902 | ||
2330 | #define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01 | ||
2331 | #define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10 | ||
2332 | #define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25 | 1916 | #define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25 |
2333 | #define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01 | ||
2334 | #define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02 | ||
2335 | #define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03 | ||
2336 | #define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04 | 1917 | #define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04 |
2337 | #define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 | 1918 | #define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 |
2338 | 1919 | ||
2339 | #define PCI_VENDOR_ID_DUNORD 0x5544 | 1920 | #define PCI_VENDOR_ID_DUNORD 0x5544 |
2340 | #define PCI_DEVICE_ID_DUNORD_I3000 0x0001 | 1921 | #define PCI_DEVICE_ID_DUNORD_I3000 0x0001 |
2341 | 1922 | ||
1923 | |||
2342 | #define PCI_VENDOR_ID_DCI 0x6666 | 1924 | #define PCI_VENDOR_ID_DCI 0x6666 |
2343 | #define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 | 1925 | #define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 |
2344 | #define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 | 1926 | #define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 |
2345 | 1927 | ||
2346 | #define PCI_VENDOR_ID_DUNORD 0x5544 | ||
2347 | #define PCI_DEVICE_ID_DUNORD_I3000 0x0001 | ||
2348 | |||
2349 | #define PCI_VENDOR_ID_GENROCO 0x5555 | ||
2350 | #define PCI_DEVICE_ID_GENROCO_HFP832 0x0003 | ||
2351 | |||
2352 | #define PCI_VENDOR_ID_INTEL 0x8086 | 1928 | #define PCI_VENDOR_ID_INTEL 0x8086 |
2353 | #define PCI_DEVICE_ID_INTEL_EESSC 0x0008 | 1929 | #define PCI_DEVICE_ID_INTEL_EESSC 0x0008 |
2354 | #define PCI_DEVICE_ID_INTEL_21145 0x0039 | ||
2355 | #define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 | 1930 | #define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 |
2356 | #define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 | 1931 | #define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 |
2357 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 | 1932 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 |
@@ -2360,30 +1935,17 @@ | |||
2360 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 | 1935 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 |
2361 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 | 1936 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 |
2362 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 | 1937 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 |
2363 | #define PCI_DEVICE_ID_INTEL_82430 0x0486 | ||
2364 | #define PCI_DEVICE_ID_INTEL_82434 0x04a3 | ||
2365 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 | 1938 | #define PCI_DEVICE_ID_INTEL_I960 0x0960 |
2366 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 | 1939 | #define PCI_DEVICE_ID_INTEL_I960RM 0x0962 |
2367 | #define PCI_DEVICE_ID_INTEL_82562ET 0x1031 | ||
2368 | #define PCI_DEVICE_ID_INTEL_82801CAM 0x1038 | ||
2369 | #define PCI_DEVICE_ID_INTEL_82815_MC 0x1130 | 1940 | #define PCI_DEVICE_ID_INTEL_82815_MC 0x1130 |
2370 | #define PCI_DEVICE_ID_INTEL_82815_AB 0x1131 | ||
2371 | #define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132 | 1941 | #define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132 |
2372 | #define PCI_DEVICE_ID_INTEL_82559ER 0x1209 | ||
2373 | #define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221 | 1942 | #define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221 |
2374 | #define PCI_DEVICE_ID_INTEL_82092AA_1 0x1222 | ||
2375 | #define PCI_DEVICE_ID_INTEL_7116 0x1223 | ||
2376 | #define PCI_DEVICE_ID_INTEL_7505_0 0x2550 | 1943 | #define PCI_DEVICE_ID_INTEL_7505_0 0x2550 |
2377 | #define PCI_DEVICE_ID_INTEL_7505_1 0x2552 | ||
2378 | #define PCI_DEVICE_ID_INTEL_7205_0 0x255d | 1944 | #define PCI_DEVICE_ID_INTEL_7205_0 0x255d |
2379 | #define PCI_DEVICE_ID_INTEL_82596 0x1226 | ||
2380 | #define PCI_DEVICE_ID_INTEL_82865 0x1227 | ||
2381 | #define PCI_DEVICE_ID_INTEL_82557 0x1229 | ||
2382 | #define PCI_DEVICE_ID_INTEL_82437 0x122d | 1945 | #define PCI_DEVICE_ID_INTEL_82437 0x122d |
2383 | #define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e | 1946 | #define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e |
2384 | #define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230 | 1947 | #define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230 |
2385 | #define PCI_DEVICE_ID_INTEL_82371MX 0x1234 | 1948 | #define PCI_DEVICE_ID_INTEL_82371MX 0x1234 |
2386 | #define PCI_DEVICE_ID_INTEL_82437MX 0x1235 | ||
2387 | #define PCI_DEVICE_ID_INTEL_82441 0x1237 | 1949 | #define PCI_DEVICE_ID_INTEL_82441 0x1237 |
2388 | #define PCI_DEVICE_ID_INTEL_82380FB 0x124b | 1950 | #define PCI_DEVICE_ID_INTEL_82380FB 0x124b |
2389 | #define PCI_DEVICE_ID_INTEL_82439 0x1250 | 1951 | #define PCI_DEVICE_ID_INTEL_82439 0x1250 |
@@ -2392,83 +1954,53 @@ | |||
2392 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 | 1954 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 |
2393 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 1955 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
2394 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 1956 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
2395 | #define PCI_DEVICE_ID_INTEL_82801AA_2 0x2412 | ||
2396 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 | 1957 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 |
2397 | #define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 | 1958 | #define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 |
2398 | #define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416 | 1959 | #define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416 |
2399 | #define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418 | 1960 | #define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418 |
2400 | #define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420 | 1961 | #define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420 |
2401 | #define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421 | 1962 | #define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421 |
2402 | #define PCI_DEVICE_ID_INTEL_82801AB_2 0x2422 | ||
2403 | #define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423 | 1963 | #define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423 |
2404 | #define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425 | 1964 | #define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425 |
2405 | #define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426 | 1965 | #define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426 |
2406 | #define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428 | 1966 | #define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428 |
2407 | #define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440 | 1967 | #define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440 |
2408 | #define PCI_DEVICE_ID_INTEL_82801BA_1 0x2442 | ||
2409 | #define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443 | 1968 | #define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443 |
2410 | #define PCI_DEVICE_ID_INTEL_82801BA_3 0x2444 | ||
2411 | #define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445 | 1969 | #define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445 |
2412 | #define PCI_DEVICE_ID_INTEL_82801BA_5 0x2446 | ||
2413 | #define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448 | 1970 | #define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448 |
2414 | #define PCI_DEVICE_ID_INTEL_82801BA_7 0x2449 | ||
2415 | #define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a | 1971 | #define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a |
2416 | #define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b | 1972 | #define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b |
2417 | #define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c | 1973 | #define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c |
2418 | #define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e | 1974 | #define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e |
2419 | #define PCI_DEVICE_ID_INTEL_82801E_0 0x2450 | 1975 | #define PCI_DEVICE_ID_INTEL_82801E_0 0x2450 |
2420 | #define PCI_DEVICE_ID_INTEL_82801E_2 0x2452 | ||
2421 | #define PCI_DEVICE_ID_INTEL_82801E_3 0x2453 | ||
2422 | #define PCI_DEVICE_ID_INTEL_82801E_9 0x2459 | ||
2423 | #define PCI_DEVICE_ID_INTEL_82801E_11 0x245b | 1976 | #define PCI_DEVICE_ID_INTEL_82801E_11 0x245b |
2424 | #define PCI_DEVICE_ID_INTEL_82801E_13 0x245d | ||
2425 | #define PCI_DEVICE_ID_INTEL_82801E_14 0x245e | ||
2426 | #define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480 | 1977 | #define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480 |
2427 | #define PCI_DEVICE_ID_INTEL_82801CA_2 0x2482 | ||
2428 | #define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483 | 1978 | #define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483 |
2429 | #define PCI_DEVICE_ID_INTEL_82801CA_4 0x2484 | ||
2430 | #define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485 | 1979 | #define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485 |
2431 | #define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486 | 1980 | #define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486 |
2432 | #define PCI_DEVICE_ID_INTEL_82801CA_7 0x2487 | ||
2433 | #define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a | 1981 | #define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a |
2434 | #define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b | 1982 | #define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b |
2435 | #define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c | 1983 | #define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c |
2436 | #define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0 | 1984 | #define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0 |
2437 | #define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1 | 1985 | #define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1 |
2438 | #define PCI_DEVICE_ID_INTEL_82801DB_2 0x24c2 | ||
2439 | #define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3 | 1986 | #define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3 |
2440 | #define PCI_DEVICE_ID_INTEL_82801DB_4 0x24c4 | ||
2441 | #define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5 | 1987 | #define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5 |
2442 | #define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6 | 1988 | #define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6 |
2443 | #define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7 | ||
2444 | #define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9 | 1989 | #define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9 |
2445 | #define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca | 1990 | #define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca |
2446 | #define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb | 1991 | #define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb |
2447 | #define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc | 1992 | #define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc |
2448 | #define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd | ||
2449 | #define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0 | 1993 | #define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0 |
2450 | #define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1 | 1994 | #define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1 |
2451 | #define PCI_DEVICE_ID_INTEL_82801EB_2 0x24d2 | ||
2452 | #define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3 | 1995 | #define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3 |
2453 | #define PCI_DEVICE_ID_INTEL_82801EB_4 0x24d4 | ||
2454 | #define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 | 1996 | #define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 |
2455 | #define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 | 1997 | #define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 |
2456 | #define PCI_DEVICE_ID_INTEL_82801EB_7 0x24d7 | ||
2457 | #define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db | 1998 | #define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db |
2458 | #define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd | ||
2459 | #define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 | 1999 | #define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 |
2460 | #define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 | 2000 | #define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 |
2461 | #define PCI_DEVICE_ID_INTEL_ESB_3 0x25a3 | ||
2462 | #define PCI_DEVICE_ID_INTEL_ESB_31 0x25b0 | ||
2463 | #define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 | 2001 | #define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 |
2464 | #define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 | 2002 | #define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 |
2465 | #define PCI_DEVICE_ID_INTEL_ESB_6 0x25a7 | ||
2466 | #define PCI_DEVICE_ID_INTEL_ESB_7 0x25a9 | ||
2467 | #define PCI_DEVICE_ID_INTEL_ESB_8 0x25aa | ||
2468 | #define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab | 2003 | #define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab |
2469 | #define PCI_DEVICE_ID_INTEL_ESB_11 0x25ac | ||
2470 | #define PCI_DEVICE_ID_INTEL_ESB_12 0x25ad | ||
2471 | #define PCI_DEVICE_ID_INTEL_ESB_13 0x25ae | ||
2472 | #define PCI_DEVICE_ID_INTEL_82820_HB 0x2500 | 2004 | #define PCI_DEVICE_ID_INTEL_82820_HB 0x2500 |
2473 | #define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 | 2005 | #define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 |
2474 | #define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 | 2006 | #define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 |
@@ -2478,7 +2010,6 @@ | |||
2478 | #define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 | 2010 | #define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 |
2479 | #define PCI_DEVICE_ID_INTEL_82865_IG 0x2572 | 2011 | #define PCI_DEVICE_ID_INTEL_82865_IG 0x2572 |
2480 | #define PCI_DEVICE_ID_INTEL_82875_HB 0x2578 | 2012 | #define PCI_DEVICE_ID_INTEL_82875_HB 0x2578 |
2481 | #define PCI_DEVICE_ID_INTEL_82875_IG 0x257b | ||
2482 | #define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580 | 2013 | #define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580 |
2483 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 | 2014 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 |
2484 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 | 2015 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 |
@@ -2488,80 +2019,23 @@ | |||
2488 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 | 2019 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 |
2489 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 | 2020 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 |
2490 | #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 | 2021 | #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 |
2491 | #define PCI_DEVICE_ID_INTEL_ICH6_3 0x2651 | ||
2492 | #define PCI_DEVICE_ID_INTEL_ICH6_4 0x2652 | ||
2493 | #define PCI_DEVICE_ID_INTEL_ICH6_5 0x2653 | ||
2494 | #define PCI_DEVICE_ID_INTEL_ICH6_6 0x2658 | ||
2495 | #define PCI_DEVICE_ID_INTEL_ICH6_7 0x2659 | ||
2496 | #define PCI_DEVICE_ID_INTEL_ICH6_8 0x265a | ||
2497 | #define PCI_DEVICE_ID_INTEL_ICH6_9 0x265b | ||
2498 | #define PCI_DEVICE_ID_INTEL_ICH6_10 0x265c | ||
2499 | #define PCI_DEVICE_ID_INTEL_ICH6_11 0x2660 | ||
2500 | #define PCI_DEVICE_ID_INTEL_ICH6_12 0x2662 | ||
2501 | #define PCI_DEVICE_ID_INTEL_ICH6_13 0x2664 | ||
2502 | #define PCI_DEVICE_ID_INTEL_ICH6_14 0x2666 | ||
2503 | #define PCI_DEVICE_ID_INTEL_ICH6_15 0x2668 | ||
2504 | #define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a | 2022 | #define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a |
2505 | #define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d | 2023 | #define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d |
2506 | #define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e | 2024 | #define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e |
2507 | #define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f | 2025 | #define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f |
2508 | #define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670 | 2026 | #define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670 |
2509 | #define PCI_DEVICE_ID_INTEL_ESB2_1 0x2680 | ||
2510 | #define PCI_DEVICE_ID_INTEL_ESB2_2 0x2681 | ||
2511 | #define PCI_DEVICE_ID_INTEL_ESB2_3 0x2682 | ||
2512 | #define PCI_DEVICE_ID_INTEL_ESB2_4 0x2683 | ||
2513 | #define PCI_DEVICE_ID_INTEL_ESB2_5 0x2688 | ||
2514 | #define PCI_DEVICE_ID_INTEL_ESB2_6 0x2689 | ||
2515 | #define PCI_DEVICE_ID_INTEL_ESB2_7 0x268a | ||
2516 | #define PCI_DEVICE_ID_INTEL_ESB2_8 0x268b | ||
2517 | #define PCI_DEVICE_ID_INTEL_ESB2_9 0x268c | ||
2518 | #define PCI_DEVICE_ID_INTEL_ESB2_10 0x2690 | ||
2519 | #define PCI_DEVICE_ID_INTEL_ESB2_11 0x2692 | ||
2520 | #define PCI_DEVICE_ID_INTEL_ESB2_12 0x2694 | ||
2521 | #define PCI_DEVICE_ID_INTEL_ESB2_13 0x2696 | ||
2522 | #define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698 | 2027 | #define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698 |
2523 | #define PCI_DEVICE_ID_INTEL_ESB2_15 0x2699 | ||
2524 | #define PCI_DEVICE_ID_INTEL_ESB2_16 0x269a | ||
2525 | #define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b | 2028 | #define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b |
2526 | #define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e | 2029 | #define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e |
2527 | #define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8 | 2030 | #define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8 |
2528 | #define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 | 2031 | #define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 |
2529 | #define PCI_DEVICE_ID_INTEL_ICH7_2 0x27c0 | ||
2530 | #define PCI_DEVICE_ID_INTEL_ICH7_3 0x27c1 | ||
2531 | #define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 | 2032 | #define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 |
2532 | #define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd | 2033 | #define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd |
2533 | #define PCI_DEVICE_ID_INTEL_ICH7_5 0x27c4 | ||
2534 | #define PCI_DEVICE_ID_INTEL_ICH7_6 0x27c5 | ||
2535 | #define PCI_DEVICE_ID_INTEL_ICH7_7 0x27c8 | ||
2536 | #define PCI_DEVICE_ID_INTEL_ICH7_8 0x27c9 | ||
2537 | #define PCI_DEVICE_ID_INTEL_ICH7_9 0x27ca | ||
2538 | #define PCI_DEVICE_ID_INTEL_ICH7_10 0x27cb | ||
2539 | #define PCI_DEVICE_ID_INTEL_ICH7_11 0x27cc | ||
2540 | #define PCI_DEVICE_ID_INTEL_ICH7_12 0x27d0 | ||
2541 | #define PCI_DEVICE_ID_INTEL_ICH7_13 0x27d2 | ||
2542 | #define PCI_DEVICE_ID_INTEL_ICH7_14 0x27d4 | ||
2543 | #define PCI_DEVICE_ID_INTEL_ICH7_15 0x27d6 | ||
2544 | #define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8 | ||
2545 | #define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da | 2034 | #define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da |
2546 | #define PCI_DEVICE_ID_INTEL_ICH7_18 0x27dc | ||
2547 | #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd | 2035 | #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd |
2548 | #define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de | 2036 | #define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de |
2549 | #define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df | 2037 | #define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df |
2550 | #define PCI_DEVICE_ID_INTEL_ICH7_22 0x27e0 | ||
2551 | #define PCI_DEVICE_ID_INTEL_ICH7_23 0x27e2 | ||
2552 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 | 2038 | #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 |
2553 | #define PCI_DEVICE_ID_INTEL_ESB2_19 0x3500 | ||
2554 | #define PCI_DEVICE_ID_INTEL_ESB2_20 0x3501 | ||
2555 | #define PCI_DEVICE_ID_INTEL_ESB2_21 0x3504 | ||
2556 | #define PCI_DEVICE_ID_INTEL_ESB2_22 0x3505 | ||
2557 | #define PCI_DEVICE_ID_INTEL_ESB2_23 0x350c | ||
2558 | #define PCI_DEVICE_ID_INTEL_ESB2_24 0x350d | ||
2559 | #define PCI_DEVICE_ID_INTEL_ESB2_25 0x3510 | ||
2560 | #define PCI_DEVICE_ID_INTEL_ESB2_26 0x3511 | ||
2561 | #define PCI_DEVICE_ID_INTEL_ESB2_27 0x3514 | ||
2562 | #define PCI_DEVICE_ID_INTEL_ESB2_28 0x3515 | ||
2563 | #define PCI_DEVICE_ID_INTEL_ESB2_29 0x3518 | ||
2564 | #define PCI_DEVICE_ID_INTEL_ESB2_30 0x3519 | ||
2565 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 | 2039 | #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 |
2566 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 | 2040 | #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 |
2567 | #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 | 2041 | #define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 |
@@ -2575,7 +2049,6 @@ | |||
2575 | #define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 | 2049 | #define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 |
2576 | #define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a | 2050 | #define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a |
2577 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e | 2051 | #define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e |
2578 | #define PCI_DEVICE_ID_INTEL_80310 0x530d | ||
2579 | #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 | 2052 | #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 |
2580 | #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 | 2053 | #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 |
2581 | #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 | 2054 | #define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 |
@@ -2600,22 +2073,15 @@ | |||
2600 | #define PCI_DEVICE_ID_INTEL_440MX_6 0x7196 | 2073 | #define PCI_DEVICE_ID_INTEL_440MX_6 0x7196 |
2601 | #define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198 | 2074 | #define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198 |
2602 | #define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199 | 2075 | #define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199 |
2603 | #define PCI_DEVICE_ID_INTEL_82443MX_2 0x719a | ||
2604 | #define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b | 2076 | #define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b |
2605 | #define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0 | 2077 | #define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0 |
2606 | #define PCI_DEVICE_ID_INTEL_82443GX_1 0x71a1 | ||
2607 | #define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 | 2078 | #define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 |
2608 | #define PCI_DEVICE_ID_INTEL_82372FB_0 0x7600 | ||
2609 | #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 | 2079 | #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 |
2610 | #define PCI_DEVICE_ID_INTEL_82372FB_2 0x7602 | ||
2611 | #define PCI_DEVICE_ID_INTEL_82372FB_3 0x7603 | ||
2612 | #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 | 2080 | #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 |
2613 | #define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 | ||
2614 | #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca | 2081 | #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca |
2615 | #define PCI_DEVICE_ID_INTEL_82454NX 0x84cb | 2082 | #define PCI_DEVICE_ID_INTEL_82454NX 0x84cb |
2616 | #define PCI_DEVICE_ID_INTEL_84460GX 0x84ea | 2083 | #define PCI_DEVICE_ID_INTEL_84460GX 0x84ea |
2617 | #define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500 | 2084 | #define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500 |
2618 | #define PCI_DEVICE_ID_INTEL_IXP2400 0x9001 | ||
2619 | #define PCI_DEVICE_ID_INTEL_IXP2800 0x9004 | 2085 | #define PCI_DEVICE_ID_INTEL_IXP2800 0x9004 |
2620 | #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 | 2086 | #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 |
2621 | 2087 | ||
@@ -2628,7 +2094,6 @@ | |||
2628 | #define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003 | 2094 | #define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003 |
2629 | 2095 | ||
2630 | #define PCI_VENDOR_ID_KTI 0x8e2e | 2096 | #define PCI_VENDOR_ID_KTI 0x8e2e |
2631 | #define PCI_DEVICE_ID_KTI_ET32P2 0x3000 | ||
2632 | 2097 | ||
2633 | #define PCI_VENDOR_ID_ADAPTEC 0x9004 | 2098 | #define PCI_VENDOR_ID_ADAPTEC 0x9004 |
2634 | #define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 | 2099 | #define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 |
@@ -2636,7 +2101,6 @@ | |||
2636 | #define PCI_DEVICE_ID_ADAPTEC_38602 0x3860 | 2101 | #define PCI_DEVICE_ID_ADAPTEC_38602 0x3860 |
2637 | #define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 | 2102 | #define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 |
2638 | #define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 | 2103 | #define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 |
2639 | #define PCI_DEVICE_ID_ADAPTEC_5800 0x5800 | ||
2640 | #define PCI_DEVICE_ID_ADAPTEC_3860 0x6038 | 2104 | #define PCI_DEVICE_ID_ADAPTEC_3860 0x6038 |
2641 | #define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075 | 2105 | #define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075 |
2642 | #define PCI_DEVICE_ID_ADAPTEC_7860 0x6078 | 2106 | #define PCI_DEVICE_ID_ADAPTEC_7860 0x6078 |
@@ -2656,7 +2120,6 @@ | |||
2656 | #define PCI_DEVICE_ID_ADAPTEC_7886 0x8678 | 2120 | #define PCI_DEVICE_ID_ADAPTEC_7886 0x8678 |
2657 | #define PCI_DEVICE_ID_ADAPTEC_7887 0x8778 | 2121 | #define PCI_DEVICE_ID_ADAPTEC_7887 0x8778 |
2658 | #define PCI_DEVICE_ID_ADAPTEC_7888 0x8878 | 2122 | #define PCI_DEVICE_ID_ADAPTEC_7888 0x8878 |
2659 | #define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78 | ||
2660 | 2123 | ||
2661 | #define PCI_VENDOR_ID_ADAPTEC2 0x9005 | 2124 | #define PCI_VENDOR_ID_ADAPTEC2 0x9005 |
2662 | #define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010 | 2125 | #define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010 |
@@ -2676,8 +2139,6 @@ | |||
2676 | #define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf | 2139 | #define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf |
2677 | #define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 | 2140 | #define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 |
2678 | 2141 | ||
2679 | #define PCI_VENDOR_ID_ATRONICS 0x907f | ||
2680 | #define PCI_DEVICE_ID_ATRONICS_2015 0x2015 | ||
2681 | 2142 | ||
2682 | #define PCI_VENDOR_ID_HOLTEK 0x9412 | 2143 | #define PCI_VENDOR_ID_HOLTEK 0x9412 |
2683 | #define PCI_DEVICE_ID_HOLTEK_6565 0x6565 | 2144 | #define PCI_DEVICE_ID_HOLTEK_6565 0x6565 |
@@ -2696,6 +2157,7 @@ | |||
2696 | 2157 | ||
2697 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d | 2158 | #define PCI_SUBVENDOR_ID_EXSYS 0xd84d |
2698 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 | 2159 | #define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 |
2160 | #define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 | ||
2699 | 2161 | ||
2700 | #define PCI_VENDOR_ID_TIGERJET 0xe159 | 2162 | #define PCI_VENDOR_ID_TIGERJET 0xe159 |
2701 | #define PCI_DEVICE_ID_TIGERJET_300 0x0001 | 2163 | #define PCI_DEVICE_ID_TIGERJET_300 0x0001 |
@@ -2709,7 +2171,3 @@ | |||
2709 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 | 2171 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 |
2710 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 | 2172 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 |
2711 | 2173 | ||
2712 | #define PCI_VENDOR_ID_ARK 0xedd8 | ||
2713 | #define PCI_DEVICE_ID_ARK_STING 0xa091 | ||
2714 | #define PCI_DEVICE_ID_ARK_STINGARK 0xa099 | ||
2715 | #define PCI_DEVICE_ID_ARK_2000MT 0xa0a1 | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h new file mode 100644 index 000000000000..a726225e0afe --- /dev/null +++ b/include/linux/platform_device.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * platform_device.h - generic, centralized driver model | ||
3 | * | ||
4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | * | ||
8 | * See Documentation/driver-model/ for more information. | ||
9 | */ | ||
10 | |||
11 | #ifndef _PLATFORM_DEVICE_H_ | ||
12 | #define _PLATFORM_DEVICE_H_ | ||
13 | |||
14 | #include <linux/device.h> | ||
15 | |||
16 | struct platform_device { | ||
17 | const char * name; | ||
18 | u32 id; | ||
19 | struct device dev; | ||
20 | u32 num_resources; | ||
21 | struct resource * resource; | ||
22 | }; | ||
23 | |||
24 | #define to_platform_device(x) container_of((x), struct platform_device, dev) | ||
25 | |||
26 | extern int platform_device_register(struct platform_device *); | ||
27 | extern void platform_device_unregister(struct platform_device *); | ||
28 | |||
29 | extern struct bus_type platform_bus_type; | ||
30 | extern struct device platform_bus; | ||
31 | |||
32 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); | ||
33 | extern int platform_get_irq(struct platform_device *, unsigned int); | ||
34 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *); | ||
35 | extern int platform_get_irq_byname(struct platform_device *, char *); | ||
36 | extern int platform_add_devices(struct platform_device **, int); | ||
37 | |||
38 | extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int); | ||
39 | |||
40 | #endif /* _PLATFORM_DEVICE_H_ */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5cfb07648eca..1514098d156d 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -170,6 +170,7 @@ typedef int __bitwise suspend_disk_method_t; | |||
170 | 170 | ||
171 | struct pm_ops { | 171 | struct pm_ops { |
172 | suspend_disk_method_t pm_disk_mode; | 172 | suspend_disk_method_t pm_disk_mode; |
173 | int (*valid)(suspend_state_t state); | ||
173 | int (*prepare)(suspend_state_t state); | 174 | int (*prepare)(suspend_state_t state); |
174 | int (*enter)(suspend_state_t state); | 175 | int (*enter)(suspend_state_t state); |
175 | int (*finish)(suspend_state_t state); | 176 | int (*finish)(suspend_state_t state); |
@@ -219,10 +220,11 @@ typedef struct pm_message { | |||
219 | 220 | ||
220 | struct dev_pm_info { | 221 | struct dev_pm_info { |
221 | pm_message_t power_state; | 222 | pm_message_t power_state; |
223 | unsigned can_wakeup:1; | ||
222 | #ifdef CONFIG_PM | 224 | #ifdef CONFIG_PM |
225 | unsigned should_wakeup:1; | ||
223 | pm_message_t prev_state; | 226 | pm_message_t prev_state; |
224 | void * saved_state; | 227 | void * saved_state; |
225 | atomic_t pm_users; | ||
226 | struct device * pm_parent; | 228 | struct device * pm_parent; |
227 | struct list_head entry; | 229 | struct list_head entry; |
228 | #endif | 230 | #endif |
@@ -236,13 +238,48 @@ extern void device_resume(void); | |||
236 | 238 | ||
237 | #ifdef CONFIG_PM | 239 | #ifdef CONFIG_PM |
238 | extern int device_suspend(pm_message_t state); | 240 | extern int device_suspend(pm_message_t state); |
239 | #else | 241 | |
242 | #define device_set_wakeup_enable(dev,val) \ | ||
243 | ((dev)->power.should_wakeup = !!(val)) | ||
244 | #define device_may_wakeup(dev) \ | ||
245 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
246 | |||
247 | extern int dpm_runtime_suspend(struct device *, pm_message_t); | ||
248 | extern void dpm_runtime_resume(struct device *); | ||
249 | |||
250 | #else /* !CONFIG_PM */ | ||
251 | |||
240 | static inline int device_suspend(pm_message_t state) | 252 | static inline int device_suspend(pm_message_t state) |
241 | { | 253 | { |
242 | return 0; | 254 | return 0; |
243 | } | 255 | } |
256 | |||
257 | #define device_set_wakeup_enable(dev,val) do{}while(0) | ||
258 | #define device_may_wakeup(dev) (0) | ||
259 | |||
260 | static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | ||
261 | { | ||
262 | return 0; | ||
263 | } | ||
264 | |||
265 | static inline void dpm_runtime_resume(struct device * dev) | ||
266 | { | ||
267 | |||
268 | } | ||
269 | |||
244 | #endif | 270 | #endif |
245 | 271 | ||
272 | /* changes to device_may_wakeup take effect on the next pm state change. | ||
273 | * by default, devices should wakeup if they can. | ||
274 | */ | ||
275 | #define device_can_wakeup(dev) \ | ||
276 | ((dev)->power.can_wakeup) | ||
277 | #define device_init_wakeup(dev,val) \ | ||
278 | do { \ | ||
279 | device_can_wakeup(dev) = !!(val); \ | ||
280 | device_set_wakeup_enable(dev,val); \ | ||
281 | } while(0) | ||
282 | |||
246 | #endif /* __KERNEL__ */ | 283 | #endif /* __KERNEL__ */ |
247 | 284 | ||
248 | #endif /* _LINUX_PM_H */ | 285 | #endif /* _LINUX_PM_H */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 045d4761febc..9f0f9281f42a 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | struct radix_tree_root { | 25 | struct radix_tree_root { |
26 | unsigned int height; | 26 | unsigned int height; |
27 | unsigned int gfp_mask; | 27 | gfp_t gfp_mask; |
28 | struct radix_tree_node *rnode; | 28 | struct radix_tree_node *rnode; |
29 | }; | 29 | }; |
30 | 30 | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 70191a5a148f..cce25591eec2 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -275,6 +275,7 @@ static inline int rcu_pending(int cpu) | |||
275 | extern void rcu_init(void); | 275 | extern void rcu_init(void); |
276 | extern void rcu_check_callbacks(int cpu, int user); | 276 | extern void rcu_check_callbacks(int cpu, int user); |
277 | extern void rcu_restart_cpu(int cpu); | 277 | extern void rcu_restart_cpu(int cpu); |
278 | extern long rcu_batches_completed(void); | ||
278 | 279 | ||
279 | /* Exported interfaces */ | 280 | /* Exported interfaces */ |
280 | extern void FASTCALL(call_rcu(struct rcu_head *head, | 281 | extern void FASTCALL(call_rcu(struct rcu_head *head, |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index af00b10294cd..001ab82df051 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1972,7 +1972,7 @@ extern struct address_space_operations reiserfs_address_space_operations; | |||
1972 | 1972 | ||
1973 | /* fix_nodes.c */ | 1973 | /* fix_nodes.c */ |
1974 | #ifdef CONFIG_REISERFS_CHECK | 1974 | #ifdef CONFIG_REISERFS_CHECK |
1975 | void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s); | 1975 | void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s); |
1976 | void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); | 1976 | void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); |
1977 | #else | 1977 | #else |
1978 | static inline void *reiserfs_kmalloc(size_t size, int flags, | 1978 | static inline void *reiserfs_kmalloc(size_t size, int flags, |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index e80fb7ee6efd..35b30e6c8cf8 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -95,8 +95,8 @@ int try_to_unmap(struct page *); | |||
95 | /* | 95 | /* |
96 | * Called from mm/filemap_xip.c to unmap empty zero page | 96 | * Called from mm/filemap_xip.c to unmap empty zero page |
97 | */ | 97 | */ |
98 | pte_t *page_check_address(struct page *, struct mm_struct *, unsigned long); | 98 | pte_t *page_check_address(struct page *, struct mm_struct *, |
99 | 99 | unsigned long, spinlock_t **); | |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * Used by swapoff to help locate where page is expected in vma. | 102 | * Used by swapoff to help locate where page is expected in vma. |
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index b52a2af25f1f..f30f805080ae 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
@@ -61,5 +61,10 @@ extern void FASTCALL(__up_read(struct rw_semaphore *sem)); | |||
61 | extern void FASTCALL(__up_write(struct rw_semaphore *sem)); | 61 | extern void FASTCALL(__up_write(struct rw_semaphore *sem)); |
62 | extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem)); | 62 | extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem)); |
63 | 63 | ||
64 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
65 | { | ||
66 | return (sem->activity != 0); | ||
67 | } | ||
68 | |||
64 | #endif /* __KERNEL__ */ | 69 | #endif /* __KERNEL__ */ |
65 | #endif /* _LINUX_RWSEM_SPINLOCK_H */ | 70 | #endif /* _LINUX_RWSEM_SPINLOCK_H */ |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 7f717e95ae37..66ff545552f7 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -1,14 +1,23 @@ | |||
1 | #ifndef _LINUX_SCATTERLIST_H | 1 | #ifndef _LINUX_SCATTERLIST_H |
2 | #define _LINUX_SCATTERLIST_H | 2 | #define _LINUX_SCATTERLIST_H |
3 | 3 | ||
4 | static inline void sg_init_one(struct scatterlist *sg, | 4 | #include <asm/scatterlist.h> |
5 | u8 *buf, unsigned int buflen) | 5 | #include <linux/mm.h> |
6 | { | 6 | #include <linux/string.h> |
7 | memset(sg, 0, sizeof(*sg)); | ||
8 | 7 | ||
8 | static inline void sg_set_buf(struct scatterlist *sg, void *buf, | ||
9 | unsigned int buflen) | ||
10 | { | ||
9 | sg->page = virt_to_page(buf); | 11 | sg->page = virt_to_page(buf); |
10 | sg->offset = offset_in_page(buf); | 12 | sg->offset = offset_in_page(buf); |
11 | sg->length = buflen; | 13 | sg->length = buflen; |
12 | } | 14 | } |
13 | 15 | ||
16 | static inline void sg_init_one(struct scatterlist *sg, void *buf, | ||
17 | unsigned int buflen) | ||
18 | { | ||
19 | memset(sg, 0, sizeof(*sg)); | ||
20 | sg_set_buf(sg, buf, buflen); | ||
21 | } | ||
22 | |||
14 | #endif /* _LINUX_SCATTERLIST_H */ | 23 | #endif /* _LINUX_SCATTERLIST_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 27519df0f987..03b68a7b4b82 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -249,6 +249,36 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
249 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 249 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
250 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 250 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
251 | 251 | ||
252 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
253 | /* | ||
254 | * The mm counters are not protected by its page_table_lock, | ||
255 | * so must be incremented atomically. | ||
256 | */ | ||
257 | #ifdef ATOMIC64_INIT | ||
258 | #define set_mm_counter(mm, member, value) atomic64_set(&(mm)->_##member, value) | ||
259 | #define get_mm_counter(mm, member) ((unsigned long)atomic64_read(&(mm)->_##member)) | ||
260 | #define add_mm_counter(mm, member, value) atomic64_add(value, &(mm)->_##member) | ||
261 | #define inc_mm_counter(mm, member) atomic64_inc(&(mm)->_##member) | ||
262 | #define dec_mm_counter(mm, member) atomic64_dec(&(mm)->_##member) | ||
263 | typedef atomic64_t mm_counter_t; | ||
264 | #else /* !ATOMIC64_INIT */ | ||
265 | /* | ||
266 | * The counters wrap back to 0 at 2^32 * PAGE_SIZE, | ||
267 | * that is, at 16TB if using 4kB page size. | ||
268 | */ | ||
269 | #define set_mm_counter(mm, member, value) atomic_set(&(mm)->_##member, value) | ||
270 | #define get_mm_counter(mm, member) ((unsigned long)atomic_read(&(mm)->_##member)) | ||
271 | #define add_mm_counter(mm, member, value) atomic_add(value, &(mm)->_##member) | ||
272 | #define inc_mm_counter(mm, member) atomic_inc(&(mm)->_##member) | ||
273 | #define dec_mm_counter(mm, member) atomic_dec(&(mm)->_##member) | ||
274 | typedef atomic_t mm_counter_t; | ||
275 | #endif /* !ATOMIC64_INIT */ | ||
276 | |||
277 | #else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | ||
278 | /* | ||
279 | * The mm counters are protected by its page_table_lock, | ||
280 | * so can be incremented directly. | ||
281 | */ | ||
252 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) | 282 | #define set_mm_counter(mm, member, value) (mm)->_##member = (value) |
253 | #define get_mm_counter(mm, member) ((mm)->_##member) | 283 | #define get_mm_counter(mm, member) ((mm)->_##member) |
254 | #define add_mm_counter(mm, member, value) (mm)->_##member += (value) | 284 | #define add_mm_counter(mm, member, value) (mm)->_##member += (value) |
@@ -256,6 +286,20 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
256 | #define dec_mm_counter(mm, member) (mm)->_##member-- | 286 | #define dec_mm_counter(mm, member) (mm)->_##member-- |
257 | typedef unsigned long mm_counter_t; | 287 | typedef unsigned long mm_counter_t; |
258 | 288 | ||
289 | #endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ | ||
290 | |||
291 | #define get_mm_rss(mm) \ | ||
292 | (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss)) | ||
293 | #define update_hiwater_rss(mm) do { \ | ||
294 | unsigned long _rss = get_mm_rss(mm); \ | ||
295 | if ((mm)->hiwater_rss < _rss) \ | ||
296 | (mm)->hiwater_rss = _rss; \ | ||
297 | } while (0) | ||
298 | #define update_hiwater_vm(mm) do { \ | ||
299 | if ((mm)->hiwater_vm < (mm)->total_vm) \ | ||
300 | (mm)->hiwater_vm = (mm)->total_vm; \ | ||
301 | } while (0) | ||
302 | |||
259 | struct mm_struct { | 303 | struct mm_struct { |
260 | struct vm_area_struct * mmap; /* list of VMAs */ | 304 | struct vm_area_struct * mmap; /* list of VMAs */ |
261 | struct rb_root mm_rb; | 305 | struct rb_root mm_rb; |
@@ -279,15 +323,20 @@ struct mm_struct { | |||
279 | * by mmlist_lock | 323 | * by mmlist_lock |
280 | */ | 324 | */ |
281 | 325 | ||
326 | /* Special counters, in some configurations protected by the | ||
327 | * page_table_lock, in other configurations by being atomic. | ||
328 | */ | ||
329 | mm_counter_t _file_rss; | ||
330 | mm_counter_t _anon_rss; | ||
331 | |||
332 | unsigned long hiwater_rss; /* High-watermark of RSS usage */ | ||
333 | unsigned long hiwater_vm; /* High-water virtual memory usage */ | ||
334 | |||
335 | unsigned long total_vm, locked_vm, shared_vm, exec_vm; | ||
336 | unsigned long stack_vm, reserved_vm, def_flags, nr_ptes; | ||
282 | unsigned long start_code, end_code, start_data, end_data; | 337 | unsigned long start_code, end_code, start_data, end_data; |
283 | unsigned long start_brk, brk, start_stack; | 338 | unsigned long start_brk, brk, start_stack; |
284 | unsigned long arg_start, arg_end, env_start, env_end; | 339 | unsigned long arg_start, arg_end, env_start, env_end; |
285 | unsigned long total_vm, locked_vm, shared_vm; | ||
286 | unsigned long exec_vm, stack_vm, reserved_vm, def_flags, nr_ptes; | ||
287 | |||
288 | /* Special counters protected by the page_table_lock */ | ||
289 | mm_counter_t _rss; | ||
290 | mm_counter_t _anon_rss; | ||
291 | 340 | ||
292 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 341 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
293 | 342 | ||
@@ -308,11 +357,7 @@ struct mm_struct { | |||
308 | /* aio bits */ | 357 | /* aio bits */ |
309 | rwlock_t ioctx_list_lock; | 358 | rwlock_t ioctx_list_lock; |
310 | struct kioctx *ioctx_list; | 359 | struct kioctx *ioctx_list; |
311 | |||
312 | struct kioctx default_kioctx; | 360 | struct kioctx default_kioctx; |
313 | |||
314 | unsigned long hiwater_rss; /* High-water RSS usage */ | ||
315 | unsigned long hiwater_vm; /* High-water virtual memory usage */ | ||
316 | }; | 361 | }; |
317 | 362 | ||
318 | struct sighand_struct { | 363 | struct sighand_struct { |
@@ -895,7 +940,7 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask); | |||
895 | #else | 940 | #else |
896 | static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) | 941 | static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) |
897 | { | 942 | { |
898 | if (!cpus_intersects(new_mask, cpu_online_map)) | 943 | if (!cpu_isset(0, new_mask)) |
899 | return -EINVAL; | 944 | return -EINVAL; |
900 | return 0; | 945 | return 0; |
901 | } | 946 | } |
@@ -1039,6 +1084,11 @@ extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned lon | |||
1039 | #define SEND_SIG_PRIV ((struct siginfo *) 1) | 1084 | #define SEND_SIG_PRIV ((struct siginfo *) 1) |
1040 | #define SEND_SIG_FORCED ((struct siginfo *) 2) | 1085 | #define SEND_SIG_FORCED ((struct siginfo *) 2) |
1041 | 1086 | ||
1087 | static inline int is_si_special(const struct siginfo *info) | ||
1088 | { | ||
1089 | return info <= SEND_SIG_FORCED; | ||
1090 | } | ||
1091 | |||
1042 | /* True if we are on the alternate signal stack. */ | 1092 | /* True if we are on the alternate signal stack. */ |
1043 | 1093 | ||
1044 | static inline int on_sig_stack(unsigned long sp) | 1094 | static inline int on_sig_stack(unsigned long sp) |
@@ -1166,7 +1216,7 @@ extern void unhash_process(struct task_struct *p); | |||
1166 | /* | 1216 | /* |
1167 | * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring | 1217 | * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring |
1168 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 1218 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
1169 | * pins the final release of task.io_context. | 1219 | * pins the final release of task.io_context. Also protects ->cpuset. |
1170 | * | 1220 | * |
1171 | * Nests both inside and outside of read_lock(&tasklist_lock). | 1221 | * Nests both inside and outside of read_lock(&tasklist_lock). |
1172 | * It must not be nested with write_lock_irq(&tasklist_lock), | 1222 | * It must not be nested with write_lock_irq(&tasklist_lock), |
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h index 78f634007fc6..c85e103d5e7b 100644 --- a/include/linux/sdladrv.h +++ b/include/linux/sdladrv.h | |||
@@ -52,12 +52,8 @@ typedef struct sdlahw | |||
52 | 52 | ||
53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); | 53 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); |
54 | extern int sdla_down (sdlahw_t* hw); | 54 | extern int sdla_down (sdlahw_t* hw); |
55 | extern int sdla_inten (sdlahw_t* hw); | ||
56 | extern int sdla_intde (sdlahw_t* hw); | ||
57 | extern int sdla_intack (sdlahw_t* hw); | ||
58 | extern void S514_intack (sdlahw_t* hw, u32 int_status); | 55 | extern void S514_intack (sdlahw_t* hw, u32 int_status); |
59 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); | 56 | extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); |
60 | extern int sdla_intr (sdlahw_t* hw); | ||
61 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); | 57 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); |
62 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, | 58 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, |
63 | unsigned len); | 59 | unsigned len); |
diff --git a/include/linux/security.h b/include/linux/security.h index 627382e74057..f7e0ae018712 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/shm.h> | 30 | #include <linux/shm.h> |
31 | #include <linux/msg.h> | 31 | #include <linux/msg.h> |
32 | #include <linux/sched.h> | 32 | #include <linux/sched.h> |
33 | #include <linux/key.h> | ||
33 | 34 | ||
34 | struct ctl_table; | 35 | struct ctl_table; |
35 | 36 | ||
@@ -385,6 +386,9 @@ struct swap_info_struct; | |||
385 | * NULL to request the size of the buffer required. @size indicates | 386 | * NULL to request the size of the buffer required. @size indicates |
386 | * the size of @buffer in bytes. Note that @name is the remainder | 387 | * the size of @buffer in bytes. Note that @name is the remainder |
387 | * of the attribute name after the security. prefix has been removed. | 388 | * of the attribute name after the security. prefix has been removed. |
389 | * @err is the return value from the preceding fs getxattr call, | ||
390 | * and can be used by the security module to determine whether it | ||
391 | * should try and canonicalize the attribute value. | ||
388 | * Return number of bytes used/required on success. | 392 | * Return number of bytes used/required on success. |
389 | * @inode_setsecurity: | 393 | * @inode_setsecurity: |
390 | * Set the security label associated with @name for @inode from the | 394 | * Set the security label associated with @name for @inode from the |
@@ -785,6 +789,27 @@ struct swap_info_struct; | |||
785 | * @sk_free_security: | 789 | * @sk_free_security: |
786 | * Deallocate security structure. | 790 | * Deallocate security structure. |
787 | * | 791 | * |
792 | * Security hooks affecting all Key Management operations | ||
793 | * | ||
794 | * @key_alloc: | ||
795 | * Permit allocation of a key and assign security data. Note that key does | ||
796 | * not have a serial number assigned at this point. | ||
797 | * @key points to the key. | ||
798 | * Return 0 if permission is granted, -ve error otherwise. | ||
799 | * @key_free: | ||
800 | * Notification of destruction; free security data. | ||
801 | * @key points to the key. | ||
802 | * No return value. | ||
803 | * @key_permission: | ||
804 | * See whether a specific operational right is granted to a process on a | ||
805 | * key. | ||
806 | * @key_ref refers to the key (key pointer + possession attribute bit). | ||
807 | * @context points to the process to provide the context against which to | ||
808 | * evaluate the security data on the key. | ||
809 | * @perm describes the combination of permissions required of this key. | ||
810 | * Return 1 if permission granted, 0 if permission denied and -ve it the | ||
811 | * normal permissions model should be effected. | ||
812 | * | ||
788 | * Security hooks affecting all System V IPC operations. | 813 | * Security hooks affecting all System V IPC operations. |
789 | * | 814 | * |
790 | * @ipc_permission: | 815 | * @ipc_permission: |
@@ -1091,7 +1116,7 @@ struct security_operations { | |||
1091 | int (*inode_getxattr) (struct dentry *dentry, char *name); | 1116 | int (*inode_getxattr) (struct dentry *dentry, char *name); |
1092 | int (*inode_listxattr) (struct dentry *dentry); | 1117 | int (*inode_listxattr) (struct dentry *dentry); |
1093 | int (*inode_removexattr) (struct dentry *dentry, char *name); | 1118 | int (*inode_removexattr) (struct dentry *dentry, char *name); |
1094 | int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size); | 1119 | int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size, int err); |
1095 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); | 1120 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); |
1096 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); | 1121 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); |
1097 | 1122 | ||
@@ -1210,9 +1235,20 @@ struct security_operations { | |||
1210 | int (*socket_shutdown) (struct socket * sock, int how); | 1235 | int (*socket_shutdown) (struct socket * sock, int how); |
1211 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); | 1236 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); |
1212 | int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); | 1237 | int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); |
1213 | int (*sk_alloc_security) (struct sock *sk, int family, int priority); | 1238 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); |
1214 | void (*sk_free_security) (struct sock *sk); | 1239 | void (*sk_free_security) (struct sock *sk); |
1215 | #endif /* CONFIG_SECURITY_NETWORK */ | 1240 | #endif /* CONFIG_SECURITY_NETWORK */ |
1241 | |||
1242 | /* key management security hooks */ | ||
1243 | #ifdef CONFIG_KEYS | ||
1244 | int (*key_alloc)(struct key *key); | ||
1245 | void (*key_free)(struct key *key); | ||
1246 | int (*key_permission)(key_ref_t key_ref, | ||
1247 | struct task_struct *context, | ||
1248 | key_perm_t perm); | ||
1249 | |||
1250 | #endif /* CONFIG_KEYS */ | ||
1251 | |||
1216 | }; | 1252 | }; |
1217 | 1253 | ||
1218 | /* global variables */ | 1254 | /* global variables */ |
@@ -1580,11 +1616,11 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name) | |||
1580 | return security_ops->inode_removexattr (dentry, name); | 1616 | return security_ops->inode_removexattr (dentry, name); |
1581 | } | 1617 | } |
1582 | 1618 | ||
1583 | static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) | 1619 | static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err) |
1584 | { | 1620 | { |
1585 | if (unlikely (IS_PRIVATE (inode))) | 1621 | if (unlikely (IS_PRIVATE (inode))) |
1586 | return 0; | 1622 | return 0; |
1587 | return security_ops->inode_getsecurity(inode, name, buffer, size); | 1623 | return security_ops->inode_getsecurity(inode, name, buffer, size, err); |
1588 | } | 1624 | } |
1589 | 1625 | ||
1590 | static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) | 1626 | static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) |
@@ -2222,7 +2258,7 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name) | |||
2222 | return cap_inode_removexattr(dentry, name); | 2258 | return cap_inode_removexattr(dentry, name); |
2223 | } | 2259 | } |
2224 | 2260 | ||
2225 | static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) | 2261 | static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err) |
2226 | { | 2262 | { |
2227 | return -EOPNOTSUPP; | 2263 | return -EOPNOTSUPP; |
2228 | } | 2264 | } |
@@ -2761,5 +2797,45 @@ static inline void security_sk_free(struct sock *sk) | |||
2761 | } | 2797 | } |
2762 | #endif /* CONFIG_SECURITY_NETWORK */ | 2798 | #endif /* CONFIG_SECURITY_NETWORK */ |
2763 | 2799 | ||
2800 | #ifdef CONFIG_KEYS | ||
2801 | #ifdef CONFIG_SECURITY | ||
2802 | static inline int security_key_alloc(struct key *key) | ||
2803 | { | ||
2804 | return security_ops->key_alloc(key); | ||
2805 | } | ||
2806 | |||
2807 | static inline void security_key_free(struct key *key) | ||
2808 | { | ||
2809 | security_ops->key_free(key); | ||
2810 | } | ||
2811 | |||
2812 | static inline int security_key_permission(key_ref_t key_ref, | ||
2813 | struct task_struct *context, | ||
2814 | key_perm_t perm) | ||
2815 | { | ||
2816 | return security_ops->key_permission(key_ref, context, perm); | ||
2817 | } | ||
2818 | |||
2819 | #else | ||
2820 | |||
2821 | static inline int security_key_alloc(struct key *key) | ||
2822 | { | ||
2823 | return 0; | ||
2824 | } | ||
2825 | |||
2826 | static inline void security_key_free(struct key *key) | ||
2827 | { | ||
2828 | } | ||
2829 | |||
2830 | static inline int security_key_permission(key_ref_t key_ref, | ||
2831 | struct task_struct *context, | ||
2832 | key_perm_t perm) | ||
2833 | { | ||
2834 | return 0; | ||
2835 | } | ||
2836 | |||
2837 | #endif | ||
2838 | #endif /* CONFIG_KEYS */ | ||
2839 | |||
2764 | #endif /* ! __LINUX_SECURITY_H */ | 2840 | #endif /* ! __LINUX_SECURITY_H */ |
2765 | 2841 | ||
diff --git a/include/linux/serial.h b/include/linux/serial.h index 12cd9cf65e8f..33fc8cb8ddfb 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define _LINUX_SERIAL_H | 11 | #define _LINUX_SERIAL_H |
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | #include <linux/types.h> | ||
14 | #include <asm/page.h> | 15 | #include <asm/page.h> |
15 | 16 | ||
16 | /* | 17 | /* |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 317a979b24de..2b799d40d669 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #define _LINUX_SERIAL_8250_H | 12 | #define _LINUX_SERIAL_8250_H |
13 | 13 | ||
14 | #include <linux/serial_core.h> | 14 | #include <linux/serial_core.h> |
15 | #include <linux/device.h> | 15 | #include <linux/platform_device.h> |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * This is the platform device platform_data structure | 18 | * This is the platform device platform_data structure |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 27db8da43aa4..2b0401b93f2b 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -39,7 +39,8 @@ | |||
39 | #define PORT_RSA 13 | 39 | #define PORT_RSA 13 |
40 | #define PORT_NS16550A 14 | 40 | #define PORT_NS16550A 14 |
41 | #define PORT_XSCALE 15 | 41 | #define PORT_XSCALE 15 |
42 | #define PORT_MAX_8250 15 /* max port ID */ | 42 | #define PORT_IP3106 16 |
43 | #define PORT_MAX_8250 16 /* max port ID */ | ||
43 | 44 | ||
44 | /* | 45 | /* |
45 | * ARM specific type numbers. These are not currently guaranteed | 46 | * ARM specific type numbers. These are not currently guaranteed |
diff --git a/include/linux/serial_ip3106.h b/include/linux/serial_ip3106.h new file mode 100644 index 000000000000..f500ac602c5c --- /dev/null +++ b/include/linux/serial_ip3106.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Embedded Alley Solutions, source@embeddedalley.com. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef _LINUX_SERIAL_IP3106_H | ||
20 | #define _LINUX_SERIAL_IP3106_H | ||
21 | |||
22 | #include <linux/serial_core.h> | ||
23 | #include <linux/device.h> | ||
24 | |||
25 | #define IP3106_NR_PORTS 2 | ||
26 | |||
27 | struct ip3106_port { | ||
28 | struct uart_port port; | ||
29 | struct timer_list timer; | ||
30 | unsigned int old_status; | ||
31 | }; | ||
32 | |||
33 | /* register offsets */ | ||
34 | #define IP3106_LCR 0 | ||
35 | #define IP3106_MCR 0x004 | ||
36 | #define IP3106_BAUD 0x008 | ||
37 | #define IP3106_CFG 0x00c | ||
38 | #define IP3106_FIFO 0x028 | ||
39 | #define IP3106_ISTAT 0xfe0 | ||
40 | #define IP3106_IEN 0xfe4 | ||
41 | #define IP3106_ICLR 0xfe8 | ||
42 | #define IP3106_ISET 0xfec | ||
43 | #define IP3106_PD 0xff4 | ||
44 | #define IP3106_MID 0xffc | ||
45 | |||
46 | #define IP3106_UART_LCR_TXBREAK (1<<30) | ||
47 | #define IP3106_UART_LCR_PAREVN 0x10000000 | ||
48 | #define IP3106_UART_LCR_PAREN 0x08000000 | ||
49 | #define IP3106_UART_LCR_2STOPB 0x04000000 | ||
50 | #define IP3106_UART_LCR_8BIT 0x01000000 | ||
51 | #define IP3106_UART_LCR_TX_RST 0x00040000 | ||
52 | #define IP3106_UART_LCR_RX_RST 0x00020000 | ||
53 | #define IP3106_UART_LCR_RX_NEXT 0x00010000 | ||
54 | |||
55 | #define IP3106_UART_MCR_SCR 0xFF000000 | ||
56 | #define IP3106_UART_MCR_DCD 0x00800000 | ||
57 | #define IP3106_UART_MCR_CTS 0x00100000 | ||
58 | #define IP3106_UART_MCR_LOOP 0x00000010 | ||
59 | #define IP3106_UART_MCR_RTS 0x00000002 | ||
60 | #define IP3106_UART_MCR_DTR 0x00000001 | ||
61 | |||
62 | #define IP3106_UART_INT_TX 0x00000080 | ||
63 | #define IP3106_UART_INT_EMPTY 0x00000040 | ||
64 | #define IP3106_UART_INT_RCVTO 0x00000020 | ||
65 | #define IP3106_UART_INT_RX 0x00000010 | ||
66 | #define IP3106_UART_INT_RXOVRN 0x00000008 | ||
67 | #define IP3106_UART_INT_FRERR 0x00000004 | ||
68 | #define IP3106_UART_INT_BREAK 0x00000002 | ||
69 | #define IP3106_UART_INT_PARITY 0x00000001 | ||
70 | #define IP3106_UART_INT_ALLRX 0x0000003F | ||
71 | #define IP3106_UART_INT_ALLTX 0x000000C0 | ||
72 | |||
73 | #define IP3106_UART_FIFO_TXFIFO 0x001F0000 | ||
74 | #define IP3106_UART_FIFO_TXFIFO_STA (0x1f<<16) | ||
75 | #define IP3106_UART_FIFO_RXBRK 0x00008000 | ||
76 | #define IP3106_UART_FIFO_RXFE 0x00004000 | ||
77 | #define IP3106_UART_FIFO_RXPAR 0x00002000 | ||
78 | #define IP3106_UART_FIFO_RXFIFO 0x00001F00 | ||
79 | #define IP3106_UART_FIFO_RBRTHR 0x000000FF | ||
80 | |||
81 | #endif | ||
diff --git a/include/linux/signal.h b/include/linux/signal.h index 7be18b5e2fb4..5dd5f02c5c5f 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | struct sigqueue { | 26 | struct sigqueue { |
27 | struct list_head list; | 27 | struct list_head list; |
28 | spinlock_t *lock; | ||
29 | int flags; | 28 | int flags; |
30 | siginfo_t info; | 29 | siginfo_t info; |
31 | struct user_struct *user; | 30 | struct user_struct *user; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 8f5d9e7f8734..4286d832166f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -137,6 +137,8 @@ struct skb_shared_info { | |||
137 | unsigned int nr_frags; | 137 | unsigned int nr_frags; |
138 | unsigned short tso_size; | 138 | unsigned short tso_size; |
139 | unsigned short tso_segs; | 139 | unsigned short tso_segs; |
140 | unsigned short ufo_size; | ||
141 | unsigned int ip6_frag_id; | ||
140 | struct sk_buff *frag_list; | 142 | struct sk_buff *frag_list; |
141 | skb_frag_t frags[MAX_SKB_FRAGS]; | 143 | skb_frag_t frags[MAX_SKB_FRAGS]; |
142 | }; | 144 | }; |
@@ -171,7 +173,6 @@ enum { | |||
171 | * struct sk_buff - socket buffer | 173 | * struct sk_buff - socket buffer |
172 | * @next: Next buffer in list | 174 | * @next: Next buffer in list |
173 | * @prev: Previous buffer in list | 175 | * @prev: Previous buffer in list |
174 | * @list: List we are on | ||
175 | * @sk: Socket we are owned by | 176 | * @sk: Socket we are owned by |
176 | * @tstamp: Time we arrived | 177 | * @tstamp: Time we arrived |
177 | * @dev: Device we arrived on/are leaving by | 178 | * @dev: Device we arrived on/are leaving by |
@@ -190,6 +191,7 @@ enum { | |||
190 | * @cloned: Head may be cloned (check refcnt to be sure) | 191 | * @cloned: Head may be cloned (check refcnt to be sure) |
191 | * @nohdr: Payload reference only, must not modify header | 192 | * @nohdr: Payload reference only, must not modify header |
192 | * @pkt_type: Packet class | 193 | * @pkt_type: Packet class |
194 | * @fclone: skbuff clone status | ||
193 | * @ip_summed: Driver fed us an IP checksum | 195 | * @ip_summed: Driver fed us an IP checksum |
194 | * @priority: Packet queueing priority | 196 | * @priority: Packet queueing priority |
195 | * @users: User count - see {datagram,tcp}.c | 197 | * @users: User count - see {datagram,tcp}.c |
@@ -202,6 +204,7 @@ enum { | |||
202 | * @destructor: Destruct function | 204 | * @destructor: Destruct function |
203 | * @nfmark: Can be used for communication between hooks | 205 | * @nfmark: Can be used for communication between hooks |
204 | * @nfct: Associated connection, if any | 206 | * @nfct: Associated connection, if any |
207 | * @ipvs_property: skbuff is owned by ipvs | ||
205 | * @nfctinfo: Relationship of this skb to the connection | 208 | * @nfctinfo: Relationship of this skb to the connection |
206 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 209 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
207 | * @tc_index: Traffic control index | 210 | * @tc_index: Traffic control index |
@@ -340,6 +343,11 @@ extern void skb_over_panic(struct sk_buff *skb, int len, | |||
340 | extern void skb_under_panic(struct sk_buff *skb, int len, | 343 | extern void skb_under_panic(struct sk_buff *skb, int len, |
341 | void *here); | 344 | void *here); |
342 | 345 | ||
346 | extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | ||
347 | int getfrag(void *from, char *to, int offset, | ||
348 | int len,int odd, struct sk_buff *skb), | ||
349 | void *from, int length); | ||
350 | |||
343 | struct skb_seq_state | 351 | struct skb_seq_state |
344 | { | 352 | { |
345 | __u32 lower_offset; | 353 | __u32 lower_offset; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 5fc04a16ecb0..09b9aa60063d 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -121,7 +121,7 @@ extern unsigned int ksize(const void *); | |||
121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); | 121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
122 | extern void *kmalloc_node(size_t size, gfp_t flags, int node); | 122 | extern void *kmalloc_node(size_t size, gfp_t flags, int node); |
123 | #else | 123 | #else |
124 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) | 124 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) |
125 | { | 125 | { |
126 | return kmem_cache_alloc(cachep, flags); | 126 | return kmem_cache_alloc(cachep, flags); |
127 | } | 127 | } |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index cdc99a27840d..0e9682c9def5 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -171,23 +171,42 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | |||
171 | #define write_lock_irq(lock) _write_lock_irq(lock) | 171 | #define write_lock_irq(lock) _write_lock_irq(lock) |
172 | #define write_lock_bh(lock) _write_lock_bh(lock) | 172 | #define write_lock_bh(lock) _write_lock_bh(lock) |
173 | 173 | ||
174 | #define spin_unlock(lock) _spin_unlock(lock) | 174 | /* |
175 | #define write_unlock(lock) _write_unlock(lock) | 175 | * We inline the unlock functions in the nondebug case: |
176 | #define read_unlock(lock) _read_unlock(lock) | 176 | */ |
177 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) | ||
178 | # define spin_unlock(lock) _spin_unlock(lock) | ||
179 | # define read_unlock(lock) _read_unlock(lock) | ||
180 | # define write_unlock(lock) _write_unlock(lock) | ||
181 | #else | ||
182 | # define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | ||
183 | # define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock) | ||
184 | # define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) | ||
185 | #endif | ||
186 | |||
187 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) | ||
188 | # define spin_unlock_irq(lock) _spin_unlock_irq(lock) | ||
189 | # define read_unlock_irq(lock) _read_unlock_irq(lock) | ||
190 | # define write_unlock_irq(lock) _write_unlock_irq(lock) | ||
191 | #else | ||
192 | # define spin_unlock_irq(lock) \ | ||
193 | do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) | ||
194 | # define read_unlock_irq(lock) \ | ||
195 | do { __raw_read_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) | ||
196 | # define write_unlock_irq(lock) \ | ||
197 | do { __raw_write_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) | ||
198 | #endif | ||
177 | 199 | ||
178 | #define spin_unlock_irqrestore(lock, flags) \ | 200 | #define spin_unlock_irqrestore(lock, flags) \ |
179 | _spin_unlock_irqrestore(lock, flags) | 201 | _spin_unlock_irqrestore(lock, flags) |
180 | #define spin_unlock_irq(lock) _spin_unlock_irq(lock) | ||
181 | #define spin_unlock_bh(lock) _spin_unlock_bh(lock) | 202 | #define spin_unlock_bh(lock) _spin_unlock_bh(lock) |
182 | 203 | ||
183 | #define read_unlock_irqrestore(lock, flags) \ | 204 | #define read_unlock_irqrestore(lock, flags) \ |
184 | _read_unlock_irqrestore(lock, flags) | 205 | _read_unlock_irqrestore(lock, flags) |
185 | #define read_unlock_irq(lock) _read_unlock_irq(lock) | ||
186 | #define read_unlock_bh(lock) _read_unlock_bh(lock) | 206 | #define read_unlock_bh(lock) _read_unlock_bh(lock) |
187 | 207 | ||
188 | #define write_unlock_irqrestore(lock, flags) \ | 208 | #define write_unlock_irqrestore(lock, flags) \ |
189 | _write_unlock_irqrestore(lock, flags) | 209 | _write_unlock_irqrestore(lock, flags) |
190 | #define write_unlock_irq(lock) _write_unlock_irq(lock) | ||
191 | #define write_unlock_bh(lock) _write_unlock_bh(lock) | 210 | #define write_unlock_bh(lock) _write_unlock_bh(lock) |
192 | 211 | ||
193 | #define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) | 212 | #define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 04ebc24db348..b68c11a2d6dd 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -66,7 +66,12 @@ struct rpc_cred_cache { | |||
66 | 66 | ||
67 | struct rpc_auth { | 67 | struct rpc_auth { |
68 | unsigned int au_cslack; /* call cred size estimate */ | 68 | unsigned int au_cslack; /* call cred size estimate */ |
69 | unsigned int au_rslack; /* reply verf size guess */ | 69 | /* guess at number of u32's auth adds before |
70 | * reply data; normally the verifier size: */ | ||
71 | unsigned int au_rslack; | ||
72 | /* for gss, used to calculate au_rslack: */ | ||
73 | unsigned int au_verfsize; | ||
74 | |||
70 | unsigned int au_flags; /* various flags */ | 75 | unsigned int au_flags; /* various flags */ |
71 | struct rpc_authops * au_ops; /* operations */ | 76 | struct rpc_authops * au_ops; /* operations */ |
72 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may | 77 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index eadb31e3c198..1a42d902bc11 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define RPCDBG_AUTH 0x0010 | 32 | #define RPCDBG_AUTH 0x0010 |
33 | #define RPCDBG_PMAP 0x0020 | 33 | #define RPCDBG_PMAP 0x0020 |
34 | #define RPCDBG_SCHED 0x0040 | 34 | #define RPCDBG_SCHED 0x0040 |
35 | #define RPCDBG_TRANS 0x0080 | ||
35 | #define RPCDBG_SVCSOCK 0x0100 | 36 | #define RPCDBG_SVCSOCK 0x0100 |
36 | #define RPCDBG_SVCDSP 0x0200 | 37 | #define RPCDBG_SVCDSP 0x0200 |
37 | #define RPCDBG_MISC 0x0400 | 38 | #define RPCDBG_MISC 0x0400 |
@@ -94,6 +95,8 @@ enum { | |||
94 | CTL_NLMDEBUG, | 95 | CTL_NLMDEBUG, |
95 | CTL_SLOTTABLE_UDP, | 96 | CTL_SLOTTABLE_UDP, |
96 | CTL_SLOTTABLE_TCP, | 97 | CTL_SLOTTABLE_TCP, |
98 | CTL_MIN_RESVPORT, | ||
99 | CTL_MAX_RESVPORT, | ||
97 | }; | 100 | }; |
98 | 101 | ||
99 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ | 102 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 689262f63059..9b8bcf125c18 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -40,14 +40,21 @@ int gss_import_sec_context( | |||
40 | struct gss_ctx **ctx_id); | 40 | struct gss_ctx **ctx_id); |
41 | u32 gss_get_mic( | 41 | u32 gss_get_mic( |
42 | struct gss_ctx *ctx_id, | 42 | struct gss_ctx *ctx_id, |
43 | u32 qop, | ||
44 | struct xdr_buf *message, | 43 | struct xdr_buf *message, |
45 | struct xdr_netobj *mic_token); | 44 | struct xdr_netobj *mic_token); |
46 | u32 gss_verify_mic( | 45 | u32 gss_verify_mic( |
47 | struct gss_ctx *ctx_id, | 46 | struct gss_ctx *ctx_id, |
48 | struct xdr_buf *message, | 47 | struct xdr_buf *message, |
49 | struct xdr_netobj *mic_token, | 48 | struct xdr_netobj *mic_token); |
50 | u32 *qstate); | 49 | u32 gss_wrap( |
50 | struct gss_ctx *ctx_id, | ||
51 | int offset, | ||
52 | struct xdr_buf *outbuf, | ||
53 | struct page **inpages); | ||
54 | u32 gss_unwrap( | ||
55 | struct gss_ctx *ctx_id, | ||
56 | int offset, | ||
57 | struct xdr_buf *inbuf); | ||
51 | u32 gss_delete_sec_context( | 58 | u32 gss_delete_sec_context( |
52 | struct gss_ctx **ctx_id); | 59 | struct gss_ctx **ctx_id); |
53 | 60 | ||
@@ -56,7 +63,6 @@ char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | |||
56 | 63 | ||
57 | struct pf_desc { | 64 | struct pf_desc { |
58 | u32 pseudoflavor; | 65 | u32 pseudoflavor; |
59 | u32 qop; | ||
60 | u32 service; | 66 | u32 service; |
61 | char *name; | 67 | char *name; |
62 | char *auth_domain_name; | 68 | char *auth_domain_name; |
@@ -85,14 +91,21 @@ struct gss_api_ops { | |||
85 | struct gss_ctx *ctx_id); | 91 | struct gss_ctx *ctx_id); |
86 | u32 (*gss_get_mic)( | 92 | u32 (*gss_get_mic)( |
87 | struct gss_ctx *ctx_id, | 93 | struct gss_ctx *ctx_id, |
88 | u32 qop, | ||
89 | struct xdr_buf *message, | 94 | struct xdr_buf *message, |
90 | struct xdr_netobj *mic_token); | 95 | struct xdr_netobj *mic_token); |
91 | u32 (*gss_verify_mic)( | 96 | u32 (*gss_verify_mic)( |
92 | struct gss_ctx *ctx_id, | 97 | struct gss_ctx *ctx_id, |
93 | struct xdr_buf *message, | 98 | struct xdr_buf *message, |
94 | struct xdr_netobj *mic_token, | 99 | struct xdr_netobj *mic_token); |
95 | u32 *qstate); | 100 | u32 (*gss_wrap)( |
101 | struct gss_ctx *ctx_id, | ||
102 | int offset, | ||
103 | struct xdr_buf *outbuf, | ||
104 | struct page **inpages); | ||
105 | u32 (*gss_unwrap)( | ||
106 | struct gss_ctx *ctx_id, | ||
107 | int offset, | ||
108 | struct xdr_buf *buf); | ||
96 | void (*gss_delete_sec_context)( | 109 | void (*gss_delete_sec_context)( |
97 | void *internal_ctx_id); | 110 | void *internal_ctx_id); |
98 | }; | 111 | }; |
diff --git a/include/linux/sunrpc/gss_err.h b/include/linux/sunrpc/gss_err.h index 92608a2e574c..a6807867bd21 100644 --- a/include/linux/sunrpc/gss_err.h +++ b/include/linux/sunrpc/gss_err.h | |||
@@ -66,16 +66,6 @@ typedef unsigned int OM_uint32; | |||
66 | 66 | ||
67 | 67 | ||
68 | /* | 68 | /* |
69 | * Define the default Quality of Protection for per-message services. Note | ||
70 | * that an implementation that offers multiple levels of QOP may either reserve | ||
71 | * a value (for example zero, as assumed here) to mean "default protection", or | ||
72 | * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit | ||
73 | * QOP value. However a value of 0 should always be interpreted by a GSSAPI | ||
74 | * implementation as a request for the default protection level. | ||
75 | */ | ||
76 | #define GSS_C_QOP_DEFAULT 0 | ||
77 | |||
78 | /* | ||
79 | * Expiration time of 2^32-1 seconds means infinite lifetime for a | 69 | * Expiration time of 2^32-1 seconds means infinite lifetime for a |
80 | * credential or security context | 70 | * credential or security context |
81 | */ | 71 | */ |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index ffe31d2eb9ec..2c3601d31045 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
@@ -116,18 +116,22 @@ enum seal_alg { | |||
116 | 116 | ||
117 | s32 | 117 | s32 |
118 | make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | 118 | make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, |
119 | struct xdr_netobj *cksum); | 119 | int body_offset, struct xdr_netobj *cksum); |
120 | |||
121 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | ||
122 | struct xdr_netobj *); | ||
123 | |||
124 | u32 gss_verify_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | ||
125 | struct xdr_netobj *); | ||
120 | 126 | ||
121 | u32 | 127 | u32 |
122 | krb5_make_token(struct krb5_ctx *context_handle, int qop_req, | 128 | gss_wrap_kerberos(struct gss_ctx *ctx_id, int offset, |
123 | struct xdr_buf *input_message_buffer, | 129 | struct xdr_buf *outbuf, struct page **pages); |
124 | struct xdr_netobj *output_message_buffer, int toktype); | ||
125 | 130 | ||
126 | u32 | 131 | u32 |
127 | krb5_read_token(struct krb5_ctx *context_handle, | 132 | gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset, |
128 | struct xdr_netobj *input_token_buffer, | 133 | struct xdr_buf *buf); |
129 | struct xdr_buf *message_buffer, | 134 | |
130 | int *qop_state, int toktype); | ||
131 | 135 | ||
132 | u32 | 136 | u32 |
133 | krb5_encrypt(struct crypto_tfm * key, | 137 | krb5_encrypt(struct crypto_tfm * key, |
@@ -137,6 +141,13 @@ u32 | |||
137 | krb5_decrypt(struct crypto_tfm * key, | 141 | krb5_decrypt(struct crypto_tfm * key, |
138 | void *iv, void *in, void *out, int length); | 142 | void *iv, void *in, void *out, int length); |
139 | 143 | ||
144 | int | ||
145 | gss_encrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *outbuf, int offset, | ||
146 | struct page **pages); | ||
147 | |||
148 | int | ||
149 | gss_decrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *inbuf, int offset); | ||
150 | |||
140 | s32 | 151 | s32 |
141 | krb5_make_seq_num(struct crypto_tfm * key, | 152 | krb5_make_seq_num(struct crypto_tfm * key, |
142 | int direction, | 153 | int direction, |
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h index b5c9968c3c17..0beb2cf00a84 100644 --- a/include/linux/sunrpc/gss_spkm3.h +++ b/include/linux/sunrpc/gss_spkm3.h | |||
@@ -41,9 +41,9 @@ struct spkm3_ctx { | |||
41 | #define SPKM_WRAP_TOK 5 | 41 | #define SPKM_WRAP_TOK 5 |
42 | #define SPKM_DEL_TOK 6 | 42 | #define SPKM_DEL_TOK 6 |
43 | 43 | ||
44 | u32 spkm3_make_token(struct spkm3_ctx *ctx, int qop_req, struct xdr_buf * text, struct xdr_netobj * token, int toktype); | 44 | u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype); |
45 | 45 | ||
46 | u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int *qop_state, int toktype); | 46 | u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype); |
47 | 47 | ||
48 | #define CKSUMTYPE_RSA_MD5 0x0007 | 48 | #define CKSUMTYPE_RSA_MD5 0x0007 |
49 | 49 | ||
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 15f115332389..f43f237360ae 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -76,5 +76,30 @@ enum rpc_auth_stat { | |||
76 | 76 | ||
77 | #define RPC_MAXNETNAMELEN 256 | 77 | #define RPC_MAXNETNAMELEN 256 |
78 | 78 | ||
79 | /* | ||
80 | * From RFC 1831: | ||
81 | * | ||
82 | * "A record is composed of one or more record fragments. A record | ||
83 | * fragment is a four-byte header followed by 0 to (2**31) - 1 bytes of | ||
84 | * fragment data. The bytes encode an unsigned binary number; as with | ||
85 | * XDR integers, the byte order is from highest to lowest. The number | ||
86 | * encodes two values -- a boolean which indicates whether the fragment | ||
87 | * is the last fragment of the record (bit value 1 implies the fragment | ||
88 | * is the last fragment) and a 31-bit unsigned binary value which is the | ||
89 | * length in bytes of the fragment's data. The boolean value is the | ||
90 | * highest-order bit of the header; the length is the 31 low-order bits. | ||
91 | * (Note that this record specification is NOT in XDR standard form!)" | ||
92 | * | ||
93 | * The Linux RPC client always sends its requests in a single record | ||
94 | * fragment, limiting the maximum payload size for stream transports to | ||
95 | * 2GB. | ||
96 | */ | ||
97 | |||
98 | typedef u32 rpc_fraghdr; | ||
99 | |||
100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) | ||
101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) | ||
102 | #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) | ||
103 | |||
79 | #endif /* __KERNEL__ */ | 104 | #endif /* __KERNEL__ */ |
80 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 105 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 23448d0fb5bc..5da968729cf8 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -161,14 +161,10 @@ typedef struct { | |||
161 | 161 | ||
162 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); | 162 | typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); |
163 | 163 | ||
164 | extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *); | ||
164 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, | 165 | extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, |
165 | skb_reader_t *, skb_read_actor_t); | 166 | skb_reader_t *, skb_read_actor_t); |
166 | 167 | ||
167 | struct socket; | ||
168 | struct sockaddr; | ||
169 | extern int xdr_sendpages(struct socket *, struct sockaddr *, int, | ||
170 | struct xdr_buf *, unsigned int, int); | ||
171 | |||
172 | extern int xdr_encode_word(struct xdr_buf *, int, u32); | 168 | extern int xdr_encode_word(struct xdr_buf *, int, u32); |
173 | extern int xdr_decode_word(struct xdr_buf *, int, u32 *); | 169 | extern int xdr_decode_word(struct xdr_buf *, int, u32 *); |
174 | 170 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index e618c1649814..3b8b6e823c70 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/sunrpc/clnt_xprt.h | 2 | * linux/include/linux/sunrpc/xprt.h |
3 | * | 3 | * |
4 | * Declarations for the RPC transport interface. | 4 | * Declarations for the RPC transport interface. |
5 | * | 5 | * |
@@ -15,20 +15,6 @@ | |||
15 | #include <linux/sunrpc/sched.h> | 15 | #include <linux/sunrpc/sched.h> |
16 | #include <linux/sunrpc/xdr.h> | 16 | #include <linux/sunrpc/xdr.h> |
17 | 17 | ||
18 | /* | ||
19 | * The transport code maintains an estimate on the maximum number of out- | ||
20 | * standing RPC requests, using a smoothed version of the congestion | ||
21 | * avoidance implemented in 44BSD. This is basically the Van Jacobson | ||
22 | * congestion algorithm: If a retransmit occurs, the congestion window is | ||
23 | * halved; otherwise, it is incremented by 1/cwnd when | ||
24 | * | ||
25 | * - a reply is received and | ||
26 | * - a full number of requests are outstanding and | ||
27 | * - the congestion window hasn't been updated recently. | ||
28 | * | ||
29 | * Upper procedures may check whether a request would block waiting for | ||
30 | * a free RPC slot by using the RPC_CONGESTED() macro. | ||
31 | */ | ||
32 | extern unsigned int xprt_udp_slot_table_entries; | 18 | extern unsigned int xprt_udp_slot_table_entries; |
33 | extern unsigned int xprt_tcp_slot_table_entries; | 19 | extern unsigned int xprt_tcp_slot_table_entries; |
34 | 20 | ||
@@ -36,34 +22,23 @@ extern unsigned int xprt_tcp_slot_table_entries; | |||
36 | #define RPC_DEF_SLOT_TABLE (16U) | 22 | #define RPC_DEF_SLOT_TABLE (16U) |
37 | #define RPC_MAX_SLOT_TABLE (128U) | 23 | #define RPC_MAX_SLOT_TABLE (128U) |
38 | 24 | ||
39 | #define RPC_CWNDSHIFT (8U) | ||
40 | #define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT) | ||
41 | #define RPC_INITCWND RPC_CWNDSCALE | ||
42 | #define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT) | ||
43 | #define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd) | ||
44 | |||
45 | /* Default timeout values */ | ||
46 | #define RPC_MAX_UDP_TIMEOUT (60*HZ) | ||
47 | #define RPC_MAX_TCP_TIMEOUT (600*HZ) | ||
48 | |||
49 | /* | 25 | /* |
50 | * Wait duration for an RPC TCP connection to be established. Solaris | 26 | * RPC call and reply header size as number of 32bit words (verifier |
51 | * NFS over TCP uses 60 seconds, for example, which is in line with how | 27 | * size computed separately) |
52 | * long a server takes to reboot. | ||
53 | */ | 28 | */ |
54 | #define RPC_CONNECT_TIMEOUT (60*HZ) | 29 | #define RPC_CALLHDRSIZE 6 |
30 | #define RPC_REPHDRSIZE 4 | ||
55 | 31 | ||
56 | /* | 32 | /* |
57 | * Delay an arbitrary number of seconds before attempting to reconnect | 33 | * Parameters for choosing a free port |
58 | * after an error. | ||
59 | */ | 34 | */ |
60 | #define RPC_REESTABLISH_TIMEOUT (15*HZ) | 35 | extern unsigned int xprt_min_resvport; |
36 | extern unsigned int xprt_max_resvport; | ||
61 | 37 | ||
62 | /* RPC call and reply header size as number of 32bit words (verifier | 38 | #define RPC_MIN_RESVPORT (1U) |
63 | * size computed separately) | 39 | #define RPC_MAX_RESVPORT (65535U) |
64 | */ | 40 | #define RPC_DEF_MIN_RESVPORT (650U) |
65 | #define RPC_CALLHDRSIZE 6 | 41 | #define RPC_DEF_MAX_RESVPORT (1023U) |
66 | #define RPC_REPHDRSIZE 4 | ||
67 | 42 | ||
68 | /* | 43 | /* |
69 | * This describes a timeout strategy | 44 | * This describes a timeout strategy |
@@ -76,6 +51,9 @@ struct rpc_timeout { | |||
76 | unsigned char to_exponential; | 51 | unsigned char to_exponential; |
77 | }; | 52 | }; |
78 | 53 | ||
54 | struct rpc_task; | ||
55 | struct rpc_xprt; | ||
56 | |||
79 | /* | 57 | /* |
80 | * This describes a complete RPC request | 58 | * This describes a complete RPC request |
81 | */ | 59 | */ |
@@ -95,7 +73,10 @@ struct rpc_rqst { | |||
95 | int rq_cong; /* has incremented xprt->cong */ | 73 | int rq_cong; /* has incremented xprt->cong */ |
96 | int rq_received; /* receive completed */ | 74 | int rq_received; /* receive completed */ |
97 | u32 rq_seqno; /* gss seq no. used on req. */ | 75 | u32 rq_seqno; /* gss seq no. used on req. */ |
98 | 76 | int rq_enc_pages_num; | |
77 | struct page **rq_enc_pages; /* scratch pages for use by | ||
78 | gss privacy code */ | ||
79 | void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */ | ||
99 | struct list_head rq_list; | 80 | struct list_head rq_list; |
100 | 81 | ||
101 | struct xdr_buf rq_private_buf; /* The receive buffer | 82 | struct xdr_buf rq_private_buf; /* The receive buffer |
@@ -121,12 +102,21 @@ struct rpc_rqst { | |||
121 | #define rq_svec rq_snd_buf.head | 102 | #define rq_svec rq_snd_buf.head |
122 | #define rq_slen rq_snd_buf.len | 103 | #define rq_slen rq_snd_buf.len |
123 | 104 | ||
124 | #define XPRT_LAST_FRAG (1 << 0) | 105 | struct rpc_xprt_ops { |
125 | #define XPRT_COPY_RECM (1 << 1) | 106 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
126 | #define XPRT_COPY_XID (1 << 2) | 107 | int (*reserve_xprt)(struct rpc_task *task); |
127 | #define XPRT_COPY_DATA (1 << 3) | 108 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
109 | void (*connect)(struct rpc_task *task); | ||
110 | int (*send_request)(struct rpc_task *task); | ||
111 | void (*set_retrans_timeout)(struct rpc_task *task); | ||
112 | void (*timer)(struct rpc_task *task); | ||
113 | void (*release_request)(struct rpc_task *task); | ||
114 | void (*close)(struct rpc_xprt *xprt); | ||
115 | void (*destroy)(struct rpc_xprt *xprt); | ||
116 | }; | ||
128 | 117 | ||
129 | struct rpc_xprt { | 118 | struct rpc_xprt { |
119 | struct rpc_xprt_ops * ops; /* transport methods */ | ||
130 | struct socket * sock; /* BSD socket layer */ | 120 | struct socket * sock; /* BSD socket layer */ |
131 | struct sock * inet; /* INET layer */ | 121 | struct sock * inet; /* INET layer */ |
132 | 122 | ||
@@ -137,11 +127,13 @@ struct rpc_xprt { | |||
137 | unsigned long cong; /* current congestion */ | 127 | unsigned long cong; /* current congestion */ |
138 | unsigned long cwnd; /* congestion window */ | 128 | unsigned long cwnd; /* congestion window */ |
139 | 129 | ||
140 | unsigned int rcvsize, /* socket receive buffer size */ | 130 | size_t rcvsize, /* transport rcv buffer size */ |
141 | sndsize; /* socket send buffer size */ | 131 | sndsize; /* transport send buffer size */ |
142 | 132 | ||
143 | size_t max_payload; /* largest RPC payload size, | 133 | size_t max_payload; /* largest RPC payload size, |
144 | in bytes */ | 134 | in bytes */ |
135 | unsigned int tsh_size; /* size of transport specific | ||
136 | header */ | ||
145 | 137 | ||
146 | struct rpc_wait_queue sending; /* requests waiting to send */ | 138 | struct rpc_wait_queue sending; /* requests waiting to send */ |
147 | struct rpc_wait_queue resend; /* requests waiting to resend */ | 139 | struct rpc_wait_queue resend; /* requests waiting to resend */ |
@@ -150,11 +142,9 @@ struct rpc_xprt { | |||
150 | struct list_head free; /* free slots */ | 142 | struct list_head free; /* free slots */ |
151 | struct rpc_rqst * slot; /* slot table storage */ | 143 | struct rpc_rqst * slot; /* slot table storage */ |
152 | unsigned int max_reqs; /* total slots */ | 144 | unsigned int max_reqs; /* total slots */ |
153 | unsigned long sockstate; /* Socket state */ | 145 | unsigned long state; /* transport state */ |
154 | unsigned char shutdown : 1, /* being shut down */ | 146 | unsigned char shutdown : 1, /* being shut down */ |
155 | nocong : 1, /* no congestion control */ | 147 | resvport : 1; /* use a reserved port */ |
156 | resvport : 1, /* use a reserved port */ | ||
157 | stream : 1; /* TCP */ | ||
158 | 148 | ||
159 | /* | 149 | /* |
160 | * XID | 150 | * XID |
@@ -171,22 +161,27 @@ struct rpc_xprt { | |||
171 | unsigned long tcp_copied, /* copied to request */ | 161 | unsigned long tcp_copied, /* copied to request */ |
172 | tcp_flags; | 162 | tcp_flags; |
173 | /* | 163 | /* |
174 | * Connection of sockets | 164 | * Connection of transports |
175 | */ | 165 | */ |
176 | struct work_struct sock_connect; | 166 | unsigned long connect_timeout, |
167 | bind_timeout, | ||
168 | reestablish_timeout; | ||
169 | struct work_struct connect_worker; | ||
177 | unsigned short port; | 170 | unsigned short port; |
171 | |||
178 | /* | 172 | /* |
179 | * Disconnection of idle sockets | 173 | * Disconnection of idle transports |
180 | */ | 174 | */ |
181 | struct work_struct task_cleanup; | 175 | struct work_struct task_cleanup; |
182 | struct timer_list timer; | 176 | struct timer_list timer; |
183 | unsigned long last_used; | 177 | unsigned long last_used, |
178 | idle_timeout; | ||
184 | 179 | ||
185 | /* | 180 | /* |
186 | * Send stuff | 181 | * Send stuff |
187 | */ | 182 | */ |
188 | spinlock_t sock_lock; /* lock socket info */ | 183 | spinlock_t transport_lock; /* lock transport info */ |
189 | spinlock_t xprt_lock; /* lock xprt info */ | 184 | spinlock_t reserve_lock; /* lock slot table */ |
190 | struct rpc_task * snd_task; /* Task blocked in send */ | 185 | struct rpc_task * snd_task; /* Task blocked in send */ |
191 | 186 | ||
192 | struct list_head recv; | 187 | struct list_head recv; |
@@ -195,37 +190,111 @@ struct rpc_xprt { | |||
195 | void (*old_data_ready)(struct sock *, int); | 190 | void (*old_data_ready)(struct sock *, int); |
196 | void (*old_state_change)(struct sock *); | 191 | void (*old_state_change)(struct sock *); |
197 | void (*old_write_space)(struct sock *); | 192 | void (*old_write_space)(struct sock *); |
198 | |||
199 | wait_queue_head_t cong_wait; | ||
200 | }; | 193 | }; |
201 | 194 | ||
195 | #define XPRT_LAST_FRAG (1 << 0) | ||
196 | #define XPRT_COPY_RECM (1 << 1) | ||
197 | #define XPRT_COPY_XID (1 << 2) | ||
198 | #define XPRT_COPY_DATA (1 << 3) | ||
199 | |||
202 | #ifdef __KERNEL__ | 200 | #ifdef __KERNEL__ |
203 | 201 | ||
204 | struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, | 202 | /* |
205 | struct rpc_timeout *toparms); | 203 | * Transport operations used by ULPs |
206 | int xprt_destroy(struct rpc_xprt *); | 204 | */ |
207 | void xprt_set_timeout(struct rpc_timeout *, unsigned int, | 205 | struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *to); |
208 | unsigned long); | 206 | void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr); |
209 | 207 | ||
210 | void xprt_reserve(struct rpc_task *); | 208 | /* |
211 | int xprt_prepare_transmit(struct rpc_task *); | 209 | * Generic internal transport functions |
212 | void xprt_transmit(struct rpc_task *); | 210 | */ |
213 | void xprt_receive(struct rpc_task *); | 211 | void xprt_connect(struct rpc_task *task); |
212 | void xprt_reserve(struct rpc_task *task); | ||
213 | int xprt_reserve_xprt(struct rpc_task *task); | ||
214 | int xprt_reserve_xprt_cong(struct rpc_task *task); | ||
215 | int xprt_prepare_transmit(struct rpc_task *task); | ||
216 | void xprt_transmit(struct rpc_task *task); | ||
217 | void xprt_abort_transmit(struct rpc_task *task); | ||
214 | int xprt_adjust_timeout(struct rpc_rqst *req); | 218 | int xprt_adjust_timeout(struct rpc_rqst *req); |
215 | void xprt_release(struct rpc_task *); | 219 | void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
216 | void xprt_connect(struct rpc_task *); | 220 | void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
217 | void xprt_sock_setbufsize(struct rpc_xprt *); | 221 | void xprt_release(struct rpc_task *task); |
218 | 222 | int xprt_destroy(struct rpc_xprt *xprt); | |
219 | #define XPRT_LOCKED 0 | 223 | |
220 | #define XPRT_CONNECT 1 | 224 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) |
221 | #define XPRT_CONNECTING 2 | 225 | { |
222 | 226 | return p + xprt->tsh_size; | |
223 | #define xprt_connected(xp) (test_bit(XPRT_CONNECT, &(xp)->sockstate)) | 227 | } |
224 | #define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) | 228 | |
225 | #define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) | 229 | /* |
226 | #define xprt_test_and_clear_connected(xp) \ | 230 | * Transport switch helper functions |
227 | (test_and_clear_bit(XPRT_CONNECT, &(xp)->sockstate)) | 231 | */ |
228 | #define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) | 232 | void xprt_set_retrans_timeout_def(struct rpc_task *task); |
233 | void xprt_set_retrans_timeout_rtt(struct rpc_task *task); | ||
234 | void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); | ||
235 | void xprt_wait_for_buffer_space(struct rpc_task *task); | ||
236 | void xprt_write_space(struct rpc_xprt *xprt); | ||
237 | void xprt_update_rtt(struct rpc_task *task); | ||
238 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | ||
239 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); | ||
240 | void xprt_complete_rqst(struct rpc_task *task, int copied); | ||
241 | void xprt_release_rqst_cong(struct rpc_task *task); | ||
242 | void xprt_disconnect(struct rpc_xprt *xprt); | ||
243 | |||
244 | /* | ||
245 | * Socket transport setup operations | ||
246 | */ | ||
247 | int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to); | ||
248 | int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to); | ||
249 | |||
250 | /* | ||
251 | * Reserved bit positions in xprt->state | ||
252 | */ | ||
253 | #define XPRT_LOCKED (0) | ||
254 | #define XPRT_CONNECTED (1) | ||
255 | #define XPRT_CONNECTING (2) | ||
256 | |||
257 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | ||
258 | { | ||
259 | set_bit(XPRT_CONNECTED, &xprt->state); | ||
260 | } | ||
261 | |||
262 | static inline void xprt_clear_connected(struct rpc_xprt *xprt) | ||
263 | { | ||
264 | clear_bit(XPRT_CONNECTED, &xprt->state); | ||
265 | } | ||
266 | |||
267 | static inline int xprt_connected(struct rpc_xprt *xprt) | ||
268 | { | ||
269 | return test_bit(XPRT_CONNECTED, &xprt->state); | ||
270 | } | ||
271 | |||
272 | static inline int xprt_test_and_set_connected(struct rpc_xprt *xprt) | ||
273 | { | ||
274 | return test_and_set_bit(XPRT_CONNECTED, &xprt->state); | ||
275 | } | ||
276 | |||
277 | static inline int xprt_test_and_clear_connected(struct rpc_xprt *xprt) | ||
278 | { | ||
279 | return test_and_clear_bit(XPRT_CONNECTED, &xprt->state); | ||
280 | } | ||
281 | |||
282 | static inline void xprt_clear_connecting(struct rpc_xprt *xprt) | ||
283 | { | ||
284 | smp_mb__before_clear_bit(); | ||
285 | clear_bit(XPRT_CONNECTING, &xprt->state); | ||
286 | smp_mb__after_clear_bit(); | ||
287 | } | ||
288 | |||
289 | static inline int xprt_connecting(struct rpc_xprt *xprt) | ||
290 | { | ||
291 | return test_bit(XPRT_CONNECTING, &xprt->state); | ||
292 | } | ||
293 | |||
294 | static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt) | ||
295 | { | ||
296 | return test_and_set_bit(XPRT_CONNECTING, &xprt->state); | ||
297 | } | ||
229 | 298 | ||
230 | #endif /* __KERNEL__*/ | 299 | #endif /* __KERNEL__*/ |
231 | 300 | ||
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index ad15a54806d8..a61c04f804b2 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -71,7 +71,12 @@ void restore_processor_state(void); | |||
71 | struct saved_context; | 71 | struct saved_context; |
72 | void __save_processor_state(struct saved_context *ctxt); | 72 | void __save_processor_state(struct saved_context *ctxt); |
73 | void __restore_processor_state(struct saved_context *ctxt); | 73 | void __restore_processor_state(struct saved_context *ctxt); |
74 | extern unsigned long get_usable_page(unsigned gfp_mask); | 74 | unsigned long get_safe_page(gfp_t gfp_mask); |
75 | extern void free_eaten_memory(void); | 75 | |
76 | /* | ||
77 | * XXX: We try to keep some more pages free so that I/O operations succeed | ||
78 | * without paging. Might this be more? | ||
79 | */ | ||
80 | #define PAGES_FOR_IO 512 | ||
76 | 81 | ||
77 | #endif /* _LINUX_SWSUSP_H */ | 82 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index a7bf1a3b1496..20c975642cab 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -171,8 +171,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
171 | extern void swap_setup(void); | 171 | extern void swap_setup(void); |
172 | 172 | ||
173 | /* linux/mm/vmscan.c */ | 173 | /* linux/mm/vmscan.c */ |
174 | extern int try_to_free_pages(struct zone **, unsigned int); | 174 | extern int try_to_free_pages(struct zone **, gfp_t); |
175 | extern int zone_reclaim(struct zone *, unsigned int, unsigned int); | 175 | extern int zone_reclaim(struct zone *, gfp_t, unsigned int); |
176 | extern int shrink_all_memory(int); | 176 | extern int shrink_all_memory(int); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | 178 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a6f03e473737..c7007b1db91d 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -491,6 +491,7 @@ asmlinkage long sys_nfsservctl(int cmd, | |||
491 | asmlinkage long sys_syslog(int type, char __user *buf, int len); | 491 | asmlinkage long sys_syslog(int type, char __user *buf, int len); |
492 | asmlinkage long sys_uselib(const char __user *library); | 492 | asmlinkage long sys_uselib(const char __user *library); |
493 | asmlinkage long sys_ni_syscall(void); | 493 | asmlinkage long sys_ni_syscall(void); |
494 | asmlinkage long sys_ptrace(long request, long pid, long addr, long data); | ||
494 | 495 | ||
495 | asmlinkage long sys_add_key(const char __user *_type, | 496 | asmlinkage long sys_add_key(const char __user *_type, |
496 | const char __user *_description, | 497 | const char __user *_description, |
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 515046d1b2f4..7dac8f04d28e 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/err.h> | 10 | #include <linux/err.h> |
11 | #include <linux/slab.h> | ||
11 | 12 | ||
12 | struct ts_config; | 13 | struct ts_config; |
13 | 14 | ||
@@ -40,7 +41,7 @@ struct ts_state | |||
40 | struct ts_ops | 41 | struct ts_ops |
41 | { | 42 | { |
42 | const char *name; | 43 | const char *name; |
43 | struct ts_config * (*init)(const void *, unsigned int, int); | 44 | struct ts_config * (*init)(const void *, unsigned int, gfp_t); |
44 | unsigned int (*find)(struct ts_config *, | 45 | unsigned int (*find)(struct ts_config *, |
45 | struct ts_state *); | 46 | struct ts_state *); |
46 | void (*destroy)(struct ts_config *); | 47 | void (*destroy)(struct ts_config *); |
@@ -148,7 +149,7 @@ static inline unsigned int textsearch_get_pattern_len(struct ts_config *conf) | |||
148 | extern int textsearch_register(struct ts_ops *); | 149 | extern int textsearch_register(struct ts_ops *); |
149 | extern int textsearch_unregister(struct ts_ops *); | 150 | extern int textsearch_unregister(struct ts_ops *); |
150 | extern struct ts_config *textsearch_prepare(const char *, const void *, | 151 | extern struct ts_config *textsearch_prepare(const char *, const void *, |
151 | unsigned int, int, int); | 152 | unsigned int, gfp_t, int); |
152 | extern void textsearch_destroy(struct ts_config *conf); | 153 | extern void textsearch_destroy(struct ts_config *conf); |
153 | extern unsigned int textsearch_find_continuous(struct ts_config *, | 154 | extern unsigned int textsearch_find_continuous(struct ts_config *, |
154 | struct ts_state *, | 155 | struct ts_state *, |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 3340f3bd135d..72f3a7781106 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -12,16 +12,12 @@ struct timer_list { | |||
12 | struct list_head entry; | 12 | struct list_head entry; |
13 | unsigned long expires; | 13 | unsigned long expires; |
14 | 14 | ||
15 | unsigned long magic; | ||
16 | |||
17 | void (*function)(unsigned long); | 15 | void (*function)(unsigned long); |
18 | unsigned long data; | 16 | unsigned long data; |
19 | 17 | ||
20 | struct timer_base_s *base; | 18 | struct timer_base_s *base; |
21 | }; | 19 | }; |
22 | 20 | ||
23 | #define TIMER_MAGIC 0x4b87ad6e | ||
24 | |||
25 | extern struct timer_base_s __init_timer_base; | 21 | extern struct timer_base_s __init_timer_base; |
26 | 22 | ||
27 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ | 23 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ |
@@ -29,7 +25,6 @@ extern struct timer_base_s __init_timer_base; | |||
29 | .expires = (_expires), \ | 25 | .expires = (_expires), \ |
30 | .data = (_data), \ | 26 | .data = (_data), \ |
31 | .base = &__init_timer_base, \ | 27 | .base = &__init_timer_base, \ |
32 | .magic = TIMER_MAGIC, \ | ||
33 | } | 28 | } |
34 | 29 | ||
35 | #define DEFINE_TIMER(_name, _function, _expires, _data) \ | 30 | #define DEFINE_TIMER(_name, _function, _expires, _data) \ |
@@ -38,6 +33,15 @@ extern struct timer_base_s __init_timer_base; | |||
38 | 33 | ||
39 | void fastcall init_timer(struct timer_list * timer); | 34 | void fastcall init_timer(struct timer_list * timer); |
40 | 35 | ||
36 | static inline void setup_timer(struct timer_list * timer, | ||
37 | void (*function)(unsigned long), | ||
38 | unsigned long data) | ||
39 | { | ||
40 | timer->function = function; | ||
41 | timer->data = data; | ||
42 | init_timer(timer); | ||
43 | } | ||
44 | |||
41 | /*** | 45 | /*** |
42 | * timer_pending - is a timer pending? | 46 | * timer_pending - is a timer pending? |
43 | * @timer: the timer in question | 47 | * @timer: the timer in question |
@@ -74,8 +78,9 @@ extern unsigned long next_timer_interrupt(void); | |||
74 | * Timers with an ->expired field in the past will be executed in the next | 78 | * Timers with an ->expired field in the past will be executed in the next |
75 | * timer tick. | 79 | * timer tick. |
76 | */ | 80 | */ |
77 | static inline void add_timer(struct timer_list * timer) | 81 | static inline void add_timer(struct timer_list *timer) |
78 | { | 82 | { |
83 | BUG_ON(timer_pending(timer)); | ||
79 | __mod_timer(timer, timer->expires); | 84 | __mod_timer(timer, timer->expires); |
80 | } | 85 | } |
81 | 86 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index 7e050a2cc35b..04a4a8cb4ed3 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -282,6 +282,13 @@ static inline int ntp_synced(void) | |||
282 | return !(time_status & STA_UNSYNC); | 282 | return !(time_status & STA_UNSYNC); |
283 | } | 283 | } |
284 | 284 | ||
285 | /* Required to safely shift negative values */ | ||
286 | #define shift_right(x, s) ({ \ | ||
287 | __typeof__(x) __x = (x); \ | ||
288 | __typeof__(s) __s = (s); \ | ||
289 | __x < 0 ? -(-__x >> __s) : __x >> __s; \ | ||
290 | }) | ||
291 | |||
285 | 292 | ||
286 | #ifdef CONFIG_TIME_INTERPOLATION | 293 | #ifdef CONFIG_TIME_INTERPOLATION |
287 | 294 | ||
diff --git a/include/linux/types.h b/include/linux/types.h index 0aee34f9da9f..21b9ce803644 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -151,7 +151,12 @@ typedef unsigned long sector_t; | |||
151 | */ | 151 | */ |
152 | 152 | ||
153 | #ifdef __CHECKER__ | 153 | #ifdef __CHECKER__ |
154 | #define __bitwise __attribute__((bitwise)) | 154 | #define __bitwise__ __attribute__((bitwise)) |
155 | #else | ||
156 | #define __bitwise__ | ||
157 | #endif | ||
158 | #ifdef __CHECK_ENDIAN__ | ||
159 | #define __bitwise __bitwise__ | ||
155 | #else | 160 | #else |
156 | #define __bitwise | 161 | #define __bitwise |
157 | #endif | 162 | #endif |
@@ -166,7 +171,7 @@ typedef __u64 __bitwise __be64; | |||
166 | #endif | 171 | #endif |
167 | 172 | ||
168 | #ifdef __KERNEL__ | 173 | #ifdef __KERNEL__ |
169 | typedef unsigned __nocast gfp_t; | 174 | typedef unsigned __bitwise__ gfp_t; |
170 | #endif | 175 | #endif |
171 | 176 | ||
172 | struct ustat { | 177 | struct ustat { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 4dbe580f9335..748d04385256 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -57,6 +57,7 @@ struct usb_host_endpoint { | |||
57 | struct usb_endpoint_descriptor desc; | 57 | struct usb_endpoint_descriptor desc; |
58 | struct list_head urb_list; | 58 | struct list_head urb_list; |
59 | void *hcpriv; | 59 | void *hcpriv; |
60 | struct kobject *kobj; /* For sysfs info */ | ||
60 | 61 | ||
61 | unsigned char *extra; /* Extra descriptors */ | 62 | unsigned char *extra; /* Extra descriptors */ |
62 | int extralen; | 63 | int extralen; |
@@ -136,7 +137,8 @@ struct usb_interface { | |||
136 | * active alternate setting */ | 137 | * active alternate setting */ |
137 | unsigned num_altsetting; /* number of alternate settings */ | 138 | unsigned num_altsetting; /* number of alternate settings */ |
138 | 139 | ||
139 | int minor; /* minor number this interface is bound to */ | 140 | int minor; /* minor number this interface is |
141 | * bound to */ | ||
140 | enum usb_interface_condition condition; /* state of binding */ | 142 | enum usb_interface_condition condition; /* state of binding */ |
141 | struct device dev; /* interface specific device info */ | 143 | struct device dev; /* interface specific device info */ |
142 | struct class_device *class_dev; | 144 | struct class_device *class_dev; |
@@ -229,7 +231,7 @@ struct usb_interface_cache { | |||
229 | struct usb_host_config { | 231 | struct usb_host_config { |
230 | struct usb_config_descriptor desc; | 232 | struct usb_config_descriptor desc; |
231 | 233 | ||
232 | char *string; | 234 | char *string; /* iConfiguration string, if present */ |
233 | /* the interfaces associated with this configuration, | 235 | /* the interfaces associated with this configuration, |
234 | * stored in no particular order */ | 236 | * stored in no particular order */ |
235 | struct usb_interface *interface[USB_MAXINTERFACES]; | 237 | struct usb_interface *interface[USB_MAXINTERFACES]; |
@@ -248,7 +250,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
248 | __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ | 250 | __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ |
249 | type,(void**)ptr) | 251 | type,(void**)ptr) |
250 | 252 | ||
251 | /* -------------------------------------------------------------------------- */ | 253 | /* ----------------------------------------------------------------------- */ |
252 | 254 | ||
253 | struct usb_operations; | 255 | struct usb_operations; |
254 | 256 | ||
@@ -268,7 +270,8 @@ struct usb_bus { | |||
268 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 270 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
269 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 271 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
270 | 272 | ||
271 | int devnum_next; /* Next open device number in round-robin allocation */ | 273 | int devnum_next; /* Next open device number in |
274 | * round-robin allocation */ | ||
272 | 275 | ||
273 | struct usb_devmap devmap; /* device address allocation map */ | 276 | struct usb_devmap devmap; /* device address allocation map */ |
274 | struct usb_operations *op; /* Operations (specific to the HC) */ | 277 | struct usb_operations *op; /* Operations (specific to the HC) */ |
@@ -289,15 +292,16 @@ struct usb_bus { | |||
289 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 292 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
290 | 293 | ||
291 | struct class_device *class_dev; /* class device for this bus */ | 294 | struct class_device *class_dev; /* class device for this bus */ |
292 | struct kref kref; /* handles reference counting this bus */ | 295 | struct kref kref; /* reference counting for this bus */ |
293 | void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ | 296 | void (*release)(struct usb_bus *bus); |
297 | |||
294 | #if defined(CONFIG_USB_MON) | 298 | #if defined(CONFIG_USB_MON) |
295 | struct mon_bus *mon_bus; /* non-null when associated */ | 299 | struct mon_bus *mon_bus; /* non-null when associated */ |
296 | int monitored; /* non-zero when monitored */ | 300 | int monitored; /* non-zero when monitored */ |
297 | #endif | 301 | #endif |
298 | }; | 302 | }; |
299 | 303 | ||
300 | /* -------------------------------------------------------------------------- */ | 304 | /* ----------------------------------------------------------------------- */ |
301 | 305 | ||
302 | /* This is arbitrary. | 306 | /* This is arbitrary. |
303 | * From USB 2.0 spec Table 11-13, offset 7, a hub can | 307 | * From USB 2.0 spec Table 11-13, offset 7, a hub can |
@@ -326,7 +330,8 @@ struct usb_device { | |||
326 | 330 | ||
327 | struct semaphore serialize; | 331 | struct semaphore serialize; |
328 | 332 | ||
329 | unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */ | 333 | unsigned int toggle[2]; /* one bit for each endpoint |
334 | * ([0] = IN, [1] = OUT) */ | ||
330 | 335 | ||
331 | struct usb_device *parent; /* our hub, unless we're the root */ | 336 | struct usb_device *parent; /* our hub, unless we're the root */ |
332 | struct usb_bus *bus; /* Bus we're part of */ | 337 | struct usb_bus *bus; /* Bus we're part of */ |
@@ -343,12 +348,14 @@ struct usb_device { | |||
343 | 348 | ||
344 | char **rawdescriptors; /* Raw descriptors for each config */ | 349 | char **rawdescriptors; /* Raw descriptors for each config */ |
345 | 350 | ||
346 | int have_langid; /* whether string_langid is valid yet */ | 351 | int have_langid; /* whether string_langid is valid */ |
347 | int string_langid; /* language ID for strings */ | 352 | int string_langid; /* language ID for strings */ |
348 | 353 | ||
349 | char *product; | 354 | /* static strings from the device */ |
350 | char *manufacturer; | 355 | char *product; /* iProduct string, if present */ |
351 | char *serial; /* static strings from the device */ | 356 | char *manufacturer; /* iManufacturer string, if present */ |
357 | char *serial; /* iSerialNumber string, if present */ | ||
358 | |||
352 | struct list_head filelist; | 359 | struct list_head filelist; |
353 | struct class_device *class_dev; | 360 | struct class_device *class_dev; |
354 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ | 361 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ |
@@ -440,22 +447,31 @@ extern struct usb_host_interface *usb_altnum_to_altsetting( | |||
440 | * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are | 447 | * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are |
441 | * high speed, and a different one if they are full or low speed. | 448 | * high speed, and a different one if they are full or low speed. |
442 | */ | 449 | */ |
443 | static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) | 450 | static inline int usb_make_path (struct usb_device *dev, char *buf, |
451 | size_t size) | ||
444 | { | 452 | { |
445 | int actual; | 453 | int actual; |
446 | actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, dev->devpath); | 454 | actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, |
455 | dev->devpath); | ||
447 | return (actual >= (int)size) ? -1 : actual; | 456 | return (actual >= (int)size) ? -1 : actual; |
448 | } | 457 | } |
449 | 458 | ||
450 | /*-------------------------------------------------------------------------*/ | 459 | /*-------------------------------------------------------------------------*/ |
451 | 460 | ||
452 | #define USB_DEVICE_ID_MATCH_DEVICE (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) | 461 | #define USB_DEVICE_ID_MATCH_DEVICE \ |
453 | #define USB_DEVICE_ID_MATCH_DEV_RANGE (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI) | 462 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) |
454 | #define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE) | 463 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ |
464 | (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI) | ||
465 | #define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION \ | ||
466 | (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE) | ||
455 | #define USB_DEVICE_ID_MATCH_DEV_INFO \ | 467 | #define USB_DEVICE_ID_MATCH_DEV_INFO \ |
456 | (USB_DEVICE_ID_MATCH_DEV_CLASS | USB_DEVICE_ID_MATCH_DEV_SUBCLASS | USB_DEVICE_ID_MATCH_DEV_PROTOCOL) | 468 | (USB_DEVICE_ID_MATCH_DEV_CLASS | \ |
469 | USB_DEVICE_ID_MATCH_DEV_SUBCLASS | \ | ||
470 | USB_DEVICE_ID_MATCH_DEV_PROTOCOL) | ||
457 | #define USB_DEVICE_ID_MATCH_INT_INFO \ | 471 | #define USB_DEVICE_ID_MATCH_INT_INFO \ |
458 | (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS | USB_DEVICE_ID_MATCH_INT_PROTOCOL) | 472 | (USB_DEVICE_ID_MATCH_INT_CLASS | \ |
473 | USB_DEVICE_ID_MATCH_INT_SUBCLASS | \ | ||
474 | USB_DEVICE_ID_MATCH_INT_PROTOCOL) | ||
459 | 475 | ||
460 | /** | 476 | /** |
461 | * USB_DEVICE - macro used to describe a specific usb device | 477 | * USB_DEVICE - macro used to describe a specific usb device |
@@ -466,9 +482,11 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) | |||
466 | * specific device. | 482 | * specific device. |
467 | */ | 483 | */ |
468 | #define USB_DEVICE(vend,prod) \ | 484 | #define USB_DEVICE(vend,prod) \ |
469 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), .idProduct = (prod) | 485 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \ |
486 | .idProduct = (prod) | ||
470 | /** | 487 | /** |
471 | * USB_DEVICE_VER - macro used to describe a specific usb device with a version range | 488 | * USB_DEVICE_VER - macro used to describe a specific usb device with a |
489 | * version range | ||
472 | * @vend: the 16 bit USB Vendor ID | 490 | * @vend: the 16 bit USB Vendor ID |
473 | * @prod: the 16 bit USB Product ID | 491 | * @prod: the 16 bit USB Product ID |
474 | * @lo: the bcdDevice_lo value | 492 | * @lo: the bcdDevice_lo value |
@@ -478,7 +496,9 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) | |||
478 | * specific device, with a version range. | 496 | * specific device, with a version range. |
479 | */ | 497 | */ |
480 | #define USB_DEVICE_VER(vend,prod,lo,hi) \ | 498 | #define USB_DEVICE_VER(vend,prod,lo,hi) \ |
481 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, .idVendor = (vend), .idProduct = (prod), .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) | 499 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \ |
500 | .idVendor = (vend), .idProduct = (prod), \ | ||
501 | .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) | ||
482 | 502 | ||
483 | /** | 503 | /** |
484 | * USB_DEVICE_INFO - macro used to describe a class of usb devices | 504 | * USB_DEVICE_INFO - macro used to describe a class of usb devices |
@@ -490,7 +510,8 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) | |||
490 | * specific class of devices. | 510 | * specific class of devices. |
491 | */ | 511 | */ |
492 | #define USB_DEVICE_INFO(cl,sc,pr) \ | 512 | #define USB_DEVICE_INFO(cl,sc,pr) \ |
493 | .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), .bDeviceSubClass = (sc), .bDeviceProtocol = (pr) | 513 | .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), \ |
514 | .bDeviceSubClass = (sc), .bDeviceProtocol = (pr) | ||
494 | 515 | ||
495 | /** | 516 | /** |
496 | * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces | 517 | * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces |
@@ -502,9 +523,10 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) | |||
502 | * specific class of interfaces. | 523 | * specific class of interfaces. |
503 | */ | 524 | */ |
504 | #define USB_INTERFACE_INFO(cl,sc,pr) \ | 525 | #define USB_INTERFACE_INFO(cl,sc,pr) \ |
505 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | 526 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ |
527 | .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) | ||
506 | 528 | ||
507 | /* -------------------------------------------------------------------------- */ | 529 | /* ----------------------------------------------------------------------- */ |
508 | 530 | ||
509 | /** | 531 | /** |
510 | * struct usb_driver - identifies USB driver to usbcore | 532 | * struct usb_driver - identifies USB driver to usbcore |
@@ -557,7 +579,8 @@ struct usb_driver { | |||
557 | 579 | ||
558 | void (*disconnect) (struct usb_interface *intf); | 580 | void (*disconnect) (struct usb_interface *intf); |
559 | 581 | ||
560 | int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf); | 582 | int (*ioctl) (struct usb_interface *intf, unsigned int code, |
583 | void *buf); | ||
561 | 584 | ||
562 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 585 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
563 | int (*resume) (struct usb_interface *intf); | 586 | int (*resume) (struct usb_interface *intf); |
@@ -572,10 +595,8 @@ extern struct bus_type usb_bus_type; | |||
572 | 595 | ||
573 | /** | 596 | /** |
574 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number | 597 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number |
575 | * @name: devfs name for this driver. Will also be used by the driver | 598 | * @name: the usb class device name for this driver. Will show up in sysfs. |
576 | * class code to create a usb class device. | ||
577 | * @fops: pointer to the struct file_operations of this driver. | 599 | * @fops: pointer to the struct file_operations of this driver. |
578 | * @mode: the mode for the devfs file to be created for this driver. | ||
579 | * @minor_base: the start of the minor range for this driver. | 600 | * @minor_base: the start of the minor range for this driver. |
580 | * | 601 | * |
581 | * This structure is used for the usb_register_dev() and | 602 | * This structure is used for the usb_register_dev() and |
@@ -585,8 +606,7 @@ extern struct bus_type usb_bus_type; | |||
585 | struct usb_class_driver { | 606 | struct usb_class_driver { |
586 | char *name; | 607 | char *name; |
587 | struct file_operations *fops; | 608 | struct file_operations *fops; |
588 | mode_t mode; | 609 | int minor_base; |
589 | int minor_base; | ||
590 | }; | 610 | }; |
591 | 611 | ||
592 | /* | 612 | /* |
@@ -603,7 +623,7 @@ extern void usb_deregister_dev(struct usb_interface *intf, | |||
603 | 623 | ||
604 | extern int usb_disabled(void); | 624 | extern int usb_disabled(void); |
605 | 625 | ||
606 | /* -------------------------------------------------------------------------- */ | 626 | /* ----------------------------------------------------------------------- */ |
607 | 627 | ||
608 | /* | 628 | /* |
609 | * URB support, for asynchronous request completions | 629 | * URB support, for asynchronous request completions |
@@ -613,12 +633,14 @@ extern int usb_disabled(void); | |||
613 | * urb->transfer_flags: | 633 | * urb->transfer_flags: |
614 | */ | 634 | */ |
615 | #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ | 635 | #define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ |
616 | #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */ | 636 | #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame |
637 | * ignored */ | ||
617 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ | 638 | #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ |
618 | #define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ | 639 | #define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ |
619 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ | 640 | #define URB_NO_FSBR 0x0020 /* UHCI-specific */ |
620 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */ | 641 | #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ |
621 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */ | 642 | #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt |
643 | * needed */ | ||
622 | 644 | ||
623 | struct usb_iso_packet_descriptor { | 645 | struct usb_iso_packet_descriptor { |
624 | unsigned int offset; | 646 | unsigned int offset; |
@@ -806,7 +828,8 @@ struct urb | |||
806 | u8 reject; /* submissions will fail */ | 828 | u8 reject; /* submissions will fail */ |
807 | 829 | ||
808 | /* public, documented fields in the urb that can be used by drivers */ | 830 | /* public, documented fields in the urb that can be used by drivers */ |
809 | struct list_head urb_list; /* list head for use by the urb owner */ | 831 | struct list_head urb_list; /* list head for use by the urb's |
832 | * current owner */ | ||
810 | struct usb_device *dev; /* (in) pointer to associated device */ | 833 | struct usb_device *dev; /* (in) pointer to associated device */ |
811 | unsigned int pipe; /* (in) pipe information */ | 834 | unsigned int pipe; /* (in) pipe information */ |
812 | int status; /* (return) non-ISO status */ | 835 | int status; /* (return) non-ISO status */ |
@@ -819,14 +842,16 @@ struct urb | |||
819 | dma_addr_t setup_dma; /* (in) dma addr for setup_packet */ | 842 | dma_addr_t setup_dma; /* (in) dma addr for setup_packet */ |
820 | int start_frame; /* (modify) start frame (ISO) */ | 843 | int start_frame; /* (modify) start frame (ISO) */ |
821 | int number_of_packets; /* (in) number of ISO packets */ | 844 | int number_of_packets; /* (in) number of ISO packets */ |
822 | int interval; /* (modify) transfer interval (INT/ISO) */ | 845 | int interval; /* (modify) transfer interval |
846 | * (INT/ISO) */ | ||
823 | int error_count; /* (return) number of ISO errors */ | 847 | int error_count; /* (return) number of ISO errors */ |
824 | void *context; /* (in) context for completion */ | 848 | void *context; /* (in) context for completion */ |
825 | usb_complete_t complete; /* (in) completion routine */ | 849 | usb_complete_t complete; /* (in) completion routine */ |
826 | struct usb_iso_packet_descriptor iso_frame_desc[0]; /* (in) ISO ONLY */ | 850 | struct usb_iso_packet_descriptor iso_frame_desc[0]; |
851 | /* (in) ISO ONLY */ | ||
827 | }; | 852 | }; |
828 | 853 | ||
829 | /* -------------------------------------------------------------------------- */ | 854 | /* ----------------------------------------------------------------------- */ |
830 | 855 | ||
831 | /** | 856 | /** |
832 | * usb_fill_control_urb - initializes a control urb | 857 | * usb_fill_control_urb - initializes a control urb |
@@ -933,17 +958,17 @@ static inline void usb_fill_int_urb (struct urb *urb, | |||
933 | } | 958 | } |
934 | 959 | ||
935 | extern void usb_init_urb(struct urb *urb); | 960 | extern void usb_init_urb(struct urb *urb); |
936 | extern struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags); | 961 | extern struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags); |
937 | extern void usb_free_urb(struct urb *urb); | 962 | extern void usb_free_urb(struct urb *urb); |
938 | #define usb_put_urb usb_free_urb | 963 | #define usb_put_urb usb_free_urb |
939 | extern struct urb *usb_get_urb(struct urb *urb); | 964 | extern struct urb *usb_get_urb(struct urb *urb); |
940 | extern int usb_submit_urb(struct urb *urb, unsigned mem_flags); | 965 | extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); |
941 | extern int usb_unlink_urb(struct urb *urb); | 966 | extern int usb_unlink_urb(struct urb *urb); |
942 | extern void usb_kill_urb(struct urb *urb); | 967 | extern void usb_kill_urb(struct urb *urb); |
943 | 968 | ||
944 | #define HAVE_USB_BUFFERS | 969 | #define HAVE_USB_BUFFERS |
945 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 970 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
946 | unsigned mem_flags, dma_addr_t *dma); | 971 | gfp_t mem_flags, dma_addr_t *dma); |
947 | void usb_buffer_free (struct usb_device *dev, size_t size, | 972 | void usb_buffer_free (struct usb_device *dev, size_t size, |
948 | void *addr, dma_addr_t dma); | 973 | void *addr, dma_addr_t dma); |
949 | 974 | ||
@@ -974,11 +999,6 @@ extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe, | |||
974 | void *data, int len, int *actual_length, | 999 | void *data, int len, int *actual_length, |
975 | int timeout); | 1000 | int timeout); |
976 | 1001 | ||
977 | /* selective suspend/resume */ | ||
978 | extern int usb_suspend_device(struct usb_device *dev, pm_message_t message); | ||
979 | extern int usb_resume_device(struct usb_device *dev); | ||
980 | |||
981 | |||
982 | /* wrappers around usb_control_msg() for the most common standard requests */ | 1002 | /* wrappers around usb_control_msg() for the most common standard requests */ |
983 | extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, | 1003 | extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, |
984 | unsigned char descindex, void *buf, int size); | 1004 | unsigned char descindex, void *buf, int size); |
@@ -1050,13 +1070,13 @@ int usb_sg_init ( | |||
1050 | struct scatterlist *sg, | 1070 | struct scatterlist *sg, |
1051 | int nents, | 1071 | int nents, |
1052 | size_t length, | 1072 | size_t length, |
1053 | unsigned mem_flags | 1073 | gfp_t mem_flags |
1054 | ); | 1074 | ); |
1055 | void usb_sg_cancel (struct usb_sg_request *io); | 1075 | void usb_sg_cancel (struct usb_sg_request *io); |
1056 | void usb_sg_wait (struct usb_sg_request *io); | 1076 | void usb_sg_wait (struct usb_sg_request *io); |
1057 | 1077 | ||
1058 | 1078 | ||
1059 | /* -------------------------------------------------------------------------- */ | 1079 | /* ----------------------------------------------------------------------- */ |
1060 | 1080 | ||
1061 | /* | 1081 | /* |
1062 | * For various legacy reasons, Linux has a small cookie that's paired with | 1082 | * For various legacy reasons, Linux has a small cookie that's paired with |
@@ -1097,23 +1117,34 @@ void usb_sg_wait (struct usb_sg_request *io); | |||
1097 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ | 1117 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ |
1098 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) | 1118 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) |
1099 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) | 1119 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) |
1100 | #define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | ((bit) << (ep))) | 1120 | #define usb_settoggle(dev, ep, out, bit) \ |
1121 | ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \ | ||
1122 | ((bit) << (ep))) | ||
1101 | 1123 | ||
1102 | 1124 | ||
1103 | static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int endpoint) | 1125 | static inline unsigned int __create_pipe(struct usb_device *dev, |
1126 | unsigned int endpoint) | ||
1104 | { | 1127 | { |
1105 | return (dev->devnum << 8) | (endpoint << 15); | 1128 | return (dev->devnum << 8) | (endpoint << 15); |
1106 | } | 1129 | } |
1107 | 1130 | ||
1108 | /* Create various pipes... */ | 1131 | /* Create various pipes... */ |
1109 | #define usb_sndctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint)) | 1132 | #define usb_sndctrlpipe(dev,endpoint) \ |
1110 | #define usb_rcvctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1133 | ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint)) |
1111 | #define usb_sndisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint)) | 1134 | #define usb_rcvctrlpipe(dev,endpoint) \ |
1112 | #define usb_rcvisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1135 | ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) |
1113 | #define usb_sndbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint)) | 1136 | #define usb_sndisocpipe(dev,endpoint) \ |
1114 | #define usb_rcvbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1137 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint)) |
1115 | #define usb_sndintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) | 1138 | #define usb_rcvisocpipe(dev,endpoint) \ |
1116 | #define usb_rcvintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | 1139 | ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) |
1140 | #define usb_sndbulkpipe(dev,endpoint) \ | ||
1141 | ((PIPE_BULK << 30) | __create_pipe(dev,endpoint)) | ||
1142 | #define usb_rcvbulkpipe(dev,endpoint) \ | ||
1143 | ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | ||
1144 | #define usb_sndintpipe(dev,endpoint) \ | ||
1145 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) | ||
1146 | #define usb_rcvintpipe(dev,endpoint) \ | ||
1147 | ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) | ||
1117 | 1148 | ||
1118 | /*-------------------------------------------------------------------------*/ | 1149 | /*-------------------------------------------------------------------------*/ |
1119 | 1150 | ||
@@ -1137,17 +1168,29 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out) | |||
1137 | return le16_to_cpu(ep->desc.wMaxPacketSize); | 1168 | return le16_to_cpu(ep->desc.wMaxPacketSize); |
1138 | } | 1169 | } |
1139 | 1170 | ||
1140 | /* -------------------------------------------------------------------------- */ | 1171 | /* ----------------------------------------------------------------------- */ |
1172 | |||
1173 | /* Events from the usb core */ | ||
1174 | #define USB_DEVICE_ADD 0x0001 | ||
1175 | #define USB_DEVICE_REMOVE 0x0002 | ||
1176 | #define USB_BUS_ADD 0x0003 | ||
1177 | #define USB_BUS_REMOVE 0x0004 | ||
1178 | extern void usb_register_notify(struct notifier_block *nb); | ||
1179 | extern void usb_unregister_notify(struct notifier_block *nb); | ||
1141 | 1180 | ||
1142 | #ifdef DEBUG | 1181 | #ifdef DEBUG |
1143 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg) | 1182 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ |
1183 | __FILE__ , ## arg) | ||
1144 | #else | 1184 | #else |
1145 | #define dbg(format, arg...) do {} while (0) | 1185 | #define dbg(format, arg...) do {} while (0) |
1146 | #endif | 1186 | #endif |
1147 | 1187 | ||
1148 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) | 1188 | #define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ |
1149 | #define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) | 1189 | __FILE__ , ## arg) |
1150 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) | 1190 | #define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \ |
1191 | __FILE__ , ## arg) | ||
1192 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \ | ||
1193 | __FILE__ , ## arg) | ||
1151 | 1194 | ||
1152 | 1195 | ||
1153 | #endif /* __KERNEL__ */ | 1196 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index 71e608607324..ff81117eb733 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -107,18 +107,18 @@ struct usb_ep_ops { | |||
107 | int (*disable) (struct usb_ep *ep); | 107 | int (*disable) (struct usb_ep *ep); |
108 | 108 | ||
109 | struct usb_request *(*alloc_request) (struct usb_ep *ep, | 109 | struct usb_request *(*alloc_request) (struct usb_ep *ep, |
110 | unsigned gfp_flags); | 110 | gfp_t gfp_flags); |
111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); | 111 | void (*free_request) (struct usb_ep *ep, struct usb_request *req); |
112 | 112 | ||
113 | void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, | 113 | void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, |
114 | dma_addr_t *dma, unsigned gfp_flags); | 114 | dma_addr_t *dma, gfp_t gfp_flags); |
115 | void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, | 115 | void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, |
116 | unsigned bytes); | 116 | unsigned bytes); |
117 | // NOTE: on 2.6, drivers may also use dma_map() and | 117 | // NOTE: on 2.6, drivers may also use dma_map() and |
118 | // dma_sync_single_*() to directly manage dma overhead. | 118 | // dma_sync_single_*() to directly manage dma overhead. |
119 | 119 | ||
120 | int (*queue) (struct usb_ep *ep, struct usb_request *req, | 120 | int (*queue) (struct usb_ep *ep, struct usb_request *req, |
121 | unsigned gfp_flags); | 121 | gfp_t gfp_flags); |
122 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | 122 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); |
123 | 123 | ||
124 | int (*set_halt) (struct usb_ep *ep, int value); | 124 | int (*set_halt) (struct usb_ep *ep, int value); |
@@ -214,7 +214,7 @@ usb_ep_disable (struct usb_ep *ep) | |||
214 | * Returns the request, or null if one could not be allocated. | 214 | * Returns the request, or null if one could not be allocated. |
215 | */ | 215 | */ |
216 | static inline struct usb_request * | 216 | static inline struct usb_request * |
217 | usb_ep_alloc_request (struct usb_ep *ep, unsigned gfp_flags) | 217 | usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) |
218 | { | 218 | { |
219 | return ep->ops->alloc_request (ep, gfp_flags); | 219 | return ep->ops->alloc_request (ep, gfp_flags); |
220 | } | 220 | } |
@@ -254,7 +254,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req) | |||
254 | */ | 254 | */ |
255 | static inline void * | 255 | static inline void * |
256 | usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, | 256 | usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, |
257 | unsigned gfp_flags) | 257 | gfp_t gfp_flags) |
258 | { | 258 | { |
259 | return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); | 259 | return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); |
260 | } | 260 | } |
@@ -330,7 +330,7 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len) | |||
330 | * reported when the usb peripheral is disconnected. | 330 | * reported when the usb peripheral is disconnected. |
331 | */ | 331 | */ |
332 | static inline int | 332 | static inline int |
333 | usb_ep_queue (struct usb_ep *ep, struct usb_request *req, unsigned gfp_flags) | 333 | usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) |
334 | { | 334 | { |
335 | return ep->ops->queue (ep, req, gfp_flags); | 335 | return ep->ops->queue (ep, req, gfp_flags); |
336 | } | 336 | } |
diff --git a/include/linux/usb_otg.h b/include/linux/usb_otg.h index c6683146e9b0..f827f6e203c2 100644 --- a/include/linux/usb_otg.h +++ b/include/linux/usb_otg.h | |||
@@ -63,6 +63,10 @@ struct otg_transceiver { | |||
63 | int (*set_power)(struct otg_transceiver *otg, | 63 | int (*set_power)(struct otg_transceiver *otg, |
64 | unsigned mA); | 64 | unsigned mA); |
65 | 65 | ||
66 | /* for non-OTG B devices: set transceiver into suspend mode */ | ||
67 | int (*set_suspend)(struct otg_transceiver *otg, | ||
68 | int suspend); | ||
69 | |||
66 | /* for B devices only: start session with A-Host */ | 70 | /* for B devices only: start session with A-Host */ |
67 | int (*start_srp)(struct otg_transceiver *otg); | 71 | int (*start_srp)(struct otg_transceiver *otg); |
68 | 72 | ||
@@ -108,6 +112,15 @@ otg_set_power(struct otg_transceiver *otg, unsigned mA) | |||
108 | } | 112 | } |
109 | 113 | ||
110 | static inline int | 114 | static inline int |
115 | otg_set_suspend(struct otg_transceiver *otg, int suspend) | ||
116 | { | ||
117 | if (otg->set_suspend != NULL) | ||
118 | return otg->set_suspend(otg, suspend); | ||
119 | else | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | static inline int | ||
111 | otg_start_srp(struct otg_transceiver *otg) | 124 | otg_start_srp(struct otg_transceiver *otg) |
112 | { | 125 | { |
113 | return otg->start_srp(otg); | 126 | return otg->start_srp(otg); |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 9facf733800c..8859f0b41543 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -140,6 +140,12 @@ struct usbdevfs_urb32 { | |||
140 | compat_caddr_t usercontext; /* unused */ | 140 | compat_caddr_t usercontext; /* unused */ |
141 | struct usbdevfs_iso_packet_desc iso_frame_desc[0]; | 141 | struct usbdevfs_iso_packet_desc iso_frame_desc[0]; |
142 | }; | 142 | }; |
143 | |||
144 | struct usbdevfs_ioctl32 { | ||
145 | s32 ifno; | ||
146 | s32 ioctl_code; | ||
147 | compat_caddr_t data; | ||
148 | }; | ||
143 | #endif | 149 | #endif |
144 | 150 | ||
145 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) | 151 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) |
@@ -160,6 +166,7 @@ struct usbdevfs_urb32 { | |||
160 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) | 166 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
161 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) | 167 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) |
162 | #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) | 168 | #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) |
169 | #define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32) | ||
163 | #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) | 170 | #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) |
164 | #define USBDEVFS_RESET _IO('U', 20) | 171 | #define USBDEVFS_RESET _IO('U', 20) |
165 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) | 172 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 3701a0673d2c..1d5577b2b752 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -32,10 +32,14 @@ struct vm_struct { | |||
32 | * Highlevel APIs for driver use | 32 | * Highlevel APIs for driver use |
33 | */ | 33 | */ |
34 | extern void *vmalloc(unsigned long size); | 34 | extern void *vmalloc(unsigned long size); |
35 | extern void *vmalloc_node(unsigned long size, int node); | ||
35 | extern void *vmalloc_exec(unsigned long size); | 36 | extern void *vmalloc_exec(unsigned long size); |
36 | extern void *vmalloc_32(unsigned long size); | 37 | extern void *vmalloc_32(unsigned long size); |
37 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); | 38 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
38 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot); | 39 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, |
40 | pgprot_t prot); | ||
41 | extern void *__vmalloc_node(unsigned long size, gfp_t gfp_mask, | ||
42 | pgprot_t prot, int node); | ||
39 | extern void vfree(void *addr); | 43 | extern void vfree(void *addr); |
40 | 44 | ||
41 | extern void *vmap(struct page **pages, unsigned int count, | 45 | extern void *vmap(struct page **pages, unsigned int count, |
@@ -48,6 +52,8 @@ extern void vunmap(void *addr); | |||
48 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | 52 | extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); |
49 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 53 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, |
50 | unsigned long start, unsigned long end); | 54 | unsigned long start, unsigned long end); |
55 | extern struct vm_struct *get_vm_area_node(unsigned long size, | ||
56 | unsigned long flags, int node); | ||
51 | extern struct vm_struct *remove_vm_area(void *addr); | 57 | extern struct vm_struct *remove_vm_area(void *addr); |
52 | extern struct vm_struct *__remove_vm_area(void *addr); | 58 | extern struct vm_struct *__remove_vm_area(void *addr); |
53 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 59 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index 167d956c492b..dae9860091dd 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h | |||
@@ -265,15 +265,6 @@ typedef struct { | |||
265 | #include <linux/tty_driver.h> | 265 | #include <linux/tty_driver.h> |
266 | #include <linux/tty_flip.h> | 266 | #include <linux/tty_flip.h> |
267 | 267 | ||
268 | |||
269 | #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) | ||
270 | #define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\ | ||
271 | ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0) | ||
272 | #define is_hex_digit(ch) ((((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')||\ | ||
273 | ((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'f')||\ | ||
274 | ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'F'))?1:0) | ||
275 | |||
276 | |||
277 | /****** Data Structures *****************************************************/ | 268 | /****** Data Structures *****************************************************/ |
278 | 269 | ||
279 | /* Adapter Data Space. | 270 | /* Adapter Data Space. |
diff --git a/include/linux/x1205.h b/include/linux/x1205.h new file mode 100644 index 000000000000..64fd3af894a5 --- /dev/null +++ b/include/linux/x1205.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * x1205.h - defines for drivers/i2c/chips/x1205.c | ||
3 | * Copyright 2004 Karen Spearel | ||
4 | * Copyright 2005 Alessandro Zummo | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_X1205_H__ | ||
13 | #define __LINUX_X1205_H__ | ||
14 | |||
15 | /* commands */ | ||
16 | |||
17 | #define X1205_CMD_GETDATETIME 0 | ||
18 | #define X1205_CMD_SETTIME 1 | ||
19 | #define X1205_CMD_SETDATETIME 2 | ||
20 | #define X1205_CMD_GETALARM 3 | ||
21 | #define X1205_CMD_SETALARM 4 | ||
22 | #define X1205_CMD_GETDTRIM 5 | ||
23 | #define X1205_CMD_SETDTRIM 6 | ||
24 | #define X1205_CMD_GETATRIM 7 | ||
25 | #define X1205_CMD_SETATRIM 8 | ||
26 | |||
27 | extern int x1205_do_command(unsigned int cmd, void *arg); | ||
28 | extern int x1205_direct_attach(int adapter_id, | ||
29 | struct i2c_client_address_data *address_data); | ||
30 | |||
31 | #endif /* __LINUX_X1205_H__ */ | ||
diff --git a/include/linux/zutil.h b/include/linux/zutil.h index fdfd5ed41ec4..ee0c59cf2136 100644 --- a/include/linux/zutil.h +++ b/include/linux/zutil.h | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | #include <linux/zlib.h> | 16 | #include <linux/zlib.h> |
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | #include <linux/errno.h> | ||
19 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
20 | 19 | ||
21 | typedef unsigned char uch; | 20 | typedef unsigned char uch; |
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h index cb7c0aa96f22..8138983adced 100644 --- a/include/media/ovcamchip.h +++ b/include/media/ovcamchip.h | |||
@@ -17,20 +17,6 @@ | |||
17 | #include <linux/videodev.h> | 17 | #include <linux/videodev.h> |
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | 19 | ||
20 | /* Remove these once they are officially defined */ | ||
21 | #ifndef I2C_DRIVERID_OVCAMCHIP | ||
22 | #define I2C_DRIVERID_OVCAMCHIP 0xf00f | ||
23 | #endif | ||
24 | #ifndef I2C_HW_SMBUS_OV511 | ||
25 | #define I2C_HW_SMBUS_OV511 0xfe | ||
26 | #endif | ||
27 | #ifndef I2C_HW_SMBUS_OV518 | ||
28 | #define I2C_HW_SMBUS_OV518 0xff | ||
29 | #endif | ||
30 | #ifndef I2C_HW_SMBUS_OVFX2 | ||
31 | #define I2C_HW_SMBUS_OVFX2 0xfd | ||
32 | #endif | ||
33 | |||
34 | /* --------------------------------- */ | 20 | /* --------------------------------- */ |
35 | /* ENUMERATIONS */ | 21 | /* ENUMERATIONS */ |
36 | /* --------------------------------- */ | 22 | /* --------------------------------- */ |
diff --git a/include/net/ax25.h b/include/net/ax25.h index 9dbcd9e51c00..2250a18b0cbb 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h | |||
@@ -171,7 +171,7 @@ typedef struct { | |||
171 | ax25_address calls[AX25_MAX_DIGIS]; | 171 | ax25_address calls[AX25_MAX_DIGIS]; |
172 | unsigned char repeated[AX25_MAX_DIGIS]; | 172 | unsigned char repeated[AX25_MAX_DIGIS]; |
173 | unsigned char ndigi; | 173 | unsigned char ndigi; |
174 | char lastrepeat; | 174 | signed char lastrepeat; |
175 | } ax25_digi; | 175 | } ax25_digi; |
176 | 176 | ||
177 | typedef struct ax25_route { | 177 | typedef struct ax25_route { |
@@ -237,8 +237,7 @@ typedef struct ax25_cb { | |||
237 | static __inline__ void ax25_cb_put(ax25_cb *ax25) | 237 | static __inline__ void ax25_cb_put(ax25_cb *ax25) |
238 | { | 238 | { |
239 | if (atomic_dec_and_test(&ax25->refcount)) { | 239 | if (atomic_dec_and_test(&ax25->refcount)) { |
240 | if (ax25->digipeat) | 240 | kfree(ax25->digipeat); |
241 | kfree(ax25->digipeat); | ||
242 | kfree(ax25); | 241 | kfree(ax25); |
243 | } | 242 | } |
244 | } | 243 | } |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 210458624840..e42d728b1620 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -171,4 +171,10 @@ static inline int skb_frags_no(struct sk_buff *skb) | |||
171 | 171 | ||
172 | int bt_err(__u16 code); | 172 | int bt_err(__u16 code); |
173 | 173 | ||
174 | extern int hci_sock_init(void); | ||
175 | extern int hci_sock_cleanup(void); | ||
176 | |||
177 | extern int bt_sysfs_init(void); | ||
178 | extern void bt_sysfs_cleanup(void); | ||
179 | |||
174 | #endif /* __BLUETOOTH_H */ | 180 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index fbe557f7ea1d..e656be7c001a 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -275,9 +275,6 @@ static inline void rfcomm_session_hold(struct rfcomm_session *s) | |||
275 | atomic_inc(&s->refcnt); | 275 | atomic_inc(&s->refcnt); |
276 | } | 276 | } |
277 | 277 | ||
278 | /* ---- RFCOMM chechsum ---- */ | ||
279 | extern u8 rfcomm_crc_table[]; | ||
280 | |||
281 | /* ---- RFCOMM sockets ---- */ | 278 | /* ---- RFCOMM sockets ---- */ |
282 | struct sockaddr_rc { | 279 | struct sockaddr_rc { |
283 | sa_family_t rc_family; | 280 | sa_family_t rc_family; |
diff --git a/include/net/dst.h b/include/net/dst.h index 4a056a682435..6c196a5baf24 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -94,7 +94,6 @@ struct dst_ops | |||
94 | struct dst_entry * (*negative_advice)(struct dst_entry *); | 94 | struct dst_entry * (*negative_advice)(struct dst_entry *); |
95 | void (*link_failure)(struct sk_buff *); | 95 | void (*link_failure)(struct sk_buff *); |
96 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); | 96 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); |
97 | int (*get_mss)(struct dst_entry *dst, u32 mtu); | ||
98 | int entry_size; | 97 | int entry_size; |
99 | 98 | ||
100 | atomic_t entries; | 99 | atomic_t entries; |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index dc36b1be6745..5e38dca1d082 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -11,19 +11,26 @@ | |||
11 | * | 11 | * |
12 | * Adaption to a generic IEEE 802.11 stack by James Ketrenos | 12 | * Adaption to a generic IEEE 802.11 stack by James Ketrenos |
13 | * <jketreno@linux.intel.com> | 13 | * <jketreno@linux.intel.com> |
14 | * Copyright (c) 2004, Intel Corporation | 14 | * Copyright (c) 2004-2005, Intel Corporation |
15 | * | 15 | * |
16 | * This program is free software; you can redistribute it and/or modify | 16 | * This program is free software; you can redistribute it and/or modify |
17 | * it under the terms of the GNU General Public License version 2 as | 17 | * it under the terms of the GNU General Public License version 2 as |
18 | * published by the Free Software Foundation. See README and COPYING for | 18 | * published by the Free Software Foundation. See README and COPYING for |
19 | * more details. | 19 | * more details. |
20 | * | ||
21 | * API Version History | ||
22 | * 1.0.x -- Initial version | ||
23 | * 1.1.x -- Added radiotap, QoS, TIM, ieee80211_geo APIs, | ||
24 | * various structure changes, and crypto API init method | ||
20 | */ | 25 | */ |
21 | #ifndef IEEE80211_H | 26 | #ifndef IEEE80211_H |
22 | #define IEEE80211_H | 27 | #define IEEE80211_H |
23 | #include <linux/if_ether.h> /* ETH_ALEN */ | 28 | #include <linux/if_ether.h> /* ETH_ALEN */ |
24 | #include <linux/kernel.h> /* ARRAY_SIZE */ | 29 | #include <linux/kernel.h> /* ARRAY_SIZE */ |
25 | #include <linux/wireless.h> | 30 | #include <linux/wireless.h> |
26 | 31 | ||
32 | #define IEEE80211_VERSION "git-1.1.6" | ||
33 | |||
27 | #define IEEE80211_DATA_LEN 2304 | 34 | #define IEEE80211_DATA_LEN 2304 |
28 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | 35 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section |
29 | 6.2.1.1.2. | 36 | 6.2.1.1.2. |
@@ -33,34 +40,13 @@ | |||
33 | represents the 2304 bytes of real data, plus a possible 8 bytes of | 40 | represents the 2304 bytes of real data, plus a possible 8 bytes of |
34 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ | 41 | WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ |
35 | 42 | ||
36 | |||
37 | #define IEEE80211_HLEN 30 | ||
38 | #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) | ||
39 | |||
40 | struct ieee80211_hdr { | ||
41 | __le16 frame_ctl; | ||
42 | __le16 duration_id; | ||
43 | u8 addr1[ETH_ALEN]; | ||
44 | u8 addr2[ETH_ALEN]; | ||
45 | u8 addr3[ETH_ALEN]; | ||
46 | __le16 seq_ctl; | ||
47 | u8 addr4[ETH_ALEN]; | ||
48 | } __attribute__ ((packed)); | ||
49 | |||
50 | struct ieee80211_hdr_3addr { | ||
51 | __le16 frame_ctl; | ||
52 | __le16 duration_id; | ||
53 | u8 addr1[ETH_ALEN]; | ||
54 | u8 addr2[ETH_ALEN]; | ||
55 | u8 addr3[ETH_ALEN]; | ||
56 | __le16 seq_ctl; | ||
57 | } __attribute__ ((packed)); | ||
58 | |||
59 | #define IEEE80211_1ADDR_LEN 10 | 43 | #define IEEE80211_1ADDR_LEN 10 |
60 | #define IEEE80211_2ADDR_LEN 16 | 44 | #define IEEE80211_2ADDR_LEN 16 |
61 | #define IEEE80211_3ADDR_LEN 24 | 45 | #define IEEE80211_3ADDR_LEN 24 |
62 | #define IEEE80211_4ADDR_LEN 30 | 46 | #define IEEE80211_4ADDR_LEN 30 |
63 | #define IEEE80211_FCS_LEN 4 | 47 | #define IEEE80211_FCS_LEN 4 |
48 | #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) | ||
49 | #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) | ||
64 | 50 | ||
65 | #define MIN_FRAG_THRESHOLD 256U | 51 | #define MIN_FRAG_THRESHOLD 256U |
66 | #define MAX_FRAG_THRESHOLD 2346U | 52 | #define MAX_FRAG_THRESHOLD 2346U |
@@ -113,11 +99,11 @@ struct ieee80211_hdr_3addr { | |||
113 | #define IEEE80211_STYPE_CFACK 0x0050 | 99 | #define IEEE80211_STYPE_CFACK 0x0050 |
114 | #define IEEE80211_STYPE_CFPOLL 0x0060 | 100 | #define IEEE80211_STYPE_CFPOLL 0x0060 |
115 | #define IEEE80211_STYPE_CFACKPOLL 0x0070 | 101 | #define IEEE80211_STYPE_CFACKPOLL 0x0070 |
102 | #define IEEE80211_STYPE_QOS_DATA 0x0080 | ||
116 | 103 | ||
117 | #define IEEE80211_SCTL_FRAG 0x000F | 104 | #define IEEE80211_SCTL_FRAG 0x000F |
118 | #define IEEE80211_SCTL_SEQ 0xFFF0 | 105 | #define IEEE80211_SCTL_SEQ 0xFFF0 |
119 | 106 | ||
120 | |||
121 | /* debug macros */ | 107 | /* debug macros */ |
122 | 108 | ||
123 | #ifdef CONFIG_IEEE80211_DEBUG | 109 | #ifdef CONFIG_IEEE80211_DEBUG |
@@ -128,8 +114,7 @@ do { if (ieee80211_debug_level & (level)) \ | |||
128 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) | 114 | in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) |
129 | #else | 115 | #else |
130 | #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) | 116 | #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) |
131 | #endif /* CONFIG_IEEE80211_DEBUG */ | 117 | #endif /* CONFIG_IEEE80211_DEBUG */ |
132 | |||
133 | 118 | ||
134 | /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ | 119 | /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ |
135 | 120 | ||
@@ -140,7 +125,6 @@ do { if (ieee80211_debug_level & (level)) \ | |||
140 | * messages. It should never be used for passing essid to user space. */ | 125 | * messages. It should never be used for passing essid to user space. */ |
141 | const char *escape_essid(const char *essid, u8 essid_len); | 126 | const char *escape_essid(const char *essid, u8 essid_len); |
142 | 127 | ||
143 | |||
144 | /* | 128 | /* |
145 | * To use the debug system: | 129 | * To use the debug system: |
146 | * | 130 | * |
@@ -177,6 +161,7 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
177 | 161 | ||
178 | #define IEEE80211_DL_TX (1<<8) | 162 | #define IEEE80211_DL_TX (1<<8) |
179 | #define IEEE80211_DL_RX (1<<9) | 163 | #define IEEE80211_DL_RX (1<<9) |
164 | #define IEEE80211_DL_QOS (1<<31) | ||
180 | 165 | ||
181 | #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) | 166 | #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) |
182 | #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) | 167 | #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) |
@@ -190,9 +175,10 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
190 | #define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) | 175 | #define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) |
191 | #define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) | 176 | #define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) |
192 | #define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) | 177 | #define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) |
178 | #define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) | ||
193 | #include <linux/netdevice.h> | 179 | #include <linux/netdevice.h> |
194 | #include <linux/wireless.h> | 180 | #include <linux/wireless.h> |
195 | #include <linux/if_arp.h> /* ARPHRD_ETHER */ | 181 | #include <linux/if_arp.h> /* ARPHRD_ETHER */ |
196 | 182 | ||
197 | #ifndef WIRELESS_SPY | 183 | #ifndef WIRELESS_SPY |
198 | #define WIRELESS_SPY /* enable iwspy support */ | 184 | #define WIRELESS_SPY /* enable iwspy support */ |
@@ -200,10 +186,10 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
200 | #include <net/iw_handler.h> /* new driver API */ | 186 | #include <net/iw_handler.h> /* new driver API */ |
201 | 187 | ||
202 | #ifndef ETH_P_PAE | 188 | #ifndef ETH_P_PAE |
203 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | 189 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ |
204 | #endif /* ETH_P_PAE */ | 190 | #endif /* ETH_P_PAE */ |
205 | 191 | ||
206 | #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ | 192 | #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ |
207 | 193 | ||
208 | #ifndef ETH_P_80211_RAW | 194 | #ifndef ETH_P_80211_RAW |
209 | #define ETH_P_80211_RAW (ETH_P_ECONET + 1) | 195 | #define ETH_P_80211_RAW (ETH_P_ECONET + 1) |
@@ -215,10 +201,10 @@ const char *escape_essid(const char *essid, u8 essid_len); | |||
215 | 201 | ||
216 | struct ieee80211_snap_hdr { | 202 | struct ieee80211_snap_hdr { |
217 | 203 | ||
218 | u8 dsap; /* always 0xAA */ | 204 | u8 dsap; /* always 0xAA */ |
219 | u8 ssap; /* always 0xAA */ | 205 | u8 ssap; /* always 0xAA */ |
220 | u8 ctrl; /* always 0x03 */ | 206 | u8 ctrl; /* always 0x03 */ |
221 | u8 oui[P80211_OUI_LEN]; /* organizational universal id */ | 207 | u8 oui[P80211_OUI_LEN]; /* organizational universal id */ |
222 | 208 | ||
223 | } __attribute__ ((packed)); | 209 | } __attribute__ ((packed)); |
224 | 210 | ||
@@ -246,8 +232,9 @@ struct ieee80211_snap_hdr { | |||
246 | #define WLAN_CAPABILITY_PBCC (1<<6) | 232 | #define WLAN_CAPABILITY_PBCC (1<<6) |
247 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) | 233 | #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) |
248 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) | 234 | #define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) |
235 | #define WLAN_CAPABILITY_QOS (1<<9) | ||
249 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 236 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
250 | #define WLAN_CAPABILITY_OSSS_OFDM (1<<13) | 237 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
251 | 238 | ||
252 | /* Status codes */ | 239 | /* Status codes */ |
253 | enum ieee80211_statuscode { | 240 | enum ieee80211_statuscode { |
@@ -312,14 +299,12 @@ enum ieee80211_reasoncode { | |||
312 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, | 299 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, |
313 | }; | 300 | }; |
314 | 301 | ||
315 | |||
316 | #define IEEE80211_STATMASK_SIGNAL (1<<0) | 302 | #define IEEE80211_STATMASK_SIGNAL (1<<0) |
317 | #define IEEE80211_STATMASK_RSSI (1<<1) | 303 | #define IEEE80211_STATMASK_RSSI (1<<1) |
318 | #define IEEE80211_STATMASK_NOISE (1<<2) | 304 | #define IEEE80211_STATMASK_NOISE (1<<2) |
319 | #define IEEE80211_STATMASK_RATE (1<<3) | 305 | #define IEEE80211_STATMASK_RATE (1<<3) |
320 | #define IEEE80211_STATMASK_WEMASK 0x7 | 306 | #define IEEE80211_STATMASK_WEMASK 0x7 |
321 | 307 | ||
322 | |||
323 | #define IEEE80211_CCK_MODULATION (1<<0) | 308 | #define IEEE80211_CCK_MODULATION (1<<0) |
324 | #define IEEE80211_OFDM_MODULATION (1<<1) | 309 | #define IEEE80211_OFDM_MODULATION (1<<1) |
325 | 310 | ||
@@ -377,9 +362,6 @@ enum ieee80211_reasoncode { | |||
377 | #define IEEE80211_NUM_CCK_RATES 4 | 362 | #define IEEE80211_NUM_CCK_RATES 4 |
378 | #define IEEE80211_OFDM_SHIFT_MASK_A 4 | 363 | #define IEEE80211_OFDM_SHIFT_MASK_A 4 |
379 | 364 | ||
380 | |||
381 | |||
382 | |||
383 | /* NOTE: This data is for statistical purposes; not all hardware provides this | 365 | /* NOTE: This data is for statistical purposes; not all hardware provides this |
384 | * information for frames received. Not setting these will not cause | 366 | * information for frames received. Not setting these will not cause |
385 | * any adverse affects. */ | 367 | * any adverse affects. */ |
@@ -388,7 +370,7 @@ struct ieee80211_rx_stats { | |||
388 | s8 rssi; | 370 | s8 rssi; |
389 | u8 signal; | 371 | u8 signal; |
390 | u8 noise; | 372 | u8 noise; |
391 | u16 rate; /* in 100 kbps */ | 373 | u16 rate; /* in 100 kbps */ |
392 | u8 received_channel; | 374 | u8 received_channel; |
393 | u8 control; | 375 | u8 control; |
394 | u8 mask; | 376 | u8 mask; |
@@ -439,38 +421,44 @@ struct ieee80211_device; | |||
439 | 421 | ||
440 | #include "ieee80211_crypt.h" | 422 | #include "ieee80211_crypt.h" |
441 | 423 | ||
442 | #define SEC_KEY_1 (1<<0) | 424 | #define SEC_KEY_1 (1<<0) |
443 | #define SEC_KEY_2 (1<<1) | 425 | #define SEC_KEY_2 (1<<1) |
444 | #define SEC_KEY_3 (1<<2) | 426 | #define SEC_KEY_3 (1<<2) |
445 | #define SEC_KEY_4 (1<<3) | 427 | #define SEC_KEY_4 (1<<3) |
446 | #define SEC_ACTIVE_KEY (1<<4) | 428 | #define SEC_ACTIVE_KEY (1<<4) |
447 | #define SEC_AUTH_MODE (1<<5) | 429 | #define SEC_AUTH_MODE (1<<5) |
448 | #define SEC_UNICAST_GROUP (1<<6) | 430 | #define SEC_UNICAST_GROUP (1<<6) |
449 | #define SEC_LEVEL (1<<7) | 431 | #define SEC_LEVEL (1<<7) |
450 | #define SEC_ENABLED (1<<8) | 432 | #define SEC_ENABLED (1<<8) |
451 | 433 | #define SEC_ENCRYPT (1<<9) | |
452 | #define SEC_LEVEL_0 0 /* None */ | 434 | |
453 | #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ | 435 | #define SEC_LEVEL_0 0 /* None */ |
454 | #define SEC_LEVEL_2 2 /* Level 1 + TKIP */ | 436 | #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ |
455 | #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ | 437 | #define SEC_LEVEL_2 2 /* Level 1 + TKIP */ |
456 | #define SEC_LEVEL_3 4 /* Level 2 + CCMP */ | 438 | #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ |
457 | 439 | #define SEC_LEVEL_3 4 /* Level 2 + CCMP */ | |
458 | #define WEP_KEYS 4 | 440 | |
459 | #define WEP_KEY_LEN 13 | 441 | #define SEC_ALG_NONE 0 |
442 | #define SEC_ALG_WEP 1 | ||
443 | #define SEC_ALG_TKIP 2 | ||
444 | #define SEC_ALG_CCMP 3 | ||
445 | |||
446 | #define WEP_KEYS 4 | ||
447 | #define WEP_KEY_LEN 13 | ||
448 | #define SCM_KEY_LEN 32 | ||
449 | #define SCM_TEMPORAL_KEY_LENGTH 16 | ||
460 | 450 | ||
461 | struct ieee80211_security { | 451 | struct ieee80211_security { |
462 | u16 active_key:2, | 452 | u16 active_key:2, |
463 | enabled:1, | 453 | enabled:1, |
464 | auth_mode:2, | 454 | auth_mode:2, auth_algo:4, unicast_uses_group:1, encrypt:1; |
465 | auth_algo:4, | 455 | u8 encode_alg[WEP_KEYS]; |
466 | unicast_uses_group:1; | ||
467 | u8 key_sizes[WEP_KEYS]; | 456 | u8 key_sizes[WEP_KEYS]; |
468 | u8 keys[WEP_KEYS][WEP_KEY_LEN]; | 457 | u8 keys[WEP_KEYS][SCM_KEY_LEN]; |
469 | u8 level; | 458 | u8 level; |
470 | u16 flags; | 459 | u16 flags; |
471 | } __attribute__ ((packed)); | 460 | } __attribute__ ((packed)); |
472 | 461 | ||
473 | |||
474 | /* | 462 | /* |
475 | 463 | ||
476 | 802.11 data frame from AP | 464 | 802.11 data frame from AP |
@@ -494,7 +482,7 @@ enum ieee80211_mfie { | |||
494 | MFIE_TYPE_RATES = 1, | 482 | MFIE_TYPE_RATES = 1, |
495 | MFIE_TYPE_FH_SET = 2, | 483 | MFIE_TYPE_FH_SET = 2, |
496 | MFIE_TYPE_DS_SET = 3, | 484 | MFIE_TYPE_DS_SET = 3, |
497 | MFIE_TYPE_CF_SET = 4, | 485 | MFIE_TYPE_CF_SET = 4, |
498 | MFIE_TYPE_TIM = 5, | 486 | MFIE_TYPE_TIM = 5, |
499 | MFIE_TYPE_IBSS_SET = 6, | 487 | MFIE_TYPE_IBSS_SET = 6, |
500 | MFIE_TYPE_COUNTRY = 7, | 488 | MFIE_TYPE_COUNTRY = 7, |
@@ -516,11 +504,75 @@ enum ieee80211_mfie { | |||
516 | MFIE_TYPE_RSN = 48, | 504 | MFIE_TYPE_RSN = 48, |
517 | MFIE_TYPE_RATES_EX = 50, | 505 | MFIE_TYPE_RATES_EX = 50, |
518 | MFIE_TYPE_GENERIC = 221, | 506 | MFIE_TYPE_GENERIC = 221, |
507 | MFIE_TYPE_QOS_PARAMETER = 222, | ||
519 | }; | 508 | }; |
520 | 509 | ||
521 | struct ieee80211_info_element_hdr { | 510 | /* Minimal header; can be used for passing 802.11 frames with sufficient |
522 | u8 id; | 511 | * information to determine what type of underlying data type is actually |
523 | u8 len; | 512 | * stored in the data. */ |
513 | struct ieee80211_hdr { | ||
514 | __le16 frame_ctl; | ||
515 | __le16 duration_id; | ||
516 | u8 payload[0]; | ||
517 | } __attribute__ ((packed)); | ||
518 | |||
519 | struct ieee80211_hdr_1addr { | ||
520 | __le16 frame_ctl; | ||
521 | __le16 duration_id; | ||
522 | u8 addr1[ETH_ALEN]; | ||
523 | u8 payload[0]; | ||
524 | } __attribute__ ((packed)); | ||
525 | |||
526 | struct ieee80211_hdr_2addr { | ||
527 | __le16 frame_ctl; | ||
528 | __le16 duration_id; | ||
529 | u8 addr1[ETH_ALEN]; | ||
530 | u8 addr2[ETH_ALEN]; | ||
531 | u8 payload[0]; | ||
532 | } __attribute__ ((packed)); | ||
533 | |||
534 | struct ieee80211_hdr_3addr { | ||
535 | __le16 frame_ctl; | ||
536 | __le16 duration_id; | ||
537 | u8 addr1[ETH_ALEN]; | ||
538 | u8 addr2[ETH_ALEN]; | ||
539 | u8 addr3[ETH_ALEN]; | ||
540 | __le16 seq_ctl; | ||
541 | u8 payload[0]; | ||
542 | } __attribute__ ((packed)); | ||
543 | |||
544 | struct ieee80211_hdr_4addr { | ||
545 | __le16 frame_ctl; | ||
546 | __le16 duration_id; | ||
547 | u8 addr1[ETH_ALEN]; | ||
548 | u8 addr2[ETH_ALEN]; | ||
549 | u8 addr3[ETH_ALEN]; | ||
550 | __le16 seq_ctl; | ||
551 | u8 addr4[ETH_ALEN]; | ||
552 | u8 payload[0]; | ||
553 | } __attribute__ ((packed)); | ||
554 | |||
555 | struct ieee80211_hdr_3addrqos { | ||
556 | __le16 frame_ctl; | ||
557 | __le16 duration_id; | ||
558 | u8 addr1[ETH_ALEN]; | ||
559 | u8 addr2[ETH_ALEN]; | ||
560 | u8 addr3[ETH_ALEN]; | ||
561 | __le16 seq_ctl; | ||
562 | u8 payload[0]; | ||
563 | __le16 qos_ctl; | ||
564 | } __attribute__ ((packed)); | ||
565 | |||
566 | struct ieee80211_hdr_4addrqos { | ||
567 | __le16 frame_ctl; | ||
568 | __le16 duration_id; | ||
569 | u8 addr1[ETH_ALEN]; | ||
570 | u8 addr2[ETH_ALEN]; | ||
571 | u8 addr3[ETH_ALEN]; | ||
572 | __le16 seq_ctl; | ||
573 | u8 addr4[ETH_ALEN]; | ||
574 | u8 payload[0]; | ||
575 | __le16 qos_ctl; | ||
524 | } __attribute__ ((packed)); | 576 | } __attribute__ ((packed)); |
525 | 577 | ||
526 | struct ieee80211_info_element { | 578 | struct ieee80211_info_element { |
@@ -546,49 +598,77 @@ struct ieee80211_info_element { | |||
546 | u16 status; | 598 | u16 status; |
547 | */ | 599 | */ |
548 | 600 | ||
549 | struct ieee80211_authentication { | 601 | struct ieee80211_auth { |
550 | struct ieee80211_hdr_3addr header; | 602 | struct ieee80211_hdr_3addr header; |
551 | __le16 algorithm; | 603 | __le16 algorithm; |
552 | __le16 transaction; | 604 | __le16 transaction; |
553 | __le16 status; | 605 | __le16 status; |
554 | struct ieee80211_info_element info_element; | 606 | /* challenge */ |
607 | struct ieee80211_info_element info_element[0]; | ||
555 | } __attribute__ ((packed)); | 608 | } __attribute__ ((packed)); |
556 | 609 | ||
610 | struct ieee80211_disassoc { | ||
611 | struct ieee80211_hdr_3addr header; | ||
612 | __le16 reason; | ||
613 | } __attribute__ ((packed)); | ||
614 | |||
615 | /* Alias deauth for disassoc */ | ||
616 | #define ieee80211_deauth ieee80211_disassoc | ||
617 | |||
618 | struct ieee80211_probe_request { | ||
619 | struct ieee80211_hdr_3addr header; | ||
620 | /* SSID, supported rates */ | ||
621 | struct ieee80211_info_element info_element[0]; | ||
622 | } __attribute__ ((packed)); | ||
557 | 623 | ||
558 | struct ieee80211_probe_response { | 624 | struct ieee80211_probe_response { |
559 | struct ieee80211_hdr_3addr header; | 625 | struct ieee80211_hdr_3addr header; |
560 | u32 time_stamp[2]; | 626 | u32 time_stamp[2]; |
561 | __le16 beacon_interval; | 627 | __le16 beacon_interval; |
562 | __le16 capability; | 628 | __le16 capability; |
563 | struct ieee80211_info_element info_element; | 629 | /* SSID, supported rates, FH params, DS params, |
630 | * CF params, IBSS params, TIM (if beacon), RSN */ | ||
631 | struct ieee80211_info_element info_element[0]; | ||
564 | } __attribute__ ((packed)); | 632 | } __attribute__ ((packed)); |
565 | 633 | ||
566 | struct ieee80211_assoc_request_frame { | 634 | /* Alias beacon for probe_response */ |
635 | #define ieee80211_beacon ieee80211_probe_response | ||
636 | |||
637 | struct ieee80211_assoc_request { | ||
638 | struct ieee80211_hdr_3addr header; | ||
639 | __le16 capability; | ||
640 | __le16 listen_interval; | ||
641 | /* SSID, supported rates, RSN */ | ||
642 | struct ieee80211_info_element info_element[0]; | ||
643 | } __attribute__ ((packed)); | ||
644 | |||
645 | struct ieee80211_reassoc_request { | ||
646 | struct ieee80211_hdr_3addr header; | ||
567 | __le16 capability; | 647 | __le16 capability; |
568 | __le16 listen_interval; | 648 | __le16 listen_interval; |
569 | u8 current_ap[ETH_ALEN]; | 649 | u8 current_ap[ETH_ALEN]; |
570 | struct ieee80211_info_element info_element; | 650 | struct ieee80211_info_element info_element[0]; |
571 | } __attribute__ ((packed)); | 651 | } __attribute__ ((packed)); |
572 | 652 | ||
573 | struct ieee80211_assoc_response_frame { | 653 | struct ieee80211_assoc_response { |
574 | struct ieee80211_hdr_3addr header; | 654 | struct ieee80211_hdr_3addr header; |
575 | __le16 capability; | 655 | __le16 capability; |
576 | __le16 status; | 656 | __le16 status; |
577 | __le16 aid; | 657 | __le16 aid; |
578 | struct ieee80211_info_element info_element; /* supported rates */ | 658 | /* supported rates */ |
659 | struct ieee80211_info_element info_element[0]; | ||
579 | } __attribute__ ((packed)); | 660 | } __attribute__ ((packed)); |
580 | 661 | ||
581 | |||
582 | struct ieee80211_txb { | 662 | struct ieee80211_txb { |
583 | u8 nr_frags; | 663 | u8 nr_frags; |
584 | u8 encrypted; | 664 | u8 encrypted; |
585 | u16 reserved; | 665 | u8 rts_included; |
586 | u16 frag_size; | 666 | u8 reserved; |
587 | u16 payload_size; | 667 | __le16 frag_size; |
668 | __le16 payload_size; | ||
588 | struct sk_buff *fragments[0]; | 669 | struct sk_buff *fragments[0]; |
589 | }; | 670 | }; |
590 | 671 | ||
591 | |||
592 | /* SWEEP TABLE ENTRIES NUMBER */ | 672 | /* SWEEP TABLE ENTRIES NUMBER */ |
593 | #define MAX_SWEEP_TAB_ENTRIES 42 | 673 | #define MAX_SWEEP_TAB_ENTRIES 42 |
594 | #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 | 674 | #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 |
@@ -604,9 +684,68 @@ struct ieee80211_txb { | |||
604 | 684 | ||
605 | #define MAX_WPA_IE_LEN 64 | 685 | #define MAX_WPA_IE_LEN 64 |
606 | 686 | ||
607 | #define NETWORK_EMPTY_ESSID (1<<0) | 687 | #define NETWORK_EMPTY_ESSID (1<<0) |
608 | #define NETWORK_HAS_OFDM (1<<1) | 688 | #define NETWORK_HAS_OFDM (1<<1) |
609 | #define NETWORK_HAS_CCK (1<<2) | 689 | #define NETWORK_HAS_CCK (1<<2) |
690 | |||
691 | /* QoS structure */ | ||
692 | #define NETWORK_HAS_QOS_PARAMETERS (1<<3) | ||
693 | #define NETWORK_HAS_QOS_INFORMATION (1<<4) | ||
694 | #define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | NETWORK_HAS_QOS_INFORMATION) | ||
695 | |||
696 | #define QOS_QUEUE_NUM 4 | ||
697 | #define QOS_OUI_LEN 3 | ||
698 | #define QOS_OUI_TYPE 2 | ||
699 | #define QOS_ELEMENT_ID 221 | ||
700 | #define QOS_OUI_INFO_SUB_TYPE 0 | ||
701 | #define QOS_OUI_PARAM_SUB_TYPE 1 | ||
702 | #define QOS_VERSION_1 1 | ||
703 | #define QOS_AIFSN_MIN_VALUE 2 | ||
704 | |||
705 | struct ieee80211_qos_information_element { | ||
706 | u8 elementID; | ||
707 | u8 length; | ||
708 | u8 qui[QOS_OUI_LEN]; | ||
709 | u8 qui_type; | ||
710 | u8 qui_subtype; | ||
711 | u8 version; | ||
712 | u8 ac_info; | ||
713 | } __attribute__ ((packed)); | ||
714 | |||
715 | struct ieee80211_qos_ac_parameter { | ||
716 | u8 aci_aifsn; | ||
717 | u8 ecw_min_max; | ||
718 | __le16 tx_op_limit; | ||
719 | } __attribute__ ((packed)); | ||
720 | |||
721 | struct ieee80211_qos_parameter_info { | ||
722 | struct ieee80211_qos_information_element info_element; | ||
723 | u8 reserved; | ||
724 | struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; | ||
725 | } __attribute__ ((packed)); | ||
726 | |||
727 | struct ieee80211_qos_parameters { | ||
728 | __le16 cw_min[QOS_QUEUE_NUM]; | ||
729 | __le16 cw_max[QOS_QUEUE_NUM]; | ||
730 | u8 aifs[QOS_QUEUE_NUM]; | ||
731 | u8 flag[QOS_QUEUE_NUM]; | ||
732 | __le16 tx_op_limit[QOS_QUEUE_NUM]; | ||
733 | } __attribute__ ((packed)); | ||
734 | |||
735 | struct ieee80211_qos_data { | ||
736 | struct ieee80211_qos_parameters parameters; | ||
737 | int active; | ||
738 | int supported; | ||
739 | u8 param_count; | ||
740 | u8 old_param_count; | ||
741 | }; | ||
742 | |||
743 | struct ieee80211_tim_parameters { | ||
744 | u8 tim_count; | ||
745 | u8 tim_period; | ||
746 | } __attribute__ ((packed)); | ||
747 | |||
748 | /*******************************************************/ | ||
610 | 749 | ||
611 | struct ieee80211_network { | 750 | struct ieee80211_network { |
612 | /* These entries are used to identify a unique network */ | 751 | /* These entries are used to identify a unique network */ |
@@ -616,6 +755,8 @@ struct ieee80211_network { | |||
616 | u8 ssid[IW_ESSID_MAX_SIZE + 1]; | 755 | u8 ssid[IW_ESSID_MAX_SIZE + 1]; |
617 | u8 ssid_len; | 756 | u8 ssid_len; |
618 | 757 | ||
758 | struct ieee80211_qos_data qos_data; | ||
759 | |||
619 | /* These are network statistics */ | 760 | /* These are network statistics */ |
620 | struct ieee80211_rx_stats stats; | 761 | struct ieee80211_rx_stats stats; |
621 | u16 capability; | 762 | u16 capability; |
@@ -631,10 +772,12 @@ struct ieee80211_network { | |||
631 | u16 beacon_interval; | 772 | u16 beacon_interval; |
632 | u16 listen_interval; | 773 | u16 listen_interval; |
633 | u16 atim_window; | 774 | u16 atim_window; |
775 | u8 erp_value; | ||
634 | u8 wpa_ie[MAX_WPA_IE_LEN]; | 776 | u8 wpa_ie[MAX_WPA_IE_LEN]; |
635 | size_t wpa_ie_len; | 777 | size_t wpa_ie_len; |
636 | u8 rsn_ie[MAX_WPA_IE_LEN]; | 778 | u8 rsn_ie[MAX_WPA_IE_LEN]; |
637 | size_t rsn_ie_len; | 779 | size_t rsn_ie_len; |
780 | struct ieee80211_tim_parameters tim; | ||
638 | struct list_head list; | 781 | struct list_head list; |
639 | }; | 782 | }; |
640 | 783 | ||
@@ -651,17 +794,52 @@ enum ieee80211_state { | |||
651 | #define DEFAULT_MAX_SCAN_AGE (15 * HZ) | 794 | #define DEFAULT_MAX_SCAN_AGE (15 * HZ) |
652 | #define DEFAULT_FTS 2346 | 795 | #define DEFAULT_FTS 2346 |
653 | 796 | ||
654 | |||
655 | #define CFG_IEEE80211_RESERVE_FCS (1<<0) | 797 | #define CFG_IEEE80211_RESERVE_FCS (1<<0) |
656 | #define CFG_IEEE80211_COMPUTE_FCS (1<<1) | 798 | #define CFG_IEEE80211_COMPUTE_FCS (1<<1) |
799 | #define CFG_IEEE80211_RTS (1<<2) | ||
800 | |||
801 | #define IEEE80211_24GHZ_MIN_CHANNEL 1 | ||
802 | #define IEEE80211_24GHZ_MAX_CHANNEL 14 | ||
803 | #define IEEE80211_24GHZ_CHANNELS 14 | ||
804 | |||
805 | #define IEEE80211_52GHZ_MIN_CHANNEL 36 | ||
806 | #define IEEE80211_52GHZ_MAX_CHANNEL 165 | ||
807 | #define IEEE80211_52GHZ_CHANNELS 32 | ||
808 | |||
809 | enum { | ||
810 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), | ||
811 | IEEE80211_CH_B_ONLY = (1 << 2), | ||
812 | IEEE80211_CH_NO_IBSS = (1 << 3), | ||
813 | IEEE80211_CH_UNIFORM_SPREADING = (1 << 4), | ||
814 | IEEE80211_CH_RADAR_DETECT = (1 << 5), | ||
815 | IEEE80211_CH_INVALID = (1 << 6), | ||
816 | }; | ||
817 | |||
818 | struct ieee80211_channel { | ||
819 | u32 freq; | ||
820 | u8 channel; | ||
821 | u8 flags; | ||
822 | u8 max_power; | ||
823 | }; | ||
824 | |||
825 | struct ieee80211_geo { | ||
826 | u8 name[4]; | ||
827 | u8 bg_channels; | ||
828 | u8 a_channels; | ||
829 | struct ieee80211_channel bg[IEEE80211_24GHZ_CHANNELS]; | ||
830 | struct ieee80211_channel a[IEEE80211_52GHZ_CHANNELS]; | ||
831 | }; | ||
657 | 832 | ||
658 | struct ieee80211_device { | 833 | struct ieee80211_device { |
659 | struct net_device *dev; | 834 | struct net_device *dev; |
835 | struct ieee80211_security sec; | ||
660 | 836 | ||
661 | /* Bookkeeping structures */ | 837 | /* Bookkeeping structures */ |
662 | struct net_device_stats stats; | 838 | struct net_device_stats stats; |
663 | struct ieee80211_stats ieee_stats; | 839 | struct ieee80211_stats ieee_stats; |
664 | 840 | ||
841 | struct ieee80211_geo geo; | ||
842 | |||
665 | /* Probe / Beacon management */ | 843 | /* Probe / Beacon management */ |
666 | struct list_head network_free_list; | 844 | struct list_head network_free_list; |
667 | struct list_head network_list; | 845 | struct list_head network_list; |
@@ -669,62 +847,102 @@ struct ieee80211_device { | |||
669 | int scans; | 847 | int scans; |
670 | int scan_age; | 848 | int scan_age; |
671 | 849 | ||
672 | int iw_mode; /* operating mode (IW_MODE_*) */ | 850 | int iw_mode; /* operating mode (IW_MODE_*) */ |
851 | struct iw_spy_data spy_data; /* iwspy support */ | ||
673 | 852 | ||
674 | spinlock_t lock; | 853 | spinlock_t lock; |
675 | 854 | ||
676 | int tx_headroom; /* Set to size of any additional room needed at front | 855 | int tx_headroom; /* Set to size of any additional room needed at front |
677 | * of allocated Tx SKBs */ | 856 | * of allocated Tx SKBs */ |
678 | u32 config; | 857 | u32 config; |
679 | 858 | ||
680 | /* WEP and other encryption related settings at the device level */ | 859 | /* WEP and other encryption related settings at the device level */ |
681 | int open_wep; /* Set to 1 to allow unencrypted frames */ | 860 | int open_wep; /* Set to 1 to allow unencrypted frames */ |
682 | 861 | ||
683 | int reset_on_keychange; /* Set to 1 if the HW needs to be reset on | 862 | int reset_on_keychange; /* Set to 1 if the HW needs to be reset on |
684 | * WEP key changes */ | 863 | * WEP key changes */ |
685 | 864 | ||
686 | /* If the host performs {en,de}cryption, then set to 1 */ | 865 | /* If the host performs {en,de}cryption, then set to 1 */ |
687 | int host_encrypt; | 866 | int host_encrypt; |
867 | int host_encrypt_msdu; | ||
688 | int host_decrypt; | 868 | int host_decrypt; |
689 | int ieee802_1x; /* is IEEE 802.1X used */ | 869 | /* host performs multicast decryption */ |
870 | int host_mc_decrypt; | ||
871 | |||
872 | int host_open_frag; | ||
873 | int host_build_iv; | ||
874 | int ieee802_1x; /* is IEEE 802.1X used */ | ||
690 | 875 | ||
691 | /* WPA data */ | 876 | /* WPA data */ |
692 | int wpa_enabled; | 877 | int wpa_enabled; |
693 | int drop_unencrypted; | 878 | int drop_unencrypted; |
694 | int tkip_countermeasures; | ||
695 | int privacy_invoked; | 879 | int privacy_invoked; |
696 | size_t wpa_ie_len; | 880 | size_t wpa_ie_len; |
697 | u8 *wpa_ie; | 881 | u8 *wpa_ie; |
698 | 882 | ||
699 | struct list_head crypt_deinit_list; | 883 | struct list_head crypt_deinit_list; |
700 | struct ieee80211_crypt_data *crypt[WEP_KEYS]; | 884 | struct ieee80211_crypt_data *crypt[WEP_KEYS]; |
701 | int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ | 885 | int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ |
702 | struct timer_list crypt_deinit_timer; | 886 | struct timer_list crypt_deinit_timer; |
887 | int crypt_quiesced; | ||
703 | 888 | ||
704 | int bcrx_sta_key; /* use individual keys to override default keys even | 889 | int bcrx_sta_key; /* use individual keys to override default keys even |
705 | * with RX of broad/multicast frames */ | 890 | * with RX of broad/multicast frames */ |
706 | 891 | ||
707 | /* Fragmentation structures */ | 892 | /* Fragmentation structures */ |
708 | struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; | 893 | struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; |
709 | unsigned int frag_next_idx; | 894 | unsigned int frag_next_idx; |
710 | u16 fts; /* Fragmentation Threshold */ | 895 | u16 fts; /* Fragmentation Threshold */ |
896 | u16 rts; /* RTS threshold */ | ||
711 | 897 | ||
712 | /* Association info */ | 898 | /* Association info */ |
713 | u8 bssid[ETH_ALEN]; | 899 | u8 bssid[ETH_ALEN]; |
714 | 900 | ||
715 | enum ieee80211_state state; | 901 | enum ieee80211_state state; |
716 | 902 | ||
717 | int mode; /* A, B, G */ | 903 | int mode; /* A, B, G */ |
718 | int modulation; /* CCK, OFDM */ | 904 | int modulation; /* CCK, OFDM */ |
719 | int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ | 905 | int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */ |
720 | int abg_ture; /* ABG flag */ | 906 | int abg_true; /* ABG flag */ |
907 | |||
908 | int perfect_rssi; | ||
909 | int worst_rssi; | ||
721 | 910 | ||
722 | /* Callback functions */ | 911 | /* Callback functions */ |
723 | void (*set_security)(struct net_device *dev, | 912 | void (*set_security) (struct net_device * dev, |
724 | struct ieee80211_security *sec); | 913 | struct ieee80211_security * sec); |
725 | int (*hard_start_xmit)(struct ieee80211_txb *txb, | 914 | int (*hard_start_xmit) (struct ieee80211_txb * txb, |
726 | struct net_device *dev); | 915 | struct net_device * dev, int pri); |
727 | int (*reset_port)(struct net_device *dev); | 916 | int (*reset_port) (struct net_device * dev); |
917 | int (*is_queue_full) (struct net_device * dev, int pri); | ||
918 | |||
919 | int (*handle_management) (struct net_device * dev, | ||
920 | struct ieee80211_network * network, u16 type); | ||
921 | |||
922 | /* Typical STA methods */ | ||
923 | int (*handle_auth) (struct net_device * dev, | ||
924 | struct ieee80211_auth * auth); | ||
925 | int (*handle_deauth) (struct net_device * dev, | ||
926 | struct ieee80211_auth * auth); | ||
927 | int (*handle_disassoc) (struct net_device * dev, | ||
928 | struct ieee80211_disassoc * assoc); | ||
929 | int (*handle_beacon) (struct net_device * dev, | ||
930 | struct ieee80211_beacon * beacon, | ||
931 | struct ieee80211_network * network); | ||
932 | int (*handle_probe_response) (struct net_device * dev, | ||
933 | struct ieee80211_probe_response * resp, | ||
934 | struct ieee80211_network * network); | ||
935 | int (*handle_probe_request) (struct net_device * dev, | ||
936 | struct ieee80211_probe_request * req, | ||
937 | struct ieee80211_rx_stats * stats); | ||
938 | int (*handle_assoc_response) (struct net_device * dev, | ||
939 | struct ieee80211_assoc_response * resp, | ||
940 | struct ieee80211_network * network); | ||
941 | |||
942 | /* Typical AP methods */ | ||
943 | int (*handle_assoc_request) (struct net_device * dev); | ||
944 | int (*handle_reassoc_request) (struct net_device * dev, | ||
945 | struct ieee80211_reassoc_request * req); | ||
728 | 946 | ||
729 | /* This must be the last item so that it points to the data | 947 | /* This must be the last item so that it points to the data |
730 | * allocated beyond this structure by alloc_ieee80211 */ | 948 | * allocated beyond this structure by alloc_ieee80211 */ |
@@ -736,12 +954,12 @@ struct ieee80211_device { | |||
736 | #define IEEE_G (1<<2) | 954 | #define IEEE_G (1<<2) |
737 | #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) | 955 | #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) |
738 | 956 | ||
739 | extern inline void *ieee80211_priv(struct net_device *dev) | 957 | static inline void *ieee80211_priv(struct net_device *dev) |
740 | { | 958 | { |
741 | return ((struct ieee80211_device *)netdev_priv(dev))->priv; | 959 | return ((struct ieee80211_device *)netdev_priv(dev))->priv; |
742 | } | 960 | } |
743 | 961 | ||
744 | extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) | 962 | static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) |
745 | { | 963 | { |
746 | /* Single white space is for Linksys APs */ | 964 | /* Single white space is for Linksys APs */ |
747 | if (essid_len == 1 && essid[0] == ' ') | 965 | if (essid_len == 1 && essid[0] == ' ') |
@@ -757,7 +975,8 @@ extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) | |||
757 | return 1; | 975 | return 1; |
758 | } | 976 | } |
759 | 977 | ||
760 | extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode) | 978 | static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, |
979 | int mode) | ||
761 | { | 980 | { |
762 | /* | 981 | /* |
763 | * It is possible for both access points and our device to support | 982 | * It is possible for both access points and our device to support |
@@ -783,14 +1002,17 @@ extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mod | |||
783 | return 0; | 1002 | return 0; |
784 | } | 1003 | } |
785 | 1004 | ||
786 | extern inline int ieee80211_get_hdrlen(u16 fc) | 1005 | static inline int ieee80211_get_hdrlen(u16 fc) |
787 | { | 1006 | { |
788 | int hdrlen = IEEE80211_3ADDR_LEN; | 1007 | int hdrlen = IEEE80211_3ADDR_LEN; |
1008 | u16 stype = WLAN_FC_GET_STYPE(fc); | ||
789 | 1009 | ||
790 | switch (WLAN_FC_GET_TYPE(fc)) { | 1010 | switch (WLAN_FC_GET_TYPE(fc)) { |
791 | case IEEE80211_FTYPE_DATA: | 1011 | case IEEE80211_FTYPE_DATA: |
792 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) | 1012 | if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) |
793 | hdrlen = IEEE80211_4ADDR_LEN; | 1013 | hdrlen = IEEE80211_4ADDR_LEN; |
1014 | if (stype & IEEE80211_STYPE_QOS_DATA) | ||
1015 | hdrlen += 2; | ||
794 | break; | 1016 | break; |
795 | case IEEE80211_FTYPE_CTL: | 1017 | case IEEE80211_FTYPE_CTL: |
796 | switch (WLAN_FC_GET_STYPE(fc)) { | 1018 | switch (WLAN_FC_GET_STYPE(fc)) { |
@@ -808,7 +1030,48 @@ extern inline int ieee80211_get_hdrlen(u16 fc) | |||
808 | return hdrlen; | 1030 | return hdrlen; |
809 | } | 1031 | } |
810 | 1032 | ||
1033 | static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) | ||
1034 | { | ||
1035 | switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { | ||
1036 | case IEEE80211_1ADDR_LEN: | ||
1037 | return ((struct ieee80211_hdr_1addr *)hdr)->payload; | ||
1038 | case IEEE80211_2ADDR_LEN: | ||
1039 | return ((struct ieee80211_hdr_2addr *)hdr)->payload; | ||
1040 | case IEEE80211_3ADDR_LEN: | ||
1041 | return ((struct ieee80211_hdr_3addr *)hdr)->payload; | ||
1042 | case IEEE80211_4ADDR_LEN: | ||
1043 | return ((struct ieee80211_hdr_4addr *)hdr)->payload; | ||
1044 | } | ||
1045 | |||
1046 | } | ||
1047 | |||
1048 | static inline int ieee80211_is_ofdm_rate(u8 rate) | ||
1049 | { | ||
1050 | switch (rate & ~IEEE80211_BASIC_RATE_MASK) { | ||
1051 | case IEEE80211_OFDM_RATE_6MB: | ||
1052 | case IEEE80211_OFDM_RATE_9MB: | ||
1053 | case IEEE80211_OFDM_RATE_12MB: | ||
1054 | case IEEE80211_OFDM_RATE_18MB: | ||
1055 | case IEEE80211_OFDM_RATE_24MB: | ||
1056 | case IEEE80211_OFDM_RATE_36MB: | ||
1057 | case IEEE80211_OFDM_RATE_48MB: | ||
1058 | case IEEE80211_OFDM_RATE_54MB: | ||
1059 | return 1; | ||
1060 | } | ||
1061 | return 0; | ||
1062 | } | ||
811 | 1063 | ||
1064 | static inline int ieee80211_is_cck_rate(u8 rate) | ||
1065 | { | ||
1066 | switch (rate & ~IEEE80211_BASIC_RATE_MASK) { | ||
1067 | case IEEE80211_CCK_RATE_1MB: | ||
1068 | case IEEE80211_CCK_RATE_2MB: | ||
1069 | case IEEE80211_CCK_RATE_5MB: | ||
1070 | case IEEE80211_CCK_RATE_11MB: | ||
1071 | return 1; | ||
1072 | } | ||
1073 | return 0; | ||
1074 | } | ||
812 | 1075 | ||
813 | /* ieee80211.c */ | 1076 | /* ieee80211.c */ |
814 | extern void free_ieee80211(struct net_device *dev); | 1077 | extern void free_ieee80211(struct net_device *dev); |
@@ -817,18 +1080,30 @@ extern struct net_device *alloc_ieee80211(int sizeof_priv); | |||
817 | extern int ieee80211_set_encryption(struct ieee80211_device *ieee); | 1080 | extern int ieee80211_set_encryption(struct ieee80211_device *ieee); |
818 | 1081 | ||
819 | /* ieee80211_tx.c */ | 1082 | /* ieee80211_tx.c */ |
820 | extern int ieee80211_xmit(struct sk_buff *skb, | 1083 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); |
821 | struct net_device *dev); | ||
822 | extern void ieee80211_txb_free(struct ieee80211_txb *); | 1084 | extern void ieee80211_txb_free(struct ieee80211_txb *); |
823 | 1085 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, | |
1086 | struct ieee80211_hdr *frame, int len); | ||
824 | 1087 | ||
825 | /* ieee80211_rx.c */ | 1088 | /* ieee80211_rx.c */ |
826 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | 1089 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, |
827 | struct ieee80211_rx_stats *rx_stats); | 1090 | struct ieee80211_rx_stats *rx_stats); |
828 | extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, | 1091 | extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, |
829 | struct ieee80211_hdr *header, | 1092 | struct ieee80211_hdr_4addr *header, |
830 | struct ieee80211_rx_stats *stats); | 1093 | struct ieee80211_rx_stats *stats); |
831 | 1094 | ||
1095 | /* ieee80211_geo.c */ | ||
1096 | extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device | ||
1097 | *ieee); | ||
1098 | extern int ieee80211_set_geo(struct ieee80211_device *ieee, | ||
1099 | const struct ieee80211_geo *geo); | ||
1100 | |||
1101 | extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee, | ||
1102 | u8 channel); | ||
1103 | extern int ieee80211_channel_to_index(struct ieee80211_device *ieee, | ||
1104 | u8 channel); | ||
1105 | extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq); | ||
1106 | |||
832 | /* ieee80211_wx.c */ | 1107 | /* ieee80211_wx.c */ |
833 | extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, | 1108 | extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, |
834 | struct iw_request_info *info, | 1109 | struct iw_request_info *info, |
@@ -839,17 +1114,21 @@ extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee, | |||
839 | extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, | 1114 | extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, |
840 | struct iw_request_info *info, | 1115 | struct iw_request_info *info, |
841 | union iwreq_data *wrqu, char *key); | 1116 | union iwreq_data *wrqu, char *key); |
842 | 1117 | extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, | |
843 | 1118 | struct iw_request_info *info, | |
844 | extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee) | 1119 | union iwreq_data *wrqu, char *extra); |
1120 | extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, | ||
1121 | struct iw_request_info *info, | ||
1122 | union iwreq_data *wrqu, char *extra); | ||
1123 | |||
1124 | static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) | ||
845 | { | 1125 | { |
846 | ieee->scans++; | 1126 | ieee->scans++; |
847 | } | 1127 | } |
848 | 1128 | ||
849 | extern inline int ieee80211_get_scans(struct ieee80211_device *ieee) | 1129 | static inline int ieee80211_get_scans(struct ieee80211_device *ieee) |
850 | { | 1130 | { |
851 | return ieee->scans; | 1131 | return ieee->scans; |
852 | } | 1132 | } |
853 | 1133 | ||
854 | 1134 | #endif /* IEEE80211_H */ | |
855 | #endif /* IEEE80211_H */ | ||
diff --git a/include/net/ieee80211_crypt.h b/include/net/ieee80211_crypt.h index b58a3bcc0dc0..0a1c2d82ca4b 100644 --- a/include/net/ieee80211_crypt.h +++ b/include/net/ieee80211_crypt.h | |||
@@ -25,16 +25,22 @@ | |||
25 | 25 | ||
26 | #include <linux/skbuff.h> | 26 | #include <linux/skbuff.h> |
27 | 27 | ||
28 | enum { | ||
29 | IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0), | ||
30 | }; | ||
31 | |||
28 | struct ieee80211_crypto_ops { | 32 | struct ieee80211_crypto_ops { |
29 | const char *name; | 33 | const char *name; |
30 | 34 | ||
31 | /* init new crypto context (e.g., allocate private data space, | 35 | /* init new crypto context (e.g., allocate private data space, |
32 | * select IV, etc.); returns NULL on failure or pointer to allocated | 36 | * select IV, etc.); returns NULL on failure or pointer to allocated |
33 | * private data on success */ | 37 | * private data on success */ |
34 | void * (*init)(int keyidx); | 38 | void *(*init) (int keyidx); |
35 | 39 | ||
36 | /* deinitialize crypto context and free allocated private data */ | 40 | /* deinitialize crypto context and free allocated private data */ |
37 | void (*deinit)(void *priv); | 41 | void (*deinit) (void *priv); |
42 | |||
43 | int (*build_iv) (struct sk_buff * skb, int hdr_len, void *priv); | ||
38 | 44 | ||
39 | /* encrypt/decrypt return < 0 on error or >= 0 on success. The return | 45 | /* encrypt/decrypt return < 0 on error or >= 0 on success. The return |
40 | * value from decrypt_mpdu is passed as the keyidx value for | 46 | * value from decrypt_mpdu is passed as the keyidx value for |
@@ -42,34 +48,39 @@ struct ieee80211_crypto_ops { | |||
42 | * encryption; if not, error will be returned; these functions are | 48 | * encryption; if not, error will be returned; these functions are |
43 | * called for all MPDUs (i.e., fragments). | 49 | * called for all MPDUs (i.e., fragments). |
44 | */ | 50 | */ |
45 | int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); | 51 | int (*encrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv); |
46 | int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv); | 52 | int (*decrypt_mpdu) (struct sk_buff * skb, int hdr_len, void *priv); |
47 | 53 | ||
48 | /* These functions are called for full MSDUs, i.e. full frames. | 54 | /* These functions are called for full MSDUs, i.e. full frames. |
49 | * These can be NULL if full MSDU operations are not needed. */ | 55 | * These can be NULL if full MSDU operations are not needed. */ |
50 | int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv); | 56 | int (*encrypt_msdu) (struct sk_buff * skb, int hdr_len, void *priv); |
51 | int (*decrypt_msdu)(struct sk_buff *skb, int keyidx, int hdr_len, | 57 | int (*decrypt_msdu) (struct sk_buff * skb, int keyidx, int hdr_len, |
52 | void *priv); | 58 | void *priv); |
53 | 59 | ||
54 | int (*set_key)(void *key, int len, u8 *seq, void *priv); | 60 | int (*set_key) (void *key, int len, u8 * seq, void *priv); |
55 | int (*get_key)(void *key, int len, u8 *seq, void *priv); | 61 | int (*get_key) (void *key, int len, u8 * seq, void *priv); |
56 | 62 | ||
57 | /* procfs handler for printing out key information and possible | 63 | /* procfs handler for printing out key information and possible |
58 | * statistics */ | 64 | * statistics */ |
59 | char * (*print_stats)(char *p, void *priv); | 65 | char *(*print_stats) (char *p, void *priv); |
66 | |||
67 | /* Crypto specific flag get/set for configuration settings */ | ||
68 | unsigned long (*get_flags) (void *priv); | ||
69 | unsigned long (*set_flags) (unsigned long flags, void *priv); | ||
60 | 70 | ||
61 | /* maximum number of bytes added by encryption; encrypt buf is | 71 | /* maximum number of bytes added by encryption; encrypt buf is |
62 | * allocated with extra_prefix_len bytes, copy of in_buf, and | 72 | * allocated with extra_prefix_len bytes, copy of in_buf, and |
63 | * extra_postfix_len; encrypt need not use all this space, but | 73 | * extra_postfix_len; encrypt need not use all this space, but |
64 | * the result must start at the beginning of the buffer and correct | 74 | * the result must start at the beginning of the buffer and correct |
65 | * length must be returned */ | 75 | * length must be returned */ |
66 | int extra_prefix_len, extra_postfix_len; | 76 | int extra_mpdu_prefix_len, extra_mpdu_postfix_len; |
77 | int extra_msdu_prefix_len, extra_msdu_postfix_len; | ||
67 | 78 | ||
68 | struct module *owner; | 79 | struct module *owner; |
69 | }; | 80 | }; |
70 | 81 | ||
71 | struct ieee80211_crypt_data { | 82 | struct ieee80211_crypt_data { |
72 | struct list_head list; /* delayed deletion list */ | 83 | struct list_head list; /* delayed deletion list */ |
73 | struct ieee80211_crypto_ops *ops; | 84 | struct ieee80211_crypto_ops *ops; |
74 | void *priv; | 85 | void *priv; |
75 | atomic_t refcnt; | 86 | atomic_t refcnt; |
@@ -77,10 +88,11 @@ struct ieee80211_crypt_data { | |||
77 | 88 | ||
78 | int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); | 89 | int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); |
79 | int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); | 90 | int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); |
80 | struct ieee80211_crypto_ops * ieee80211_get_crypto_ops(const char *name); | 91 | struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name); |
81 | void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); | 92 | void ieee80211_crypt_deinit_entries(struct ieee80211_device *, int); |
82 | void ieee80211_crypt_deinit_handler(unsigned long); | 93 | void ieee80211_crypt_deinit_handler(unsigned long); |
83 | void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, | 94 | void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, |
84 | struct ieee80211_crypt_data **crypt); | 95 | struct ieee80211_crypt_data **crypt); |
96 | void ieee80211_crypt_quiescing(struct ieee80211_device *ieee); | ||
85 | 97 | ||
86 | #endif | 98 | #endif |
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h new file mode 100644 index 000000000000..429b73892a5f --- /dev/null +++ b/include/net/ieee80211_radiotap.h | |||
@@ -0,0 +1,231 @@ | |||
1 | /* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */ | ||
2 | /* $NetBSD: ieee80211_radiotap.h,v 1.11 2005/06/22 06:16:02 dyoung Exp $ */ | ||
3 | |||
4 | /*- | ||
5 | * Copyright (c) 2003, 2004 David Young. All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer. | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in the | ||
14 | * documentation and/or other materials provided with the distribution. | ||
15 | * 3. The name of David Young may not be used to endorse or promote | ||
16 | * products derived from this software without specific prior | ||
17 | * written permission. | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY | ||
20 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID | ||
23 | * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
25 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
27 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | ||
30 | * OF SUCH DAMAGE. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | * Modifications to fit into the linux IEEE 802.11 stack, | ||
35 | * Mike Kershaw (dragorn@kismetwireless.net) | ||
36 | */ | ||
37 | |||
38 | #ifndef IEEE80211RADIOTAP_H | ||
39 | #define IEEE80211RADIOTAP_H | ||
40 | |||
41 | #include <linux/if_ether.h> | ||
42 | #include <linux/kernel.h> | ||
43 | |||
44 | /* Radiotap header version (from official NetBSD feed) */ | ||
45 | #define IEEE80211RADIOTAP_VERSION "1.5" | ||
46 | /* Base version of the radiotap packet header data */ | ||
47 | #define PKTHDR_RADIOTAP_VERSION 0 | ||
48 | |||
49 | /* A generic radio capture format is desirable. There is one for | ||
50 | * Linux, but it is neither rigidly defined (there were not even | ||
51 | * units given for some fields) nor easily extensible. | ||
52 | * | ||
53 | * I suggest the following extensible radio capture format. It is | ||
54 | * based on a bitmap indicating which fields are present. | ||
55 | * | ||
56 | * I am trying to describe precisely what the application programmer | ||
57 | * should expect in the following, and for that reason I tell the | ||
58 | * units and origin of each measurement (where it applies), or else I | ||
59 | * use sufficiently weaselly language ("is a monotonically nondecreasing | ||
60 | * function of...") that I cannot set false expectations for lawyerly | ||
61 | * readers. | ||
62 | */ | ||
63 | |||
64 | /* XXX tcpdump/libpcap do not tolerate variable-length headers, | ||
65 | * yet, so we pad every radiotap header to 64 bytes. Ugh. | ||
66 | */ | ||
67 | #define IEEE80211_RADIOTAP_HDRLEN 64 | ||
68 | |||
69 | /* The radio capture header precedes the 802.11 header. */ | ||
70 | struct ieee80211_radiotap_header { | ||
71 | u8 it_version; /* Version 0. Only increases | ||
72 | * for drastic changes, | ||
73 | * introduction of compatible | ||
74 | * new fields does not count. | ||
75 | */ | ||
76 | u8 it_pad; | ||
77 | u16 it_len; /* length of the whole | ||
78 | * header in bytes, including | ||
79 | * it_version, it_pad, | ||
80 | * it_len, and data fields. | ||
81 | */ | ||
82 | u32 it_present; /* A bitmap telling which | ||
83 | * fields are present. Set bit 31 | ||
84 | * (0x80000000) to extend the | ||
85 | * bitmap by another 32 bits. | ||
86 | * Additional extensions are made | ||
87 | * by setting bit 31. | ||
88 | */ | ||
89 | }; | ||
90 | |||
91 | /* Name Data type Units | ||
92 | * ---- --------- ----- | ||
93 | * | ||
94 | * IEEE80211_RADIOTAP_TSFT u64 microseconds | ||
95 | * | ||
96 | * Value in microseconds of the MAC's 64-bit 802.11 Time | ||
97 | * Synchronization Function timer when the first bit of the | ||
98 | * MPDU arrived at the MAC. For received frames, only. | ||
99 | * | ||
100 | * IEEE80211_RADIOTAP_CHANNEL 2 x u16 MHz, bitmap | ||
101 | * | ||
102 | * Tx/Rx frequency in MHz, followed by flags (see below). | ||
103 | * | ||
104 | * IEEE80211_RADIOTAP_FHSS u16 see below | ||
105 | * | ||
106 | * For frequency-hopping radios, the hop set (first byte) | ||
107 | * and pattern (second byte). | ||
108 | * | ||
109 | * IEEE80211_RADIOTAP_RATE u8 500kb/s | ||
110 | * | ||
111 | * Tx/Rx data rate | ||
112 | * | ||
113 | * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from | ||
114 | * one milliwatt (dBm) | ||
115 | * | ||
116 | * RF signal power at the antenna, decibel difference from | ||
117 | * one milliwatt. | ||
118 | * | ||
119 | * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from | ||
120 | * one milliwatt (dBm) | ||
121 | * | ||
122 | * RF noise power at the antenna, decibel difference from one | ||
123 | * milliwatt. | ||
124 | * | ||
125 | * IEEE80211_RADIOTAP_DB_ANTSIGNAL u8 decibel (dB) | ||
126 | * | ||
127 | * RF signal power at the antenna, decibel difference from an | ||
128 | * arbitrary, fixed reference. | ||
129 | * | ||
130 | * IEEE80211_RADIOTAP_DB_ANTNOISE u8 decibel (dB) | ||
131 | * | ||
132 | * RF noise power at the antenna, decibel difference from an | ||
133 | * arbitrary, fixed reference point. | ||
134 | * | ||
135 | * IEEE80211_RADIOTAP_LOCK_QUALITY u16 unitless | ||
136 | * | ||
137 | * Quality of Barker code lock. Unitless. Monotonically | ||
138 | * nondecreasing with "better" lock strength. Called "Signal | ||
139 | * Quality" in datasheets. (Is there a standard way to measure | ||
140 | * this?) | ||
141 | * | ||
142 | * IEEE80211_RADIOTAP_TX_ATTENUATION u16 unitless | ||
143 | * | ||
144 | * Transmit power expressed as unitless distance from max | ||
145 | * power set at factory calibration. 0 is max power. | ||
146 | * Monotonically nondecreasing with lower power levels. | ||
147 | * | ||
148 | * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u16 decibels (dB) | ||
149 | * | ||
150 | * Transmit power expressed as decibel distance from max power | ||
151 | * set at factory calibration. 0 is max power. Monotonically | ||
152 | * nondecreasing with lower power levels. | ||
153 | * | ||
154 | * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from | ||
155 | * one milliwatt (dBm) | ||
156 | * | ||
157 | * Transmit power expressed as dBm (decibels from a 1 milliwatt | ||
158 | * reference). This is the absolute power level measured at | ||
159 | * the antenna port. | ||
160 | * | ||
161 | * IEEE80211_RADIOTAP_FLAGS u8 bitmap | ||
162 | * | ||
163 | * Properties of transmitted and received frames. See flags | ||
164 | * defined below. | ||
165 | * | ||
166 | * IEEE80211_RADIOTAP_ANTENNA u8 antenna index | ||
167 | * | ||
168 | * Unitless indication of the Rx/Tx antenna for this packet. | ||
169 | * The first antenna is antenna 0. | ||
170 | * | ||
171 | * IEEE80211_RADIOTAP_FCS u32 data | ||
172 | * | ||
173 | * FCS from frame in network byte order. | ||
174 | */ | ||
175 | enum ieee80211_radiotap_type { | ||
176 | IEEE80211_RADIOTAP_TSFT = 0, | ||
177 | IEEE80211_RADIOTAP_FLAGS = 1, | ||
178 | IEEE80211_RADIOTAP_RATE = 2, | ||
179 | IEEE80211_RADIOTAP_CHANNEL = 3, | ||
180 | IEEE80211_RADIOTAP_FHSS = 4, | ||
181 | IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, | ||
182 | IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, | ||
183 | IEEE80211_RADIOTAP_LOCK_QUALITY = 7, | ||
184 | IEEE80211_RADIOTAP_TX_ATTENUATION = 8, | ||
185 | IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, | ||
186 | IEEE80211_RADIOTAP_DBM_TX_POWER = 10, | ||
187 | IEEE80211_RADIOTAP_ANTENNA = 11, | ||
188 | IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, | ||
189 | IEEE80211_RADIOTAP_DB_ANTNOISE = 13, | ||
190 | IEEE80211_RADIOTAP_EXT = 31, | ||
191 | }; | ||
192 | |||
193 | /* Channel flags. */ | ||
194 | #define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ | ||
195 | #define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ | ||
196 | #define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ | ||
197 | #define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ | ||
198 | #define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ | ||
199 | #define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ | ||
200 | #define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ | ||
201 | #define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ | ||
202 | |||
203 | /* For IEEE80211_RADIOTAP_FLAGS */ | ||
204 | #define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received | ||
205 | * during CFP | ||
206 | */ | ||
207 | #define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received | ||
208 | * with short | ||
209 | * preamble | ||
210 | */ | ||
211 | #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received | ||
212 | * with WEP encryption | ||
213 | */ | ||
214 | #define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received | ||
215 | * with fragmentation | ||
216 | */ | ||
217 | #define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ | ||
218 | #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between | ||
219 | * 802.11 header and payload | ||
220 | * (to 32-bit boundary) | ||
221 | */ | ||
222 | |||
223 | /* Ugly macro to convert literal channel numbers into their mhz equivalents | ||
224 | * There are certianly some conditions that will break this (like feeding it '30') | ||
225 | * but they shouldn't arise since nothing talks on channel 30. */ | ||
226 | #define ieee80211chan2mhz(x) \ | ||
227 | (((x) <= 14) ? \ | ||
228 | (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ | ||
229 | ((x) + 1000) * 5) | ||
230 | |||
231 | #endif /* IEEE80211_RADIOTAP_H */ | ||
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index f45c37d89cf7..c7a959428b4f 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
@@ -254,8 +254,10 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa) | |||
254 | { | 254 | { |
255 | if (skb->protocol == ntohs(ETH_P_802_2)) | 255 | if (skb->protocol == ntohs(ETH_P_802_2)) |
256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); | 256 | memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN); |
257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) | 257 | else if (skb->protocol == ntohs(ETH_P_TR_802_2)) { |
258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); | 258 | memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN); |
259 | *sa &= 0x7F; | ||
260 | } | ||
259 | } | 261 | } |
260 | 262 | ||
261 | /** | 263 | /** |
diff --git a/include/net/netrom.h b/include/net/netrom.h index a6bf6e0f606a..a5ee53bce62f 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
@@ -136,8 +136,7 @@ static __inline__ void nr_node_put(struct nr_node *nr_node) | |||
136 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) | 136 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) |
137 | { | 137 | { |
138 | if (atomic_dec_and_test(&nr_neigh->refcount)) { | 138 | if (atomic_dec_and_test(&nr_neigh->refcount)) { |
139 | if (nr_neigh->digipeat != NULL) | 139 | kfree(nr_neigh->digipeat); |
140 | kfree(nr_neigh->digipeat); | ||
141 | kfree(nr_neigh); | 140 | kfree(nr_neigh); |
142 | } | 141 | } |
143 | } | 142 | } |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 1c5f19f995ad..f1c3bc54526a 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -171,10 +171,10 @@ struct sctp_sndrcvinfo { | |||
171 | */ | 171 | */ |
172 | 172 | ||
173 | enum sctp_sinfo_flags { | 173 | enum sctp_sinfo_flags { |
174 | MSG_UNORDERED = 1, /* Send/receive message unordered. */ | 174 | SCTP_UNORDERED = 1, /* Send/receive message unordered. */ |
175 | MSG_ADDR_OVER = 2, /* Override the primary destination. */ | 175 | SCTP_ADDR_OVER = 2, /* Override the primary destination. */ |
176 | MSG_ABORT=4, /* Send an ABORT message to the peer. */ | 176 | SCTP_ABORT=4, /* Send an ABORT message to the peer. */ |
177 | /* MSG_EOF is already defined per socket.h */ | 177 | SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ |
178 | }; | 178 | }; |
179 | 179 | ||
180 | 180 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index ecb75526cba0..e0498bd36004 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -207,7 +207,7 @@ struct sock { | |||
207 | struct sk_buff_head sk_write_queue; | 207 | struct sk_buff_head sk_write_queue; |
208 | int sk_wmem_queued; | 208 | int sk_wmem_queued; |
209 | int sk_forward_alloc; | 209 | int sk_forward_alloc; |
210 | unsigned int sk_allocation; | 210 | gfp_t sk_allocation; |
211 | int sk_sndbuf; | 211 | int sk_sndbuf; |
212 | int sk_route_caps; | 212 | int sk_route_caps; |
213 | unsigned long sk_flags; | 213 | unsigned long sk_flags; |
diff --git a/include/net/syncppp.h b/include/net/syncppp.h index 614cb6ba564e..877efa434700 100644 --- a/include/net/syncppp.h +++ b/include/net/syncppp.h | |||
@@ -86,7 +86,6 @@ static inline struct sppp *sppp_of(struct net_device *dev) | |||
86 | 86 | ||
87 | void sppp_attach (struct ppp_device *pd); | 87 | void sppp_attach (struct ppp_device *pd); |
88 | void sppp_detach (struct net_device *dev); | 88 | void sppp_detach (struct net_device *dev); |
89 | void sppp_input (struct net_device *dev, struct sk_buff *m); | ||
90 | int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); | 89 | int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd); |
91 | struct sk_buff *sppp_dequeue (struct net_device *dev); | 90 | struct sk_buff *sppp_dequeue (struct net_device *dev); |
92 | int sppp_isempty (struct net_device *dev); | 91 | int sppp_isempty (struct net_device *dev); |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index c8592c7e8eaa..e788bbc5657d 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/config.h> | 18 | #include <linux/config.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/sched.h> /* task_struct, completion */ | ||
20 | 21 | ||
21 | #include <pcmcia/cs_types.h> | 22 | #include <pcmcia/cs_types.h> |
22 | #include <pcmcia/cs.h> | 23 | #include <pcmcia/cs.h> |
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 5308683c8c41..0a9fcd59eb43 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. |
3 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. | 3 | * Copyright (c) 2004 Topspin Corporation. All rights reserved. |
4 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. | 4 | * Copyright (c) 2004 Voltaire Corporation. All rights reserved. |
5 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. | 5 | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. |
@@ -109,7 +109,6 @@ struct ib_cm_id; | |||
109 | 109 | ||
110 | struct ib_cm_req_event_param { | 110 | struct ib_cm_req_event_param { |
111 | struct ib_cm_id *listen_id; | 111 | struct ib_cm_id *listen_id; |
112 | struct ib_device *device; | ||
113 | u8 port; | 112 | u8 port; |
114 | 113 | ||
115 | struct ib_sa_path_rec *primary_path; | 114 | struct ib_sa_path_rec *primary_path; |
@@ -220,7 +219,6 @@ struct ib_cm_apr_event_param { | |||
220 | 219 | ||
221 | struct ib_cm_sidr_req_event_param { | 220 | struct ib_cm_sidr_req_event_param { |
222 | struct ib_cm_id *listen_id; | 221 | struct ib_cm_id *listen_id; |
223 | struct ib_device *device; | ||
224 | u8 port; | 222 | u8 port; |
225 | u16 pkey; | 223 | u16 pkey; |
226 | }; | 224 | }; |
@@ -284,6 +282,7 @@ typedef int (*ib_cm_handler)(struct ib_cm_id *cm_id, | |||
284 | struct ib_cm_id { | 282 | struct ib_cm_id { |
285 | ib_cm_handler cm_handler; | 283 | ib_cm_handler cm_handler; |
286 | void *context; | 284 | void *context; |
285 | struct ib_device *device; | ||
287 | __be64 service_id; | 286 | __be64 service_id; |
288 | __be64 service_mask; | 287 | __be64 service_mask; |
289 | enum ib_cm_state state; /* internal CM/debug use */ | 288 | enum ib_cm_state state; /* internal CM/debug use */ |
@@ -295,6 +294,8 @@ struct ib_cm_id { | |||
295 | 294 | ||
296 | /** | 295 | /** |
297 | * ib_create_cm_id - Allocate a communication identifier. | 296 | * ib_create_cm_id - Allocate a communication identifier. |
297 | * @device: Device associated with the cm_id. All related communication will | ||
298 | * be associated with the specified device. | ||
298 | * @cm_handler: Callback invoked to notify the user of CM events. | 299 | * @cm_handler: Callback invoked to notify the user of CM events. |
299 | * @context: User specified context associated with the communication | 300 | * @context: User specified context associated with the communication |
300 | * identifier. | 301 | * identifier. |
@@ -302,7 +303,8 @@ struct ib_cm_id { | |||
302 | * Communication identifiers are used to track connection states, service | 303 | * Communication identifiers are used to track connection states, service |
303 | * ID resolution requests, and listen requests. | 304 | * ID resolution requests, and listen requests. |
304 | */ | 305 | */ |
305 | struct ib_cm_id *ib_create_cm_id(ib_cm_handler cm_handler, | 306 | struct ib_cm_id *ib_create_cm_id(struct ib_device *device, |
307 | ib_cm_handler cm_handler, | ||
306 | void *context); | 308 | void *context); |
307 | 309 | ||
308 | /** | 310 | /** |
diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 4172e6841e3d..2c133506742b 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h | |||
@@ -109,10 +109,14 @@ | |||
109 | #define IB_QP_SET_QKEY 0x80000000 | 109 | #define IB_QP_SET_QKEY 0x80000000 |
110 | 110 | ||
111 | enum { | 111 | enum { |
112 | IB_MGMT_MAD_HDR = 24, | ||
112 | IB_MGMT_MAD_DATA = 232, | 113 | IB_MGMT_MAD_DATA = 232, |
114 | IB_MGMT_RMPP_HDR = 36, | ||
113 | IB_MGMT_RMPP_DATA = 220, | 115 | IB_MGMT_RMPP_DATA = 220, |
116 | IB_MGMT_VENDOR_HDR = 40, | ||
114 | IB_MGMT_VENDOR_DATA = 216, | 117 | IB_MGMT_VENDOR_DATA = 216, |
115 | IB_MGMT_SA_DATA = 200 | 118 | IB_MGMT_SA_HDR = 56, |
119 | IB_MGMT_SA_DATA = 200, | ||
116 | }; | 120 | }; |
117 | 121 | ||
118 | struct ib_mad_hdr { | 122 | struct ib_mad_hdr { |
@@ -203,26 +207,25 @@ struct ib_class_port_info | |||
203 | 207 | ||
204 | /** | 208 | /** |
205 | * ib_mad_send_buf - MAD data buffer and work request for sends. | 209 | * ib_mad_send_buf - MAD data buffer and work request for sends. |
206 | * @mad: References an allocated MAD data buffer. The size of the data | 210 | * @next: A pointer used to chain together MADs for posting. |
207 | * buffer is specified in the @send_wr.length field. | 211 | * @mad: References an allocated MAD data buffer. |
208 | * @mapping: DMA mapping information. | ||
209 | * @mad_agent: MAD agent that allocated the buffer. | 212 | * @mad_agent: MAD agent that allocated the buffer. |
213 | * @ah: The address handle to use when sending the MAD. | ||
210 | * @context: User-controlled context fields. | 214 | * @context: User-controlled context fields. |
211 | * @send_wr: An initialized work request structure used when sending the MAD. | 215 | * @timeout_ms: Time to wait for a response. |
212 | * The wr_id field of the work request is initialized to reference this | 216 | * @retries: Number of times to retry a request for a response. |
213 | * data structure. | ||
214 | * @sge: A scatter-gather list referenced by the work request. | ||
215 | * | 217 | * |
216 | * Users are responsible for initializing the MAD buffer itself, with the | 218 | * Users are responsible for initializing the MAD buffer itself, with the |
217 | * exception of specifying the payload length field in any RMPP MAD. | 219 | * exception of specifying the payload length field in any RMPP MAD. |
218 | */ | 220 | */ |
219 | struct ib_mad_send_buf { | 221 | struct ib_mad_send_buf { |
220 | struct ib_mad *mad; | 222 | struct ib_mad_send_buf *next; |
221 | DECLARE_PCI_UNMAP_ADDR(mapping) | 223 | void *mad; |
222 | struct ib_mad_agent *mad_agent; | 224 | struct ib_mad_agent *mad_agent; |
225 | struct ib_ah *ah; | ||
223 | void *context[2]; | 226 | void *context[2]; |
224 | struct ib_send_wr send_wr; | 227 | int timeout_ms; |
225 | struct ib_sge sge; | 228 | int retries; |
226 | }; | 229 | }; |
227 | 230 | ||
228 | /** | 231 | /** |
@@ -287,7 +290,7 @@ typedef void (*ib_mad_send_handler)(struct ib_mad_agent *mad_agent, | |||
287 | * or @mad_send_wc. | 290 | * or @mad_send_wc. |
288 | */ | 291 | */ |
289 | typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent, | 292 | typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent, |
290 | struct ib_send_wr *send_wr, | 293 | struct ib_mad_send_buf *send_buf, |
291 | struct ib_mad_send_wc *mad_send_wc); | 294 | struct ib_mad_send_wc *mad_send_wc); |
292 | 295 | ||
293 | /** | 296 | /** |
@@ -334,13 +337,13 @@ struct ib_mad_agent { | |||
334 | 337 | ||
335 | /** | 338 | /** |
336 | * ib_mad_send_wc - MAD send completion information. | 339 | * ib_mad_send_wc - MAD send completion information. |
337 | * @wr_id: Work request identifier associated with the send MAD request. | 340 | * @send_buf: Send MAD data buffer associated with the send MAD request. |
338 | * @status: Completion status. | 341 | * @status: Completion status. |
339 | * @vendor_err: Optional vendor error information returned with a failed | 342 | * @vendor_err: Optional vendor error information returned with a failed |
340 | * request. | 343 | * request. |
341 | */ | 344 | */ |
342 | struct ib_mad_send_wc { | 345 | struct ib_mad_send_wc { |
343 | u64 wr_id; | 346 | struct ib_mad_send_buf *send_buf; |
344 | enum ib_wc_status status; | 347 | enum ib_wc_status status; |
345 | u32 vendor_err; | 348 | u32 vendor_err; |
346 | }; | 349 | }; |
@@ -366,7 +369,7 @@ struct ib_mad_recv_buf { | |||
366 | * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers. | 369 | * @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers. |
367 | * @mad_len: The length of the received MAD, without duplicated headers. | 370 | * @mad_len: The length of the received MAD, without duplicated headers. |
368 | * | 371 | * |
369 | * For received response, the wr_id field of the wc is set to the wr_id | 372 | * For received response, the wr_id contains a pointer to the ib_mad_send_buf |
370 | * for the corresponding send request. | 373 | * for the corresponding send request. |
371 | */ | 374 | */ |
372 | struct ib_mad_recv_wc { | 375 | struct ib_mad_recv_wc { |
@@ -463,9 +466,9 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent); | |||
463 | /** | 466 | /** |
464 | * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated | 467 | * ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated |
465 | * with the registered client. | 468 | * with the registered client. |
466 | * @mad_agent: Specifies the associated registration to post the send to. | 469 | * @send_buf: Specifies the information needed to send the MAD(s). |
467 | * @send_wr: Specifies the information needed to send the MAD(s). | 470 | * @bad_send_buf: Specifies the MAD on which an error was encountered. This |
468 | * @bad_send_wr: Specifies the MAD on which an error was encountered. | 471 | * parameter is optional if only a single MAD is posted. |
469 | * | 472 | * |
470 | * Sent MADs are not guaranteed to complete in the order that they were posted. | 473 | * Sent MADs are not guaranteed to complete in the order that they were posted. |
471 | * | 474 | * |
@@ -479,9 +482,8 @@ int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent); | |||
479 | * defined data being transferred. The paylen_newwin field should be | 482 | * defined data being transferred. The paylen_newwin field should be |
480 | * specified in network-byte order. | 483 | * specified in network-byte order. |
481 | */ | 484 | */ |
482 | int ib_post_send_mad(struct ib_mad_agent *mad_agent, | 485 | int ib_post_send_mad(struct ib_mad_send_buf *send_buf, |
483 | struct ib_send_wr *send_wr, | 486 | struct ib_mad_send_buf **bad_send_buf); |
484 | struct ib_send_wr **bad_send_wr); | ||
485 | 487 | ||
486 | /** | 488 | /** |
487 | * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer. | 489 | * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer. |
@@ -507,23 +509,25 @@ void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc); | |||
507 | /** | 509 | /** |
508 | * ib_cancel_mad - Cancels an outstanding send MAD operation. | 510 | * ib_cancel_mad - Cancels an outstanding send MAD operation. |
509 | * @mad_agent: Specifies the registration associated with sent MAD. | 511 | * @mad_agent: Specifies the registration associated with sent MAD. |
510 | * @wr_id: Indicates the work request identifier of the MAD to cancel. | 512 | * @send_buf: Indicates the MAD to cancel. |
511 | * | 513 | * |
512 | * MADs will be returned to the user through the corresponding | 514 | * MADs will be returned to the user through the corresponding |
513 | * ib_mad_send_handler. | 515 | * ib_mad_send_handler. |
514 | */ | 516 | */ |
515 | void ib_cancel_mad(struct ib_mad_agent *mad_agent, u64 wr_id); | 517 | void ib_cancel_mad(struct ib_mad_agent *mad_agent, |
518 | struct ib_mad_send_buf *send_buf); | ||
516 | 519 | ||
517 | /** | 520 | /** |
518 | * ib_modify_mad - Modifies an outstanding send MAD operation. | 521 | * ib_modify_mad - Modifies an outstanding send MAD operation. |
519 | * @mad_agent: Specifies the registration associated with sent MAD. | 522 | * @mad_agent: Specifies the registration associated with sent MAD. |
520 | * @wr_id: Indicates the work request identifier of the MAD to modify. | 523 | * @send_buf: Indicates the MAD to modify. |
521 | * @timeout_ms: New timeout value for sent MAD. | 524 | * @timeout_ms: New timeout value for sent MAD. |
522 | * | 525 | * |
523 | * This call will reset the timeout value for a sent MAD to the specified | 526 | * This call will reset the timeout value for a sent MAD to the specified |
524 | * value. | 527 | * value. |
525 | */ | 528 | */ |
526 | int ib_modify_mad(struct ib_mad_agent *mad_agent, u64 wr_id, u32 timeout_ms); | 529 | int ib_modify_mad(struct ib_mad_agent *mad_agent, |
530 | struct ib_mad_send_buf *send_buf, u32 timeout_ms); | ||
527 | 531 | ||
528 | /** | 532 | /** |
529 | * ib_redirect_mad_qp - Registers a QP for MAD services. | 533 | * ib_redirect_mad_qp - Registers a QP for MAD services. |
@@ -572,7 +576,6 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
572 | * @remote_qpn: Specifies the QPN of the receiving node. | 576 | * @remote_qpn: Specifies the QPN of the receiving node. |
573 | * @pkey_index: Specifies which PKey the MAD will be sent using. This field | 577 | * @pkey_index: Specifies which PKey the MAD will be sent using. This field |
574 | * is valid only if the remote_qpn is QP 1. | 578 | * is valid only if the remote_qpn is QP 1. |
575 | * @ah: References the address handle used to transfer to the remote node. | ||
576 | * @rmpp_active: Indicates if the send will enable RMPP. | 579 | * @rmpp_active: Indicates if the send will enable RMPP. |
577 | * @hdr_len: Indicates the size of the data header of the MAD. This length | 580 | * @hdr_len: Indicates the size of the data header of the MAD. This length |
578 | * should include the common MAD header, RMPP header, plus any class | 581 | * should include the common MAD header, RMPP header, plus any class |
@@ -582,11 +585,10 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
582 | * additional padding that may be necessary. | 585 | * additional padding that may be necessary. |
583 | * @gfp_mask: GFP mask used for the memory allocation. | 586 | * @gfp_mask: GFP mask used for the memory allocation. |
584 | * | 587 | * |
585 | * This is a helper routine that may be used to allocate a MAD. Users are | 588 | * This routine allocates a MAD for sending. The returned MAD send buffer |
586 | * not required to allocate outbound MADs using this call. The returned | 589 | * will reference a data buffer usable for sending a MAD, along |
587 | * MAD send buffer will reference a data buffer usable for sending a MAD, along | ||
588 | * with an initialized work request structure. Users may modify the returned | 590 | * with an initialized work request structure. Users may modify the returned |
589 | * MAD data buffer or work request before posting the send. | 591 | * MAD data buffer before posting the send. |
590 | * | 592 | * |
591 | * The returned data buffer will be cleared. Users are responsible for | 593 | * The returned data buffer will be cleared. Users are responsible for |
592 | * initializing the common MAD and any class specific headers. If @rmpp_active | 594 | * initializing the common MAD and any class specific headers. If @rmpp_active |
@@ -594,7 +596,7 @@ int ib_process_mad_wc(struct ib_mad_agent *mad_agent, | |||
594 | */ | 596 | */ |
595 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, | 597 | struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent, |
596 | u32 remote_qpn, u16 pkey_index, | 598 | u32 remote_qpn, u16 pkey_index, |
597 | struct ib_ah *ah, int rmpp_active, | 599 | int rmpp_active, |
598 | int hdr_len, int data_len, | 600 | int hdr_len, int data_len, |
599 | gfp_t gfp_mask); | 601 | gfp_t gfp_mask); |
600 | 602 | ||
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h index e4d1654276ad..3037588b8464 100644 --- a/include/rdma/ib_user_cm.h +++ b/include/rdma/ib_user_cm.h | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
40 | 40 | ||
41 | #define IB_USER_CM_ABI_VERSION 2 | 41 | #define IB_USER_CM_ABI_VERSION 3 |
42 | 42 | ||
43 | enum { | 43 | enum { |
44 | IB_USER_CM_CMD_CREATE_ID, | 44 | IB_USER_CM_CMD_CREATE_ID, |
@@ -299,8 +299,6 @@ struct ib_ucm_event_get { | |||
299 | }; | 299 | }; |
300 | 300 | ||
301 | struct ib_ucm_req_event_resp { | 301 | struct ib_ucm_req_event_resp { |
302 | /* device */ | ||
303 | /* port */ | ||
304 | struct ib_ucm_path_rec primary_path; | 302 | struct ib_ucm_path_rec primary_path; |
305 | struct ib_ucm_path_rec alternate_path; | 303 | struct ib_ucm_path_rec alternate_path; |
306 | __be64 remote_ca_guid; | 304 | __be64 remote_ca_guid; |
@@ -316,6 +314,7 @@ struct ib_ucm_req_event_resp { | |||
316 | __u8 retry_count; | 314 | __u8 retry_count; |
317 | __u8 rnr_retry_count; | 315 | __u8 rnr_retry_count; |
318 | __u8 srq; | 316 | __u8 srq; |
317 | __u8 port; | ||
319 | }; | 318 | }; |
320 | 319 | ||
321 | struct ib_ucm_rep_event_resp { | 320 | struct ib_ucm_rep_event_resp { |
@@ -353,10 +352,9 @@ struct ib_ucm_apr_event_resp { | |||
353 | }; | 352 | }; |
354 | 353 | ||
355 | struct ib_ucm_sidr_req_event_resp { | 354 | struct ib_ucm_sidr_req_event_resp { |
356 | /* device */ | ||
357 | /* port */ | ||
358 | __u16 pkey; | 355 | __u16 pkey; |
359 | __u8 reserved[2]; | 356 | __u8 port; |
357 | __u8 reserved; | ||
360 | }; | 358 | }; |
361 | 359 | ||
362 | struct ib_ucm_sidr_rep_event_resp { | 360 | struct ib_ucm_sidr_rep_event_resp { |
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h index fd85725391a4..072f3a2edace 100644 --- a/include/rdma/ib_user_verbs.h +++ b/include/rdma/ib_user_verbs.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 3 | * Copyright (c) 2005 Cisco Systems. All rights reserved. |
4 | * Copyright (c) 2005 PathScale, Inc. All rights reserved. | ||
4 | * | 5 | * |
5 | * This software is available to you under a choice of one of two | 6 | * This software is available to you under a choice of one of two |
6 | * licenses. You may choose to be licensed under the terms of the GNU | 7 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -42,15 +43,12 @@ | |||
42 | * Increment this value if any changes that break userspace ABI | 43 | * Increment this value if any changes that break userspace ABI |
43 | * compatibility are made. | 44 | * compatibility are made. |
44 | */ | 45 | */ |
45 | #define IB_USER_VERBS_ABI_VERSION 2 | 46 | #define IB_USER_VERBS_ABI_VERSION 3 |
46 | 47 | ||
47 | enum { | 48 | enum { |
48 | IB_USER_VERBS_CMD_QUERY_PARAMS, | ||
49 | IB_USER_VERBS_CMD_GET_CONTEXT, | 49 | IB_USER_VERBS_CMD_GET_CONTEXT, |
50 | IB_USER_VERBS_CMD_QUERY_DEVICE, | 50 | IB_USER_VERBS_CMD_QUERY_DEVICE, |
51 | IB_USER_VERBS_CMD_QUERY_PORT, | 51 | IB_USER_VERBS_CMD_QUERY_PORT, |
52 | IB_USER_VERBS_CMD_QUERY_GID, | ||
53 | IB_USER_VERBS_CMD_QUERY_PKEY, | ||
54 | IB_USER_VERBS_CMD_ALLOC_PD, | 52 | IB_USER_VERBS_CMD_ALLOC_PD, |
55 | IB_USER_VERBS_CMD_DEALLOC_PD, | 53 | IB_USER_VERBS_CMD_DEALLOC_PD, |
56 | IB_USER_VERBS_CMD_CREATE_AH, | 54 | IB_USER_VERBS_CMD_CREATE_AH, |
@@ -65,6 +63,7 @@ enum { | |||
65 | IB_USER_VERBS_CMD_ALLOC_MW, | 63 | IB_USER_VERBS_CMD_ALLOC_MW, |
66 | IB_USER_VERBS_CMD_BIND_MW, | 64 | IB_USER_VERBS_CMD_BIND_MW, |
67 | IB_USER_VERBS_CMD_DEALLOC_MW, | 65 | IB_USER_VERBS_CMD_DEALLOC_MW, |
66 | IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL, | ||
68 | IB_USER_VERBS_CMD_CREATE_CQ, | 67 | IB_USER_VERBS_CMD_CREATE_CQ, |
69 | IB_USER_VERBS_CMD_RESIZE_CQ, | 68 | IB_USER_VERBS_CMD_RESIZE_CQ, |
70 | IB_USER_VERBS_CMD_DESTROY_CQ, | 69 | IB_USER_VERBS_CMD_DESTROY_CQ, |
@@ -90,8 +89,11 @@ enum { | |||
90 | * Make sure that all structs defined in this file remain laid out so | 89 | * Make sure that all structs defined in this file remain laid out so |
91 | * that they pack the same way on 32-bit and 64-bit architectures (to | 90 | * that they pack the same way on 32-bit and 64-bit architectures (to |
92 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). | 91 | * avoid incompatibility between 32-bit userspace and 64-bit kernels). |
93 | * In particular do not use pointer types -- pass pointers in __u64 | 92 | * Specifically: |
94 | * instead. | 93 | * - Do not use pointer types -- pass pointers in __u64 instead. |
94 | * - Make sure that any structure larger than 4 bytes is padded to a | ||
95 | * multiple of 8 bytes. Otherwise the structure size will be | ||
96 | * different between 32-bit and 64-bit architectures. | ||
95 | */ | 97 | */ |
96 | 98 | ||
97 | struct ib_uverbs_async_event_desc { | 99 | struct ib_uverbs_async_event_desc { |
@@ -118,27 +120,14 @@ struct ib_uverbs_cmd_hdr { | |||
118 | __u16 out_words; | 120 | __u16 out_words; |
119 | }; | 121 | }; |
120 | 122 | ||
121 | /* | ||
122 | * No driver_data for "query params" command, since this is intended | ||
123 | * to be a core function with no possible device dependence. | ||
124 | */ | ||
125 | struct ib_uverbs_query_params { | ||
126 | __u64 response; | ||
127 | }; | ||
128 | |||
129 | struct ib_uverbs_query_params_resp { | ||
130 | __u32 num_cq_events; | ||
131 | }; | ||
132 | |||
133 | struct ib_uverbs_get_context { | 123 | struct ib_uverbs_get_context { |
134 | __u64 response; | 124 | __u64 response; |
135 | __u64 cq_fd_tab; | ||
136 | __u64 driver_data[0]; | 125 | __u64 driver_data[0]; |
137 | }; | 126 | }; |
138 | 127 | ||
139 | struct ib_uverbs_get_context_resp { | 128 | struct ib_uverbs_get_context_resp { |
140 | __u32 async_fd; | 129 | __u32 async_fd; |
141 | __u32 reserved; | 130 | __u32 num_comp_vectors; |
142 | }; | 131 | }; |
143 | 132 | ||
144 | struct ib_uverbs_query_device { | 133 | struct ib_uverbs_query_device { |
@@ -220,31 +209,6 @@ struct ib_uverbs_query_port_resp { | |||
220 | __u8 reserved[3]; | 209 | __u8 reserved[3]; |
221 | }; | 210 | }; |
222 | 211 | ||
223 | struct ib_uverbs_query_gid { | ||
224 | __u64 response; | ||
225 | __u8 port_num; | ||
226 | __u8 index; | ||
227 | __u8 reserved[6]; | ||
228 | __u64 driver_data[0]; | ||
229 | }; | ||
230 | |||
231 | struct ib_uverbs_query_gid_resp { | ||
232 | __u8 gid[16]; | ||
233 | }; | ||
234 | |||
235 | struct ib_uverbs_query_pkey { | ||
236 | __u64 response; | ||
237 | __u8 port_num; | ||
238 | __u8 index; | ||
239 | __u8 reserved[6]; | ||
240 | __u64 driver_data[0]; | ||
241 | }; | ||
242 | |||
243 | struct ib_uverbs_query_pkey_resp { | ||
244 | __u16 pkey; | ||
245 | __u16 reserved; | ||
246 | }; | ||
247 | |||
248 | struct ib_uverbs_alloc_pd { | 212 | struct ib_uverbs_alloc_pd { |
249 | __u64 response; | 213 | __u64 response; |
250 | __u64 driver_data[0]; | 214 | __u64 driver_data[0]; |
@@ -278,11 +242,21 @@ struct ib_uverbs_dereg_mr { | |||
278 | __u32 mr_handle; | 242 | __u32 mr_handle; |
279 | }; | 243 | }; |
280 | 244 | ||
245 | struct ib_uverbs_create_comp_channel { | ||
246 | __u64 response; | ||
247 | }; | ||
248 | |||
249 | struct ib_uverbs_create_comp_channel_resp { | ||
250 | __u32 fd; | ||
251 | }; | ||
252 | |||
281 | struct ib_uverbs_create_cq { | 253 | struct ib_uverbs_create_cq { |
282 | __u64 response; | 254 | __u64 response; |
283 | __u64 user_handle; | 255 | __u64 user_handle; |
284 | __u32 cqe; | 256 | __u32 cqe; |
285 | __u32 event_handler; | 257 | __u32 comp_vector; |
258 | __s32 comp_channel; | ||
259 | __u32 reserved; | ||
286 | __u64 driver_data[0]; | 260 | __u64 driver_data[0]; |
287 | }; | 261 | }; |
288 | 262 | ||
@@ -291,6 +265,41 @@ struct ib_uverbs_create_cq_resp { | |||
291 | __u32 cqe; | 265 | __u32 cqe; |
292 | }; | 266 | }; |
293 | 267 | ||
268 | struct ib_uverbs_poll_cq { | ||
269 | __u64 response; | ||
270 | __u32 cq_handle; | ||
271 | __u32 ne; | ||
272 | }; | ||
273 | |||
274 | struct ib_uverbs_wc { | ||
275 | __u64 wr_id; | ||
276 | __u32 status; | ||
277 | __u32 opcode; | ||
278 | __u32 vendor_err; | ||
279 | __u32 byte_len; | ||
280 | __u32 imm_data; | ||
281 | __u32 qp_num; | ||
282 | __u32 src_qp; | ||
283 | __u32 wc_flags; | ||
284 | __u16 pkey_index; | ||
285 | __u16 slid; | ||
286 | __u8 sl; | ||
287 | __u8 dlid_path_bits; | ||
288 | __u8 port_num; | ||
289 | __u8 reserved; | ||
290 | }; | ||
291 | |||
292 | struct ib_uverbs_poll_cq_resp { | ||
293 | __u32 count; | ||
294 | __u32 reserved; | ||
295 | struct ib_uverbs_wc wc[0]; | ||
296 | }; | ||
297 | |||
298 | struct ib_uverbs_req_notify_cq { | ||
299 | __u32 cq_handle; | ||
300 | __u32 solicited_only; | ||
301 | }; | ||
302 | |||
294 | struct ib_uverbs_destroy_cq { | 303 | struct ib_uverbs_destroy_cq { |
295 | __u64 response; | 304 | __u64 response; |
296 | __u32 cq_handle; | 305 | __u32 cq_handle; |
@@ -388,6 +397,127 @@ struct ib_uverbs_destroy_qp_resp { | |||
388 | __u32 events_reported; | 397 | __u32 events_reported; |
389 | }; | 398 | }; |
390 | 399 | ||
400 | /* | ||
401 | * The ib_uverbs_sge structure isn't used anywhere, since we assume | ||
402 | * the ib_sge structure is packed the same way on 32-bit and 64-bit | ||
403 | * architectures in both kernel and user space. It's just here to | ||
404 | * document the ABI. | ||
405 | */ | ||
406 | struct ib_uverbs_sge { | ||
407 | __u64 addr; | ||
408 | __u32 length; | ||
409 | __u32 lkey; | ||
410 | }; | ||
411 | |||
412 | struct ib_uverbs_send_wr { | ||
413 | __u64 wr_id; | ||
414 | __u32 num_sge; | ||
415 | __u32 opcode; | ||
416 | __u32 send_flags; | ||
417 | __u32 imm_data; | ||
418 | union { | ||
419 | struct { | ||
420 | __u64 remote_addr; | ||
421 | __u32 rkey; | ||
422 | __u32 reserved; | ||
423 | } rdma; | ||
424 | struct { | ||
425 | __u64 remote_addr; | ||
426 | __u64 compare_add; | ||
427 | __u64 swap; | ||
428 | __u32 rkey; | ||
429 | __u32 reserved; | ||
430 | } atomic; | ||
431 | struct { | ||
432 | __u32 ah; | ||
433 | __u32 remote_qpn; | ||
434 | __u32 remote_qkey; | ||
435 | __u32 reserved; | ||
436 | } ud; | ||
437 | } wr; | ||
438 | }; | ||
439 | |||
440 | struct ib_uverbs_post_send { | ||
441 | __u64 response; | ||
442 | __u32 qp_handle; | ||
443 | __u32 wr_count; | ||
444 | __u32 sge_count; | ||
445 | __u32 wqe_size; | ||
446 | struct ib_uverbs_send_wr send_wr[0]; | ||
447 | }; | ||
448 | |||
449 | struct ib_uverbs_post_send_resp { | ||
450 | __u32 bad_wr; | ||
451 | }; | ||
452 | |||
453 | struct ib_uverbs_recv_wr { | ||
454 | __u64 wr_id; | ||
455 | __u32 num_sge; | ||
456 | __u32 reserved; | ||
457 | }; | ||
458 | |||
459 | struct ib_uverbs_post_recv { | ||
460 | __u64 response; | ||
461 | __u32 qp_handle; | ||
462 | __u32 wr_count; | ||
463 | __u32 sge_count; | ||
464 | __u32 wqe_size; | ||
465 | struct ib_uverbs_recv_wr recv_wr[0]; | ||
466 | }; | ||
467 | |||
468 | struct ib_uverbs_post_recv_resp { | ||
469 | __u32 bad_wr; | ||
470 | }; | ||
471 | |||
472 | struct ib_uverbs_post_srq_recv { | ||
473 | __u64 response; | ||
474 | __u32 srq_handle; | ||
475 | __u32 wr_count; | ||
476 | __u32 sge_count; | ||
477 | __u32 wqe_size; | ||
478 | struct ib_uverbs_recv_wr recv[0]; | ||
479 | }; | ||
480 | |||
481 | struct ib_uverbs_post_srq_recv_resp { | ||
482 | __u32 bad_wr; | ||
483 | }; | ||
484 | |||
485 | struct ib_uverbs_global_route { | ||
486 | __u8 dgid[16]; | ||
487 | __u32 flow_label; | ||
488 | __u8 sgid_index; | ||
489 | __u8 hop_limit; | ||
490 | __u8 traffic_class; | ||
491 | __u8 reserved; | ||
492 | }; | ||
493 | |||
494 | struct ib_uverbs_ah_attr { | ||
495 | struct ib_uverbs_global_route grh; | ||
496 | __u16 dlid; | ||
497 | __u8 sl; | ||
498 | __u8 src_path_bits; | ||
499 | __u8 static_rate; | ||
500 | __u8 is_global; | ||
501 | __u8 port_num; | ||
502 | __u8 reserved; | ||
503 | }; | ||
504 | |||
505 | struct ib_uverbs_create_ah { | ||
506 | __u64 response; | ||
507 | __u64 user_handle; | ||
508 | __u32 pd_handle; | ||
509 | __u32 reserved; | ||
510 | struct ib_uverbs_ah_attr attr; | ||
511 | }; | ||
512 | |||
513 | struct ib_uverbs_create_ah_resp { | ||
514 | __u32 ah_handle; | ||
515 | }; | ||
516 | |||
517 | struct ib_uverbs_destroy_ah { | ||
518 | __u32 ah_handle; | ||
519 | }; | ||
520 | |||
391 | struct ib_uverbs_attach_mcast { | 521 | struct ib_uverbs_attach_mcast { |
392 | __u8 gid[16]; | 522 | __u8 gid[16]; |
393 | __u32 qp_handle; | 523 | __u32 qp_handle; |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index e6f4c9e55df7..f72d46d54e0a 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -595,11 +595,8 @@ struct ib_send_wr { | |||
595 | } atomic; | 595 | } atomic; |
596 | struct { | 596 | struct { |
597 | struct ib_ah *ah; | 597 | struct ib_ah *ah; |
598 | struct ib_mad_hdr *mad_hdr; | ||
599 | u32 remote_qpn; | 598 | u32 remote_qpn; |
600 | u32 remote_qkey; | 599 | u32 remote_qkey; |
601 | int timeout_ms; /* valid for MADs only */ | ||
602 | int retries; /* valid for MADs only */ | ||
603 | u16 pkey_index; /* valid for GSI only */ | 600 | u16 pkey_index; /* valid for GSI only */ |
604 | u8 port_num; /* valid for DR SMPs on switch only */ | 601 | u8 port_num; /* valid for DR SMPs on switch only */ |
605 | } ud; | 602 | } ud; |
@@ -951,6 +948,9 @@ struct ib_device { | |||
951 | IB_DEV_UNREGISTERED | 948 | IB_DEV_UNREGISTERED |
952 | } reg_state; | 949 | } reg_state; |
953 | 950 | ||
951 | u64 uverbs_cmd_mask; | ||
952 | int uverbs_abi_ver; | ||
953 | |||
954 | u8 node_type; | 954 | u8 node_type; |
955 | u8 phys_port_cnt; | 955 | u8 phys_port_cnt; |
956 | }; | 956 | }; |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index b361172b576c..6cb1e2788d8b 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -116,6 +116,9 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; | |||
116 | /* values for service action in */ | 116 | /* values for service action in */ |
117 | #define SAI_READ_CAPACITY_16 0x10 | 117 | #define SAI_READ_CAPACITY_16 0x10 |
118 | 118 | ||
119 | /* Values for T10/04-262r7 */ | ||
120 | #define ATA_16 0x85 /* 16-byte pass-thru */ | ||
121 | #define ATA_12 0xa1 /* 12-byte pass-thru */ | ||
119 | 122 | ||
120 | /* | 123 | /* |
121 | * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft | 124 | * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index bed4b7c9be99..7529f4388bb4 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/dma-mapping.h> | 4 | #include <linux/dma-mapping.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/timer.h> | ||
7 | 8 | ||
8 | struct request; | 9 | struct request; |
9 | struct scatterlist; | 10 | struct scatterlist; |
@@ -146,7 +147,7 @@ struct scsi_cmnd { | |||
146 | #define SCSI_STATE_MLQUEUE 0x100b | 147 | #define SCSI_STATE_MLQUEUE 0x100b |
147 | 148 | ||
148 | 149 | ||
149 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, int); | 150 | extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t); |
150 | extern void scsi_put_command(struct scsi_cmnd *); | 151 | extern void scsi_put_command(struct scsi_cmnd *); |
151 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); | 152 | extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int); |
152 | extern void scsi_finish_command(struct scsi_cmnd *cmd); | 153 | extern void scsi_finish_command(struct scsi_cmnd *cmd); |
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index 6a140020d7cb..2539debb7993 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h | |||
@@ -45,7 +45,7 @@ struct scsi_request { | |||
45 | level driver) of this request */ | 45 | level driver) of this request */ |
46 | }; | 46 | }; |
47 | 47 | ||
48 | extern struct scsi_request *scsi_allocate_request(struct scsi_device *, int); | 48 | extern struct scsi_request *scsi_allocate_request(struct scsi_device *, gfp_t); |
49 | extern void scsi_release_request(struct scsi_request *); | 49 | extern void scsi_release_request(struct scsi_request *); |
50 | extern void scsi_wait_req(struct scsi_request *, const void *cmnd, | 50 | extern void scsi_wait_req(struct scsi_request *, const void *cmnd, |
51 | void *buffer, unsigned bufflen, | 51 | void *buffer, unsigned bufflen, |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index b0d445437372..c04405bead2d 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define SCSI_TRANSPORT_FC_H | 28 | #define SCSI_TRANSPORT_FC_H |
29 | 29 | ||
30 | #include <linux/config.h> | 30 | #include <linux/config.h> |
31 | #include <linux/sched.h> | ||
31 | 32 | ||
32 | struct scsi_transport_template; | 33 | struct scsi_transport_template; |
33 | 34 | ||
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 3a2fd2cc9f19..83489c3abbaf 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -111,7 +111,7 @@ size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id); | |||
111 | int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id); | 111 | int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id); |
112 | 112 | ||
113 | /* basic memory allocation functions */ | 113 | /* basic memory allocation functions */ |
114 | void *snd_malloc_pages(size_t size, unsigned int gfp_flags); | 114 | void *snd_malloc_pages(size_t size, gfp_t gfp_flags); |
115 | void snd_free_pages(void *ptr, size_t size); | 115 | void snd_free_pages(void *ptr, size_t size); |
116 | 116 | ||
117 | #endif /* __SOUND_MEMALLOC_H */ | 117 | #endif /* __SOUND_MEMALLOC_H */ |