static int cfi_fdt_probe(device_t dev) { if (!ofw_bus_is_compatible(dev, "cfi-flash")) return (ENXIO); return (cfi_probe(dev)); }
static int cfi_xlp_probe(device_t dev) { if (pci_get_vendor(dev) != PCI_VENDOR_NETLOGIC || pci_get_device(dev) != PCI_DEVICE_ID_NLM_NOR) return (ENXIO); device_set_desc(dev, "Netlogic XLP NOR Bus"); return (cfi_probe(dev)); }
static int cfi_nexus_attach(device_t dev) { int error; error = cfi_probe(dev); if (error != 0) return (error); return cfi_attach(dev); }
bool cfi_identify(struct cfi * const cfi) { const bus_space_tag_t bst = cfi->cfi_bst; const bus_space_handle_t bsh = cfi->cfi_bsh; KASSERT(cfi != NULL); KASSERT(bst != NULL); memset(cfi, 0, sizeof(struct cfi)); /* XXX clean slate */ cfi->cfi_bst = bst; /* restore bus space */ cfi->cfi_bsh = bsh; /* " " " */ return cfi_probe(cfi); }
static int cfi_ixp4xx_probe(device_t dev) { struct cfi_softc *sc = device_get_softc(dev); /* * NB: we assume the boot loader sets up EXP_TIMING_CS0_OFFSET * according to the flash on the board. If it does not then it * can be done here. */ if (bootverbose) { struct ixp425_softc *sa = device_get_softc(device_get_parent(dev)); device_printf(dev, "EXP_TIMING_CS0_OFFSET 0x%x\n", EXP_BUS_READ_4(sa, EXP_TIMING_CS0_OFFSET)); } sc->sc_width = 2; /* NB: don't probe interface width */ return cfi_probe(dev); }
int old_pcmcia_sleeve_attach_flash(void (*set_vpp)(struct map_info *, int), unsigned long map_size) { void *(*cfi_probe)(void *) = inter_module_get("cfi_probe"); printk(" ### " __FUNCTION__ "\n"); if (cfi_probe != NULL) { /* * assuming 150ns Flash, 30ns extra to cross the expansion ASIC and control logic * and 206 MHz CPU clock (4ns ns cycle time, up to 250MHz) */ unsigned long msc1_sm1_config = (MSC_NonBrst | MSC_16BitStMem | MSC_RdAcc((150 + 100)/4) | MSC_NxtRdAcc((150 + 100)/4) | MSC_Rec(100/4)); msc1_sm1_config = 0xFFFC; MSC1 = ((MSC1 & 0xFFFF) /* sm0 */ | (msc1_sm1_config << 16)); printk(__FUNCTION__ ": setting MSC1=0x%x\n", MSC1); pcmcia_sleeve_flash_map.set_vpp = set_vpp; pcmcia_sleeve_flash_map.size = map_size; pcmcia_sleeve_mtd = cfi_probe(&pcmcia_sleeve_flash_map); if (pcmcia_sleeve_mtd) { pcmcia_sleeve_mtd->module = THIS_MODULE; if ( add_mtd_partitions(pcmcia_sleeve_mtd, pcmcia_sleeve_flash_partitions, NB_OF(pcmcia_sleeve_flash_partitions))) printk(" *** " __FUNCTION__ ": unable to add flash partitions\n"); printk(KERN_NOTICE "PCMCIA flash access initialized\n"); return 0; } return -ENXIO; } else { return -EINVAL; } }
static int cfi_econa_probe(device_t dev) { return cfi_probe(dev); }
static int cfi_nexus_probe(device_t dev) { return cfi_probe(dev); }