pci.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. #ifndef _ASM_TILE_PCI_H
  15. #define _ASM_TILE_PCI_H
  16. #include <linux/pci.h>
  17. #include <asm-generic/pci_iomap.h>
  18. /*
  19. * Structure of a PCI controller (host bridge)
  20. */
  21. struct pci_controller {
  22. int index; /* PCI domain number */
  23. struct pci_bus *root_bus;
  24. int first_busno;
  25. int last_busno;
  26. int hv_cfg_fd[2]; /* config{0,1} fds for this PCIe controller */
  27. int hv_mem_fd; /* fd to Hypervisor for MMIO operations */
  28. struct pci_ops *ops;
  29. int irq_base; /* Base IRQ from the Hypervisor */
  30. int plx_gen1; /* flag for PLX Gen 1 configuration */
  31. /* Address ranges that are routed to this controller/bridge. */
  32. struct resource mem_resources[3];
  33. };
  34. /*
  35. * The hypervisor maps the entirety of CPA-space as bus addresses, so
  36. * bus addresses are physical addresses. The networking and block
  37. * device layers use this boolean for bounce buffer decisions.
  38. */
  39. #define PCI_DMA_BUS_IS_PHYS 1
  40. int __devinit tile_pci_init(void);
  41. int __devinit pcibios_init(void);
  42. static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
  43. void __devinit pcibios_fixup_bus(struct pci_bus *bus);
  44. #define TILE_NUM_PCIE 2
  45. #define pci_domain_nr(bus) (((struct pci_controller *)(bus)->sysdata)->index)
  46. /*
  47. * This decides whether to display the domain number in /proc.
  48. */
  49. static inline int pci_proc_domain(struct pci_bus *bus)
  50. {
  51. return 1;
  52. }
  53. /*
  54. * pcibios_assign_all_busses() tells whether or not the bus numbers
  55. * should be reassigned, in case the BIOS didn't do it correctly, or
  56. * in case we don't have a BIOS and we want to let Linux do it.
  57. */
  58. static inline int pcibios_assign_all_busses(void)
  59. {
  60. return 1;
  61. }
  62. #define PCIBIOS_MIN_MEM 0
  63. #define PCIBIOS_MIN_IO 0
  64. /*
  65. * This flag tells if the platform is TILEmpower that needs
  66. * special configuration for the PLX switch chip.
  67. */
  68. extern int tile_plx_gen1;
  69. /* Use any cpu for PCI. */
  70. #define cpumask_of_pcibus(bus) cpu_online_mask
  71. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  72. #include <asm-generic/pci-dma-compat.h>
  73. /* generic pci stuff */
  74. #include <asm-generic/pci.h>
  75. #endif /* _ASM_TILE_PCI_H */