mtd/drivers/mtd/devices doc2000.c, 1.62, 1.63 doc2001.c, 1.44,
1.45 doc2001plus.c, 1.9, 1.10 docprobe.c, 1.41, 1.42
gleixner at infradead.org
gleixner at infradead.org
Thu Sep 16 19:51:59 EDT 2004
Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/tmp/cvs-serv7799
Modified Files:
doc2000.c doc2001.c doc2001plus.c docprobe.c
Log Message:
Part 3 of the __iomem readb and friends overhaul
Index: doc2000.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/doc2000.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- doc2000.c 9 Aug 2004 14:04:02 -0000 1.62
+++ doc2000.c 16 Sep 2004 23:51:56 -0000 1.63
@@ -89,7 +89,7 @@
/* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */
static int _DoC_WaitReady(struct DiskOnChip *doc)
{
- unsigned long docptr = doc->virtadr;
+ void __iomem *docptr = doc->virtadr;
unsigned long timeo = jiffies + (HZ * 10);
DEBUG(MTD_DEBUG_LEVEL3,
@@ -114,7 +114,8 @@
static inline int DoC_WaitReady(struct DiskOnChip *doc)
{
- unsigned long docptr = doc->virtadr;
+ void __iomem *docptr = doc->virtadr;
+
/* This is inline, to optimise the common case, where it's ready instantly */
int ret = 0;
@@ -140,7 +141,7 @@
static inline int DoC_Command(struct DiskOnChip *doc, unsigned char command,
unsigned char xtraflags)
{
- unsigned long docptr = doc->virtadr;
+ void __iomem *docptr = doc->virtadr;
if (DoC_is_2000(doc))
xtraflags |= CDSN_CTRL_FLASH_IO;
@@ -172,10 +173,8 @@
static int DoC_Address(struct DiskOnChip *doc, int numbytes, unsigned long ofs,
unsigned char xtraflags1, unsigned char xtraflags2)
{
- unsigned long docptr;
int i;
-
- docptr = doc->virtadr;
+ void __iomem *docptr = doc->virtadr;
if (DoC_is_2000(doc))
xtraflags1 |= CDSN_CTRL_FLASH_IO;
@@ -240,11 +239,9 @@
{
volatile int dummy;
int modulus = 0xffff;
- unsigned long docptr;
+ void __iomem *docptr = doc->virtadr;
int i;
- docptr = doc->virtadr;
-
if (len <= 0)
return;
@@ -271,11 +268,9 @@
/* Write a buffer to DoC, taking care of Millennium odditys */
static void DoC_WriteBuf(struct DiskOnChip *doc, const u_char * buf, int len)
{
- unsigned long docptr;
+ void __iomem *docptr = doc->virtadr;
int i;
- docptr = doc->virtadr;
-
if (len <= 0)
return;
@@ -292,7 +287,7 @@
static inline int DoC_SelectChip(struct DiskOnChip *doc, int chip)
{
- unsigned long docptr = doc->virtadr;
+ void __iomem *docptr = doc->virtadr;
/* Software requirement 11.4.4 before writing DeviceSelect */
/* Deassert the CE line to eliminate glitches on the FCE# outputs */
@@ -316,7 +311,7 @@
static inline int DoC_SelectFloor(struct DiskOnChip *doc, int floor)
{
- unsigned long docptr = doc->virtadr;
+ void __iomem *docptr = doc->virtadr;
/* Select the floor (bank) of chips required */
WriteDOC(floor, docptr, FloorSelect);
@@ -639,15 +634,13 @@
size_t * retlen, u_char * buf, u_char * eccbuf, struct nand_oobinfo *oobsel)
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
- unsigned long docptr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip;
unsigned char syndrome[6];
volatile char dummy;
int i, len256 = 0, ret=0;
size_t left = len;
- docptr = this->virtadr;
-
/* Don't allow read past end of device */
if (from >= this->totlen)
return -EINVAL;
@@ -799,15 +792,13 @@
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
int di; /* Yes, DI is a hangover from when I was disassembling the binary driver */
- unsigned long docptr;
+ void __iomem *docptr = this->virtadr;
volatile char dummy;
int len256 = 0;
struct Nand *mychip;
size_t left = len;
int status;
- docptr = this->virtadr;
-
/* Don't allow write past end of device */
if (to >= this->totlen)
return -EINVAL;
@@ -1044,13 +1035,10 @@
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
int len256 = 0, ret;
- unsigned long docptr;
struct Nand *mychip;
down(&this->lock);
- docptr = this->virtadr;
-
mychip = &this->chips[ofs >> this->chipshift];
if (this->curfloor != mychip->floor) {
@@ -1105,7 +1093,7 @@
{
struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
int len256 = 0;
- unsigned long docptr = this->virtadr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
volatile int dummy;
int status;
@@ -1222,7 +1210,7 @@
__u32 ofs = instr->addr;
__u32 len = instr->len;
volatile int dummy;
- unsigned long docptr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip;
int status;
@@ -1235,8 +1223,6 @@
instr->state = MTD_ERASING;
- docptr = this->virtadr;
-
/* FIXME: Do this in the background. Use timers or schedule_task() */
while(len) {
mychip = &this->chips[ofs >> this->chipshift];
Index: doc2001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/doc2001.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- doc2001.c 9 Aug 2004 14:04:24 -0000 1.44
+++ doc2001.c 16 Sep 2004 23:51:57 -0000 1.45
@@ -52,7 +52,7 @@
static struct mtd_info *docmillist = NULL;
/* Perform the required delay cycles by reading from the NOP register */
-static void DoC_Delay(unsigned long docptr, unsigned short cycles)
+static void DoC_Delay(void __iomem * docptr, unsigned short cycles)
{
volatile char dummy;
int i;
@@ -62,7 +62,7 @@
}
/* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */
-static int _DoC_WaitReady(unsigned long docptr)
+static int _DoC_WaitReady(void __iomem * docptr)
{
unsigned short c = 0xffff;
@@ -79,7 +79,7 @@
return (c == 0);
}
-static inline int DoC_WaitReady(unsigned long docptr)
+static inline int DoC_WaitReady(void __iomem * docptr)
{
/* This is inline, to optimise the common case, where it's ready instantly */
int ret = 0;
@@ -103,7 +103,7 @@
with the internal pipeline. Each of 4 delay cycles (read from the NOP register) is
required after writing to CDSN Control register, see Software Requirement 11.4 item 3. */
-static inline void DoC_Command(unsigned long docptr, unsigned char command,
+static inline void DoC_Command(void __iomem * docptr, unsigned char command,
unsigned char xtraflags)
{
/* Assert the CLE (Command Latch Enable) line to the flash chip */
@@ -123,7 +123,7 @@
with the internal pipeline. Each of 4 delay cycles (read from the NOP register) is
required after writing to CDSN Control register, see Software Requirement 11.4 item 3. */
-static inline void DoC_Address(unsigned long docptr, int numbytes, unsigned long ofs,
+static inline void DoC_Address(void __iomem * docptr, int numbytes, unsigned long ofs,
unsigned char xtraflags1, unsigned char xtraflags2)
{
/* Assert the ALE (Address Latch Enable) line to the flash chip */
@@ -161,7 +161,7 @@
}
/* DoC_SelectChip: Select a given flash chip within the current floor */
-static int DoC_SelectChip(unsigned long docptr, int chip)
+static int DoC_SelectChip(void __iomem * docptr, int chip)
{
/* Select the individual flash chip requested */
WriteDOC(chip, docptr, CDSNDeviceSelect);
@@ -172,7 +172,7 @@
}
/* DoC_SelectFloor: Select a given floor (bank of flash chips) */
-static int DoC_SelectFloor(unsigned long docptr, int floor)
+static int DoC_SelectFloor(void __iomem * docptr, int floor)
{
/* Select the floor (bank) of chips required */
WriteDOC(floor, docptr, FloorSelect);
@@ -417,7 +417,7 @@
volatile char dummy;
unsigned char syndrome[6];
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
/* Don't allow read past end of device */
@@ -543,7 +543,7 @@
int i,ret = 0;
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[to >> (this->chipshift)];
/* Don't allow write past end of device */
@@ -678,7 +678,7 @@
#endif
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
/* Find the chip which is to be used and select it */
@@ -730,7 +730,7 @@
volatile char dummy;
int ret = 0;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
/* Find the chip which is to be used and select it */
@@ -799,7 +799,7 @@
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
__u32 ofs = instr->addr;
__u32 len = instr->len;
- unsigned long docptr = this->virtadr;
+ void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
if (len != mtd->erasesize)
Index: doc2001plus.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/doc2001plus.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- doc2001plus.c 9 Aug 2004 13:19:44 -0000 1.9
+++ doc2001plus.c 16 Sep 2004 23:51:57 -0000 1.10
@@ -57,7 +57,7 @@
/* Perform the required delay cycles by writing to the NOP register */
-static void DoC_Delay(unsigned long docptr, int cycles)
+static void DoC_Delay(void __iomem * docptr, int cycles)
{
int i;
@@ -68,7 +68,7 @@
#define CDSN_CTRL_FR_B_MASK (CDSN_CTRL_FR_B0 | CDSN_CTRL_FR_B1)
/* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */
-static int _DoC_WaitReady(unsigned long docptr)
+static int _DoC_WaitReady(void __iomem * docptr)
{
unsigned int c = 0xffff;
@@ -85,7 +85,7 @@
return (c == 0);
}
-static inline int DoC_WaitReady(unsigned long docptr)
+static inline int DoC_WaitReady(void __iomem * docptr)
{
/* This is inline, to optimise the common case, where it's ready instantly */
int ret = 0;
@@ -106,7 +106,7 @@
* can detect. M-systems suggest always check this on any block level
* operation and setting to normal mode if in reset mode.
*/
-static inline void DoC_CheckASIC(unsigned long docptr)
+static inline void DoC_CheckASIC(void __iomem * docptr)
{
/* Make sure the DoC is in normal mode */
if ((ReadDOC(docptr, Mplus_DOCControl) & DOC_MODE_NORMAL) == 0) {
@@ -118,7 +118,7 @@
/* DoC_Command: Send a flash command to the flash chip through the Flash
* command register. Need 2 Write Pipeline Terminates to complete send.
*/
-static inline void DoC_Command(unsigned long docptr, unsigned char command,
+static inline void DoC_Command(void __iomem * docptr, unsigned char command,
unsigned char xtraflags)
{
WriteDOC(command, docptr, Mplus_FlashCmd);
@@ -133,7 +133,7 @@
unsigned long ofs, unsigned char xtraflags1,
unsigned char xtraflags2)
{
- unsigned long docptr = doc->virtadr;
+ void __iomem * docptr = doc->virtadr;
/* Allow for possible Mill Plus internal flash interleaving */
ofs >>= doc->interleave;
@@ -163,14 +163,14 @@
}
/* DoC_SelectChip: Select a given flash chip within the current floor */
-static int DoC_SelectChip(unsigned long docptr, int chip)
+static int DoC_SelectChip(void __iomem * docptr, int chip)
{
/* No choice for flash chip on Millennium Plus */
return 0;
}
/* DoC_SelectFloor: Select a given floor (bank of flash chips) */
-static int DoC_SelectFloor(unsigned long docptr, int floor)
+static int DoC_SelectFloor(void __iomem * docptr, int floor)
{
WriteDOC((floor & 0x3), docptr, Mplus_DeviceSelect);
return 0;
@@ -253,7 +253,7 @@
return cmd;
}
-static inline void MemReadDOC(unsigned long docptr, unsigned char *buf, int len)
+static inline void MemReadDOC(void __iomem * docptr, unsigned char *buf, int len)
{
#ifndef USE_MEMCPY
int i;
@@ -264,7 +264,7 @@
#endif
}
-static inline void MemWriteDOC(unsigned long docptr, unsigned char *buf, int len)
+static inline void MemWriteDOC(void __iomem * docptr, unsigned char *buf, int len)
{
#ifndef USE_MEMCPY
int i;
@@ -280,7 +280,7 @@
{
int mfr, id, i, j;
volatile char dummy;
- unsigned long docptr = doc->virtadr;
+ void __iomem * docptr = doc->virtadr;
/* Page in the required floor/chip */
DoC_SelectFloor(docptr, floor);
@@ -371,7 +371,7 @@
printk(KERN_NOTICE "Setting DiskOnChip Millennium Plus interleave to %s\n",
this->interleave?"on (16-bit)":"off (8-bit)");
conf ^= 4;
- WriteDOC(this->virtadr, conf, Mplus_Configuration);
+ WriteDOC(conf, this->virtadr, Mplus_Configuration);
}
/* For each floor, find the number of valid chips it contains */
@@ -531,7 +531,7 @@
int i;
loff_t fofs;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
unsigned char *bp, buf[1056];
char c[32];
@@ -616,7 +616,7 @@
loff_t fofs;
unsigned char syndrome[6];
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[from >> (this->chipshift)];
/* Don't allow read past end of device */
@@ -755,7 +755,7 @@
loff_t fto;
volatile char dummy;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[to >> (this->chipshift)];
/* Don't allow write past end of device */
@@ -881,7 +881,7 @@
{
loff_t fofs, base;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
size_t i, size, got, want;
@@ -959,7 +959,7 @@
volatile char dummy;
loff_t fofs, base;
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
- unsigned long docptr = this->virtadr;
+ void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
size_t i, size, got, want;
int ret = 0;
@@ -1061,7 +1061,7 @@
struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
__u32 ofs = instr->addr;
__u32 len = instr->len;
- unsigned long docptr = this->virtadr;
+ void __iomem * docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];
DoC_CheckASIC(docptr);
Index: docprobe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/docprobe.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- docprobe.c 3 Dec 2003 10:19:57 -0000 1.41
+++ docprobe.c 16 Sep 2004 23:51:57 -0000 1.42
@@ -270,7 +270,7 @@
memset((char *)this, 0, sizeof(struct DiskOnChip));
mtd->priv = this;
- this->virtadr = docptr;
+ this->virtadr = (void __iomem *)docptr;
this->physadr = physadr;
this->ChipID = ChipID;
sprintf(namebuf, "with ChipID %2.2X", ChipID);
More information about the linux-mtd-cvs
mailing list