Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/cavium/thunder_pcie_pem.c
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | struct thunder_pem_softc { | ||||
uint32_t node; | uint32_t node; | ||||
uint32_t id; | uint32_t id; | ||||
uint32_t sli; | uint32_t sli; | ||||
uint32_t sli_group; | uint32_t sli_group; | ||||
uint64_t sli_window_base; | uint64_t sli_window_base; | ||||
}; | }; | ||||
static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, | static struct resource * thunder_pem_alloc_resource(device_t, device_t, int, | ||||
int *, u_long, u_long, u_long, u_int); | int *, rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static int thunder_pem_attach(device_t); | static int thunder_pem_attach(device_t); | ||||
static int thunder_pem_detach(device_t); | static int thunder_pem_detach(device_t); | ||||
static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); | static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int); | ||||
static int thunder_pem_link_init(struct thunder_pem_softc *); | static int thunder_pem_link_init(struct thunder_pem_softc *); | ||||
static int thunder_pem_maxslots(device_t); | static int thunder_pem_maxslots(device_t); | ||||
static int thunder_pem_probe(device_t); | static int thunder_pem_probe(device_t); | ||||
static uint32_t thunder_pem_read_config(device_t, u_int, u_int, u_int, u_int, | static uint32_t thunder_pem_read_config(device_t, u_int, u_int, u_int, u_int, | ||||
int); | int); | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | thunder_pem_write_ivar(device_t dev, device_t child, int index, | ||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
static int | static int | ||||
thunder_pem_identify(device_t dev) | thunder_pem_identify(device_t dev) | ||||
{ | { | ||||
struct thunder_pem_softc *sc; | struct thunder_pem_softc *sc; | ||||
u_long start; | rman_res_t start; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
start = rman_get_start(sc->reg); | start = rman_get_start(sc->reg); | ||||
/* Calculate PEM designations from its address */ | /* Calculate PEM designations from its address */ | ||||
sc->node = (start >> SLI_NODE_SHIFT) & SLI_NODE_MASK; | sc->node = (start >> SLI_NODE_SHIFT) & SLI_NODE_MASK; | ||||
sc->id = ((start >> SLI_ID_SHIFT) & SLI_ID_MASK) + | sc->id = ((start >> SLI_ID_SHIFT) & SLI_ID_MASK) + | ||||
(SLI_PEMS_PER_NODE * sc->node); | (SLI_PEMS_PER_NODE * sc->node); | ||||
▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | case 4: | ||||
break; | break; | ||||
default: | default: | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, | thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct thunder_pem_softc *sc = device_get_softc(dev); | struct thunder_pem_softc *sc = device_get_softc(dev); | ||||
struct rman *rm = NULL; | struct rman *rm = NULL; | ||||
struct resource *res; | struct resource *res; | ||||
device_t parent_dev; | device_t parent_dev; | ||||
switch (type) { | switch (type) { | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines |