Lines Matching refs:brdev

228 cbb_pci_probe(device_t brdev)  in cbb_pci_probe()  argument
239 if (cbb_chipset(pci_get_devid(brdev), &name) != CB_UNKNOWN) { in cbb_pci_probe()
240 device_set_desc(brdev, name); in cbb_pci_probe()
249 baseclass = pci_get_class(brdev); in cbb_pci_probe()
250 subclass = pci_get_subclass(brdev); in cbb_pci_probe()
251 progif = pci_get_progif(brdev); in cbb_pci_probe()
254 device_set_desc(brdev, "PCI-CardBus Bridge"); in cbb_pci_probe()
278 cbb_pci_attach(device_t brdev) in cbb_pci_attach() argument
284 struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); in cbb_pci_attach()
290 parent = device_get_parent(brdev); in cbb_pci_attach()
291 mtx_init(&sc->mtx, device_get_nameunit(brdev), "cbb", MTX_DEF); in cbb_pci_attach()
292 sc->chipset = cbb_chipset(pci_get_devid(brdev), NULL); in cbb_pci_attach()
293 sc->dev = brdev; in cbb_pci_attach()
295 sc->domain = pci_get_domain(brdev); in cbb_pci_attach()
298 pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1); in cbb_pci_attach()
299 pcib_setup_secbus(brdev, &sc->bus, 1); in cbb_pci_attach()
301 sc->bus.sec = pci_read_config(brdev, PCIR_SECBUS_2, 1); in cbb_pci_attach()
302 sc->bus.sub = pci_read_config(brdev, PCIR_SUBBUS_2, 1); in cbb_pci_attach()
307 sc->base_res = bus_alloc_resource_any(brdev, SYS_RES_MEMORY, &rid, in cbb_pci_attach()
310 device_printf(brdev, "Could not map register memory\n"); in cbb_pci_attach()
314 DEVPRINTF((brdev, "Found memory at %jx\n", in cbb_pci_attach()
319 sc->cbdev = device_add_child(brdev, "cardbus", -1); in cbb_pci_attach()
321 DEVPRINTF((brdev, "WARNING: cannot add cardbus bus.\n")); in cbb_pci_attach()
323 DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n")); in cbb_pci_attach()
327 exca_init(&sc->exca, brdev, sc->bst, sc->bsh, CBB_EXCA_OFFSET); in cbb_pci_attach()
334 sctx = device_get_sysctl_ctx(brdev); in cbb_pci_attach()
335 soid = device_get_sysctl_tree(brdev); in cbb_pci_attach()
362 DEVPRINTF((brdev, "Secondary bus is %d\n", sc->bus.sec)); in cbb_pci_attach()
363 pribus = pci_read_config(brdev, PCIR_PRIBUS_2, 1); in cbb_pci_attach()
368 DEVPRINTF((brdev, "Setting primary bus to %d\n", in cbb_pci_attach()
370 pci_write_config(brdev, PCIR_PRIBUS_2, sc->pribus, 1); in cbb_pci_attach()
374 DEVPRINTF((brdev, "Secondary bus set to %d subbus %d\n", in cbb_pci_attach()
376 pci_write_config(brdev, PCIR_SECBUS_2, sc->bus.sec, 1); in cbb_pci_attach()
377 pci_write_config(brdev, PCIR_SUBBUS_2, sc->bus.sub, 1); in cbb_pci_attach()
383 sc->irq_res = bus_alloc_resource_any(brdev, SYS_RES_IRQ, &rid, in cbb_pci_attach()
386 device_printf(brdev, "Unable to map IRQ...\n"); in cbb_pci_attach()
390 if (bus_setup_intr(brdev, sc->irq_res, INTR_TYPE_AV | INTR_MPSAFE, in cbb_pci_attach()
392 device_printf(brdev, "couldn't establish interrupt\n"); in cbb_pci_attach()
400 cbb_power(brdev, CARD_OFF); in cbb_pci_attach()
409 cbb_print_config(brdev); in cbb_pci_attach()
413 "%s event thread", device_get_nameunit(brdev))) { in cbb_pci_attach()
414 device_printf(brdev, "unable to create event thread.\n"); in cbb_pci_attach()
421 bus_release_resource(brdev, SYS_RES_IRQ, 0, sc->irq_res); in cbb_pci_attach()
423 bus_release_resource(brdev, SYS_RES_MEMORY, CBBR_SOCKBASE, in cbb_pci_attach()
431 cbb_pci_detach(device_t brdev) in cbb_pci_detach() argument
434 struct cbb_softc *sc = device_get_softc(brdev); in cbb_pci_detach()
438 error = cbb_detach(brdev); in cbb_pci_detach()
441 pcib_free_secbus(brdev, &sc->bus); in cbb_pci_detach()
663 cbb_pci_shutdown(device_t brdev) in cbb_pci_shutdown() argument
665 struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); in cbb_pci_shutdown()
677 PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL, |CBBM_BRIDGECTRL_RESET, 2); in cbb_pci_shutdown()
681 cbb_power(brdev, CARD_OFF); in cbb_pci_shutdown()
688 pci_write_config(brdev, CBBR_MEMBASE0, 0, 4); in cbb_pci_shutdown()
689 pci_write_config(brdev, CBBR_MEMLIMIT0, 0, 4); in cbb_pci_shutdown()
690 pci_write_config(brdev, CBBR_MEMBASE1, 0, 4); in cbb_pci_shutdown()
691 pci_write_config(brdev, CBBR_MEMLIMIT1, 0, 4); in cbb_pci_shutdown()
692 pci_write_config(brdev, CBBR_IOBASE0, 0, 4); in cbb_pci_shutdown()
693 pci_write_config(brdev, CBBR_IOLIMIT0, 0, 4); in cbb_pci_shutdown()
694 pci_write_config(brdev, CBBR_IOBASE1, 0, 4); in cbb_pci_shutdown()
695 pci_write_config(brdev, CBBR_IOLIMIT1, 0, 4); in cbb_pci_shutdown()
848 cbb_maxslots(device_t brdev) in cbb_maxslots() argument
854 cbb_read_config(device_t brdev, u_int b, u_int s, u_int f, u_int reg, int width) in cbb_read_config() argument
859 return (PCIB_READ_CONFIG(device_get_parent(device_get_parent(brdev)), in cbb_read_config()
864 cbb_write_config(device_t brdev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, in cbb_write_config() argument
870 PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(brdev)), in cbb_write_config()
875 cbb_pci_suspend(device_t brdev) in cbb_pci_suspend() argument
878 struct cbb_softc *sc = device_get_softc(brdev); in cbb_pci_suspend()
880 error = bus_generic_suspend(brdev); in cbb_pci_suspend()
889 cbb_pci_resume(device_t brdev) in cbb_pci_resume() argument
892 struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); in cbb_pci_resume()
919 error = bus_generic_resume(brdev); in cbb_pci_resume()