FreeBSD kernel amd64 PCI device code
pci_dw_mv.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/devmap.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/rman.h>
#include <sys/sysctl.h>
#include <machine/bus.h>
#include <machine/intr.h>
#include <machine/resource.h>
#include <dev/extres/clk/clk.h>
#include <dev/extres/phy/phy.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/ofw_pci.h>
#include <dev/ofw/ofwpci.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcib_private.h>
#include <dev/pci/pci_dw.h>
#include "pcib_if.h"
#include "pci_dw_if.h"
Include dependency graph for pci_dw_mv.c:

Go to the source code of this file.

Data Structures

struct  pci_mv_softc
 

Macros

#define MV_GLOBAL_CONTROL_REG   0x8000
 
#define PCIE_APP_LTSSM_EN   (1 << 2)
 
#define MV_GLOBAL_STATUS_REG   0x8008
 
#define MV_STATUS_RDLH_LINK_UP   (1 << 1)
 
#define MV_STATUS_PHY_LINK_UP   (1 << 9)
 
#define MV_INT_CAUSE1   0x801C
 
#define MV_INT_MASK1   0x8020
 
#define INT_A_ASSERT_MASK   (1 << 9)
 
#define INT_B_ASSERT_MASK   (1 << 10)
 
#define INT_C_ASSERT_MASK   (1 << 11)
 
#define INT_D_ASSERT_MASK   (1 << 12)
 
#define MV_INT_CAUSE2   0x8024
 
#define MV_INT_MASK2   0x8028
 
#define MV_ERR_INT_CAUSE   0x802C
 
#define MV_ERR_INT_MASK   0x8030
 
#define MV_ARCACHE_TRC_REG   0x8050
 
#define MV_AWCACHE_TRC_REG   0x8054
 
#define MV_ARUSER_REG   0x805C
 
#define MV_AWUSER_REG   0x8060
 
#define MV_MAX_LANES   8
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int pci_mv_phy_init (struct pci_mv_softc *sc)
 
static void pci_mv_init (struct pci_mv_softc *sc)
 
static int pci_mv_intr (void *arg)
 
static int pci_mv_get_link (device_t dev, bool *status)
 
static int pci_mv_probe (device_t dev)
 
static int pci_mv_attach (device_t dev)
 
 DEFINE_CLASS_1 (pcib, pci_mv_driver, pci_mv_methods, sizeof(struct pci_mv_softc), pci_dw_driver)
 
 DRIVER_MODULE (pci_mv, simplebus, pci_mv_driver, pci_mv_devclass, NULL, NULL)
 

Variables

static struct ofw_compat_data compat_data []
 
static device_method_t pci_mv_methods []
 
static devclass_t pci_mv_devclass
 

Macro Definition Documentation

◆ INT_A_ASSERT_MASK

#define INT_A_ASSERT_MASK   (1 << 9)

Definition at line 73 of file pci_dw_mv.c.

◆ INT_B_ASSERT_MASK

#define INT_B_ASSERT_MASK   (1 << 10)

Definition at line 74 of file pci_dw_mv.c.

◆ INT_C_ASSERT_MASK

#define INT_C_ASSERT_MASK   (1 << 11)

Definition at line 75 of file pci_dw_mv.c.

◆ INT_D_ASSERT_MASK

#define INT_D_ASSERT_MASK   (1 << 12)

Definition at line 76 of file pci_dw_mv.c.

◆ MV_ARCACHE_TRC_REG

#define MV_ARCACHE_TRC_REG   0x8050

Definition at line 83 of file pci_dw_mv.c.

◆ MV_ARUSER_REG

#define MV_ARUSER_REG   0x805C

Definition at line 85 of file pci_dw_mv.c.

◆ MV_AWCACHE_TRC_REG

#define MV_AWCACHE_TRC_REG   0x8054

Definition at line 84 of file pci_dw_mv.c.

◆ MV_AWUSER_REG

#define MV_AWUSER_REG   0x8060

Definition at line 86 of file pci_dw_mv.c.

◆ MV_ERR_INT_CAUSE

#define MV_ERR_INT_CAUSE   0x802C

Definition at line 80 of file pci_dw_mv.c.

◆ MV_ERR_INT_MASK

#define MV_ERR_INT_MASK   0x8030

Definition at line 81 of file pci_dw_mv.c.

◆ MV_GLOBAL_CONTROL_REG

