pci.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 <asm/io.h>
  53. struct pci_dev;
  54. /* The PCI address space does equal the physical memory
  55. * address space. The networking and block device layers use
  56. * this boolean for bounce buffer decisions.
  57. */
  58. #define PCI_DMA_BUS_IS_PHYS (1)
  59. /* Return the index of the PCI controller for device. */
  60. static inline int pci_controller_num(struct pci_dev *dev)
  61. {
  62. return 0;
  63. }
  64. #define HAVE_PCI_MMAP
  65. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  66. enum pci_mmap_state mmap_state,
  67. int write_combine);
  68. #endif /* __KERNEL__ */
  69. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  70. #include <asm-generic/pci-dma-compat.h>
  71. static inline struct resource *
  72. pcibios_select_root(struct pci_dev *pdev, struct resource *res)
  73. {
  74. struct resource *root = NULL;
  75. if (res->flags & IORESOURCE_IO)
  76. root = &ioport_resource;
  77. if (res->flags & IORESOURCE_MEM)
  78. root = &iomem_resource;
  79. return root;
  80. }
  81. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  82. {
  83. return channel ? 15 : 14;
  84. }
  85. #endif /* _ASM_PCI_H */