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

Go to the source code of this file.

Macros

#define PCIE_DEV_ID_OFF   0x0000
 
#define PCIE_CMD_OFF   0x0004
 
#define PCIE_DEV_REV_OFF   0x0008
 
#define PCIE_BAR_LO_OFF(n)   (0x0010 + ((n) << 3))
 
#define PCIE_BAR_HI_OFF(n)   (0x0014 + ((n) << 3))
 
#define PCIE_HEADER_LOG_4_OFF   0x0128
 
#define PCIE_BAR_CTRL_OFF(n)   (0x1804 + ((n - 1) * 4))
 
#define PCIE_WIN04_CTRL_OFF(n)   (0x1820 + ((n) << 4))
 
#define PCIE_WIN04_BASE_OFF(n)   (0x1824 + ((n) << 4))
 
#define PCIE_WIN04_REMAP_OFF(n)   (0x182c + ((n) << 4))
 
#define PCIE_WIN5_CTRL_OFF   0x1880
 
#define PCIE_WIN5_BASE_OFF   0x1884
 
#define PCIE_WIN5_REMAP_OFF   0x188c
 
#define PCIE_CONF_ADDR_OFF   0x18f8
 
#define PCIE_CONF_ADDR_EN   0x80000000
 
#define PCIE_CONF_REG(r)   ((((r) & 0xf00) << 16) | ((r) & 0xfc))
 
#define PCIE_CONF_BUS(b)   (((b) & 0xff) << 16)
 
#define PCIE_CONF_DEV(d)   (((d) & 0x1f) << 11)
 
#define PCIE_CONF_FUNC(f)   (((f) & 0x7) << 8)
 
#define PCIE_CONF_DATA_OFF   0x18fc
 
#define PCIE_MASK_OFF   0x1910
 
#define PCIE_CTRL_OFF   0x1a00
 
#define PCIE_CTRL_X1_MODE   0x0001
 
#define PCIE_STAT_OFF   0x1a04
 
#define PCIE_STAT_DEV_OFFS   20
 
#define PCIE_STAT_DEV_MASK   0x1f
 
#define PCIE_STAT_BUS_OFFS   8
 
#define PCIE_STAT_BUS_MASK   0xff
 
#define PCIE_STAT_LINK_DOWN   1
 
#define PCIE_DEBUG_CTRL   0x1a60
 
#define PCIE_DEBUG_SOFT_RESET   (1<<20)
 

Functions

u32 orion_pcie_dev_id (void __iomem *base)
 
u32 orion_pcie_rev (void __iomem *base)
 
int orion_pcie_link_up (void __iomem *base)
 
int __init orion_pcie_x4_mode (void __iomem *base)
 
int orion_pcie_get_local_bus_nr (void __iomem *base)
 
void __init orion_pcie_set_local_bus_nr (void __iomem *base, int nr)
 
void __init orion_pcie_reset (void __iomem *base)
 
void __init orion_pcie_setup (void __iomem *base)
 
int orion_pcie_rd_conf (void __iomem *base, struct pci_bus *bus, u32 devfn, int where, int size, u32 *val)
 
int orion_pcie_rd_conf_tlp (void __iomem *base, struct pci_bus *bus, u32 devfn, int where, int size, u32 *val)
 
int orion_pcie_rd_conf_wa (void __iomem *wa_base, struct pci_bus *bus, u32 devfn, int where, int size, u32 *val)
 
int orion_pcie_wr_conf (void __iomem *base, struct pci_bus *bus, u32 devfn, int where, int size, u32 val)
 

Macro Definition Documentation

#define PCIE_BAR_CTRL_OFF (   n)    (0x1804 + ((n - 1) * 4))

Definition at line 28 of file pcie.c.

#define PCIE_BAR_HI_OFF (   n)    (0x0014 + ((n) << 3))

Definition at line 26 of file pcie.c.

#define PCIE_BAR_LO_OFF (   n)    (0x0010 + ((n) << 3))

Definition at line 25 of file pcie.c.

#define PCIE_CMD_OFF   0x0004

Definition at line 23 of file pcie.c.

#define PCIE_CONF_ADDR_EN   0x80000000

Definition at line 36 of file pcie.c.

#define PCIE_CONF_ADDR_OFF   0x18f8

Definition at line 35 of file pcie.c.

#define PCIE_CONF_BUS (   b)    (((b) & 0xff) << 16)

