aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:19:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:19:14 -0400
commit867a89e0b73af48838c7987e80899a1ff26dd6ff (patch)
treeb4a8830b3e880b9a5133ad1ec3106665819cc8d4 /include
parent44473d991332053eb3fea1e08f8a6ee2c6fb409c (diff)
parent6c39103ce5192bdb2195f3daab7323dfa44fb52e (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.h6
-rw-r--r--include/asm-powerpc/rio.h (renamed from include/asm-ppc/rio.h)0
-rw-r--r--include/asm-powerpc/system.h24
-rw-r--r--include/linux/lmb.h4
-rw-r--r--include/linux/rio.h38
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
139struct thread_struct { 139struct 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 */
207static __inline__ unsigned long 207static __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 */
232static __inline__ unsigned long 232static __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
250static __inline__ unsigned long 250static __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
269static __inline__ unsigned long 269static __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 */
291extern void __xchg_called_with_bad_pointer(void); 291extern void __xchg_called_with_bad_pointer(void);
292 292
293static __inline__ unsigned long 293static __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
308static __inline__ unsigned long 308static __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
341static __inline__ unsigned long 341static __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
364static __inline__ unsigned long 364static __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
387static __inline__ unsigned long 387static __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
409static __inline__ unsigned long 409static __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(). */
433extern void __cmpxchg_called_with_bad_pointer(void); 433extern void __cmpxchg_called_with_bad_pointer(void);
434 434
435static __inline__ unsigned long 435static __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
451static __inline__ unsigned long 451static __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
41extern void __init lmb_init(void); 41extern void __init lmb_init(void);
42extern void __init lmb_analyze(void); 42extern void __init lmb_analyze(void);
43extern long __init lmb_add(u64 base, u64 size); 43extern long lmb_add(u64 base, u64 size);
44extern long lmb_remove(u64 base, u64 size);
44extern long __init lmb_reserve(u64 base, u64 size); 45extern long __init lmb_reserve(u64 base, u64 size);
45extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, 46extern 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);
53extern u64 __init lmb_end_of_DRAM(void); 54extern u64 __init lmb_end_of_DRAM(void);
54extern void __init lmb_enforce_memory_limit(u64 memory_limit); 55extern void __init lmb_enforce_memory_limit(u64 memory_limit);
55extern int __init lmb_is_reserved(u64 addr); 56extern int __init lmb_is_reserved(u64 addr);
57extern int lmb_find(struct lmb_property *res);
56 58
57extern void lmb_dump_all(void); 59extern 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
148enum 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 */
167struct rio_mport { 169struct 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 */
231struct rio_ops { 239struct 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