diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-08-30 18:30:38 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-08-30 18:30:38 -0400 |
commit | 0a7d5f8ce960e74fa22986bda4af488539796e49 (patch) | |
tree | e29ad17808a5c3410518e22dae8dfe94801b59f3 /include/asm-powerpc | |
parent | 0165508c80a2b5d5268d9c5dfa9b30c534a33693 (diff) | |
parent | dc709bd190c130b299ac19d596594256265c042a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/atomic.h | 32 | ||||
-rw-r--r-- | include/asm-powerpc/backlight.h | 16 | ||||
-rw-r--r-- | include/asm-powerpc/bitops.h | 16 | ||||
-rw-r--r-- | include/asm-powerpc/cputime.h | 18 | ||||
-rw-r--r-- | include/asm-powerpc/irq.h | 38 | ||||
-rw-r--r-- | include/asm-powerpc/kexec.h | 3 | ||||
-rw-r--r-- | include/asm-powerpc/kprobes.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/pgalloc.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/rtas.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 26 | ||||
-rw-r--r-- | include/asm-powerpc/tsi108.h | 14 | ||||
-rw-r--r-- | include/asm-powerpc/tsi108_irq.h | 124 |
12 files changed, 221 insertions, 70 deletions
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h index bb3c0ab7e667..53283e2540b3 100644 --- a/include/asm-powerpc/atomic.h +++ b/include/asm-powerpc/atomic.h | |||
@@ -27,8 +27,8 @@ static __inline__ void atomic_add(int a, atomic_t *v) | |||
27 | PPC405_ERR77(0,%3) | 27 | PPC405_ERR77(0,%3) |
28 | " stwcx. %0,0,%3 \n\ | 28 | " stwcx. %0,0,%3 \n\ |
29 | bne- 1b" | 29 | bne- 1b" |
30 | : "=&r" (t), "=m" (v->counter) | 30 | : "=&r" (t), "+m" (v->counter) |
31 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 31 | : "r" (a), "r" (&v->counter) |
32 | : "cc"); | 32 | : "cc"); |
33 | } | 33 | } |
34 | 34 | ||
@@ -63,8 +63,8 @@ static __inline__ void atomic_sub(int a, atomic_t *v) | |||
63 | PPC405_ERR77(0,%3) | 63 | PPC405_ERR77(0,%3) |
64 | " stwcx. %0,0,%3 \n\ | 64 | " stwcx. %0,0,%3 \n\ |
65 | bne- 1b" | 65 | bne- 1b" |
66 | : "=&r" (t), "=m" (v->counter) | 66 | : "=&r" (t), "+m" (v->counter) |
67 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 67 | : "r" (a), "r" (&v->counter) |
68 | : "cc"); | 68 | : "cc"); |
69 | } | 69 | } |
70 | 70 | ||
@@ -97,8 +97,8 @@ static __inline__ void atomic_inc(atomic_t *v) | |||
97 | PPC405_ERR77(0,%2) | 97 | PPC405_ERR77(0,%2) |
98 | " stwcx. %0,0,%2 \n\ | 98 | " stwcx. %0,0,%2 \n\ |
99 | bne- 1b" | 99 | bne- 1b" |
100 | : "=&r" (t), "=m" (v->counter) | 100 | : "=&r" (t), "+m" (v->counter) |
101 | : "r" (&v->counter), "m" (v->counter) | 101 | : "r" (&v->counter) |
102 | : "cc"); | 102 | : "cc"); |
103 | } | 103 | } |
104 | 104 | ||
@@ -141,8 +141,8 @@ static __inline__ void atomic_dec(atomic_t *v) | |||
141 | PPC405_ERR77(0,%2)\ | 141 | PPC405_ERR77(0,%2)\ |
142 | " stwcx. %0,0,%2\n\ | 142 | " stwcx. %0,0,%2\n\ |
143 | bne- 1b" | 143 | bne- 1b" |
144 | : "=&r" (t), "=m" (v->counter) | 144 | : "=&r" (t), "+m" (v->counter) |
145 | : "r" (&v->counter), "m" (v->counter) | 145 | : "r" (&v->counter) |
146 | : "cc"); | 146 | : "cc"); |
147 | } | 147 | } |
148 | 148 | ||
@@ -253,8 +253,8 @@ static __inline__ void atomic64_add(long a, atomic64_t *v) | |||
253 | add %0,%2,%0\n\ | 253 | add %0,%2,%0\n\ |
254 | stdcx. %0,0,%3 \n\ | 254 | stdcx. %0,0,%3 \n\ |
255 | bne- 1b" | 255 | bne- 1b" |
256 | : "=&r" (t), "=m" (v->counter) | 256 | : "=&r" (t), "+m" (v->counter) |
257 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 257 | : "r" (a), "r" (&v->counter) |
258 | : "cc"); | 258 | : "cc"); |
259 | } | 259 | } |
260 | 260 | ||
@@ -287,8 +287,8 @@ static __inline__ void atomic64_sub(long a, atomic64_t *v) | |||
287 | subf %0,%2,%0\n\ | 287 | subf %0,%2,%0\n\ |
288 | stdcx. %0,0,%3 \n\ | 288 | stdcx. %0,0,%3 \n\ |
289 | bne- 1b" | 289 | bne- 1b" |
290 | : "=&r" (t), "=m" (v->counter) | 290 | : "=&r" (t), "+m" (v->counter) |
291 | : "r" (a), "r" (&v->counter), "m" (v->counter) | 291 | : "r" (a), "r" (&v->counter) |
292 | : "cc"); | 292 | : "cc"); |
293 | } | 293 | } |
294 | 294 | ||
@@ -319,8 +319,8 @@ static __inline__ void atomic64_inc(atomic64_t *v) | |||
319 | addic %0,%0,1\n\ | 319 | addic %0,%0,1\n\ |
320 | stdcx. %0,0,%2 \n\ | 320 | stdcx. %0,0,%2 \n\ |
321 | bne- 1b" | 321 | bne- 1b" |
322 | : "=&r" (t), "=m" (v->counter) | 322 | : "=&r" (t), "+m" (v->counter) |
323 | : "r" (&v->counter), "m" (v->counter) | 323 | : "r" (&v->counter) |
324 | : "cc"); | 324 | : "cc"); |
325 | } | 325 | } |
326 | 326 | ||
@@ -361,8 +361,8 @@ static __inline__ void atomic64_dec(atomic64_t *v) | |||
361 | addic %0,%0,-1\n\ | 361 | addic %0,%0,-1\n\ |
362 | stdcx. %0,0,%2\n\ | 362 | stdcx. %0,0,%2\n\ |
363 | bne- 1b" | 363 | bne- 1b" |
364 | : "=&r" (t), "=m" (v->counter) | 364 | : "=&r" (t), "+m" (v->counter) |
365 | : "r" (&v->counter), "m" (v->counter) | 365 | : "r" (&v->counter) |
366 | : "cc"); | 366 | : "cc"); |
367 | } | 367 | } |
368 | 368 | ||
diff --git a/include/asm-powerpc/backlight.h b/include/asm-powerpc/backlight.h index a5e9e656e332..8cf5c37c3817 100644 --- a/include/asm-powerpc/backlight.h +++ b/include/asm-powerpc/backlight.h | |||
@@ -16,16 +16,26 @@ | |||
16 | extern struct backlight_device *pmac_backlight; | 16 | extern struct backlight_device *pmac_backlight; |
17 | extern struct mutex pmac_backlight_mutex; | 17 | extern struct mutex pmac_backlight_mutex; |
18 | 18 | ||
19 | extern void pmac_backlight_calc_curve(struct fb_info*); | ||
20 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); | 19 | extern int pmac_backlight_curve_lookup(struct fb_info *info, int value); |
21 | 20 | ||
22 | extern int pmac_has_backlight_type(const char *type); | 21 | extern int pmac_has_backlight_type(const char *type); |
23 | 22 | ||
24 | extern void pmac_backlight_key_up(void); | 23 | extern void pmac_backlight_key(int direction); |
25 | extern void pmac_backlight_key_down(void); | 24 | static inline void pmac_backlight_key_up(void) |
25 | { | ||
26 | pmac_backlight_key(0); | ||
27 | } | ||
28 | static inline void pmac_backlight_key_down(void) | ||
29 | { | ||
30 | pmac_backlight_key(1); | ||
31 | } | ||
26 | 32 | ||
33 | extern void pmac_backlight_set_legacy_brightness_pmu(int brightness); | ||
27 | extern int pmac_backlight_set_legacy_brightness(int brightness); | 34 | extern int pmac_backlight_set_legacy_brightness(int brightness); |
28 | extern int pmac_backlight_get_legacy_brightness(void); | 35 | extern int pmac_backlight_get_legacy_brightness(void); |
29 | 36 | ||
37 | extern void pmac_backlight_enable(void); | ||
38 | extern void pmac_backlight_disable(void); | ||
39 | |||
30 | #endif /* __KERNEL__ */ | 40 | #endif /* __KERNEL__ */ |
31 | #endif | 41 | #endif |
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h index 76e2f08c3c83..c341063d0804 100644 --- a/include/asm-powerpc/bitops.h +++ b/include/asm-powerpc/bitops.h | |||
@@ -65,8 +65,8 @@ static __inline__ void set_bit(int nr, volatile unsigned long *addr) | |||
65 | PPC405_ERR77(0,%3) | 65 | PPC405_ERR77(0,%3) |
66 | PPC_STLCX "%0,0,%3\n" | 66 | PPC_STLCX "%0,0,%3\n" |
67 | "bne- 1b" | 67 | "bne- 1b" |
68 | : "=&r"(old), "=m"(*p) | 68 | : "=&r" (old), "+m" (*p) |
69 | : "r"(mask), "r"(p), "m"(*p) | 69 | : "r" (mask), "r" (p) |
70 | : "cc" ); | 70 | : "cc" ); |
71 | } | 71 | } |
72 | 72 | ||
@@ -82,8 +82,8 @@ static __inline__ void clear_bit(int nr, volatile unsigned long *addr) | |||
82 | PPC405_ERR77(0,%3) | 82 | PPC405_ERR77(0,%3) |
83 | PPC_STLCX "%0,0,%3\n" | 83 | PPC_STLCX "%0,0,%3\n" |
84 | "bne- 1b" | 84 | "bne- 1b" |
85 | : "=&r"(old), "=m"(*p) | 85 | : "=&r" (old), "+m" (*p) |
86 | : "r"(mask), "r"(p), "m"(*p) | 86 | : "r" (mask), "r" (p) |
87 | : "cc" ); | 87 | : "cc" ); |
88 | } | 88 | } |
89 | 89 | ||
@@ -99,8 +99,8 @@ static __inline__ void change_bit(int nr, volatile unsigned long *addr) | |||
99 | PPC405_ERR77(0,%3) | 99 | PPC405_ERR77(0,%3) |
100 | PPC_STLCX "%0,0,%3\n" | 100 | PPC_STLCX "%0,0,%3\n" |
101 | "bne- 1b" | 101 | "bne- 1b" |
102 | : "=&r"(old), "=m"(*p) | 102 | : "=&r" (old), "+m" (*p) |
103 | : "r"(mask), "r"(p), "m"(*p) | 103 | : "r" (mask), "r" (p) |
104 | : "cc" ); | 104 | : "cc" ); |
105 | } | 105 | } |
106 | 106 | ||
@@ -179,8 +179,8 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr) | |||
179 | "or %0,%0,%2\n" | 179 | "or %0,%0,%2\n" |
180 | PPC_STLCX "%0,0,%3\n" | 180 | PPC_STLCX "%0,0,%3\n" |
181 | "bne- 1b" | 181 | "bne- 1b" |
182 | : "=&r" (old), "=m" (*addr) | 182 | : "=&r" (old), "+m" (*addr) |
183 | : "r" (mask), "r" (addr), "m" (*addr) | 183 | : "r" (mask), "r" (addr) |
184 | : "cc"); | 184 | : "cc"); |
185 | } | 185 | } |
186 | 186 | ||
diff --git a/include/asm-powerpc/cputime.h b/include/asm-powerpc/cputime.h index a21185d47883..310804485208 100644 --- a/include/asm-powerpc/cputime.h +++ b/include/asm-powerpc/cputime.h | |||
@@ -43,6 +43,7 @@ typedef u64 cputime64_t; | |||
43 | 43 | ||
44 | #define cputime64_zero ((cputime64_t)0) | 44 | #define cputime64_zero ((cputime64_t)0) |
45 | #define cputime64_add(__a, __b) ((__a) + (__b)) | 45 | #define cputime64_add(__a, __b) ((__a) + (__b)) |
46 | #define cputime64_sub(__a, __b) ((__a) - (__b)) | ||
46 | #define cputime_to_cputime64(__ct) (__ct) | 47 | #define cputime_to_cputime64(__ct) (__ct) |
47 | 48 | ||
48 | #ifdef __KERNEL__ | 49 | #ifdef __KERNEL__ |
@@ -74,6 +75,23 @@ static inline cputime_t jiffies_to_cputime(const unsigned long jif) | |||
74 | return ct; | 75 | return ct; |
75 | } | 76 | } |
76 | 77 | ||
78 | static inline cputime64_t jiffies64_to_cputime64(const u64 jif) | ||
79 | { | ||
80 | cputime_t ct; | ||
81 | u64 sec; | ||
82 | |||
83 | /* have to be a little careful about overflow */ | ||
84 | ct = jif % HZ; | ||
85 | sec = jif / HZ; | ||
86 | if (ct) { | ||
87 | ct *= tb_ticks_per_sec; | ||
88 | do_div(ct, HZ); | ||
89 | } | ||
90 | if (sec) | ||
91 | ct += (cputime_t) sec * tb_ticks_per_sec; | ||
92 | return ct; | ||
93 | } | ||
94 | |||
77 | static inline u64 cputime64_to_jiffies64(const cputime_t ct) | 95 | static inline u64 cputime64_to_jiffies64(const cputime_t ct) |
78 | { | 96 | { |
79 | return mulhdu(ct, __cputime_jiffies_factor); | 97 | return mulhdu(ct, __cputime_jiffies_factor); |
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index e05754752028..d903a62959da 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h | |||
@@ -83,25 +83,24 @@ struct irq_host_ops { | |||
83 | int (*match)(struct irq_host *h, struct device_node *node); | 83 | int (*match)(struct irq_host *h, struct device_node *node); |
84 | 84 | ||
85 | /* Create or update a mapping between a virtual irq number and a hw | 85 | /* Create or update a mapping between a virtual irq number and a hw |
86 | * irq number. This can be called several times for the same mapping | 86 | * irq number. This is called only once for a given mapping. |
87 | * but with different flags, though unmap shall always be called | ||
88 | * before the virq->hw mapping is changed. | ||
89 | */ | 87 | */ |
90 | int (*map)(struct irq_host *h, unsigned int virq, | 88 | int (*map)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw); |
91 | irq_hw_number_t hw, unsigned int flags); | ||
92 | 89 | ||
93 | /* Dispose of such a mapping */ | 90 | /* Dispose of such a mapping */ |
94 | void (*unmap)(struct irq_host *h, unsigned int virq); | 91 | void (*unmap)(struct irq_host *h, unsigned int virq); |
95 | 92 | ||
96 | /* Translate device-tree interrupt specifier from raw format coming | 93 | /* Translate device-tree interrupt specifier from raw format coming |
97 | * from the firmware to a irq_hw_number_t (interrupt line number) and | 94 | * from the firmware to a irq_hw_number_t (interrupt line number) and |
98 | * trigger flags that can be passed to irq_create_mapping(). | 95 | * type (sense) that can be passed to set_irq_type(). In the absence |
99 | * If no translation is provided, raw format is assumed to be one cell | 96 | * of this callback, irq_create_of_mapping() and irq_of_parse_and_map() |
100 | * for interrupt line and default sense. | 97 | * will return the hw number in the first cell and IRQ_TYPE_NONE for |
98 | * the type (which amount to keeping whatever default value the | ||
99 | * interrupt controller has for that line) | ||
101 | */ | 100 | */ |
102 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, | 101 | int (*xlate)(struct irq_host *h, struct device_node *ctrler, |
103 | u32 *intspec, unsigned int intsize, | 102 | u32 *intspec, unsigned int intsize, |
104 | irq_hw_number_t *out_hwirq, unsigned int *out_flags); | 103 | irq_hw_number_t *out_hwirq, unsigned int *out_type); |
105 | }; | 104 | }; |
106 | 105 | ||
107 | struct irq_host { | 106 | struct irq_host { |
@@ -193,25 +192,14 @@ extern void irq_set_virq_count(unsigned int count); | |||
193 | * irq_create_mapping - Map a hardware interrupt into linux virq space | 192 | * irq_create_mapping - Map a hardware interrupt into linux virq space |
194 | * @host: host owning this hardware interrupt or NULL for default host | 193 | * @host: host owning this hardware interrupt or NULL for default host |
195 | * @hwirq: hardware irq number in that host space | 194 | * @hwirq: hardware irq number in that host space |
196 | * @flags: flags passed to the controller. contains the trigger type among | ||
197 | * others. Use IRQ_TYPE_* defined in include/linux/irq.h | ||
198 | * | 195 | * |
199 | * Only one mapping per hardware interrupt is permitted. Returns a linux | 196 | * Only one mapping per hardware interrupt is permitted. Returns a linux |
200 | * virq number. The flags can be used to provide sense information to the | 197 | * virq number. |
201 | * controller (typically extracted from the device-tree). If no information | 198 | * If the sense/trigger is to be specified, set_irq_type() should be called |
202 | * is passed, the controller defaults will apply (for example, xics can only | 199 | * on the number returned from that call. |
203 | * do edge so flags are irrelevant for some pseries specific irqs). | ||
204 | * | ||
205 | * The device-tree generally contains the trigger info in an encoding that is | ||
206 | * specific to a given type of controller. In that case, you can directly use | ||
207 | * host->ops->trigger_xlate() to translate that. | ||
208 | * | ||
209 | * It is recommended that new PICs that don't have existing OF bindings chose | ||
210 | * to use a representation of triggers identical to linux. | ||
211 | */ | 200 | */ |
212 | extern unsigned int irq_create_mapping(struct irq_host *host, | 201 | extern unsigned int irq_create_mapping(struct irq_host *host, |
213 | irq_hw_number_t hwirq, | 202 | irq_hw_number_t hwirq); |
214 | unsigned int flags); | ||
215 | 203 | ||
216 | 204 | ||
217 | /*** | 205 | /*** |
@@ -295,7 +283,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count); | |||
295 | * | 283 | * |
296 | * This function is identical to irq_create_mapping except that it takes | 284 | * This function is identical to irq_create_mapping except that it takes |
297 | * as input informations straight from the device-tree (typically the results | 285 | * as input informations straight from the device-tree (typically the results |
298 | * of the of_irq_map_*() functions | 286 | * of the of_irq_map_*() functions. |
299 | */ | 287 | */ |
300 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | 288 | extern unsigned int irq_create_of_mapping(struct device_node *controller, |
301 | u32 *intspec, unsigned int intsize); | 289 | u32 *intspec, unsigned int intsize); |
diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index 8f7fd5cfec34..11cbdf81fd2e 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifndef __ASSEMBLY__ | 34 | #ifndef __ASSEMBLY__ |
35 | #include <linux/cpumask.h> | ||
35 | 36 | ||
36 | #ifdef CONFIG_KEXEC | 37 | #ifdef CONFIG_KEXEC |
37 | 38 | ||
@@ -109,7 +110,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
109 | 110 | ||
110 | #define MAX_NOTE_BYTES 1024 | 111 | #define MAX_NOTE_BYTES 1024 |
111 | 112 | ||
112 | #ifdef __powerpc64__ | ||
113 | extern void kexec_smp_wait(void); /* get and clear naca physid, wait for | 113 | extern void kexec_smp_wait(void); /* get and clear naca physid, wait for |
114 | master to copy new code to 0 */ | 114 | master to copy new code to 0 */ |
115 | extern int crashing_cpu; | 115 | extern int crashing_cpu; |
@@ -119,7 +119,6 @@ static inline int kexec_sr_activated(int cpu) | |||
119 | { | 119 | { |
120 | return cpu_isset(cpu,cpus_in_sr); | 120 | return cpu_isset(cpu,cpus_in_sr); |
121 | } | 121 | } |
122 | #endif /* __powerpc64 __ */ | ||
123 | 122 | ||
124 | struct kimage; | 123 | struct kimage; |
125 | struct pt_regs; | 124 | struct pt_regs; |
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 2d0af52c823d..34e1f89a5fa0 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t; | |||
51 | 51 | ||
52 | #define ARCH_SUPPORTS_KRETPROBES | 52 | #define ARCH_SUPPORTS_KRETPROBES |
53 | #define ARCH_INACTIVE_KPROBE_COUNT 1 | 53 | #define ARCH_INACTIVE_KPROBE_COUNT 1 |
54 | #define flush_insn_slot(p) do { } while (0) | ||
54 | 55 | ||
55 | void kretprobe_trampoline(void); | 56 | void kretprobe_trampoline(void); |
56 | extern void arch_remove_kprobe(struct kprobe *p); | 57 | extern void arch_remove_kprobe(struct kprobe *p); |
diff --git a/include/asm-powerpc/pgalloc.h b/include/asm-powerpc/pgalloc.h index 9f0917c68659..ae63db7b3e7d 100644 --- a/include/asm-powerpc/pgalloc.h +++ b/include/asm-powerpc/pgalloc.h | |||
@@ -117,7 +117,7 @@ static inline void pte_free(struct page *ptepage) | |||
117 | pte_free_kernel(page_address(ptepage)); | 117 | pte_free_kernel(page_address(ptepage)); |
118 | } | 118 | } |
119 | 119 | ||
120 | #define PGF_CACHENUM_MASK 0xf | 120 | #define PGF_CACHENUM_MASK 0x3 |
121 | 121 | ||
122 | typedef struct pgtable_free { | 122 | typedef struct pgtable_free { |
123 | unsigned long val; | 123 | unsigned long val; |
diff --git a/include/asm-powerpc/rtas.h b/include/asm-powerpc/rtas.h index a33c6acffa61..82a27e9a041f 100644 --- a/include/asm-powerpc/rtas.h +++ b/include/asm-powerpc/rtas.h | |||
@@ -170,6 +170,7 @@ extern int rtas_get_sensor(int sensor, int index, int *state); | |||
170 | extern int rtas_get_power_level(int powerdomain, int *level); | 170 | extern int rtas_get_power_level(int powerdomain, int *level); |
171 | extern int rtas_set_power_level(int powerdomain, int level, int *setlevel); | 171 | extern int rtas_set_power_level(int powerdomain, int level, int *setlevel); |
172 | extern int rtas_set_indicator(int indicator, int index, int new_value); | 172 | extern int rtas_set_indicator(int indicator, int index, int new_value); |
173 | extern int rtas_set_indicator_fast(int indicator, int index, int new_value); | ||
173 | extern void rtas_progress(char *s, unsigned short hex); | 174 | extern void rtas_progress(char *s, unsigned short hex); |
174 | extern void rtas_initialize(void); | 175 | extern void rtas_initialize(void); |
175 | 176 | ||
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index d075725bf444..4c9f5229e833 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -39,7 +39,6 @@ | |||
39 | #define read_barrier_depends() do { } while(0) | 39 | #define read_barrier_depends() do { } while(0) |
40 | 40 | ||
41 | #define set_mb(var, value) do { var = value; mb(); } while (0) | 41 | #define set_mb(var, value) do { var = value; mb(); } while (0) |
42 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
43 | 42 | ||
44 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
45 | #ifdef CONFIG_SMP | 44 | #ifdef CONFIG_SMP |
@@ -54,6 +53,15 @@ | |||
54 | #define smp_read_barrier_depends() do { } while(0) | 53 | #define smp_read_barrier_depends() do { } while(0) |
55 | #endif /* CONFIG_SMP */ | 54 | #endif /* CONFIG_SMP */ |
56 | 55 | ||
56 | /* | ||
57 | * This is a barrier which prevents following instructions from being | ||
58 | * started until the value of the argument x is known. For example, if | ||
59 | * x is a variable loaded from memory, this prevents following | ||
60 | * instructions from being executed until the load has been performed. | ||
61 | */ | ||
62 | #define data_barrier(x) \ | ||
63 | asm volatile("twi 0,%0,0; isync" : : "r" (x) : "memory"); | ||
64 | |||
57 | struct task_struct; | 65 | struct task_struct; |
58 | struct pt_regs; | 66 | struct pt_regs; |
59 | 67 | ||
@@ -220,8 +228,8 @@ __xchg_u32(volatile void *p, unsigned long val) | |||
220 | " stwcx. %3,0,%2 \n\ | 228 | " stwcx. %3,0,%2 \n\ |
221 | bne- 1b" | 229 | bne- 1b" |
222 | ISYNC_ON_SMP | 230 | ISYNC_ON_SMP |
223 | : "=&r" (prev), "=m" (*(volatile unsigned int *)p) | 231 | : "=&r" (prev), "+m" (*(volatile unsigned int *)p) |
224 | : "r" (p), "r" (val), "m" (*(volatile unsigned int *)p) | 232 | : "r" (p), "r" (val) |
225 | : "cc", "memory"); | 233 | : "cc", "memory"); |
226 | 234 | ||
227 | return prev; | 235 | return prev; |
@@ -240,8 +248,8 @@ __xchg_u64(volatile void *p, unsigned long val) | |||
240 | " stdcx. %3,0,%2 \n\ | 248 | " stdcx. %3,0,%2 \n\ |
241 | bne- 1b" | 249 | bne- 1b" |
242 | ISYNC_ON_SMP | 250 | ISYNC_ON_SMP |
243 | : "=&r" (prev), "=m" (*(volatile unsigned long *)p) | 251 | : "=&r" (prev), "+m" (*(volatile unsigned long *)p) |
244 | : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p) | 252 | : "r" (p), "r" (val) |
245 | : "cc", "memory"); | 253 | : "cc", "memory"); |
246 | 254 | ||
247 | return prev; | 255 | return prev; |
@@ -299,8 +307,8 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | |||
299 | ISYNC_ON_SMP | 307 | ISYNC_ON_SMP |
300 | "\n\ | 308 | "\n\ |
301 | 2:" | 309 | 2:" |
302 | : "=&r" (prev), "=m" (*p) | 310 | : "=&r" (prev), "+m" (*p) |
303 | : "r" (p), "r" (old), "r" (new), "m" (*p) | 311 | : "r" (p), "r" (old), "r" (new) |
304 | : "cc", "memory"); | 312 | : "cc", "memory"); |
305 | 313 | ||
306 | return prev; | 314 | return prev; |
@@ -322,8 +330,8 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | |||
322 | ISYNC_ON_SMP | 330 | ISYNC_ON_SMP |
323 | "\n\ | 331 | "\n\ |
324 | 2:" | 332 | 2:" |
325 | : "=&r" (prev), "=m" (*p) | 333 | : "=&r" (prev), "+m" (*p) |
326 | : "r" (p), "r" (old), "r" (new), "m" (*p) | 334 | : "r" (p), "r" (old), "r" (new) |
327 | : "cc", "memory"); | 335 | : "cc", "memory"); |
328 | 336 | ||
329 | return prev; | 337 | return prev; |
diff --git a/include/asm-powerpc/tsi108.h b/include/asm-powerpc/tsi108.h index c4c278d72f71..2c702d35a7cf 100644 --- a/include/asm-powerpc/tsi108.h +++ b/include/asm-powerpc/tsi108.h | |||
@@ -1,16 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-ppc/tsi108.h | ||
3 | * | ||
4 | * common routine and memory layout for Tundra TSI108(Grendel) host bridge | 2 | * common routine and memory layout for Tundra TSI108(Grendel) host bridge |
5 | * memory controller. | 3 | * memory controller. |
6 | * | 4 | * |
7 | * Author: Jacob Pan (jacob.pan@freescale.com) | 5 | * Author: Jacob Pan (jacob.pan@freescale.com) |
8 | * Alex Bounine (alexandreb@tundra.com) | 6 | * Alex Bounine (alexandreb@tundra.com) |
9 | * 2004 (c) Freescale Semiconductor Inc. This file is licensed under | 7 | * |
10 | * the terms of the GNU General Public License version 2. This program | 8 | * Copyright 2004-2006 Freescale Semiconductor, Inc. |
11 | * is licensed "as is" without any warranty of any kind, whether express | 9 | * |
12 | * or implied. | 10 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
13 | */ | 14 | */ |
15 | |||
14 | #ifndef __PPC_KERNEL_TSI108_H | 16 | #ifndef __PPC_KERNEL_TSI108_H |
15 | #define __PPC_KERNEL_TSI108_H | 17 | #define __PPC_KERNEL_TSI108_H |
16 | 18 | ||
diff --git a/include/asm-powerpc/tsi108_irq.h b/include/asm-powerpc/tsi108_irq.h new file mode 100644 index 000000000000..3e4d04effa57 --- /dev/null +++ b/include/asm-powerpc/tsi108_irq.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * (C) Copyright 2005 Tundra Semiconductor Corp. | ||
3 | * Alex Bounine, <alexandreb at tundra.com). | ||
4 | * | ||
5 | * See file CREDITS for list of people who contributed to this | ||
6 | * project. | ||
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 as | ||
10 | * published by the Free Software Foundation; either version 2 of | ||
11 | * the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
21 | * MA 02111-1307 USA | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * definitions for interrupt controller initialization and external interrupt | ||
26 | * demultiplexing on TSI108EMU/SVB boards. | ||
27 | */ | ||
28 | |||
29 | #ifndef _ASM_PPC_TSI108_IRQ_H | ||
30 | #define _ASM_PPC_TSI108_IRQ_H | ||
31 | |||
32 | /* | ||
33 | * Tsi108 interrupts | ||
34 | */ | ||
35 | #ifndef TSI108_IRQ_REG_BASE | ||
36 | #define TSI108_IRQ_REG_BASE 0 | ||
37 | #endif | ||
38 | |||
39 | #define TSI108_IRQ(x) (TSI108_IRQ_REG_BASE + (x)) | ||
40 | |||
41 | #define TSI108_MAX_VECTORS (36 + 4) /* 36 sources + PCI INT demux */ | ||
42 | #define MAX_TASK_PRIO 0xF | ||
43 | |||
44 | #define TSI108_IRQ_SPURIOUS (TSI108_MAX_VECTORS) | ||
45 | |||
46 | #define DEFAULT_PRIO_LVL 10 /* initial priority level */ | ||
47 | |||
48 | /* Interrupt vectors assignment to external and internal | ||
49 | * sources of requests. */ | ||
50 | |||
51 | /* EXTERNAL INTERRUPT SOURCES */ | ||
52 | |||
53 | #define IRQ_TSI108_EXT_INT0 TSI108_IRQ(0) /* External Source at INT[0] */ | ||
54 | #define IRQ_TSI108_EXT_INT1 TSI108_IRQ(1) /* External Source at INT[1] */ | ||
55 | #define IRQ_TSI108_EXT_INT2 TSI108_IRQ(2) /* External Source at INT[2] */ | ||
56 | #define IRQ_TSI108_EXT_INT3 TSI108_IRQ(3) /* External Source at INT[3] */ | ||
57 | |||
58 | /* INTERNAL INTERRUPT SOURCES */ | ||
59 | |||
60 | #define IRQ_TSI108_RESERVED0 TSI108_IRQ(4) /* Reserved IRQ */ | ||
61 | #define IRQ_TSI108_RESERVED1 TSI108_IRQ(5) /* Reserved IRQ */ | ||
62 | #define IRQ_TSI108_RESERVED2 TSI108_IRQ(6) /* Reserved IRQ */ | ||
63 | #define IRQ_TSI108_RESERVED3 TSI108_IRQ(7) /* Reserved IRQ */ | ||
64 | #define IRQ_TSI108_DMA0 TSI108_IRQ(8) /* DMA0 */ | ||
65 | #define IRQ_TSI108_DMA1 TSI108_IRQ(9) /* DMA1 */ | ||
66 | #define IRQ_TSI108_DMA2 TSI108_IRQ(10) /* DMA2 */ | ||
67 | #define IRQ_TSI108_DMA3 TSI108_IRQ(11) /* DMA3 */ | ||
68 | #define IRQ_TSI108_UART0 TSI108_IRQ(12) /* UART0 */ | ||
69 | #define IRQ_TSI108_UART1 TSI108_IRQ(13) /* UART1 */ | ||
70 | #define IRQ_TSI108_I2C TSI108_IRQ(14) /* I2C */ | ||
71 | #define IRQ_TSI108_GPIO TSI108_IRQ(15) /* GPIO */ | ||
72 | #define IRQ_TSI108_GIGE0 TSI108_IRQ(16) /* GIGE0 */ | ||
73 | #define IRQ_TSI108_GIGE1 TSI108_IRQ(17) /* GIGE1 */ | ||
74 | #define IRQ_TSI108_RESERVED4 TSI108_IRQ(18) /* Reserved IRQ */ | ||
75 | #define IRQ_TSI108_HLP TSI108_IRQ(19) /* HLP */ | ||
76 | #define IRQ_TSI108_SDRAM TSI108_IRQ(20) /* SDC */ | ||
77 | #define IRQ_TSI108_PROC_IF TSI108_IRQ(21) /* Processor IF */ | ||
78 | #define IRQ_TSI108_RESERVED5 TSI108_IRQ(22) /* Reserved IRQ */ | ||
79 | #define IRQ_TSI108_PCI TSI108_IRQ(23) /* PCI/X block */ | ||
80 | |||
81 | #define IRQ_TSI108_MBOX0 TSI108_IRQ(24) /* Mailbox 0 register */ | ||
82 | #define IRQ_TSI108_MBOX1 TSI108_IRQ(25) /* Mailbox 1 register */ | ||
83 | #define IRQ_TSI108_MBOX2 TSI108_IRQ(26) /* Mailbox 2 register */ | ||
84 | #define IRQ_TSI108_MBOX3 TSI108_IRQ(27) /* Mailbox 3 register */ | ||
85 | |||
86 | #define IRQ_TSI108_DBELL0 TSI108_IRQ(28) /* Doorbell 0 */ | ||
87 | #define IRQ_TSI108_DBELL1 TSI108_IRQ(29) /* Doorbell 1 */ | ||
88 | #define IRQ_TSI108_DBELL2 TSI108_IRQ(30) /* Doorbell 2 */ | ||
89 | #define IRQ_TSI108_DBELL3 TSI108_IRQ(31) /* Doorbell 3 */ | ||
90 | |||
91 | #define IRQ_TSI108_TIMER0 TSI108_IRQ(32) /* Global Timer 0 */ | ||
92 | #define IRQ_TSI108_TIMER1 TSI108_IRQ(33) /* Global Timer 1 */ | ||
93 | #define IRQ_TSI108_TIMER2 TSI108_IRQ(34) /* Global Timer 2 */ | ||
94 | #define IRQ_TSI108_TIMER3 TSI108_IRQ(35) /* Global Timer 3 */ | ||
95 | |||
96 | /* | ||
97 | * PCI bus INTA# - INTD# lines demultiplexor | ||
98 | */ | ||
99 | #define IRQ_PCI_INTAD_BASE TSI108_IRQ(36) | ||
100 | #define IRQ_PCI_INTA (IRQ_PCI_INTAD_BASE + 0) | ||
101 | #define IRQ_PCI_INTB (IRQ_PCI_INTAD_BASE + 1) | ||
102 | #define IRQ_PCI_INTC (IRQ_PCI_INTAD_BASE + 2) | ||
103 | #define IRQ_PCI_INTD (IRQ_PCI_INTAD_BASE + 3) | ||
104 | #define NUM_PCI_IRQS (4) | ||
105 | |||
106 | /* number of entries in vector dispatch table */ | ||
107 | #define IRQ_TSI108_TAB_SIZE (TSI108_MAX_VECTORS + 1) | ||
108 | |||
109 | /* Mapping of MPIC outputs to processors' interrupt pins */ | ||
110 | |||
111 | #define IDIR_INT_OUT0 0x1 | ||
112 | #define IDIR_INT_OUT1 0x2 | ||
113 | #define IDIR_INT_OUT2 0x4 | ||
114 | #define IDIR_INT_OUT3 0x8 | ||
115 | |||
116 | /*--------------------------------------------------------------- | ||
117 | * IRQ line configuration parameters */ | ||
118 | |||
119 | /* Interrupt delivery modes */ | ||
120 | typedef enum { | ||
121 | TSI108_IRQ_DIRECTED, | ||
122 | TSI108_IRQ_DISTRIBUTED, | ||
123 | } TSI108_IRQ_MODE; | ||
124 | #endif /* _ASM_PPC_TSI108_IRQ_H */ | ||