Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
pci.c File Reference
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/mbus.h>
#include <video/vga.h>
#include <asm/irq.h>
#include <asm/mach/pci.h>
#include <plat/pcie.h>
#include <plat/addr-map.h>
#include <mach/orion5x.h>
#include "common.h"

Go to the source code of this file.

Macros

#define PCIE_BASE   (ORION5X_PCIE_VIRT_BASE)
 
#define ORION5X_PCI_REG(x)   (ORION5X_PCI_VIRT_BASE + (x))
 
#define PCI_MODE   ORION5X_PCI_REG(0xd00)
 
#define PCI_CMD   ORION5X_PCI_REG(0xc00)
 
#define PCI_P2P_CONF   ORION5X_PCI_REG(0x1d14)
 
#define PCI_CONF_ADDR   ORION5X_PCI_REG(0xc78)
 
#define PCI_CONF_DATA   ORION5X_PCI_REG(0xc7c)
 
#define PCI_MODE_64BIT   (1 << 2)
 
#define PCI_MODE_PCIX   ((1 << 4) | (1 << 5))
 
#define PCI_CMD_HOST_REORDER   (1 << 29)
 
#define PCI_P2P_BUS_OFFS   16
 
#define PCI_P2P_BUS_MASK   (0xff << PCI_P2P_BUS_OFFS)
 
#define PCI_P2P_DEV_OFFS   24
 
#define PCI_P2P_DEV_MASK   (0x1f << PCI_P2P_DEV_OFFS)
 
#define PCI_CONF_REG(reg)   ((reg) & 0xfc)
 
#define PCI_CONF_FUNC(func)   (((func) & 0x3) << 8)
 
#define PCI_CONF_DEV(dev)   (((dev) & 0x1f) << 11)
 
#define PCI_CONF_BUS(bus)   (((bus) & 0xff) << 16)
 
#define PCI_CONF_ADDR_EN   (1 << 31)
 
#define PCI_CONF_FUNC_STAT_CMD   0
 
#define PCI_CONF_REG_STAT_CMD   4
 
#define PCIX_STAT   0x64
 
#define PCIX_STAT_BUS_OFFS   8
 
#define PCIX_STAT_BUS_MASK   (0xff << PCIX_STAT_BUS_OFFS)
 
#define PCI_BAR_SIZE_DDR_CS(n)
 
#define PCI_BAR_REMAP_DDR_CS(n)
 
#define PCI_BAR_ENABLE   ORION5X_PCI_REG(0xc3c)
 
#define PCI_ADDR_DECODE_CTRL   ORION5X_PCI_REG(0xd3c)
 
#define PCI_CONF_FUNC_BAR_CS(n)   ((n) >> 1)
 
#define PCI_CONF_REG_BAR_LO_CS(n)   (((n) & 1) ? 0x18 : 0x10)
 
#define PCI_CONF_REG_BAR_HI_CS(n)   (((n) & 1) ? 0x1c : 0x14)
 

Functions

void __init orion5x_pcie_id (u32 *dev, u32 *rev)
 
 DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup)
 
void __init orion5x_pci_disable (void)
 
void __init orion5x_pci_set_cardbus_mode (void)
 
int __init orion5x_pci_sys_setup (int nr, struct pci_sys_data *sys)
 
struct pci_bus __initorion5x_pci_sys_scan_bus (int nr, struct pci_sys_data *sys)
 
int __init orion5x_pci_map_irq (const struct pci_dev *dev, u8 slot, u8 pin)
 

Macro Definition Documentation

#define ORION5X_PCI_REG (   x)    (ORION5X_PCI_VIRT_BASE + (x))

Definition at line 191 of file pci.c.

#define PCI_ADDR_DECODE_CTRL   ORION5X_PCI_REG(0xd3c)

Definition at line 247 of file pci.c.

#define PCI_BAR_ENABLE   ORION5X_PCI_REG(0xc3c)

Definition at line 246 of file pci.c.

#define PCI_BAR_REMAP_DDR_CS (   n)
Value:
(((n) == 0) ? ORION5X_PCI_REG(0xc48) : \
((n) == 1) ? ORION5X_PCI_REG(0xd48) : \
((n) == 2) ? ORION5X_PCI_REG(0xc4c) : \
((n) == 3) ? ORION5X_PCI_REG(0xd4c) : 0)

Definition at line 242 of file pci.c.

