io.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * S390 version
  4. * Copyright IBM Corp. 1999
  5. * Author(s): Martin Schwidefsky ([email protected])
  6. *
  7. * Derived from "include/asm-i386/io.h"
  8. */
  9. #ifndef _S390_IO_H
  10. #define _S390_IO_H
  11. #include <linux/kernel.h>
  12. #include <asm/page.h>
  13. #include <asm/pgtable.h>
  14. #include <asm/pci_io.h>
  15. #define xlate_dev_mem_ptr xlate_dev_mem_ptr
  16. void *xlate_dev_mem_ptr(phys_addr_t phys);
  17. #define unxlate_dev_mem_ptr unxlate_dev_mem_ptr
  18. void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);
  19. #define IO_SPACE_LIMIT 0
  20. void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
  21. void __iomem *ioremap(phys_addr_t addr, size_t size);
  22. void __iomem *ioremap_wc(phys_addr_t addr, size_t size);
  23. void __iomem *ioremap_wt(phys_addr_t addr, size_t size);
  24. void iounmap(volatile void __iomem *addr);
  25. static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
  26. {
  27. return NULL;
  28. }
  29. static inline void ioport_unmap(void __iomem *p)
  30. {
  31. }
  32. #ifdef CONFIG_PCI
  33. /*
  34. * s390 needs a private implementation of pci_iomap since ioremap with its
  35. * offset parameter isn't sufficient. That's because BAR spaces are not
  36. * disjunctive on s390 so we need the bar parameter of pci_iomap to find
  37. * the corresponding device and create the mapping cookie.
  38. */
  39. #define pci_iomap pci_iomap
  40. #define pci_iomap_range pci_iomap_range
  41. #define pci_iounmap pci_iounmap
  42. #define pci_iomap_wc pci_iomap_wc
  43. #define pci_iomap_wc_range pci_iomap_wc_range
  44. #define ioremap ioremap
  45. #define ioremap_wt ioremap_wt
  46. #define ioremap_wc ioremap_wc
  47. #define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
  48. #define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
  49. #define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
  50. #define mmiowb() zpci_barrier()
  51. #define __raw_readb zpci_read_u8
  52. #define __raw_readw zpci_read_u16
  53. #define __raw_readl zpci_read_u32
  54. #define __raw_readq zpci_read_u64
  55. #define __raw_writeb zpci_write_u8
  56. #define __raw_writew zpci_write_u16
  57. #define __raw_writel zpci_write_u32
  58. #define __raw_writeq zpci_write_u64
  59. #endif /* CONFIG_PCI */
  60. #include <asm-generic/io.h>
  61. #endif