Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is subject to the terms and conditions of the GNU General Public
0003  * License.  See the file "COPYING" in the main directory of this archive
0004  * for more details.
0005  *
0006  * Copyright (C) 2005-2009 Cavium Networks
0007  */
0008 
0009 #ifndef __PCI_OCTEON_H__
0010 #define __PCI_OCTEON_H__
0011 
0012 #include <linux/pci.h>
0013 
0014 /*
0015  * The physical memory base mapped by BAR1.  256MB at the end of the
0016  * first 4GB.
0017  */
0018 #define CVMX_PCIE_BAR1_PHYS_BASE ((1ull << 32) - (1ull << 28))
0019 #define CVMX_PCIE_BAR1_PHYS_SIZE (1ull << 28)
0020 
0021 /*
0022  * The RC base of BAR1.  gen1 has a 39-bit BAR2, gen2 has 41-bit BAR2,
0023  * place BAR1 so it is the same for both.
0024  */
0025 #define CVMX_PCIE_BAR1_RC_BASE (1ull << 41)
0026 
0027 /*
0028  * pcibios_map_irq() is defined inside pci-octeon.c. All it does is
0029  * call the Octeon specific version pointed to by this variable. This
0030  * function needs to change for PCI or PCIe based hosts.
0031  */
0032 extern int (*octeon_pcibios_map_irq)(const struct pci_dev *dev,
0033                      u8 slot, u8 pin);
0034 
0035 /*
0036  * For PCI (not PCIe) the BAR2 base address.
0037  */
0038 #define OCTEON_BAR2_PCI_ADDRESS 0x8000000000ull
0039 
0040 /*
0041  * For PCI (not PCIe) the base of the memory mapped by BAR1
0042  */
0043 extern u64 octeon_bar1_pci_phys;
0044 
0045 /*
0046  * The following defines are used when octeon_dma_bar_type =
0047  * OCTEON_DMA_BAR_TYPE_BIG
0048  */
0049 #define OCTEON_PCI_BAR1_HOLE_BITS 5
0050 #define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3))
0051 
0052 enum octeon_dma_bar_type {
0053     OCTEON_DMA_BAR_TYPE_INVALID,
0054     OCTEON_DMA_BAR_TYPE_SMALL,
0055     OCTEON_DMA_BAR_TYPE_BIG,
0056     OCTEON_DMA_BAR_TYPE_PCIE,
0057     OCTEON_DMA_BAR_TYPE_PCIE2
0058 };
0059 
0060 /*
0061  * This tells the DMA mapping system in dma-octeon.c how to map PCI
0062  * DMA addresses.
0063  */
0064 extern enum octeon_dma_bar_type octeon_dma_bar_type;
0065 
0066 void octeon_pci_dma_init(void);
0067 extern char *octeon_swiotlb;
0068 
0069 #endif