staticstruct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe *cp)
{ struct cfi_private cfi; struct cfi_private *retcfi; unsignedlong *chip_map; int max_chips; int i, j;
memset(&cfi, 0, sizeof(cfi));
/* Call the probetype-specific code with all permutations of
interleave and device type, etc. */ if (!genprobe_new_chip(map, cp, &cfi)) { /* The probe didn't like it */
pr_debug("%s: Found no %s device at location zero\n",
cp->name, map->name); return NULL;
}
#if 0 /* Let the CFI probe routine do this sanity check. The Intel and AMD probe routines won't ever return a broken CFI structure anyway, because they make them up themselves.
*/ if (cfi.cfiq->NumEraseRegions == 0) {
printk(KERN_WARNING "Number of erase regions is zero\n");
kfree(cfi.cfiq); return NULL;
} #endif
cfi.chipshift = cfi.cfiq->DevSize;
/* * Allocate memory for bitmap of valid chips. * Align bitmap storage size to full byte.
*/
max_chips = map->size >> cfi.chipshift; if (!max_chips) {
printk(KERN_WARNING "NOR chip too large to fit in mapping. Attempting to cope...\n");
max_chips = 1;
}
/* * Now probe for other chips, checking sensibly for aliases while * we're at it. The new_chip probe above should have let the first * chip in read mode.
*/
for (i = 1; i < max_chips; i++) {
cp->probe_chip(map, i << cfi.chipshift, chip_map, &cfi);
}
/* * Now allocate the space for the structures we need to return to * our caller, and copy the appropriate data into them.
*/
mtd = (*probe_function)(map, primary); /* If it was happy, it'll have increased its own use count */
symbol_put_addr(probe_function); return mtd;
} #endif
printk(KERN_NOTICE "Support for command set %04X not present\n", type);
return NULL;
}
staticstruct mtd_info *check_cmd_set(struct map_info *map, int primary)
{ struct cfi_private *cfi = map->fldrv_priv;
__u16 type = primary?cfi->cfiq->P_ID:cfi->cfiq->A_ID;
if (type == P_ID_NONE || type == P_ID_RESERVED) return NULL;
switch(type){ /* We need these for the !CONFIG_MODULES case,
because symbol_get() doesn't work there */ #ifdef CONFIG_MTD_CFI_INTELEXT case P_ID_INTEL_EXT: case P_ID_INTEL_STD: case P_ID_INTEL_PERFORMANCE: return cfi_cmdset_0001(map, primary); #endif #ifdef CONFIG_MTD_CFI_AMDSTD case P_ID_AMD_STD: case P_ID_SST_OLD: case P_ID_WINBOND: return cfi_cmdset_0002(map, primary); #endif #ifdef CONFIG_MTD_CFI_STAA case P_ID_ST_ADV: return cfi_cmdset_0020(map, primary); #endif default: return cfi_cmdset_unknown(map, primary);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.