#define PCI_BAR_SIZE_DDR_CS (   n)
Value:
(((n) == 0) ? ORION5X_PCI_REG(0xc08) : \
((n) == 1) ? ORION5X_PCI_REG(0xd08) : \
((n) == 2) ? ORION5X_PCI_REG(0xc0c) : \
((n) == 3) ? ORION5X_PCI_REG(0xd0c) : 0)

Definition at line 238 of file pci.c.

#define PCI_CMD   ORION5X_PCI_REG(0xc00)

Definition at line 193 of file pci.c.

#define PCI_CMD_HOST_REORDER   (1 << 29)

Definition at line 207 of file pci.c.

#define PCI_CONF_ADDR   ORION5X_PCI_REG(0xc78)

Definition at line 195 of file pci.c.

#define PCI_CONF_ADDR_EN   (1 << 31)

Definition at line 224 of file pci.c.

#define PCI_CONF_BUS (   bus)    (((bus) & 0xff) << 16)

Definition at line 223 of file pci.c.

#define PCI_CONF_DATA   ORION5X_PCI_REG(0xc7c)

Definition at line 196 of file pci.c.

#define PCI_CONF_DEV (   dev)    (((dev) & 0x1f) << 11)

Definition at line 222 of file pci.c.

#define PCI_CONF_FUNC (   func)    (((func) & 0x3) << 8)

Definition at line 221 of file pci.c.

#define PCI_CONF_FUNC_BAR_CS (   n)    ((n) >> 1)

Definition at line 252 of file pci.c.

#define PCI_CONF_FUNC_STAT_CMD   0

Definition at line 229 of file pci.c.

#define PCI_CONF_REG (   reg)    ((reg) & 0xfc)

Definition at line 220 of file pci.c.

#define PCI_CONF_REG_BAR_HI_CS (   n)    (((n) & 1) ? 0x1c : 0x14)

Definition at line 254 of file pci.c.

#define PCI_CONF_REG_BAR_LO_CS (   n)    (((n) & 1) ? 0x18 : 0x10)

Definition at line 253 of file pci.c.

#define PCI_CONF_REG_STAT_CMD   4

Definition at line 230 of file pci.c.

#define PCI_MODE   ORION5X_PCI_REG(0xd00)

Definition at line 192 of file pci.c.

#define PCI_MODE_64BIT   (1 << 2)

Definition at line 201 of file pci.c.

#define PCI_MODE_PCIX   ((1 << 4) | (1 << 5))

Definition at line 202 of file pci.c.

#define PCI_P2P_BUS_MASK   (0xff << PCI_P2P_BUS_OFFS)

Definition at line 213 of file pci.c.

#define PCI_P2P_BUS_OFFS   16

Definition at line 212 of file pci.c.

#define PCI_P2P_CONF   ORION5X_PCI_REG(0x1d14)

Definition at line 194 of file pci.c.

#define PCI_P2P_DEV_MASK   (0x1f << PCI_P2P_DEV_OFFS)

Definition at line 215 of file pci.c.

#define PCI_P2P_DEV_OFFS   24

Definition at line 214 of file pci.c.

#define PCIE_BASE   (ORION5X_PCIE_VIRT_BASE)

Definition at line 41 of file pci.c.

#define PCIX_STAT   0x64

Definition at line 231 of file pci.c.

#define PCIX_STAT_BUS_MASK   (0xff << PCIX_STAT_BUS_OFFS)

Definition at line 233 of file pci.c.

#define PCIX_STAT_BUS_OFFS   8

Definition at line 232 of file pci.c.

Function Documentation

DECLARE_PCI_FIXUP_HEADER ( PCI_VENDOR_ID_MARVELL  ,
PCI_ANY_ID  ,
rc_pci_fixup   
)
void __init orion5x_pci_disable ( void  )

Definition at line 528 of file pci.c.

int __init orion5x_pci_map_irq ( const struct pci_dev dev,
u8  slot,
u8  pin 
)

Definition at line 573 of file pci.c.

void __init orion5x_pci_set_cardbus_mode ( void  )

Definition at line 533 of file pci.c.

struct pci_bus __init* orion5x_pci_sys_scan_bus ( int  nr,
struct pci_sys_data sys 
)
read

Definition at line 555 of file pci.c.

int __init orion5x_pci_sys_setup ( int  nr,
struct pci_sys_data sys 
)

Definition at line 538 of file pci.c.

void __init orion5x_pcie_id ( u32 dev,
u32 rev 
)

Definition at line 43 of file pci.c.