pci.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 <asm/pci-bridge.h>
  17. /*
  18. * The hypervisor maps the entirety of CPA-space as bus addresses, so
  19. * bus addresses are physical addresses. The networking and block
  20. * device layers use this boolean for bounce buffer decisions.
  21. */
  22. #define PCI_DMA_BUS_IS_PHYS 1
  23. struct pci_controller *pci_bus_to_hose(int bus);
  24. unsigned char __init common_swizzle(struct pci_dev *dev, unsigned char *pinp);
  25. int __init tile_pci_init(void);
  26. void pci_iounmap(struct pci_dev *dev, void __iomem *addr);
  27. void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
  28. void __devinit pcibios_fixup_bus(struct pci_bus *bus);
  29. int __devinit _tile_cfg_read(struct pci_controller *hose,
  30. int bus,
  31. int slot,
  32. int function,
  33. int offset,
  34. int size,
  35. u32 *val);
  36. int __devinit _tile_cfg_write(struct pci_controller *hose,
  37. int bus,
  38. int slot,
  39. int function,
  40. int offset,
  41. int size,
  42. u32 val);
  43. /*
  44. * These are used to to config reads and writes in the early stages of
  45. * setup before the driver infrastructure has been set up enough to be
  46. * able to do config reads and writes.
  47. */
  48. #define early_cfg_read(where, size, value) \
  49. _tile_cfg_read(controller, \
  50. current_bus, \
  51. pci_slot, \
  52. pci_fn, \
  53. where, \
  54. size, \
  55. value)
  56. #define early_cfg_write(where, size, value) \
  57. _tile_cfg_write(controller, \
  58. current_bus, \
  59. pci_slot, \
  60. pci_fn, \
  61. where, \
  62. size, \
  63. value)
  64. #define PCICFG_BYTE 1
  65. #define PCICFG_WORD 2
  66. #define PCICFG_DWORD 4
  67. #define TILE_NUM_PCIE 2
  68. #define pci_domain_nr(bus) (((struct pci_controller *)(bus)->sysdata)->index)
  69. /*
  70. * This decides whether to display the domain number in /proc.
  71. */
  72. static inline int pci_proc_domain(struct pci_bus *bus)
  73. {
  74. return 1;
  75. }
  76. /*
  77. * I/O space is currently not supported.
  78. */
  79. #define TILE_PCIE_LOWER_IO 0x0
  80. #define TILE_PCIE_UPPER_IO 0x10000
  81. #define TILE_PCIE_PCIE_IO_SIZE 0x0000FFFF
  82. #define _PAGE_NO_CACHE 0
  83. #define _PAGE_GUARDED 0
  84. #define pcibios_assign_all_busses() pci_assign_all_buses
  85. extern int pci_assign_all_buses;
  86. static inline void pcibios_set_master(struct pci_dev *dev)
  87. {
  88. /* No special bus mastering setup handling */
  89. }
  90. #define PCIBIOS_MIN_MEM 0
  91. #define PCIBIOS_MIN_IO TILE_PCIE_LOWER_IO
  92. /*
  93. * This flag tells if the platform is TILEmpower that needs
  94. * special configuration for the PLX switch chip.
  95. */
  96. extern int blade_pci;
  97. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  98. #include <asm-generic/pci-dma-compat.h>
  99. /* generic pci stuff */
  100. #include <asm-generic/pci.h>
  101. /* Use any cpu for PCI. */
  102. #define cpumask_of_pcibus(bus) cpu_online_mask
  103. #endif /* _ASM_TILE_PCI_H */