Commit 95075bdb authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Merge bk://linux-mtd.bkbits.net/mtd-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents faa9979f 0055897d
......@@ -11,7 +11,7 @@ DOCBOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \
mousedrivers.sgml deviceiobook.sgml procfs-guide.sgml \
tulip-user.sgml writing_usb_driver.sgml scsidrivers.sgml \
sis900.sgml kernel-api.sgml journal-api.sgml lsm.sgml usb.sgml \
gadget.sgml libata.sgml
gadget.sgml libata.sgml mtdnand.sgml librs.sgml
###
# The build process is as follows (targets):
......
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN"[]>
<book id="Reed-Solomon-Library-Guide">
<bookinfo>
<title>Reed-Solomon Library Programming Interface</title>
<authorgroup>
<author>
<firstname>Thomas</firstname>
<surname>Gleixner</surname>
<affiliation>
<address>
<email>tglx@linutronix.de</email>
</address>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>2004</year>
<holder>Thomas Gleixner</holder>
</copyright>
<legalnotice>
<para>
This documentation is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public
License version 2 as published by the Free Software Foundation.
</para>
<para>
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
</para>
<para>
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
</para>
<para>
For more details see the file COPYING in the source
distribution of Linux.
</para>
</legalnotice>
</bookinfo>
<toc></toc>
<chapter id="intro">
<title>Introduction</title>
<para>
The generic Reed-Solomon Library provides encoding, decoding
and error correction functions.
</para>
<para>
Reed-Solomon codes are used in communication and storage
applications to ensure data integrity.
</para>
<para>
This documentation is provided for developers who want to utilize
the functions provided by the library.
</para>
</chapter>
<chapter id="bugs">
<title>Known Bugs And Assumptions</title>
<para>
None.
</para>
</chapter>
<chapter id="usage">
<title>Usage</title>
<para>
This chapter provides examples how to use the library.
</para>
<sect1>
<title>Initializing</title>
<para>
The init function init_rs returns a pointer to a
rs decoder structure, which holds the neccecary
information for encoding, decoding and error correction
with the given polynomial. It either uses an existing
matching decoder or creates a new one. On creation all
the lookup tables for fast en/decoding are created.
The function may take a while, so make sure not to
call it in critical code pathes.
</para>
<programlisting>
/* the Reed Solomon control structure */
static struct rs_control *rs_decoder;
/* Symbolsize is 10 (bits)
* Primitve polynomial is x^10+x^3+1
* first consecutive root is 0
* primitve element to generate roots = 1
* generator polinomial degree (number of roots) = 6
*/
rs_decoder = init_rs (10, 0x409, 0, 1, 6);
</programlisting>
</sect1>
<sect1>
<title>Encoding</title>
<para>
The encoder calculates the Reed-Solomon code over
the given data length and stores the result in
the parity buffer. Note that the parity buffer must
be initialized before calling the encoder.
</para>
<para>
The expanded data can be inverted on the fly by
providing a non zero inversion mask. The expanded data is
XOR'ed with the mask. This is used e.g. for FLASH
ECC, where the all 0xFF is inverted to an all 0x00.
The Reed-Solomon code for all 0x00 is all 0x00. The
code is inverted before storing to FLASH so it is 0xFF
too. This prevent's that reading from an erased FLASH
results in ECC errors.
</para>
<para>
The databytes are expanded to the given symbolsize
on the fly. There is no support for encoding continuos
bitstreams with a symbolsize != 8 at the moment. If
it is neccecary it should be not a big deal to implement
such functionality.
</para>
<programlisting>
/* Parity buffer. Size = number of roots */
uint16_t par[6];
/* Initialize the parity buffer */
memset(par, 0, sizeof(par));
/* Encode 512 byte in data8. Store parity in buffer par */
encode_rs8 (rs_decoder, data8, 512, par, 0);
</programlisting>
</sect1>
<sect1>
<title>Decoding</title>
<para>
The decoder calculates the syndrome over
the given data length and the received parity symbols
and corrects errors in the data.
</para>
<para>
If a syndrome is available from a hardware decoder
then the syndrome calculation is skipped.
</para>
<para>
The correction of the data buffer can be suppressed
by providing a correction pattern buffer and an error
location buffer to the decoder. The decoder stores the
calculated error location and the correction bitmask
in the given buffers. This is useful for hardware
decoders which use a weird bitordering scheme.
</para>
<para>
The databytes are expanded to the given symbolsize
on the fly. There is no support for decoding continuos
bitstreams with a symbolsize != 8 at the moment. If
it is neccecary it should be not a big deal to implement
such functionality.
</para>
<sect2>
<title>
Decoding with syndrome calculation, direct data correction
</title>
<programlisting>
/* Parity buffer. Size = number of roots */
uint16_t par[6];
uint8_t data[512];
int numerr;
/* Receive data */
.....
/* Receive parity */
.....
/* Decode 512 byte in data8.*/
numerr = decode_rs8 (rs_decoder, data8, par, 512, NULL, 0, NULL, 0, NULL);
</programlisting>
</sect2>
<sect2>
<title>
Decoding with syndrome given by hardware decoder, direct data correction
</title>
<programlisting>
/* Parity buffer. Size = number of roots */
uint16_t par[6], syn[6];
uint8_t data[512];
int numerr;
/* Receive data */
.....
/* Receive parity */
.....
/* Get syndrome from hardware decoder */
.....
/* Decode 512 byte in data8.*/
numerr = decode_rs8 (rs_decoder, data8, par, 512, syn, 0, NULL, 0, NULL);
</programlisting>
</sect2>
<sect2>
<title>
Decoding with syndrome given by hardware decoder, no direct data correction.
</title>
<para>
Note: It's not neccecary to give data and recieved parity to the decoder.
</para>
<programlisting>
/* Parity buffer. Size = number of roots */
uint16_t par[6], syn[6], corr[8];
uint8_t data[512];
int numerr, errpos[8];
/* Receive data */
.....
/* Receive parity */
.....
/* Get syndrome from hardware decoder */
.....
/* Decode 512 byte in data8.*/
numerr = decode_rs8 (rs_decoder, NULL, NULL, 512, syn, 0, errpos, 0, corr);
for (i = 0; i < numerr; i++) {
do_error_correction_in_your_buffer(errpos[i], corr[i]);
}
</programlisting>
</sect2>
</sect1>
<sect1>
<title>Cleanup</title>
<para>
The function free_rs frees the allocated resources,
if the caller is the last user of the decoder.
</para>
<programlisting>
/* Release resources */
free_rs(rs_decoder);
</programlisting>
</sect1>
</chapter>
<chapter id="structs">
<title>Structures</title>
<para>
This chapter contains the autogenerated documentation of the structures which are
used in the Reed-Solomon Library and are relevant for a developer.
</para>
!Iinclude/linux/rslib.h
</chapter>
<chapter id="pubfunctions">
<title>Public Functions Provided</title>
<para>
This chapter contains the autogenerated documentation of the Reed-Solomon functions
which are exported.
</para>
!Elib/reed_solomon/reed_solomon.c
</chapter>
<chapter id="credits">
<title>Credits</title>
<para>
The library code for encoding and decoding was written by Phil Karn.
</para>
<programlisting>
Copyright 2002, Phil Karn, KA9Q
May be used under the terms of the GNU General Public License (GPL)
</programlisting>
<para>
The wrapper functions and interfaces are written by Thomas Gleixner
</para>
<para>
Many users have provided bugfixes, improvements and helping hands for testing.
Thanks a lot.
</para>
<para>
The following people have contributed to this document:
</para>
<para>
Thomas Gleixner<email>tglx@linutronix.de</email>
</para>
</chapter>
</book>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
Common Flash Interface probe code.
(C) 2000 Red Hat. GPL'd.
$Id: cfi_probe.c,v 1.77 2004/07/14 08:38:44 dwmw2 Exp $
$Id: cfi_probe.c,v 1.79 2004/10/20 23:04:01 dwmw2 Exp $
*/
#include <linux/config.h>
......@@ -243,12 +243,27 @@ static char *vendorname(__u16 vendor)
case P_ID_AMD_EXT:
return "AMD/Fujitsu Extended";
case P_ID_WINBOND:
return "Winbond Standard";
case P_ID_ST_ADV:
return "ST Advanced";
case P_ID_MITSUBISHI_STD:
return "Mitsubishi Standard";
case P_ID_MITSUBISHI_EXT:
return "Mitsubishi Extended";
case P_ID_SST_PAGE:
return "SST Page Write";
case P_ID_INTEL_PERFORMANCE:
return "Intel Performance Code";
case P_ID_INTEL_DATA:
return "Intel Data";
case P_ID_RESERVED:
return "Not Allowed / Reserved for Future Use";
......@@ -327,6 +342,10 @@ static void print_cfi_ident(struct cfi_ident *cfip)
printk(" - x32-only asynchronous interface\n");
break;
case 4:
printk(" - supports x16 and x32 via Word# with asynchronous interface\n");
break;
case 65535:
printk(" - Not Allowed / Reserved\n");
break;
......
......@@ -7,7 +7,7 @@
*
* This code is covered by the GPL.
*
* $Id: cfi_util.c,v 1.4 2004/07/14 08:38:44 dwmw2 Exp $
* $Id: cfi_util.c,v 1.5 2004/08/12 06:40:23 eric Exp $
*
*/
......@@ -22,6 +22,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/cfi.h>
#include <linux/mtd/compatmac.h>
......@@ -74,19 +75,114 @@ cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name)
EXPORT_SYMBOL(cfi_read_pri);
void cfi_fixup(struct map_info *map, struct cfi_fixup* fixups)
void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup *fixups)
{
struct map_info *map = mtd->priv;
struct cfi_private *cfi = map->fldrv_priv;
struct cfi_fixup *f;
for (f=fixups; f->fixup; f++) {
if (((f->mfr == CFI_MFR_ANY) || (f->mfr == cfi->mfr)) &&
((f->id == CFI_ID_ANY) || (f->id == cfi->id))) {
f->fixup(map, f->param);
f->fixup(mtd, f->param);
}
}
}
EXPORT_SYMBOL(cfi_fixup);
int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
loff_t ofs, size_t len, void *thunk)
{
struct map_info *map = mtd->priv;
struct cfi_private *cfi = map->fldrv_priv;
unsigned long adr;
int chipnum, ret = 0;
int i, first;
struct mtd_erase_region_info *regions = mtd->eraseregions;
if (ofs > mtd->size)
return -EINVAL;
if ((len + ofs) > mtd->size)
return -EINVAL;
/* Check that both start and end of the requested erase are
* aligned with the erasesize at the appropriate addresses.
*/
i = 0;
/* Skip all erase regions which are ended before the start of
the requested erase. Actually, to save on the calculations,
we skip to the first erase region which starts after the
start of the requested erase, and then go back one.
*/
while (i < mtd->numeraseregions && ofs >= regions[i].offset)
i++;
i--;
/* OK, now i is pointing at the erase region in which this
erase request starts. Check the start of the requested
erase range is aligned with the erase size which is in
effect here.
*/
if (ofs & (regions[i].erasesize-1))
return -EINVAL;
/* Remember the erase region we start on */
first = i;
/* Next, check that the end of the requested erase is aligned
* with the erase region at that address.
*/
while (i<mtd->numeraseregions && (ofs + len) >= regions[i].offset)
i++;
/* As before, drop back one to point at the region in which
the address actually falls
*/
i--;
if ((ofs + len) & (regions[i].erasesize-1))
return -EINVAL;
chipnum = ofs >> cfi->chipshift;
adr = ofs - (chipnum << cfi->chipshift);
i=first;
while(len) {
unsigned long chipmask;
int size = regions[i].erasesize;
ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk);
if (ret)
return ret;
adr += size;
len -= size;
chipmask = (1 << cfi->chipshift) - 1;
if ((adr & chipmask) == ((regions[i].offset + size * regions[i].numblocks) & chipmask))
i++;
if (adr >> cfi->chipshift) {
adr = 0;
chipnum++;
if (chipnum >= cfi->numchips)
break;
}
}
return 0;
}
EXPORT_SYMBOL(cfi_varsize_frob);
MODULE_LICENSE("GPL");
#ifndef FWH_LOCK_H
#define FWH_LOCK_H
enum fwh_lock_state {
FWH_UNLOCKED = 0,
FWH_DENY_WRITE = 1,
FWH_IMMUTABLE = 2,
FWH_DENY_READ = 4,
};
struct fwh_xxlock_thunk {
enum fwh_lock_state val;
flstate_t state;
};
#define FWH_XXLOCK_ONEBLOCK_LOCK ((struct fwh_xxlock_thunk){ FWH_DENY_WRITE, FL_LOCKING})
#define FWH_XXLOCK_ONEBLOCK_UNLOCK ((struct fwh_xxlock_thunk){ FWH_UNLOCKED, FL_UNLOCKING})
/*
* This locking/unlock is specific to firmware hub parts. Only one
* is known that supports the Intel command set. Firmware
* hub parts cannot be interleaved as they are on the LPC bus
* so this code has not been tested with interleaved chips,
* and will likely fail in that context.
*/
static int fwh_xxlock_oneblock(struct map_info *map, struct flchip *chip,
unsigned long adr, int len, void *thunk)
{
struct cfi_private *cfi = map->fldrv_priv;
struct fwh_xxlock_thunk *xxlt = (struct fwh_xxlock_thunk *)thunk;
int ret;
/* Refuse the operation if the we cannot look behind the chip */
if (chip->start < 0x400000) {
DEBUG( MTD_DEBUG_LEVEL3,
"MTD %s(): chip->start: %lx wanted >= 0x400000\n",
__func__, chip->start );
return -EIO;
}
/*
* lock block registers:
* - on 64k boundariesand
* - bit 1 set high
* - block lock registers are 4MiB lower - overflow subtract (danger)
*
* The address manipulation is first done on the logical address
* which is 0 at the start of the chip, and then the offset of
* the individual chip is addted to it. Any other order a weird
* map offset could cause problems.
*/
adr = (adr & ~0xffffUL) | 0x2;
adr += chip->start - 0x400000;
/*
* This is easy because these are writes to registers and not writes
* to flash memory - that means that we don't have to check status
* and timeout.
*/
cfi_spin_lock(chip->mutex);
ret = get_chip(map, chip, adr, FL_LOCKING);
if (ret) {
cfi_spin_unlock(chip->mutex);
return ret;
}
chip->state = xxlt->state;
map_write(map, CMD(xxlt->val), adr);
/* Done and happy. */
chip->state = FL_READY;
put_chip(map, chip, adr);
cfi_spin_unlock(chip->mutex);
return 0;
}
static int fwh_lock_varsize(struct mtd_info *mtd, loff_t ofs, size_t len)
{
int ret;
ret = cfi_varsize_frob(mtd, fwh_xxlock_oneblock, ofs, len,
(void *)&FWH_XXLOCK_ONEBLOCK_LOCK);
return ret;
}
static int fwh_unlock_varsize(struct mtd_info *mtd, loff_t ofs, size_t len)
{
int ret;
ret = cfi_varsize_frob(mtd, fwh_xxlock_oneblock, ofs, len,
(void *)&FWH_XXLOCK_ONEBLOCK_UNLOCK);
return ret;
}
static void fixup_use_fwh_lock(struct mtd_info *mtd, void *param)
{
printk(KERN_NOTICE "using fwh lock/unlock method\n");
/* Setup for the chips with the fwh lock method */
mtd->lock = fwh_lock_varsize;
mtd->unlock = fwh_unlock_varsize;
}
#endif /* FWH_LOCK_H */
......@@ -2,7 +2,7 @@
* Routines common to all CFI-type probes.
* (C) 2001-2003 Red Hat, Inc.
* GPL'd
* $Id: gen_probe.c,v 1.19 2004/07/13 22:33:32 dwmw2 Exp $
* $Id: gen_probe.c,v 1.21 2004/08/14 15:14:05 dwmw2 Exp $
*/
#include <linux/kernel.h>
......@@ -64,7 +64,7 @@ static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chi
interleave and device type, etc. */
if (!genprobe_new_chip(map, cp, &cfi)) {
/* The probe didn't like it */
printk(KERN_WARNING "%s: Found no %s device at location zero\n",
printk(KERN_DEBUG "%s: Found no %s device at location zero\n",
cp->name, map->name);
return NULL;
}
......@@ -169,8 +169,12 @@ static int genprobe_new_chip(struct map_info *map, struct chip_probe *cp,
cfi->interleave = nr_chips;
for (type = 0; type < 3; type++) {
cfi->device_type = 1<<type;
/* Minimum device size. Don't look for one 8-bit device
in a 16-bit bus, etc. */
type = map_bankwidth(map) / nr_chips;
for (; type <= CFI_DEVICETYPE_X32; type<<=1) {
cfi->device_type = type;
if (cp->probe_chip(map, 0, NULL, cfi))
return 1;
......
This diff is collapsed.
/*
* $Id: cmdlinepart.c,v 1.14 2004/07/12 12:34:23 dwmw2 Exp $
* $Id: cmdlinepart.c,v 1.15 2004/09/21 12:11:41 lavinen Exp $
*
* Read flash partition table from command line
*
......@@ -339,7 +339,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
* main.c::checksetup(). Note that we can not yet kmalloc() anything,
* so we only save the commandline for later processing.
*/
static int __init mtdpart_setup(char *s)
int mtdpart_setup(char *s)
{
cmdline = s;
return 1;
......
# drivers/mtd/maps/Kconfig
# $Id: Kconfig,v 1.30 2004/07/21 00:16:14 jwboyer Exp $
# $Id: Kconfig,v 1.37 2004/10/20 22:57:18 dwmw2 Exp $
menu "Mapping drivers for chip access"
depends on MTD!=n
......@@ -92,6 +92,25 @@ config MTD_NETSC520
demonstration board. If you have one of these boards and would like
to use the flash chips on it, say 'Y'.
config MTD_TS5500
tristate "JEDEC Flash device mapped on Technologic Systems TS-5500"
depends on X86 && MTD_JEDECPROBE && MTD_PARTITIONS
help
This provides a driver for the on-board flash of the Technologic
System's TS-5500 board. The flash is split into 3 partitions
which are accessed as separate MTD devices.
mtd0 and mtd2 are the two BIOS drives. Unfortunately the BIOS
uses a proprietary flash translation layer from General Software,
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.
Note that jumper 3 ("Write Enable Drive A") must be set
otherwise detection won't succeeed.
config MTD_SBC_GXX
tristate "CFI Flash device mapped on Arcom SBC-GXx boards"
depends on X86 && MTD_CFI_INTELEXT && MTD_PARTITIONS && MTD_COMPLEX_MAPPINGS
......@@ -160,7 +179,7 @@ config MTD_AMD76XROM
config MTD_ICHXROM
tristate "BIOS flash chip on Intel Controller Hub 2/3/4/5"
depends on X86 && MTD_JEDECPROBE && MTD_COMPLEX_MAPPINGS
depends on X86 && MTD_JEDECPROBE
help
Support for treating the BIOS flash chip on ICHX motherboards
as an MTD device - with this you can reprogram your BIOS.
......@@ -355,13 +374,21 @@ config MTD_ARCTIC
use the flash chips on it, say 'Y'.
config MTD_EBONY
tristate "CFI Flash device mapped on IBM 440GP Ebony"
depends on MTD_CFI && PPC32 && 440 && EBONY
tristate "Flash devices mapped on IBM 440GP Ebony"
depends on MTD_CFI && PPC32 && 44x && EBONY
help
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
use the flash chips on it, say 'Y'.
config MTD_OCOTEA
tristate "Flash devices mapped on IBM 440GX Ocotea"
depends on MTD_CFI && PPC32 && 44x && OCOTEA
help
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
use the flash chips on it, say 'Y'.
config MTD_REDWOOD
tristate "CFI Flash devices mapped on IBM Redwood"
depends on MTD_CFI && PPC32 && 4xx && 40x && ( REDWOOD_4 || REDWOOD_5 || REDWOOD_6 )
......@@ -448,6 +475,12 @@ config MTD_SA1100
the SA1100 and SA1110, including the Assabet and the Compaq iPAQ.
If you have such a board, say 'Y'.
config MTD_IPAQ
tristate "CFI Flash device mapped on Compaq/HP iPAQ"
depends on ARM && IPAQ_HANDHELD && MTD_CFI
help
This provides a driver for the on-board flash of the iPAQ.
config MTD_DC21285
tristate "CFI Flash device mapped on DC21285 Footbridge"
depends on ARM && MTD_CFI && ARCH_FOOTBRIDGE && MTD_COMPLEX_MAPPINGS
......@@ -468,7 +501,7 @@ config MTD_IXP4XX
tristate "CFI Flash device mapped on Intel IXP4xx based systems"
depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
help
This eables 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
IXDP425 and Coyote. If you have an IXP4xx based board and
would like to use the flash chips on it, say 'Y'.
......@@ -477,9 +510,9 @@ config MTD_IXP2000
tristate "CFI Flash device mapped on Intel IXP2000 based systems"
depends on ARM && MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP2000
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
IXDP2400 and IXDP2401. If you have an IXP2000 based board and
IXDP425 and Coyote. If you have an IXP2000 based board and
would like to use the flash chips on it, say 'Y'.
config MTD_EPXA10DB
......@@ -595,5 +628,22 @@ config MTD_DMV182
help
Map driver for Dy-4 SVME/DMV-182 board.
config MTD_BAST
tristate "Map driver for Simtec BAST (EB2410ITX)"
depends on ARCH_BAST
select MTD_PARTITIONS
select MTD_MAP_BANK_WIDTH_16
select MTD_JEDECPROBE
help
Map driver for NOR flash on the Simtec BAST (EB2410ITX).
Note, this driver *cannot* over-ride the WP link on the
board, or currently detect the state of the link.
config MTD_BAST_MAXSIZE
int "Maximum size for BAST flash area (MiB)"
depends on MTD_BAST
default "4"
endmenu
#
# linux/drivers/maps/Makefile
#
# $Id: Makefile.common,v 1.14 2004/07/12 16:07:31 dwmw2 Exp $
# $Id: Makefile.common,v 1.19 2004/09/21 14:27:16 bjd Exp $
ifeq ($(CONFIG_MTD_COMPLEX_MAPPINGS),y)
obj-$(CONFIG_MTD) += map_funcs.o
......@@ -10,6 +10,7 @@ endif
# Chip mappings
obj-$(CONFIG_MTD_CDB89712) += cdb89712.o
obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o
obj-$(CONFIG_MTD_BAST) += bast-flash.o
obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o
obj-$(CONFIG_MTD_CSTM_MIPS_IXX) += cstm_mips_ixx.o
obj-$(CONFIG_MTD_DC21285) += dc21285.o
......@@ -31,9 +32,11 @@ obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o
obj-$(CONFIG_MTD_TQM8XXL) += tqm8xxl.o
obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o
obj-$(CONFIG_MTD_IPAQ) += ipaq-flash.o
obj-$(CONFIG_MTD_SBC_GXX) += sbc_gxx.o
obj-$(CONFIG_MTD_SC520CDP) += sc520cdp.o
obj-$(CONFIG_MTD_NETSC520) += netsc520.o
obj-$(CONFIG_MTD_TS5500) += ts5500_flash.o
obj-$(CONFIG_MTD_SUN_UFLASH) += sun_uflash.o
obj-$(CONFIG_MTD_VMAX) += vmax301.o
obj-$(CONFIG_MTD_SCx200_DOCFLASH)+= scx200_docflash.o
......@@ -55,6 +58,7 @@ obj-$(CONFIG_MTD_UCLINUX) += uclinux.o
obj-$(CONFIG_MTD_NETtel) += nettel.o
obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
obj-$(CONFIG_MTD_EBONY) += ebony.o
obj-$(CONFIG_MTD_OCOTEA) += ocotea.o
obj-$(CONFIG_MTD_BEECH) += beech-mtd.o
obj-$(CONFIG_MTD_ARCTIC) += arctic-mtd.o
obj-$(CONFIG_MTD_H720X) += h720x-flash.o
......
This diff is collapsed.
/*
* $Id: arctic-mtd.c,v 1.11 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: arctic-mtd.c,v 1.12 2004/09/16 23:27:12 gleixner Exp $
*
* drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for
* IBM 405LP Arctic boards.
......@@ -98,7 +98,7 @@ init_arctic_mtd(void)
{
printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);
arctic_mtd_map.virt = (unsigned long) ioremap(PADDR, SIZE);
arctic_mtd_map.virt = (void __iomem *) ioremap(PADDR, SIZE);
if (!arctic_mtd_map.virt) {
printk("%s: failed to ioremap 0x%x\n", NAME, PADDR);
......
......@@ -2,7 +2,7 @@
* NV-RAM memory access on autcpu12
* (C) 2002 Thomas Gleixner (gleixner@autronix.de)
*
* $Id: autcpu12-nvram.c,v 1.6 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: autcpu12-nvram.c,v 1.7 2004/09/16 23:27:12 gleixner Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -47,7 +47,7 @@ static int __init init_autcpu12_sram (void)
{
int err, save0, save1;
autcpu12_sram_map.virt = (unsigned long)ioremap(0x12000000, SZ_128K);
autcpu12_sram_map.virt = (void __iomem *)ioremap(0x12000000, SZ_128K);
if (!autcpu12_sram_map.virt) {
printk("Failed to ioremap autcpu12 NV-RAM space\n");
err = -EIO;
......@@ -76,7 +76,7 @@ static int __init init_autcpu12_sram (void)
/* We have a 128K found, restore 0x10000 and set size
* to 128K
*/
ma[_write32(&autcpu12_sram_map,save1,0x10000);
map_write32(&autcpu12_sram_map,save1,0x10000);
autcpu12_sram_map.size = SZ_128K;
map:
......
/* linux/drivers/mtd/maps/bast_flash.c
*
* Copyright (c) 2004 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* Simtec Bast (EB2410ITX) NOR MTD Mapping driver
*
* Changelog:
* 20-Sep-2004 BJD Initial version
*
* $Id: bast-flash.c,v 1.1 2004/09/21 14:29:04 bjd Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/mach-types.h>
#include <asm/mach/flash.h>
#include <asm/arch/map.h>
#include <asm/arch/bast-map.h>
#include <asm/arch/bast-cpld.h>
#ifdef CONFIG_MTD_BAST_MAXSIZE
#define AREA_MAXSIZE (CONFIG_MTD_BAST_MAXSIZE * (1024*1024))
#else
#define AREA_MAXSIZE (32*1024*1024)
#endif
#define PFX "bast-flash: "
struct bast_flash_info {
struct mtd_info *mtd;
struct map_info map;
struct mtd_partition *partitions;
struct resource *area;
};
static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
static struct bast_flash_info *to_bast_info(struct device *dev)
{
return (struct bast_flash_info *)dev_get_drvdata(dev);
}
static void bast_flash_setrw(int to)
{
unsigned int val;
unsigned long flags;
local_irq_save(flags);
val = __raw_readb(BAST_VA_CTRL3);
if (to)
val |= BAST_CPLD_CTRL3_ROMWEN;
else
val &= ~BAST_CPLD_CTRL3_ROMWEN;
pr_debug("new cpld ctrl3=%02x\n", val);
__raw_writeb(val, BAST_VA_CTRL3);
local_irq_restore(flags);
}
static int bast_flash_remove(struct device *dev)
{
struct bast_flash_info *info = to_bast_info(dev);
dev_set_drvdata(dev, NULL);
if (info == NULL)
return 0;
if (info->map.virt != NULL)
iounmap(info->map.virt);
if (info->mtd) {
del_mtd_partitions(info->mtd);
map_destroy(info->mtd);
}
if (info->partitions)
kfree(info->partitions);
if (info->area) {
release_resource(info->area);
kfree(info->area);
}
kfree(info);
return 0;
}
static int bast_flash_probe(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct bast_flash_info *info;
struct resource *res;
int err = 0;
info = kmalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL) {
printk(KERN_ERR PFX "no memory for flash info\n");
err = -ENOMEM;
goto exit_error;
}
memzero(info, sizeof(*info));
dev_set_drvdata(dev, info);
res = pdev->resource; /* assume that the flash has one resource */
info->map.phys = res->start;
info->map.size = res->end - res->start + 1;
info->map.name = dev->bus_id;
info->map.bankwidth = 2;
if (info->map.size > AREA_MAXSIZE)
info->map.size = AREA_MAXSIZE;
pr_debug("%s: area %08lx, size %ld\n", __FUNCTION__,
info->map.phys, info->map.size);
info->area = request_mem_region(res->start, info->map.size,
pdev->name);
if (info->area == NULL) {
printk(KERN_ERR PFX "cannot reserve flash memory region\n");
err = -ENOENT;
goto exit_error;
}
info->map.virt = ioremap(res->start, info->map.size);
pr_debug("%s: virt at %08x\n", __FUNCTION__, (int)info->map.virt);
if (info->map.virt == 0) {
printk(KERN_ERR PFX "failed to ioremap() region\n");
err = -EIO;
goto exit_error;
}
simple_map_init(&info->map);
/* enable the write to the flash area */
bast_flash_setrw(1);
/* probe for the device(s) */
info->mtd = do_map_probe("jedec_probe", &info->map);
if (info->mtd == NULL)
info->mtd = do_map_probe("cfi_probe", &info->map);
if (info->mtd == NULL) {
printk(KERN_ERR PFX "map_probe() failed\n");
err = -ENXIO;
goto exit_error;
}
/* mark ourselves as the owner */
info->mtd->owner = THIS_MODULE;
err = parse_mtd_partitions(info->mtd, probes, &info->partitions, 0);
if (err > 0) {
err = add_mtd_partitions(info->mtd, info->partitions, err);
if (err)
printk(KERN_ERR PFX "cannot add/parse partitions\n");
}
if (err == 0)
return 0;
/* fall through to exit error */
exit_error:
bast_flash_remove(dev);
return err;
}
static struct device_driver bast_flash_driver = {
.name = "bast-nor",
.bus = &platform_bus_type,
.probe = bast_flash_probe,
.remove = bast_flash_remove,
};
static int __init bast_flash_init(void)
{
printk("BAST NOR-Flash Driver, (c) 2004 Simtec Electronics\n");
return driver_register(&bast_flash_driver);
}
static void __exit bast_flash_exit(void)
{
driver_unregister(&bast_flash_driver);
}
module_init(bast_flash_init);
module_exit(bast_flash_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
MODULE_DESCRIPTION("BAST MTD Map driver");
/*
* $Id: beech-mtd.c,v 1.8 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: beech-mtd.c,v 1.9 2004/09/16 23:27:12 gleixner Exp $
*
* drivers/mtd/maps/beech-mtd.c MTD mappings and partition tables for
* IBM 405LP Beech boards.
......@@ -74,7 +74,7 @@ init_beech_mtd(void)
{
printk("%s: 0x%08x at 0x%08x\n", NAME, SIZE, PADDR);
beech_mtd_map.virt = (unsigned long) ioremap(PADDR, SIZE);
beech_mtd_map.virt = (void __iomem *) ioremap(PADDR, SIZE);
if (!beech_mtd_map.virt) {
printk("%s: failed to ioremap 0x%x\n", NAME, PADDR);
......
/*
* Flash on Cirrus CDB89712
*
* $Id: cdb89712.c,v 1.8 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: cdb89712.c,v 1.9 2004/09/16 23:27:12 gleixner Exp $
*/
#include <linux/module.h>
......@@ -44,7 +44,7 @@ static int __init init_cdb89712_flash (void)
goto out;
}
cdb89712_flash_map.virt = (unsigned long)ioremap(FLASH_START, FLASH_SIZE);
cdb89712_flash_map.virt = (void __iomem *)ioremap(FLASH_START, FLASH_SIZE);
if (!cdb89712_flash_map.virt) {
printk(KERN_NOTICE "Failed to ioremap Cdb89712 FLASH space\n");
err = -EIO;
......@@ -114,7 +114,7 @@ static int __init init_cdb89712_sram (void)
goto out;
}
cdb89712_sram_map.virt = (unsigned long)ioremap(SRAM_START, SRAM_SIZE);
cdb89712_sram_map.virt = (void __iomem *)ioremap(SRAM_START, SRAM_SIZE);
if (!cdb89712_sram_map.virt) {
printk(KERN_NOTICE "Failed to ioremap Cdb89712 SRAM space\n");
err = -EIO;
......@@ -182,7 +182,7 @@ static int __init init_cdb89712_bootrom (void)
goto out;
}
cdb89712_bootrom_map.virt = (unsigned long)ioremap(BOOTROM_START, BOOTROM_SIZE);
cdb89712_bootrom_map.virt = (void __iomem *)ioremap(BOOTROM_START, BOOTROM_SIZE);
if (!cdb89712_bootrom_map.virt) {
printk(KERN_NOTICE "Failed to ioremap Cdb89712 BootROM space\n");
err = -EIO;
......
......@@ -11,7 +11,7 @@
*
* (C) 2000 Nicolas Pitre <nico@cam.org>
*
* $Id: ceiva.c,v 1.10 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: ceiva.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $
*/
#include <linux/config.h>
......@@ -103,7 +103,7 @@ struct clps_info {
unsigned long base;
unsigned long size;
int width;
void __iomem *vbase;
void *vbase;
struct map_info *map;
struct mtd_info *mtd;
struct resource *res;
......@@ -150,7 +150,7 @@ static int __init clps_setup_mtd(struct clps_info *clps, int nr, struct mtd_info
break;
}
clps[i].map->virt = clps[i].vbase;
clps[i].map->virt = (void __iomem *)clps[i].vbase;
clps[i].map->bankwidth = clps[i].width;
clps[i].map->size = clps[i].size;
......
/*
* Copyright 2001 Flaga hf. Medical Devices, Kri Davsson <kd@flaga.is>
*
* $Id: cfi_flagadm.c,v 1.12 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: cfi_flagadm.c,v 1.13 2004/09/16 23:27:12 gleixner Exp $
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -96,7 +96,7 @@ int __init init_flagadm(void)
FLASH_SIZE, FLASH_PHYS_ADDR);
flagadm_map.phys = FLASH_PHYS_ADDR;
flagadm_map.virt = (unsigned long)ioremap(FLASH_PHYS_ADDR,
flagadm_map.virt = (void __iomem *s)ioremap(FLASH_PHYS_ADDR,
FLASH_SIZE);
if (!flagadm_map.virt) {
......
/*
* $Id: cstm_mips_ixx.c,v 1.10 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: cstm_mips_ixx.c,v 1.11 2004/09/16 23:27:12 gleixner Exp $
*
* Mapping of a custom board with both AMD CFI and JEDEC flash in partitions.
* Config with both CFI and JEDEC device support.
......@@ -170,7 +170,7 @@ int __init init_cstm_mips_ixx(void)
cstm_mips_ixx_map[i].phys = cstm_mips_ixx_board_desc[i].window_addr;
cstm_mips_ixx_map[i].virt = (unsigned long)ioremap(cstm_mips_ixx_board_desc[i].window_addr, cstm_mips_ixx_board_desc[i].window_size);
cstm_mips_ixx_map[i].virt = (void __iomem *)ioremap(cstm_mips_ixx_board_desc[i].window_addr, cstm_mips_ixx_board_desc[i].window_size);
if (!cstm_mips_ixx_map[i].virt) {
printk(KERN_WARNING "Failed to ioremap\n");
return -EIO;
......
/*
* Flash memory access on Alchemy Db1550 board
*
* $Id: db1550-flash.c,v 1.3 2004/07/14 17:45:40 dwmw2 Exp $
* $Id: db1550-flash.c,v 1.6 2004/10/20 05:50:19 ppopov Exp $
*
* (C) 2004 Embedded Edge, LLC, based on db1550-flash.c:
* (C) 2003 Pete Popov <pete_popov@yahoo.com>
* (C) 2003, 2004 Pete Popov <ppopov@embeddedalley.com>
*
*/
......@@ -19,7 +19,6 @@
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/au1000.h>
#ifdef DEBUG_RW
#define DBG(x...) printk(x)
......@@ -132,7 +131,7 @@ int setup_flash_params(void)
window_addr = 0x1C000000;
window_size = 0x4000000;
#else /* USER ONLY */
window_addr = 0x1E000000;
window_addr = 0x18000000;
window_size = 0x4000000;
#endif
return 0;
......@@ -160,10 +159,10 @@ int __init db1550_mtd_init(void)
* Now let's probe for the actual flash. Do it here since
* specific machine settings might have been set above.
*/
printk(KERN_NOTICE "Pb1550 flash: probing %d-bit flash bus\n",
printk(KERN_NOTICE "Db1550 flash: probing %d-bit flash bus\n",
db1550_map.bankwidth*8);
db1550_map.virt =
(unsigned long)ioremap(window_addr, window_size);
(void __iomem *)ioremap(window_addr, window_size);
mymtd = do_map_probe("cfi_probe", &db1550_map);
if (!mymtd) return -ENXIO;
mymtd->owner = THIS_MODULE;
......@@ -177,6 +176,7 @@ static void __exit db1550_mtd_cleanup(void)
if (mymtd) {
del_mtd_partitions(mymtd);
map_destroy(mymtd);
iounmap((void *) db1550_map.virt);
}
}
......
/*
* Flash memory access on Alchemy Db1xxx boards
*
* $Id: db1x00-flash.c,v 1.3 2004/07/14 17:45:40 dwmw2 Exp $
* $Id: db1x00-flash.c,v 1.5 2004/09/18 23:22:35 ppopov Exp $
*
* (C) 2003 Pete Popov <ppopov@pacbell.net>
* (C) 2003 Pete Popov <ppopov@embeddedalley.com>
*
*/
......@@ -18,8 +18,6 @@
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/au1000.h>
#include <asm/db1x00.h>
#ifdef DEBUG_RW
#define DBG(x...) printk(x)
......@@ -27,11 +25,20 @@
#define DBG(x...)
#endif
/* MTD CONFIG OPTIONS */
#if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
#define DB1X00_BOTH_BANKS
#elif defined(CONFIG_MTD_DB1X00_BOOT) && !defined(CONFIG_MTD_DB1X00_USER)
#define DB1X00_BOOT_ONLY
#elif !defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
#define DB1X00_USER_ONLY
#endif
static unsigned long window_addr;
static unsigned long window_size;
static unsigned long flash_size;
static BCSR * const bcsr = (BCSR *)0xAE000000;
static unsigned short *bcsr = (unsigned short *)0xAE000000;
static unsigned char flash_bankwidth = 4;
/*
......@@ -113,7 +120,7 @@ static struct mtd_info *db1xxx_mtd;
*/
int setup_flash_params(void)
{
switch ((bcsr->status >> 14) & 0x3) {
switch ((bcsr[2] >> 14) & 0x3) {
case 0: /* 64Mbit devices */
flash_size = 0x800000; /* 8MB per part */
#if defined(DB1X00_BOTH_BANKS)
......@@ -192,7 +199,7 @@ int __init db1x00_mtd_init(void)
*/
printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n",
db1xxx_mtd_map.bankwidth*8);
db1xxx_mtd_map.virt = (unsigned long)ioremap(window_addr, window_size);
db1xxx_mtd_map.virt = (void __iomem *)ioremap(window_addr, window_size);
db1xxx_mtd = do_map_probe("cfi_probe", &db1xxx_mtd_map);
if (!db1xxx_mtd) return -ENXIO;
db1xxx_mtd->owner = THIS_MODULE;
......
/*
* $Id: dbox2-flash.c,v 1.11 2004/07/12 21:59:43 dwmw2 Exp $
* $Id: dbox2-flash.c,v 1.12 2004/09/16 23:27:12 gleixner Exp $
*
* D-Box 2 flash driver
*/
......@@ -75,7 +75,7 @@ struct map_info dbox2_flash_map = {
int __init init_dbox2_flash(void)
{
printk(KERN_NOTICE "D-Box 2 flash driver (size->0x%X mem->0x%X)\n", WINDOW_SIZE, WINDOW_ADDR);
dbox2_flash_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
dbox2_flash_map.virt = (void __iomem *)ioremap(WINDOW_ADDR, WINDOW_SIZE);
if (!dbox2_flash_map.virt) {
printk("Failed to ioremap\n");
......
......@@ -5,7 +5,7 @@
*
* This code is GPL
*
* $Id: dc21285.c,v 1.20 2004/07/12 22:38:29 dwmw2 Exp $
* $Id: dc21285.c,v 1.21 2004/09/16 23:27:13 gleixner Exp $
*/
#include <linux/config.h>
#include <linux/module.h>
......@@ -175,7 +175,7 @@ static int __init init_dc21285(void)
dc21285_map.bankwidth*8);
/* Let's map the flash area */
dc21285_map.map_priv_1 = (unsigned long)ioremap(DC21285_FLASH, 16*1024*1024);
dc21285_map.map_priv_1 = (void __iomem *)ioremap(DC21285_FLASH, 16*1024*1024);
if (!dc21285_map.map_priv_1) {
printk("Failed to ioremap\n");
return -EIO;
......
......@@ -14,7 +14,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: dilnetpc.c,v 1.13 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: dilnetpc.c,v 1.15 2004/10/21 08:31:32 dwmw2 Exp $
*
* 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
......@@ -403,7 +403,7 @@ static int __init init_dnpc(void)
printk(KERN_NOTICE "DIL/Net %s flash: 0x%lx at 0x%lx\n",
is_dnp ? "DNPC" : "ADNP", dnpc_map.size, dnpc_map.phys);
dnpc_map.virt = (unsigned long)ioremap_nocache(dnpc_map.phys, dnpc_map.size);
dnpc_map.virt = (void __iomem *)ioremap_nocache(dnpc_map.phys, dnpc_map.size);
dnpc_map_flash(dnpc_map.phys, dnpc_map.size);
......@@ -413,7 +413,7 @@ static int __init init_dnpc(void)
}
simple_map_init(&dnpc_map);
printk("FLASH virtual address: 0x%lx\n", dnpc_map.virt);
printk("FLASH virtual address: 0x%p\n", dnpc_map.virt);
mymtd = do_map_probe("jedec_probe", &dnpc_map);
......
......@@ -4,7 +4,7 @@
*
* Flash map driver for the Dy4 SVME182 board
*
* $Id: dmv182.c,v 1.3 2004/07/14 17:45:40 dwmw2 Exp $
* $Id: dmv182.c,v 1.4 2004/09/16 23:27:13 gleixner Exp $
*
* Copyright 2003-2004, TimeSys Corporation
*
......@@ -104,7 +104,7 @@ static int __init init_svme182(void)
partitions = svme182_partitions;
svme182_map.virt =
(unsigned long)ioremap(FLASH_BASE_ADDR, svme182_map.size);
(void __iomem *)ioremap(FLASH_BASE_ADDR, svme182_map.size);
if (svme182_map.virt == 0) {
printk("Failed to ioremap FLASH memory area.\n");
......
/*
* $Id: ebony.c,v 1.10 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: ebony.c,v 1.12 2004/09/16 23:27:13 gleixner Exp $
*
* Mapping for Ebony user flash
*
* Matt Porter <mporter@mvista.com>
* Matt Porter <mporter@kernel.crashing.org>
*
* Copyright 2002 MontaVista Software Inc.
* Copyright 2002-2004 MontaVista Software Inc.
*
* 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
......@@ -21,9 +21,10 @@
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <linux/config.h>
#include <linux/version.h>
#include <asm/io.h>
#include <asm/ibm44x.h>
#include <platforms/ebony.h>
#include <platforms/4xx/ebony.h>
static struct mtd_info *flash;
......@@ -63,7 +64,7 @@ static struct mtd_partition ebony_large_partitions[] = {
int __init init_ebony(void)
{
u8 fpga0_reg;
unsigned long fpga0_adr;
u8 *fpga0_adr;
unsigned long long small_flash_base, large_flash_base;
fpga0_adr = ioremap64(EBONY_FPGA_ADDR, 16);
......@@ -93,7 +94,7 @@ int __init init_ebony(void)
ebony_small_map.phys = small_flash_base;
ebony_small_map.virt =
(unsigned long)ioremap64(small_flash_base,
(void __iomem *)ioremap64(small_flash_base,
ebony_small_map.size);
if (!ebony_small_map.virt) {
......@@ -160,5 +161,5 @@ module_init(init_ebony);
module_exit(cleanup_ebony);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Matt Porter <mporter@mvista.com>");
MODULE_AUTHOR("Matt Porter <mporter@kernel.crashing.org>");
MODULE_DESCRIPTION("MTD map and partitions for IBM 440GP Ebony boards");
/*
* $Id: edb7312.c,v 1.11 2004/07/14 09:52:55 dwmw2 Exp $
* $Id: edb7312.c,v 1.12 2004/09/16 23:27:13 gleixner Exp $
*
* Handle mapping of the NOR flash on Cogent EDB7312 boards
*
......@@ -71,19 +71,19 @@ static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
#endif
static int mtd_parts_nb;
static struct mtd_partition *mtd_parts;
static int mtd_parts_nb = 0;
static struct mtd_partition *mtd_parts = 0;
int __init init_edb7312nor(void)
{
static const char *rom_probe_types[] = PROBETYPES;
const char **type;
const char *part_type = NULL;
const char *part_type = 0;
printk(KERN_NOTICE MSG_PREFIX "0x%08x at 0x%08x\n",
WINDOW_SIZE, WINDOW_ADDR);
edb7312nor_map.virt = (unsigned long)
ioremap(WINDOW_ADDR, WINDOW_SIZE);
edb7312nor_map.virt = (void __iomem *)
ioremap(WINDOW_ADDR, WINDOW_SIZE);
if (!edb7312nor_map.virt) {
printk(MSG_PREFIX "failed to ioremap\n");
......@@ -92,7 +92,7 @@ int __init init_edb7312nor(void)
simple_map_init(&edb7312nor_map);
mymtd = NULL;
mymtd = 0;
type = rom_probe_types;
for(; !mymtd && *type; type++) {
mymtd = do_map_probe(*type, &edb7312nor_map);
......
......@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
$Id: elan-104nc.c,v 1.21 2004/07/12 22:38:29 dwmw2 Exp $
$Id: elan-104nc.c,v 1.22 2004/09/16 23:27:13 gleixner Exp $
The ELAN-104NC has up to 8 Mibyte of Intel StrataFlash (28F320/28F640) in x16
mode. This drivers uses the CFI probe and Intel Extended Command Set drivers.
......@@ -53,7 +53,7 @@ always fail. So we don't do it. I just hope it doesn't break anything.
#define PAGE_IO_SIZE 2
static volatile int page_in_window = -1; // Current page in window.
static unsigned long iomapadr;
static void __iomem *iomapadr;
static spinlock_t elan_104nc_spin = SPIN_LOCK_UNLOCKED;
/* partition_info gives details on the logical partitions that the split the
......@@ -190,7 +190,7 @@ int __init init_elan_104nc(void)
/* Urg! We use I/O port 0x22 without request_region()ing it,
because it's already allocated to the PIC. */
iomapadr = (unsigned long)ioremap(WINDOW_START, WINDOW_LENGTH);
iomapadr = (void __iomem *)ioremap(WINDOW_START, WINDOW_LENGTH);
if (!iomapadr) {
printk( KERN_ERR"%s: failed to ioremap memory region\n",
elan_104nc_map.name );
......
......@@ -5,7 +5,7 @@
* Copyright (C) 2001 Altera Corporation
* Copyright (C) 2001 Red Hat, Inc.
*
* $Id: epxa10db-flash.c,v 1.11 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: epxa10db-flash.c,v 1.12 2004/09/16 23:27:13 gleixner Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -62,7 +62,7 @@ static int __init epxa_mtd_init(void)
printk(KERN_NOTICE "%s flash device: 0x%x at 0x%x\n", BOARD_NAME, FLASH_SIZE, FLASH_START);
epxa_map.virt = (unsigned long)ioremap(FLASH_START, FLASH_SIZE);
epxa_map.virt = (void __iomem *)ioremap(FLASH_START, FLASH_SIZE);
if (!epxa_map.virt) {
printk("Failed to ioremap %s flash\n",BOARD_NAME);
return -EIO;
......
/* fortunet.c memory map
*
* $Id: fortunet.c,v 1.7 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: fortunet.c,v 1.8 2004/09/16 23:27:13 gleixner Exp $
*/
#include <linux/module.h>
......@@ -210,7 +210,7 @@ int __init init_fortunet(void)
map_regions[ix].map_info.phys = map_regions[ix].window_addr_physical,
map_regions[ix].map_info.virt =
(int)ioremap_nocache(
(void __iomem *)ioremap_nocache(
map_regions[ix].window_addr_physical,
map_regions[ix].map_info.size);
if(!map_regions[ix].map_info.virt)
......
......@@ -2,7 +2,7 @@
* Flash memory access on Hynix GMS30C7201/HMS30C7202 based
* evaluation boards
*
* $Id: h720x-flash.c,v 1.9 2004/07/14 17:45:40 dwmw2 Exp $
* $Id: h720x-flash.c,v 1.10 2004/09/16 23:27:13 gleixner Exp $
*
* (C) 2002 Jungjun Kim <jungjun.kim@hynix.com>
* 2003 Thomas Gleixner <tglx@linutronix.de>
......@@ -73,7 +73,7 @@ int __init h720x_mtd_init(void)
char *part_type = NULL;
h720x_map.virt = (unsigned long)ioremap(FLASH_PHYS, FLASH_SIZE);
h720x_map.virt = (void __iomem *)ioremap(FLASH_PHYS, FLASH_SIZE);
if (!h720x_map.virt) {
printk(KERN_ERR "H720x-MTD: ioremap failed\n");
......
This diff is collapsed.
/*
* $Id: impa7.c,v 1.11 2004/07/14 09:52:55 dwmw2 Exp $
* $Id: impa7.c,v 1.12 2004/09/16 23:27:13 gleixner Exp $
*
* Handle mapping of the NOR flash on implementa A7 boards
*
......@@ -77,7 +77,7 @@ int __init init_impa7(void)
{
static const char *rom_probe_types[] = PROBETYPES;
const char **type;
const char *part_type = NULL;
const char *part_type = 0;
int i;
static struct { u_long addr; u_long size; } pt[NUM_FLASHBANKS] = {
{ WINDOW_ADDR0, WINDOW_SIZE0 },
......@@ -91,7 +91,7 @@ int __init init_impa7(void)
pt[i].size, pt[i].addr);
impa7_map[i].phys = pt[i].addr;
impa7_map[i].virt = (unsigned long)
impa7_map[i].virt = (void __iomem *)
ioremap(pt[i].addr, pt[i].size);
if (!impa7_map[i].virt) {
printk(MSG_PREFIX "failed to ioremap\n");
......@@ -99,7 +99,7 @@ int __init init_impa7(void)
}
simple_map_init(&impa7_map[i]);
impa7_mtd[i] = NULL;
impa7_mtd[i] = 0;
type = rom_probe_types;
for(; !impa7_mtd[i] && *type; type++) {
impa7_mtd[i] = do_map_probe(*type, &impa7_map[i]);
......
......@@ -22,7 +22,7 @@
This is access code for flashes using ARM's flash partitioning
standards.
$Id: integrator-flash.c,v 1.16 2004/07/12 21:59:44 dwmw2 Exp $
$Id: integrator-flash.c,v 1.17 2004/09/16 23:27:13 gleixner Exp $
======================================================================*/
......@@ -110,7 +110,7 @@ static int armflash_probe(struct device *_dev)
info->map.size = size;
info->map.bankwidth = plat->width;
info->map.phys = res->start;
info->map.virt = (unsigned long) base;
info->map.virt = (void __iomem *) base;
info->map.name = dev->dev.bus_id;
info->map.set_vpp = armflash_set_vpp;
......
This diff is collapsed.
/*
* $Id: iq80310.c,v 1.18 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: iq80310.c,v 1.19 2004/09/16 23:27:13 gleixner Exp $
*
* Mapping for the Intel XScale IQ80310 evaluation board
*
......@@ -68,7 +68,7 @@ static int __init init_iq80310(void)
int parsed_nr_parts = 0;
int ret;
iq80310_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
iq80310_map.virt = (void __iomem *)ioremap(WINDOW_ADDR, WINDOW_SIZE);
if (!iq80310_map.virt) {
printk("Failed to ioremap\n");
return -EIO;
......
/*
* $Id: ixp2000.c,v 1.1 2004/09/02 00:13:41 dsaxena Exp $
* $Id: ixp2000.c,v 1.3 2004/09/16 23:27:13 gleixner Exp $
*
* drivers/mtd/maps/ixp2000.c
*
......@@ -14,7 +14,7 @@
* 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
* published by the Free Software Foundation.
*
*
*/
#include <linux/module.h>
......@@ -44,8 +44,8 @@ struct ixp2000_flash_info {
};
static inline unsigned long flash_bank_setup(struct map_info *map, unsigned long ofs)
{
unsigned long (*set_bank)(unsigned long) =
{
unsigned long (*set_bank)(unsigned long) =
(unsigned long(*)(unsigned long))map->map_priv_2;
return (set_bank ? set_bank(ofs) : ofs);
......@@ -53,15 +53,15 @@ static inline unsigned long flash_bank_setup(struct map_info *map, unsigned long
#ifdef __ARMEB__
/*
* Rev A0 and A1 of IXP2400 silicon have a broken addressing unit which
* causes the lower address bits to be XORed with 0x11 on 8 bit accesses
* and XORed with 0x10 on 16 bit accesses. See the spec update, erratta 44.
* Rev A0 and A1 of IXP2400 silicon have a broken addressing unit which
* causes the lower address bits to be XORed with 0x11 on 8 bit accesses
* and XORed with 0x10 on 16 bit accesses. See the spec update, erratum 44.
*/
static int errata44_workaround = 0;
static int erratum44_workaround = 0;
static inline unsigned long address_fix8_write(unsigned long addr)
{
if (errata44_workaround) {
if (erratum44_workaround) {
return (addr ^ 3);
}
return addr;
......@@ -88,7 +88,7 @@ static void ixp2000_flash_copy_from(struct map_info *map, void *to,
unsigned long from, ssize_t len)
{
from = flash_bank_setup(map, from);
while(len--)
while(len--)
*(__u8 *) to++ = *(__u8 *)(map->map_priv_1 + from++);
}
......@@ -127,8 +127,8 @@ static int ixp2000_flash_remove(struct device *_dev)
if (info->map.map_priv_1)
iounmap((void *) info->map.map_priv_1);
if (info->partitions)
kfree(info->partitions);
if (info->partitions) {
kfree(info->partitions); }
if (info->res) {
release_resource(info->res);
......@@ -147,11 +147,11 @@ static int ixp2000_flash_probe(struct device *_dev)
static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
struct platform_device *dev = to_platform_device(_dev);
struct ixp2000_flash_data *ixp_data = dev->dev.platform_data;
struct flash_platform_data *plat;
struct flash_platform_data *plat;
struct ixp2000_flash_info *info;
unsigned long window_size;
int err = -1;
if (!ixp_data)
return -ENODEV;
......@@ -160,7 +160,7 @@ static int ixp2000_flash_probe(struct device *_dev)
return -ENODEV;
window_size = dev->resource->end - dev->resource->start + 1;
dev_info(_dev, "Probe of IXP2000 flash(%d banks x %dM)\n",
dev_info(_dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n",
ixp_data->nr_banks, ((u32)window_size >> 20));
if (plat->width != 1) {
......@@ -173,7 +173,7 @@ static int ixp2000_flash_probe(struct device *_dev)
if(!info) {
err = -ENOMEM;
goto Error;
}
}
memzero(info, sizeof(struct ixp2000_flash_info));
dev_set_drvdata(&dev->dev, info);
......@@ -183,7 +183,7 @@ static int ixp2000_flash_probe(struct device *_dev)
* not attempt to do a direct access on us.
*/
info->map.phys = NO_XIP;
info->nr_banks = ixp_data->nr_banks;
info->map.size = ixp_data->nr_banks * window_size;
info->map.bankwidth = 1;
......@@ -191,7 +191,7 @@ static int ixp2000_flash_probe(struct device *_dev)
/*
* map_priv_2 is used to store a ptr to to the bank_setup routine
*/
info->map.map_priv_2 = (u32) ixp_data->bank_setup;
info->map.map_priv_2 = (void __iomem *) ixp_data->bank_setup;
info->map.name = dev->dev.bus_id;
info->map.read = ixp2000_flash_read8;
......@@ -199,8 +199,8 @@ static int ixp2000_flash_probe(struct device *_dev)
info->map.copy_from = ixp2000_flash_copy_from;
info->map.copy_to = ixp2000_flash_copy_to;
info->res = request_mem_region(dev->resource->start,
dev->resource->end - dev->resource->start + 1,
info->res = request_mem_region(dev->resource->start,
dev->resource->end - dev->resource->start + 1,
dev->dev.bus_id);
if (!info->res) {
dev_err(_dev, "Could not reserve memory region\n");
......@@ -209,7 +209,7 @@ static int ixp2000_flash_probe(struct device *_dev)
}
info->map.map_priv_1 =
(unsigned long) ioremap(dev->resource->start,
(void __iomem *) ioremap(dev->resource->start,
dev->resource->end - dev->resource->start + 1);
if (!info->map.map_priv_1) {
dev_err(_dev, "Failed to ioremap flash region\n");
......@@ -224,12 +224,12 @@ static int ixp2000_flash_probe(struct device *_dev)
#if defined(__ARMEB__)
/*
* Enable errata 44 workaround for NPUs with broken slowport
* Enable erratum 44 workaround for NPUs with broken slowport
*/
errata44_workaround = ixp2000_has_broken_slowport();
dev_info(_dev, "Errata 44 workaround %s\n",
errata44_workaround ? "enabled" : "disabled");
dev_info(_dev, "Erratum 44 workaround %s\n",
erratum44_workaround ? "enabled" : "disabled");
#endif
info->mtd = do_map_probe(plat->map_name, &info->map);
......
......@@ -69,7 +69,7 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
dest[len - 1] = BYTE0(src[i]);
}
/*
/*
* Unaligned writes are ignored, causing the 8-bit
* probe to fail and proceed to the 16-bit probe (which succeeds).
*/
......@@ -79,7 +79,7 @@ static void ixp4xx_probe_write16(struct map_info *map, map_word d, unsigned long
*(__u16 *) (map->map_priv_1 + adr) = d.x[0];
}
/*
/*
* Fast write16 function without the probing check above
*/
static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr)
......@@ -197,7 +197,7 @@ static int ixp4xx_flash_probe(struct device *_dev)
}
info->map.map_priv_1 =
(void __iomem *) ioremap(dev->resource->start,
(void __iomem *) ioremap(dev->resource->start,
dev->resource->end - dev->resource->start + 1);
if (!info->map.map_priv_1) {
printk(KERN_ERR "IXP4XXFlash: Failed to ioremap region\n");
......@@ -212,7 +212,7 @@ static int ixp4xx_flash_probe(struct device *_dev)
goto Error;
}
info->mtd->owner = THIS_MODULE;
/* Use the fast version */
info->map.write = ixp4xx_write16,
......
/*
* $Id: l440gx.c,v 1.13 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: l440gx.c,v 1.14 2004/09/16 23:27:13 gleixner Exp $
*
* BIOS Flash chip on Intel 440GX board.
*
......@@ -73,7 +73,7 @@ static int __init init_l440gx(void)
return -ENODEV;
}
l440gx_map.virt = (unsigned long)ioremap_nocache(WINDOW_ADDR, WINDOW_SIZE);
l440gx_map.virt = (void __iomem *)ioremap_nocache(WINDOW_ADDR, WINDOW_SIZE);
if (!l440gx_map.virt) {
printk(KERN_WARNING "Failed to ioremap L440GX flash region\n");
......
......@@ -7,7 +7,7 @@
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* $Id: lasat.c,v 1.7 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: lasat.c,v 1.8 2004/09/16 23:27:13 gleixner Exp $
*
*/
......@@ -50,7 +50,7 @@ static int __init init_lasat(void)
ENABLE_VPP((&lasat_map));
lasat_map.phys = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
lasat_map.virt = (unsigned long)ioremap_nocache(
lasat_map.virt = (void __iomem *)ioremap_nocache(
lasat_map.phys, lasat_board_info.li_flash_size);
lasat_map.size = lasat_board_info.li_flash_size;
......
/*
* $Id: mbx860.c,v 1.6 2004/07/12 21:59:44 dwmw2 Exp $
* $Id: mbx860.c,v 1.7 2004/09/16 23:27:13 gleixner Exp $
*
* Handle mapping of the flash on MBX860 boards
*
......@@ -60,7 +60,7 @@ struct map_info mbx_map = {
int __init init_mbx(void)
{
printk(KERN_NOTICE "Motorola MBX flash device: 0x%x at 0x%x\n", WINDOW_SIZE*4, WINDOW_ADDR);
mbx_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE * 4);
mbx_map.virt = (void __iomem *)ioremap(WINDOW_ADDR, WINDOW_SIZE * 4);
if (!mbx_map.virt) {
printk("Failed to ioremap\n");
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment