Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6

Some manual fixups for clashing kfree() cleanups etc.
This commit is contained in:
Linus Torvalds 2005-11-07 10:24:08 -08:00
Родитель 5b2f7ffcb7 c2965f1129
Коммит b3ce1debe2
192 изменённых файлов: 11483 добавлений и 5056 удалений

Просмотреть файл

@ -1,4 +1,4 @@
# $Id: Kconfig,v 1.7 2004/11/22 11:33:56 ijc Exp $ # $Id: Kconfig,v 1.11 2005/11/07 11:14:19 gleixner Exp $
menu "Memory Technology Devices (MTD)" menu "Memory Technology Devices (MTD)"
@ -253,6 +253,16 @@ config INFTL
permitted to copy, modify and distribute the code as you wish. Just permitted to copy, modify and distribute the code as you wish. Just
not use it. not use it.
config RFD_FTL
tristate "Resident Flash Disk (Flash Translation Layer) support"
depends on MTD
---help---
This provides support for the flash translation layer known
as the Resident Flash Disk (RFD), as used by the Embedded BIOS
of General Software. There is a blurb at:
http://www.gensw.com/pages/prod/bios/rfd.htm
source "drivers/mtd/chips/Kconfig" source "drivers/mtd/chips/Kconfig"
source "drivers/mtd/maps/Kconfig" source "drivers/mtd/maps/Kconfig"
@ -261,5 +271,7 @@ source "drivers/mtd/devices/Kconfig"
source "drivers/mtd/nand/Kconfig" source "drivers/mtd/nand/Kconfig"
source "drivers/mtd/onenand/Kconfig"
endmenu endmenu

Просмотреть файл

@ -1,7 +1,7 @@
# #
# Makefile for the memory technology device drivers. # Makefile for the memory technology device drivers.
# #
# $Id: Makefile.common,v 1.5 2004/08/10 20:51:49 dwmw2 Exp $ # $Id: Makefile.common,v 1.7 2005/07/11 10:39:27 gleixner Exp $
# Core functionality. # Core functionality.
mtd-y := mtdcore.o mtd-y := mtdcore.o
@ -20,8 +20,9 @@ obj-$(CONFIG_MTD_BLOCK_RO) += mtdblock_ro.o mtd_blkdevs.o
obj-$(CONFIG_FTL) += ftl.o mtd_blkdevs.o obj-$(CONFIG_FTL) += ftl.o mtd_blkdevs.o
obj-$(CONFIG_NFTL) += nftl.o mtd_blkdevs.o obj-$(CONFIG_NFTL) += nftl.o mtd_blkdevs.o
obj-$(CONFIG_INFTL) += inftl.o mtd_blkdevs.o obj-$(CONFIG_INFTL) += inftl.o mtd_blkdevs.o
obj-$(CONFIG_RFD_FTL) += rfd_ftl.o mtd_blkdevs.o
nftl-objs := nftlcore.o nftlmount.o nftl-objs := nftlcore.o nftlmount.o
inftl-objs := inftlcore.o inftlmount.o inftl-objs := inftlcore.o inftlmount.o
obj-y += chips/ maps/ devices/ nand/ obj-y += chips/ maps/ devices/ nand/ onenand/

Просмотреть файл

@ -21,7 +21,7 @@
This is access code for flashes using ARM's flash partitioning This is access code for flashes using ARM's flash partitioning
standards. standards.
$Id: afs.c,v 1.13 2004/02/27 22:09:59 rmk Exp $ $Id: afs.c,v 1.15 2005/11/07 11:14:19 gleixner Exp $
======================================================================*/ ======================================================================*/

Просмотреть файл

@ -1,5 +1,5 @@
# drivers/mtd/chips/Kconfig # drivers/mtd/chips/Kconfig
# $Id: Kconfig,v 1.15 2005/06/06 23:04:35 tpoynor Exp $ # $Id: Kconfig,v 1.18 2005/11/07 11:14:22 gleixner Exp $
menu "RAM/ROM/Flash chip drivers" menu "RAM/ROM/Flash chip drivers"
depends on MTD!=n depends on MTD!=n

Просмотреть файл

@ -1,7 +1,7 @@
# #
# linux/drivers/chips/Makefile # linux/drivers/chips/Makefile
# #
# $Id: Makefile.common,v 1.4 2004/07/12 16:07:30 dwmw2 Exp $ # $Id: Makefile.common,v 1.5 2005/11/07 11:14:22 gleixner Exp $
# *** BIG UGLY NOTE *** # *** BIG UGLY NOTE ***
# #

Просмотреть файл

@ -3,7 +3,7 @@
* *
* Author: Jonas Holmberg <jonas.holmberg@axis.com> * Author: Jonas Holmberg <jonas.holmberg@axis.com>
* *
* $Id: amd_flash.c,v 1.27 2005/02/04 07:43:09 jonashg Exp $ * $Id: amd_flash.c,v 1.28 2005/11/07 11:14:22 gleixner Exp $
* *
* Copyright (c) 2001 Axis Communications AB * Copyright (c) 2001 Axis Communications AB
* *

Просмотреть файл

