pci.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /* MN10300 PCI definitions
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_PCI_H
  12. #define _ASM_PCI_H
  13. #ifdef __KERNEL__
  14. #include <linux/mm.h> /* for struct page */
  15. #if 0
  16. #define __pcbdebug(FMT, ADDR, ...) \
  17. printk(KERN_DEBUG "PCIBRIDGE[%08x]: "FMT"\n", \
  18. (u32)(ADDR), ##__VA_ARGS__)
  19. #define __pcidebug(FMT, BUS, DEVFN, WHERE,...) \
  20. do { \
  21. printk(KERN_DEBUG "PCI[%02x:%02x.%x + %02x]: "FMT"\n", \
  22. (BUS)->number, \
  23. PCI_SLOT(DEVFN), \
  24. PCI_FUNC(DEVFN), \
  25. (u32)(WHERE), ##__VA_ARGS__); \
  26. } while (0)
  27. #else
  28. #define __pcbdebug(FMT, ADDR, ...) do {} while (0)
  29. #define __pcidebug(FMT, BUS, DEVFN, WHERE, ...) do {} while (0)
  30. #endif
  31. /* Can be used to override the logic in pci_scan_bus for skipping
  32. * already-configured bus numbers - to be used for buggy BIOSes or
  33. * architectures with incomplete PCI setup by the loader */
  34. #ifdef CONFIG_PCI
  35. #define pcibios_assign_all_busses() 1
  36. extern void unit_pci_init(void);
  37. #else
  38. #define pcibios_assign_all_busses() 0
  39. #endif
  40. extern unsigned long pci_mem_start;
  41. #define PCIBIOS_MIN_IO 0xBE000004
  42. #define PCIBIOS_MIN_MEM 0xB8000000
  43. void pcibios_set_master(struct pci_dev *dev);
  44. void pcibios_penalize_isa_irq(int irq);
  45. /* Dynamic DMA mapping stuff.
  46. * i386 has everything mapped statically.
  47. */
  48. #include <linux/types.h>
  49. #include <linux/slab.h>
  50. #include <asm/scatterlist.h>
  51. #include <linux/string.h>
  52. #include <linux/mm.h>
  53. #include <asm/io.h>
  54. struct pci_dev;
  55. /* The PCI address space does equal the physical memory
  56. * address space. The networking and block device layers use
  57. * this boolean for bounce buffer decisions.
  58. */
  59. #define PCI_DMA_BUS_IS_PHYS (1)
  60. /* This is always fine. */
  61. #define pci_dac_dma_supported(pci_dev, mask) (0)
  62. /* Return the index of the PCI controller for device. */
  63. static inline int pci_controller_num(struct pci_dev *dev)
  64. {
  65. return 0;
  66. }
  67. #define HAVE_PCI_MMAP
  68. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  69. enum pci_mmap_state mmap_state,
  70. int write_combine);
  71. #endif /* __KERNEL__ */
  72. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  73. #include <asm-generic/pci-dma-compat.h>
  74. /**
  75. * pcibios_resource_to_bus - convert resource to PCI bus address
  76. * @dev: device which owns this resource
  77. * @region: converted bus-centric region (start,end)
  78. * @res: resource to convert
  79. *
  80. * Convert a resource to a PCI device bus address or bus window.
  81. */
  82. extern void pcibios_resource_to_bus(struct pci_dev *dev,
  83. struct pci_bus_region *region,
  84. struct resource *res);
  85. extern void pcibios_bus_to_resource(struct pci_dev *dev,
  86. struct resource *res,
  87. struct pci_bus_region *region);
  88. static inline struct resource *
  89. pcibios_select_root(struct pci_dev *pdev, struct resource *res)
  90. {
  91. struct resource *root = NULL;
  92. if (res->flags & IORESOURCE_IO)
  93. root = &ioport_resource;
  94. if (res->flags & IORESOURCE_MEM)
  95. root = &iomem_resource;
  96. return root;
  97. }
  98. #define pcibios_scan_all_fns(a, b) 0
  99. #endif /* _ASM_PCI_H */