pci-octeon.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2005-2009 Cavium Networks
  7. */
  8. #ifndef __PCI_OCTEON_H__
  9. #define __PCI_OCTEON_H__
  10. #include <linux/pci.h>
  11. /* Some PCI cards require delays when accessing config space. */
  12. #define PCI_CONFIG_SPACE_DELAY 10000
  13. /*
  14. * The physical memory base mapped by BAR1. 256MB at the end of the
  15. * first 4GB.
  16. */
  17. #define CVMX_PCIE_BAR1_PHYS_BASE ((1ull << 32) - (1ull << 28))
  18. #define CVMX_PCIE_BAR1_PHYS_SIZE (1ull << 28)
  19. /*
  20. * The RC base of BAR1. gen1 has a 39-bit BAR2, gen2 has 41-bit BAR2,
  21. * place BAR1 so it is the same for both.
  22. */
  23. #define CVMX_PCIE_BAR1_RC_BASE (1ull << 41)
  24. /*
  25. * pcibios_map_irq() is defined inside pci-octeon.c. All it does is
  26. * call the Octeon specific version pointed to by this variable. This
  27. * function needs to change for PCI or PCIe based hosts.
  28. */
  29. extern int (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
  30. u8 slot, u8 pin);
  31. /*
  32. * The following defines are used when octeon_dma_bar_type =
  33. * OCTEON_DMA_BAR_TYPE_BIG
  34. */
  35. #define OCTEON_PCI_BAR1_HOLE_BITS 5
  36. #define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3))
  37. enum octeon_dma_bar_type {
  38. OCTEON_DMA_BAR_TYPE_INVALID,
  39. OCTEON_DMA_BAR_TYPE_SMALL,
  40. OCTEON_DMA_BAR_TYPE_BIG,
  41. OCTEON_DMA_BAR_TYPE_PCIE
  42. };
  43. /*
  44. * This tells the DMA mapping system in dma-octeon.c how to map PCI
  45. * DMA addresses.
  46. */
  47. extern enum octeon_dma_bar_type octeon_dma_bar_type;
  48. #endif