pci.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #ifndef __ASM_SH64_PCI_H
  2. #define __ASM_SH64_PCI_H
  3. #ifdef __KERNEL__
  4. #include <linux/dma-mapping.h>
  5. /* Can be used to override the logic in pci_scan_bus for skipping
  6. already-configured bus numbers - to be used for buggy BIOSes
  7. or architectures with incomplete PCI setup by the loader */
  8. #define pcibios_assign_all_busses() 1
  9. /*
  10. * These are currently the correct values for the STM overdrive board
  11. * We need some way of setting this on a board specific way, it will
  12. * not be the same on other boards I think
  13. */
  14. #if defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
  15. #define PCIBIOS_MIN_IO 0x2000
  16. #define PCIBIOS_MIN_MEM 0x40000000
  17. #endif
  18. extern void pcibios_set_master(struct pci_dev *dev);
  19. /*
  20. * Set penalize isa irq function
  21. */
  22. static inline void pcibios_penalize_isa_irq(int irq, int active)
  23. {
  24. /* We don't do dynamic PCI IRQ allocation */
  25. }
  26. /* Dynamic DMA mapping stuff.
  27. * SuperH has everything mapped statically like x86.
  28. */
  29. /* The PCI address space does equal the physical memory
  30. * address space. The networking and block device layers use
  31. * this boolean for bounce buffer decisions.
  32. */
  33. #define PCI_DMA_BUS_IS_PHYS (1)
  34. #include <linux/types.h>
  35. #include <linux/slab.h>
  36. #include <asm/scatterlist.h>
  37. #include <linux/string.h>
  38. #include <asm/io.h>
  39. /* pci_unmap_{single,page} being a nop depends upon the
  40. * configuration.
  41. */
  42. #ifdef CONFIG_SH_PCIDMA_NONCOHERENT
  43. #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
  44. dma_addr_t ADDR_NAME;
  45. #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
  46. __u32 LEN_NAME;
  47. #define pci_unmap_addr(PTR, ADDR_NAME) \
  48. ((PTR)->ADDR_NAME)
  49. #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
  50. (((PTR)->ADDR_NAME) = (VAL))
  51. #define pci_unmap_len(PTR, LEN_NAME) \
  52. ((PTR)->LEN_NAME)
  53. #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
  54. (((PTR)->LEN_NAME) = (VAL))
  55. #else
  56. #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
  57. #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
  58. #define pci_unmap_addr(PTR, ADDR_NAME) (0)
  59. #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
  60. #define pci_unmap_len(PTR, LEN_NAME) (0)
  61. #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
  62. #endif
  63. #ifdef CONFIG_PCI
  64. static inline void pci_dma_burst_advice(struct pci_dev *pdev,
  65. enum pci_dma_burst_strategy *strat,
  66. unsigned long *strategy_parameter)
  67. {
  68. *strat = PCI_DMA_BURST_INFINITY;
  69. *strategy_parameter = ~0UL;
  70. }
  71. #endif
  72. /* Board-specific fixup routines. */
  73. extern void pcibios_fixup(void);
  74. extern void pcibios_fixup_irqs(void);
  75. #ifdef CONFIG_PCI_AUTO
  76. extern int pciauto_assign_resources(int busno, struct pci_channel *hose);
  77. #endif
  78. #endif /* __KERNEL__ */
  79. /* generic pci stuff */
  80. #include <asm-generic/pci.h>
  81. /* generic DMA-mapping stuff */
  82. #include <asm-generic/pci-dma-compat.h>
  83. #endif /* __ASM_SH64_PCI_H */