7 #include <linux/kernel.h>
8 #include <linux/slab.h>
9 #include <linux/module.h>
27 cfi = genprobe_ident_chips(map, cp);
35 mtd = check_cmd_set(map, 1);
37 mtd = check_cmd_set(map, 0);
42 (
unsigned long)mtd->
size >> 10,
43 (
unsigned long)map->
size >> 10);
63 unsigned long *chip_map;
67 memset(&cfi, 0,
sizeof(cfi));
71 if (!genprobe_new_chip(map, cp, &cfi)) {
73 pr_debug(
"%s: Found no %s device at location zero\n",
82 if (cfi.cfiq->NumEraseRegions == 0) {
88 cfi.chipshift = cfi.cfiq->DevSize;
108 max_chips = map->
size >> cfi.chipshift;
130 for (i = 1; i < max_chips; i++) {
131 cp->
probe_chip(map, i << cfi.chipshift, chip_map, &cfi);
148 memcpy(retcfi, &cfi,
sizeof(cfi));
151 for (i = 0, j = 0; (j < cfi.numchips) && (i < max_chips); i++) {
155 pchip->
start = (i << cfi.chipshift);
170 int min_chips = (map_bankwidth(map)/4?:1);
171 int max_chips = map_bankwidth(map);
174 for (nr_chips = max_chips; nr_chips >= min_chips; nr_chips >>= 1) {
176 if (!cfi_interleave_supported(nr_chips))
183 type = map_bankwidth(map) / nr_chips;
206 #ifdef CONFIG_MODULES
213 if (!probe_function) {
218 if (probe_function) {
243 #ifdef CONFIG_MTD_CFI_INTELEXT
249 #ifdef CONFIG_MTD_CFI_AMDSTD
255 #ifdef CONFIG_MTD_CFI_STAA
260 return cfi_cmdset_unknown(map, primary);