diff -urNX /usr/src/dontdiff mtd-cvs-20050307/drivers/mtd/chips/cfi_cmdset_0001.c mtd-cvs-20050315/drivers/mtd/chips/cfi_cmdset_0001.c --- mtd-cvs-20050307/drivers/mtd/chips/cfi_cmdset_0001.c 2006-07-31 22:46:14 +0200 +++ mtd-cvs-20050315/drivers/mtd/chips/cfi_cmdset_0001.c 2006-07-31 22:22:03 +0200 @@ -4,7 +4,7 @@ * * (C) 2000 Red Hat. GPL'd * - * $Id: cfi_cmdset_0001.c,v 1.168 2005/02/17 20:34:59 nico Exp $ + * $Id: cfi_cmdset_0001.c,v 1.169 2005/03/15 19:07:18 gleixner Exp $ * * * 10/10/2000 Nicolas Pitre @@ -1697,24 +1697,14 @@ /* check for lock bit */ if (map_word_bitsset(map, status, CMD(0x3a))) { - unsigned char chipstatus; + unsigned long chipstatus; /* Reset the error bits */ map_write(map, CMD(0x50), adr); map_write(map, CMD(0x70), adr); xip_enable(map, chip, adr); - chipstatus = status.x[0]; - if (!map_word_equal(map, status, CMD(chipstatus))) { - int i, w; - for (w=0; w> (cfi->device_type * 8); - } - } - printk(KERN_WARNING "Status is not identical for all chips: 0x%lx. Merging to give 0x%02x\n", - status.x[0], chipstatus); - } + chipstatus = MERGESTATUS(status); if ((chipstatus & 0x30) == 0x30) { printk(KERN_NOTICE "Chip reports improper command sequence: status 0x%x\n", chipstatus); diff -urNX /usr/src/dontdiff mtd-cvs-20050307/drivers/mtd/chips/jedec_probe.c mtd-cvs-20050315/drivers/mtd/chips/jedec_probe.c --- mtd-cvs-20050307/drivers/mtd/chips/jedec_probe.c 2006-07-31 22:46:14 +0200 +++ mtd-cvs-20050315/drivers/mtd/chips/jedec_probe.c 2006-07-31 22:19:06 +0200 @@ -1,7 +1,7 @@ /* Common Flash Interface probe code. (C) 2000 Red Hat. GPL'd. - $Id: jedec_probe.c,v 1.63 2005/02/14 16:30:32 bjd Exp $ + $Id: jedec_probe.c,v 1.64 2005/03/14 20:34:13 bjd Exp $ See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5) for the standard this probe goes back to. @@ -1283,7 +1283,8 @@ .DevSize = SIZE_256KiB, .CmdSet = P_ID_SST_PAGE, .NumEraseRegions= 1, - regions: {ERASEINFO(0x01000,64), + .regions = { + ERASEINFO(0x01000,64), } }, { .mfr_id = MANUFACTURER_SST, @@ -1295,7 +1296,8 @@ .DevSize = SIZE_256KiB, .CmdSet = P_ID_SST_PAGE, .NumEraseRegions= 1, - regions: {ERASEINFO(0x01000,64), + .regions = { + ERASEINFO(0x01000,64), } }, { .mfr_id = MANUFACTURER_SST, diff -urNX /usr/src/dontdiff mtd-cvs-20050307/drivers/mtd/maps/plat-ram.c mtd-cvs-20050315/drivers/mtd/maps/plat-ram.c --- mtd-cvs-20050307/drivers/mtd/maps/plat-ram.c 2006-07-31 22:46:15 +0200 +++ mtd-cvs-20050315/drivers/mtd/maps/plat-ram.c 2006-07-31 22:19:08 +0200 @@ -6,7 +6,7 @@ * * Generic platfrom device based RAM map * - * $Id: plat-ram.c,v 1.1 2005/01/24 00:37:02 bjd Exp $ + * $Id: plat-ram.c,v 1.2 2005/03/14 20:33:19 bjd Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,8 +23,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define DEBUG - #include #include #include @@ -192,7 +190,7 @@ /* remap the memory area */ info->map.virt = ioremap(res->start, info->map.size); - dev_dbg(dev, "virt %p, %d bytes\n", info->map.virt, info->map.size); + dev_dbg(dev, "virt %p, %lu bytes\n", info->map.virt, info->map.size); if (info->map.virt == NULL) { dev_err(dev, "failed to ioremap() region\n"); @@ -200,12 +198,6 @@ goto exit_free; } - { - unsigned int *p = (unsigned int *)info->map.virt; - printk("%08x %08x %08x %08x\n", - readl(p), readl(p+1), readl(p+2), readl(p+3)); - } - simple_map_init(&info->map); dev_dbg(dev, "initialised map, probing for mtd\n"); diff -urNX /usr/src/dontdiff mtd-cvs-20050307/drivers/mtd/nand/nand_base.c mtd-cvs-20050315/drivers/mtd/nand/nand_base.c --- mtd-cvs-20050307/drivers/mtd/nand/nand_base.c 2006-07-31 22:46:15 +0200 +++ mtd-cvs-20050315/drivers/mtd/nand/nand_base.c 2006-07-31 22:19:09 +0200 @@ -59,7 +59,7 @@ * The AG-AND chips have nice features for speed improvement, * which are not supported yet. Read / program 4 pages in one go. * - * $Id: nand_base.c,v 1.135 2005/03/01 09:32:45 gleixner Exp $ + * $Id: nand_base.c,v 1.136 2005/03/14 18:30:44 bjd Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -2291,7 +2291,7 @@ */ int nand_scan (struct mtd_info *mtd, int maxchips) { - int i, j, nand_maf_id, nand_dev_id, busw, maf_id; + int i, nand_maf_id, nand_dev_id, busw, maf_id; struct nand_chip *this = mtd->priv; /* Get buswidth to select the correct functions*/ diff -urNX /usr/src/dontdiff mtd-cvs-20050307/include/linux/mtd/cfi.h mtd-cvs-20050315/include/linux/mtd/cfi.h --- mtd-cvs-20050307/include/linux/mtd/cfi.h 2006-07-31 22:46:27 +0200 +++ mtd-cvs-20050315/include/linux/mtd/cfi.h 2006-07-31 22:15:51 +0200 @@ -1,7 +1,7 @@ /* Common Flash Interface structures * See http://support.intel.com/design/flash/technote/index.htm - * $Id: cfi.h,v 1.52 2005/02/08 17:11:15 nico Exp $ + * $Id: cfi.h,v 1.53 2005/03/15 19:03:13 gleixner Exp $ */ #ifndef __MTD_CFI_H__ @@ -315,6 +315,69 @@ } #define CMD(x) cfi_build_cmd((x), map, cfi) + +static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, + struct cfi_private *cfi) +{ + int wordwidth, words_per_bus, chip_mode, chips_per_word; + unsigned long onestat, res = 0; + int i; + + /* We do it this way to give the compiler a fighting chance + of optimising away all the crap for 'bankwidth' larger than + an unsigned long, in the common case where that support is + disabled */ + if (map_bankwidth_is_large(map)) { + wordwidth = sizeof(unsigned long); + words_per_bus = (map_bankwidth(map)) / wordwidth; // i.e. normally 1 + } else { + wordwidth = map_bankwidth(map); + words_per_bus = 1; + } + + chip_mode = map_bankwidth(map) / cfi_interleave(cfi); + chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); + + onestat = val.x[0]; + /* Or all status words together */ + for (i=1; i < words_per_bus; i++) { + onestat |= val.x[i]; + } + + res = onestat; + switch(chips_per_word) { + default: BUG(); +#if BITS_PER_LONG >= 64 + case 8: + res |= (onestat >> (chip_mode * 32)); +#endif + case 4: + res |= (onestat >> (chip_mode * 16)); + case 2: + res |= (onestat >> (chip_mode * 8)); + case 1: + ; + } + + /* Last, determine what the bit-pattern should be for a single + device, according to chip mode and endianness... */ + switch (chip_mode) { + case 1: + break; + case 2: + res = cfi16_to_cpu(res); + break; + case 4: + res = cfi32_to_cpu(res); + break; + default: BUG(); + } + return res; +} + +#define MERGESTATUS(x) cfi_merge_status((x), map, cfi) + + /* * Sends a CFI command to a bank of flash for the given geometry. * diff -urNX /usr/src/dontdiff mtd-cvs-20050307/include/linux/mtd/flashchip.h mtd-cvs-20050315/include/linux/mtd/flashchip.h --- mtd-cvs-20050307/include/linux/mtd/flashchip.h 2006-07-31 22:46:27 +0200 +++ mtd-cvs-20050315/include/linux/mtd/flashchip.h 2006-07-31 22:15:51 +0200 @@ -6,7 +6,7 @@ * * (C) 2000 Red Hat. GPLd. * - * $Id: flashchip.h,v 1.16 2005/02/08 17:11:15 nico Exp $ + * $Id: flashchip.h,v 1.17 2005/03/14 18:27:15 bjd Exp $ * */ @@ -63,8 +63,8 @@ flstate_t state; flstate_t oldstate; - int write_suspended:1; - int erase_suspended:1; + unsigned int write_suspended:1; + unsigned int erase_suspended:1; unsigned long in_progress_block_addr; spinlock_t *mutex;