diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/Kbuild | 45 | ||||
-rw-r--r-- | include/asm-powerpc/ide.h | 12 | ||||
-rw-r--r-- | include/asm-powerpc/io.h | 183 | ||||
-rw-r--r-- | include/asm-powerpc/iseries/iseries_io.h | 60 | ||||
-rw-r--r-- | include/asm-powerpc/page.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/ppc-pci.h | 11 | ||||
-rw-r--r-- | include/asm-powerpc/prom.h | 12 | ||||
-rw-r--r-- | include/asm-powerpc/ptrace.h | 4 |
8 files changed, 150 insertions, 183 deletions
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild index ac61d7eb6021..9827849953a3 100644 --- a/include/asm-powerpc/Kbuild +++ b/include/asm-powerpc/Kbuild | |||
@@ -1,10 +1,41 @@ | |||
1 | include include/asm-generic/Kbuild.asm | 1 | include include/asm-generic/Kbuild.asm |
2 | 2 | ||
3 | unifdef-y += a.out.h asm-compat.h bootx.h byteorder.h cputable.h elf.h \ | 3 | header-y += auxvec.h |
4 | nvram.h param.h posix_types.h ptrace.h seccomp.h signal.h \ | 4 | header-y += ioctls.h |
5 | termios.h types.h unistd.h | 5 | header-y += mman.h |
6 | header-y += sembuf.h | ||
7 | header-y += siginfo.h | ||
8 | header-y += stat.h | ||
9 | header-y += errno.h | ||
10 | header-y += ipcbuf.h | ||
11 | header-y += msgbuf.h | ||
12 | header-y += shmbuf.h | ||
13 | header-y += socket.h | ||
14 | header-y += termbits.h | ||
15 | header-y += fcntl.h | ||
16 | header-y += ipc.h | ||
17 | header-y += poll.h | ||
18 | header-y += shmparam.h | ||
19 | header-y += sockios.h | ||
20 | header-y += ucontext.h | ||
21 | header-y += ioctl.h | ||
22 | header-y += linkage.h | ||
23 | header-y += resource.h | ||
24 | header-y += sigcontext.h | ||
25 | header-y += statfs.h | ||
6 | 26 | ||
7 | header-y += auxvec.h ioctls.h mman.h sembuf.h siginfo.h stat.h errno.h \ | 27 | unifdef-y += a.out.h |
8 | ipcbuf.h msgbuf.h shmbuf.h socket.h termbits.h fcntl.h ipc.h \ | 28 | unifdef-y += asm-compat.h |
9 | poll.h shmparam.h sockios.h ucontext.h ioctl.h linkage.h \ | 29 | unifdef-y += bootx.h |
10 | resource.h sigcontext.h statfs.h | 30 | unifdef-y += byteorder.h |
31 | unifdef-y += cputable.h | ||
32 | unifdef-y += elf.h | ||
33 | unifdef-y += nvram.h | ||
34 | unifdef-y += param.h | ||
35 | unifdef-y += posix_types.h | ||
36 | unifdef-y += ptrace.h | ||
37 | unifdef-y += seccomp.h | ||
38 | unifdef-y += signal.h | ||
39 | unifdef-y += termios.h | ||
40 | unifdef-y += types.h | ||
41 | unifdef-y += unistd.h | ||
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h index b09b42af6a1e..c8390f9485de 100644 --- a/include/asm-powerpc/ide.h +++ b/include/asm-powerpc/ide.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <asm/mpc8xx.h> | 13 | #include <asm/mpc8xx.h> |
14 | #endif | 14 | #endif |
15 | #include <asm/io.h> | ||
15 | 16 | ||
16 | #ifndef MAX_HWIFS | 17 | #ifndef MAX_HWIFS |
17 | #ifdef __powerpc64__ | 18 | #ifdef __powerpc64__ |
@@ -21,15 +22,14 @@ | |||
21 | #endif | 22 | #endif |
22 | #endif | 23 | #endif |
23 | 24 | ||
25 | #define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c)) | ||
26 | #define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c)) | ||
27 | #define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c)) | ||
28 | #define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c)) | ||
29 | |||
24 | #ifndef __powerpc64__ | 30 | #ifndef __powerpc64__ |
25 | #include <linux/hdreg.h> | 31 | #include <linux/hdreg.h> |
26 | #include <linux/ioport.h> | 32 | #include <linux/ioport.h> |
27 | #include <asm/io.h> | ||
28 | |||
29 | extern void __ide_mm_insw(void __iomem *port, void *addr, u32 count); | ||
30 | extern void __ide_mm_outsw(void __iomem *port, void *addr, u32 count); | ||
31 | extern void __ide_mm_insl(void __iomem *port, void *addr, u32 count); | ||
32 | extern void __ide_mm_outsl(void __iomem *port, void *addr, u32 count); | ||
33 | 33 | ||
34 | struct ide_machdep_calls { | 34 | struct ide_machdep_calls { |
35 | int (*default_irq)(unsigned long base); | 35 | int (*default_irq)(unsigned long base); |
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 212428db0d8b..46bae1cf385b 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h | |||
@@ -20,20 +20,11 @@ extern int check_legacy_ioport(unsigned long base_port); | |||
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
22 | #include <asm/paca.h> | 22 | #include <asm/paca.h> |
23 | #ifdef CONFIG_PPC_ISERIES | ||
24 | #include <asm/iseries/iseries_io.h> | ||
25 | #endif | ||
26 | #include <asm/synch.h> | 23 | #include <asm/synch.h> |
27 | #include <asm/delay.h> | 24 | #include <asm/delay.h> |
28 | 25 | ||
29 | #include <asm-generic/iomap.h> | 26 | #include <asm-generic/iomap.h> |
30 | 27 | ||
31 | #define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c)) | ||
32 | #define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c)) | ||
33 | #define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c)) | ||
34 | #define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c)) | ||
35 | |||
36 | |||
37 | #define SIO_CONFIG_RA 0x398 | 28 | #define SIO_CONFIG_RA 0x398 |
38 | #define SIO_CONFIG_RD 0x399 | 29 | #define SIO_CONFIG_RD 0x399 |
39 | 30 | ||
@@ -43,42 +34,53 @@ extern unsigned long isa_io_base; | |||
43 | extern unsigned long pci_io_base; | 34 | extern unsigned long pci_io_base; |
44 | 35 | ||
45 | #ifdef CONFIG_PPC_ISERIES | 36 | #ifdef CONFIG_PPC_ISERIES |
46 | /* __raw_* accessors aren't supported on iSeries */ | 37 | |
47 | #define __raw_readb(addr) { BUG(); 0; } | 38 | extern int in_8(const volatile unsigned char __iomem *addr); |
48 | #define __raw_readw(addr) { BUG(); 0; } | 39 | extern void out_8(volatile unsigned char __iomem *addr, int val); |
49 | #define __raw_readl(addr) { BUG(); 0; } | 40 | extern int in_le16(const volatile unsigned short __iomem *addr); |
50 | #define __raw_readq(addr) { BUG(); 0; } | 41 | extern int in_be16(const volatile unsigned short __iomem *addr); |
51 | #define __raw_writeb(v, addr) { BUG(); 0; } | 42 | extern void out_le16(volatile unsigned short __iomem *addr, int val); |
52 | #define __raw_writew(v, addr) { BUG(); 0; } | 43 | extern void out_be16(volatile unsigned short __iomem *addr, int val); |
53 | #define __raw_writel(v, addr) { BUG(); 0; } | 44 | extern unsigned in_le32(const volatile unsigned __iomem *addr); |
54 | #define __raw_writeq(v, addr) { BUG(); 0; } | 45 | extern unsigned in_be32(const volatile unsigned __iomem *addr); |
55 | #define readb(addr) iSeries_Read_Byte(addr) | 46 | extern void out_le32(volatile unsigned __iomem *addr, int val); |
56 | #define readw(addr) iSeries_Read_Word(addr) | 47 | extern void out_be32(volatile unsigned __iomem *addr, int val); |
57 | #define readl(addr) iSeries_Read_Long(addr) | 48 | extern unsigned long in_le64(const volatile unsigned long __iomem *addr); |
58 | #define writeb(data, addr) iSeries_Write_Byte((data),(addr)) | 49 | extern unsigned long in_be64(const volatile unsigned long __iomem *addr); |
59 | #define writew(data, addr) iSeries_Write_Word((data),(addr)) | 50 | extern void out_le64(volatile unsigned long __iomem *addr, unsigned long val); |
60 | #define writel(data, addr) iSeries_Write_Long((data),(addr)) | 51 | extern void out_be64(volatile unsigned long __iomem *addr, unsigned long val); |
61 | #define memset_io(a,b,c) iSeries_memset_io((a),(b),(c)) | 52 | |
62 | #define memcpy_fromio(a,b,c) iSeries_memcpy_fromio((a), (b), (c)) | 53 | extern unsigned char __raw_readb(const volatile void __iomem *addr); |
63 | #define memcpy_toio(a,b,c) iSeries_memcpy_toio((a), (b), (c)) | 54 | extern unsigned short __raw_readw(const volatile void __iomem *addr); |
64 | 55 | extern unsigned int __raw_readl(const volatile void __iomem *addr); | |
65 | #define inb(addr) readb(((void __iomem *)(long)(addr))) | 56 | extern unsigned long __raw_readq(const volatile void __iomem *addr); |
66 | #define inw(addr) readw(((void __iomem *)(long)(addr))) | 57 | extern void __raw_writeb(unsigned char v, volatile void __iomem *addr); |
67 | #define inl(addr) readl(((void __iomem *)(long)(addr))) | 58 | extern void __raw_writew(unsigned short v, volatile void __iomem *addr); |
68 | #define outb(data,addr) writeb(data,((void __iomem *)(long)(addr))) | 59 | extern void __raw_writel(unsigned int v, volatile void __iomem *addr); |
69 | #define outw(data,addr) writew(data,((void __iomem *)(long)(addr))) | 60 | extern void __raw_writeq(unsigned long v, volatile void __iomem *addr); |
70 | #define outl(data,addr) writel(data,((void __iomem *)(long)(addr))) | 61 | |
71 | /* | 62 | extern void memset_io(volatile void __iomem *addr, int c, unsigned long n); |
72 | * The *_ns versions below don't do byte-swapping. | 63 | extern void memcpy_fromio(void *dest, const volatile void __iomem *src, |
73 | * Neither do the standard versions now, these are just here | 64 | unsigned long n); |
74 | * for older code. | 65 | extern void memcpy_toio(volatile void __iomem *dest, const void *src, |
75 | */ | 66 | unsigned long n); |
76 | #define insb(port, buf, ns) _insb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) | 67 | |
77 | #define insw(port, buf, ns) _insw_ns((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) | 68 | #else /* CONFIG_PPC_ISERIES */ |
78 | #define insl(port, buf, nl) _insl_ns((u8 __iomem *)((port)+pci_io_base), (buf), (nl)) | 69 | |
79 | #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) | 70 | #define in_8(addr) __in_8((addr)) |
80 | #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) | 71 | #define out_8(addr, val) __out_8((addr), (val)) |
81 | #else | 72 | #define in_le16(addr) __in_le16((addr)) |
73 | #define in_be16(addr) __in_be16((addr)) | ||
74 | #define out_le16(addr, val) __out_le16((addr), (val)) | ||
75 | #define out_be16(addr, val) __out_be16((addr), (val)) | ||
76 | #define in_le32(addr) __in_le32((addr)) | ||
77 | #define in_be32(addr) __in_be32((addr)) | ||
78 | #define out_le32(addr, val) __out_le32((addr), (val)) | ||
79 | #define out_be32(addr, val) __out_be32((addr), (val)) | ||
80 | #define in_le64(addr) __in_le64((addr)) | ||
81 | #define in_be64(addr) __in_be64((addr)) | ||
82 | #define out_le64(addr, val) __out_le64((addr), (val)) | ||
83 | #define out_be64(addr, val) __out_be64((addr), (val)) | ||
82 | 84 | ||
83 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) | 85 | static inline unsigned char __raw_readb(const volatile void __iomem *addr) |
84 | { | 86 | { |
@@ -112,23 +114,11 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) | |||
112 | { | 114 | { |
113 | *(volatile unsigned long __force *)addr = v; | 115 | *(volatile unsigned long __force *)addr = v; |
114 | } | 116 | } |
115 | #define readb(addr) eeh_readb(addr) | ||
116 | #define readw(addr) eeh_readw(addr) | ||
117 | #define readl(addr) eeh_readl(addr) | ||
118 | #define readq(addr) eeh_readq(addr) | ||
119 | #define writeb(data, addr) eeh_writeb((data), (addr)) | ||
120 | #define writew(data, addr) eeh_writew((data), (addr)) | ||
121 | #define writel(data, addr) eeh_writel((data), (addr)) | ||
122 | #define writeq(data, addr) eeh_writeq((data), (addr)) | ||
123 | #define memset_io(a,b,c) eeh_memset_io((a),(b),(c)) | 117 | #define memset_io(a,b,c) eeh_memset_io((a),(b),(c)) |
124 | #define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c)) | 118 | #define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c)) |
125 | #define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c)) | 119 | #define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c)) |
126 | #define inb(port) eeh_inb((unsigned long)port) | 120 | |
127 | #define outb(val, port) eeh_outb(val, (unsigned long)port) | 121 | #endif /* CONFIG_PPC_ISERIES */ |
128 | #define inw(port) eeh_inw((unsigned long)port) | ||
129 | #define outw(val, port) eeh_outw(val, (unsigned long)port) | ||
130 | #define inl(port) eeh_inl((unsigned long)port) | ||
131 | #define outl(val, port) eeh_outl(val, (unsigned long)port) | ||
132 | 122 | ||
133 | /* | 123 | /* |
134 | * The insw/outsw/insl/outsl macros don't do byte-swapping. | 124 | * The insw/outsw/insl/outsl macros don't do byte-swapping. |
@@ -138,30 +128,37 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) | |||
138 | #define insb(port, buf, ns) eeh_insb((port), (buf), (ns)) | 128 | #define insb(port, buf, ns) eeh_insb((port), (buf), (ns)) |
139 | #define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) | 129 | #define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) |
140 | #define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) | 130 | #define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) |
141 | #define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) | ||
142 | #define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) | ||
143 | |||
144 | #endif | ||
145 | 131 | ||
146 | #define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) | 132 | #define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) |
147 | #define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) | 133 | #define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) |
148 | #define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) | 134 | #define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) |
149 | 135 | ||
136 | #define readb(addr) eeh_readb(addr) | ||
137 | #define readw(addr) eeh_readw(addr) | ||
138 | #define readl(addr) eeh_readl(addr) | ||
139 | #define readq(addr) eeh_readq(addr) | ||
140 | #define writeb(data, addr) eeh_writeb((data), (addr)) | ||
141 | #define writew(data, addr) eeh_writew((data), (addr)) | ||
142 | #define writel(data, addr) eeh_writel((data), (addr)) | ||
143 | #define writeq(data, addr) eeh_writeq((data), (addr)) | ||
144 | #define inb(port) eeh_inb((unsigned long)port) | ||
145 | #define outb(val, port) eeh_outb(val, (unsigned long)port) | ||
146 | #define inw(port) eeh_inw((unsigned long)port) | ||
147 | #define outw(val, port) eeh_outw(val, (unsigned long)port) | ||
148 | #define inl(port) eeh_inl((unsigned long)port) | ||
149 | #define outl(val, port) eeh_outl(val, (unsigned long)port) | ||
150 | |||
150 | #define readb_relaxed(addr) readb(addr) | 151 | #define readb_relaxed(addr) readb(addr) |
151 | #define readw_relaxed(addr) readw(addr) | 152 | #define readw_relaxed(addr) readw(addr) |
152 | #define readl_relaxed(addr) readl(addr) | 153 | #define readl_relaxed(addr) readl(addr) |
153 | #define readq_relaxed(addr) readq(addr) | 154 | #define readq_relaxed(addr) readq(addr) |
154 | 155 | ||
155 | extern void _insb(volatile u8 __iomem *port, void *buf, int ns); | 156 | extern void _insb(volatile u8 __iomem *port, void *buf, long count); |
156 | extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns); | 157 | extern void _outsb(volatile u8 __iomem *port, const void *buf, long count); |
157 | extern void _insw(volatile u16 __iomem *port, void *buf, int ns); | 158 | extern void _insw_ns(volatile u16 __iomem *port, void *buf, long count); |
158 | extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns); | 159 | extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count); |
159 | extern void _insl(volatile u32 __iomem *port, void *buf, int nl); | 160 | extern void _insl_ns(volatile u32 __iomem *port, void *buf, long count); |
160 | extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl); | 161 | extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count); |
161 | extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns); | ||
162 | extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns); | ||
163 | extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl); | ||
164 | extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); | ||
165 | 162 | ||
166 | static inline void mmiowb(void) | 163 | static inline void mmiowb(void) |
167 | { | 164 | { |
@@ -180,14 +177,6 @@ static inline void mmiowb(void) | |||
180 | #define inl_p(port) inl(port) | 177 | #define inl_p(port) inl(port) |
181 | #define outl_p(val, port) (udelay(1), outl((val), (port))) | 178 | #define outl_p(val, port) (udelay(1), outl((val), (port))) |
182 | 179 | ||
183 | /* | ||
184 | * The *_ns versions below don't do byte-swapping. | ||
185 | * Neither do the standard versions now, these are just here | ||
186 | * for older code. | ||
187 | */ | ||
188 | #define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) | ||
189 | #define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) | ||
190 | |||
191 | 180 | ||
192 | #define IO_SPACE_LIMIT ~(0UL) | 181 | #define IO_SPACE_LIMIT ~(0UL) |
193 | 182 | ||
@@ -279,7 +268,7 @@ static inline void iosync(void) | |||
279 | * and should not be used directly by device drivers. Use inb/readb | 268 | * and should not be used directly by device drivers. Use inb/readb |
280 | * instead. | 269 | * instead. |
281 | */ | 270 | */ |
282 | static inline int in_8(const volatile unsigned char __iomem *addr) | 271 | static inline int __in_8(const volatile unsigned char __iomem *addr) |
283 | { | 272 | { |
284 | int ret; | 273 | int ret; |
285 | 274 | ||
@@ -288,14 +277,14 @@ static inline int in_8(const volatile unsigned char __iomem *addr) | |||
288 | return ret; | 277 | return ret; |
289 | } | 278 | } |
290 | 279 | ||
291 | static inline void out_8(volatile unsigned char __iomem *addr, int val) | 280 | static inline void __out_8(volatile unsigned char __iomem *addr, int val) |
292 | { | 281 | { |
293 | __asm__ __volatile__("sync; stb%U0%X0 %1,%0" | 282 | __asm__ __volatile__("sync; stb%U0%X0 %1,%0" |
294 | : "=m" (*addr) : "r" (val)); | 283 | : "=m" (*addr) : "r" (val)); |
295 | get_paca()->io_sync = 1; | 284 | get_paca()->io_sync = 1; |
296 | } | 285 | } |
297 | 286 | ||
298 | static inline int in_le16(const volatile unsigned short __iomem *addr) | 287 | static inline int __in_le16(const volatile unsigned short __iomem *addr) |
299 | { | 288 | { |
300 | int ret; | 289 | int ret; |
301 | 290 | ||
@@ -304,7 +293,7 @@ static inline int in_le16(const volatile unsigned short __iomem *addr) | |||
304 | return ret; | 293 | return ret; |
305 | } | 294 | } |
306 | 295 | ||
307 | static inline int in_be16(const volatile unsigned short __iomem *addr) | 296 | static inline int __in_be16(const volatile unsigned short __iomem *addr) |
308 | { | 297 | { |
309 | int ret; | 298 | int ret; |
310 | 299 | ||
@@ -313,21 +302,21 @@ static inline int in_be16(const volatile unsigned short __iomem *addr) | |||
313 | return ret; | 302 | return ret; |
314 | } | 303 | } |
315 | 304 | ||
316 | static inline void out_le16(volatile unsigned short __iomem *addr, int val) | 305 | static inline void __out_le16(volatile unsigned short __iomem *addr, int val) |
317 | { | 306 | { |
318 | __asm__ __volatile__("sync; sthbrx %1,0,%2" | 307 | __asm__ __volatile__("sync; sthbrx %1,0,%2" |
319 | : "=m" (*addr) : "r" (val), "r" (addr)); | 308 | : "=m" (*addr) : "r" (val), "r" (addr)); |
320 | get_paca()->io_sync = 1; | 309 | get_paca()->io_sync = 1; |
321 | } | 310 | } |
322 | 311 | ||
323 | static inline void out_be16(volatile unsigned short __iomem *addr, int val) | 312 | static inline void __out_be16(volatile unsigned short __iomem *addr, int val) |
324 | { | 313 | { |
325 | __asm__ __volatile__("sync; sth%U0%X0 %1,%0" | 314 | __asm__ __volatile__("sync; sth%U0%X0 %1,%0" |
326 | : "=m" (*addr) : "r" (val)); | 315 | : "=m" (*addr) : "r" (val)); |
327 | get_paca()->io_sync = 1; | 316 | get_paca()->io_sync = 1; |
328 | } | 317 | } |
329 | 318 | ||
330 | static inline unsigned in_le32(const volatile unsigned __iomem *addr) | 319 | static inline unsigned __in_le32(const volatile unsigned __iomem *addr) |
331 | { | 320 | { |
332 | unsigned ret; | 321 | unsigned ret; |
333 | 322 | ||
@@ -336,7 +325,7 @@ static inline unsigned in_le32(const volatile unsigned __iomem *addr) | |||
336 | return ret; | 325 | return ret; |
337 | } | 326 | } |
338 | 327 | ||
339 | static inline unsigned in_be32(const volatile unsigned __iomem *addr) | 328 | static inline unsigned __in_be32(const volatile unsigned __iomem *addr) |
340 | { | 329 | { |
341 | unsigned ret; | 330 | unsigned ret; |
342 | 331 | ||
@@ -345,21 +334,21 @@ static inline unsigned in_be32(const volatile unsigned __iomem *addr) | |||
345 | return ret; | 334 | return ret; |
346 | } | 335 | } |
347 | 336 | ||
348 | static inline void out_le32(volatile unsigned __iomem *addr, int val) | 337 | static inline void __out_le32(volatile unsigned __iomem *addr, int val) |
349 | { | 338 | { |
350 | __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr) | 339 | __asm__ __volatile__("sync; stwbrx %1,0,%2" : "=m" (*addr) |
351 | : "r" (val), "r" (addr)); | 340 | : "r" (val), "r" (addr)); |
352 | get_paca()->io_sync = 1; | 341 | get_paca()->io_sync = 1; |
353 | } | 342 | } |
354 | 343 | ||
355 | static inline void out_be32(volatile unsigned __iomem *addr, int val) | 344 | static inline void __out_be32(volatile unsigned __iomem *addr, int val) |
356 | { | 345 | { |
357 | __asm__ __volatile__("sync; stw%U0%X0 %1,%0" | 346 | __asm__ __volatile__("sync; stw%U0%X0 %1,%0" |
358 | : "=m" (*addr) : "r" (val)); | 347 | : "=m" (*addr) : "r" (val)); |
359 | get_paca()->io_sync = 1; | 348 | get_paca()->io_sync = 1; |
360 | } | 349 | } |
361 | 350 | ||
362 | static inline unsigned long in_le64(const volatile unsigned long __iomem *addr) | 351 | static inline unsigned long __in_le64(const volatile unsigned long __iomem *addr) |
363 | { | 352 | { |
364 | unsigned long tmp, ret; | 353 | unsigned long tmp, ret; |
365 | 354 | ||
@@ -379,7 +368,7 @@ static inline unsigned long in_le64(const volatile unsigned long __iomem *addr) | |||
379 | return ret; | 368 | return ret; |
380 | } | 369 | } |
381 | 370 | ||
382 | static inline unsigned long in_be64(const volatile unsigned long __iomem *addr) | 371 | static inline unsigned long __in_be64(const volatile unsigned long __iomem *addr) |
383 | { | 372 | { |
384 | unsigned long ret; | 373 | unsigned long ret; |
385 | 374 | ||
@@ -388,7 +377,7 @@ static inline unsigned long in_be64(const volatile unsigned long __iomem *addr) | |||
388 | return ret; | 377 | return ret; |
389 | } | 378 | } |
390 | 379 | ||
391 | static inline void out_le64(volatile unsigned long __iomem *addr, unsigned long val) | 380 | static inline void __out_le64(volatile unsigned long __iomem *addr, unsigned long val) |
392 | { | 381 | { |
393 | unsigned long tmp; | 382 | unsigned long tmp; |
394 | 383 | ||
@@ -406,15 +395,13 @@ static inline void out_le64(volatile unsigned long __iomem *addr, unsigned long | |||
406 | get_paca()->io_sync = 1; | 395 | get_paca()->io_sync = 1; |
407 | } | 396 | } |
408 | 397 | ||
409 | static inline void out_be64(volatile unsigned long __iomem *addr, unsigned long val) | 398 | static inline void __out_be64(volatile unsigned long __iomem *addr, unsigned long val) |
410 | { | 399 | { |
411 | __asm__ __volatile__("sync; std%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); | 400 | __asm__ __volatile__("sync; std%U0%X0 %1,%0" : "=m" (*addr) : "r" (val)); |
412 | get_paca()->io_sync = 1; | 401 | get_paca()->io_sync = 1; |
413 | } | 402 | } |
414 | 403 | ||
415 | #ifndef CONFIG_PPC_ISERIES | ||
416 | #include <asm/eeh.h> | 404 | #include <asm/eeh.h> |
417 | #endif | ||
418 | 405 | ||
419 | /** | 406 | /** |
420 | * check_signature - find BIOS signatures | 407 | * check_signature - find BIOS signatures |
@@ -430,7 +417,6 @@ static inline int check_signature(const volatile void __iomem * io_addr, | |||
430 | const unsigned char *signature, int length) | 417 | const unsigned char *signature, int length) |
431 | { | 418 | { |
432 | int retval = 0; | 419 | int retval = 0; |
433 | #ifndef CONFIG_PPC_ISERIES | ||
434 | do { | 420 | do { |
435 | if (readb(io_addr) != *signature) | 421 | if (readb(io_addr) != *signature) |
436 | goto out; | 422 | goto out; |
@@ -440,7 +426,6 @@ static inline int check_signature(const volatile void __iomem * io_addr, | |||
440 | } while (length); | 426 | } while (length); |
441 | retval = 1; | 427 | retval = 1; |
442 | out: | 428 | out: |
443 | #endif | ||
444 | return retval; | 429 | return retval; |
445 | } | 430 | } |
446 | 431 | ||
diff --git a/include/asm-powerpc/iseries/iseries_io.h b/include/asm-powerpc/iseries/iseries_io.h deleted file mode 100644 index f29009bd63c9..000000000000 --- a/include/asm-powerpc/iseries/iseries_io.h +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | #ifndef _ASM_POWERPC_ISERIES_ISERIES_IO_H | ||
2 | #define _ASM_POWERPC_ISERIES_ISERIES_IO_H | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_PPC_ISERIES | ||
6 | #include <linux/types.h> | ||
7 | /* | ||
8 | * Created by Allan Trautman on Thu Dec 28 2000. | ||
9 | * | ||
10 | * Remaps the io.h for the iSeries Io | ||
11 | * Copyright (C) 2000 Allan H Trautman, IBM Corporation | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the: | ||
25 | * Free Software Foundation, Inc., | ||
26 | * 59 Temple Place, Suite 330, | ||
27 | * Boston, MA 02111-1307 USA | ||
28 | * | ||
29 | * Change Activity: | ||
30 | * Created December 28, 2000 | ||
31 | * End Change Activity | ||
32 | */ | ||
33 | |||
34 | #ifdef CONFIG_PCI | ||
35 | extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); | ||
36 | extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); | ||
37 | extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); | ||
38 | extern void iSeries_Write_Byte(u8 IoData, volatile void __iomem * IoAddress); | ||
39 | extern void iSeries_Write_Word(u16 IoData, volatile void __iomem * IoAddress); | ||
40 | extern void iSeries_Write_Long(u32 IoData, volatile void __iomem * IoAddress); | ||
41 | |||
42 | extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n); | ||
43 | extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, | ||
44 | size_t n); | ||
45 | extern void iSeries_memcpy_fromio(void *dest, | ||
46 | const volatile void __iomem *source, size_t n); | ||
47 | #else | ||
48 | static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress) | ||
49 | { | ||
50 | return 0xff; | ||
51 | } | ||
52 | |||
53 | static inline void iSeries_Write_Byte(u8 IoData, | ||
54 | volatile void __iomem *IoAddress) | ||
55 | { | ||
56 | } | ||
57 | #endif /* CONFIG_PCI */ | ||
58 | |||
59 | #endif /* CONFIG_PPC_ISERIES */ | ||
60 | #endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */ | ||
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h index fb597b37c2a2..b4d38b0b15f8 100644 --- a/include/asm-powerpc/page.h +++ b/include/asm-powerpc/page.h | |||
@@ -55,12 +55,6 @@ | |||
55 | #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) | 55 | #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) |
56 | #define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) | 56 | #define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) |
57 | 57 | ||
58 | #ifdef CONFIG_DISCONTIGMEM | ||
59 | #define page_to_pfn(page) discontigmem_page_to_pfn(page) | ||
60 | #define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn) | ||
61 | #define pfn_valid(pfn) discontigmem_pfn_valid(pfn) | ||
62 | #endif | ||
63 | |||
64 | #ifdef CONFIG_FLATMEM | 58 | #ifdef CONFIG_FLATMEM |
65 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 59 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
66 | #endif | 60 | #endif |
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h index cf79bc7ebb55..1115756c79f9 100644 --- a/include/asm-powerpc/ppc-pci.h +++ b/include/asm-powerpc/ppc-pci.h | |||
@@ -69,6 +69,17 @@ struct pci_dev *pci_get_device_by_addr(unsigned long addr); | |||
69 | void eeh_slot_error_detail (struct pci_dn *pdn, int severity); | 69 | void eeh_slot_error_detail (struct pci_dn *pdn, int severity); |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * rtas_pci_enableo - enable IO transfers for this slot | ||
73 | * @pdn: pci device node | ||
74 | * @function: either EEH_THAW_MMIO or EEH_THAW_DMA | ||
75 | * | ||
76 | * Enable I/O transfers to this slot | ||
77 | */ | ||
78 | #define EEH_THAW_MMIO 2 | ||
79 | #define EEH_THAW_DMA 3 | ||
80 | int rtas_pci_enable(struct pci_dn *pdn, int function); | ||
81 | |||
82 | /** | ||
72 | * rtas_set_slot_reset -- unfreeze a frozen slot | 83 | * rtas_set_slot_reset -- unfreeze a frozen slot |
73 | * | 84 | * |
74 | * Clear the EEH-frozen condition on a slot. This routine | 85 | * Clear the EEH-frozen condition on a slot. This routine |
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index c15e66a2e681..524629769336 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -197,7 +197,7 @@ extern int release_OF_resource(struct device_node* node, int index); | |||
197 | */ | 197 | */ |
198 | 198 | ||
199 | 199 | ||
200 | /* Helper to read a big number */ | 200 | /* Helper to read a big number; size is in cells (not bytes) */ |
201 | static inline u64 of_read_number(const u32 *cell, int size) | 201 | static inline u64 of_read_number(const u32 *cell, int size) |
202 | { | 202 | { |
203 | u64 r = 0; | 203 | u64 r = 0; |
@@ -206,6 +206,16 @@ static inline u64 of_read_number(const u32 *cell, int size) | |||
206 | return r; | 206 | return r; |
207 | } | 207 | } |
208 | 208 | ||
209 | /* Like of_read_number, but we want an unsigned long result */ | ||
210 | #ifdef CONFIG_PPC32 | ||
211 | static inline unsigned long of_read_ulong(const u32 *cell, int size) | ||
212 | { | ||
213 | return cell[size-1]; | ||
214 | } | ||
215 | #else | ||
216 | #define of_read_ulong(cell, size) of_read_number(cell, size) | ||
217 | #endif | ||
218 | |||
209 | /* Translate an OF address block into a CPU physical address | 219 | /* Translate an OF address block into a CPU physical address |
210 | */ | 220 | */ |
211 | #define OF_BAD_ADDR ((u64)-1) | 221 | #define OF_BAD_ADDR ((u64)-1) |
diff --git a/include/asm-powerpc/ptrace.h b/include/asm-powerpc/ptrace.h index dc4cb9cc73a1..4435efe85d0e 100644 --- a/include/asm-powerpc/ptrace.h +++ b/include/asm-powerpc/ptrace.h | |||
@@ -215,12 +215,10 @@ do { \ | |||
215 | #define PTRACE_GETVRREGS 18 | 215 | #define PTRACE_GETVRREGS 18 |
216 | #define PTRACE_SETVRREGS 19 | 216 | #define PTRACE_SETVRREGS 19 |
217 | 217 | ||
218 | #ifndef __powerpc64__ | ||
219 | /* Get/set all the upper 32-bits of the SPE registers, accumulator, and | 218 | /* Get/set all the upper 32-bits of the SPE registers, accumulator, and |
220 | * spefscr, in one go */ | 219 | * spefscr, in one go */ |
221 | #define PTRACE_GETEVRREGS 20 | 220 | #define PTRACE_GETEVRREGS 20 |
222 | #define PTRACE_SETEVRREGS 21 | 221 | #define PTRACE_SETEVRREGS 21 |
223 | #endif /* __powerpc64__ */ | ||
224 | 222 | ||
225 | /* | 223 | /* |
226 | * Get or set a debug register. The first 16 are DABR registers and the | 224 | * Get or set a debug register. The first 16 are DABR registers and the |
@@ -235,7 +233,6 @@ do { \ | |||
235 | #define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ | 233 | #define PPC_PTRACE_GETFPREGS 0x97 /* Get FPRs 0 - 31 */ |
236 | #define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */ | 234 | #define PPC_PTRACE_SETFPREGS 0x96 /* Set FPRs 0 - 31 */ |
237 | 235 | ||
238 | #ifdef __powerpc64__ | ||
239 | /* Calls to trace a 64bit program from a 32bit program */ | 236 | /* Calls to trace a 64bit program from a 32bit program */ |
240 | #define PPC_PTRACE_PEEKTEXT_3264 0x95 | 237 | #define PPC_PTRACE_PEEKTEXT_3264 0x95 |
241 | #define PPC_PTRACE_PEEKDATA_3264 0x94 | 238 | #define PPC_PTRACE_PEEKDATA_3264 0x94 |
@@ -243,6 +240,5 @@ do { \ | |||
243 | #define PPC_PTRACE_POKEDATA_3264 0x92 | 240 | #define PPC_PTRACE_POKEDATA_3264 0x92 |
244 | #define PPC_PTRACE_PEEKUSR_3264 0x91 | 241 | #define PPC_PTRACE_PEEKUSR_3264 0x91 |
245 | #define PPC_PTRACE_POKEUSR_3264 0x90 | 242 | #define PPC_PTRACE_POKEUSR_3264 0x90 |
246 | #endif /* __powerpc64__ */ | ||
247 | 243 | ||
248 | #endif /* _ASM_POWERPC_PTRACE_H */ | 244 | #endif /* _ASM_POWERPC_PTRACE_H */ |