static int kiic_probe(device_t self) { const char *name; name = ofw_bus_get_name(self); if (name && strcmp(name, "i2c") == 0) { device_set_desc(self, "Keywest I2C controller"); return (0); } return (ENXIO); }
static int macgpio_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name && strcmp(name, "gpio") == 0) { device_set_desc(dev, "MacIO GPIO Controller"); return (0); } return (ENXIO); }
static int eeprom_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (strcmp(name, "eeprom") == 0 || strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } return (ENXIO); }
static int ebus_nexus_probe(device_t dev) { const char* compat; compat = ofw_bus_get_compat(dev); if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ebus") == 0 && strcmp(compat, "jbus-ebus") == 0) { device_set_desc(dev, "JBus-EBus bridge"); return (BUS_PROBE_GENERIC); } return (ENXIO); }
static int schppm_probe(device_t dev) { const char* compat; compat = ofw_bus_get_compat(dev); if (compat != NULL && strcmp(ofw_bus_get_name(dev), "ppm") == 0 && strcmp(compat, "gp2-ppm") == 0) { device_set_desc(dev, "Schizo power management"); return (BUS_PROBE_DEFAULT); } return (ENXIO); }
static int dma_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (strcmp(name, "espdma") == 0 || strcmp(name, "dma") == 0 || strcmp(name, "ledma") == 0) { device_set_desc_copy(dev, name); return (0); } return (ENXIO); }
static int gem_sbus_probe(device_t dev) { if (strcmp(ofw_bus_get_name(dev), "network") == 0 && ofw_bus_get_compat(dev) != NULL && strcmp(ofw_bus_get_compat(dev), "SUNW,sbus-gem") == 0) { device_set_desc(dev, "Sun GEM Gigabit Ethernet"); return (0); } return (ENXIO); }
static int sc_probe(device_t dev) { int unit; unit = device_get_unit(dev); if (strcmp(ofw_bus_get_name(dev), SC_DRIVER_NAME) != 0 || unit >= SC_MD_MAX) return (ENXIO); device_set_desc(dev, "System console"); return (sc_probe_unit(unit, device_get_flags(dev) | SC_MD_FLAGS)); }
static int auxio_bus_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (strcmp("auxio", name) == 0) { device_set_desc(dev, "Sun Auxiliary I/O"); return (0); } return (ENXIO); }
static int rtasdev_probe(device_t dev) { const char *name = ofw_bus_get_name(dev); if (strcmp(name, "rtas") != 0) return (ENXIO); if (!rtas_exists()) return (ENXIO); device_set_desc(dev, "Run-Time Abstraction Services"); return (0); }
static int ofw_clkbus_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name == NULL || strcmp(name, "clocks") != 0) return (ENXIO); device_set_desc(dev, "OFW clocks bus"); return (BUS_PROBE_GENERIC); }
static int ofw_cpulist_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name == NULL || strcmp(name, "cpus") != 0) return (ENXIO); device_set_desc(dev, "Open Firmware CPU Group"); return (0); }
static int scc_macio_probe(device_t dev) { struct scc_softc *sc; const char *nm; sc = device_get_softc(dev); nm = ofw_bus_get_name(dev); if (!strcmp(nm, "escc")) { device_set_desc(dev, "Zilog Z8530 dual channel SCC"); sc->sc_class = &scc_z8530_class; return (scc_bfe_probe(dev, MACIO_REGSHFT, MACIO_RCLK, 0)); } return (ENXIO); }
static int rtc_ebus_probe(device_t dev) { if (strcmp(ofw_bus_get_name(dev), "rtc") == 0) { /* The bq4802 is not supported, yet. */ if (ofw_bus_get_compat(dev) != NULL && strcmp(ofw_bus_get_compat(dev), "bq4802") == 0) return (ENXIO); device_set_desc(dev, RTC_DESC); return (0); } return (ENXIO); }
static int esp_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (strcmp("SUNW,fas", name) == 0) { device_set_desc(dev, "Sun FAS366 Fast-Wide SCSI"); return (BUS_PROBE_DEFAULT); } else if (strcmp("esp", name) == 0) { device_set_desc(dev, "Sun ESP SCSI/Sun FAS Fast-SCSI"); return (BUS_PROBE_DEFAULT); } return (ENXIO); }
/***************************************************************************** Probe and attachment routines. *****************************************************************************/ static int davbus_probe(device_t self) { const char *name; name = ofw_bus_get_name(self); if (!name) return (ENXIO); if (strcmp(name, "davbus") != 0) return (ENXIO); device_set_desc(self, "Apple DAVBus Audio Controller"); return (0); }
static int aw_ccu_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name == NULL || strcmp(name, "clocks") != 0) return (ENXIO); if (aw_ccu_search_compatible()->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Allwinner Clock Control Unit"); return (BUS_PROBE_SPECIFIC); }
static int unin_chip_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name == NULL) return (ENXIO); if (strcmp(name, "uni-n") != 0 && strcmp(name, "u3") != 0 && strcmp(name, "u4") != 0) return (ENXIO); device_set_desc(dev, "Apple UniNorth System Controller"); return (0); }
static int ebus_probe(device_t dev) { if (pci_get_class(dev) != PCIC_BRIDGE || pci_get_vendor(dev) != 0x108e || strcmp(ofw_bus_get_name(dev), "ebus") != 0) return (ENXIO); if (pci_get_device(dev) == 0x1000) device_set_desc(dev, "PCI-EBus2 bridge"); else if (pci_get_device(dev) == 0x1100) device_set_desc(dev, "PCI-EBus3 bridge"); else return (ENXIO); return (0); }
static void ofwbus_probe_nomatch(device_t bus, device_t child) { const char *name, *type; if (!bootverbose) return; name = ofw_bus_get_name(child); type = ofw_bus_get_type(child); device_printf(bus, "<%s>", name != NULL ? name : "unknown"); ofwbus_print_res(device_get_ivars(child)); printf(" type %s (no driver attached)\n", type != NULL ? type : "unknown"); }
static int vdevice_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name == NULL || strcmp(name, "vdevice") != 0) return (ENXIO); if (!ofw_bus_is_compatible(dev, "IBM,vdevice")) return (ENXIO); device_set_desc(dev, "POWER Hypervisor Virtual Device Root"); return (0); }
static int tumbler_probe(device_t dev) { const char *name; name = ofw_bus_get_name(dev); if (name == NULL) return (ENXIO); if (strcmp(name, "deq") == 0 && iicbus_get_addr(dev) == TUMBLER_IICADDR) { device_set_desc(dev, "Texas Instruments TAS3001 Audio Codec"); return (0); } return (ENXIO); }
static int aoagpio_probe(device_t gpio) { phandle_t node; char bname[32]; const char *name; struct gpio_match *m; struct aoagpio_softc *sc; node = ofw_bus_get_node(gpio); if (node == 0 || node == -1) return (EINVAL); bzero(bname, sizeof(bname)); if (OF_getprop(node, "audio-gpio", bname, sizeof(bname)) > 2) name = bname; else name = ofw_bus_get_name(gpio); /* Try to find a match. */ for (m = gpio_controls; m->name != NULL; m++) { if (strcmp(name, m->name) == 0) { sc = device_get_softc(gpio); gpio_ctrls[m->ctrl] = sc; sc->dev = gpio; sc->ctrl = m->ctrl; sc->level = 0; sc->detect_active = 0; sc->i2s = NULL; OF_getprop(node, "audio-gpio-active-state", &sc->detect_active, sizeof(sc->detect_active)); if ((1 << m->ctrl) & GPIO_CTRL_EXTINT_SET) aoagpio_int(gpio); device_set_desc(gpio, m->name); device_quiet(gpio); return (0); } } return (ENXIO); }
static int scc_ebus_probe(device_t dev) { struct scc_softc *sc; const char *cmpt, *nm; sc = device_get_softc(dev); nm = ofw_bus_get_name(dev); cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); } return (ENXIO); }
static void macgpio_probe_nomatch(device_t dev, device_t child) { struct macgpio_devinfo *dinfo; const char *type; if (bootverbose) { dinfo = device_get_ivars(child); if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); if (dinfo->gpio_num >= 0) printf(" gpio %d",dinfo->gpio_num); resource_list_print_type(&dinfo->mdi_resources, "irq", SYS_RES_IRQ, "%jd"); printf(" (no driver attached)\n"); } }
static int pcf_ebus_probe(device_t dev) { const char *compat; /* * We must not attach to this i2c device if this is a system with * a boot-bus controller. Additionally testing the compatibility * property will hopefully take care of this. */ if (strcmp("i2c", ofw_bus_get_name(dev)) == 0) { compat = ofw_bus_get_compat(dev); if (compat != NULL && strcmp("i2cpcf,8584", compat) == 0) { device_set_desc(dev, "PCF8584 I2C bus controller"); return (0); } } return (ENXIO); }
static void unin_chip_probe_nomatch(device_t dev, device_t child) { struct unin_chip_devinfo *dinfo; struct resource_list *rl; const char *type; if (bootverbose) { dinfo = device_get_ivars(child); rl = &dinfo->udi_resources; if ((type = ofw_bus_get_type(child)) == NULL) type = "(unknown)"; device_printf(dev, "<%s, %s>", type, ofw_bus_get_name(child)); resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); printf(" (no driver attached)\n"); } }
static int uart_ebus_probe(device_t dev) { const char *nm, *cmpt; struct uart_softc *sc; struct uart_devinfo dummy; sc = device_get_softc(dev); sc->sc_class = NULL; nm = ofw_bus_get_name(dev); cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; if (!strcmp(nm, "lom-console") || !strcmp(nm, "su") || !strcmp(nm, "su_pnp") || !strcmp(cmpt, "rsc-console") || !strcmp(cmpt, "rsc-control") || !strcmp(cmpt, "su") || !strcmp(cmpt, "su16550")) { /* * On AXi and AXmp boards the NS16550 (used to connect * keyboard/mouse) share their IRQ lines with the i8042. * Any IRQ activity (typically during attach) of the * NS16550 used to connect the keyboard when actually the * PS/2 keyboard is selected in OFW causes interaction * with the OBP i8042 driver resulting in a hang and vice * versa. As RS232 keyboards and mice obviously aren't * meant to be used in parallel with PS/2 ones on these * boards don't attach to the NS16550 in case the RS232 * keyboard isn't selected in order to prevent such hangs. */ if ((!strcmp(sparc64_model, "SUNW,UltraAX-MP") || !strcmp(sparc64_model, "SUNW,UltraSPARC-IIi-Engine")) && uart_cpu_getdev(UART_DEV_KEYBOARD, &dummy)) { device_disable(dev); return (ENXIO); } sc->sc_class = &uart_ns8250_class; return (uart_bus_probe(dev, 0, 0, 0, 0)); } return (ENXIO); }
static int uart_phyp_probe(device_t dev) { const char *name; struct uart_phyp_softc sc; int err; name = ofw_bus_get_name(dev); if (name == NULL || strcmp(name, "vty") != 0) return (ENXIO); sc.node = ofw_bus_get_node(dev); err = uart_phyp_probe_node(&sc); if (err != 0) return (err); device_set_desc(dev, "POWER Hypervisor Virtual Serial Port"); return (err); }
static void simplebus_probe_nomatch(device_t bus, device_t child) { const char *name, *type, *compat; if (!bootverbose) return; compat = ofw_bus_get_compat(child); if (compat == NULL) return; name = ofw_bus_get_name(child); type = ofw_bus_get_type(child); device_printf(bus, "<%s>", name != NULL ? name : "unknown"); simplebus_print_res(device_get_ivars(child)); if (!ofw_bus_status_okay(child)) printf(" disabled"); if (type) printf(" type %s", type); printf(" compat %s (no driver attached)\n", compat); }