@ -4,7 +4,7 @@
* *
* (C) 2000 Red Hat. GPL'd * (C) 2000 Red Hat. GPL'd
* *
* $Id: cfi_cmdset_0001.c,v 1.178 2005/05/19 17:05:43 nico Exp $ * $Id: cfi_cmdset_0001.c,v 1.185 2005/11/07 11:14:22 gleixner Exp $
* *
* *
* 10/10/2000 Nicolas Pitre <nico@cam.org> * 10/10/2000 Nicolas Pitre <nico@cam.org>
@ -51,6 +51,7 @@
static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static int cfi_intelext_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); static int cfi_intelext_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static int cfi_intelext_writev(struct mtd_info *, const struct kvec *, unsigned long, loff_t, size_t *);
static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *); static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *);
static void cfi_intelext_sync (struct mtd_info *); static void cfi_intelext_sync (struct mtd_info *);
static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, size_t len); static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, size_t len);
@ -105,6 +106,7 @@ static struct mtd_chip_driver cfi_intelext_chipdrv = {
static void cfi_tell_features(struct cfi_pri_intelext *extp) static void cfi_tell_features(struct cfi_pri_intelext *extp)
{ {
int i; int i;
printk(" Extended Query version %c.%c\n", extp->MajorVersion, extp->MinorVersion);
printk(" Feature/Command Support: %4.4X\n", extp->FeatureSupport); printk(" Feature/Command Support: %4.4X\n", extp->FeatureSupport);
printk(" - Chip Erase: %s\n", extp->FeatureSupport&1?"supported":"unsupported"); printk(" - Chip Erase: %s\n", extp->FeatureSupport&1?"supported":"unsupported");
printk(" - Suspend Erase: %s\n", extp->FeatureSupport&2?"supported":"unsupported"); printk(" - Suspend Erase: %s\n", extp->FeatureSupport&2?"supported":"unsupported");
@ -116,7 +118,8 @@ static void cfi_tell_features(struct cfi_pri_intelext *extp)
printk(" - Page-mode read: %s\n", extp->FeatureSupport&128?"supported":"unsupported"); printk(" - Page-mode read: %s\n", extp->FeatureSupport&128?"supported":"unsupported");
printk(" - Synchronous read: %s\n", extp->FeatureSupport&256?"supported":"unsupported"); printk(" - Synchronous read: %s\n", extp->FeatureSupport&256?"supported":"unsupported");
printk(" - Simultaneous operations: %s\n", extp->FeatureSupport&512?"supported":"unsupported"); printk(" - Simultaneous operations: %s\n", extp->FeatureSupport&512?"supported":"unsupported");
for (i=10; i<32; i++) { printk(" - Extended Flash Array: %s\n", extp->FeatureSupport&1024?"supported":"unsupported");
for (i=11; i<32; i++) {
if (extp->FeatureSupport & (1<<i)) if (extp->FeatureSupport & (1<<i))
printk(" - Unknown Bit %X: supported\n", i); printk(" - Unknown Bit %X: supported\n", i);
} }
@ -130,8 +133,14 @@ static void cfi_tell_features(struct cfi_pri_intelext *extp)
printk(" Block Status Register Mask: %4.4X\n", extp->BlkStatusRegMask); printk(" Block Status Register Mask: %4.4X\n", extp->BlkStatusRegMask);
printk(" - Lock Bit Active: %s\n", extp->BlkStatusRegMask&1?"yes":"no"); printk(" - Lock Bit Active: %s\n", extp->BlkStatusRegMask&1?"yes":"no");
printk(" - Valid Bit Active: %s\n", extp->BlkStatusRegMask&2?"yes":"no"); printk(" - Lock-Down Bit Active: %s\n", extp->BlkStatusRegMask&2?"yes":"no");
for (i=2; i<16; i++) { for (i=2; i<3; i++) {
if (extp->BlkStatusRegMask & (1<<i))
printk(" - Unknown Bit %X Active: yes\n",i);
}
printk(" - EFA Lock Bit: %s\n", extp->BlkStatusRegMask&16?"yes":"no");
printk(" - EFA Lock-Down Bit: %s\n", extp->BlkStatusRegMask&32?"yes":"no");
for (i=6; i<16; i++) {
if (extp->BlkStatusRegMask & (1<<i)) if (extp->BlkStatusRegMask & (1<<i))
printk(" - Unknown Bit %X Active: yes\n",i); printk(" - Unknown Bit %X Active: yes\n",i);
} }
@ -207,6 +216,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd, void *param)
if (cfi->cfiq->BufWriteTimeoutTyp) { if (cfi->cfiq->BufWriteTimeoutTyp) {
printk(KERN_INFO "Using buffer write method\n" ); printk(KERN_INFO "Using buffer write method\n" );
mtd->write = cfi_intelext_write_buffers; mtd->write = cfi_intelext_write_buffers;
mtd->writev = cfi_intelext_writev;
} }
} }
@ -252,12 +262,21 @@ read_pri_intelext(struct map_info *map, __u16 adr)
if (!extp) if (!extp)
return NULL; return NULL;
if (extp->MajorVersion != '1' ||
(extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
printk(KERN_ERR " Unknown Intel/Sharp Extended Query "
"version %c.%c.\n", extp->MajorVersion,
extp->MinorVersion);
kfree(extp);
return NULL;
}
/* Do some byteswapping if necessary */ /* Do some byteswapping if necessary */
extp->FeatureSupport = le32_to_cpu(extp->FeatureSupport); extp->FeatureSupport = le32_to_cpu(extp->FeatureSupport);
extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask); extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask);
extp->ProtRegAddr = le16_to_cpu(extp->ProtRegAddr); extp->ProtRegAddr = le16_to_cpu(extp->ProtRegAddr);
if (extp->MajorVersion == '1' && extp->MinorVersion == '3') { if (extp->MajorVersion == '1' && extp->MinorVersion >= '3') {
unsigned int extra_size = 0; unsigned int extra_size = 0;
int nb_parts, i; int nb_parts, i;
@ -266,7 +285,10 @@ read_pri_intelext(struct map_info *map, __u16 adr)
sizeof(struct cfi_intelext_otpinfo); sizeof(struct cfi_intelext_otpinfo);
/* Burst Read info */ /* Burst Read info */
extra_size += 6; extra_size += 2;
if (extp_size < sizeof(*extp) + extra_size)
goto need_more;
extra_size += extp->extra[extra_size-1];
/* Number of hardware-partitions */ /* Number of hardware-partitions */
extra_size += 1; extra_size += 1;
@ -274,6 +296,10 @@ read_pri_intelext(struct map_info *map, __u16 adr)
goto need_more; goto need_more;
nb_parts = extp->extra[extra_size - 1]; nb_parts = extp->extra[extra_size - 1];
/* skip the sizeof(partregion) field in CFI 1.4 */
if (extp->MinorVersion >= '4')
extra_size += 2;
for (i = 0; i < nb_parts; i++) { for (i = 0; i < nb_parts; i++) {
struct cfi_intelext_regioninfo *rinfo; struct cfi_intelext_regioninfo *rinfo;
rinfo = (struct cfi_intelext_regioninfo *)&extp->extra[extra_size]; rinfo = (struct cfi_intelext_regioninfo *)&extp->extra[extra_size];
@ -285,6 +311,9 @@ read_pri_intelext(struct map_info *map, __u16 adr)
* sizeof(struct cfi_intelext_blockinfo); * sizeof(struct cfi_intelext_blockinfo);
} }
if (extp->MinorVersion >= '4')
extra_size += sizeof(struct cfi_intelext_programming_regioninfo);
if (extp_size < sizeof(*extp) + extra_size) { if (extp_size < sizeof(*extp) + extra_size) {
need_more: need_more:
extp_size = sizeof(*extp) + extra_size; extp_size = sizeof(*extp) + extra_size;
@ -429,7 +458,7 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd)
} }
for (i=0; i<mtd->numeraseregions;i++){ for (i=0; i<mtd->numeraseregions;i++){
printk(KERN_DEBUG "%d: offset=0x%x,size=0x%x,blocks=%d\n", printk(KERN_DEBUG "erase region %d: offset=0x%x,size=0x%x,blocks=%d\n",
i,mtd->eraseregions[i].offset, i,mtd->eraseregions[i].offset,
mtd->eraseregions[i].erasesize, mtd->eraseregions[i].erasesize,
mtd->eraseregions[i].numblocks); mtd->eraseregions[i].numblocks);
@ -480,7 +509,7 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
* arrangement at this point. This can be rearranged in the future * arrangement at this point. This can be rearranged in the future
* if someone feels motivated enough. --nico * if someone feels motivated enough. --nico
*/ */
if (extp && extp->MajorVersion == '1' && extp->MinorVersion == '3' if (extp && extp->MajorVersion == '1' && extp->MinorVersion >= '3'
&& extp->FeatureSupport & (1 << 9)) { && extp->FeatureSupport & (1 << 9)) {
struct cfi_private *newcfi; struct cfi_private *newcfi;
struct flchip *chip; struct flchip *chip;
@ -492,12 +521,16 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
sizeof(struct cfi_intelext_otpinfo); sizeof(struct cfi_intelext_otpinfo);
/* Burst Read info */ /* Burst Read info */
offs += 6; offs += extp->extra[offs+1]+2;
/* Number of partition regions */ /* Number of partition regions */
numregions = extp->extra[offs]; numregions = extp->extra[offs];
offs += 1; offs += 1;
/* skip the sizeof(partregion) field in CFI 1.4 */
if (extp->MinorVersion >= '4')
offs += 2;
/* Number of hardware partitions */ /* Number of hardware partitions */
numparts = 0; numparts = 0;
for (i = 0; i < numregions; i++) { for (i = 0; i < numregions; i++) {
@ -509,6 +542,20 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
sizeof(struct cfi_intelext_blockinfo); sizeof(struct cfi_intelext_blockinfo);
} }
/* Programming Region info */
if (extp->MinorVersion >= '4') {
struct cfi_intelext_programming_regioninfo *prinfo;
prinfo = (struct cfi_intelext_programming_regioninfo *)&extp->extra[offs];
MTD_PROGREGION_SIZE(mtd) = cfi->interleave << prinfo->ProgRegShift;
MTD_PROGREGION_CTRLMODE_VALID(mtd) = cfi->interleave * prinfo->ControlValid;
MTD_PROGREGION_CTRLMODE_INVALID(mtd) = cfi->interleave * prinfo->ControlInvalid;
mtd->flags |= MTD_PROGRAM_REGIONS;
printk(KERN_DEBUG "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n",
map->name, MTD_PROGREGION_SIZE(mtd),
MTD_PROGREGION_CTRLMODE_VALID(mtd),
MTD_PROGREGION_CTRLMODE_INVALID(mtd));
}
/* /*
* All functions below currently rely on all chips having * All functions below currently rely on all chips having
* the same geometry so we'll just assume that all hardware * the same geometry so we'll just assume that all hardware
@ -653,8 +700,8 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
break; break;
if (time_after(jiffies, timeo)) { if (time_after(jiffies, timeo)) {
printk(KERN_ERR "Waiting for chip to be ready timed out. Status %lx\n", printk(KERN_ERR "%s: Waiting for chip to be ready timed out. Status %lx\n",
status.x[0]); map->name, status.x[0]);
return -EIO; return -EIO;
} }
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
@ -701,8 +748,8 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
map_write(map, CMD(0x70), adr); map_write(map, CMD(0x70), adr);
chip->state = FL_ERASING; chip->state = FL_ERASING;
chip->oldstate = FL_READY; chip->oldstate = FL_READY;
printk(KERN_ERR "Chip not ready after erase " printk(KERN_ERR "%s: Chip not ready after erase "
"suspended: status = 0x%lx\n", status.x[0]); "suspended: status = 0x%lx\n", map->name, status.x[0]);
return -EIO; return -EIO;
} }
@ -809,7 +856,7 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
DISABLE_VPP(map); DISABLE_VPP(map);
break; break;
default: default:
printk(KERN_ERR "put_chip() called with oldstate %d!!\n", chip->oldstate); printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate);
} }
wake_up(&chip->wq); wake_up(&chip->wq);
} }
@ -1120,7 +1167,7 @@ static void cfi_intelext_unpoint (struct mtd_info *mtd, u_char *addr, loff_t fro
if(chip->ref_point_counter == 0) if(chip->ref_point_counter == 0)
chip->state = FL_READY; chip->state = FL_READY;
} else } else
printk(KERN_ERR "Warning: unpoint called on non pointed region\n"); /* Should this give an error? */ printk(KERN_ERR "%s: Warning: unpoint called on non pointed region\n", map->name); /* Should this give an error? */
put_chip(map, chip, chip->start); put_chip(map, chip, chip->start);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
@ -1212,12 +1259,17 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
adr += chip->start; adr += chip->start;
/* Let's determine this according to the interleave only once */ /* Let's determine those according to the interleave only once */
status_OK = CMD(0x80); status_OK = CMD(0x80);
switch (mode) { switch (mode) {
case FL_WRITING: write_cmd = CMD(0x40); break; case FL_WRITING:
case FL_OTP_WRITE: write_cmd = CMD(0xc0); break; write_cmd = (cfi->cfiq->P_ID != 0x0200) ? CMD(0x40) : CMD(0x41);
default: return -EINVAL; break;
case FL_OTP_WRITE:
write_cmd = CMD(0xc0);
break;
default:
return -EINVAL;
} }
spin_lock(chip->mutex); spin_lock(chip->mutex);
@ -1261,9 +1313,10 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
/* OK Still waiting */ /* OK Still waiting */
if (time_after(jiffies, timeo)) { if (time_after(jiffies, timeo)) {
map_write(map, CMD(0x70), adr);
chip->state = FL_STATUS; chip->state = FL_STATUS;
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
printk(KERN_ERR "waiting for chip to be ready timed out in word write\n"); printk(KERN_ERR "%s: word write error (status timeout)\n", map->name);
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
@ -1275,7 +1328,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
if (!z) { if (!z) {
chip->word_write_time--; chip->word_write_time--;
if (!chip->word_write_time) if (!chip->word_write_time)
chip->word_write_time++; chip->word_write_time = 1;
} }
if (z > 1) if (z > 1)
chip->word_write_time++; chip->word_write_time++;
@ -1283,19 +1336,31 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
/* Done and happy. */ /* Done and happy. */
chip->state = FL_STATUS; chip->state = FL_STATUS;
/* check for lock bit */ /* check for errors */
if (map_word_bitsset(map, status, CMD(0x02))) { if (map_word_bitsset(map, status, CMD(0x1a))) {
/* clear status */ unsigned long chipstatus = MERGESTATUS(status);
/* reset status */
map_write(map, CMD(0x50), adr); map_write(map, CMD(0x50), adr);
/* put back into read status register mode */
map_write(map, CMD(0x70), adr); map_write(map, CMD(0x70), adr);
xip_enable(map, chip, adr);
if (chipstatus & 0x02) {
ret = -EROFS; ret = -EROFS;
} else if (chipstatus & 0x08) {
printk(KERN_ERR "%s: word write error (bad VPP)\n", map->name);
ret = -EIO;
} else {
printk(KERN_ERR "%s: word write error (status 0x%lx)\n", map->name, chipstatus);
ret = -EINVAL;
}
goto out;
} }
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
out: put_chip(map, chip, adr); out: put_chip(map, chip, adr);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
return ret; return ret;
} }
@ -1384,12 +1449,15 @@ static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t le
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf, int len) unsigned long adr, const struct kvec **pvec,
unsigned long *pvec_seek, int len)
{ {
struct cfi_private *cfi = map->fldrv_priv; struct cfi_private *cfi = map->fldrv_priv;
map_word status, status_OK; map_word status, status_OK, write_cmd, datum;
unsigned long cmd_adr, timeo; unsigned long cmd_adr, timeo;
int wbufsize, z, ret=0, bytes, words; int wbufsize, z, ret=0, word_gap, words;
const struct kvec *vec;
unsigned long vec_seek;
wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
adr += chip->start; adr += chip->start;
@ -1397,6 +1465,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
/* Let's determine this according to the interleave only once */ /* Let's determine this according to the interleave only once */
status_OK = CMD(0x80); status_OK = CMD(0x80);
write_cmd = (cfi->cfiq->P_ID != 0x0200) ? CMD(0xe8) : CMD(0xe9);
spin_lock(chip->mutex); spin_lock(chip->mutex);
ret = get_chip(map, chip, cmd_adr, FL_WRITING); ret = get_chip(map, chip, cmd_adr, FL_WRITING);
@ -1428,7 +1497,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
z = 0; z = 0;
for (;;) { for (;;) {
map_write(map, CMD(0xe8), cmd_adr); map_write(map, write_cmd, cmd_adr);
status = map_read(map, cmd_adr); status = map_read(map, cmd_adr);
if (map_word_andequal(map, status, status_OK, status_OK)) if (map_word_andequal(map, status, status_OK, status_OK))
@ -1446,36 +1515,61 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
map_write(map, CMD(0x50), cmd_adr); map_write(map, CMD(0x50), cmd_adr);
map_write(map, CMD(0x70), cmd_adr); map_write(map, CMD(0x70), cmd_adr);
xip_enable(map, chip, cmd_adr); xip_enable(map, chip, cmd_adr);
printk(KERN_ERR "Chip not ready for buffer write. status = %lx, Xstatus = %lx\n", printk(KERN_ERR "%s: Chip not ready for buffer write. status = %lx, Xstatus = %lx\n",
status.x[0], Xstatus.x[0]); map->name, status.x[0], Xstatus.x[0]);
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
} }
/* Figure out the number of words to write */
word_gap = (-adr & (map_bankwidth(map)-1));
words = (len - word_gap + map_bankwidth(map) - 1) / map_bankwidth(map);
if (!word_gap) {
words--;
} else {
word_gap = map_bankwidth(map) - word_gap;
adr -= word_gap;
datum = map_word_ff(map);
}
/* Write length of data to come */ /* Write length of data to come */
bytes = len & (map_bankwidth(map)-1); map_write(map, CMD(words), cmd_adr );
words = len / map_bankwidth(map);
map_write(map, CMD(words - !bytes), cmd_adr );
/* Write data */ /* Write data */
z = 0; vec = *pvec;
while(z < words * map_bankwidth(map)) { vec_seek = *pvec_seek;
map_word datum = map_word_load(map, buf); do {
map_write(map, datum, adr+z); int n = map_bankwidth(map) - word_gap;
if (n > vec->iov_len - vec_seek)
z += map_bankwidth(map); n = vec->iov_len - vec_seek;
buf += map_bankwidth(map); if (n > len)
} n = len;
if (bytes) {
map_word datum;
if (!word_gap && len < map_bankwidth(map))
datum = map_word_ff(map); datum = map_word_ff(map);
datum = map_word_load_partial(map, datum, buf, 0, bytes);
map_write(map, datum, adr+z); datum = map_word_load_partial(map, datum,
vec->iov_base + vec_seek,
word_gap, n);
len -= n;
word_gap += n;
if (!len || word_gap == map_bankwidth(map)) {
map_write(map, datum, adr);
adr += map_bankwidth(map);
word_gap = 0;
} }
vec_seek += n;
if (vec_seek == vec->iov_len) {
vec++;
vec_seek = 0;
}
} while (len);
*pvec = vec;
*pvec_seek = vec_seek;
/* GO GO GO */ /* GO GO GO */
map_write(map, CMD(0xd0), cmd_adr); map_write(map, CMD(0xd0), cmd_adr);
chip->state = FL_WRITING; chip->state = FL_WRITING;
@ -1506,9 +1600,10 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
/* OK Still waiting */ /* OK Still waiting */
if (time_after(jiffies, timeo)) { if (time_after(jiffies, timeo)) {
map_write(map, CMD(0x70), cmd_adr);
chip->state = FL_STATUS; chip->state = FL_STATUS;
xip_enable(map, chip, cmd_adr); xip_enable(map, chip, cmd_adr);
printk(KERN_ERR "waiting for chip to be ready timed out in bufwrite\n"); printk(KERN_ERR "%s: buffer write error (status timeout)\n", map->name);
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
@ -1520,7 +1615,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
if (!z) { if (!z) {
chip->buffer_write_time--; chip->buffer_write_time--;
if (!chip->buffer_write_time) if (!chip->buffer_write_time)
chip->buffer_write_time++; chip->buffer_write_time = 1;
} }
if (z > 1) if (z > 1)
chip->buffer_write_time++; chip->buffer_write_time++;
@ -1528,13 +1623,26 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
/* Done and happy. */ /* Done and happy. */
chip->state = FL_STATUS; chip->state = FL_STATUS;
/* check for lock bit */ /* check for errors */
if (map_word_bitsset(map, status, CMD(0x02))) { if (map_word_bitsset(map, status, CMD(0x1a))) {
/* clear status */ unsigned long chipstatus = MERGESTATUS(status);
/* reset status */
map_write(map, CMD(0x50), cmd_adr); map_write(map, CMD(0x50), cmd_adr);
/* put back into read status register mode */ map_write(map, CMD(0x70), cmd_adr);
map_write(map, CMD(0x70), adr); xip_enable(map, chip, cmd_adr);
if (chipstatus & 0x02) {
ret = -EROFS; ret = -EROFS;
} else if (chipstatus & 0x08) {
printk(KERN_ERR "%s: buffer write error (bad VPP)\n", map->name);
ret = -EIO;
} else {
printk(KERN_ERR "%s: buffer write error (status 0x%lx)\n", map->name, chipstatus);
ret = -EINVAL;
}
goto out;
} }
xip_enable(map, chip, cmd_adr); xip_enable(map, chip, cmd_adr);
@ -1543,15 +1651,19 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
return ret; return ret;
} }
static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to, static int cfi_intelext_writev (struct mtd_info *mtd, const struct kvec *vecs,
size_t len, size_t *retlen, const u_char *buf) unsigned long count, loff_t to, size_t *retlen)
{ {
struct map_info *map = mtd->priv; struct map_info *map = mtd->priv;
struct cfi_private *cfi = map->fldrv_priv; struct cfi_private *cfi = map->fldrv_priv;
int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
int ret = 0; int ret = 0;
int chipnum; int chipnum;
unsigned long ofs; unsigned long ofs, vec_seek, i;
size_t len = 0;
for (i = 0; i < count; i++)
len += vecs[i].iov_len;
*retlen = 0; *retlen = 0;
if (!len) if (!len)
@ -1559,41 +1671,20 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
chipnum = to >> cfi->chipshift; chipnum = to >> cfi->chipshift;
ofs = to - (chipnum << cfi->chipshift); ofs = to - (chipnum << cfi->chipshift);
vec_seek = 0;
/* If it's not bus-aligned, do the first word write */ do {
if (ofs & (map_bankwidth(map)-1)) {
size_t local_len = (-ofs)&(map_bankwidth(map)-1);
if (local_len > len)
local_len = len;
ret = cfi_intelext_write_words(mtd, to, local_len,
retlen, buf);
if (ret)
return ret;
ofs += local_len;
buf += local_len;
len -= local_len;
if (ofs >> cfi->chipshift) {
chipnum ++;
ofs = 0;
if (chipnum == cfi->numchips)
return 0;
}
}
while(len) {
/* We must not cross write block boundaries */ /* We must not cross write block boundaries */
int size = wbufsize - (ofs & (wbufsize-1)); int size = wbufsize - (ofs & (wbufsize-1));
if (size > len) if (size > len)
size = len; size = len;
ret = do_write_buffer(map, &cfi->chips[chipnum], ret = do_write_buffer(map, &cfi->chips[chipnum],
ofs, buf, size); ofs, &vecs, &vec_seek, size);
if (ret) if (ret)
return ret; return ret;
ofs += size; ofs += size;
buf += size;
(*retlen) += size; (*retlen) += size;
len -= size; len -= size;
@ -1603,10 +1694,22 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
if (chipnum == cfi->numchips) if (chipnum == cfi->numchips)
return 0; return 0;
} }
} } while (len);
return 0; return 0;
} }
static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
size_t len, size_t *retlen, const u_char *buf)
{
struct kvec vec;
vec.iov_base = (void *) buf;
vec.iov_len = len;
return cfi_intelext_writev(mtd, &vec, 1, to, retlen);
}
static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
unsigned long adr, int len, void *thunk) unsigned long adr, int len, void *thunk)
{ {
@ -1675,16 +1778,10 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
/* OK Still waiting */ /* OK Still waiting */
if (time_after(jiffies, timeo)) { if (time_after(jiffies, timeo)) {
map_word Xstatus;
map_write(map, CMD(0x70), adr); map_write(map, CMD(0x70), adr);
chip->state = FL_STATUS; chip->state = FL_STATUS;
Xstatus = map_read(map, adr);
/* Clear status bits */
map_write(map, CMD(0x50), adr);
map_write(map, CMD(0x70), adr);
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
printk(KERN_ERR "waiting for erase at %08lx to complete timed out. status = %lx, Xstatus = %lx.\n", printk(KERN_ERR "%s: block erase error: (status timeout)\n", map->name);
adr, status.x[0], Xstatus.x[0]);
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
@ -1698,43 +1795,40 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
chip->state = FL_STATUS; chip->state = FL_STATUS;
status = map_read(map, adr); status = map_read(map, adr);
/* check for lock bit */ /* check for errors */
if (map_word_bitsset(map, status, CMD(0x3a))) { if (map_word_bitsset(map, status, CMD(0x3a))) {
unsigned long chipstatus; unsigned long chipstatus = MERGESTATUS(status);
/* Reset the error bits */ /* Reset the error bits */
map_write(map, CMD(0x50), adr); map_write(map, CMD(0x50), adr);
map_write(map, CMD(0x70), adr); map_write(map, CMD(0x70), adr);
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
chipstatus = MERGESTATUS(status);
if ((chipstatus & 0x30) == 0x30) { if ((chipstatus & 0x30) == 0x30) {
printk(KERN_NOTICE "Chip reports improper command sequence: status 0x%lx\n", chipstatus); printk(KERN_ERR "%s: block erase error: (bad command sequence, status 0x%lx)\n", map->name, chipstatus);
ret = -EIO; ret = -EINVAL;
} else if (chipstatus & 0x02) { } else if (chipstatus & 0x02) {
/* Protection bit set */ /* Protection bit set */
ret = -EROFS; ret = -EROFS;
} else if (chipstatus & 0x8) { } else if (chipstatus & 0x8) {
/* Voltage */ /* Voltage */
printk(KERN_WARNING "Chip reports voltage low on erase: status 0x%lx\n", chipstatus); printk(KERN_ERR "%s: block erase error: (bad VPP)\n", map->name);
ret = -EIO; ret = -EIO;
} else if (chipstatus & 0x20) { } else if (chipstatus & 0x20 && retries--) {
if (retries--) { printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus);
printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus);
timeo = jiffies + HZ; timeo = jiffies + HZ;
put_chip(map, chip, adr); put_chip(map, chip, adr);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
goto retry; goto retry;
} } else {
printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%lx\n", adr, chipstatus); printk(KERN_ERR "%s: block erase failed at 0x%08lx (status 0x%lx)\n", map->name, adr, chipstatus);
ret = -EIO; ret = -EIO;
} }
} else {
xip_enable(map, chip, adr); goto out;
ret = 0;
} }
xip_enable(map, chip, adr);
out: put_chip(map, chip, adr); out: put_chip(map, chip, adr);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
return ret; return ret;
@ -1877,13 +1971,10 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip
/* OK Still waiting */ /* OK Still waiting */
if (time_after(jiffies, timeo)) { if (time_after(jiffies, timeo)) {
map_word Xstatus;
map_write(map, CMD(0x70), adr); map_write(map, CMD(0x70), adr);
chip->state = FL_STATUS; chip->state = FL_STATUS;
Xstatus = map_read(map, adr);
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
printk(KERN_ERR "waiting for unlock to complete timed out. status = %lx, Xstatus = %lx.\n", printk(KERN_ERR "%s: block unlock error: (status timeout)\n", map->name);
status.x[0], Xstatus.x[0]);
put_chip(map, chip, adr); put_chip(map, chip, adr);
spin_unlock(chip->mutex); spin_unlock(chip->mutex);
return -EIO; return -EIO;
@ -2355,20 +2446,23 @@ static void cfi_intelext_destroy(struct mtd_info *mtd)
kfree(mtd->eraseregions); kfree(mtd->eraseregions);
} }
static char im_name_1[]="cfi_cmdset_0001"; static char im_name_0001[] = "cfi_cmdset_0001";
static char im_name_3[]="cfi_cmdset_0003"; static char im_name_0003[] = "cfi_cmdset_0003";
static char im_name_0200[] = "cfi_cmdset_0200";
static int __init cfi_intelext_init(void) static int __init cfi_intelext_init(void)
{ {
inter_module_register(im_name_1, THIS_MODULE, &cfi_cmdset_0001); inter_module_register(im_name_0001, THIS_MODULE, &cfi_cmdset_0001);
inter_module_register(im_name_3, THIS_MODULE, &cfi_cmdset_0001); inter_module_register(im_name_0003, THIS_MODULE, &cfi_cmdset_0001);
inter_module_register(im_name_0200, THIS_MODULE, &cfi_cmdset_0001);
return 0; return 0;
} }
static void __exit cfi_intelext_exit(void) static void __exit cfi_intelext_exit(void)
{ {
inter_module_unregister(im_name_1); inter_module_unregister(im_name_0001);
inter_module_unregister(im_name_3); inter_module_unregister(im_name_0003);
inter_module_unregister(im_name_0200);
} }
module_init(cfi_intelext_init); module_init(cfi_intelext_init);

Просмотреть файл

@ -17,7 +17,7 @@
* *
* This code is GPL * This code is GPL
* *
* $Id: cfi_cmdset_0002.c,v 1.118 2005/07/04 22:34:29 gleixner Exp $ * $Id: cfi_cmdset_0002.c,v 1.122 2005/11/07 11:14:22 gleixner Exp $
* *
*/ */
@ -253,6 +253,16 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
return NULL; return NULL;
} }
if (extp->MajorVersion != '1' ||
(extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
printk(KERN_ERR " Unknown Amd/Fujitsu Extended Query "
"version %c.%c.\n", extp->MajorVersion,
extp->MinorVersion);
kfree(extp);
kfree(mtd);
return NULL;
}
/* Install our own private info structure */ /* Install our own private info structure */
cfi->cmdset_priv = extp; cfi->cmdset_priv = extp;
@ -1003,16 +1013,16 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip,
continue; continue;
} }
if (chip_ready(map, adr)) if (time_after(jiffies, timeo) && !chip_ready(map, adr)){
break;
if (time_after(jiffies, timeo)) {
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
printk(KERN_WARNING "MTD %s(): software timeout\n", __func__); printk(KERN_WARNING "MTD %s(): software timeout\n", __func__);
xip_disable(map, chip, adr); xip_disable(map, chip, adr);
break; break;
} }
if (chip_ready(map, adr))
break;
/* Latency issues. Drop the lock, wait a while and retry */ /* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1); UDELAY(map, chip, adr, 1);
} }
@ -1264,14 +1274,14 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
continue; continue;
} }
if (time_after(jiffies, timeo) && !chip_ready(map, adr))
break;
if (chip_ready(map, adr)) { if (chip_ready(map, adr)) {
xip_enable(map, chip, adr); xip_enable(map, chip, adr);
goto op_done; goto op_done;
} }
if( time_after(jiffies, timeo))
break;
/* Latency issues. Drop the lock, wait a while and retry */ /* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1); UDELAY(map, chip, adr, 1);
} }

Просмотреть файл

@ -4,7 +4,7 @@
* *
* (C) 2000 Red Hat. GPL'd * (C) 2000 Red Hat. GPL'd
* *
* $Id: cfi_cmdset_0020.c,v 1.19 2005/07/13 15:52:45 dwmw2 Exp $ * $Id: cfi_cmdset_0020.c,v 1.22 2005/11/07 11:14:22 gleixner Exp $
* *
* 10/10/2000 Nicolas Pitre <nico@cam.org> * 10/10/2000 Nicolas Pitre <nico@cam.org>
* - completely revamped method functions so they are aware and * - completely revamped method functions so they are aware and
@ -133,6 +133,15 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
if (!extp) if (!extp)
return NULL; return NULL;
if (extp->MajorVersion != '1' ||
(extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
printk(KERN_ERR " Unknown ST Microelectronics"
" Extended Query version %c.%c.\n",
extp->MajorVersion, extp->MinorVersion);
kfree(extp);
return NULL;
}
/* Do some byteswapping if necessary */ /* Do some byteswapping if necessary */
extp->FeatureSupport = cfi32_to_cpu(extp->FeatureSupport); extp->FeatureSupport = cfi32_to_cpu(extp->FeatureSupport);
extp->BlkStatusRegMask = cfi32_to_cpu(extp->BlkStatusRegMask); extp->BlkStatusRegMask = cfi32_to_cpu(extp->BlkStatusRegMask);

