Lines Matching +full:primary +full:- +full:device
1 // SPDX-License-Identifier: GPL-2.0
3 * Routines common to all CFI-type probes.
4 * (C) 2001-2003 Red Hat, Inc.
32 map->fldrv_priv = cfi; in mtd_do_chip_probe()
35 mtd = check_cmd_set(map, 1); /* First the primary cmdset */ in mtd_do_chip_probe()
40 if (mtd->size > map->size) { in mtd_do_chip_probe()
42 (unsigned long)mtd->size >> 10, in mtd_do_chip_probe()
43 (unsigned long)map->size >> 10); in mtd_do_chip_probe()
44 mtd->size = map->size; in mtd_do_chip_probe()
51 kfree(cfi->cfiq); in mtd_do_chip_probe()
53 map->fldrv_priv = NULL; in mtd_do_chip_probe()
69 /* Call the probetype-specific code with all permutations of in genprobe_ident_chips()
70 interleave and device type, etc. */ in genprobe_ident_chips()
73 pr_debug("%s: Found no %s device at location zero\n", in genprobe_ident_chips()
74 cp->name, map->name); in genprobe_ident_chips()
82 if (cfi.cfiq->NumEraseRegions == 0) { in genprobe_ident_chips()
88 cfi.chipshift = cfi.cfiq->DevSize; in genprobe_ident_chips()
108 max_chips = map->size >> cfi.chipshift; in genprobe_ident_chips()
129 cp->probe_chip(map, i << cfi.chipshift, chip_map, &cfi); in genprobe_ident_chips()
146 memset(&retcfi->chips[0], 0, sizeof(struct flchip) * cfi.numchips); in genprobe_ident_chips()
150 struct flchip *pchip = &retcfi->chips[j++]; in genprobe_ident_chips()
152 pchip->start = (i << cfi.chipshift); in genprobe_ident_chips()
153 pchip->state = FL_READY; in genprobe_ident_chips()
154 init_waitqueue_head(&pchip->wq); in genprobe_ident_chips()
155 mutex_init(&pchip->mutex); in genprobe_ident_chips()
167 int min_chips = (map_bankwidth(map)/4?:1); /* At most 4-bytes wide. */ in genprobe_new_chip()
176 cfi->interleave = nr_chips; in genprobe_new_chip()
178 /* Minimum device size. Don't look for one 8-bit device in genprobe_new_chip()
179 in a 16-bit bus, etc. */ in genprobe_new_chip()
183 cfi->device_type = type; in genprobe_new_chip()
185 if (cp->probe_chip(map, 0, NULL, cfi)) in genprobe_new_chip()
199 int primary) in cfi_cmdset_unknown() argument
201 struct cfi_private *cfi = map->fldrv_priv; in cfi_cmdset_unknown()
202 __u16 type = primary?cfi->cfiq->P_ID:cfi->cfiq->A_ID; in cfi_cmdset_unknown()
221 mtd = (*probe_function)(map, primary); in cfi_cmdset_unknown()
232 static struct mtd_info *check_cmd_set(struct map_info *map, int primary) in check_cmd_set() argument
234 struct cfi_private *cfi = map->fldrv_priv; in check_cmd_set()
235 __u16 type = primary?cfi->cfiq->P_ID:cfi->cfiq->A_ID; in check_cmd_set()
247 return cfi_cmdset_0001(map, primary); in check_cmd_set()
253 return cfi_cmdset_0002(map, primary); in check_cmd_set()
257 return cfi_cmdset_0020(map, primary); in check_cmd_set()
260 return cfi_cmdset_unknown(map, primary); in check_cmd_set()