--- zzzz-none-000/linux-2.4.17/drivers/mtd/chips/cfi_probe.c 2001-10-04 22:14:59.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/drivers/mtd/chips/cfi_probe.c 2004-11-24 13:22:49.000000000 +0000 @@ -1,7 +1,7 @@ /* Common Flash Interface probe code. (C) 2000 Red Hat. GPL'd. - $Id: cfi_probe.c,v 1.66 2001/10/02 15:05:12 dwmw2 Exp $ + $Id: cfi_probe.c,v 1.1.1.1 2003/06/23 22:18:28 jharrell Exp $ */ #include @@ -44,9 +44,24 @@ if (cfi_read(map,base+osf*0x10)==cfi_build_cmd('Q',map,cfi) && cfi_read(map,base+osf*0x11)==cfi_build_cmd('R',map,cfi) && - cfi_read(map,base+osf*0x12)==cfi_build_cmd('Y',map,cfi)) - return 1; // ok ! - + cfi_read(map,base+osf*0x12)==cfi_build_cmd('Y',map,cfi)) { +#ifdef CFIDEV_BUSWIDTH_8 + if (map->buswidth == 8) { + if (cfi_read(map,base+0x04+osf*0x10)==cfi_build_cmd('Q',map,cfi) && + cfi_read(map,base+0x04+osf*0x11)==cfi_build_cmd('R',map,cfi) && + cfi_read(map,base+0x04+osf*0x12)==cfi_build_cmd('Y',map,cfi)) { + return 1; // ok ! + } + else { + printk("cfi_check_qry_or_id: 64 bit upper range BAD \n"); + } + } + else + return 1; // ok ! +#else + return 1; // ok ! +#endif + } return 0; // nothing found } @@ -55,7 +70,7 @@ { int i; - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); if (!qry_present(map,base,cfi)) @@ -74,7 +89,10 @@ if (qry_present(map,chips[i].start,cfi)) { /* Eep. This chip also had the QRY marker. * Is it an alias for the new one? */ - cfi_send_gen_cmd(0xF0, 0, chips[i].start, map, cfi, cfi->device_type, NULL); + +/* Commented the following lines to avoid chip alias detection. */ +#if 0 + cfi_send_gen_cmd(0xFF, 0, chips[i].start, map, cfi, cfi->device_type, NULL); /* If the QRY marker goes away, it's an alias */ if (!qry_present(map, chips[i].start, cfi)) { @@ -82,11 +100,13 @@ map->name, base, chips[i].start); return 0; } +#endif + /* Yes, it's actually got QRY for data. Most * unfortunate. Stick the new chip in read mode * too and if it's the same, assume it's an alias. */ /* FIXME: Use other modes to do a proper check */ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); if (qry_present(map, base, cfi)) { printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n", @@ -108,7 +128,7 @@ cfi->numchips++; /* Put it back into Read Mode */ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit mode\n", map->name, cfi->interleave, cfi->device_type*8, base, @@ -171,7 +191,7 @@ #endif } /* Put it back into Read Mode */ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); + cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); return 1; } @@ -240,21 +260,21 @@ else printk("No Vpp line\n"); - printk("Typical byte/word write timeout: %d µs\n", 1<WordWriteTimeoutTyp); - printk("Maximum byte/word write timeout: %d µs\n", (1<WordWriteTimeoutMax) * (1<WordWriteTimeoutTyp)); + printk("Typical byte/word write timeout: %d ´s\n", 1<WordWriteTimeoutTyp); + printk("Maximum byte/word write timeout: %d ´s\n", (1<WordWriteTimeoutMax) * (1<WordWriteTimeoutTyp)); if (cfip->BufWriteTimeoutTyp || cfip->BufWriteTimeoutMax) { - printk("Typical full buffer write timeout: %d µs\n", 1<BufWriteTimeoutTyp); - printk("Maximum full buffer write timeout: %d µs\n", (1<BufWriteTimeoutMax) * (1<BufWriteTimeoutTyp)); + printk("Typical full buffer write timeout: %d ´s\n", 1<BufWriteTimeoutTyp); + printk("Maximum full buffer write timeout: %d ´s\n", (1<BufWriteTimeoutMax) * (1<BufWriteTimeoutTyp)); } else printk("Full buffer write not supported\n"); - printk("Typical block erase timeout: %d µs\n", 1<BlockEraseTimeoutTyp); - printk("Maximum block erase timeout: %d µs\n", (1<BlockEraseTimeoutMax) * (1<BlockEraseTimeoutTyp)); + printk("Typical block erase timeout: %d ´s\n", 1<BlockEraseTimeoutTyp); + printk("Maximum block erase timeout: %d ´s\n", (1<BlockEraseTimeoutMax) * (1<BlockEraseTimeoutTyp)); if (cfip->ChipEraseTimeoutTyp || cfip->ChipEraseTimeoutMax) { - printk("Typical chip erase timeout: %d µs\n", 1<ChipEraseTimeoutTyp); - printk("Maximum chip erase timeout: %d µs\n", (1<ChipEraseTimeoutMax) * (1<ChipEraseTimeoutTyp)); + printk("Typical chip erase timeout: %d ´s\n", 1<ChipEraseTimeoutTyp); + printk("Maximum chip erase timeout: %d ´s\n", (1<ChipEraseTimeoutMax) * (1<ChipEraseTimeoutTyp)); } else printk("Chip erase not supported\n");