Просмотреть файл

@ -1,7 +1,7 @@
/* /*
Common Flash Interface probe code. Common Flash Interface probe code.
(C) 2000 Red Hat. GPL'd. (C) 2000 Red Hat. GPL'd.
$Id: cfi_probe.c,v 1.83 2004/11/16 18:19:02 nico Exp $ $Id: cfi_probe.c,v 1.84 2005/11/07 11:14:23 gleixner Exp $
*/ */
#include <linux/config.h> #include <linux/config.h>

Просмотреть файл

@ -7,7 +7,7 @@
* *
* This code is covered by the GPL. * This code is covered by the GPL.
* *
* $Id: cfi_util.c,v 1.8 2004/12/14 19:55:56 nico Exp $ * $Id: cfi_util.c,v 1.10 2005/11/07 11:14:23 gleixner Exp $
* *
*/ */
@ -70,15 +70,6 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n
local_irq_enable(); local_irq_enable();
#endif #endif
if (extp->MajorVersion != '1' ||
(extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
printk(KERN_WARNING " Unknown %s Extended Query "
"version %c.%c.\n", name, extp->MajorVersion,
extp->MinorVersion);
kfree(extp);
extp = NULL;
}
out: return extp; out: return extp;
} }

Просмотреть файл

@ -2,7 +2,7 @@
* Routines common to all CFI-type probes. * Routines common to all CFI-type probes.
* (C) 2001-2003 Red Hat, Inc. * (C) 2001-2003 Red Hat, Inc.
* GPL'd * GPL'd
* $Id: gen_probe.c,v 1.22 2005/01/24 23:49:50 rmk Exp $ * $Id: gen_probe.c,v 1.24 2005/11/07 11:14:23 gleixner Exp $
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
@ -235,6 +235,7 @@ static struct mtd_info *check_cmd_set(struct map_info *map, int primary)
#ifdef CONFIG_MTD_CFI_INTELEXT #ifdef CONFIG_MTD_CFI_INTELEXT
case 0x0001: case 0x0001:
case 0x0003: case 0x0003:
case 0x0200:
return cfi_cmdset_0001(map, primary); return cfi_cmdset_0001(map, primary);
#endif #endif
#ifdef CONFIG_MTD_CFI_AMDSTD #ifdef CONFIG_MTD_CFI_AMDSTD

Просмотреть файл

