Lines Matching +full:interleave +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
83 for (f = fixups; f->fixup; f++) { in cfi_early_fixup()
84 if (((f->mfr == CFI_MFR_ANY) || (f->mfr == cfi->mfr)) && in cfi_early_fixup()
85 ((f->id == CFI_ID_ANY) || (f->id == cfi->id))) { in cfi_early_fixup()
86 f->fixup(cfi); in cfi_early_fixup()
92 in: interleave,type,mode
101 if ((base + 0) >= map->size) { in cfi_probe_chip()
104 (unsigned long)base, map->size -1); in cfi_probe_chip()
107 if ((base + 0xff) >= map->size) { in cfi_probe_chip()
110 (unsigned long)base + 0x55, map->size -1); in cfi_probe_chip()
120 if (!cfi->numchips) { in cfi_probe_chip()
127 for (i=0; i < (base >> cfi->chipshift); i++) { in cfi_probe_chip()
133 start = i << cfi->chipshift; in cfi_probe_chip()
134 /* This chip should be in read mode if it's one in cfi_probe_chip()
145 map->name, base, start); in cfi_probe_chip()
149 * unfortunate. Stick the new chip in read mode in cfi_probe_chip()
157 map->name, base, start); in cfi_probe_chip()
165 set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */ in cfi_probe_chip()
166 cfi->numchips++; in cfi_probe_chip()
168 /* Put it back into Read Mode */ in cfi_probe_chip()
172 printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n", in cfi_probe_chip()
173 map->name, cfi->interleave, cfi->device_type*8, base, in cfi_probe_chip()
174 map->bankwidth*8); in cfi_probe_chip()
185 cfi->cfiq->DevSize = 27; in fixup_s70gl02gs_chips()
186 cfi->cfiq->EraseRegionInfo[0] = 0x20003ff; in fixup_s70gl02gs_chips()
198 int ofs_factor = cfi->interleave*cfi->device_type; in cfi_chip_setup()
211 cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL); in cfi_chip_setup()
212 if (!cfi->cfiq) in cfi_chip_setup()
215 memset(cfi->cfiq,0,sizeof(struct cfi_ident)); in cfi_chip_setup()
217 cfi->cfi_mode = CFI_MODE_CFI; in cfi_chip_setup()
219 cfi->sector_erase_cmd = CMD(0x30); in cfi_chip_setup()
224 ((unsigned char *)cfi->cfiq)[i] = cfi_read_query(map,base + (0x10 + i)*ofs_factor); in cfi_chip_setup()
227 cfi->cfiq->P_ID = le16_to_cpu(cfi->cfiq->P_ID); in cfi_chip_setup()
229 cfi->cfiq->P_ADR = le16_to_cpu(cfi->cfiq->P_ADR); in cfi_chip_setup()
230 cfi->cfiq->A_ID = le16_to_cpu(cfi->cfiq->A_ID); in cfi_chip_setup()
231 cfi->cfiq->A_ADR = le16_to_cpu(cfi->cfiq->A_ADR); in cfi_chip_setup()
232 cfi->cfiq->InterfaceDesc = le16_to_cpu(cfi->cfiq->InterfaceDesc); in cfi_chip_setup()
233 cfi->cfiq->MaxBufWriteSize = le16_to_cpu(cfi->cfiq->MaxBufWriteSize); in cfi_chip_setup()
237 print_cfi_ident(cfi->cfiq); in cfi_chip_setup()
240 for (i=0; i<cfi->cfiq->NumEraseRegions; i++) { in cfi_chip_setup()
241 cfi->cfiq->EraseRegionInfo[i] = le32_to_cpu(cfi->cfiq->EraseRegionInfo[i]); in cfi_chip_setup()
245 i, (cfi->cfiq->EraseRegionInfo[i] >> 8) & ~0xff, in cfi_chip_setup()
246 (cfi->cfiq->EraseRegionInfo[i] & 0xffff) + 1); in cfi_chip_setup()
250 if (cfi->cfiq->P_ID == P_ID_SST_OLD) { in cfi_chip_setup()
256 * Note we put the device back into Read Mode BEFORE going into Auto in cfi_chip_setup()
257 * Select Mode, as some devices support nesting of modes, others in cfi_chip_setup()
261 * back into Read Mode, which is a nop in this case). in cfi_chip_setup()
263 cfi_send_gen_cmd(0xf0, 0, base, map, cfi, cfi->device_type, NULL); in cfi_chip_setup()
264 cfi_send_gen_cmd(0xaa, addr_unlock1, base, map, cfi, cfi->device_type, NULL); in cfi_chip_setup()
265 cfi_send_gen_cmd(0x55, addr_unlock2, base, map, cfi, cfi->device_type, NULL); in cfi_chip_setup()
266 cfi_send_gen_cmd(0x90, addr_unlock1, base, map, cfi, cfi->device_type, NULL); in cfi_chip_setup()
267 cfi->mfr = cfi_read_query16(map, base); in cfi_chip_setup()
268 cfi->id = cfi_read_query16(map, base + ofs_factor); in cfi_chip_setup()
271 if (cfi->mfr == CFI_MFR_AMD && (cfi->id & 0xff) == 0x7e) in cfi_chip_setup()
272 cfi->id = cfi_read_query(map, base + 0xe * ofs_factor) << 8 | in cfi_chip_setup()
275 /* Put it back into Read Mode */ in cfi_chip_setup()
281 …printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank. Manufacturer ID %#08x Chip ID %… in cfi_chip_setup()
282 map->name, cfi->interleave, cfi->device_type*8, base, in cfi_chip_setup()
283 map->bankwidth*8, cfi->mfr, cfi->id); in cfi_chip_setup()
343 if (cfip->qry[0] != 'Q' || cfip->qry[1] != 'R' || cfip->qry[2] != 'Y') { in print_cfi_ident()
348 printk("Primary Vendor Command Set: %4.4X (%s)\n", cfip->P_ID, vendorname(cfip->P_ID)); in print_cfi_ident()
349 if (cfip->P_ADR) in print_cfi_ident()
350 printk("Primary Algorithm Table at %4.4X\n", cfip->P_ADR); in print_cfi_ident()
354 printk("Alternative Vendor Command Set: %4.4X (%s)\n", cfip->A_ID, vendorname(cfip->A_ID)); in print_cfi_ident()
355 if (cfip->A_ADR) in print_cfi_ident()
356 printk("Alternate Algorithm Table at %4.4X\n", cfip->A_ADR); in print_cfi_ident()
361 printk("Vcc Minimum: %2d.%d V\n", cfip->VccMin >> 4, cfip->VccMin & 0xf); in print_cfi_ident()
362 printk("Vcc Maximum: %2d.%d V\n", cfip->VccMax >> 4, cfip->VccMax & 0xf); in print_cfi_ident()
363 if (cfip->VppMin) { in print_cfi_ident()
364 printk("Vpp Minimum: %2d.%d V\n", cfip->VppMin >> 4, cfip->VppMin & 0xf); in print_cfi_ident()
365 printk("Vpp Maximum: %2d.%d V\n", cfip->VppMax >> 4, cfip->VppMax & 0xf); in print_cfi_ident()
370 printk("Typical byte/word write timeout: %d µs\n", 1<<cfip->WordWriteTimeoutTyp); in print_cfi_ident()
371 …printk("Maximum byte/word write timeout: %d µs\n", (1<<cfip->WordWriteTimeoutMax) * (1<<cfip->Word… in print_cfi_ident()
373 if (cfip->BufWriteTimeoutTyp || cfip->BufWriteTimeoutMax) { in print_cfi_ident()
374 printk("Typical full buffer write timeout: %d µs\n", 1<<cfip->BufWriteTimeoutTyp); in print_cfi_ident()
375 …printk("Maximum full buffer write timeout: %d µs\n", (1<<cfip->BufWriteTimeoutMax) * (1<<cfip->Buf… in print_cfi_ident()
380 printk("Typical block erase timeout: %d ms\n", 1<<cfip->BlockEraseTimeoutTyp); in print_cfi_ident()
381 …printk("Maximum block erase timeout: %d ms\n", (1<<cfip->BlockEraseTimeoutMax) * (1<<cfip->BlockEr… in print_cfi_ident()
382 if (cfip->ChipEraseTimeoutTyp || cfip->ChipEraseTimeoutMax) { in print_cfi_ident()
383 printk("Typical chip erase timeout: %d ms\n", 1<<cfip->ChipEraseTimeoutTyp); in print_cfi_ident()
384 …printk("Maximum chip erase timeout: %d ms\n", (1<<cfip->ChipEraseTimeoutMax) * (1<<cfip->ChipErase… in print_cfi_ident()
389 printk("Device size: 0x%X bytes (%d MiB)\n", 1 << cfip->DevSize, 1<< (cfip->DevSize - 20)); in print_cfi_ident()
390 printk("Flash Device Interface description: 0x%4.4X\n", cfip->InterfaceDesc); in print_cfi_ident()
391 switch(cfip->InterfaceDesc) { in print_cfi_ident()
393 printk(" - x8-only asynchronous interface\n"); in print_cfi_ident()
397 printk(" - x16-only asynchronous interface\n"); in print_cfi_ident()
401 printk(" - supports x8 and x16 via BYTE# with asynchronous interface\n"); in print_cfi_ident()
405 printk(" - x32-only asynchronous interface\n"); in print_cfi_ident()
409 printk(" - supports x16 and x32 via Word# with asynchronous interface\n"); in print_cfi_ident()
413 printk(" - Not Allowed / Reserved\n"); in print_cfi_ident()
417 printk(" - Unknown\n"); in print_cfi_ident()
421 printk("Max. bytes in buffer write: 0x%x\n", 1<< cfip->MaxBufWriteSize); in print_cfi_ident()
422 printk("Number of Erase Block Regions: %d\n", cfip->NumEraseRegions); in print_cfi_ident()
435 * Just use the generic probe stuff to call our CFI-specific in cfi_probe()
463 MODULE_DESCRIPTION("Probe code for CFI-compliant flash chips");