#define MV_GLOBAL_CONTROL_REG   0x8000

Definition at line 64 of file pci_dw_mv.c.

◆ MV_GLOBAL_STATUS_REG

#define MV_GLOBAL_STATUS_REG   0x8008

Definition at line 67 of file pci_dw_mv.c.

◆ MV_INT_CAUSE1

#define MV_INT_CAUSE1   0x801C

Definition at line 71 of file pci_dw_mv.c.

◆ MV_INT_CAUSE2

#define MV_INT_CAUSE2   0x8024

Definition at line 78 of file pci_dw_mv.c.

◆ MV_INT_MASK1

#define MV_INT_MASK1   0x8020

Definition at line 72 of file pci_dw_mv.c.

◆ MV_INT_MASK2

#define MV_INT_MASK2   0x8028

Definition at line 79 of file pci_dw_mv.c.

◆ MV_MAX_LANES

#define MV_MAX_LANES   8

Definition at line 88 of file pci_dw_mv.c.

◆ MV_STATUS_PHY_LINK_UP

#define MV_STATUS_PHY_LINK_UP   (1 << 9)

Definition at line 69 of file pci_dw_mv.c.

◆ MV_STATUS_RDLH_LINK_UP

#define MV_STATUS_RDLH_LINK_UP   (1 << 1)

Definition at line 68 of file pci_dw_mv.c.

◆ PCIE_APP_LTSSM_EN

#define PCIE_APP_LTSSM_EN   (1 << 2)

Definition at line 65 of file pci_dw_mv.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DEFINE_CLASS_1()

DEFINE_CLASS_1 ( pcib  ,
pci_mv_driver  ,
pci_mv_methods  ,
sizeof(struct pci_mv_softc ,
pci_dw_driver   
)

◆ DRIVER_MODULE()

DRIVER_MODULE ( pci_mv  ,
simplebus  ,
pci_mv_driver  ,
pci_mv_devclass  ,
NULL  ,
NULL   
)

◆ pci_mv_attach()

static int pci_mv_attach ( device_t  dev)
static

◆ pci_mv_get_link()

static int pci_mv_get_link ( device_t  dev,
bool *  status 
)
static

Definition at line 193 of file pci_dw_mv.c.

References dev, MV_GLOBAL_STATUS_REG, MV_STATUS_PHY_LINK_UP, MV_STATUS_RDLH_LINK_UP, pci_dw_dbi_rd4(), reg, and status.

Here is the call graph for this function:

◆ pci_mv_init()

static void pci_mv_init ( struct pci_mv_softc sc)
static

◆ pci_mv_intr()

static int pci_mv_intr ( void *  arg)
static

Definition at line 178 of file pci_dw_mv.c.

References pci_mv_softc::dev, MV_INT_CAUSE1, MV_INT_CAUSE2, pci_dw_dbi_rd4(), and pci_dw_dbi_wr4().

Referenced by pci_mv_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_mv_phy_init()

static int pci_mv_phy_init ( struct pci_mv_softc sc)
static

Definition at line 107 of file pci_dw_mv.c.

References pci_mv_softc::dev, MV_MAX_LANES, pci_mv_softc::node, and pci_mv_softc::phy.

Referenced by pci_mv_attach().

Here is the caller graph for this function:

◆ pci_mv_probe()

static int pci_mv_probe ( device_t  dev)
static

Definition at line 208 of file pci_dw_mv.c.

References compat_data, and dev.

Variable Documentation

◆ compat_data

struct ofw_compat_data compat_data[]
static
Initial value:
= {
{"marvell,armada8k-pcie", 1},
{NULL, 0},
}

Definition at line 101 of file pci_dw_mv.c.

Referenced by pci_mv_probe().

◆ pci_mv_devclass

devclass_t pci_mv_devclass
static

Definition at line 318 of file pci_dw_mv.c.

◆ pci_mv_methods

device_method_t pci_mv_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, pci_mv_probe),
DEVMETHOD(device_attach, pci_mv_attach),
DEVMETHOD(pci_dw_get_link, pci_mv_get_link),
DEVMETHOD_END
}
static int pci_mv_probe(device_t dev)
Definition: pci_dw_mv.c:208
static int pci_mv_attach(device_t dev)
Definition: pci_dw_mv.c:222
static int pci_mv_get_link(device_t dev, bool *status)
Definition: pci_dw_mv.c:193

Definition at line 306 of file pci_dw_mv.c.