@ -1,7 +1,7 @@
/* /*
Common Flash Interface probe code. Common Flash Interface probe code.
(C) 2000 Red Hat. GPL'd. (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.66 2005/11/07 11:14:23 gleixner Exp $
See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5) See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5)
for the standard this probe goes back to. for the standard this probe goes back to.

Просмотреть файл

@ -1,7 +1,7 @@
/* /*
* Common code to handle absent "placeholder" devices * Common code to handle absent "placeholder" devices
* Copyright 2001 Resilience Corporation <ebrower@resilience.com> * Copyright 2001 Resilience Corporation <ebrower@resilience.com>
* $Id: map_absent.c,v 1.5 2004/11/16 18:29:00 dwmw2 Exp $ * $Id: map_absent.c,v 1.6 2005/11/07 11:14:23 gleixner Exp $
* *
* This map driver is used to allocate "placeholder" MTD * This map driver is used to allocate "placeholder" MTD
* devices on systems that have socketed/removable media. * devices on systems that have socketed/removable media.

Просмотреть файл

@ -4,7 +4,7 @@
* Copyright 2000,2001 David A. Schleef <ds@schleef.org> * Copyright 2000,2001 David A. Schleef <ds@schleef.org>
* 2000,2001 Lineo, Inc. * 2000,2001 Lineo, Inc.
* *
* $Id: sharp.c,v 1.14 2004/08/09 13:19:43 dwmw2 Exp $ * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $
* *
* Devices supported: * Devices supported:
* LH28F016SCT Symmetrical block flash memory, 2Mx8 * LH28F016SCT Symmetrical block flash memory, 2Mx8
@ -31,6 +31,7 @@
#include <linux/mtd/cfi.h> #include <linux/mtd/cfi.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h>
#define CMD_RESET 0xffffffff #define CMD_RESET 0xffffffff
#define CMD_READ_ID 0x90909090 #define CMD_READ_ID 0x90909090
@ -214,7 +215,7 @@ static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd)
/* This function returns with the chip->mutex lock held. */ /* This function returns with the chip->mutex lock held. */
static int sharp_wait(struct map_info *map, struct flchip *chip) static int sharp_wait(struct map_info *map, struct flchip *chip)
{ {
__u16 status; int status, i;
unsigned long timeo = jiffies + HZ; unsigned long timeo = jiffies + HZ;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int adr = 0; int adr = 0;
@ -227,13 +228,11 @@ retry:
map_write32(map,CMD_READ_STATUS,adr); map_write32(map,CMD_READ_STATUS,adr);
chip->state = FL_STATUS; chip->state = FL_STATUS;
case FL_STATUS: case FL_STATUS:
for(i=0;i<100;i++){
status = map_read32(map,adr); status = map_read32(map,adr);
//printk("status=%08x\n",status); if((status & SR_READY)==SR_READY)
break;
udelay(100); udelay(1);
if((status & SR_READY)!=SR_READY){
//printk(".status=%08x\n",status);
udelay(100);
} }
break; break;
default: default:

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: cmdlinepart.c,v 1.18 2005/06/07 15:04:26 joern Exp $ * $Id: cmdlinepart.c,v 1.19 2005/11/07 11:14:19 gleixner Exp $
* *
* Read flash partition table from command line * Read flash partition table from command line
* *

Просмотреть файл

@ -1,5 +1,5 @@
# drivers/mtd/maps/Kconfig # drivers/mtd/maps/Kconfig
# $Id: Kconfig,v 1.15 2004/12/22 17:51:15 joern Exp $ # $Id: Kconfig,v 1.18 2005/11/07 11:14:24 gleixner Exp $
menu "Self-contained MTD device drivers" menu "Self-contained MTD device drivers"
depends on MTD!=n depends on MTD!=n

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: blkmtd.c,v 1.24 2004/11/16 18:29:01 dwmw2 Exp $ * $Id: blkmtd.c,v 1.27 2005/11/07 11:14:24 gleixner Exp $
* *
* blkmtd.c - use a block device as a fake MTD * blkmtd.c - use a block device as a fake MTD
* *
@ -39,7 +39,7 @@
/* Default erase size in K, always make it a multiple of PAGE_SIZE */ /* Default erase size in K, always make it a multiple of PAGE_SIZE */
#define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10) /* 128KiB */ #define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10) /* 128KiB */
#define VERSION "$Revision: 1.24 $" #define VERSION "$Revision: 1.27 $"
/* Info for the block device */ /* Info for the block device */
struct blkmtd_dev { struct blkmtd_dev {

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: block2mtd.c,v 1.28 2005/03/19 22:40:44 gleixner Exp $ * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $
* *
* block2mtd.c - create an mtd from a block device * block2mtd.c - create an mtd from a block device
* *
@ -19,7 +19,7 @@
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#define VERSION "$Revision: 1.28 $" #define VERSION "$Revision: 1.29 $"
#define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)

Просмотреть файл

@ -4,7 +4,7 @@
* (c) 1999 Machine Vision Holdings, Inc. * (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
* *
* $Id: doc2000.c,v 1.66 2005/01/05 18:05:12 dwmw2 Exp $ * $Id: doc2000.c,v 1.67 2005/11/07 11:14:24 gleixner Exp $
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>

Просмотреть файл

@ -4,7 +4,7 @@
* (c) 1999 Machine Vision Holdings, Inc. * (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
* *
* $Id: doc2001.c,v 1.48 2005/01/05 18:05:12 dwmw2 Exp $ * $Id: doc2001.c,v 1.49 2005/11/07 11:14:24 gleixner Exp $
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>

Просмотреть файл

@ -6,7 +6,7 @@
* (c) 1999 Machine Vision Holdings, Inc. * (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
* *
* $Id: doc2001plus.c,v 1.13 2005/01/05 18:05:12 dwmw2 Exp $ * $Id: doc2001plus.c,v 1.14 2005/11/07 11:14:24 gleixner Exp $
* *
* Released under GPL * Released under GPL
*/ */

Просмотреть файл

@ -7,7 +7,7 @@
* Author: Fabrice Bellard (fabrice.bellard@netgem.com) * Author: Fabrice Bellard (fabrice.bellard@netgem.com)
* Copyright (C) 2000 Netgem S.A. * Copyright (C) 2000 Netgem S.A.
* *
* $Id: docecc.c,v 1.5 2003/05/21 15:15:06 dwmw2 Exp $ * $Id: docecc.c,v 1.7 2005/11/07 11:14:25 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

Просмотреть файл

@ -4,7 +4,7 @@
/* (C) 1999 Machine Vision Holdings, Inc. */ /* (C) 1999 Machine Vision Holdings, Inc. */
/* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> */ /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> */
/* $Id: docprobe.c,v 1.44 2005/01/05 12:40:36 dwmw2 Exp $ */ /* $Id: docprobe.c,v 1.46 2005/11/07 11:14:25 gleixner Exp $ */

Просмотреть файл

@ -2,7 +2,7 @@
/* /*
* MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART.
* *
* $Id: lart.c,v 1.7 2004/08/09 13:19:44 dwmw2 Exp $ * $Id: lart.c,v 1.9 2005/11/07 11:14:25 gleixner Exp $
* *
* Author: Abraham vd Merwe <abraham@2d3d.co.za> * Author: Abraham vd Merwe <abraham@2d3d.co.za>
* *

Просмотреть файл

@ -1,5 +1,5 @@
/** /**
* $Id: phram.c,v 1.14 2005/03/07 21:43:38 joern Exp $ * $Id: phram.c,v 1.16 2005/11/07 11:14:25 gleixner Exp $
* *
* Copyright (c) ???? Jochen Schäuble <psionic@psionic.de> * Copyright (c) ???? Jochen Schäuble <psionic@psionic.de>
* Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de> * Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de>

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: pmc551.c,v 1.30 2005/01/05 18:05:13 dwmw2 Exp $ * $Id: pmc551.c,v 1.32 2005/11/07 11:14:25 gleixner Exp $
* *
* PMC551 PCI Mezzanine Ram Device * PMC551 PCI Mezzanine Ram Device
* *

Просмотреть файл

@ -1,6 +1,6 @@
/*====================================================================== /*======================================================================
$Id: slram.c,v 1.34 2005/01/06 21:16:42 jwboyer Exp $ $Id: slram.c,v 1.36 2005/11/07 11:14:25 gleixner Exp $
This driver provides a method to access memory not used by the kernel This driver provides a method to access memory not used by the kernel
itself (i.e. if the kernel commandline mem=xxx is used). To actually itself (i.e. if the kernel commandline mem=xxx is used). To actually

Просмотреть файл

@ -1,5 +1,5 @@
/* This version ported to the Linux-MTD system by dwmw2@infradead.org /* This version ported to the Linux-MTD system by dwmw2@infradead.org
* $Id: ftl.c,v 1.55 2005/01/17 13:47:21 hvr Exp $ * $Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $
* *
* Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br> * Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
@ -1086,7 +1086,7 @@ struct mtd_blktrans_ops ftl_tr = {
int init_ftl(void) int init_ftl(void)
{ {
DEBUG(0, "$Id: ftl.c,v 1.55 2005/01/17 13:47:21 hvr Exp $\n"); DEBUG(0, "$Id: ftl.c,v 1.58 2005/11/07 11:14:19 gleixner Exp $\n");
return register_mtd_blktrans(&ftl_tr); return register_mtd_blktrans(&ftl_tr);
} }

Просмотреть файл

@ -7,7 +7,7 @@
* (c) 1999 Machine Vision Holdings, Inc. * (c) 1999 Machine Vision Holdings, Inc.
* Author: David Woodhouse <dwmw2@infradead.org> * Author: David Woodhouse <dwmw2@infradead.org>
* *
* $Id: inftlcore.c,v 1.18 2004/11/16 18:28:59 dwmw2 Exp $ * $Id: inftlcore.c,v 1.19 2005/11/07 11:14:20 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -889,7 +889,7 @@ extern char inftlmountrev[];
static int __init init_inftl(void) static int __init init_inftl(void)
{ {
printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.18 $, " printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.19 $, "
"inftlmount.c %s\n", inftlmountrev); "inftlmount.c %s\n", inftlmountrev);
return register_mtd_blktrans(&inftl_tr); return register_mtd_blktrans(&inftl_tr);

Просмотреть файл

@ -8,7 +8,7 @@
* Author: Fabrice Bellard (fabrice.bellard@netgem.com) * Author: Fabrice Bellard (fabrice.bellard@netgem.com)
* Copyright (C) 2000 Netgem S.A. * Copyright (C) 2000 Netgem S.A.
* *
* $Id: inftlmount.c,v 1.16 2004/11/22 13:50:53 kalev Exp $ * $Id: inftlmount.c,v 1.18 2005/11/07 11:14:20 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -41,7 +41,7 @@
#include <linux/mtd/inftl.h> #include <linux/mtd/inftl.h>
#include <linux/mtd/compatmac.h> #include <linux/mtd/compatmac.h>
char inftlmountrev[]="$Revision: 1.16 $"; char inftlmountrev[]="$Revision: 1.18 $";
/* /*
* find_boot_record: Find the INFTL Media Header and its Spare copy which * find_boot_record: Find the INFTL Media Header and its Spare copy which
@ -563,7 +563,7 @@ int INFTL_mount(struct INFTLrecord *s)
/* Search for INFTL MediaHeader and Spare INFTL Media Header */ /* Search for INFTL MediaHeader and Spare INFTL Media Header */
if (find_boot_record(s) < 0) { if (find_boot_record(s) < 0) {
printk(KERN_WARNING "INFTL: could not find valid boot record?\n"); printk(KERN_WARNING "INFTL: could not find valid boot record?\n");
return -1; return -ENXIO;
} }
/* Init the logical to physical table */ /* Init the logical to physical table */

Просмотреть файл

@ -1,5 +1,5 @@
# drivers/mtd/maps/Kconfig # drivers/mtd/maps/Kconfig
# $Id: Kconfig,v 1.55 2005/07/02 01:53:24 tpoynor Exp $ # $Id: Kconfig,v 1.61 2005/11/07 11:14:26 gleixner Exp $
menu "Mapping drivers for chip access" menu "Mapping drivers for chip access"
depends on MTD!=n depends on MTD!=n
@ -94,17 +94,17 @@ config MTD_NETSC520
config MTD_TS5500 config MTD_TS5500
tristate "JEDEC Flash device mapped on Technologic Systems TS-5500" tristate "JEDEC Flash device mapped on Technologic Systems TS-5500"
depends on X86 && MTD_JEDECPROBE && MTD_PARTITIONS depends on ELAN
select MTD_PARTITIONS
select MTD_JEDECPROBE
select MTD_CFI_AMDSTD
help help
This provides a driver for the on-board flash of the Technologic This provides a driver for the on-board flash of the Technologic
System's TS-5500 board. The flash is split into 3 partitions System's TS-5500 board. The 2MB flash is split into 3 partitions
which are accessed as separate MTD devices. which are accessed as separate MTD devices.
mtd0 and mtd2 are the two BIOS drives. Unfortunately the BIOS mtd0 and mtd2 are the two BIOS drives, which use the resident
uses a proprietary flash translation layer from General Software, flash disk (RFD) flash translation layer.
which is not supported (the drives cannot be mounted). You can
create your own file system (jffs for example), but the BIOS
won't be able to boot from it.
mtd1 allows you to reprogram your BIOS. BE VERY CAREFUL. mtd1 allows you to reprogram your BIOS. BE VERY CAREFUL.
@ -213,10 +213,17 @@ config MTD_NETtel
config MTD_ALCHEMY config MTD_ALCHEMY
tristate ' AMD Alchemy Pb1xxx/Db1xxx/RDK MTD support' tristate ' AMD Alchemy Pb1xxx/Db1xxx/RDK MTD support'
depends on MIPS && SOC_AU1X00 depends on SOC_AU1X00
help help
Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
config MTD_MTX1
tristate "4G Systems MTX-1 Flash device"
depends on MIPS && MIPS_MTX1
help
Flash memory access on 4G Systems MTX-1 Board. If you have one of
these boards and would like to use the flash chips on it, say 'Y'.
config MTD_DILNETPC config MTD_DILNETPC
tristate "CFI Flash device mapped on DIL/Net PC" tristate "CFI Flash device mapped on DIL/Net PC"
depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
@ -244,14 +251,14 @@ config MTD_L440GX
config MTD_SBC8240 config MTD_SBC8240
tristate "Flash device on SBC8240" tristate "Flash device on SBC8240"
depends on PPC32 && MTD_JEDECPROBE && 6xx && 8260 depends on MTD_JEDECPROBE && 8260
help help
Flash access on the SBC8240 board from Wind River. See Flash access on the SBC8240 board from Wind River. See
<http://www.windriver.com/products/sbc8240/> <http://www.windriver.com/products/sbc8240/>
config MTD_TQM8XXL config MTD_TQM8XXL
tristate "CFI Flash device mapped on TQM8XXL" tristate "CFI Flash device mapped on TQM8XXL"
depends on MTD_CFI && PPC32 && 8xx && TQM8xxL depends on MTD_CFI && TQM8xxL
help help
The TQM8xxL PowerPC board has up to two banks of CFI-compliant The TQM8xxL PowerPC board has up to two banks of CFI-compliant
chips, currently uses AMD one. This 'mapping' driver supports chips, currently uses AMD one. This 'mapping' driver supports
@ -261,7 +268,7 @@ config MTD_TQM8XXL
config MTD_RPXLITE config MTD_RPXLITE
tristate "CFI Flash device mapped on RPX Lite or CLLF" tristate "CFI Flash device mapped on RPX Lite or CLLF"
depends on MTD_CFI && PPC32 && 8xx && (RPXCLASSIC || RPXLITE) depends on MTD_CFI && (RPXCLASSIC || RPXLITE)
help help
The RPXLite PowerPC board has CFI-compliant chips mapped in The RPXLite PowerPC board has CFI-compliant chips mapped in
a strange sparse mapping. This 'mapping' driver supports that a strange sparse mapping. This 'mapping' driver supports that
@ -271,7 +278,7 @@ config MTD_RPXLITE
config MTD_MBX860 config MTD_MBX860
tristate "System flash on MBX860 board" tristate "System flash on MBX860 board"
depends on MTD_CFI && PPC32 && 8xx && MBX depends on MTD_CFI && MBX
help help
This enables access routines for the flash chips on the Motorola This enables access routines for the flash chips on the Motorola
MBX860 board. If you have one of these boards and would like MBX860 board. If you have one of these boards and would like
@ -279,7 +286,7 @@ config MTD_MBX860
config MTD_DBOX2 config MTD_DBOX2
tristate "CFI Flash device mapped on D-Box2" tristate "CFI Flash device mapped on D-Box2"
depends on PPC32 && 8xx && DBOX2 && MTD_CFI_INTELSTD && MTD_CFI_INTELEXT && MTD_CFI_AMDSTD depends on DBOX2 && MTD_CFI_INTELSTD && MTD_CFI_INTELEXT && MTD_CFI_AMDSTD
help help
This enables access routines for the flash chips on the Nokia/Sagem This enables access routines for the flash chips on the Nokia/Sagem
D-Box 2 board. If you have one of these boards and would like to use D-Box 2 board. If you have one of these boards and would like to use
@ -287,14 +294,14 @@ config MTD_DBOX2
config MTD_CFI_FLAGADM config MTD_CFI_FLAGADM
tristate "CFI Flash device mapping on FlagaDM" tristate "CFI Flash device mapping on FlagaDM"
depends on PPC32 && 8xx && MTD_CFI depends on 8xx && MTD_CFI
help help
Mapping for the Flaga digital module. If you don't have one, ignore Mapping for the Flaga digital module. If you don't have one, ignore
this setting. this setting.
config MTD_BEECH config MTD_BEECH
tristate "CFI Flash device mapped on IBM 405LP Beech" tristate "CFI Flash device mapped on IBM 405LP Beech"
depends on MTD_CFI && PPC32 && 40x && BEECH depends on MTD_CFI && BEECH
help help
This enables access routines for the flash chips on the IBM This enables access routines for the flash chips on the IBM
405LP Beech board. If you have one of these boards and would like 405LP Beech board. If you have one of these boards and would like
@ -302,7 +309,7 @@ config MTD_BEECH
config MTD_ARCTIC config MTD_ARCTIC
tristate "CFI Flash device mapped on IBM 405LP Arctic" tristate "CFI Flash device mapped on IBM 405LP Arctic"
depends on MTD_CFI && PPC32 && 40x && ARCTIC2 depends on MTD_CFI && ARCTIC2
help help
This enables access routines for the flash chips on the IBM 405LP This enables access routines for the flash chips on the IBM 405LP
Arctic board. If you have one of these boards and would like to Arctic board. If you have one of these boards and would like to
@ -310,7 +317,7 @@ config MTD_ARCTIC
config MTD_WALNUT config MTD_WALNUT
tristate "Flash device mapped on IBM 405GP Walnut" tristate "Flash device mapped on IBM 405GP Walnut"
depends on MTD_JEDECPROBE && PPC32 && 40x && WALNUT depends on MTD_JEDECPROBE && WALNUT
help help
This enables access routines for the flash chips on the IBM 405GP This enables access routines for the flash chips on the IBM 405GP
Walnut board. If you have one of these boards and would like to Walnut board. If you have one of these boards and would like to
@ -318,7 +325,7 @@ config MTD_WALNUT
config MTD_EBONY config MTD_EBONY
tristate "Flash devices mapped on IBM 440GP Ebony" tristate "Flash devices mapped on IBM 440GP Ebony"
depends on MTD_JEDECPROBE && PPC32 && 44x && EBONY depends on MTD_JEDECPROBE && EBONY
help help
This enables access routines for the flash chips on the IBM 440GP This enables access routines for the flash chips on the IBM 440GP
Ebony board. If you have one of these boards and would like to Ebony board. If you have one of these boards and would like to
@ -326,7 +333,7 @@ config MTD_EBONY
config MTD_OCOTEA config MTD_OCOTEA
tristate "Flash devices mapped on IBM 440GX Ocotea" tristate "Flash devices mapped on IBM 440GX Ocotea"
depends on MTD_CFI && PPC32 && 44x && OCOTEA depends on MTD_CFI && OCOTEA
help help
This enables access routines for the flash chips on the IBM 440GX This enables access routines for the flash chips on the IBM 440GX
Ocotea board. If you have one of these boards and would like to Ocotea board. If you have one of these boards and would like to
@ -334,12 +341,20 @@ config MTD_OCOTEA
config MTD_REDWOOD config MTD_REDWOOD
tristate "CFI Flash devices mapped on IBM Redwood" tristate "CFI Flash devices mapped on IBM Redwood"
depends on MTD_CFI && PPC32 && 4xx && 40x && ( REDWOOD_4 || REDWOOD_5 || REDWOOD_6 ) depends on MTD_CFI && ( REDWOOD_4 || REDWOOD_5 || REDWOOD_6 )
help help
This enables access routines for the flash chips on the IBM This enables access routines for the flash chips on the IBM
Redwood board. If you have one of these boards and would like to Redwood board. If you have one of these boards and would like to
use the flash chips on it, say 'Y'. use the flash chips on it, say 'Y'.
config MTD_TQM834x
tristate "Flash device mapped on TQ Components TQM834x Boards"
depends on MTD_CFI && TQM834x
help
This enables access routines for the flash chips on the
TQ Components TQM834x boards. If you have one of these boards
and would like to use the flash chips on it, say 'Y'.
config MTD_CSTM_MIPS_IXX config MTD_CSTM_MIPS_IXX
tristate "Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board" tristate "Flash chip mapping on ITE QED-4N-S01B, Globespan IVR or custom board"
depends on MIPS && MTD_CFI && MTD_JEDECPROBE && MTD_PARTITIONS depends on MIPS && MTD_CFI && MTD_JEDECPROBE && MTD_PARTITIONS
@ -405,14 +420,14 @@ config MTD_ARM_INTEGRATOR
config MTD_CDB89712 config MTD_CDB89712
tristate "Cirrus CDB89712 evaluation board mappings" tristate "Cirrus CDB89712 evaluation board mappings"
depends on ARM && MTD_CFI && ARCH_CDB89712 depends on MTD_CFI && ARCH_CDB89712
help help
This enables access to the flash or ROM chips on the CDB89712 board. This enables access to the flash or ROM chips on the CDB89712 board.
If you have such a board, say 'Y'. If you have such a board, say 'Y'.
config MTD_SA1100 config MTD_SA1100
tristate "CFI Flash device mapped on StrongARM SA11x0" tristate "CFI Flash device mapped on StrongARM SA11x0"
depends on ARM && MTD_CFI && ARCH_SA1100 && MTD_PARTITIONS depends on MTD_CFI && ARCH_SA1100 && MTD_PARTITIONS
help help
This enables access to the flash chips on most platforms based on This enables access to the flash chips on most platforms based on
the SA1100 and SA1110, including the Assabet and the Compaq iPAQ. the SA1100 and SA1110, including the Assabet and the Compaq iPAQ.
@ -420,13 +435,13 @@ config MTD_SA1100
config MTD_IPAQ config MTD_IPAQ
tristate "CFI Flash device mapped on Compaq/HP iPAQ" tristate "CFI Flash device mapped on Compaq/HP iPAQ"
depends on ARM && IPAQ_HANDHELD && MTD_CFI depends on IPAQ_HANDHELD && MTD_CFI
help help
This provides a driver for the on-board flash of the iPAQ. This provides a driver for the on-board flash of the iPAQ.
config MTD_DC21285 config MTD_DC21285
tristate "CFI Flash device mapped on DC21285 Footbridge" tristate "CFI Flash device mapped on DC21285 Footbridge"
depends on ARM && MTD_CFI && ARCH_FOOTBRIDGE && MTD_COMPLEX_MAPPINGS depends on MTD_CFI && ARCH_FOOTBRIDGE && MTD_COMPLEX_MAPPINGS
help help
This provides a driver for the flash accessed using Intel's This provides a driver for the flash accessed using Intel's
21285 bridge used with Intel's StrongARM processors. More info at 21285 bridge used with Intel's StrongARM processors. More info at
@ -434,7 +449,7 @@ config MTD_DC21285
config MTD_IQ80310 config MTD_IQ80310
tristate "CFI Flash device mapped on the XScale IQ80310 board" tristate "CFI Flash device mapped on the XScale IQ80310 board"
depends on ARM && MTD_CFI && ARCH_IQ80310 depends on MTD_CFI && ARCH_IQ80310
help help
This enables access routines for the flash chips on the Intel XScale This enables access routines for the flash chips on the Intel XScale
IQ80310 evaluation board. If you have one of these boards and would IQ80310 evaluation board. If you have one of these boards and would
@ -442,7 +457,7 @@ config MTD_IQ80310
config MTD_IXP4XX config MTD_IXP4XX
tristate "CFI Flash device mapped on Intel IXP4xx based systems" tristate "CFI Flash device mapped on Intel IXP4xx based systems"
depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
help help
This enables MTD access to flash devices on platforms based This enables MTD access to flash devices on platforms based
on Intel's IXP4xx family of network processors such as the on Intel's IXP4xx family of network processors such as the
@ -451,7 +466,7 @@ config MTD_IXP4XX
config MTD_IXP2000 config MTD_IXP2000
tristate "CFI Flash device mapped on Intel IXP2000 based systems" tristate "CFI Flash device mapped on Intel IXP2000 based systems"
depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP2000 depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP2000
help help
This enables MTD access to flash devices on platforms based This enables MTD access to flash devices on platforms based
on Intel's IXP2000 family of network processors such as the on Intel's IXP2000 family of network processors such as the
@ -460,7 +475,7 @@ config MTD_IXP2000
config MTD_EPXA10DB config MTD_EPXA10DB
tristate "CFI Flash device mapped on Epxa10db" tristate "CFI Flash device mapped on Epxa10db"
depends on ARM && MTD_CFI && MTD_PARTITIONS && ARCH_CAMELOT depends on MTD_CFI && MTD_PARTITIONS && ARCH_CAMELOT
help help
This enables support for the flash devices on the Altera This enables support for the flash devices on the Altera
Excalibur XA10 Development Board. If you are building a kernel Excalibur XA10 Development Board. If you are building a kernel
@ -468,21 +483,21 @@ config MTD_EPXA10DB
config MTD_FORTUNET config MTD_FORTUNET
tristate "CFI Flash device mapped on the FortuNet board" tristate "CFI Flash device mapped on the FortuNet board"
depends on ARM && MTD_CFI && MTD_PARTITIONS && SA1100_FORTUNET depends on MTD_CFI && MTD_PARTITIONS && SA1100_FORTUNET
help help
This enables access to the Flash on the FortuNet board. If you This enables access to the Flash on the FortuNet board. If you
have such a board, say 'Y'. have such a board, say 'Y'.
config MTD_AUTCPU12 config MTD_AUTCPU12
tristate "NV-RAM mapping AUTCPU12 board" tristate "NV-RAM mapping AUTCPU12 board"
depends on ARM && ARCH_AUTCPU12 depends on ARCH_AUTCPU12
help help
This enables access to the NV-RAM on autronix autcpu12 board. This enables access to the NV-RAM on autronix autcpu12 board.
If you have such a board, say 'Y'. If you have such a board, say 'Y'.
config MTD_EDB7312 config MTD_EDB7312
tristate "CFI Flash device mapped on EDB7312" tristate "CFI Flash device mapped on EDB7312"
depends on ARM && MTD_CFI depends on ARCH_EDB7312 && MTD_CFI
help help
This enables access to the CFI Flash on the Cogent EDB7312 board. This enables access to the CFI Flash on the Cogent EDB7312 board.
If you have such a board, say 'Y' here. If you have such a board, say 'Y' here.
@ -496,7 +511,7 @@ config MTD_IMPA7
config MTD_CEIVA config MTD_CEIVA
tristate "JEDEC Flash device mapped on Ceiva/Polaroid PhotoMax Digital Picture Frame" tristate "JEDEC Flash device mapped on Ceiva/Polaroid PhotoMax Digital Picture Frame"
depends on ARM && MTD_JEDECPROBE && ARCH_CEIVA depends on MTD_JEDECPROBE && ARCH_CEIVA
help help
This enables access to the flash chips on the Ceiva/Polaroid This enables access to the flash chips on the Ceiva/Polaroid
PhotoMax Digital Picture Frame. PhotoMax Digital Picture Frame.
@ -504,25 +519,31 @@ config MTD_CEIVA
config MTD_NOR_TOTO config MTD_NOR_TOTO
tristate "NOR Flash device on TOTO board" tristate "NOR Flash device on TOTO board"
depends on ARM && ARCH_OMAP && OMAP_TOTO depends on ARCH_OMAP && OMAP_TOTO
help help
This enables access to the NOR flash on the Texas Instruments This enables access to the NOR flash on the Texas Instruments
TOTO board. TOTO board.
config MTD_H720X config MTD_H720X
tristate "Hynix evaluation board mappings" tristate "Hynix evaluation board mappings"
depends on ARM && MTD_CFI && ( ARCH_H7201 || ARCH_H7202 ) depends on MTD_CFI && ( ARCH_H7201 || ARCH_H7202 )
help help
This enables access to the flash chips on the Hynix evaluation boards. This enables access to the flash chips on the Hynix evaluation boards.
If you have such a board, say 'Y'. If you have such a board, say 'Y'.
config MTD_MPC1211 config MTD_MPC1211
tristate "CFI Flash device mapped on Interface MPC-1211" tristate "CFI Flash device mapped on Interface MPC-1211"
depends on SUPERH && SH_MPC1211 && MTD_CFI depends on SH_MPC1211 && MTD_CFI
help help
This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02). This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02).
If you have such a board, say 'Y'. If you have such a board, say 'Y'.
config MTD_PQ2FADS
tristate "JEDEC flash SIMM mapped on PQ2FADS and 8272ADS boards"
depends on (ADS8272 || PQ2FADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT
help
This enables access to flash SIMM on PQ2FADS-like boards
config MTD_OMAP_NOR config MTD_OMAP_NOR
tristate "TI OMAP board mappings" tristate "TI OMAP board mappings"
depends on MTD_CFI && ARCH_OMAP depends on MTD_CFI && ARCH_OMAP

Просмотреть файл

@ -1,7 +1,7 @@
# #
# linux/drivers/maps/Makefile # linux/drivers/maps/Makefile
# #
# $Id: Makefile.common,v 1.30 2005/07/02 01:53:24 tpoynor Exp $ # $Id: Makefile.common,v 1.34 2005/11/07 11:14:26 gleixner Exp $
ifeq ($(CONFIG_MTD_COMPLEX_MAPPINGS),y) ifeq ($(CONFIG_MTD_COMPLEX_MAPPINGS),y)
obj-$(CONFIG_MTD) += map_funcs.o obj-$(CONFIG_MTD) += map_funcs.o
@ -70,3 +70,6 @@ obj-$(CONFIG_MTD_DMV182) += dmv182.o
obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o
obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
obj-$(CONFIG_MTD_PQ2FADS) += pq2fads.o
obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o
obj-$(CONFIG_MTD_TQM834x) += tqm834x.o

Просмотреть файл

@ -1,7 +1,7 @@
/* /*
* Flash memory access on AMD Alchemy evaluation boards * Flash memory access on AMD Alchemy evaluation boards
* *
* $Id: alchemy-flash.c,v 1.1 2005/02/27 21:50:21 ppopov Exp $ * $Id: alchemy-flash.c,v 1.2 2005/11/07 11:14:26 gleixner Exp $
* *
* (C) 2003, 2004 Pete Popov <ppopov@embeddedalley.com> * (C) 2003, 2004 Pete Popov <ppopov@embeddedalley.com>
* *

Просмотреть файл

@ -2,7 +2,7 @@
* amd76xrom.c * amd76xrom.c
* *
* Normal mappings of chips in physical memory * Normal mappings of chips in physical memory
* $Id: amd76xrom.c,v 1.20 2005/03/18 14:04:35 gleixner Exp $ * $Id: amd76xrom.c,v 1.21 2005/11/07 11:14:26 gleixner Exp $
*/ */
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: arctic-mtd.c,v 1.13 2004/11/04 13:24:14 gleixner Exp $ * $Id: arctic-mtd.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
* *
* drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for * drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for
* IBM 405LP Arctic boards. * IBM 405LP Arctic boards.

Просмотреть файл

@ -2,7 +2,7 @@
* NV-RAM memory access on autcpu12 * NV-RAM memory access on autcpu12
* (C) 2002 Thomas Gleixner (gleixner@autronix.de) * (C) 2002 Thomas Gleixner (gleixner@autronix.de)
* *
* $Id: autcpu12-nvram.c,v 1.8 2004/11/04 13:24:14 gleixner Exp $ * $Id: autcpu12-nvram.c,v 1.9 2005/11/07 11:14:26 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

Просмотреть файл

@ -9,7 +9,7 @@
* 20-Sep-2004 BJD Initial version * 20-Sep-2004 BJD Initial version
* 17-Jan-2005 BJD Add whole device if no partitions found * 17-Jan-2005 BJD Add whole device if no partitions found
* *
* $Id: bast-flash.c,v 1.2 2005/01/18 11:13:47 bjd Exp $ * $Id: bast-flash.c,v 1.5 2005/11/07 11:14:26 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -205,6 +205,7 @@ static int bast_flash_probe(struct device *dev)
static struct device_driver bast_flash_driver = { static struct device_driver bast_flash_driver = {
.name = "bast-nor", .name = "bast-nor",
.owner = THIS_MODULE,
.bus = &platform_bus_type, .bus = &platform_bus_type,
.probe = bast_flash_probe, .probe = bast_flash_probe,
.remove = bast_flash_remove, .remove = bast_flash_remove,

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: beech-mtd.c,v 1.10 2004/11/04 13:24:14 gleixner Exp $ * $Id: beech-mtd.c,v 1.11 2005/11/07 11:14:26 gleixner Exp $
* *
* drivers/mtd/maps/beech-mtd.c MTD mappings and partition tables for * drivers/mtd/maps/beech-mtd.c MTD mappings and partition tables for
* IBM 405LP Beech boards. * IBM 405LP Beech boards.

Просмотреть файл

@ -1,7 +1,7 @@
/* /*
* Flash on Cirrus CDB89712 * Flash on Cirrus CDB89712
* *
* $Id: cdb89712.c,v 1.10 2004/11/04 13:24:14 gleixner Exp $ * $Id: cdb89712.c,v 1.11 2005/11/07 11:14:26 gleixner Exp $
*/ */
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -1,7 +1,7 @@
/* /*
* Copyright © 2001 Flaga hf. Medical Devices, Kári Davíðsson <kd@flaga.is> * Copyright © 2001 Flaga hf. Medical Devices, Kári Davíðsson <kd@flaga.is>
* *
* $Id: cfi_flagadm.c,v 1.14 2004/11/04 13:24:14 gleixner Exp $ * $Id: cfi_flagadm.c,v 1.15 2005/11/07 11:14:26 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify it * 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 the * under the terms of the GNU General Public License as published by the

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: cstm_mips_ixx.c,v 1.12 2004/11/04 13:24:14 gleixner Exp $ * $Id: cstm_mips_ixx.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
* *
* Mapping of a custom board with both AMD CFI and JEDEC flash in partitions. * Mapping of a custom board with both AMD CFI and JEDEC flash in partitions.
* Config with both CFI and JEDEC device support. * Config with both CFI and JEDEC device support.

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: dbox2-flash.c,v 1.13 2004/11/04 13:24:14 gleixner Exp $ * $Id: dbox2-flash.c,v 1.14 2005/11/07 11:14:26 gleixner Exp $
* *
* D-Box 2 flash driver * D-Box 2 flash driver
*/ */

Просмотреть файл

@ -5,7 +5,7 @@
* *
* This code is GPL * This code is GPL
* *
* $Id: dc21285.c,v 1.22 2004/11/01 13:39:21 rmk Exp $ * $Id: dc21285.c,v 1.24 2005/11/07 11:14:26 gleixner Exp $
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -14,7 +14,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* *
* $Id: dilnetpc.c,v 1.17 2004/11/28 09:40:39 dwmw2 Exp $ * $Id: dilnetpc.c,v 1.20 2005/11/07 11:14:26 gleixner Exp $
* *
* The DIL/Net PC is a tiny embedded PC board made by SSV Embedded Systems * The DIL/Net PC is a tiny embedded PC board made by SSV Embedded Systems
* featuring the AMD Elan SC410 processor. There are two variants of this * featuring the AMD Elan SC410 processor. There are two variants of this

Просмотреть файл

@ -4,7 +4,7 @@
* *
* Flash map driver for the Dy4 SVME182 board * Flash map driver for the Dy4 SVME182 board
* *
* $Id: dmv182.c,v 1.5 2004/11/04 13:24:14 gleixner Exp $ * $Id: dmv182.c,v 1.6 2005/11/07 11:14:26 gleixner Exp $
* *
* Copyright 2003-2004, TimeSys Corporation * Copyright 2003-2004, TimeSys Corporation
* *

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: ebony.c,v 1.15 2004/12/09 18:39:54 holindho Exp $ * $Id: ebony.c,v 1.16 2005/11/07 11:14:26 gleixner Exp $
* *
* Mapping for Ebony user flash * Mapping for Ebony user flash
* *

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: edb7312.c,v 1.13 2004/11/04 13:24:14 gleixner Exp $ * $Id: edb7312.c,v 1.14 2005/11/07 11:14:27 gleixner Exp $
* *
* Handle mapping of the NOR flash on Cogent EDB7312 boards * Handle mapping of the NOR flash on Cogent EDB7312 boards
* *

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (C) 2001 Altera Corporation * Copyright (C) 2001 Altera Corporation
* Copyright (C) 2001 Red Hat, Inc. * Copyright (C) 2001 Red Hat, Inc.
* *
* $Id: epxa10db-flash.c,v 1.13 2004/11/04 13:24:14 gleixner Exp $ * $Id: epxa10db-flash.c,v 1.15 2005/11/07 11:14:27 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

Просмотреть файл

@ -1,6 +1,6 @@
/* fortunet.c memory map /* fortunet.c memory map
* *
* $Id: fortunet.c,v 1.9 2004/11/04 13:24:14 gleixner Exp $ * $Id: fortunet.c,v 1.11 2005/11/07 11:14:27 gleixner Exp $
*/ */
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -2,7 +2,7 @@
* Flash memory access on Hynix GMS30C7201/HMS30C7202 based * Flash memory access on Hynix GMS30C7201/HMS30C7202 based
* evaluation boards * evaluation boards
* *
* $Id: h720x-flash.c,v 1.11 2004/11/04 13:24:14 gleixner Exp $ * $Id: h720x-flash.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $
* *
* (C) 2002 Jungjun Kim <jungjun.kim@hynix.com> * (C) 2002 Jungjun Kim <jungjun.kim@hynix.com>
* 2003 Thomas Gleixner <tglx@linutronix.de> * 2003 Thomas Gleixner <tglx@linutronix.de>

Просмотреть файл

@ -2,7 +2,7 @@
* ichxrom.c * ichxrom.c
* *
* Normal mappings of chips in physical memory * Normal mappings of chips in physical memory
* $Id: ichxrom.c,v 1.18 2005/07/07 10:26:20 dwmw2 Exp $ * $Id: ichxrom.c,v 1.19 2005/11/07 11:14:27 gleixner Exp $
*/ */
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: impa7.c,v 1.13 2004/11/04 13:24:14 gleixner Exp $ * $Id: impa7.c,v 1.14 2005/11/07 11:14:27 gleixner Exp $
* *
* Handle mapping of the NOR flash on implementa A7 boards * Handle mapping of the NOR flash on implementa A7 boards
* *

Просмотреть файл

@ -22,7 +22,7 @@
This is access code for flashes using ARM's flash partitioning This is access code for flashes using ARM's flash partitioning
standards. standards.
$Id: integrator-flash.c,v 1.18 2004/11/01 13:26:15 rmk Exp $ $Id: integrator-flash.c,v 1.20 2005/11/07 11:14:27 gleixner Exp $
======================================================================*/ ======================================================================*/

Просмотреть файл

@ -5,7 +5,7 @@
* (C) 2002 Hewlett-Packard Company <jamey.hicks@hp.com> * (C) 2002 Hewlett-Packard Company <jamey.hicks@hp.com>
* (C) 2003 Christian Pellegrin <chri@ascensit.com>, <chri@infis.univ.ts.it>: concatenation of multiple flashes * (C) 2003 Christian Pellegrin <chri@ascensit.com>, <chri@infis.univ.ts.it>: concatenation of multiple flashes
* *
* $Id: ipaq-flash.c,v 1.3 2004/11/04 13:24:15 gleixner Exp $ * $Id: ipaq-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $
*/ */
#include <linux/config.h> #include <linux/config.h>

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: iq80310.c,v 1.20 2004/11/04 13:24:15 gleixner Exp $ * $Id: iq80310.c,v 1.21 2005/11/07 11:14:27 gleixner Exp $
* *
* Mapping for the Intel XScale IQ80310 evaluation board * Mapping for the Intel XScale IQ80310 evaluation board
* *

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: ixp2000.c,v 1.6 2005/03/18 14:07:46 gleixner Exp $ * $Id: ixp2000.c,v 1.9 2005/11/07 11:14:27 gleixner Exp $
* *
* drivers/mtd/maps/ixp2000.c * drivers/mtd/maps/ixp2000.c
* *
@ -192,7 +192,7 @@ static int ixp2000_flash_probe(struct device *_dev)
/* /*
* map_priv_2 is used to store a ptr to to the bank_setup routine * map_priv_2 is used to store a ptr to to the bank_setup routine
*/ */
info->map.map_priv_2 = (void __iomem *) ixp_data->bank_setup; info->map.map_priv_2 = (unsigned long) ixp_data->bank_setup;
info->map.name = dev->dev.bus_id; info->map.name = dev->dev.bus_id;
info->map.read = ixp2000_flash_read8; info->map.read = ixp2000_flash_read8;
@ -209,7 +209,7 @@ static int ixp2000_flash_probe(struct device *_dev)
goto Error; goto Error;
} }
info->map.map_priv_1 = ioremap(dev->resource->start, info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start,
dev->resource->end - dev->resource->start + 1); dev->resource->end - dev->resource->start + 1);
if (!info->map.map_priv_1) { if (!info->map.map_priv_1) {
dev_err(_dev, "Failed to ioremap flash region\n"); dev_err(_dev, "Failed to ioremap flash region\n");

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: ixp4xx.c,v 1.7 2004/11/04 13:24:15 gleixner Exp $ * $Id: ixp4xx.c,v 1.12 2005/11/07 11:14:27 gleixner Exp $
* *
* drivers/mtd/maps/ixp4xx.c * drivers/mtd/maps/ixp4xx.c
* *
@ -45,7 +45,7 @@
static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs) static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs)
{ {
map_word val; map_word val;
val.x[0] = *(__u16 *) (map->map_priv_1 + ofs); val.x[0] = le16_to_cpu(readw(map->virt + ofs));
return val; return val;
} }
@ -59,17 +59,17 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
{ {
int i; int i;
u8 *dest = (u8 *) to; u8 *dest = (u8 *) to;
u16 *src = (u16 *) (map->map_priv_1 + from); void __iomem *src = map->virt + from;
u16 data; u16 data;
for (i = 0; i < (len / 2); i++) { for (i = 0; i < (len / 2); i++) {
data = src[i]; data = le16_to_cpu(readw(src + 2*i));
dest[i * 2] = BYTE0(data); dest[i * 2] = BYTE0(data);
dest[i * 2 + 1] = BYTE1(data); dest[i * 2 + 1] = BYTE1(data);
} }
if (len & 1) if (len & 1)
dest[len - 1] = BYTE0(src[i]); dest[len - 1] = BYTE0(le16_to_cpu(readw(src + 2*i)));
} }
/* /*
@ -79,7 +79,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr) static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long adr)
{ {
if (!(adr & 1)) if (!(adr & 1))
*(__u16 *) (map->map_priv_1 + adr) = d.x[0]; writew(cpu_to_le16(d.x[0]), map->virt + adr);
} }
/* /*
@ -87,7 +87,7 @@ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long
*/ */
static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr) static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr)
{ {
*(__u16 *) (map->map_priv_1 + adr) = d.x[0]; writew(cpu_to_le16(d.x[0]), map->virt + adr);
} }
struct ixp4xx_flash_info { struct ixp4xx_flash_info {
@ -104,25 +104,18 @@ static int ixp4xx_flash_remove(struct device *_dev)
struct platform_device *dev = to_platform_device(_dev); struct platform_device *dev = to_platform_device(_dev);
struct flash_platform_data *plat = dev->dev.platform_data; struct flash_platform_data *plat = dev->dev.platform_data;
struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev); struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev);
map_word d;
dev_set_drvdata(&dev->dev, NULL); dev_set_drvdata(&dev->dev, NULL);
if(!info) if(!info)
return 0; return 0;
/*
* This is required for a soft reboot to work.
*/
d.x[0] = 0xff;
ixp4xx_write16(&info->map, d, 0x55 * 0x2);
if (info->mtd) { if (info->mtd) {
del_mtd_partitions(info->mtd); del_mtd_partitions(info->mtd);
map_destroy(info->mtd); map_destroy(info->mtd);
} }
if (info->map.map_priv_1) if (info->map.virt)
iounmap((void *) info->map.map_priv_1); iounmap(info->map.virt);
kfree(info->partitions); kfree(info->partitions);
@ -134,9 +127,6 @@ static int ixp4xx_flash_remove(struct device *_dev)
if (plat->exit) if (plat->exit)
plat->exit(); plat->exit();
/* Disable flash write */
*IXP4XX_EXP_CS0 &= ~IXP4XX_FLASH_WRITABLE;
return 0; return 0;
} }
@ -165,12 +155,6 @@ static int ixp4xx_flash_probe(struct device *_dev)
dev_set_drvdata(&dev->dev, info); dev_set_drvdata(&dev->dev, info);
/*
* Enable flash write
* TODO: Move this out to board specific code
*/
*IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE;
/* /*
* Tell the MTD layer we're not 1:1 mapped so that it does * Tell the MTD layer we're not 1:1 mapped so that it does
* not attempt to do a direct access on us. * not attempt to do a direct access on us.
@ -198,9 +182,9 @@ static int ixp4xx_flash_probe(struct device *_dev)
goto Error; goto Error;
} }
info->map.map_priv_1 = ioremap(dev->resource->start, info->map.virt = ioremap(dev->resource->start,
dev->resource->end - dev->resource->start + 1); dev->resource->end - dev->resource->start + 1);
if (!info->map.map_priv_1) { if (!info->map.virt) {
printk(KERN_ERR "IXP4XXFlash: Failed to ioremap region\n"); printk(KERN_ERR "IXP4XXFlash: Failed to ioremap region\n");
err = -EIO; err = -EIO;
goto Error; goto Error;
@ -258,4 +242,3 @@ module_exit(ixp4xx_flash_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems"); MODULE_DESCRIPTION("MTD map driver for Intel IXP4xx systems");
MODULE_AUTHOR("Deepak Saxena"); MODULE_AUTHOR("Deepak Saxena");

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: l440gx.c,v 1.17 2004/11/28 09:40:39 dwmw2 Exp $ * $Id: l440gx.c,v 1.18 2005/11/07 11:14:27 gleixner Exp $
* *
* BIOS Flash chip on Intel 440GX board. * BIOS Flash chip on Intel 440GX board.
* *

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: lubbock-flash.c,v 1.19 2004/11/04 13:24:15 gleixner Exp $ * $Id: lubbock-flash.c,v 1.21 2005/11/07 11:14:27 gleixner Exp $
* *
* Map driver for the Lubbock developer platform. * Map driver for the Lubbock developer platform.
* *

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: mbx860.c,v 1.8 2004/11/04 13:24:15 gleixner Exp $ * $Id: mbx860.c,v 1.9 2005/11/07 11:14:27 gleixner Exp $
* *
* Handle mapping of the flash on MBX860 boards * Handle mapping of the flash on MBX860 boards
* *

Просмотреть файл

@ -0,0 +1,96 @@
/*
* Flash memory access on 4G Systems MTX-1 boards
*
* $Id: mtx-1_flash.c,v 1.2 2005/11/07 11:14:27 gleixner Exp $
*
* (C) 2005 Bruno Randolf <bruno.randolf@4g-systems.biz>
* (C) 2005 Jörn Engel <joern@wohnheim.fh-wedel.de>
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>
static struct map_info mtx1_map = {
.name = "MTX-1 flash",
.bankwidth = 4,
.size = 0x2000000,
.phys = 0x1E000000,
};
static struct mtd_partition mtx1_partitions[] = {
{
.name = "filesystem",
.size = 0x01C00000,
.offset = 0,
},{
.name = "yamon",
.size = 0x00100000,
.offset = MTDPART_OFS_APPEND,
.mask_flags = MTD_WRITEABLE,
},{
.name = "kernel",
.size = 0x002c0000,
.offset = MTDPART_OFS_APPEND,
},{
.name = "yamon env",
.size = 0x00040000,
.offset = MTDPART_OFS_APPEND,
}
};
static struct mtd_info *mtx1_mtd;
int __init mtx1_mtd_init(void)
{
int ret = -ENXIO;
simple_map_init(&mtx1_map);
mtx1_map.virt = ioremap(mtx1_map.phys, mtx1_map.size);
if (!mtx1_map.virt)
return -EIO;
mtx1_mtd = do_map_probe("cfi_probe", &mtx1_map);
if (!mtx1_mtd)
goto err;
mtx1_mtd->owner = THIS_MODULE;
ret = add_mtd_partitions(mtx1_mtd, mtx1_partitions,
ARRAY_SIZE(mtx1_partitions));
if (ret)
goto err;
return 0;
err:
iounmap(mtx1_map.virt);
return ret;
}
static void __exit mtx1_mtd_cleanup(void)
{
if (mtx1_mtd) {
del_mtd_partitions(mtx1_mtd);
map_destroy(mtx1_mtd);
}
if (mtx1_map.virt)
iounmap(mtx1_map.virt);
}
module_init(mtx1_mtd_init);
module_exit(mtx1_mtd_cleanup);
MODULE_AUTHOR("Bruno Randolf <bruno.randolf@4g-systems.biz>");
MODULE_DESCRIPTION("MTX-1 flash map");
MODULE_LICENSE("GPL");

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (C) 2001 Mark Langsdorf (mark.langsdorf@amd.com) * Copyright (C) 2001 Mark Langsdorf (mark.langsdorf@amd.com)
* based on sc520cdp.c by Sysgo Real-Time Solutions GmbH * based on sc520cdp.c by Sysgo Real-Time Solutions GmbH
* *
* $Id: netsc520.c,v 1.13 2004/11/28 09:40:40 dwmw2 Exp $ * $Id: netsc520.c,v 1.14 2005/11/07 11:14:27 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

Просмотреть файл

@ -6,7 +6,7 @@
* (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com) * (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com)
* (C) Copyright 2001-2002, SnapGear (www.snapgear.com) * (C) Copyright 2001-2002, SnapGear (www.snapgear.com)
* *
* $Id: nettel.c,v 1.10 2005/01/05 17:11:29 dwmw2 Exp $ * $Id: nettel.c,v 1.11 2005/11/07 11:14:27 gleixner Exp $
*/ */
/****************************************************************************/ /****************************************************************************/

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: ocelot.c,v 1.16 2005/01/05 18:05:13 dwmw2 Exp $ * $Id: ocelot.c,v 1.17 2005/11/07 11:14:27 gleixner Exp $
* *
* Flash on Momenco Ocelot * Flash on Momenco Ocelot
*/ */

Просмотреть файл

@ -1,4 +1,4 @@
// $Id: octagon-5066.c,v 1.26 2004/07/12 22:38:29 dwmw2 Exp $ // $Id: octagon-5066.c,v 1.28 2005/11/07 11:14:27 gleixner Exp $
/* ###################################################################### /* ######################################################################
Octagon 5066 MTD Driver. Octagon 5066 MTD Driver.

Просмотреть файл

@ -5,7 +5,7 @@
* *
* (C) 2002 MontVista Software, Inc. * (C) 2002 MontVista Software, Inc.
* *
* $Id: omap-toto-flash.c,v 1.3 2004/09/16 23:27:13 gleixner Exp $ * $Id: omap-toto-flash.c,v 1.5 2005/11/07 11:14:27 gleixner Exp $
*/ */
#include <linux/config.h> #include <linux/config.h>

Просмотреть файл

@ -7,7 +7,7 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* $Id: pci.c,v 1.10 2005/03/18 14:04:35 gleixner Exp $ * $Id: pci.c,v 1.13 2005/11/07 11:14:27 gleixner Exp $
* *
* Generic PCI memory map driver. We support the following boards: * Generic PCI memory map driver. We support the following boards:
* - Intel IQ80310 ATU. * - Intel IQ80310 ATU.

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: pcmciamtd.c,v 1.51 2004/07/12 22:38:29 dwmw2 Exp $ * $Id: pcmciamtd.c,v 1.55 2005/11/07 11:14:28 gleixner Exp $
* *
* pcmciamtd.c - MTD driver for PCMCIA flash memory cards * pcmciamtd.c - MTD driver for PCMCIA flash memory cards
* *
@ -48,7 +48,7 @@ static const int debug = 0;
#define DRIVER_DESC "PCMCIA Flash memory card driver" #define DRIVER_DESC "PCMCIA Flash memory card driver"
#define DRIVER_VERSION "$Revision: 1.51 $" #define DRIVER_VERSION "$Revision: 1.55 $"
/* Size of the PCMCIA address space: 26 bits = 64 MB */ /* Size of the PCMCIA address space: 26 bits = 64 MB */
#define MAX_PCMCIA_ADDR 0x4000000 #define MAX_PCMCIA_ADDR 0x4000000

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: physmap.c,v 1.37 2004/11/28 09:40:40 dwmw2 Exp $ * $Id: physmap.c,v 1.38 2005/11/07 11:14:28 gleixner Exp $
* *
* Normal mappings of chips in physical memory * Normal mappings of chips in physical memory
* *

Просмотреть файл

@ -6,7 +6,7 @@
* *
* Generic platfrom device based RAM map * Generic platfrom device based RAM map
* *
* $Id: plat-ram.c,v 1.3 2005/03/19 22:41:27 gleixner Exp $ * $Id: plat-ram.c,v 1.7 2005/11/07 11:14:28 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -177,7 +177,7 @@ static int platram_probe(struct device *dev)
info->map.phys = res->start; info->map.phys = res->start;
info->map.size = (res->end - res->start) + 1; info->map.size = (res->end - res->start) + 1;
info->map.name = pdata->mapname != NULL ? pdata->mapname : pd->name; info->map.name = pdata->mapname != NULL ? pdata->mapname : (char *)pd->name;
info->map.bankwidth = pdata->bankwidth; info->map.bankwidth = pdata->bankwidth;
/* register our usage of the memory area */ /* register our usage of the memory area */
@ -254,6 +254,7 @@ static int platram_probe(struct device *dev)
static struct device_driver platram_driver = { static struct device_driver platram_driver = {
.name = "mtd-ram", .name = "mtd-ram",
.owner = THIS_MODULE,
.bus = &platform_bus_type, .bus = &platform_bus_type,
.probe = platram_probe, .probe = platram_probe,
.remove = platram_remove, .remove = platram_remove,

Просмотреть файл

@ -5,7 +5,7 @@
* *
* This code is GPL * This code is GPL
* *
* $Id: pnc2000.c,v 1.17 2004/11/16 18:29:02 dwmw2 Exp $ * $Id: pnc2000.c,v 1.18 2005/11/07 11:14:28 gleixner Exp $
*/ */
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -0,0 +1,88 @@
/*
* drivers/mtd/maps/pq2fads.c
*
* Mapping for the flash SIMM on 8272ADS and PQ2FADS board
*
* Author: Vitaly Bordug <vbordug@ru.mvista.com>
*
* 2005 (c) MontaVista Software, Inc. This file is licensed under
* the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/ppcboot.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
/*
NOTE: bank width and interleave relative to the installed flash
should have been chosen within MTD_CFI_GEOMETRY options.
*/
#define PQ2FADS_BANK_WIDTH 4
static struct mtd_partition pq2fads_partitions[] = {
{
#ifdef CONFIG_ADS8272
.name = "HRCW",
.size = 0x40000,
.offset = 0,
.mask_flags = MTD_WRITEABLE, /* force read-only */
}, {
.name = "User FS",
.size = 0x5c0000,
.offset = 0x40000,
#else
.name = "User FS",
.size = 0x600000,
.offset = 0,
#endif
}, {
.name = "uImage",
.size = 0x100000,
.offset = 0x600000,
.mask_flags = MTD_WRITEABLE, /* force read-only */
}, {
.name = "bootloader",
.size = 0x40000,
.offset = 0x700000,
.mask_flags = MTD_WRITEABLE, /* force read-only */
}, {
.name = "bootloader env",
.size = 0x40000,
.offset = 0x740000,
.mask_flags = MTD_WRITEABLE, /* force read-only */
}
};
/* pointer to MPC885ADS board info data */
extern unsigned char __res[];
static int __init init_pq2fads_mtd(void)
{
bd_t *bd = (bd_t *)__res;
physmap_configure(bd->bi_flashstart, bd->bi_flashsize, PQ2FADS_BANK_WIDTH, NULL);
physmap_set_partitions(pq2fads_partitions,
sizeof (pq2fads_partitions) /
sizeof (pq2fads_partitions[0]));
return 0;
}
static void __exit cleanup_pq2fads_mtd(void)
{
}
module_init(init_pq2fads_mtd);
module_exit(cleanup_pq2fads_mtd);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("MTD map and partitions for MPC8272ADS boards");

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: redwood.c,v 1.10 2004/11/04 13:24:15 gleixner Exp $ * $Id: redwood.c,v 1.11 2005/11/07 11:14:28 gleixner Exp $
* *
* drivers/mtd/maps/redwood.c * drivers/mtd/maps/redwood.c
* *

Просмотреть файл

@ -3,7 +3,7 @@
* *
* (C) 2000 Nicolas Pitre <nico@cam.org> * (C) 2000 Nicolas Pitre <nico@cam.org>
* *
* $Id: sa1100-flash.c,v 1.47 2004/11/01 13:44:36 rmk Exp $ * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>

Просмотреть файл

@ -5,7 +5,7 @@
* *
* This code is GPLed * This code is GPLed
* *
* $Id: sbc8240.c,v 1.4 2004/07/12 22:38:29 dwmw2 Exp $ * $Id: sbc8240.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $
* *
*/ */

Просмотреть файл

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
$Id: sbc_gxx.c,v 1.33 2004/11/28 09:40:40 dwmw2 Exp $ $Id: sbc_gxx.c,v 1.35 2005/11/07 11:14:28 gleixner Exp $
The SBC-MediaGX / SBC-GXx has up to 16 MiB of The SBC-MediaGX / SBC-GXx has up to 16 MiB of
Intel StrataFlash (28F320/28F640) in x8 mode. Intel StrataFlash (28F320/28F640) in x8 mode.

Просмотреть файл

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* *
* $Id: sc520cdp.c,v 1.21 2004/12/13 10:27:08 dedekind Exp $ * $Id: sc520cdp.c,v 1.22 2005/11/07 11:14:28 gleixner Exp $
* *
* *
* The SC520CDP is an evaluation board for the Elan SC520 processor available * The SC520CDP is an evaluation board for the Elan SC520 processor available

Просмотреть файл

@ -2,7 +2,7 @@
Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
$Id: scx200_docflash.c,v 1.10 2004/11/28 09:40:40 dwmw2 Exp $ $Id: scx200_docflash.c,v 1.12 2005/11/07 11:14:28 gleixner Exp $
National Semiconductor SCx200 flash mapped with DOCCS National Semiconductor SCx200 flash mapped with DOCCS
*/ */

Просмотреть файл

@ -4,7 +4,7 @@
* Copyright (C) 2001 Lineo Japan, Inc. * Copyright (C) 2001 Lineo Japan, Inc.
* Copyright (C) 2002 SHARP * Copyright (C) 2002 SHARP
* *
* $Id: sharpsl-flash.c,v 1.5 2005/03/21 08:42:11 rpurdie Exp $ * $Id: sharpsl-flash.c,v 1.7 2005/11/07 11:14:28 gleixner Exp $
* *
* based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp
* Handle mapping of the flash on the RPX Lite and CLLF boards * Handle mapping of the flash on the RPX Lite and CLLF boards

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: solutionengine.c,v 1.14 2004/09/16 23:27:14 gleixner Exp $ * $Id: solutionengine.c,v 1.15 2005/11/07 11:14:28 gleixner Exp $
* *
* Flash and EPROM on Hitachi Solution Engine and similar boards. * Flash and EPROM on Hitachi Solution Engine and similar boards.
* *

Просмотреть файл

@ -1,4 +1,4 @@
/* $Id: sun_uflash.c,v 1.11 2004/11/04 13:24:15 gleixner Exp $ /* $Id: sun_uflash.c,v 1.13 2005/11/07 11:14:28 gleixner Exp $
* *
* sun_uflash - Driver implementation for user-programmable flash * sun_uflash - Driver implementation for user-programmable flash
* present on many Sun Microsystems SME boardsets. * present on many Sun Microsystems SME boardsets.

291
drivers/mtd/maps/tqm834x.c Normal file
Просмотреть файл

@ -0,0 +1,291 @@
/*
* drivers/mtd/maps/tqm834x.c
*
* MTD mapping driver for TQM834x boards
*
* Copyright 2005 Wolfgang Denk, DENX Software Engineering, <wd@denx.de>.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*
*/
#include <linux/config.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/ppcboot.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#define FLASH_BANK_MAX 2
extern unsigned char __res[];
/* trivial struct to describe partition information */
struct mtd_part_def
{
int nums;
unsigned char *type;
struct mtd_partition* mtd_part;
};
static struct mtd_info* mtd_banks[FLASH_BANK_MAX];
static struct map_info* map_banks[FLASH_BANK_MAX];
static struct mtd_part_def part_banks[FLASH_BANK_MAX];
static unsigned long num_banks;
static unsigned long start_scan_addr;
#ifdef CONFIG_MTD_PARTITIONS
/*
* The following defines the partition layout of TQM834x boards.
*
* See include/linux/mtd/partitions.h for definition of the
* mtd_partition structure.
*
* Assume minimal initial size of 4 MiB per bank, will be updated
* later in init_tqm834x_mtd() routine.
*/
/* Partition definition for the first flash bank which is always present. */
static struct mtd_partition tqm834x_partitions_bank1[] = {
{
.name = "u-boot", /* u-boot firmware */
.offset = 0x00000000,
.size = 0x00040000, /* 256 KiB */
/*mask_flags: MTD_WRITEABLE, * force read-only */
},
{
.name = "env", /* u-boot environment */
.offset = 0x00040000,
.size = 0x00020000, /* 128 KiB */
/*mask_flags: MTD_WRITEABLE, * force read-only */
},
{
.name = "kernel", /* linux kernel image */
.offset = 0x00060000,
.size = 0x00100000, /* 1 MiB */
/*mask_flags: MTD_WRITEABLE, * force read-only */
},
{
.name = "initrd", /* ramdisk image */
.offset = 0x00160000,
.size = 0x00200000, /* 2 MiB */
},
{
.name = "user", /* user data */
.offset = 0x00360000,
.size = 0x000a0000, /* remaining space */
/* NOTE: this parttion size is re-calcated in */
/* init_tqm834x_mtd() to cover actual remaining space. */
},
};
/* Partition definition for the second flash bank which may be present on some
* TQM834x boards.
*/
static struct mtd_partition tqm834x_partitions_bank2[] = {
{
.name = "jffs2", /* jffs2 filesystem */
.offset = 0x00000000,
.size = 0x00400000, /* whole device */
/* NOTE: this parttion size is re-calcated in */
/* init_tqm834x_mtd() to cover actual device size. */
},
};
#endif /* CONFIG_MTD_PARTITIONS */
static int __init init_tqm834x_mtd(void)
{
int idx = 0, ret = 0;
unsigned long flash_addr, flash_size, mtd_size = 0;
/* pointer to TQM834x board info data */
bd_t *bd = (bd_t *)__res;
#ifdef CONFIG_MTD_CMDLINE_PARTS
int n;
char mtdid[4];
const char *part_probes[] = { "cmdlinepart", NULL };
#endif
flash_addr = bd->bi_flashstart;
flash_size = bd->bi_flashsize;
/* request maximum flash size address space */
start_scan_addr = (unsigned long)ioremap(flash_addr, flash_size);
if (!start_scan_addr) {
printk("%s: Failed to ioremap address: 0x%lx\n",
__FUNCTION__, flash_addr);
return -EIO;
}
for(idx = 0 ; idx < FLASH_BANK_MAX ; idx++) {
if (mtd_size >= flash_size)
break;
pr_debug("%s: chip probing count %d\n", __FUNCTION__, idx);
map_banks[idx] =
(struct map_info *)kmalloc(sizeof(struct map_info),
GFP_KERNEL);
if (map_banks[idx] == NULL) {
ret = -ENOMEM;
goto error_mem;
}
memset((void *)map_banks[idx], 0, sizeof(struct map_info));
map_banks[idx]->name = (char *)kmalloc(16, GFP_KERNEL);
if (map_banks[idx]->name == NULL) {
ret = -ENOMEM;
goto error_mem;
}
memset((void *)map_banks[idx]->name, 0, 16);
sprintf(map_banks[idx]->name, "TQM834x-%d", idx);
map_banks[idx]->size = flash_size;
map_banks[idx]->bankwidth = 4;
simple_map_init(map_banks[idx]);
map_banks[idx]->virt = (void __iomem *)
(start_scan_addr + ((idx > 0) ?
(mtd_banks[idx-1] ? mtd_banks[idx-1]->size : 0) : 0));
map_banks[idx]->phys =
flash_addr + ((idx > 0) ?
(mtd_banks[idx-1] ? mtd_banks[idx-1]->size : 0) : 0);
/* start to probe flash chips */
mtd_banks[idx] = do_map_probe("cfi_probe", map_banks[idx]);
if (mtd_banks[idx]) {
mtd_banks[idx]->owner = THIS_MODULE;
mtd_size += mtd_banks[idx]->size;
num_banks++;
pr_debug("%s: bank %ld, name: %s, size: %d bytes \n",
__FUNCTION__, num_banks,
mtd_banks[idx]->name, mtd_banks[idx]->size);
}
}
/* no supported flash chips found */
if (!num_banks) {
printk("TQM834x: No supported flash chips found!\n");
ret = -ENXIO;
goto error_mem;
}
#ifdef CONFIG_MTD_PARTITIONS
/*
* Select static partition definitions
*/
n = ARRAY_SIZE(tqm834x_partitions_bank1);
part_banks[0].mtd_part = tqm834x_partitions_bank1;
part_banks[0].type = "static image bank1";
part_banks[0].nums = n;
/* update last partition size to cover actual remaining space */
tqm834x_partitions_bank1[n - 1].size =
mtd_banks[0]->size -
tqm834x_partitions_bank1[n - 1].offset;
/* check if we have second bank? */
if (num_banks == 2) {
n = ARRAY_SIZE(tqm834x_partitions_bank2);
part_banks[1].mtd_part = tqm834x_partitions_bank2;
part_banks[1].type = "static image bank2";
part_banks[1].nums = n;
/* update last partition size to cover actual remaining space */
tqm834x_partitions_bank2[n - 1].size =
mtd_banks[1]->size -
tqm834x_partitions_bank2[n - 1].offset;
}
for(idx = 0; idx < num_banks ; idx++) {
#ifdef CONFIG_MTD_CMDLINE_PARTS
sprintf(mtdid, "%d", idx);
n = parse_mtd_partitions(mtd_banks[idx],
part_probes,
&part_banks[idx].mtd_part,
0);
pr_debug("%s: %d command line partitions on bank %s\n",
__FUNCTION__, n, mtdid);
if (n > 0) {
part_banks[idx].type = "command line";
part_banks[idx].nums = n;
}
#endif /* CONFIG_MTD_CMDLINE_PARTS */
if (part_banks[idx].nums == 0) {
printk(KERN_NOTICE
"TQM834x flash bank %d: no partition info "
"available, registering whole device\n", idx);
add_mtd_device(mtd_banks[idx]);
} else {
printk(KERN_NOTICE
"TQM834x flash bank %d: Using %s partition "
"definition\n", idx, part_banks[idx].type);
add_mtd_partitions(mtd_banks[idx],
part_banks[idx].mtd_part,
part_banks[idx].nums);
}
}
#else /* ! CONFIG_MTD_PARTITIONS */
printk(KERN_NOTICE "TQM834x flash: registering %d flash banks "
"at once\n", num_banks);
for(idx = 0 ; idx < num_banks ; idx++)
add_mtd_device(mtd_banks[idx]);
#endif /* CONFIG_MTD_PARTITIONS */
return 0;
error_mem:
for (idx = 0 ; idx < FLASH_BANK_MAX ; idx++) {
if (map_banks[idx] != NULL) {
if (map_banks[idx]->name != NULL) {
kfree(map_banks[idx]->name);
map_banks[idx]->name = NULL;
}
kfree(map_banks[idx]);
map_banks[idx] = NULL;
}
}
iounmap((void *)start_scan_addr);
return ret;
}
static void __exit cleanup_tqm834x_mtd(void)
{
unsigned int idx = 0;
for(idx = 0 ; idx < num_banks ; idx++) {
/* destroy mtd_info previously allocated */
if (mtd_banks[idx]) {
del_mtd_partitions(mtd_banks[idx]);
map_destroy(mtd_banks[idx]);
}
/* release map_info not used anymore */
kfree(map_banks[idx]->name);
kfree(map_banks[idx]);
}
if (start_scan_addr) {
iounmap((void *)start_scan_addr);
start_scan_addr = 0;
}
}
module_init(init_tqm834x_mtd);
module_exit(cleanup_tqm834x_mtd);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Wolfgang Denk <wd@denx.de>");
MODULE_DESCRIPTION("MTD map driver for TQM834x boards");

Просмотреть файл

@ -2,7 +2,7 @@
* Handle mapping of the flash memory access routines * Handle mapping of the flash memory access routines
* on TQM8xxL based devices. * on TQM8xxL based devices.
* *
* $Id: tqm8xxl.c,v 1.13 2004/10/20 22:21:53 dwmw2 Exp $ * $Id: tqm8xxl.c,v 1.15 2005/11/07 11:14:28 gleixner Exp $
* *
* based on rpxlite.c * based on rpxlite.c
* *

Просмотреть файл

@ -19,26 +19,22 @@
* *
* Note: * Note:
* - In order for detection to work, jumper 3 must be set. * - In order for detection to work, jumper 3 must be set.
* - Drive A and B use a proprietary FTL from General Software which isn't * - Drive A and B use the resident flash disk (RFD) flash translation layer.
* supported as of yet so standard drives can't be mounted; you can create
* your own (e.g. jffs) file system.
* - If you have created your own jffs file system and the bios overwrites * - If you have created your own jffs file system and the bios overwrites
* it during boot, try disabling Drive A: and B: in the boot order. * it during boot, try disabling Drive A: and B: in the boot order.
* *
* $Id: ts5500_flash.c,v 1.2 2004/11/28 09:40:40 dwmw2 Exp $ * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mtd/mtd.h> #include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mtd/map.h> #include <linux/mtd/map.h>
#include <linux/mtd/mtd.h>
#ifdef CONFIG_MTD_PARTITIONS
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#endif #include <linux/types.h>
#define WINDOW_ADDR 0x09400000 #define WINDOW_ADDR 0x09400000
#define WINDOW_SIZE 0x00200000 #define WINDOW_SIZE 0x00200000
@ -50,7 +46,6 @@ static struct map_info ts5500_map = {
.phys = WINDOW_ADDR .phys = WINDOW_ADDR
}; };
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition ts5500_partitions[] = { static struct mtd_partition ts5500_partitions[] = {
{ {
.name = "Drive A", .name = "Drive A",
@ -71,8 +66,6 @@ static struct mtd_partition ts5500_partitions[] = {
#define NUM_PARTITIONS (sizeof(ts5500_partitions)/sizeof(struct mtd_partition)) #define NUM_PARTITIONS (sizeof(ts5500_partitions)/sizeof(struct mtd_partition))
#endif
static struct mtd_info *mymtd; static struct mtd_info *mymtd;
static int __init init_ts5500_map(void) static int __init init_ts5500_map(void)
@ -84,7 +77,7 @@ static int __init init_ts5500_map(void)
if (!ts5500_map.virt) { if (!ts5500_map.virt) {
printk(KERN_ERR "Failed to ioremap_nocache\n"); printk(KERN_ERR "Failed to ioremap_nocache\n");
rc = -EIO; rc = -EIO;
goto err_out_ioremap; goto err2;
} }
simple_map_init(&ts5500_map); simple_map_init(&ts5500_map);
@ -95,34 +88,25 @@ static int __init init_ts5500_map(void)
if (!mymtd) { if (!mymtd) {
rc = -ENXIO; rc = -ENXIO;
goto err_out_map; goto err1;
} }
mymtd->owner = THIS_MODULE; mymtd->owner = THIS_MODULE;
#ifdef CONFIG_MTD_PARTITIONS
add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS); add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS);
#else
add_mtd_device(mymtd);
#endif
return 0; return 0;
err_out_map: err1:
map_destroy(mymtd); map_destroy(mymtd);
err_out_ioremap:
iounmap(ts5500_map.virt); iounmap(ts5500_map.virt);
err2:
return rc; return rc;
} }
static void __exit cleanup_ts5500_map(void) static void __exit cleanup_ts5500_map(void)
{ {
if (mymtd) { if (mymtd) {
#ifdef CONFIG_MTD_PARTITIONS
del_mtd_partitions(mymtd); del_mtd_partitions(mymtd);
#else
del_mtd_device(mymtd);
#endif
map_destroy(mymtd); map_destroy(mymtd);
} }

Просмотреть файл

@ -2,7 +2,7 @@
* tsunami_flash.c * tsunami_flash.c
* *
* flash chip on alpha ds10... * flash chip on alpha ds10...
* $Id: tsunami_flash.c,v 1.9 2004/07/14 09:52:55 dwmw2 Exp $ * $Id: tsunami_flash.c,v 1.10 2005/11/07 11:14:29 gleixner Exp $
*/ */
#include <asm/io.h> #include <asm/io.h>
#include <asm/core_tsunami.h> #include <asm/core_tsunami.h>

Просмотреть файл

@ -5,7 +5,7 @@
* *
* (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
* *
* $Id: uclinux.c,v 1.10 2005/01/05 18:05:13 dwmw2 Exp $ * $Id: uclinux.c,v 1.12 2005/11/07 11:14:29 gleixner Exp $
*/ */
/****************************************************************************/ /****************************************************************************/

Просмотреть файл

@ -1,4 +1,4 @@
// $Id: vmax301.c,v 1.30 2004/07/12 22:38:29 dwmw2 Exp $ // $Id: vmax301.c,v 1.32 2005/11/07 11:14:29 gleixner Exp $
/* ###################################################################### /* ######################################################################
Tempustech VMAX SBC301 MTD Driver. Tempustech VMAX SBC301 MTD Driver.

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: walnut.c,v 1.2 2004/12/10 12:07:42 holindho Exp $ * $Id: walnut.c,v 1.3 2005/11/07 11:14:29 gleixner Exp $
* *
* Mapping for Walnut flash * Mapping for Walnut flash
* (used ebony.c as a "framework") * (used ebony.c as a "framework")

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: wr_sbc82xx_flash.c,v 1.7 2004/11/04 13:24:15 gleixner Exp $ * $Id: wr_sbc82xx_flash.c,v 1.8 2005/11/07 11:14:29 gleixner Exp $
* *
* Map for flash chips on Wind River PowerQUICC II SBC82xx board. * Map for flash chips on Wind River PowerQUICC II SBC82xx board.
* *

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: mtd_blkdevs.c,v 1.24 2004/11/16 18:28:59 dwmw2 Exp $ * $Id: mtd_blkdevs.c,v 1.27 2005/11/07 11:14:20 gleixner Exp $
* *
* (C) 2003 David Woodhouse <dwmw2@infradead.org> * (C) 2003 David Woodhouse <dwmw2@infradead.org>
* *
@ -21,7 +21,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/devfs_fs_kernel.h>
static LIST_HEAD(blktrans_majors); static LIST_HEAD(blktrans_majors);
@ -290,10 +289,18 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
gd->first_minor = (new->devnum) << tr->part_bits; gd->first_minor = (new->devnum) << tr->part_bits;
gd->fops = &mtd_blktrans_ops; gd->fops = &mtd_blktrans_ops;
if (tr->part_bits)
if (new->devnum < 26)
snprintf(gd->disk_name, sizeof(gd->disk_name), snprintf(gd->disk_name, sizeof(gd->disk_name),
"%s%c", tr->name, (tr->part_bits?'a':'0') + new->devnum); "%s%c", tr->name, 'a' + new->devnum);
snprintf(gd->devfs_name, sizeof(gd->devfs_name), else
"%s/%c", tr->name, (tr->part_bits?'a':'0') + new->devnum); snprintf(gd->disk_name, sizeof(gd->disk_name),
"%s%c%c", tr->name,
'a' - 1 + new->devnum / 26,
'a' + new->devnum % 26);
else
snprintf(gd->disk_name, sizeof(gd->disk_name),
"%s%d", tr->name, new->devnum);
/* 2.5 has capacity in units of 512 bytes while still /* 2.5 has capacity in units of 512 bytes while still
having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */ having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */
@ -411,8 +418,6 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
return ret; return ret;
} }
devfs_mk_dir(tr->name);
INIT_LIST_HEAD(&tr->devs); INIT_LIST_HEAD(&tr->devs);
list_add(&tr->list, &blktrans_majors); list_add(&tr->list, &blktrans_majors);
@ -445,7 +450,6 @@ int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr)
tr->remove_dev(dev); tr->remove_dev(dev);
} }
devfs_remove(tr->name);
blk_cleanup_queue(tr->blkcore_priv->rq); blk_cleanup_queue(tr->blkcore_priv->rq);
unregister_blkdev(tr->major, tr->name); unregister_blkdev(tr->major, tr->name);

Просмотреть файл

@ -1,21 +1,22 @@
/* /*
* Direct MTD block device access * Direct MTD block device access
* *
* $Id: mtdblock.c,v 1.66 2004/11/25 13:52:52 joern Exp $ * $Id: mtdblock.c,v 1.68 2005/11/07 11:14:20 gleixner Exp $
* *
* (C) 2000-2003 Nicolas Pitre <nico@cam.org> * (C) 2000-2003 Nicolas Pitre <nico@cam.org>
* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/sched.h> /* TASK_* */
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/blktrans.h> #include <linux/mtd/blktrans.h>

Просмотреть файл

@ -1,22 +1,23 @@
/* /*
* $Id: mtdchar.c,v 1.73 2005/07/04 17:36:41 gleixner Exp $ * $Id: mtdchar.c,v 1.76 2005/11/07 11:14:20 gleixner Exp $
* *
* Character-device access to raw MTD devices. * Character-device access to raw MTD devices.
* *
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/compatmac.h> #include <linux/mtd/compatmac.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/sched.h> /* TASK_* */
#include <asm/uaccess.h>
#include <linux/device.h> #include <asm/uaccess.h>
static struct class *mtd_class; static struct class *mtd_class;
@ -70,26 +71,23 @@ static loff_t mtd_lseek (struct file *file, loff_t offset, int orig)
switch (orig) { switch (orig) {
case 0: case 0:
/* SEEK_SET */ /* SEEK_SET */
file->f_pos = offset;
break; break;
case 1: case 1:
/* SEEK_CUR */ /* SEEK_CUR */
file->f_pos += offset; offset += file->f_pos;
break; break;
case 2: case 2:
/* SEEK_END */ /* SEEK_END */
file->f_pos =mtd->size + offset; offset += mtd->size;
break; break;
default: default:
return -EINVAL; return -EINVAL;
} }
if (file->f_pos < 0) if (offset >= 0 && offset < mtd->size)
file->f_pos = 0; return file->f_pos = offset;
else if (file->f_pos >= mtd->size)
file->f_pos = mtd->size - 1;
return file->f_pos; return -EINVAL;
} }