Definition at line 38 of file pcie.c.

#define PCIE_CONF_DATA_OFF   0x18fc

Definition at line 41 of file pcie.c.

#define PCIE_CONF_DEV (   d)    (((d) & 0x1f) << 11)

Definition at line 39 of file pcie.c.

#define PCIE_CONF_FUNC (   f)    (((f) & 0x7) << 8)

Definition at line 40 of file pcie.c.

#define PCIE_CONF_REG (   r)    ((((r) & 0xf00) << 16) | ((r) & 0xfc))

Definition at line 37 of file pcie.c.

#define PCIE_CTRL_OFF   0x1a00

Definition at line 43 of file pcie.c.

#define PCIE_CTRL_X1_MODE   0x0001

Definition at line 44 of file pcie.c.

#define PCIE_DEBUG_CTRL   0x1a60

Definition at line 51 of file pcie.c.

#define PCIE_DEBUG_SOFT_RESET   (1<<20)

Definition at line 52 of file pcie.c.

#define PCIE_DEV_ID_OFF   0x0000

Definition at line 22 of file pcie.c.

#define PCIE_DEV_REV_OFF   0x0008

Definition at line 24 of file pcie.c.

#define PCIE_HEADER_LOG_4_OFF   0x0128

Definition at line 27 of file pcie.c.

#define PCIE_MASK_OFF   0x1910

Definition at line 42 of file pcie.c.

#define PCIE_STAT_BUS_MASK   0xff

Definition at line 49 of file pcie.c.

#define PCIE_STAT_BUS_OFFS   8

Definition at line 48 of file pcie.c.

#define PCIE_STAT_DEV_MASK   0x1f

Definition at line 47 of file pcie.c.

#define PCIE_STAT_DEV_OFFS   20

Definition at line 46 of file pcie.c.

#define PCIE_STAT_LINK_DOWN   1

Definition at line 50 of file pcie.c.

#define PCIE_STAT_OFF   0x1a04

Definition at line 45 of file pcie.c.

#define PCIE_WIN04_BASE_OFF (   n)    (0x1824 + ((n) << 4))

Definition at line 30 of file pcie.c.

#define PCIE_WIN04_CTRL_OFF (   n)    (0x1820 + ((n) << 4))

Definition at line 29 of file pcie.c.

#define PCIE_WIN04_REMAP_OFF (   n)    (0x182c + ((n) << 4))

Definition at line 31 of file pcie.c.

#define PCIE_WIN5_BASE_OFF   0x1884

Definition at line 33 of file pcie.c.

#define PCIE_WIN5_CTRL_OFF   0x1880

Definition at line 32 of file pcie.c.

#define PCIE_WIN5_REMAP_OFF   0x188c

Definition at line 34 of file pcie.c.

Function Documentation

u32 orion_pcie_dev_id ( void __iomem base)

Definition at line 55 of file pcie.c.

int orion_pcie_get_local_bus_nr ( void __iomem base)

Definition at line 75 of file pcie.c.

int orion_pcie_link_up ( void __iomem base)

Definition at line 65 of file pcie.c.

int orion_pcie_rd_conf ( void __iomem base,
struct pci_bus bus,
u32  devfn,
int  where,
int  size,
u32 val 
)

Definition at line 206 of file pcie.c.

int orion_pcie_rd_conf_tlp ( void __iomem base,
struct pci_bus bus,
u32  devfn,
int  where,
int  size,
u32 val 
)

Definition at line 225 of file pcie.c.

int orion_pcie_rd_conf_wa ( void __iomem wa_base,
struct pci_bus bus,
u32  devfn,
int  where,
int  size,
u32 val 
)

Definition at line 248 of file pcie.c.

void __init orion_pcie_reset ( void __iomem base)

Definition at line 92 of file pcie.c.

u32 orion_pcie_rev ( void __iomem base)

Definition at line 60 of file pcie.c.

void __init orion_pcie_set_local_bus_nr ( void __iomem base,
int  nr 
)

Definition at line 82 of file pcie.c.

void __init orion_pcie_setup ( void __iomem base)

Definition at line 179 of file pcie.c.

int orion_pcie_wr_conf ( void __iomem base,
struct pci_bus bus,
u32  devfn,
int  where,
int  size,
u32  val 
)

Definition at line 264 of file pcie.c.

int __init orion_pcie_x4_mode ( void __iomem base)

Definition at line 70 of file pcie.c.