Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/mv/mv_pci.c
Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | |||||
/* Forward prototypes */ | /* Forward prototypes */ | ||||
static int mv_pcib_probe(device_t); | static int mv_pcib_probe(device_t); | ||||
static int mv_pcib_attach(device_t); | static int mv_pcib_attach(device_t); | ||||
static struct rman *mv_pcib_get_rman(device_t, int, u_int); | static struct rman *mv_pcib_get_rman(device_t, int, u_int); | ||||
static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *, | static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *, | ||||
rman_res_t, rman_res_t, rman_res_t, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
static int mv_pcib_adjust_resource(device_t, device_t, int, struct resource *, | static int mv_pcib_adjust_resource(device_t, device_t, struct resource *, | ||||
rman_res_t, rman_res_t); | rman_res_t, rman_res_t); | ||||
static int mv_pcib_release_resource(device_t, device_t, int, int, | static int mv_pcib_release_resource(device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
static int mv_pcib_activate_resource(device_t, device_t, int, int, | static int mv_pcib_activate_resource(device_t, device_t, int, int, | ||||
struct resource *r); | struct resource *r); | ||||
static int mv_pcib_deactivate_resource(device_t, device_t, int, int, | static int mv_pcib_deactivate_resource(device_t, device_t, int, int, | ||||
struct resource *r); | struct resource *r); | ||||
static int mv_pcib_map_resource(device_t, device_t, int, struct resource *, | static int mv_pcib_map_resource(device_t, device_t, int, struct resource *, | ||||
▲ Show 20 Lines • Show All 579 Lines • ▼ Show 20 Lines | if ((start < sc->sc_mem_base) || (start + count - 1 != end) || | ||||
(end > sc->sc_mem_base + sc->sc_mem_size - 1)) | (end > sc->sc_mem_base + sc->sc_mem_size - 1)) | ||||
return (NULL); | return (NULL); | ||||
return (bus_generic_rman_alloc_resource(dev, child, type, rid, | return (bus_generic_rman_alloc_resource(dev, child, type, rid, | ||||
start, end, count, flags)); | start, end, count, flags)); | ||||
} | } | ||||
static int | static int | ||||
mv_pcib_adjust_resource(device_t dev, device_t child, int type, | mv_pcib_adjust_resource(device_t dev, device_t child, | ||||
struct resource *r, rman_res_t start, rman_res_t end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
struct mv_pcib_softc *sc = device_get_softc(dev); | struct mv_pcib_softc *sc = device_get_softc(dev); | ||||
#endif | #endif | ||||
switch (type) { | switch (rman_get_type(r)) { | ||||
case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
return (bus_generic_rman_adjust_resource(dev, child, type, r, | return (bus_generic_rman_adjust_resource(dev, child, r, start, | ||||
start, end)); | end)); | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
case PCI_RES_BUS: | case PCI_RES_BUS: | ||||
return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, | return (pci_domain_adjust_bus(sc->ap_segment, child, r, start, | ||||
end)); | end)); | ||||
#endif | #endif | ||||
default: | default: | ||||
return (bus_generic_adjust_resource(dev, child, type, r, | return (bus_generic_adjust_resource(dev, child, r, start, end)); | ||||
start, end)); | |||||
} | } | ||||
} | } | ||||
static int | static int | ||||
mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, | mv_pcib_release_resource(device_t dev, device_t child, int type, int rid, | ||||
struct resource *res) | struct resource *res) | ||||
{ | { | ||||
#ifdef PCI_RES_BUS | #ifdef PCI_RES_BUS | ||||
▲ Show 20 Lines • Show All 442 Lines • Show Last 20 Lines |