diff options
Diffstat (limited to 'include/asm-ppc/io.h')
-rw-r--r-- | include/asm-ppc/io.h | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index f776c49f5579..8f58231a8bc6 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <asm/mpc8xx.h> | 30 | #include <asm/mpc8xx.h> |
31 | #elif defined(CONFIG_8260) | 31 | #elif defined(CONFIG_8260) |
32 | #include <asm/mpc8260.h> | 32 | #include <asm/mpc8260.h> |
33 | #elif defined(CONFIG_APUS) || !defined(CONFIG_PCI) | 33 | #elif !defined(CONFIG_PCI) |
34 | #define _IO_BASE 0 | 34 | #define _IO_BASE 0 |
35 | #define _ISA_MEM_BASE 0 | 35 | #define _ISA_MEM_BASE 0 |
36 | #define PCI_DRAM_OFFSET 0 | 36 | #define PCI_DRAM_OFFSET 0 |
@@ -145,24 +145,7 @@ static inline void writeb(__u8 b, volatile void __iomem *addr) | |||
145 | } | 145 | } |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | #if defined(CONFIG_APUS) | 148 | #if defined (CONFIG_8260_PCI9) |
149 | static inline __u16 readw(const volatile void __iomem *addr) | ||
150 | { | ||
151 | return *(__force volatile __u16 *)(addr); | ||
152 | } | ||
153 | static inline __u32 readl(const volatile void __iomem *addr) | ||
154 | { | ||
155 | return *(__force volatile __u32 *)(addr); | ||
156 | } | ||
157 | static inline void writew(__u16 b, volatile void __iomem *addr) | ||
158 | { | ||
159 | *(__force volatile __u16 *)(addr) = b; | ||
160 | } | ||
161 | static inline void writel(__u32 b, volatile void __iomem *addr) | ||
162 | { | ||
163 | *(__force volatile __u32 *)(addr) = b; | ||
164 | } | ||
165 | #elif defined (CONFIG_8260_PCI9) | ||
166 | /* Use macros if PCI9 workaround enabled */ | 149 | /* Use macros if PCI9 workaround enabled */ |
167 | #define readw(addr) in_le16((volatile u16 *)(addr)) | 150 | #define readw(addr) in_le16((volatile u16 *)(addr)) |
168 | #define readl(addr) in_le32((volatile u32 *)(addr)) | 151 | #define readl(addr) in_le32((volatile u32 *)(addr)) |
@@ -185,7 +168,7 @@ static inline void writel(__u32 b, volatile void __iomem *addr) | |||
185 | { | 168 | { |
186 | out_le32(addr, b); | 169 | out_le32(addr, b); |
187 | } | 170 | } |
188 | #endif /* CONFIG_APUS */ | 171 | #endif /* CONFIG_8260_PCI9 */ |
189 | 172 | ||
190 | #define readb_relaxed(addr) readb(addr) | 173 | #define readb_relaxed(addr) readb(addr) |
191 | #define readw_relaxed(addr) readw(addr) | 174 | #define readw_relaxed(addr) readw(addr) |
@@ -300,13 +283,7 @@ extern __inline__ void name(unsigned int val, unsigned int port) \ | |||
300 | } | 283 | } |
301 | 284 | ||
302 | __do_out_asm(outb, "stbx") | 285 | __do_out_asm(outb, "stbx") |
303 | #ifdef CONFIG_APUS | 286 | #if defined (CONFIG_8260_PCI9) |
304 | __do_in_asm(inb, "lbzx") | ||
305 | __do_in_asm(inw, "lhz%U1%X1") | ||
306 | __do_in_asm(inl, "lwz%U1%X1") | ||
307 | __do_out_asm(outl,"stw%U0%X0") | ||
308 | __do_out_asm(outw, "sth%U0%X0") | ||
309 | #elif defined (CONFIG_8260_PCI9) | ||
310 | /* in asm cannot be defined if PCI9 workaround is used */ | 287 | /* in asm cannot be defined if PCI9 workaround is used */ |
311 | #define inb(port) in_8((port)+___IO_BASE) | 288 | #define inb(port) in_8((port)+___IO_BASE) |
312 | #define inw(port) in_le16((port)+___IO_BASE) | 289 | #define inw(port) in_le16((port)+___IO_BASE) |
@@ -371,7 +348,6 @@ extern void __iomem *ioremap64(unsigned long long address, unsigned long size); | |||
371 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) | 348 | #define ioremap_nocache(addr, size) ioremap((addr), (size)) |
372 | extern void iounmap(volatile void __iomem *addr); | 349 | extern void iounmap(volatile void __iomem *addr); |
373 | extern unsigned long iopa(unsigned long addr); | 350 | extern unsigned long iopa(unsigned long addr); |
374 | extern unsigned long mm_ptov(unsigned long addr) __attribute_const__; | ||
375 | extern void io_block_mapping(unsigned long virt, phys_addr_t phys, | 351 | extern void io_block_mapping(unsigned long virt, phys_addr_t phys, |
376 | unsigned int size, int flags); | 352 | unsigned int size, int flags); |
377 | 353 | ||
@@ -384,24 +360,16 @@ extern void io_block_mapping(unsigned long virt, phys_addr_t phys, | |||
384 | */ | 360 | */ |
385 | extern inline unsigned long virt_to_bus(volatile void * address) | 361 | extern inline unsigned long virt_to_bus(volatile void * address) |
386 | { | 362 | { |
387 | #ifndef CONFIG_APUS | ||
388 | if (address == (void *)0) | 363 | if (address == (void *)0) |
389 | return 0; | 364 | return 0; |
390 | return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET; | 365 | return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET; |
391 | #else | ||
392 | return iopa ((unsigned long) address); | ||
393 | #endif | ||
394 | } | 366 | } |
395 | 367 | ||
396 | extern inline void * bus_to_virt(unsigned long address) | 368 | extern inline void * bus_to_virt(unsigned long address) |
397 | { | 369 | { |
398 | #ifndef CONFIG_APUS | ||
399 | if (address == 0) | 370 | if (address == 0) |
400 | return NULL; | 371 | return NULL; |
401 | return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE); | 372 | return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE); |
402 | #else | ||
403 | return (void*) mm_ptov (address); | ||
404 | #endif | ||
405 | } | 373 | } |
406 | 374 | ||
407 | /* | 375 | /* |
@@ -410,20 +378,12 @@ extern inline void * bus_to_virt(unsigned long address) | |||
410 | */ | 378 | */ |
411 | extern inline unsigned long virt_to_phys(volatile void * address) | 379 | extern inline unsigned long virt_to_phys(volatile void * address) |
412 | { | 380 | { |
413 | #ifndef CONFIG_APUS | ||
414 | return (unsigned long) address - KERNELBASE; | 381 | return (unsigned long) address - KERNELBASE; |
415 | #else | ||
416 | return iopa ((unsigned long) address); | ||
417 | #endif | ||
418 | } | 382 | } |
419 | 383 | ||
420 | extern inline void * phys_to_virt(unsigned long address) | 384 | extern inline void * phys_to_virt(unsigned long address) |
421 | { | 385 | { |
422 | #ifndef CONFIG_APUS | ||
423 | return (void *) (address + KERNELBASE); | 386 | return (void *) (address + KERNELBASE); |
424 | #else | ||
425 | return (void*) mm_ptov (address); | ||
426 | #endif | ||
427 | } | 387 | } |
428 | 388 | ||
429 | /* | 389 | /* |