diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2012-11-29 06:50:30 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-11-30 09:40:45 -0500 |
commit | cd24834130ac655d15accee6757e0eaeab4ad4ef (patch) | |
tree | 33be1efb537d6a08557a488f096c22516da0b3c2 /include/asm-generic | |
parent | d07dc5d8ab6f15353c866e2768c389abdc1faba6 (diff) |
s390/pci: base support
Add PCI support for s390, (only 64 bit mode is supported by hardware):
- PCI facility tests
- PCI instructions: pcilg, pcistg, pcistb, stpcifc, mpcifc, rpcit
- map readb/w/l/q and writeb/w/l/q to pcilg and pcistg instructions
- pci_iomap implementation
- memcpy_fromio/toio
- pci_root_ops using special pcilg/pcistg
- device, bus and domain allocation
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/io.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 448303bdb85f..9e0ebe051243 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -83,19 +83,25 @@ static inline void __raw_writel(u32 b, volatile void __iomem *addr) | |||
83 | #define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr) | 83 | #define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr) |
84 | 84 | ||
85 | #ifdef CONFIG_64BIT | 85 | #ifdef CONFIG_64BIT |
86 | #ifndef __raw_readq | ||
86 | static inline u64 __raw_readq(const volatile void __iomem *addr) | 87 | static inline u64 __raw_readq(const volatile void __iomem *addr) |
87 | { | 88 | { |
88 | return *(const volatile u64 __force *) addr; | 89 | return *(const volatile u64 __force *) addr; |
89 | } | 90 | } |
91 | #endif | ||
92 | |||
90 | #define readq(addr) __le64_to_cpu(__raw_readq(addr)) | 93 | #define readq(addr) __le64_to_cpu(__raw_readq(addr)) |
91 | 94 | ||
95 | #ifndef __raw_writeq | ||
92 | static inline void __raw_writeq(u64 b, volatile void __iomem *addr) | 96 | static inline void __raw_writeq(u64 b, volatile void __iomem *addr) |
93 | { | 97 | { |
94 | *(volatile u64 __force *) addr = b; | 98 | *(volatile u64 __force *) addr = b; |
95 | } | 99 | } |
96 | #define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr) | ||
97 | #endif | 100 | #endif |
98 | 101 | ||
102 | #define writeq(b, addr) __raw_writeq(__cpu_to_le64(b), addr) | ||
103 | #endif /* CONFIG_64BIT */ | ||
104 | |||
99 | #ifndef PCI_IOBASE | 105 | #ifndef PCI_IOBASE |
100 | #define PCI_IOBASE ((void __iomem *) 0) | 106 | #define PCI_IOBASE ((void __iomem *) 0) |
101 | #endif | 107 | #endif |
@@ -286,15 +292,20 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) | |||
286 | 292 | ||
287 | #ifndef CONFIG_GENERIC_IOMAP | 293 | #ifndef CONFIG_GENERIC_IOMAP |
288 | struct pci_dev; | 294 | struct pci_dev; |
295 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
296 | |||
297 | #ifndef pci_iounmap | ||
289 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) | 298 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) |
290 | { | 299 | { |
291 | } | 300 | } |
301 | #endif | ||
292 | #endif /* CONFIG_GENERIC_IOMAP */ | 302 | #endif /* CONFIG_GENERIC_IOMAP */ |
293 | 303 | ||
294 | /* | 304 | /* |
295 | * Change virtual addresses to physical addresses and vv. | 305 | * Change virtual addresses to physical addresses and vv. |
296 | * These are pretty trivial | 306 | * These are pretty trivial |
297 | */ | 307 | */ |
308 | #ifndef virt_to_phys | ||
298 | static inline unsigned long virt_to_phys(volatile void *address) | 309 | static inline unsigned long virt_to_phys(volatile void *address) |
299 | { | 310 | { |
300 | return __pa((unsigned long)address); | 311 | return __pa((unsigned long)address); |
@@ -304,6 +315,7 @@ static inline void *phys_to_virt(unsigned long address) | |||
304 | { | 315 | { |
305 | return __va(address); | 316 | return __va(address); |
306 | } | 317 | } |
318 | #endif | ||
307 | 319 | ||
308 | /* | 320 | /* |
309 | * Change "struct page" to physical address. | 321 | * Change "struct page" to physical address. |
@@ -363,9 +375,16 @@ static inline void *bus_to_virt(unsigned long address) | |||
363 | } | 375 | } |
364 | #endif | 376 | #endif |
365 | 377 | ||
378 | #ifndef memset_io | ||
366 | #define memset_io(a, b, c) memset(__io_virt(a), (b), (c)) | 379 | #define memset_io(a, b, c) memset(__io_virt(a), (b), (c)) |
380 | #endif | ||
381 | |||
382 | #ifndef memcpy_fromio | ||
367 | #define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c)) | 383 | #define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c)) |
384 | #endif | ||
385 | #ifndef memcpy_toio | ||
368 | #define memcpy_toio(a, b, c) memcpy(__io_virt(a), (b), (c)) | 386 | #define memcpy_toio(a, b, c) memcpy(__io_virt(a), (b), (c)) |
387 | #endif | ||
369 | 388 | ||
370 | #endif /* __KERNEL__ */ | 389 | #endif /* __KERNEL__ */ |
371 | 390 | ||