101a6221aSDavid Daney /*
201a6221aSDavid Daney  * This file is subject to the terms and conditions of the GNU General Public
301a6221aSDavid Daney  * License.  See the file "COPYING" in the main directory of this archive
401a6221aSDavid Daney  * for more details.
501a6221aSDavid Daney  *
601a6221aSDavid Daney  * Copyright (C) 2005-2009 Cavium Networks
701a6221aSDavid Daney  */
801a6221aSDavid Daney 
901a6221aSDavid Daney #ifndef __PCI_OCTEON_H__
1001a6221aSDavid Daney #define __PCI_OCTEON_H__
1101a6221aSDavid Daney 
1201a6221aSDavid Daney #include <linux/pci.h>
1301a6221aSDavid Daney 
1401a6221aSDavid Daney /* Some PCI cards require delays when accessing config space. */
1501a6221aSDavid Daney #define PCI_CONFIG_SPACE_DELAY 10000
1601a6221aSDavid Daney 
1701a6221aSDavid Daney /*
1801a6221aSDavid Daney  * pcibios_map_irq() is defined inside pci-octeon.c. All it does is
1901a6221aSDavid Daney  * call the Octeon specific version pointed to by this variable. This
2001a6221aSDavid Daney  * function needs to change for PCI or PCIe based hosts.
2101a6221aSDavid Daney  */
2201a6221aSDavid Daney extern int (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
2301a6221aSDavid Daney 				     u8 slot, u8 pin);
2401a6221aSDavid Daney 
2501a6221aSDavid Daney /*
2601a6221aSDavid Daney  * The following defines are used when octeon_dma_bar_type =
2701a6221aSDavid Daney  * OCTEON_DMA_BAR_TYPE_BIG
2801a6221aSDavid Daney  */
2901a6221aSDavid Daney #define OCTEON_PCI_BAR1_HOLE_BITS 5
3001a6221aSDavid Daney #define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3))
3101a6221aSDavid Daney 
3201a6221aSDavid Daney enum octeon_dma_bar_type {
3301a6221aSDavid Daney 	OCTEON_DMA_BAR_TYPE_INVALID,
3401a6221aSDavid Daney 	OCTEON_DMA_BAR_TYPE_SMALL,
3501a6221aSDavid Daney 	OCTEON_DMA_BAR_TYPE_BIG,
3601a6221aSDavid Daney 	OCTEON_DMA_BAR_TYPE_PCIE
3701a6221aSDavid Daney };
3801a6221aSDavid Daney 
3901a6221aSDavid Daney /*
4001a6221aSDavid Daney  * This tells the DMA mapping system in dma-octeon.c how to map PCI
4101a6221aSDavid Daney  * DMA addresses.
4201a6221aSDavid Daney  */
4301a6221aSDavid Daney extern enum octeon_dma_bar_type octeon_dma_bar_type;
4401a6221aSDavid Daney 
4501a6221aSDavid Daney #endif
46