Просмотреть файл

@ -7,14 +7,15 @@
* *
* This code is GPL * This code is GPL
* *
* $Id: mtdconcat.c,v 1.9 2004/06/30 15:17:41 dbrown Exp $ * $Id: mtdconcat.c,v 1.11 2005/11/07 11:14:20 gleixner Exp $
*/ */
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched.h> /* TASK_* */ #include <linux/sched.h>
#include <linux/types.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/concat.h> #include <linux/mtd/concat.h>

Просмотреть файл

@ -1,5 +1,5 @@
/* /*
* $Id: mtdcore.c,v 1.45 2005/02/18 14:34:50 dedekind Exp $ * $Id: mtdcore.c,v 1.47 2005/11/07 11:14:20 gleixner Exp $
* *
* Core registration and callback routines for MTD * Core registration and callback routines for MTD
* drivers and users. * drivers and users.
@ -296,39 +296,6 @@ EXPORT_SYMBOL(unregister_mtd_user);
EXPORT_SYMBOL(default_mtd_writev); EXPORT_SYMBOL(default_mtd_writev);
EXPORT_SYMBOL(default_mtd_readv); EXPORT_SYMBOL(default_mtd_readv);
/*====================================================================*/
/* Power management code */
#ifdef CONFIG_PM
#include <linux/pm.h>
static struct pm_dev *mtd_pm_dev = NULL;
static int mtd_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
{
int ret = 0, i;
if (down_trylock(&mtd_table_mutex))
return -EAGAIN;
if (rqst == PM_SUSPEND) {
for (i = 0; ret == 0 && i < MAX_MTD_DEVICES; i++) {
if (mtd_table[i] && mtd_table[i]->suspend)
ret = mtd_table[i]->suspend(mtd_table[i]);
}
} else i = MAX_MTD_DEVICES-1;
if (rqst == PM_RESUME || ret) {
for ( ; i >= 0; i--) {
if (mtd_table[i] && mtd_table[i]->resume)
mtd_table[i]->resume(mtd_table[i]);
}
}
up(&mtd_table_mutex);
return ret;
}
#endif
/*====================================================================*/ /*====================================================================*/
/* Support for /proc/mtd */ /* Support for /proc/mtd */
@ -388,22 +355,11 @@ static int __init init_mtd(void)
if ((proc_mtd = create_proc_entry( "mtd", 0, NULL ))) if ((proc_mtd = create_proc_entry( "mtd", 0, NULL )))
proc_mtd->read_proc = mtd_read_proc; proc_mtd->read_proc = mtd_read_proc;
#endif #endif
#ifdef CONFIG_PM
mtd_pm_dev = pm_register(PM_UNKNOWN_DEV, 0, mtd_pm_callback);
#endif
return 0; return 0;
} }
static void __exit cleanup_mtd(void) static void __exit cleanup_mtd(void)
{ {
#ifdef CONFIG_PM
if (mtd_pm_dev) {
pm_unregister(mtd_pm_dev);
mtd_pm_dev = NULL;
}
#endif
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
if (proc_mtd) if (proc_mtd)
remove_proc_entry( "mtd", NULL); remove_proc_entry( "mtd", NULL);

Просмотреть файл

@ -5,7 +5,7 @@
* *
* This code is GPL * This code is GPL
* *
* $Id: mtdpart.c,v 1.53 2005/02/08 17:11:13 nico Exp $ * $Id: mtdpart.c,v 1.55 2005/11/07 11:14:20 gleixner Exp $
* *
* 02-21-2002 Thomas Gleixner <gleixner@autronix.de> * 02-21-2002 Thomas Gleixner <gleixner@autronix.de>
* added support for read_oob, write_oob * added support for read_oob, write_oob
@ -465,9 +465,10 @@ int add_mtd_partitions(struct mtd_info *master,
if (slave->offset == MTDPART_OFS_APPEND) if (slave->offset == MTDPART_OFS_APPEND)
slave->offset = cur_offset; slave->offset = cur_offset;
if (slave->offset == MTDPART_OFS_NXTBLK) { if (slave->offset == MTDPART_OFS_NXTBLK) {
u_int32_t emask = master->erasesize-1; slave->offset = cur_offset;
slave->offset = (cur_offset + emask) & ~emask; if ((cur_offset % master->erasesize) != 0) {
if (slave->offset != cur_offset) { /* Round up to next erasesize */
slave->offset = ((cur_offset / master->erasesize) + 1) * master->erasesize;
printk(KERN_NOTICE "Moving partition %d: " printk(KERN_NOTICE "Moving partition %d: "
"0x%08x -> 0x%08x\n", i, "0x%08x -> 0x%08x\n", i,
cur_offset, slave->offset); cur_offset, slave->offset);

Просмотреть файл

@ -1,5 +1,5 @@
# drivers/mtd/nand/Kconfig # drivers/mtd/nand/Kconfig
# $Id: Kconfig,v 1.31 2005/06/20 12:03:21 bjd Exp $ # $Id: Kconfig,v 1.35 2005/11/07 11:14:30 gleixner Exp $
menu "NAND Flash Device Drivers" menu "NAND Flash Device Drivers"
depends on MTD!=n depends on MTD!=n
@ -25,33 +25,33 @@ config MTD_NAND_VERIFY_WRITE
config MTD_NAND_AUTCPU12 config MTD_NAND_AUTCPU12
tristate "SmartMediaCard on autronix autcpu12 board" tristate "SmartMediaCard on autronix autcpu12 board"
depends on ARM && MTD_NAND && ARCH_AUTCPU12 depends on MTD_NAND && ARCH_AUTCPU12
help help
This enables the driver for the autronix autcpu12 board to This enables the driver for the autronix autcpu12 board to
access the SmartMediaCard. access the SmartMediaCard.
config MTD_NAND_EDB7312 config MTD_NAND_EDB7312
tristate "Support for Cirrus Logic EBD7312 evaluation board" tristate "Support for Cirrus Logic EBD7312 evaluation board"
depends on ARM && MTD_NAND && ARCH_EDB7312 depends on MTD_NAND && ARCH_EDB7312
help help
This enables the driver for the Cirrus Logic EBD7312 evaluation This enables the driver for the Cirrus Logic EBD7312 evaluation
board to access the onboard NAND Flash. board to access the onboard NAND Flash.
config MTD_NAND_H1900 config MTD_NAND_H1900
tristate "iPAQ H1900 flash" tristate "iPAQ H1900 flash"
depends on ARM && MTD_NAND && ARCH_PXA && MTD_PARTITIONS depends on MTD_NAND && ARCH_PXA && MTD_PARTITIONS
help help
This enables the driver for the iPAQ h1900 flash. This enables the driver for the iPAQ h1900 flash.
config MTD_NAND_SPIA config MTD_NAND_SPIA
tristate "NAND Flash device on SPIA board" tristate "NAND Flash device on SPIA board"
depends on ARM && ARCH_P720T && MTD_NAND depends on ARCH_P720T && MTD_NAND
help help
If you had to ask, you don't have one. Say 'N'. If you had to ask, you don't have one. Say 'N'.
config MTD_NAND_TOTO config MTD_NAND_TOTO
tristate "NAND Flash device on TOTO board" tristate "NAND Flash device on TOTO board"
depends on ARM && ARCH_OMAP && MTD_NAND depends on ARCH_OMAP && MTD_NAND
help help
Support for NAND flash on Texas Instruments Toto platform. Support for NAND flash on Texas Instruments Toto platform.
@ -59,8 +59,8 @@ config MTD_NAND_IDS
tristate tristate
config MTD_NAND_AU1550 config MTD_NAND_AU1550
tristate "Au1550 NAND support" tristate "Au1550/1200 NAND support"
depends on SOC_AU1550 && MTD_NAND depends on (SOC_AU1200 || SOC_AU1550) && MTD_NAND
help help
This enables the driver for the NAND flash controller on the This enables the driver for the NAND flash controller on the
AMD/Alchemy 1550 SOC. AMD/Alchemy 1550 SOC.

Просмотреть файл

@ -3,7 +3,7 @@
* *
* Copyright (C) 2004 Embedded Edge, LLC * Copyright (C) 2004 Embedded Edge, LLC
* *
* $Id: au1550nd.c,v 1.11 2004/11/04 12:53:10 gleixner Exp $ * $Id: au1550nd.c,v 1.13 2005/11/07 11:14:30 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
@ -21,13 +21,7 @@
/* fixme: this is ugly */ /* fixme: this is ugly */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0) #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)
#include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1xxx.h>
#ifdef CONFIG_MIPS_PB1550
#include <asm/mach-pb1x00/pb1550.h>
#endif
#ifdef CONFIG_MIPS_DB1550
#include <asm/mach-db1x00/db1x00.h>
#endif
#else #else
#include <asm/au1000.h> #include <asm/au1000.h>
#ifdef CONFIG_MIPS_PB1550 #ifdef CONFIG_MIPS_PB1550
@ -45,39 +39,22 @@ static struct mtd_info *au1550_mtd = NULL;
static void __iomem *p_nand; static void __iomem *p_nand;
static int nand_width = 1; /* default x8*/ static int nand_width = 1; /* default x8*/
#define NAND_CS 1
/* /*
* Define partitions for flash device * Define partitions for flash device
*/ */
const static struct mtd_partition partition_info[] = { const static struct mtd_partition partition_info[] = {
#ifdef CONFIG_MIPS_PB1550
#define NUM_PARTITIONS 2
{ {
.name = "Pb1550 NAND FS 0", .name = "NAND FS 0",
.offset = 0, .offset = 0,
.size = 8*1024*1024 .size = 8*1024*1024
}, },
{ {
.name = "Pb1550 NAND FS 1", .name = "NAND FS 1",
.offset = MTDPART_OFS_APPEND, .offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL .size = MTDPART_SIZ_FULL
} }
#endif
#ifdef CONFIG_MIPS_DB1550
#define NUM_PARTITIONS 2
{
.name = "Db1550 NAND FS 0",
.offset = 0,
.size = 8*1024*1024
},
{
.name = "Db1550 NAND FS 1",
.offset = MTDPART_OFS_APPEND,
.size = MTDPART_SIZ_FULL
}
#endif
}; };
#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
/** /**
@ -339,11 +316,13 @@ int au1550_device_ready(struct mtd_info *mtd)
/* /*
* Main initialization routine * Main initialization routine
*/ */
int __init au1550_init (void) int __init au1xxx_nand_init (void)
{ {
struct nand_chip *this; struct nand_chip *this;
u16 boot_swapboot = 0; /* default value */ u16 boot_swapboot = 0; /* default value */
int retval; int retval;
u32 mem_staddr;
u32 nand_phys;
/* Allocate memory for MTD device structure and private data */ /* Allocate memory for MTD device structure and private data */
au1550_mtd = kmalloc (sizeof(struct mtd_info) + au1550_mtd = kmalloc (sizeof(struct mtd_info) +
@ -364,8 +343,11 @@ int __init au1550_init (void)
au1550_mtd->priv = this; au1550_mtd->priv = this;
/* MEM_STNDCTL: disable ints, disable nand boot */ /* disable interrupts */
au_writel(0, MEM_STNDCTL); au_writel(au_readl(MEM_STNDCTL) & ~(1<<8), MEM_STNDCTL);
/* disable NAND boot */
au_writel(au_readl(MEM_STNDCTL) & ~(1<<0), MEM_STNDCTL);
#ifdef CONFIG_MIPS_PB1550 #ifdef CONFIG_MIPS_PB1550
/* set gpio206 high */ /* set gpio206 high */
@ -397,19 +379,60 @@ int __init au1550_init (void)
} }
#endif #endif
/* Configure RCE1 - should be done by YAMON */ /* Configure chip-select; normally done by boot code, e.g. YAMON */
au_writel(0x5 | (nand_width << 22), 0xB4001010); /* MEM_STCFG1 */ #ifdef NAND_STCFG
au_writel(NAND_TIMING, 0xB4001014); /* MEM_STTIME1 */ if (NAND_CS == 0) {
au_sync(); au_writel(NAND_STCFG, MEM_STCFG0);
au_writel(NAND_STTIME, MEM_STTIME0);
au_writel(NAND_STADDR, MEM_STADDR0);
}
if (NAND_CS == 1) {
au_writel(NAND_STCFG, MEM_STCFG1);
au_writel(NAND_STTIME, MEM_STTIME1);
au_writel(NAND_STADDR, MEM_STADDR1);
}
if (NAND_CS == 2) {
au_writel(NAND_STCFG, MEM_STCFG2);
au_writel(NAND_STTIME, MEM_STTIME2);
au_writel(NAND_STADDR, MEM_STADDR2);
}
if (NAND_CS == 3) {
au_writel(NAND_STCFG, MEM_STCFG3);
au_writel(NAND_STTIME, MEM_STTIME3);
au_writel(NAND_STADDR, MEM_STADDR3);
}
#endif
/* setup and enable chip select, MEM_STADDR1 */ /* Locate NAND chip-select in order to determine NAND phys address */
/* we really need to decode offsets only up till 0x20 */ mem_staddr = 0x00000000;
au_writel((1<<28) | (NAND_PHYS_ADDR>>4) | if (((au_readl(MEM_STCFG0) & 0x7) == 0x5) && (NAND_CS == 0))
(((NAND_PHYS_ADDR + 0x1000)-1) & (0x3fff<<18)>>18), mem_staddr = au_readl(MEM_STADDR0);
MEM_STADDR1); else if (((au_readl(MEM_STCFG1) & 0x7) == 0x5) && (NAND_CS == 1))
au_sync(); mem_staddr = au_readl(MEM_STADDR1);
else if (((au_readl(MEM_STCFG2) & 0x7) == 0x5) && (NAND_CS == 2))
mem_staddr = au_readl(MEM_STADDR2);
else if (((au_readl(MEM_STCFG3) & 0x7) == 0x5) && (NAND_CS == 3))
mem_staddr = au_readl(MEM_STADDR3);
if (mem_staddr == 0x00000000) {
printk("Au1xxx NAND: ERROR WITH NAND CHIP-SELECT\n");
kfree(au1550_mtd);
return 1;
}
nand_phys = (mem_staddr << 4) & 0xFFFC0000;
p_nand = (void __iomem *)ioremap(nand_phys, 0x1000);
/* make controller and MTD agree */
if (NAND_CS == 0)
nand_width = au_readl(MEM_STCFG0) & (1<<22);
if (NAND_CS == 1)
nand_width = au_readl(MEM_STCFG1) & (1<<22);
if (NAND_CS == 2)
nand_width = au_readl(MEM_STCFG2) & (1<<22);
if (NAND_CS == 3)
nand_width = au_readl(MEM_STCFG3) & (1<<22);
p_nand = ioremap(NAND_PHYS_ADDR, 0x1000);
/* Set address of hardware control function */ /* Set address of hardware control function */
this->hwcontrol = au1550_hwcontrol; this->hwcontrol = au1550_hwcontrol;
@ -438,7 +461,7 @@ int __init au1550_init (void)
} }
/* Register the partitions */ /* Register the partitions */
add_mtd_partitions(au1550_mtd, partition_info, NUM_PARTITIONS); add_mtd_partitions(au1550_mtd, partition_info, NB_OF(partition_info));
return 0; return 0;
@ -450,7 +473,7 @@ int __init au1550_init (void)
return retval; return retval;
} }
module_init(au1550_init); module_init(au1xxx_nand_init);
/* /*
* Clean up routine * Clean up routine

Просмотреть файл

@ -6,7 +6,7 @@
* Derived from drivers/mtd/spia.c * Derived from drivers/mtd/spia.c
* Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
* *
* $Id: autcpu12.c,v 1.22 2004/11/04 12:53:10 gleixner Exp $ * $Id: autcpu12.c,v 1.23 2005/11/07 11:14:30 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as

Просмотреть файл

@ -16,7 +16,7 @@
* *
* Interface to generic NAND code for M-Systems DiskOnChip devices * Interface to generic NAND code for M-Systems DiskOnChip devices
* *
* $Id: diskonchip.c,v 1.54 2005/04/07 14:22:55 dbrown Exp $ * $Id: diskonchip.c,v 1.55 2005/11/07 11:14:30 gleixner Exp $
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше