Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/cavium/thunder_pcie_pem.c
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | |||||
| 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); | ||||
| static int thunder_pem_read_ivar(device_t, device_t, int, uintptr_t *); | static int thunder_pem_read_ivar(device_t, device_t, int, uintptr_t *); | ||||
| static void thunder_pem_release_all(device_t); | static void thunder_pem_release_all(device_t); | ||||
| static int thunder_pem_release_resource(device_t, device_t, int, int, | static int thunder_pem_release_resource(device_t, device_t, struct resource *); | ||||
| struct resource *); | |||||
| static struct rman * thunder_pem_get_rman(device_t, int, u_int); | static struct rman * thunder_pem_get_rman(device_t, int, u_int); | ||||
| static void thunder_pem_slix_s2m_regx_acc_modify(struct thunder_pem_softc *, | static void thunder_pem_slix_s2m_regx_acc_modify(struct thunder_pem_softc *, | ||||
| int, int); | int, int); | ||||
| static void thunder_pem_write_config(device_t, u_int, u_int, u_int, u_int, | static void thunder_pem_write_config(device_t, u_int, u_int, u_int, u_int, | ||||
| uint32_t, int); | uint32_t, int); | ||||
| static int thunder_pem_write_ivar(device_t, device_t, int, uintptr_t); | static int thunder_pem_write_ivar(device_t, device_t, int, uintptr_t); | ||||
| /* Global handlers for SLI interface */ | /* Global handlers for SLI interface */ | ||||
| ▲ Show 20 Lines • Show All 549 Lines • ▼ Show 20 Lines | device_printf(dev, "%s FAIL: type=%d, rid=%d, " | ||||
| "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", | "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", | ||||
| __func__, type, *rid, start, end, count, flags); | __func__, type, *rid, start, end, count, flags); | ||||
| } | } | ||||
| return (res); | return (res); | ||||
| } | } | ||||
| static int | static int | ||||
| thunder_pem_release_resource(device_t dev, device_t child, int type, int rid, | thunder_pem_release_resource(device_t dev, device_t child, struct resource *res) | ||||
| struct resource *res) | |||||
| { | { | ||||
| device_t parent_dev; | device_t parent_dev; | ||||
| #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | ||||
| struct thunder_pem_softc *sc = device_get_softc(dev); | struct thunder_pem_softc *sc = device_get_softc(dev); | ||||
| #endif | #endif | ||||
| switch (type) { | switch (rman_get_type(res)) { | ||||
| #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | ||||
| case PCI_RES_BUS: | case PCI_RES_BUS: | ||||
| return (pci_domain_release_bus(sc->id, child, rid, res)); | return (pci_domain_release_bus(sc->id, child, res)); | ||||
| #endif | #endif | ||||
| case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
| case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
| return (bus_generic_rman_release_resource(dev, child, type, | return (bus_generic_rman_release_resource(dev, child, res)); | ||||
| rid, res)); | |||||
| default: | default: | ||||
| /* Find parent device. On ThunderX we know an exact path. */ | /* Find parent device. On ThunderX we know an exact path. */ | ||||
| parent_dev = device_get_parent(device_get_parent(dev)); | parent_dev = device_get_parent(device_get_parent(dev)); | ||||
| return (BUS_RELEASE_RESOURCE(parent_dev, child, | return (BUS_RELEASE_RESOURCE(parent_dev, child, res)); | ||||
| type, rid, res)); | |||||
| } | } | ||||
| } | } | ||||
| static struct rman * | static struct rman * | ||||
| thunder_pem_get_rman(device_t bus, int type, u_int flags) | thunder_pem_get_rman(device_t bus, int type, u_int flags) | ||||
| { | { | ||||
| struct thunder_pem_softc *sc; | struct thunder_pem_softc *sc; | ||||
| ▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines | |||||