diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:19:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:19:14 -0400 |
commit | 867a89e0b73af48838c7987e80899a1ff26dd6ff (patch) | |
tree | b4a8830b3e880b9a5133ad1ec3106665819cc8d4 /include | |
parent | 44473d991332053eb3fea1e08f8a6ee2c6fb409c (diff) | |
parent | 6c39103ce5192bdb2195f3daab7323dfa44fb52e (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit
[RAPIDIO] Add RapidIO connection info print out and re-training for broken connections
[RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641
[RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table
[RAPIDIO] Add RapidIO node into MPC8641HPCN dts file
[RAPIDIO] Auto-probe the RapidIO system size
[RAPIDIO] Add OF-tree support to RapidIO controller driver
[RAPIDIO] Add RapidIO multi mport support
[RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc
[RAPIDIO] Add RapidIO option to kernel configuration
[RAPIDIO] Change RIO function mpc85xx_ to fsl_
[POWERPC] Provide walk_memory_resource() for powerpc
[POWERPC] Update lmb data structures for hotplug memory add/remove
[POWERPC] Hotplug memory remove notifications for powerpc
[POWERPC] windfarm: Add PowerMac 12,1 support
[POWERPC] Fix building of pmac32 when CONFIG_NVRAM=m
[POWERPC] Add IRQSTACKS support on ppc32
[POWERPC] Use __always_inline for xchg* and cmpxchg*
[POWERPC] Add fast little-endian switch system call
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/processor.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/rio.h (renamed from include/asm-ppc/rio.h) | 0 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 24 | ||||
-rw-r--r-- | include/linux/lmb.h | 4 | ||||
-rw-r--r-- | include/linux/rio.h | 38 |
5 files changed, 45 insertions, 27 deletions
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index fd98ca998b4f..cf83f2d7e2a5 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -138,6 +138,8 @@ typedef struct { | |||
138 | 138 | ||
139 | struct thread_struct { | 139 | struct thread_struct { |
140 | unsigned long ksp; /* Kernel stack pointer */ | 140 | unsigned long ksp; /* Kernel stack pointer */ |
141 | unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */ | ||
142 | |||
141 | #ifdef CONFIG_PPC64 | 143 | #ifdef CONFIG_PPC64 |
142 | unsigned long ksp_vsid; | 144 | unsigned long ksp_vsid; |
143 | #endif | 145 | #endif |
@@ -182,11 +184,14 @@ struct thread_struct { | |||
182 | #define ARCH_MIN_TASKALIGN 16 | 184 | #define ARCH_MIN_TASKALIGN 16 |
183 | 185 | ||
184 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) | 186 | #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) |
187 | #define INIT_SP_LIMIT \ | ||
188 | (_ALIGN_UP(sizeof(init_thread_info), 16) + (unsigned long) &init_stack) | ||
185 | 189 | ||
186 | 190 | ||
187 | #ifdef CONFIG_PPC32 | 191 | #ifdef CONFIG_PPC32 |
188 | #define INIT_THREAD { \ | 192 | #define INIT_THREAD { \ |
189 | .ksp = INIT_SP, \ | 193 | .ksp = INIT_SP, \ |
194 | .ksp_limit = INIT_SP_LIMIT, \ | ||
190 | .fs = KERNEL_DS, \ | 195 | .fs = KERNEL_DS, \ |
191 | .pgdir = swapper_pg_dir, \ | 196 | .pgdir = swapper_pg_dir, \ |
192 | .fpexc_mode = MSR_FE0 | MSR_FE1, \ | 197 | .fpexc_mode = MSR_FE0 | MSR_FE1, \ |
@@ -194,6 +199,7 @@ struct thread_struct { | |||
194 | #else | 199 | #else |
195 | #define INIT_THREAD { \ | 200 | #define INIT_THREAD { \ |
196 | .ksp = INIT_SP, \ | 201 | .ksp = INIT_SP, \ |
202 | .ksp_limit = INIT_SP_LIMIT, \ | ||
197 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ | 203 | .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ |
198 | .fs = KERNEL_DS, \ | 204 | .fs = KERNEL_DS, \ |
199 | .fpr = {0}, \ | 205 | .fpr = {0}, \ |
diff --git a/include/asm-ppc/rio.h b/include/asm-powerpc/rio.h index 0018bf80cb25..0018bf80cb25 100644 --- a/include/asm-ppc/rio.h +++ b/include/asm-powerpc/rio.h | |||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index fab1674b31b6..2b6559a6d113 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -204,7 +204,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */ | |||
204 | * Changes the memory location '*ptr' to be val and returns | 204 | * Changes the memory location '*ptr' to be val and returns |
205 | * the previous value stored there. | 205 | * the previous value stored there. |
206 | */ | 206 | */ |
207 | static __inline__ unsigned long | 207 | static __always_inline unsigned long |
208 | __xchg_u32(volatile void *p, unsigned long val) | 208 | __xchg_u32(volatile void *p, unsigned long val) |
209 | { | 209 | { |
210 | unsigned long prev; | 210 | unsigned long prev; |
@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val) | |||
229 | * Changes the memory location '*ptr' to be val and returns | 229 | * Changes the memory location '*ptr' to be val and returns |
230 | * the previous value stored there. | 230 | * the previous value stored there. |
231 | */ | 231 | */ |
232 | static __inline__ unsigned long | 232 | static __always_inline unsigned long |
233 | __xchg_u32_local(volatile void *p, unsigned long val) | 233 | __xchg_u32_local(volatile void *p, unsigned long val) |
234 | { | 234 | { |
235 | unsigned long prev; | 235 | unsigned long prev; |
@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | #ifdef CONFIG_PPC64 | 249 | #ifdef CONFIG_PPC64 |
250 | static __inline__ unsigned long | 250 | static __always_inline unsigned long |
251 | __xchg_u64(volatile void *p, unsigned long val) | 251 | __xchg_u64(volatile void *p, unsigned long val) |
252 | { | 252 | { |
253 | unsigned long prev; | 253 | unsigned long prev; |
@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val) | |||
266 | return prev; | 266 | return prev; |
267 | } | 267 | } |
268 | 268 | ||
269 | static __inline__ unsigned long | 269 | static __always_inline unsigned long |
270 | __xchg_u64_local(volatile void *p, unsigned long val) | 270 | __xchg_u64_local(volatile void *p, unsigned long val) |
271 | { | 271 | { |
272 | unsigned long prev; | 272 | unsigned long prev; |
@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val) | |||
290 | */ | 290 | */ |
291 | extern void __xchg_called_with_bad_pointer(void); | 291 | extern void __xchg_called_with_bad_pointer(void); |
292 | 292 | ||
293 | static __inline__ unsigned long | 293 | static __always_inline unsigned long |
294 | __xchg(volatile void *ptr, unsigned long x, unsigned int size) | 294 | __xchg(volatile void *ptr, unsigned long x, unsigned int size) |
295 | { | 295 | { |
296 | switch (size) { | 296 | switch (size) { |
@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size) | |||
305 | return x; | 305 | return x; |
306 | } | 306 | } |
307 | 307 | ||
308 | static __inline__ unsigned long | 308 | static __always_inline unsigned long |
309 | __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) | 309 | __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) |
310 | { | 310 | { |
311 | switch (size) { | 311 | switch (size) { |
@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) | |||
338 | */ | 338 | */ |
339 | #define __HAVE_ARCH_CMPXCHG 1 | 339 | #define __HAVE_ARCH_CMPXCHG 1 |
340 | 340 | ||
341 | static __inline__ unsigned long | 341 | static __always_inline unsigned long |
342 | __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | 342 | __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) |
343 | { | 343 | { |
344 | unsigned int prev; | 344 | unsigned int prev; |
@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | |||
361 | return prev; | 361 | return prev; |
362 | } | 362 | } |
363 | 363 | ||
364 | static __inline__ unsigned long | 364 | static __always_inline unsigned long |
365 | __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, | 365 | __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, |
366 | unsigned long new) | 366 | unsigned long new) |
367 | { | 367 | { |
@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, | |||
384 | } | 384 | } |
385 | 385 | ||
386 | #ifdef CONFIG_PPC64 | 386 | #ifdef CONFIG_PPC64 |
387 | static __inline__ unsigned long | 387 | static __always_inline unsigned long |
388 | __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | 388 | __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) |
389 | { | 389 | { |
390 | unsigned long prev; | 390 | unsigned long prev; |
@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | |||
406 | return prev; | 406 | return prev; |
407 | } | 407 | } |
408 | 408 | ||
409 | static __inline__ unsigned long | 409 | static __always_inline unsigned long |
410 | __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, | 410 | __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, |
411 | unsigned long new) | 411 | unsigned long new) |
412 | { | 412 | { |
@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, | |||
432 | if something tries to do an invalid cmpxchg(). */ | 432 | if something tries to do an invalid cmpxchg(). */ |
433 | extern void __cmpxchg_called_with_bad_pointer(void); | 433 | extern void __cmpxchg_called_with_bad_pointer(void); |
434 | 434 | ||
435 | static __inline__ unsigned long | 435 | static __always_inline unsigned long |
436 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, | 436 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, |
437 | unsigned int size) | 437 | unsigned int size) |
438 | { | 438 | { |
@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, | |||
448 | return old; | 448 | return old; |
449 | } | 449 | } |
450 | 450 | ||
451 | static __inline__ unsigned long | 451 | static __always_inline unsigned long |
452 | __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, | 452 | __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, |
453 | unsigned int size) | 453 | unsigned int size) |
454 | { | 454 | { |
diff --git a/include/linux/lmb.h b/include/linux/lmb.h index 271153d27fba..c46c89505dac 100644 --- a/include/linux/lmb.h +++ b/include/linux/lmb.h | |||
@@ -40,7 +40,8 @@ extern struct lmb lmb; | |||
40 | 40 | ||
41 | extern void __init lmb_init(void); | 41 | extern void __init lmb_init(void); |
42 | extern void __init lmb_analyze(void); | 42 | extern void __init lmb_analyze(void); |
43 | extern long __init lmb_add(u64 base, u64 size); | 43 | extern long lmb_add(u64 base, u64 size); |
44 | extern long lmb_remove(u64 base, u64 size); | ||
44 | extern long __init lmb_reserve(u64 base, u64 size); | 45 | extern long __init lmb_reserve(u64 base, u64 size); |
45 | extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, | 46 | extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, |
46 | u64 (*nid_range)(u64, u64, int *)); | 47 | u64 (*nid_range)(u64, u64, int *)); |
@@ -53,6 +54,7 @@ extern u64 __init lmb_phys_mem_size(void); | |||
53 | extern u64 __init lmb_end_of_DRAM(void); | 54 | extern u64 __init lmb_end_of_DRAM(void); |
54 | extern void __init lmb_enforce_memory_limit(u64 memory_limit); | 55 | extern void __init lmb_enforce_memory_limit(u64 memory_limit); |
55 | extern int __init lmb_is_reserved(u64 addr); | 56 | extern int __init lmb_is_reserved(u64 addr); |
57 | extern int lmb_find(struct lmb_property *res); | ||
56 | 58 | ||
57 | extern void lmb_dump_all(void); | 59 | extern void lmb_dump_all(void); |
58 | 60 | ||
diff --git a/include/linux/rio.h b/include/linux/rio.h index 68e3f6853fa6..cfb66bbc0f27 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/rio_regs.h> | 24 | #include <linux/rio_regs.h> |
25 | 25 | ||
26 | #define RIO_ANY_DESTID 0xff | ||
27 | #define RIO_NO_HOPCOUNT -1 | 26 | #define RIO_NO_HOPCOUNT -1 |
28 | #define RIO_INVALID_DESTID 0xffff | 27 | #define RIO_INVALID_DESTID 0xffff |
29 | 28 | ||
@@ -39,11 +38,8 @@ | |||
39 | entry is invalid (no route | 38 | entry is invalid (no route |
40 | exists for the device ID) */ | 39 | exists for the device ID) */ |
41 | 40 | ||
42 | #ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT | 41 | #define RIO_MAX_ROUTE_ENTRIES(size) (size ? (1 << 16) : (1 << 8)) |
43 | #define RIO_MAX_ROUTE_ENTRIES (1 << 8) | 42 | #define RIO_ANY_DESTID(size) (size ? 0xffff : 0xff) |
44 | #else | ||
45 | #define RIO_MAX_ROUTE_ENTRIES (1 << 16) | ||
46 | #endif | ||
47 | 43 | ||
48 | #define RIO_MAX_MBOX 4 | 44 | #define RIO_MAX_MBOX 4 |
49 | #define RIO_MAX_MSG_SIZE 0x1000 | 45 | #define RIO_MAX_MSG_SIZE 0x1000 |
@@ -149,6 +145,11 @@ struct rio_dbell { | |||
149 | void *dev_id; | 145 | void *dev_id; |
150 | }; | 146 | }; |
151 | 147 | ||
148 | enum rio_phy_type { | ||
149 | RIO_PHY_PARALLEL, | ||
150 | RIO_PHY_SERIAL, | ||
151 | }; | ||
152 | |||
152 | /** | 153 | /** |
153 | * struct rio_mport - RIO master port info | 154 | * struct rio_mport - RIO master port info |
154 | * @dbells: List of doorbell events | 155 | * @dbells: List of doorbell events |
@@ -163,6 +164,7 @@ struct rio_dbell { | |||
163 | * @id: Port ID, unique among all ports | 164 | * @id: Port ID, unique among all ports |
164 | * @index: Port index, unique among all port interfaces of the same type | 165 | * @index: Port index, unique among all port interfaces of the same type |
165 | * @name: Port name string | 166 | * @name: Port name string |
167 | * @priv: Master port private data | ||
166 | */ | 168 | */ |
167 | struct rio_mport { | 169 | struct rio_mport { |
168 | struct list_head dbells; /* list of doorbell events */ | 170 | struct list_head dbells; /* list of doorbell events */ |
@@ -177,7 +179,13 @@ struct rio_mport { | |||
177 | unsigned char id; /* port ID, unique among all ports */ | 179 | unsigned char id; /* port ID, unique among all ports */ |
178 | unsigned char index; /* port index, unique among all port | 180 | unsigned char index; /* port index, unique among all port |
179 | interfaces of the same type */ | 181 | interfaces of the same type */ |
182 | unsigned int sys_size; /* RapidIO common transport system size. | ||
183 | * 0 - Small size. 256 devices. | ||
184 | * 1 - Large size, 65536 devices. | ||
185 | */ | ||
186 | enum rio_phy_type phy_type; /* RapidIO phy type */ | ||
180 | unsigned char name[40]; | 187 | unsigned char name[40]; |
188 | void *priv; /* Master port private data */ | ||
181 | }; | 189 | }; |
182 | 190 | ||
183 | /** | 191 | /** |
@@ -211,7 +219,7 @@ struct rio_switch { | |||
211 | u16 switchid; | 219 | u16 switchid; |
212 | u16 hopcount; | 220 | u16 hopcount; |
213 | u16 destid; | 221 | u16 destid; |
214 | u8 route_table[RIO_MAX_ROUTE_ENTRIES]; | 222 | u8 *route_table; |
215 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | 223 | int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, |
216 | u16 table, u16 route_destid, u8 route_port); | 224 | u16 table, u16 route_destid, u8 route_port); |
217 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, | 225 | int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, |
@@ -229,13 +237,15 @@ struct rio_switch { | |||
229 | * @dsend: Callback to send a doorbell message. | 237 | * @dsend: Callback to send a doorbell message. |
230 | */ | 238 | */ |
231 | struct rio_ops { | 239 | struct rio_ops { |
232 | int (*lcread) (int index, u32 offset, int len, u32 * data); | 240 | int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, |
233 | int (*lcwrite) (int index, u32 offset, int len, u32 data); | 241 | u32 *data); |
234 | int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len, | 242 | int (*lcwrite) (struct rio_mport *mport, int index, u32 offset, int len, |
235 | u32 * data); | 243 | u32 data); |
236 | int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len, | 244 | int (*cread) (struct rio_mport *mport, int index, u16 destid, |
237 | u32 data); | 245 | u8 hopcount, u32 offset, int len, u32 *data); |
238 | int (*dsend) (int index, u16 destid, u16 data); | 246 | int (*cwrite) (struct rio_mport *mport, int index, u16 destid, |
247 | u8 hopcount, u32 offset, int len, u32 data); | ||
248 | int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); | ||
239 | }; | 249 | }; |
240 | 250 | ||
241 | #define RIO_RESOURCE_MEM 0x00000100 | 251 | #define RIO_RESOURCE_MEM 0x00000100 |