pci.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version
  5. * 2 of the License, or (at your option) any later version.
  6. *
  7. * Based on powerpc version
  8. */
  9. #ifndef __ASM_MICROBLAZE_PCI_H
  10. #define __ASM_MICROBLAZE_PCI_H
  11. #ifdef __KERNEL__
  12. #include <linux/types.h>
  13. #include <linux/slab.h>
  14. #include <linux/string.h>
  15. #include <linux/dma-mapping.h>
  16. #include <linux/pci.h>
  17. #include <asm/scatterlist.h>
  18. #include <asm/io.h>
  19. #include <asm/prom.h>
  20. #include <asm/pci-bridge.h>
  21. #include <asm-generic/pci-dma-compat.h>
  22. #define PCIBIOS_MIN_IO 0x1000
  23. #define PCIBIOS_MIN_MEM 0x10000000
  24. struct pci_dev;
  25. /* Values for the `which' argument to sys_pciconfig_iobase syscall. */
  26. #define IOBASE_BRIDGE_NUMBER 0
  27. #define IOBASE_MEMORY 1
  28. #define IOBASE_IO 2
  29. #define IOBASE_ISA_IO 3
  30. #define IOBASE_ISA_MEM 4
  31. #define pcibios_scan_all_fns(a, b) 0
  32. /*
  33. * Set this to 1 if you want the kernel to re-assign all PCI
  34. * bus numbers (don't do that on ppc64 yet !)
  35. */
  36. #define pcibios_assign_all_busses() 0
  37. extern int pci_domain_nr(struct pci_bus *bus);
  38. /* Decide whether to display the domain number in /proc */
  39. extern int pci_proc_domain(struct pci_bus *bus);
  40. struct vm_area_struct;
  41. /* Map a range of PCI memory or I/O space for a device into user space */
  42. int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
  43. enum pci_mmap_state mmap_state, int write_combine);
  44. /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
  45. #define HAVE_PCI_MMAP 1
  46. extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
  47. size_t count);
  48. extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,
  49. size_t count);
  50. extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
  51. struct vm_area_struct *vma,
  52. enum pci_mmap_state mmap_state);
  53. #define HAVE_PCI_LEGACY 1
  54. /* The PCI address space does equal the physical memory
  55. * address space (no IOMMU). The IDE and SCSI device layers use
  56. * this boolean for bounce buffer decisions.
  57. */
  58. #define PCI_DMA_BUS_IS_PHYS (1)
  59. extern void pcibios_claim_one_bus(struct pci_bus *b);
  60. extern void pcibios_finish_adding_to_bus(struct pci_bus *bus);
  61. extern void pcibios_resource_survey(void);
  62. extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
  63. extern int remove_phb_dynamic(struct pci_controller *phb);
  64. extern struct pci_dev *of_create_pci_dev(struct device_node *node,
  65. struct pci_bus *bus, int devfn);
  66. extern void of_scan_pci_bridge(struct device_node *node,
  67. struct pci_dev *dev);
  68. extern void of_scan_bus(struct device_node *node, struct pci_bus *bus);
  69. extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus);
  70. extern int pci_bus_find_capability(struct pci_bus *bus,
  71. unsigned int devfn, int cap);
  72. struct file;
  73. extern pgprot_t pci_phys_mem_access_prot(struct file *file,
  74. unsigned long pfn,
  75. unsigned long size,
  76. pgprot_t prot);
  77. #define HAVE_ARCH_PCI_RESOURCE_TO_USER
  78. extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
  79. const struct resource *rsrc,
  80. resource_size_t *start, resource_size_t *end);
  81. extern void pcibios_setup_bus_devices(struct pci_bus *bus);
  82. extern void pcibios_setup_bus_self(struct pci_bus *bus);
  83. /* This part of code was originally in xilinx-pci.h */
  84. #ifdef CONFIG_PCI_XILINX
  85. extern void __init xilinx_pci_init(void);
  86. #else
  87. static inline void __init xilinx_pci_init(void) { return; }
  88. #endif
  89. #endif /* __KERNEL__ */
  90. #endif /* __ASM_MICROBLAZE_PCI_H */