···4 *5 * (C) 2000 Red Hat. GPL'd6 *7- * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $8 *9 *10 * 10/10/2000 Nicolas Pitre <nico@cam.org>···644 *645 * - contension arbitration is handled in the owner's context.646 *647- * The 'shared' struct can be read when its lock is taken.648- * However any writes to it can only be made when the current649- * owner's lock is also held.650 */651 struct flchip_shared *shared = chip->priv;652 struct flchip *contender;···674 }675 timeo = jiffies + HZ;676 spin_lock(&shared->lock);0677 }678679 /* We now own it */680 shared->writing = chip;681 if (mode == FL_ERASING)682 shared->erasing = chip;683- if (contender && contender != chip)684- spin_unlock(contender->mutex);685 spin_unlock(&shared->lock);686 }687
···4 *5 * (C) 2000 Red Hat. GPL'd6 *7+ * $Id: cfi_cmdset_0001.c,v 1.186 2005/11/23 22:07:52 nico Exp $8 *9 *10 * 10/10/2000 Nicolas Pitre <nico@cam.org>···644 *645 * - contension arbitration is handled in the owner's context.646 *647+ * The 'shared' struct can be read and/or written only when648+ * its lock is taken.0649 */650 struct flchip_shared *shared = chip->priv;651 struct flchip *contender;···675 }676 timeo = jiffies + HZ;677 spin_lock(&shared->lock);678+ spin_unlock(contender->mutex);679 }680681 /* We now own it */682 shared->writing = chip;683 if (mode == FL_ERASING)684 shared->erasing = chip;00685 spin_unlock(&shared->lock);686 }687
+4-4
drivers/mtd/chips/cfi_probe.c
···1/*2 Common Flash Interface probe code.3 (C) 2000 Red Hat. GPL'd.4- $Id: cfi_probe.c,v 1.84 2005/11/07 11:14:23 gleixner Exp $5*/67#include <linux/config.h>···230 cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL);231 cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL);232 cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL);233- cfi->mfr = cfi_read_query(map, base);234- cfi->id = cfi_read_query(map, base + ofs_factor);235236 /* Put it back into Read Mode */237 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);···426 .module = THIS_MODULE427};428429-int __init cfi_probe_init(void)430{431 register_mtd_chip_driver(&cfi_chipdrv);432 return 0;
···1/*2 Common Flash Interface probe code.3 (C) 2000 Red Hat. GPL'd.4+ $Id: cfi_probe.c,v 1.86 2005/11/29 14:48:31 gleixner Exp $5*/67#include <linux/config.h>···230 cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL);231 cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL);232 cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL);233+ cfi->mfr = cfi_read_query16(map, base);234+ cfi->id = cfi_read_query16(map, base + ofs_factor);235236 /* Put it back into Read Mode */237 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);···426 .module = THIS_MODULE427};428429+static int __init cfi_probe_init(void)430{431 register_mtd_chip_driver(&cfi_chipdrv);432 return 0;
+66-57
drivers/mtd/chips/sharp.c
···4 * Copyright 2000,2001 David A. Schleef <ds@schleef.org>5 * 2000,2001 Lineo, Inc.6 *7- * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $8 *9 * Devices supported:10 * LH28F016SCT Symmetrical block flash memory, 2Mx8···160 return mtd;161}1620000000163static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd)164{165- unsigned long tmp;166 unsigned long base = 0;167- u32 read0, read4;168 int width = 4;169170- tmp = map_read32(map, base+0);171172- map_write32(map, CMD_READ_ID, base+0);173174- read0=map_read32(map, base+0);175- read4=map_read32(map, base+4);176- if(read0 == 0x89898989){177 printk("Looks like sharp flash\n");178- switch(read4){179 case 0xaaaaaaaa:180 case 0xa0a0a0a0:181 /* aa - LH28F016SCT-L95 2Mx8, 32 64k blocks*/···203 return width;204#endif205 default:206- printk("Sort-of looks like sharp flash, 0x%08x 0x%08x\n",207- read0,read4);208 }209- }else if((map_read32(map, base+0) == CMD_READ_ID)){210 /* RAM, probably */211 printk("Looks like RAM\n");212- map_write32(map, tmp, base+0);213 }else{214- printk("Doesn't look like sharp flash, 0x%08x 0x%08x\n",215- read0,read4);216 }217218 return 0;···221/* This function returns with the chip->mutex lock held. */222static int sharp_wait(struct map_info *map, struct flchip *chip)223{224- int status, i;0225 unsigned long timeo = jiffies + HZ;226 DECLARE_WAITQUEUE(wait, current);227 int adr = 0;···232233 switch(chip->state){234 case FL_READY:235- map_write32(map,CMD_READ_STATUS,adr);236 chip->state = FL_STATUS;237 case FL_STATUS:238 for(i=0;i<100;i++){239- status = map_read32(map,adr);240- if((status & SR_READY)==SR_READY)241 break;242 udelay(1);243 }···261 goto retry;262 }263264- map_write32(map,CMD_RESET, adr);265266 chip->state = FL_READY;267···358 int timeo;359 int try;360 int i;361- int status = 0;3620363 ret = sharp_wait(map,chip);364365 for(try=0;try<10;try++){366- map_write32(map,CMD_BYTE_WRITE,adr);367 /* cpu_to_le32 -> hack to fix the writel be->le conversion */368- map_write32(map,cpu_to_le32(datum),adr);0369370 chip->state = FL_WRITING;371372 timeo = jiffies + (HZ/2);373374- map_write32(map,CMD_READ_STATUS,adr);375 for(i=0;i<100;i++){376- status = map_read32(map,adr);377- if((status & SR_READY)==SR_READY)378 break;379 }380 if(i==100){381 printk("sharp: timed out writing\n");382 }383384- if(!(status&SR_ERRORS))385 break;386387- printk("sharp: error writing byte at addr=%08lx status=%08x\n",adr,status);388389- map_write32(map,CMD_CLEAR_STATUS,adr);390 }391- map_write32(map,CMD_RESET,adr);392 chip->state = FL_READY;393394 wake_up(&chip->wq);···443{444 int ret;445 unsigned long timeo;446- int status;447 DECLARE_WAITQUEUE(wait, current);448449- map_write32(map,CMD_READ_STATUS,adr);450- status = map_read32(map,adr);451452 timeo = jiffies + HZ;453454 while(time_before(jiffies, timeo)){455- map_write32(map,CMD_READ_STATUS,adr);456- status = map_read32(map,adr);457- if((status & SR_READY)==SR_READY){458 ret = 0;459 goto out;460 }···485{486 int ret;487 //int timeo;488- int status;489 //int i;490491//printk("sharp_erase_oneblock()\n");···495 sharp_unlock_oneblock(map,chip,adr);496#endif497498- map_write32(map,CMD_BLOCK_ERASE_1,adr);499- map_write32(map,CMD_BLOCK_ERASE_2,adr);500501 chip->state = FL_ERASING;502503 ret = sharp_do_wait_for_ready(map,chip,adr);504 if(ret<0)return ret;505506- map_write32(map,CMD_READ_STATUS,adr);507- status = map_read32(map,adr);508509- if(!(status&SR_ERRORS)){510- map_write32(map,CMD_RESET,adr);511 chip->state = FL_READY;512 //spin_unlock_bh(chip->mutex);513 return 0;514 }515516- printk("sharp: error erasing block at addr=%08lx status=%08x\n",adr,status);517- map_write32(map,CMD_CLEAR_STATUS,adr);518519 //spin_unlock_bh(chip->mutex);520···526 unsigned long adr)527{528 int i;529- int status;530531- map_write32(map,CMD_CLEAR_BLOCK_LOCKS_1,adr);532- map_write32(map,CMD_CLEAR_BLOCK_LOCKS_2,adr);533534 udelay(100);535536- status = map_read32(map,adr);537- printk("status=%08x\n",status);538539 for(i=0;i<1000;i++){540- //map_write32(map,CMD_READ_STATUS,adr);541- status = map_read32(map,adr);542- if((status & SR_READY)==SR_READY)543 break;544 udelay(100);545 }···547 printk("sharp: timed out unlocking block\n");548 }549550- if(!(status&SR_ERRORS)){551- map_write32(map,CMD_RESET,adr);552 chip->state = FL_READY;553 return;554 }555556- printk("sharp: error unlocking block at addr=%08lx status=%08x\n",adr,status);557- map_write32(map,CMD_CLEAR_STATUS,adr);558}559#endif560
···4 * Copyright 2000,2001 David A. Schleef <ds@schleef.org>5 * 2000,2001 Lineo, Inc.6 *7+ * $Id: sharp.c,v 1.17 2005/11/29 14:28:28 gleixner Exp $8 *9 * Devices supported:10 * LH28F016SCT Symmetrical block flash memory, 2Mx8···160 return mtd;161}162163+static inline void sharp_send_cmd(struct map_info *map, unsigned long cmd, unsigned long adr)164+{165+ map_word map_cmd;166+ map_cmd.x[0] = cmd;167+ map_write(map, map_cmd, adr);168+}169+170static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd)171{172+ map_word tmp, read0, read4;173 unsigned long base = 0;0174 int width = 4;175176+ tmp = map_read(map, base+0);177178+ sharp_send_cmd(map, CMD_READ_ID, base+0);179180+ read0 = map_read(map, base+0);181+ read4 = map_read(map, base+4);182+ if(read0.x[0] == 0x89898989){183 printk("Looks like sharp flash\n");184+ switch(read4.x[0]){185 case 0xaaaaaaaa:186 case 0xa0a0a0a0:187 /* aa - LH28F016SCT-L95 2Mx8, 32 64k blocks*/···197 return width;198#endif199 default:200+ printk("Sort-of looks like sharp flash, 0x%08lx 0x%08lx\n",201+ read0.x[0], read4.x[0]);202 }203+ }else if((map_read(map, base+0).x[0] == CMD_READ_ID)){204 /* RAM, probably */205 printk("Looks like RAM\n");206+ map_write(map, tmp, base+0);207 }else{208+ printk("Doesn't look like sharp flash, 0x%08lx 0x%08lx\n",209+ read0.x[0], read4.x[0]);210 }211212 return 0;···215/* This function returns with the chip->mutex lock held. */216static int sharp_wait(struct map_info *map, struct flchip *chip)217{218+ int i;219+ map_word status;220 unsigned long timeo = jiffies + HZ;221 DECLARE_WAITQUEUE(wait, current);222 int adr = 0;···225226 switch(chip->state){227 case FL_READY:228+ sharp_send_cmd(map, CMD_READ_STATUS, adr);229 chip->state = FL_STATUS;230 case FL_STATUS:231 for(i=0;i<100;i++){232+ status = map_read(map, adr);233+ if((status.x[0] & SR_READY)==SR_READY)234 break;235 udelay(1);236 }···254 goto retry;255 }256257+ sharp_send_cmd(map, CMD_RESET, adr);258259 chip->state = FL_READY;260···351 int timeo;352 int try;353 int i;354+ map_word data, status;355356+ status.x[0] = 0;357 ret = sharp_wait(map,chip);358359 for(try=0;try<10;try++){360+ sharp_send_cmd(map, CMD_BYTE_WRITE, adr);361 /* cpu_to_le32 -> hack to fix the writel be->le conversion */362+ data.x[0] = cpu_to_le32(datum);363+ map_write(map, data, adr);364365 chip->state = FL_WRITING;366367 timeo = jiffies + (HZ/2);368369+ sharp_send_cmd(map, CMD_READ_STATUS, adr);370 for(i=0;i<100;i++){371+ status = map_read(map, adr);372+ if((status.x[0] & SR_READY) == SR_READY)373 break;374 }375 if(i==100){376 printk("sharp: timed out writing\n");377 }378379+ if(!(status.x[0] & SR_ERRORS))380 break;381382+ printk("sharp: error writing byte at addr=%08lx status=%08lx\n", adr, status.x[0]);383384+ sharp_send_cmd(map, CMD_CLEAR_STATUS, adr);385 }386+ sharp_send_cmd(map, CMD_RESET, adr);387 chip->state = FL_READY;388389 wake_up(&chip->wq);···434{435 int ret;436 unsigned long timeo;437+ map_word status;438 DECLARE_WAITQUEUE(wait, current);439440+ sharp_send_cmd(map, CMD_READ_STATUS, adr);441+ status = map_read(map, adr);442443 timeo = jiffies + HZ;444445 while(time_before(jiffies, timeo)){446+ sharp_send_cmd(map, CMD_READ_STATUS, adr);447+ status = map_read(map, adr);448+ if((status.x[0] & SR_READY)==SR_READY){449 ret = 0;450 goto out;451 }···476{477 int ret;478 //int timeo;479+ map_word status;480 //int i;481482//printk("sharp_erase_oneblock()\n");···486 sharp_unlock_oneblock(map,chip,adr);487#endif488489+ sharp_send_cmd(map, CMD_BLOCK_ERASE_1, adr);490+ sharp_send_cmd(map, CMD_BLOCK_ERASE_2, adr);491492 chip->state = FL_ERASING;493494 ret = sharp_do_wait_for_ready(map,chip,adr);495 if(ret<0)return ret;496497+ sharp_send_cmd(map, CMD_READ_STATUS, adr);498+ status = map_read(map, adr);499500+ if(!(status.x[0] & SR_ERRORS)){501+ sharp_send_cmd(map, CMD_RESET, adr);502 chip->state = FL_READY;503 //spin_unlock_bh(chip->mutex);504 return 0;505 }506507+ printk("sharp: error erasing block at addr=%08lx status=%08lx\n", adr, status.x[0]);508+ sharp_send_cmd(map, CMD_CLEAR_STATUS, adr);509510 //spin_unlock_bh(chip->mutex);511···517 unsigned long adr)518{519 int i;520+ map_word status;521522+ sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_1, adr);523+ sharp_send_cmd(map, CMD_CLEAR_BLOCK_LOCKS_2, adr);524525 udelay(100);526527+ status = map_read(map, adr);528+ printk("status=%08lx\n", status.x[0]);529530 for(i=0;i<1000;i++){531+ //sharp_send_cmd(map, CMD_READ_STATUS, adr);532+ status = map_read(map, adr);533+ if((status.x[0] & SR_READY) == SR_READY)534 break;535 udelay(100);536 }···538 printk("sharp: timed out unlocking block\n");539 }540541+ if(!(status.x[0] & SR_ERRORS)){542+ sharp_send_cmd(map, CMD_RESET, adr);543 chip->state = FL_READY;544 return;545 }546547+ printk("sharp: error unlocking block at addr=%08lx status=%08lx\n", adr, status.x[0]);548+ sharp_send_cmd(map, CMD_CLEAR_STATUS, adr);549}550#endif551
+3-3
drivers/mtd/devices/block2mtd.c
···1/*2- * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $3 *4 * block2mtd.c - create an mtd from a block device5 *···19#include <linux/mtd/mtd.h>20#include <linux/buffer_head.h>2122-#define VERSION "$Revision: 1.29 $"232425#define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)···404142#define PAGE_READAHEAD 6443-void cache_readahead(struct address_space *mapping, int index)44{45 filler_t *filler = (filler_t*)mapping->a_ops->readpage;46 int i, pagei;
···1/*2+ * $Id: block2mtd.c,v 1.30 2005/11/29 14:48:32 gleixner Exp $3 *4 * block2mtd.c - create an mtd from a block device5 *···19#include <linux/mtd/mtd.h>20#include <linux/buffer_head.h>2122+#define VERSION "$Revision: 1.30 $"232425#define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)···404142#define PAGE_READAHEAD 6443+static void cache_readahead(struct address_space *mapping, int index)44{45 filler_t *filler = (filler_t*)mapping->a_ops->readpage;46 int i, pagei;
+3-3
drivers/mtd/devices/ms02-nv.c
···6 * as published by the Free Software Foundation; either version7 * 2 of the License, or (at your option) any later version.8 *9- * $Id: ms02-nv.c,v 1.10 2005/06/20 12:24:41 macro Exp $10 */1112#include <linux/init.h>···293294 switch (mips_machtype) {295 case MACH_DS5000_200:296- csr = (volatile u32 *)KN02_CSR_BASE;297 if (*csr & KN02_CSR_BNK32M)298 stride = 2;299 break;300 case MACH_DS5000_2X0:301 case MACH_DS5900:302- csr = (volatile u32 *)KN03_MCR_BASE;303 if (*csr & KN03_MCR_BNK32M)304 stride = 2;305 break;
···6 * as published by the Free Software Foundation; either version7 * 2 of the License, or (at your option) any later version.8 *9+ * $Id: ms02-nv.c,v 1.11 2005/11/14 13:41:47 macro Exp $10 */1112#include <linux/init.h>···293294 switch (mips_machtype) {295 case MACH_DS5000_200:296+ csr = (volatile u32 *)CKSEG1ADDR(KN02_SLOT_BASE + KN02_CSR);297 if (*csr & KN02_CSR_BNK32M)298 stride = 2;299 break;300 case MACH_DS5000_2X0:301 case MACH_DS5900:302+ csr = (volatile u32 *)CKSEG1ADDR(KN03_SLOT_BASE + IOASIC_MCR);303 if (*csr & KN03_MCR_BNK32M)304 stride = 2;305 break;
+3-3
drivers/mtd/ftl.c
···1/* This version ported to the Linux-MTD system by dwmw2@infradead.org2- * $Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $3 *4 * Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>5 * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups···1084 .owner = THIS_MODULE,1085};10861087-int init_ftl(void)1088{1089- DEBUG(0, "$Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $\n");10901091 return register_mtd_blktrans(&ftl_tr);1092}
···1/* This version ported to the Linux-MTD system by dwmw2@infradead.org2+ * $Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $3 *4 * Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>5 * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups···1084 .owner = THIS_MODULE,1085};10861087+static int init_ftl(void)1088{1089+ DEBUG(0, "$Id: ftl.c,v 1.59 2005/11/29 14:48:31 gleixner Exp $\n");10901091 return register_mtd_blktrans(&ftl_tr);1092}
-6
drivers/mtd/maps/Kconfig
···538 This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02).539 If you have such a board, say 'Y'.540541-config MTD_PQ2FADS542- tristate "JEDEC flash SIMM mapped on PQ2FADS and 8272ADS boards"543- depends on (ADS8272 || PQ2FADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT544- help545- This enables access to flash SIMM on PQ2FADS-like boards546-547config MTD_OMAP_NOR548 tristate "TI OMAP board mappings"549 depends on MTD_CFI && ARCH_OMAP
···538 This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02).539 If you have such a board, say 'Y'.540000000541config MTD_OMAP_NOR542 tristate "TI OMAP board mappings"543 depends on MTD_CFI && ARCH_OMAP
···1/*2+ * $Id: ixp4xx.c,v 1.13 2005/11/16 16:23:21 dvrabel Exp $3 *4 * drivers/mtd/maps/ixp4xx.c5 *···3435#include <linux/reboot.h>3637+/*38+ * Read/write a 16 bit word from flash address 'addr'.39+ *40+ * When the cpu is in little-endian mode it swizzles the address lines41+ * ('address coherency') so we need to undo the swizzling to ensure commands42+ * and the like end up on the correct flash address.43+ *44+ * To further complicate matters, due to the way the expansion bus controller45+ * handles 32 bit reads, the byte stream ABCD is stored on the flash as:46+ * D15 D047+ * +---+---+48+ * | A | B | 049+ * +---+---+50+ * | C | D | 251+ * +---+---+52+ * This means that on LE systems each 16 bit word must be swapped. Note that53+ * this requires CONFIG_MTD_CFI_BE_BYTE_SWAP to be enabled to 'unswap' the CFI54+ * data and other flash commands which are always in D7-D0.55+ */56#ifndef __ARMEB__57+#ifndef CONFIG_MTD_CFI_BE_BYTE_SWAP58+# error CONFIG_MTD_CFI_BE_BYTE_SWAP required59+#endif60+61+static inline u16 flash_read16(void __iomem *addr)62+{63+ return be16_to_cpu(__raw_readw((void __iomem *)((unsigned long)addr ^ 0x2)));64+}65+66+static inline void flash_write16(u16 d, void __iomem *addr)67+{68+ __raw_writew(cpu_to_be16(d), (void __iomem *)((unsigned long)addr ^ 0x2));69+}70+71#define BYTE0(h) ((h) & 0xFF)72#define BYTE1(h) (((h) >> 8) & 0xFF)73+74#else75+76+static inline u16 flash_read16(const void __iomem *addr)77+{78+ return __raw_readw(addr);79+}80+81+static inline void flash_write16(u16 d, void __iomem *addr)82+{83+ __raw_writew(d, addr);84+}85+86#define BYTE0(h) (((h) >> 8) & 0xFF)87#define BYTE1(h) ((h) & 0xFF)88#endif···45static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs)46{47 map_word val;48+ val.x[0] = flash_read16(map->virt + ofs);49 return val;50}51···57static void ixp4xx_copy_from(struct map_info *map, void *to,58 unsigned long from, ssize_t len)59{060 u8 *dest = (u8 *) to;61 void __iomem *src = map->virt + from;06263+ if (len <= 0)64+ return;65+66+ if (from & 1) {67+ *dest++ = BYTE1(flash_read16(src));68+ src++;69+ --len;70 }7172+ while (len >= 2) {73+ u16 data = flash_read16(src);74+ *dest++ = BYTE0(data);75+ *dest++ = BYTE1(data);76+ src += 2;77+ len -= 2;78+ }79+80+ if (len > 0)81+ *dest++ = BYTE0(flash_read16(src));82}8384/*···79static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr)80{81 if (!(adr & 1))82+ flash_write16(d.x[0], map->virt + adr);83}8485/*···87 */88static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr)89{90+ flash_write16(d.x[0], map->virt + adr);91}9293struct ixp4xx_flash_info {
···7 * it under the terms of the GNU General Public License version 2 as8 * published by the Free Software Foundation.9 *10- * $Id: pci.c,v 1.13 2005/11/07 11:14:27 gleixner Exp $11 *12 * Generic PCI memory map driver. We support the following boards:13 * - Intel IQ80310 ATU.···102 memcpy_toio(map->base + map->translate(map, to), from, len);103}104105-static struct map_info mtd_pci_map = {106 .phys = NO_XIP,107 .copy_from = mtd_pci_copyfrom,108 .copy_to = mtd_pci_copyto,
···7 * it under the terms of the GNU General Public License version 2 as8 * published by the Free Software Foundation.9 *10+ * $Id: pci.c,v 1.14 2005/11/17 08:20:27 dwmw2 Exp $11 *12 * Generic PCI memory map driver. We support the following boards:13 * - Intel IQ80310 ATU.···102 memcpy_toio(map->base + map->translate(map, to), from, len);103}104105+static const struct map_info mtd_pci_map = {106 .phys = NO_XIP,107 .copy_from = mtd_pci_copyfrom,108 .copy_to = mtd_pci_copyto,
+2-1
drivers/mtd/maps/physmap.c
···1/*2- * $Id: physmap.c,v 1.38 2005/11/07 11:14:28 gleixner Exp $3 *4 * Normal mappings of chips in physical memory5 *···19#include <linux/mtd/map.h>20#include <linux/config.h>21#include <linux/mtd/partitions.h>02223static struct mtd_info *mymtd;24
···1/*2+ * $Id: physmap.c,v 1.39 2005/11/29 14:49:36 gleixner Exp $3 *4 * Normal mappings of chips in physical memory5 *···19#include <linux/mtd/map.h>20#include <linux/config.h>21#include <linux/mtd/partitions.h>22+#include <linux/mtd/physmap.h>2324static struct mtd_info *mymtd;25
+2-2
drivers/mtd/maps/sc520cdp.c
···16 * along with this program; if not, write to the Free Software17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA18 *19- * $Id: sc520cdp.c,v 1.22 2005/11/07 11:14:28 gleixner Exp $20 *21 *22 * The SC520CDP is an evaluation board for the Elan SC520 processor available···164 unsigned long default_address;165};166167-static struct sc520_par_table par_table[NUM_FLASH_BANKS] =168{169 { /* Flash Bank #0: selected by ROMCS0 */170 SC520_PAR_ROMCS0,
···16 * along with this program; if not, write to the Free Software17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA18 *19+ * $Id: sc520cdp.c,v 1.23 2005/11/17 08:20:27 dwmw2 Exp $20 *21 *22 * The SC520CDP is an evaluation board for the Elan SC520 processor available···164 unsigned long default_address;165};166167+static const struct sc520_par_table par_table[NUM_FLASH_BANKS] =168{169 { /* Flash Bank #0: selected by ROMCS0 */170 SC520_PAR_ROMCS0,
···3031#define PREFIX "rfd_ftl: "3233-/* Major device # for FTL device */34-35-/* A request for this major has been sent to device@lanana.org */36#ifndef RFD_FTL_MAJOR37-#define RFD_FTL_MAJOR 9538#endif3940/* Maximum number of partitions in an FTL region */
···3031#define PREFIX "rfd_ftl: "3233+/* This major has been assigned by device@lanana.org */0034#ifndef RFD_FTL_MAJOR35+#define RFD_FTL_MAJOR 25636#endif3738/* Maximum number of partitions in an FTL region */
+2
fs/jffs2/fs.c
···234 c = JFFS2_SB_INFO(inode->i_sb);235236 jffs2_init_inode_info(f);0237238 ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node);239···401402 f = JFFS2_INODE_INFO(inode);403 jffs2_init_inode_info(f);0404405 memset(ri, 0, sizeof(*ri));406 /* Set OS-specific defaults for new inodes */
···234 c = JFFS2_SB_INFO(inode->i_sb);235236 jffs2_init_inode_info(f);237+ down(&f->sem);238239 ret = jffs2_do_read_inode(c, f, inode->i_ino, &latest_node);240···400401 f = JFFS2_INODE_INFO(inode);402 jffs2_init_inode_info(f);403+ down(&f->sem);404405 memset(ri, 0, sizeof(*ri));406 /* Set OS-specific defaults for new inodes */
···12/* Common Flash Interface structures3 * See http://support.intel.com/design/flash/technote/index.htm4- * $Id: cfi.h,v 1.56 2005/11/07 11:14:54 gleixner Exp $5 */67#ifndef __MTD_CFI_H__···416417 if (map_bankwidth_is_1(map)) {418 return val.x[0];0000000000000000419 } else if (map_bankwidth_is_2(map)) {420 return cfi16_to_cpu(val.x[0]);421 } else {
···12/* Common Flash Interface structures3 * See http://support.intel.com/design/flash/technote/index.htm4+ * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $5 */67#ifndef __MTD_CFI_H__···416417 if (map_bankwidth_is_1(map)) {418 return val.x[0];419+ } else if (map_bankwidth_is_2(map)) {420+ return cfi16_to_cpu(val.x[0]);421+ } else {422+ /* No point in a 64-bit byteswap since that would just be423+ swapping the responses from different chips, and we are424+ only interested in one chip (a representative sample) */425+ return cfi32_to_cpu(val.x[0]);426+ }427+}428+429+static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)430+{431+ map_word val = map_read(map, addr);432+433+ if (map_bankwidth_is_1(map)) {434+ return val.x[0] & 0xff;435 } else if (map_bankwidth_is_2(map)) {436 return cfi16_to_cpu(val.x[0]);437 } else {