diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2005-11-07 06:15:40 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-07 09:06:59 -0500 |
commit | e5580fbe8a950131b9ccccce0f962811dfb9ef43 (patch) | |
tree | d7558eea2208a7b8fbc83c9a94f588b67aa5a3cc /drivers/mtd/devices | |
parent | 69f34c98c1416eb74c55e38a21dbf3e294966514 (diff) |
[MTD] devices: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/Kconfig | 8 | ||||
-rw-r--r-- | drivers/mtd/devices/blkmtd.c | 10 | ||||
-rw-r--r-- | drivers/mtd/devices/block2mtd.c | 8 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2000.c | 42 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2001.c | 24 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2001plus.c | 20 | ||||
-rw-r--r-- | drivers/mtd/devices/docecc.c | 40 | ||||
-rw-r--r-- | drivers/mtd/devices/docprobe.c | 84 | ||||
-rw-r--r-- | drivers/mtd/devices/lart.c | 8 | ||||
-rw-r--r-- | drivers/mtd/devices/phram.c | 14 | ||||
-rw-r--r-- | drivers/mtd/devices/pmc551.c | 24 | ||||
-rw-r--r-- | drivers/mtd/devices/slram.c | 30 |
12 files changed, 156 insertions, 156 deletions
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index c4a56a4ac5e2..9a2aa4033c6a 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | # drivers/mtd/maps/Kconfig | 1 | # drivers/mtd/maps/Kconfig |
2 | # $Id: Kconfig,v 1.15 2004/12/22 17:51:15 joern Exp $ | 2 | # $Id: Kconfig,v 1.18 2005/11/07 11:14:24 gleixner Exp $ |
3 | 3 | ||
4 | menu "Self-contained MTD device drivers" | 4 | menu "Self-contained MTD device drivers" |
5 | depends on MTD!=n | 5 | depends on MTD!=n |
@@ -110,7 +110,7 @@ config MTDRAM_ABS_POS | |||
110 | If you have system RAM accessible by the CPU but not used by Linux | 110 | If you have system RAM accessible by the CPU but not used by Linux |
111 | in normal operation, you can give the physical address at which the | 111 | in normal operation, you can give the physical address at which the |
112 | available RAM starts, and the MTDRAM driver will use it instead of | 112 | available RAM starts, and the MTDRAM driver will use it instead of |
113 | allocating space from Linux's available memory. Otherwise, leave | 113 | allocating space from Linux's available memory. Otherwise, leave |
114 | this set to zero. Most people will want to leave this as zero. | 114 | this set to zero. Most people will want to leave this as zero. |
115 | 115 | ||
116 | config MTD_BLKMTD | 116 | config MTD_BLKMTD |
@@ -165,7 +165,7 @@ config MTD_DOC2001 | |||
165 | select MTD_DOCPROBE | 165 | select MTD_DOCPROBE |
166 | select MTD_NAND_IDS | 166 | select MTD_NAND_IDS |
167 | ---help--- | 167 | ---help--- |
168 | This provides an alternative MTD device driver for the M-Systems | 168 | This provides an alternative MTD device driver for the M-Systems |
169 | DiskOnChip Millennium devices. Use this if you have problems with | 169 | DiskOnChip Millennium devices. Use this if you have problems with |
170 | the combined DiskOnChip 2000 and Millennium driver above. To get | 170 | the combined DiskOnChip 2000 and Millennium driver above. To get |
171 | the DiskOnChip probe code to load and use this driver instead of | 171 | the DiskOnChip probe code to load and use this driver instead of |
@@ -192,7 +192,7 @@ config MTD_DOC2001PLUS | |||
192 | 192 | ||
193 | If you use this device, you probably also want to enable the INFTL | 193 | If you use this device, you probably also want to enable the INFTL |
194 | 'Inverse NAND Flash Translation Layer' option below, which is used | 194 | 'Inverse NAND Flash Translation Layer' option below, which is used |
195 | to emulate a block device by using a kind of file system on the | 195 | to emulate a block device by using a kind of file system on the |
196 | flash chips. | 196 | flash chips. |
197 | 197 | ||
198 | NOTE: This driver will soon be replaced by the new DiskOnChip driver | 198 | NOTE: This driver will soon be replaced by the new DiskOnChip driver |
diff --git a/drivers/mtd/devices/blkmtd.c b/drivers/mtd/devices/blkmtd.c index 662e807801ed..ff585788880d 100644 --- a/drivers/mtd/devices/blkmtd.c +++ b/drivers/mtd/devices/blkmtd.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: blkmtd.c,v 1.24 2004/11/16 18:29:01 dwmw2 Exp $ | 2 | * $Id: blkmtd.c,v 1.27 2005/11/07 11:14:24 gleixner Exp $ |
3 | * | 3 | * |
4 | * blkmtd.c - use a block device as a fake MTD | 4 | * blkmtd.c - use a block device as a fake MTD |
5 | * | 5 | * |
@@ -39,7 +39,7 @@ | |||
39 | 39 | ||
40 | /* Default erase size in K, always make it a multiple of PAGE_SIZE */ | 40 | /* Default erase size in K, always make it a multiple of PAGE_SIZE */ |
41 | #define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10) /* 128KiB */ | 41 | #define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10) /* 128KiB */ |
42 | #define VERSION "$Revision: 1.24 $" | 42 | #define VERSION "$Revision: 1.27 $" |
43 | 43 | ||
44 | /* Info for the block device */ | 44 | /* Info for the block device */ |
45 | struct blkmtd_dev { | 45 | struct blkmtd_dev { |
@@ -117,7 +117,7 @@ static int bi_write_complete(struct bio *bio, unsigned int bytes_done, int error | |||
117 | unlock_page(page); | 117 | unlock_page(page); |
118 | page_cache_release(page); | 118 | page_cache_release(page); |
119 | } while (bvec >= bio->bi_io_vec); | 119 | } while (bvec >= bio->bi_io_vec); |
120 | 120 | ||
121 | complete((struct completion*)bio->bi_private); | 121 | complete((struct completion*)bio->bi_private); |
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
@@ -135,7 +135,7 @@ static int blkmtd_readpage(struct blkmtd_dev *dev, struct page *page) | |||
135 | unlock_page(page); | 135 | unlock_page(page); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | 138 | ||
139 | ClearPageUptodate(page); | 139 | ClearPageUptodate(page); |
140 | ClearPageError(page); | 140 | ClearPageError(page); |
141 | 141 | ||
@@ -710,7 +710,7 @@ static struct blkmtd_dev *add_device(char *devname, int readonly, int erase_size | |||
710 | dev->mtd_info.erasesize >> 10, | 710 | dev->mtd_info.erasesize >> 10, |
711 | readonly ? "(read-only)" : ""); | 711 | readonly ? "(read-only)" : ""); |
712 | } | 712 | } |
713 | 713 | ||
714 | return dev; | 714 | return dev; |
715 | 715 | ||
716 | devinit_err: | 716 | devinit_err: |
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index 4a7a805e7564..0aaa0ced9aba 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: block2mtd.c,v 1.28 2005/03/19 22:40:44 gleixner Exp $ | 2 | * $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $ |
3 | * | 3 | * |
4 | * block2mtd.c - create an mtd from a block device | 4 | * block2mtd.c - create an mtd from a block device |
5 | * | 5 | * |
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
20 | #include <linux/buffer_head.h> | 20 | #include <linux/buffer_head.h> |
21 | 21 | ||
22 | #define VERSION "$Revision: 1.28 $" | 22 | #define VERSION "$Revision: 1.29 $" |
23 | 23 | ||
24 | 24 | ||
25 | #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) | 25 | #define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args) |
@@ -111,7 +111,7 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len) | |||
111 | return PTR_ERR(page); | 111 | return PTR_ERR(page); |
112 | 112 | ||
113 | max = (u_long*)page_address(page) + PAGE_SIZE; | 113 | max = (u_long*)page_address(page) + PAGE_SIZE; |
114 | for (p=(u_long*)page_address(page); p<max; p++) | 114 | for (p=(u_long*)page_address(page); p<max; p++) |
115 | if (*p != -1UL) { | 115 | if (*p != -1UL) { |
116 | lock_page(page); | 116 | lock_page(page); |
117 | memset(page_address(page), 0xff, PAGE_SIZE); | 117 | memset(page_address(page), 0xff, PAGE_SIZE); |
@@ -206,7 +206,7 @@ static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf, | |||
206 | if (retlen) | 206 | if (retlen) |
207 | *retlen = 0; | 207 | *retlen = 0; |
208 | while (len) { | 208 | while (len) { |
209 | if ((offset+len) > PAGE_SIZE) | 209 | if ((offset+len) > PAGE_SIZE) |
210 | cpylen = PAGE_SIZE - offset; // multiple pages | 210 | cpylen = PAGE_SIZE - offset; // multiple pages |
211 | else | 211 | else |
212 | cpylen = len; // this page | 212 | cpylen = len; // this page |
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c index 5fc532895a24..be5e88b3888d 100644 --- a/drivers/mtd/devices/doc2000.c +++ b/drivers/mtd/devices/doc2000.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * (c) 1999 Machine Vision Holdings, Inc. | 4 | * (c) 1999 Machine Vision Holdings, Inc. |
5 | * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> | 5 | * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> |
6 | * | 6 | * |
7 | * $Id: doc2000.c,v 1.66 2005/01/05 18:05:12 dwmw2 Exp $ | 7 | * $Id: doc2000.c,v 1.67 2005/11/07 11:14:24 gleixner Exp $ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
@@ -58,7 +58,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, | |||
58 | size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); | 58 | size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); |
59 | static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, | 59 | static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, |
60 | size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); | 60 | size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel); |
61 | static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, | 61 | static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, |
62 | unsigned long count, loff_t to, size_t *retlen, | 62 | unsigned long count, loff_t to, size_t *retlen, |
63 | u_char *eccbuf, struct nand_oobinfo *oobsel); | 63 | u_char *eccbuf, struct nand_oobinfo *oobsel); |
64 | static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len, | 64 | static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len, |
@@ -76,14 +76,14 @@ static void DoC_Delay(struct DiskOnChip *doc, unsigned short cycles) | |||
76 | { | 76 | { |
77 | volatile char dummy; | 77 | volatile char dummy; |
78 | int i; | 78 | int i; |
79 | 79 | ||
80 | for (i = 0; i < cycles; i++) { | 80 | for (i = 0; i < cycles; i++) { |
81 | if (DoC_is_Millennium(doc)) | 81 | if (DoC_is_Millennium(doc)) |
82 | dummy = ReadDOC(doc->virtadr, NOP); | 82 | dummy = ReadDOC(doc->virtadr, NOP); |
83 | else | 83 | else |
84 | dummy = ReadDOC(doc->virtadr, DOCStatus); | 84 | dummy = ReadDOC(doc->virtadr, DOCStatus); |
85 | } | 85 | } |
86 | 86 | ||
87 | } | 87 | } |
88 | 88 | ||
89 | /* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */ | 89 | /* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */ |
@@ -220,8 +220,8 @@ static int DoC_Address(struct DiskOnChip *doc, int numbytes, unsigned long ofs, | |||
220 | WriteDOC(ofs & 0xff, docptr, WritePipeTerm); | 220 | WriteDOC(ofs & 0xff, docptr, WritePipeTerm); |
221 | 221 | ||
222 | DoC_Delay(doc, 2); /* Needed for some slow flash chips. mf. */ | 222 | DoC_Delay(doc, 2); /* Needed for some slow flash chips. mf. */ |
223 | 223 | ||
224 | /* FIXME: The SlowIO's for millennium could be replaced by | 224 | /* FIXME: The SlowIO's for millennium could be replaced by |
225 | a single WritePipeTerm here. mf. */ | 225 | a single WritePipeTerm here. mf. */ |
226 | 226 | ||
227 | /* Lower the ALE line */ | 227 | /* Lower the ALE line */ |
@@ -377,9 +377,9 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip) | |||
377 | if (mfr == 0xff || mfr == 0) | 377 | if (mfr == 0xff || mfr == 0) |
378 | return 0; | 378 | return 0; |
379 | 379 | ||
380 | /* Check it's the same as the first chip we identified. | 380 | /* Check it's the same as the first chip we identified. |
381 | * M-Systems say that any given DiskOnChip device should only | 381 | * M-Systems say that any given DiskOnChip device should only |
382 | * contain _one_ type of flash part, although that's not a | 382 | * contain _one_ type of flash part, although that's not a |
383 | * hardware restriction. */ | 383 | * hardware restriction. */ |
384 | if (doc->mfr) { | 384 | if (doc->mfr) { |
385 | if (doc->mfr == mfr && doc->id == id) | 385 | if (doc->mfr == mfr && doc->id == id) |
@@ -397,7 +397,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip) | |||
397 | for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { | 397 | for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { |
398 | if (nand_manuf_ids[j].id == mfr) | 398 | if (nand_manuf_ids[j].id == mfr) |
399 | break; | 399 | break; |
400 | } | 400 | } |
401 | printk(KERN_INFO | 401 | printk(KERN_INFO |
402 | "Flash chip found: Manufacturer ID: %2.2X, " | 402 | "Flash chip found: Manufacturer ID: %2.2X, " |
403 | "Chip ID: %2.2X (%s:%s)\n", mfr, id, | 403 | "Chip ID: %2.2X (%s:%s)\n", mfr, id, |
@@ -405,7 +405,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip) | |||
405 | if (!doc->mfr) { | 405 | if (!doc->mfr) { |
406 | doc->mfr = mfr; | 406 | doc->mfr = mfr; |
407 | doc->id = id; | 407 | doc->id = id; |
408 | doc->chipshift = | 408 | doc->chipshift = |
409 | ffs((nand_flash_ids[i].chipsize << 20)) - 1; | 409 | ffs((nand_flash_ids[i].chipsize << 20)) - 1; |
410 | doc->page256 = (nand_flash_ids[i].pagesize == 256) ? 1 : 0; | 410 | doc->page256 = (nand_flash_ids[i].pagesize == 256) ? 1 : 0; |
411 | doc->pageadrlen = doc->chipshift > 25 ? 3 : 2; | 411 | doc->pageadrlen = doc->chipshift > 25 ? 3 : 2; |
@@ -467,7 +467,7 @@ static void DoC_ScanChips(struct DiskOnChip *this, int maxchips) | |||
467 | 467 | ||
468 | ret = 0; | 468 | ret = 0; |
469 | 469 | ||
470 | /* Fill out the chip array with {floor, chipno} for each | 470 | /* Fill out the chip array with {floor, chipno} for each |
471 | * detected chip in the device. */ | 471 | * detected chip in the device. */ |
472 | for (floor = 0; floor < MAX_FLOORS; floor++) { | 472 | for (floor = 0; floor < MAX_FLOORS; floor++) { |
473 | for (chip = 0; chip < numchips[floor]; chip++) { | 473 | for (chip = 0; chip < numchips[floor]; chip++) { |
@@ -757,12 +757,12 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, | |||
757 | (long)from, eccbuf[0], eccbuf[1], eccbuf[2], | 757 | (long)from, eccbuf[0], eccbuf[1], eccbuf[2], |
758 | eccbuf[3], eccbuf[4], eccbuf[5]); | 758 | eccbuf[3], eccbuf[4], eccbuf[5]); |
759 | #endif | 759 | #endif |
760 | 760 | ||
761 | /* disable the ECC engine */ | 761 | /* disable the ECC engine */ |
762 | WriteDOC(DOC_ECC_DIS, docptr , ECCConf); | 762 | WriteDOC(DOC_ECC_DIS, docptr , ECCConf); |
763 | } | 763 | } |
764 | 764 | ||
765 | /* according to 11.4.1, we need to wait for the busy line | 765 | /* according to 11.4.1, we need to wait for the busy line |
766 | * drop if we read to the end of the page. */ | 766 | * drop if we read to the end of the page. */ |
767 | if(0 == ((from + len) & 0x1ff)) | 767 | if(0 == ((from + len) & 0x1ff)) |
768 | { | 768 | { |
@@ -941,7 +941,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, | |||
941 | 941 | ||
942 | /* Let the caller know we completed it */ | 942 | /* Let the caller know we completed it */ |
943 | *retlen += len; | 943 | *retlen += len; |
944 | 944 | ||
945 | if (eccbuf) { | 945 | if (eccbuf) { |
946 | unsigned char x[8]; | 946 | unsigned char x[8]; |
947 | size_t dummy; | 947 | size_t dummy; |
@@ -950,10 +950,10 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, | |||
950 | /* Write the ECC data to flash */ | 950 | /* Write the ECC data to flash */ |
951 | for (di=0; di<6; di++) | 951 | for (di=0; di<6; di++) |
952 | x[di] = eccbuf[di]; | 952 | x[di] = eccbuf[di]; |
953 | 953 | ||
954 | x[6]=0x55; | 954 | x[6]=0x55; |
955 | x[7]=0x55; | 955 | x[7]=0x55; |
956 | 956 | ||
957 | ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x); | 957 | ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x); |
958 | if (ret) { | 958 | if (ret) { |
959 | up(&this->lock); | 959 | up(&this->lock); |
@@ -970,7 +970,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len, | |||
970 | return 0; | 970 | return 0; |
971 | } | 971 | } |
972 | 972 | ||
973 | static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, | 973 | static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, |
974 | unsigned long count, loff_t to, size_t *retlen, | 974 | unsigned long count, loff_t to, size_t *retlen, |
975 | u_char *eccbuf, struct nand_oobinfo *oobsel) | 975 | u_char *eccbuf, struct nand_oobinfo *oobsel) |
976 | { | 976 | { |
@@ -1022,7 +1022,7 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, | |||
1022 | break; | 1022 | break; |
1023 | 1023 | ||
1024 | to += thislen; | 1024 | to += thislen; |
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | up(&writev_buf_sem); | 1027 | up(&writev_buf_sem); |
1028 | *retlen = totretlen; | 1028 | *retlen = totretlen; |
@@ -1080,7 +1080,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len, | |||
1080 | /* Reading the full OOB data drops us off of the end of the page, | 1080 | /* Reading the full OOB data drops us off of the end of the page, |
1081 | * causing the flash device to go into busy mode, so we need | 1081 | * causing the flash device to go into busy mode, so we need |
1082 | * to wait until ready 11.4.1 and Toshiba TC58256FT docs */ | 1082 | * to wait until ready 11.4.1 and Toshiba TC58256FT docs */ |
1083 | 1083 | ||
1084 | ret = DoC_WaitReady(this); | 1084 | ret = DoC_WaitReady(this); |
1085 | 1085 | ||
1086 | up(&this->lock); | 1086 | up(&this->lock); |
@@ -1190,7 +1190,7 @@ static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len, | |||
1190 | return 0; | 1190 | return 0; |
1191 | 1191 | ||
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len, | 1194 | static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len, |
1195 | size_t * retlen, const u_char * buf) | 1195 | size_t * retlen, const u_char * buf) |
1196 | { | 1196 | { |
@@ -1222,7 +1222,7 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | instr->state = MTD_ERASING; | 1224 | instr->state = MTD_ERASING; |
1225 | 1225 | ||
1226 | /* FIXME: Do this in the background. Use timers or schedule_task() */ | 1226 | /* FIXME: Do this in the background. Use timers or schedule_task() */ |
1227 | while(len) { | 1227 | while(len) { |
1228 | mychip = &this->chips[ofs >> this->chipshift]; | 1228 | mychip = &this->chips[ofs >> this->chipshift]; |
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c index 1e704915ef08..fcb28a6fd89f 100644 --- a/drivers/mtd/devices/doc2001.c +++ b/drivers/mtd/devices/doc2001.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * (c) 1999 Machine Vision Holdings, Inc. | 4 | * (c) 1999 Machine Vision Holdings, Inc. |
5 | * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> | 5 | * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> |
6 | * | 6 | * |
7 | * $Id: doc2001.c,v 1.48 2005/01/05 18:05:12 dwmw2 Exp $ | 7 | * $Id: doc2001.c,v 1.49 2005/11/07 11:14:24 gleixner Exp $ |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
@@ -196,10 +196,10 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip) | |||
196 | DoC_Command(doc->virtadr, NAND_CMD_RESET, CDSN_CTRL_WP); | 196 | DoC_Command(doc->virtadr, NAND_CMD_RESET, CDSN_CTRL_WP); |
197 | DoC_WaitReady(doc->virtadr); | 197 | DoC_WaitReady(doc->virtadr); |
198 | 198 | ||
199 | /* Read the NAND chip ID: 1. Send ReadID command */ | 199 | /* Read the NAND chip ID: 1. Send ReadID command */ |
200 | DoC_Command(doc->virtadr, NAND_CMD_READID, CDSN_CTRL_WP); | 200 | DoC_Command(doc->virtadr, NAND_CMD_READID, CDSN_CTRL_WP); |
201 | 201 | ||
202 | /* Read the NAND chip ID: 2. Send address byte zero */ | 202 | /* Read the NAND chip ID: 2. Send address byte zero */ |
203 | DoC_Address(doc->virtadr, 1, 0x00, CDSN_CTRL_WP, 0x00); | 203 | DoC_Address(doc->virtadr, 1, 0x00, CDSN_CTRL_WP, 0x00); |
204 | 204 | ||
205 | /* Read the manufacturer and device id codes of the flash device through | 205 | /* Read the manufacturer and device id codes of the flash device through |
@@ -223,7 +223,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip) | |||
223 | for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { | 223 | for (j = 0; nand_manuf_ids[j].id != 0x0; j++) { |
224 | if (nand_manuf_ids[j].id == mfr) | 224 | if (nand_manuf_ids[j].id == mfr) |
225 | break; | 225 | break; |
226 | } | 226 | } |
227 | printk(KERN_INFO "Flash chip found: Manufacturer ID: %2.2X, " | 227 | printk(KERN_INFO "Flash chip found: Manufacturer ID: %2.2X, " |
228 | "Chip ID: %2.2X (%s:%s)\n", | 228 | "Chip ID: %2.2X (%s:%s)\n", |
229 | mfr, id, nand_manuf_ids[j].name, nand_flash_ids[i].name); | 229 | mfr, id, nand_manuf_ids[j].name, nand_flash_ids[i].name); |
@@ -275,7 +275,7 @@ static void DoC_ScanChips(struct DiskOnChip *this) | |||
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | 277 | ||
278 | /* Fill out the chip array with {floor, chipno} for each | 278 | /* Fill out the chip array with {floor, chipno} for each |
279 | * detected chip in the device. */ | 279 | * detected chip in the device. */ |
280 | for (floor = 0, ret = 0; floor < MAX_FLOORS_MIL; floor++) { | 280 | for (floor = 0, ret = 0; floor < MAX_FLOORS_MIL; floor++) { |
281 | for (chip = 0 ; chip < numchips[floor] ; chip++) { | 281 | for (chip = 0 ; chip < numchips[floor] ; chip++) { |
@@ -309,7 +309,7 @@ static int DoCMil_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2) | |||
309 | tmp2 = ReadDOC(doc2->virtadr, AliasResolution); | 309 | tmp2 = ReadDOC(doc2->virtadr, AliasResolution); |
310 | if (tmp1 != tmp2) | 310 | if (tmp1 != tmp2) |
311 | return 0; | 311 | return 0; |
312 | 312 | ||
313 | WriteDOC((tmp1+1) % 0xff, doc1->virtadr, AliasResolution); | 313 | WriteDOC((tmp1+1) % 0xff, doc1->virtadr, AliasResolution); |
314 | tmp2 = ReadDOC(doc2->virtadr, AliasResolution); | 314 | tmp2 = ReadDOC(doc2->virtadr, AliasResolution); |
315 | if (tmp2 == (tmp1+1) % 0xff) | 315 | if (tmp2 == (tmp1+1) % 0xff) |
@@ -425,7 +425,7 @@ static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | |||
425 | return -EINVAL; | 425 | return -EINVAL; |
426 | 426 | ||
427 | /* Don't allow a single read to cross a 512-byte block boundary */ | 427 | /* Don't allow a single read to cross a 512-byte block boundary */ |
428 | if (from + len > ((from | 0x1ff) + 1)) | 428 | if (from + len > ((from | 0x1ff) + 1)) |
429 | len = ((from | 0x1ff) + 1) - from; | 429 | len = ((from | 0x1ff) + 1) - from; |
430 | 430 | ||
431 | /* Find the chip which is to be used and select it */ | 431 | /* Find the chip which is to be used and select it */ |
@@ -552,7 +552,7 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len, | |||
552 | 552 | ||
553 | #if 0 | 553 | #if 0 |
554 | /* Don't allow a single write to cross a 512-byte block boundary */ | 554 | /* Don't allow a single write to cross a 512-byte block boundary */ |
555 | if (to + len > ( (to | 0x1ff) + 1)) | 555 | if (to + len > ( (to | 0x1ff) + 1)) |
556 | len = ((to | 0x1ff) + 1) - to; | 556 | len = ((to | 0x1ff) + 1) - to; |
557 | #else | 557 | #else |
558 | /* Don't allow writes which aren't exactly one block */ | 558 | /* Don't allow writes which aren't exactly one block */ |
@@ -632,7 +632,7 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len, | |||
632 | 632 | ||
633 | /* write the block status BLOCK_USED (0x5555) at the end of ECC data | 633 | /* write the block status BLOCK_USED (0x5555) at the end of ECC data |
634 | FIXME: this is only a hack for programming the IPL area for LinuxBIOS | 634 | FIXME: this is only a hack for programming the IPL area for LinuxBIOS |
635 | and should be replace with proper codes in user space utilities */ | 635 | and should be replace with proper codes in user space utilities */ |
636 | WriteDOC(0x55, docptr, Mil_CDSN_IO); | 636 | WriteDOC(0x55, docptr, Mil_CDSN_IO); |
637 | WriteDOC(0x55, docptr, Mil_CDSN_IO + 1); | 637 | WriteDOC(0x55, docptr, Mil_CDSN_IO + 1); |
638 | 638 | ||
@@ -802,7 +802,7 @@ int doc_erase (struct mtd_info *mtd, struct erase_info *instr) | |||
802 | void __iomem *docptr = this->virtadr; | 802 | void __iomem *docptr = this->virtadr; |
803 | struct Nand *mychip = &this->chips[ofs >> this->chipshift]; | 803 | struct Nand *mychip = &this->chips[ofs >> this->chipshift]; |
804 | 804 | ||
805 | if (len != mtd->erasesize) | 805 | if (len != mtd->erasesize) |
806 | printk(KERN_WARNING "Erase not right size (%x != %x)n", | 806 | printk(KERN_WARNING "Erase not right size (%x != %x)n", |
807 | len, mtd->erasesize); | 807 | len, mtd->erasesize); |
808 | 808 | ||
@@ -870,9 +870,9 @@ static void __exit cleanup_doc2001(void) | |||
870 | while ((mtd=docmillist)) { | 870 | while ((mtd=docmillist)) { |
871 | this = mtd->priv; | 871 | this = mtd->priv; |
872 | docmillist = this->nextdoc; | 872 | docmillist = this->nextdoc; |
873 | 873 | ||
874 | del_mtd_device(mtd); | 874 | del_mtd_device(mtd); |
875 | 875 | ||
876 | iounmap(this->virtadr); | 876 | iounmap(this->virtadr); |
877 | kfree(this->chips); | 877 | kfree(this->chips); |
878 | kfree(mtd); | 878 | kfree(mtd); |
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c index ed47bafb2ce2..0595cc7324b2 100644 --- a/drivers/mtd/devices/doc2001plus.c +++ b/drivers/mtd/devices/doc2001plus.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * (c) 1999 Machine Vision Holdings, Inc. | 6 | * (c) 1999 Machine Vision Holdings, Inc. |
7 | * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> | 7 | * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> |
8 | * | 8 | * |
9 | * $Id: doc2001plus.c,v 1.13 2005/01/05 18:05:12 dwmw2 Exp $ | 9 | * $Id: doc2001plus.c,v 1.14 2005/11/07 11:14:24 gleixner Exp $ |
10 | * | 10 | * |
11 | * Released under GPL | 11 | * Released under GPL |
12 | */ | 12 | */ |
@@ -293,10 +293,10 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip) | |||
293 | DoC_Command(docptr, NAND_CMD_RESET, 0); | 293 | DoC_Command(docptr, NAND_CMD_RESET, 0); |
294 | DoC_WaitReady(docptr); | 294 | DoC_WaitReady(docptr); |
295 | 295 | ||
296 | /* Read the NAND chip ID: 1. Send ReadID command */ | 296 | /* Read the NAND chip ID: 1. Send ReadID command */ |
297 | DoC_Command(docptr, NAND_CMD_READID, 0); | 297 | DoC_Command(docptr, NAND_CMD_READID, 0); |
298 | 298 | ||
299 | /* Read the NAND chip ID: 2. Send address byte zero */ | 299 | /* Read the NAND chip ID: 2. Send address byte zero */ |
300 | DoC_Address(doc, 1, 0x00, 0, 0x00); | 300 | DoC_Address(doc, 1, 0x00, 0, 0x00); |
301 | 301 | ||
302 | WriteDOC(0, docptr, Mplus_FlashControl); | 302 | WriteDOC(0, docptr, Mplus_FlashControl); |
@@ -365,7 +365,7 @@ static void DoC_ScanChips(struct DiskOnChip *this) | |||
365 | this->interleave = 1; | 365 | this->interleave = 1; |
366 | 366 | ||
367 | /* Check the ASIC agrees */ | 367 | /* Check the ASIC agrees */ |
368 | if ( (this->interleave << 2) != | 368 | if ( (this->interleave << 2) != |
369 | (ReadDOC(this->virtadr, Mplus_Configuration) & 4)) { | 369 | (ReadDOC(this->virtadr, Mplus_Configuration) & 4)) { |
370 | u_char conf = ReadDOC(this->virtadr, Mplus_Configuration); | 370 | u_char conf = ReadDOC(this->virtadr, Mplus_Configuration); |
371 | printk(KERN_NOTICE "Setting DiskOnChip Millennium Plus interleave to %s\n", | 371 | printk(KERN_NOTICE "Setting DiskOnChip Millennium Plus interleave to %s\n", |
@@ -398,7 +398,7 @@ static void DoC_ScanChips(struct DiskOnChip *this) | |||
398 | return; | 398 | return; |
399 | } | 399 | } |
400 | 400 | ||
401 | /* Fill out the chip array with {floor, chipno} for each | 401 | /* Fill out the chip array with {floor, chipno} for each |
402 | * detected chip in the device. */ | 402 | * detected chip in the device. */ |
403 | for (floor = 0, ret = 0; floor < MAX_FLOORS_MPLUS; floor++) { | 403 | for (floor = 0, ret = 0; floor < MAX_FLOORS_MPLUS; floor++) { |
404 | for (chip = 0 ; chip < numchips[floor] ; chip++) { | 404 | for (chip = 0 ; chip < numchips[floor] ; chip++) { |
@@ -432,7 +432,7 @@ static int DoCMilPlus_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2) | |||
432 | tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution); | 432 | tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution); |
433 | if (tmp1 != tmp2) | 433 | if (tmp1 != tmp2) |
434 | return 0; | 434 | return 0; |
435 | 435 | ||
436 | WriteDOC((tmp1+1) % 0xff, doc1->virtadr, Mplus_AliasResolution); | 436 | WriteDOC((tmp1+1) % 0xff, doc1->virtadr, Mplus_AliasResolution); |
437 | tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution); | 437 | tmp2 = ReadDOC(doc2->virtadr, Mplus_AliasResolution); |
438 | if (tmp2 == (tmp1+1) % 0xff) | 438 | if (tmp2 == (tmp1+1) % 0xff) |
@@ -624,7 +624,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len, | |||
624 | return -EINVAL; | 624 | return -EINVAL; |
625 | 625 | ||
626 | /* Don't allow a single read to cross a 512-byte block boundary */ | 626 | /* Don't allow a single read to cross a 512-byte block boundary */ |
627 | if (from + len > ((from | 0x1ff) + 1)) | 627 | if (from + len > ((from | 0x1ff) + 1)) |
628 | len = ((from | 0x1ff) + 1) - from; | 628 | len = ((from | 0x1ff) + 1) - from; |
629 | 629 | ||
630 | DoC_CheckASIC(docptr); | 630 | DoC_CheckASIC(docptr); |
@@ -1066,7 +1066,7 @@ int doc_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
1066 | 1066 | ||
1067 | DoC_CheckASIC(docptr); | 1067 | DoC_CheckASIC(docptr); |
1068 | 1068 | ||
1069 | if (len != mtd->erasesize) | 1069 | if (len != mtd->erasesize) |
1070 | printk(KERN_WARNING "MTD: Erase not right size (%x != %x)n", | 1070 | printk(KERN_WARNING "MTD: Erase not right size (%x != %x)n", |
1071 | len, mtd->erasesize); | 1071 | len, mtd->erasesize); |
1072 | 1072 | ||
@@ -1136,9 +1136,9 @@ static void __exit cleanup_doc2001plus(void) | |||
1136 | while ((mtd=docmilpluslist)) { | 1136 | while ((mtd=docmilpluslist)) { |
1137 | this = mtd->priv; | 1137 | this = mtd->priv; |
1138 | docmilpluslist = this->nextdoc; | 1138 | docmilpluslist = this->nextdoc; |
1139 | 1139 | ||
1140 | del_mtd_device(mtd); | 1140 | del_mtd_device(mtd); |
1141 | 1141 | ||
1142 | iounmap(this->virtadr); | 1142 | iounmap(this->virtadr); |
1143 | kfree(this->chips); | 1143 | kfree(this->chips); |
1144 | kfree(mtd); | 1144 | kfree(mtd); |
diff --git a/drivers/mtd/devices/docecc.c b/drivers/mtd/devices/docecc.c index 24f670b5a4f3..cd3db72bef96 100644 --- a/drivers/mtd/devices/docecc.c +++ b/drivers/mtd/devices/docecc.c | |||
@@ -4,10 +4,10 @@ | |||
4 | * GNU GPL License. The rest is simply to convert the disk on chip | 4 | * GNU GPL License. The rest is simply to convert the disk on chip |
5 | * syndrom into a standard syndom. | 5 | * syndrom into a standard syndom. |
6 | * | 6 | * |
7 | * Author: Fabrice Bellard (fabrice.bellard@netgem.com) | 7 | * Author: Fabrice Bellard (fabrice.bellard@netgem.com) |
8 | * Copyright (C) 2000 Netgem S.A. | 8 | * Copyright (C) 2000 Netgem S.A. |
9 | * | 9 | * |
10 | * $Id: docecc.c,v 1.5 2003/05/21 15:15:06 dwmw2 Exp $ | 10 | * $Id: docecc.c,v 1.7 2005/11/07 11:14:25 gleixner Exp $ |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
@@ -122,7 +122,7 @@ for(ci=(n)-1;ci >=0;ci--)\ | |||
122 | a(0) + a(1) @ + a(2) @^2 + ... + a(m-1) @^(m-1) | 122 | a(0) + a(1) @ + a(2) @^2 + ... + a(m-1) @^(m-1) |
123 | we consider the integer "i" whose binary representation with a(0) being LSB | 123 | we consider the integer "i" whose binary representation with a(0) being LSB |
124 | and a(m-1) MSB is (a(0),a(1),...,a(m-1)) and locate the entry | 124 | and a(m-1) MSB is (a(0),a(1),...,a(m-1)) and locate the entry |
125 | "index_of[i]". Now, @^index_of[i] is that element whose polynomial | 125 | "index_of[i]". Now, @^index_of[i] is that element whose polynomial |
126 | representation is (a(0),a(1),a(2),...,a(m-1)). | 126 | representation is (a(0),a(1),a(2),...,a(m-1)). |
127 | NOTE: | 127 | NOTE: |
128 | The element alpha_to[2^m-1] = 0 always signifying that the | 128 | The element alpha_to[2^m-1] = 0 always signifying that the |
@@ -130,7 +130,7 @@ for(ci=(n)-1;ci >=0;ci--)\ | |||
130 | Similarily, the element index_of[0] = A0 always signifying | 130 | Similarily, the element index_of[0] = A0 always signifying |
131 | that the power of alpha which has the polynomial representation | 131 | that the power of alpha which has the polynomial representation |
132 | (0,0,...,0) is "infinity". | 132 | (0,0,...,0) is "infinity". |
133 | 133 | ||
134 | */ | 134 | */ |
135 | 135 | ||
136 | static void | 136 | static void |
@@ -176,7 +176,7 @@ generate_gf(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1]) | |||
176 | * are written back. NOTE! This array must be at least NN-KK elements long. | 176 | * are written back. NOTE! This array must be at least NN-KK elements long. |
177 | * The corrected data are written in eras_val[]. They must be xor with the data | 177 | * The corrected data are written in eras_val[]. They must be xor with the data |
178 | * to retrieve the correct data : data[erase_pos[i]] ^= erase_val[i] . | 178 | * to retrieve the correct data : data[erase_pos[i]] ^= erase_val[i] . |
179 | * | 179 | * |
180 | * First "no_eras" erasures are declared by the calling program. Then, the | 180 | * First "no_eras" erasures are declared by the calling program. Then, the |
181 | * maximum # of errors correctable is t_after_eras = floor((NN-KK-no_eras)/2). | 181 | * maximum # of errors correctable is t_after_eras = floor((NN-KK-no_eras)/2). |
182 | * If the number of channel errors is not greater than "t_after_eras" the | 182 | * If the number of channel errors is not greater than "t_after_eras" the |
@@ -189,7 +189,7 @@ generate_gf(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1]) | |||
189 | * */ | 189 | * */ |
190 | static int | 190 | static int |
191 | eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | 191 | eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], |
192 | gf bb[NN - KK + 1], gf eras_val[NN-KK], int eras_pos[NN-KK], | 192 | gf bb[NN - KK + 1], gf eras_val[NN-KK], int eras_pos[NN-KK], |
193 | int no_eras) | 193 | int no_eras) |
194 | { | 194 | { |
195 | int deg_lambda, el, deg_omega; | 195 | int deg_lambda, el, deg_omega; |
@@ -212,7 +212,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
212 | count = 0; | 212 | count = 0; |
213 | goto finish; | 213 | goto finish; |
214 | } | 214 | } |
215 | 215 | ||
216 | for(i=1;i<=NN-KK;i++){ | 216 | for(i=1;i<=NN-KK;i++){ |
217 | s[i] = bb[0]; | 217 | s[i] = bb[0]; |
218 | } | 218 | } |
@@ -220,7 +220,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
220 | if(bb[j] == 0) | 220 | if(bb[j] == 0) |
221 | continue; | 221 | continue; |
222 | tmp = Index_of[bb[j]]; | 222 | tmp = Index_of[bb[j]]; |
223 | 223 | ||
224 | for(i=1;i<=NN-KK;i++) | 224 | for(i=1;i<=NN-KK;i++) |
225 | s[i] ^= Alpha_to[modnn(tmp + (B0+i-1)*PRIM*j)]; | 225 | s[i] ^= Alpha_to[modnn(tmp + (B0+i-1)*PRIM*j)]; |
226 | } | 226 | } |
@@ -234,7 +234,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
234 | tmp = modnn(tmp + 2 * KK * (B0+i-1)*PRIM); | 234 | tmp = modnn(tmp + 2 * KK * (B0+i-1)*PRIM); |
235 | s[i] = tmp; | 235 | s[i] = tmp; |
236 | } | 236 | } |
237 | 237 | ||
238 | CLEAR(&lambda[1],NN-KK); | 238 | CLEAR(&lambda[1],NN-KK); |
239 | lambda[0] = 1; | 239 | lambda[0] = 1; |
240 | 240 | ||
@@ -252,7 +252,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
252 | #if DEBUG_ECC >= 1 | 252 | #if DEBUG_ECC >= 1 |
253 | /* Test code that verifies the erasure locator polynomial just constructed | 253 | /* Test code that verifies the erasure locator polynomial just constructed |
254 | Needed only for decoder debugging. */ | 254 | Needed only for decoder debugging. */ |
255 | 255 | ||
256 | /* find roots of the erasure location polynomial */ | 256 | /* find roots of the erasure location polynomial */ |
257 | for(i=1;i<=no_eras;i++) | 257 | for(i=1;i<=no_eras;i++) |
258 | reg[i] = Index_of[lambda[i]]; | 258 | reg[i] = Index_of[lambda[i]]; |
@@ -286,7 +286,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
286 | } | 286 | } |
287 | for(i=0;i<NN-KK+1;i++) | 287 | for(i=0;i<NN-KK+1;i++) |
288 | b[i] = Index_of[lambda[i]]; | 288 | b[i] = Index_of[lambda[i]]; |
289 | 289 | ||
290 | /* | 290 | /* |
291 | * Begin Berlekamp-Massey algorithm to determine error+erasure | 291 | * Begin Berlekamp-Massey algorithm to determine error+erasure |
292 | * locator polynomial | 292 | * locator polynomial |
@@ -389,7 +389,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
389 | omega[i] = Index_of[tmp]; | 389 | omega[i] = Index_of[tmp]; |
390 | } | 390 | } |
391 | omega[NN-KK] = A0; | 391 | omega[NN-KK] = A0; |
392 | 392 | ||
393 | /* | 393 | /* |
394 | * Compute error values in poly-form. num1 = omega(inv(X(l))), num2 = | 394 | * Compute error values in poly-form. num1 = omega(inv(X(l))), num2 = |
395 | * inv(X(l))**(B0-1) and den = lambda_pr(inv(X(l))) all in poly-form | 395 | * inv(X(l))**(B0-1) and den = lambda_pr(inv(X(l))) all in poly-form |
@@ -402,7 +402,7 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
402 | } | 402 | } |
403 | num2 = Alpha_to[modnn(root[j] * (B0 - 1) + NN)]; | 403 | num2 = Alpha_to[modnn(root[j] * (B0 - 1) + NN)]; |
404 | den = 0; | 404 | den = 0; |
405 | 405 | ||
406 | /* lambda[i+1] for i even is the formal derivative lambda_pr of lambda[i] */ | 406 | /* lambda[i+1] for i even is the formal derivative lambda_pr of lambda[i] */ |
407 | for (i = min(deg_lambda,NN-KK-1) & ~1; i >= 0; i -=2) { | 407 | for (i = min(deg_lambda,NN-KK-1) & ~1; i >= 0; i -=2) { |
408 | if(lambda[i+1] != A0) | 408 | if(lambda[i+1] != A0) |
@@ -436,11 +436,11 @@ eras_dec_rs(dtype Alpha_to[NN + 1], dtype Index_of[NN + 1], | |||
436 | /* The sector bytes are packed into NB_DATA MM bits words */ | 436 | /* The sector bytes are packed into NB_DATA MM bits words */ |
437 | #define NB_DATA (((SECTOR_SIZE + 1) * 8 + 6) / MM) | 437 | #define NB_DATA (((SECTOR_SIZE + 1) * 8 + 6) / MM) |
438 | 438 | ||
439 | /* | 439 | /* |
440 | * Correct the errors in 'sector[]' by using 'ecc1[]' which is the | 440 | * Correct the errors in 'sector[]' by using 'ecc1[]' which is the |
441 | * content of the feedback shift register applyied to the sector and | 441 | * content of the feedback shift register applyied to the sector and |
442 | * the ECC. Return the number of errors corrected (and correct them in | 442 | * the ECC. Return the number of errors corrected (and correct them in |
443 | * sector), or -1 if error | 443 | * sector), or -1 if error |
444 | */ | 444 | */ |
445 | int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) | 445 | int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) |
446 | { | 446 | { |
@@ -454,7 +454,7 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) | |||
454 | Alpha_to = kmalloc((NN + 1) * sizeof(dtype), GFP_KERNEL); | 454 | Alpha_to = kmalloc((NN + 1) * sizeof(dtype), GFP_KERNEL); |
455 | if (!Alpha_to) | 455 | if (!Alpha_to) |
456 | return -1; | 456 | return -1; |
457 | 457 | ||
458 | Index_of = kmalloc((NN + 1) * sizeof(dtype), GFP_KERNEL); | 458 | Index_of = kmalloc((NN + 1) * sizeof(dtype), GFP_KERNEL); |
459 | if (!Index_of) { | 459 | if (!Index_of) { |
460 | kfree(Alpha_to); | 460 | kfree(Alpha_to); |
@@ -470,7 +470,7 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) | |||
470 | bb[2] = ((ecc1[2] & 0xf0) >> 4) | ((ecc1[3] & 0x3f) << 4); | 470 | bb[2] = ((ecc1[2] & 0xf0) >> 4) | ((ecc1[3] & 0x3f) << 4); |
471 | bb[3] = ((ecc1[3] & 0xc0) >> 6) | ((ecc1[0] & 0xff) << 2); | 471 | bb[3] = ((ecc1[3] & 0xc0) >> 6) | ((ecc1[0] & 0xff) << 2); |
472 | 472 | ||
473 | nb_errors = eras_dec_rs(Alpha_to, Index_of, bb, | 473 | nb_errors = eras_dec_rs(Alpha_to, Index_of, bb, |
474 | error_val, error_pos, 0); | 474 | error_val, error_pos, 0); |
475 | if (nb_errors <= 0) | 475 | if (nb_errors <= 0) |
476 | goto the_end; | 476 | goto the_end; |
@@ -489,7 +489,7 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) | |||
489 | can be modified since pos is even */ | 489 | can be modified since pos is even */ |
490 | index = (pos >> 3) ^ 1; | 490 | index = (pos >> 3) ^ 1; |
491 | bitpos = pos & 7; | 491 | bitpos = pos & 7; |
492 | if ((index >= 0 && index < SECTOR_SIZE) || | 492 | if ((index >= 0 && index < SECTOR_SIZE) || |
493 | index == (SECTOR_SIZE + 1)) { | 493 | index == (SECTOR_SIZE + 1)) { |
494 | val = error_val[i] >> (2 + bitpos); | 494 | val = error_val[i] >> (2 + bitpos); |
495 | parity ^= val; | 495 | parity ^= val; |
@@ -500,7 +500,7 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) | |||
500 | bitpos = (bitpos + 10) & 7; | 500 | bitpos = (bitpos + 10) & 7; |
501 | if (bitpos == 0) | 501 | if (bitpos == 0) |
502 | bitpos = 8; | 502 | bitpos = 8; |
503 | if ((index >= 0 && index < SECTOR_SIZE) || | 503 | if ((index >= 0 && index < SECTOR_SIZE) || |
504 | index == (SECTOR_SIZE + 1)) { | 504 | index == (SECTOR_SIZE + 1)) { |
505 | val = error_val[i] << (8 - bitpos); | 505 | val = error_val[i] << (8 - bitpos); |
506 | parity ^= val; | 506 | parity ^= val; |
@@ -509,7 +509,7 @@ int doc_decode_ecc(unsigned char sector[SECTOR_SIZE], unsigned char ecc1[6]) | |||
509 | } | 509 | } |
510 | } | 510 | } |
511 | } | 511 | } |
512 | 512 | ||
513 | /* use parity to test extra errors */ | 513 | /* use parity to test extra errors */ |
514 | if ((parity & 0xff) != 0) | 514 | if ((parity & 0xff) != 0) |
515 | nb_errors = -1; | 515 | nb_errors = -1; |
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c index 197d67045e1e..13178b9dd00a 100644 --- a/drivers/mtd/devices/docprobe.c +++ b/drivers/mtd/devices/docprobe.c | |||
@@ -4,22 +4,22 @@ | |||
4 | /* (C) 1999 Machine Vision Holdings, Inc. */ | 4 | /* (C) 1999 Machine Vision Holdings, Inc. */ |
5 | /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> */ | 5 | /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> */ |
6 | 6 | ||
7 | /* $Id: docprobe.c,v 1.44 2005/01/05 12:40:36 dwmw2 Exp $ */ | 7 | /* $Id: docprobe.c,v 1.46 2005/11/07 11:14:25 gleixner Exp $ */ |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | /* DOC_PASSIVE_PROBE: | 11 | /* DOC_PASSIVE_PROBE: |
12 | In order to ensure that the BIOS checksum is correct at boot time, and | 12 | In order to ensure that the BIOS checksum is correct at boot time, and |
13 | hence that the onboard BIOS extension gets executed, the DiskOnChip | 13 | hence that the onboard BIOS extension gets executed, the DiskOnChip |
14 | goes into reset mode when it is read sequentially: all registers | 14 | goes into reset mode when it is read sequentially: all registers |
15 | return 0xff until the chip is woken up again by writing to the | 15 | return 0xff until the chip is woken up again by writing to the |
16 | DOCControl register. | 16 | DOCControl register. |
17 | 17 | ||
18 | Unfortunately, this means that the probe for the DiskOnChip is unsafe, | 18 | Unfortunately, this means that the probe for the DiskOnChip is unsafe, |
19 | because one of the first things it does is write to where it thinks | 19 | because one of the first things it does is write to where it thinks |
20 | the DOCControl register should be - which may well be shared memory | 20 | the DOCControl register should be - which may well be shared memory |
21 | for another device. I've had machines which lock up when this is | 21 | for another device. I've had machines which lock up when this is |
22 | attempted. Hence the possibility to do a passive probe, which will fail | 22 | attempted. Hence the possibility to do a passive probe, which will fail |
23 | to detect a chip in reset mode, but is at least guaranteed not to lock | 23 | to detect a chip in reset mode, but is at least guaranteed not to lock |
24 | the machine. | 24 | the machine. |
25 | 25 | ||
@@ -33,9 +33,9 @@ | |||
33 | 33 | ||
34 | The old Millennium-only driver has been retained just in case there | 34 | The old Millennium-only driver has been retained just in case there |
35 | are problems with the new code. If the combined driver doesn't work | 35 | are problems with the new code. If the combined driver doesn't work |
36 | for you, you can try the old one by undefining DOC_SINGLE_DRIVER | 36 | for you, you can try the old one by undefining DOC_SINGLE_DRIVER |
37 | below and also enabling it in your configuration. If this fixes the | 37 | below and also enabling it in your configuration. If this fixes the |
38 | problems, please send a report to the MTD mailing list at | 38 | problems, please send a report to the MTD mailing list at |
39 | <linux-mtd@lists.infradead.org>. | 39 | <linux-mtd@lists.infradead.org>. |
40 | */ | 40 | */ |
41 | #define DOC_SINGLE_DRIVER | 41 | #define DOC_SINGLE_DRIVER |
@@ -68,16 +68,16 @@ MODULE_PARM_DESC(doc_config_location, "Physical memory address at which to probe | |||
68 | static unsigned long __initdata doc_locations[] = { | 68 | static unsigned long __initdata doc_locations[] = { |
69 | #if defined (__alpha__) || defined(__i386__) || defined(__x86_64__) | 69 | #if defined (__alpha__) || defined(__i386__) || defined(__x86_64__) |
70 | #ifdef CONFIG_MTD_DOCPROBE_HIGH | 70 | #ifdef CONFIG_MTD_DOCPROBE_HIGH |
71 | 0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, | 71 | 0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, |
72 | 0xfffd0000, 0xfffd2000, 0xfffd4000, 0xfffd6000, | 72 | 0xfffd0000, 0xfffd2000, 0xfffd4000, 0xfffd6000, |
73 | 0xfffd8000, 0xfffda000, 0xfffdc000, 0xfffde000, | 73 | 0xfffd8000, 0xfffda000, 0xfffdc000, 0xfffde000, |
74 | 0xfffe0000, 0xfffe2000, 0xfffe4000, 0xfffe6000, | 74 | 0xfffe0000, 0xfffe2000, 0xfffe4000, 0xfffe6000, |
75 | 0xfffe8000, 0xfffea000, 0xfffec000, 0xfffee000, | 75 | 0xfffe8000, 0xfffea000, 0xfffec000, 0xfffee000, |
76 | #else /* CONFIG_MTD_DOCPROBE_HIGH */ | 76 | #else /* CONFIG_MTD_DOCPROBE_HIGH */ |
77 | 0xc8000, 0xca000, 0xcc000, 0xce000, | 77 | 0xc8000, 0xca000, 0xcc000, 0xce000, |
78 | 0xd0000, 0xd2000, 0xd4000, 0xd6000, | 78 | 0xd0000, 0xd2000, 0xd4000, 0xd6000, |
79 | 0xd8000, 0xda000, 0xdc000, 0xde000, | 79 | 0xd8000, 0xda000, 0xdc000, 0xde000, |
80 | 0xe0000, 0xe2000, 0xe4000, 0xe6000, | 80 | 0xe0000, 0xe2000, 0xe4000, 0xe6000, |
81 | 0xe8000, 0xea000, 0xec000, 0xee000, | 81 | 0xe8000, 0xea000, 0xec000, 0xee000, |
82 | #endif /* CONFIG_MTD_DOCPROBE_HIGH */ | 82 | #endif /* CONFIG_MTD_DOCPROBE_HIGH */ |
83 | #elif defined(__PPC__) | 83 | #elif defined(__PPC__) |
@@ -111,35 +111,35 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
111 | return 0; | 111 | return 0; |
112 | #endif /* CONFIG_MTD_DOCPROBE_55AA */ | 112 | #endif /* CONFIG_MTD_DOCPROBE_55AA */ |
113 | 113 | ||
114 | #ifndef DOC_PASSIVE_PROBE | 114 | #ifndef DOC_PASSIVE_PROBE |
115 | /* It's not possible to cleanly detect the DiskOnChip - the | 115 | /* It's not possible to cleanly detect the DiskOnChip - the |
116 | * bootup procedure will put the device into reset mode, and | 116 | * bootup procedure will put the device into reset mode, and |
117 | * it's not possible to talk to it without actually writing | 117 | * it's not possible to talk to it without actually writing |
118 | * to the DOCControl register. So we store the current contents | 118 | * to the DOCControl register. So we store the current contents |
119 | * of the DOCControl register's location, in case we later decide | 119 | * of the DOCControl register's location, in case we later decide |
120 | * that it's not a DiskOnChip, and want to put it back how we | 120 | * that it's not a DiskOnChip, and want to put it back how we |
121 | * found it. | 121 | * found it. |
122 | */ | 122 | */ |
123 | tmp2 = ReadDOC(window, DOCControl); | 123 | tmp2 = ReadDOC(window, DOCControl); |
124 | 124 | ||
125 | /* Reset the DiskOnChip ASIC */ | 125 | /* Reset the DiskOnChip ASIC */ |
126 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, | 126 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, |
127 | window, DOCControl); | 127 | window, DOCControl); |
128 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, | 128 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_RESET, |
129 | window, DOCControl); | 129 | window, DOCControl); |
130 | 130 | ||
131 | /* Enable the DiskOnChip ASIC */ | 131 | /* Enable the DiskOnChip ASIC */ |
132 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, | 132 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, |
133 | window, DOCControl); | 133 | window, DOCControl); |
134 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, | 134 | WriteDOC(DOC_MODE_CLR_ERR | DOC_MODE_MDWREN | DOC_MODE_NORMAL, |
135 | window, DOCControl); | 135 | window, DOCControl); |
136 | #endif /* !DOC_PASSIVE_PROBE */ | 136 | #endif /* !DOC_PASSIVE_PROBE */ |
137 | 137 | ||
138 | /* We need to read the ChipID register four times. For some | 138 | /* We need to read the ChipID register four times. For some |
139 | newer DiskOnChip 2000 units, the first three reads will | 139 | newer DiskOnChip 2000 units, the first three reads will |
140 | return the DiskOnChip Millennium ident. Don't ask. */ | 140 | return the DiskOnChip Millennium ident. Don't ask. */ |
141 | ChipID = ReadDOC(window, ChipID); | 141 | ChipID = ReadDOC(window, ChipID); |
142 | 142 | ||
143 | switch (ChipID) { | 143 | switch (ChipID) { |
144 | case DOC_ChipID_Doc2k: | 144 | case DOC_ChipID_Doc2k: |
145 | /* Check the TOGGLE bit in the ECC register */ | 145 | /* Check the TOGGLE bit in the ECC register */ |
@@ -149,7 +149,7 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
149 | if (tmp != tmpb && tmp == tmpc) | 149 | if (tmp != tmpb && tmp == tmpc) |
150 | return ChipID; | 150 | return ChipID; |
151 | break; | 151 | break; |
152 | 152 | ||
153 | case DOC_ChipID_DocMil: | 153 | case DOC_ChipID_DocMil: |
154 | /* Check for the new 2000 with Millennium ASIC */ | 154 | /* Check for the new 2000 with Millennium ASIC */ |
155 | ReadDOC(window, ChipID); | 155 | ReadDOC(window, ChipID); |
@@ -164,7 +164,7 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
164 | if (tmp != tmpb && tmp == tmpc) | 164 | if (tmp != tmpb && tmp == tmpc) |
165 | return ChipID; | 165 | return ChipID; |
166 | break; | 166 | break; |
167 | 167 | ||
168 | case DOC_ChipID_DocMilPlus16: | 168 | case DOC_ChipID_DocMilPlus16: |
169 | case DOC_ChipID_DocMilPlus32: | 169 | case DOC_ChipID_DocMilPlus32: |
170 | case 0: | 170 | case 0: |
@@ -179,7 +179,7 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
179 | DOC_MODE_BDECT; | 179 | DOC_MODE_BDECT; |
180 | WriteDOC(tmp, window, Mplus_DOCControl); | 180 | WriteDOC(tmp, window, Mplus_DOCControl); |
181 | WriteDOC(~tmp, window, Mplus_CtrlConfirm); | 181 | WriteDOC(~tmp, window, Mplus_CtrlConfirm); |
182 | 182 | ||
183 | mdelay(1); | 183 | mdelay(1); |
184 | /* Enable the DiskOnChip ASIC */ | 184 | /* Enable the DiskOnChip ASIC */ |
185 | tmp = DOC_MODE_NORMAL | DOC_MODE_MDWREN | DOC_MODE_RST_LAT | | 185 | tmp = DOC_MODE_NORMAL | DOC_MODE_MDWREN | DOC_MODE_RST_LAT | |
@@ -187,7 +187,7 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
187 | WriteDOC(tmp, window, Mplus_DOCControl); | 187 | WriteDOC(tmp, window, Mplus_DOCControl); |
188 | WriteDOC(~tmp, window, Mplus_CtrlConfirm); | 188 | WriteDOC(~tmp, window, Mplus_CtrlConfirm); |
189 | mdelay(1); | 189 | mdelay(1); |
190 | #endif /* !DOC_PASSIVE_PROBE */ | 190 | #endif /* !DOC_PASSIVE_PROBE */ |
191 | 191 | ||
192 | ChipID = ReadDOC(window, ChipID); | 192 | ChipID = ReadDOC(window, ChipID); |
193 | 193 | ||
@@ -227,7 +227,7 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
227 | WriteDOC(tmp2, window, DOCControl); | 227 | WriteDOC(tmp2, window, DOCControl); |
228 | #endif | 228 | #endif |
229 | return 0; | 229 | return 0; |
230 | } | 230 | } |
231 | 231 | ||
232 | static int docfound; | 232 | static int docfound; |
233 | 233 | ||
@@ -244,10 +244,10 @@ static void __init DoC_Probe(unsigned long physadr) | |||
244 | void (*initroutine)(struct mtd_info *) = NULL; | 244 | void (*initroutine)(struct mtd_info *) = NULL; |
245 | 245 | ||
246 | docptr = ioremap(physadr, DOC_IOREMAP_LEN); | 246 | docptr = ioremap(physadr, DOC_IOREMAP_LEN); |
247 | 247 | ||
248 | if (!docptr) | 248 | if (!docptr) |
249 | return; | 249 | return; |
250 | 250 | ||
251 | if ((ChipID = doccheck(docptr, physadr))) { | 251 | if ((ChipID = doccheck(docptr, physadr))) { |
252 | if (ChipID == DOC_ChipID_Doc2kTSOP) { | 252 | if (ChipID == DOC_ChipID_Doc2kTSOP) { |
253 | /* Remove this at your own peril. The hardware driver works but nothing prevents you from erasing bad blocks */ | 253 | /* Remove this at your own peril. The hardware driver works but nothing prevents you from erasing bad blocks */ |
@@ -263,9 +263,9 @@ static void __init DoC_Probe(unsigned long physadr) | |||
263 | iounmap(docptr); | 263 | iounmap(docptr); |
264 | return; | 264 | return; |
265 | } | 265 | } |
266 | 266 | ||
267 | this = (struct DiskOnChip *)(&mtd[1]); | 267 | this = (struct DiskOnChip *)(&mtd[1]); |
268 | 268 | ||
269 | memset((char *)mtd,0, sizeof(struct mtd_info)); | 269 | memset((char *)mtd,0, sizeof(struct mtd_info)); |
270 | memset((char *)this, 0, sizeof(struct DiskOnChip)); | 270 | memset((char *)this, 0, sizeof(struct DiskOnChip)); |
271 | 271 | ||
@@ -281,13 +281,13 @@ static void __init DoC_Probe(unsigned long physadr) | |||
281 | im_funcname = "DoC2k_init"; | 281 | im_funcname = "DoC2k_init"; |
282 | im_modname = "doc2000"; | 282 | im_modname = "doc2000"; |
283 | break; | 283 | break; |
284 | 284 | ||
285 | case DOC_ChipID_Doc2k: | 285 | case DOC_ChipID_Doc2k: |
286 | name="2000"; | 286 | name="2000"; |
287 | im_funcname = "DoC2k_init"; | 287 | im_funcname = "DoC2k_init"; |
288 | im_modname = "doc2000"; | 288 | im_modname = "doc2000"; |
289 | break; | 289 | break; |
290 | 290 | ||
291 | case DOC_ChipID_DocMil: | 291 | case DOC_ChipID_DocMil: |
292 | name="Millennium"; | 292 | name="Millennium"; |
293 | #ifdef DOC_SINGLE_DRIVER | 293 | #ifdef DOC_SINGLE_DRIVER |
@@ -331,7 +331,7 @@ static void __init DoC_Probe(unsigned long physadr) | |||
331 | static int __init init_doc(void) | 331 | static int __init init_doc(void) |
332 | { | 332 | { |
333 | int i; | 333 | int i; |
334 | 334 | ||
335 | if (doc_config_location) { | 335 | if (doc_config_location) { |
336 | printk(KERN_INFO "Using configured DiskOnChip probe address 0x%lx\n", doc_config_location); | 336 | printk(KERN_INFO "Using configured DiskOnChip probe address 0x%lx\n", doc_config_location); |
337 | DoC_Probe(doc_config_location); | 337 | DoC_Probe(doc_config_location); |
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index df987a53ed9c..1e876fcb0408 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c | |||
@@ -2,7 +2,7 @@ | |||
2 | /* | 2 | /* |
3 | * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. | 3 | * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. |
4 | * | 4 | * |
5 | * $Id: lart.c,v 1.7 2004/08/09 13:19:44 dwmw2 Exp $ | 5 | * $Id: lart.c,v 1.9 2005/11/07 11:14:25 gleixner Exp $ |
6 | * | 6 | * |
7 | * Author: Abraham vd Merwe <abraham@2d3d.co.za> | 7 | * Author: Abraham vd Merwe <abraham@2d3d.co.za> |
8 | * | 8 | * |
@@ -122,7 +122,7 @@ static char module_name[] = "lart"; | |||
122 | 122 | ||
123 | /* | 123 | /* |
124 | * The data line mapping on LART is as follows: | 124 | * The data line mapping on LART is as follows: |
125 | * | 125 | * |
126 | * U2 CPU | U3 CPU | 126 | * U2 CPU | U3 CPU |
127 | * ------------------- | 127 | * ------------------- |
128 | * 0 20 | 0 12 | 128 | * 0 20 | 0 12 |
@@ -181,7 +181,7 @@ static char module_name[] = "lart"; | |||
181 | (((x) & 0x00004000) >> 13) \ | 181 | (((x) & 0x00004000) >> 13) \ |
182 | ) | 182 | ) |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * The address line mapping on LART is as follows: | 185 | * The address line mapping on LART is as follows: |
186 | * | 186 | * |
187 | * U3 CPU | U2 CPU | 187 | * U3 CPU | U2 CPU |
@@ -204,7 +204,7 @@ static char module_name[] = "lart"; | |||
204 | * 12 15 | 12 15 | 204 | * 12 15 | 12 15 |
205 | * 13 14 | 13 14 | 205 | * 13 14 | 13 14 |
206 | * 14 16 | 14 16 | 206 | * 14 16 | 14 16 |
207 | * | 207 | * |
208 | * MAIN BLOCK BOUNDARY | 208 | * MAIN BLOCK BOUNDARY |
209 | * | 209 | * |
210 | * 15 17 | 15 18 | 210 | * 15 17 | 15 18 |
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c index 765c0179c8df..e8685ee6c1e4 100644 --- a/drivers/mtd/devices/phram.c +++ b/drivers/mtd/devices/phram.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * $Id: phram.c,v 1.14 2005/03/07 21:43:38 joern Exp $ | 2 | * $Id: phram.c,v 1.16 2005/11/07 11:14:25 gleixner Exp $ |
3 | * | 3 | * |
4 | * Copyright (c) ???? Jochen Schäuble <psionic@psionic.de> | 4 | * Copyright (c) ???? Jochen Schäuble <psionic@psionic.de> |
5 | * Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de> | 5 | * Copyright (c) 2003-2004 Jörn Engel <joern@wh.fh-wedel.de> |
@@ -41,10 +41,10 @@ static int phram_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
41 | 41 | ||
42 | if (instr->addr + instr->len > mtd->size) | 42 | if (instr->addr + instr->len > mtd->size) |
43 | return -EINVAL; | 43 | return -EINVAL; |
44 | 44 | ||
45 | memset(start + instr->addr, 0xff, instr->len); | 45 | memset(start + instr->addr, 0xff, instr->len); |
46 | 46 | ||
47 | /* This'll catch a few races. Free the thing before returning :) | 47 | /* This'll catch a few races. Free the thing before returning :) |
48 | * I don't feel at all ashamed. This kind of thing is possible anyway | 48 | * I don't feel at all ashamed. This kind of thing is possible anyway |
49 | * with flash, but unlikely. | 49 | * with flash, but unlikely. |
50 | */ | 50 | */ |
@@ -63,7 +63,7 @@ static int phram_point(struct mtd_info *mtd, loff_t from, size_t len, | |||
63 | 63 | ||
64 | if (from + len > mtd->size) | 64 | if (from + len > mtd->size) |
65 | return -EINVAL; | 65 | return -EINVAL; |
66 | 66 | ||
67 | *mtdbuf = start + from; | 67 | *mtdbuf = start + from; |
68 | *retlen = len; | 68 | *retlen = len; |
69 | return 0; | 69 | return 0; |
@@ -84,7 +84,7 @@ static int phram_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
84 | 84 | ||
85 | if (len > mtd->size - from) | 85 | if (len > mtd->size - from) |
86 | len = mtd->size - from; | 86 | len = mtd->size - from; |
87 | 87 | ||
88 | memcpy(buf, start + from, len); | 88 | memcpy(buf, start + from, len); |
89 | 89 | ||
90 | *retlen = len; | 90 | *retlen = len; |
@@ -101,7 +101,7 @@ static int phram_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
101 | 101 | ||
102 | if (len > mtd->size - to) | 102 | if (len > mtd->size - to) |
103 | len = mtd->size - to; | 103 | len = mtd->size - to; |
104 | 104 | ||
105 | memcpy(start + to, buf, len); | 105 | memcpy(start + to, buf, len); |
106 | 106 | ||
107 | *retlen = len; | 107 | *retlen = len; |
@@ -159,7 +159,7 @@ static int register_device(char *name, unsigned long start, unsigned long len) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | list_add_tail(&new->list, &phram_list); | 161 | list_add_tail(&new->list, &phram_list); |
162 | return 0; | 162 | return 0; |
163 | 163 | ||
164 | out2: | 164 | out2: |
165 | iounmap(new->mtd.priv); | 165 | iounmap(new->mtd.priv); |
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 5b3defadf884..de48b35f5609 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: pmc551.c,v 1.30 2005/01/05 18:05:13 dwmw2 Exp $ | 2 | * $Id: pmc551.c,v 1.32 2005/11/07 11:14:25 gleixner Exp $ |
3 | * | 3 | * |
4 | * PMC551 PCI Mezzanine Ram Device | 4 | * PMC551 PCI Mezzanine Ram Device |
5 | * | 5 | * |
@@ -27,7 +27,7 @@ | |||
27 | * it as high speed swap or for a high speed disk device of some | 27 | * it as high speed swap or for a high speed disk device of some |
28 | * sort. Which becomes very useful on diskless systems in the | 28 | * sort. Which becomes very useful on diskless systems in the |
29 | * embedded market I might add. | 29 | * embedded market I might add. |
30 | * | 30 | * |
31 | * Notes: | 31 | * Notes: |
32 | * Due to what I assume is more buggy SROM, the 64M PMC551 I | 32 | * Due to what I assume is more buggy SROM, the 64M PMC551 I |
33 | * have available claims that all 4 of it's DRAM banks have 64M | 33 | * have available claims that all 4 of it's DRAM banks have 64M |
@@ -63,10 +63,10 @@ | |||
63 | * Minyard set up the card to utilize a 1M sliding apature. | 63 | * Minyard set up the card to utilize a 1M sliding apature. |
64 | * | 64 | * |
65 | * Corey Minyard <minyard@nortelnetworks.com> | 65 | * Corey Minyard <minyard@nortelnetworks.com> |
66 | * * Modified driver to utilize a sliding aperture instead of | 66 | * * Modified driver to utilize a sliding aperture instead of |
67 | * mapping all memory into kernel space which turned out to | 67 | * mapping all memory into kernel space which turned out to |
68 | * be very wasteful. | 68 | * be very wasteful. |
69 | * * Located a bug in the SROM's initialization sequence that | 69 | * * Located a bug in the SROM's initialization sequence that |
70 | * made the memory unusable, added a fix to code to touch up | 70 | * made the memory unusable, added a fix to code to touch up |
71 | * the DRAM some. | 71 | * the DRAM some. |
72 | * | 72 | * |
@@ -390,7 +390,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) | |||
390 | bcmd |= (0x40|0x20); | 390 | bcmd |= (0x40|0x20); |
391 | pci_write_config_byte(dev, PMC551_SYS_CTRL_REG, bcmd); | 391 | pci_write_config_byte(dev, PMC551_SYS_CTRL_REG, bcmd); |
392 | 392 | ||
393 | /* | 393 | /* |
394 | * Take care and turn off the memory on the device while we | 394 | * Take care and turn off the memory on the device while we |
395 | * tweak the configurations | 395 | * tweak the configurations |
396 | */ | 396 | */ |
@@ -408,7 +408,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) | |||
408 | * Grab old BAR0 config so that we can figure out memory size | 408 | * Grab old BAR0 config so that we can figure out memory size |
409 | * This is another bit of kludge going on. The reason for the | 409 | * This is another bit of kludge going on. The reason for the |
410 | * redundancy is I am hoping to retain the original configuration | 410 | * redundancy is I am hoping to retain the original configuration |
411 | * previously assigned to the card by the BIOS or some previous | 411 | * previously assigned to the card by the BIOS or some previous |
412 | * fixup routine in the kernel. So we read the old config into cfg, | 412 | * fixup routine in the kernel. So we read the old config into cfg, |
413 | * then write all 1's to the memory space, read back the result into | 413 | * then write all 1's to the memory space, read back the result into |
414 | * "size", and then write back all the old config. | 414 | * "size", and then write back all the old config. |
@@ -480,7 +480,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) | |||
480 | } while ( (PCI_COMMAND_IO) & cmd ); | 480 | } while ( (PCI_COMMAND_IO) & cmd ); |
481 | 481 | ||
482 | /* | 482 | /* |
483 | * Turn on auto refresh | 483 | * Turn on auto refresh |
484 | * The loop is taken directly from Ramix's example code. I assume that | 484 | * The loop is taken directly from Ramix's example code. I assume that |
485 | * this must be held high for some duration of time, but I can find no | 485 | * this must be held high for some duration of time, but I can find no |
486 | * documentation refrencing the reasons why. | 486 | * documentation refrencing the reasons why. |
@@ -615,7 +615,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev) | |||
615 | pci_read_config_byte(dev, PMC551_SYS_CTRL_REG, &bcmd ); | 615 | pci_read_config_byte(dev, PMC551_SYS_CTRL_REG, &bcmd ); |
616 | printk( KERN_DEBUG "pmc551: EEPROM is under %s control\n" | 616 | printk( KERN_DEBUG "pmc551: EEPROM is under %s control\n" |
617 | "pmc551: System Control Register is %slocked to PCI access\n" | 617 | "pmc551: System Control Register is %slocked to PCI access\n" |
618 | "pmc551: System Control Register is %slocked to EEPROM access\n", | 618 | "pmc551: System Control Register is %slocked to EEPROM access\n", |
619 | (bcmd&0x1)?"software":"hardware", | 619 | (bcmd&0x1)?"software":"hardware", |
620 | (bcmd&0x20)?"":"un", (bcmd&0x40)?"":"un"); | 620 | (bcmd&0x20)?"":"un", (bcmd&0x40)?"":"un"); |
621 | #endif | 621 | #endif |
@@ -744,7 +744,7 @@ static int __init init_pmc551(void) | |||
744 | priv->start = ioremap(((PCI_Device->resource[0].start) | 744 | priv->start = ioremap(((PCI_Device->resource[0].start) |
745 | & PCI_BASE_ADDRESS_MEM_MASK), | 745 | & PCI_BASE_ADDRESS_MEM_MASK), |
746 | priv->asize); | 746 | priv->asize); |
747 | 747 | ||
748 | if (!priv->start) { | 748 | if (!priv->start) { |
749 | printk(KERN_NOTICE "pmc551: Unable to map IO space\n"); | 749 | printk(KERN_NOTICE "pmc551: Unable to map IO space\n"); |
750 | kfree(mtd->priv); | 750 | kfree(mtd->priv); |
@@ -765,7 +765,7 @@ static int __init init_pmc551(void) | |||
765 | priv->curr_map0 ); | 765 | priv->curr_map0 ); |
766 | 766 | ||
767 | #ifdef CONFIG_MTD_PMC551_DEBUG | 767 | #ifdef CONFIG_MTD_PMC551_DEBUG |
768 | printk( KERN_DEBUG "pmc551: aperture set to %d\n", | 768 | printk( KERN_DEBUG "pmc551: aperture set to %d\n", |
769 | (priv->base_map0 & 0xF0)>>4 ); | 769 | (priv->base_map0 & 0xF0)>>4 ); |
770 | #endif | 770 | #endif |
771 | 771 | ||
@@ -823,13 +823,13 @@ static void __exit cleanup_pmc551(void) | |||
823 | while((mtd=pmc551list)) { | 823 | while((mtd=pmc551list)) { |
824 | priv = mtd->priv; | 824 | priv = mtd->priv; |
825 | pmc551list = priv->nextpmc551; | 825 | pmc551list = priv->nextpmc551; |
826 | 826 | ||
827 | if(priv->start) { | 827 | if(priv->start) { |
828 | printk (KERN_DEBUG "pmc551: unmapping %dM starting at 0x%p\n", | 828 | printk (KERN_DEBUG "pmc551: unmapping %dM starting at 0x%p\n", |
829 | priv->asize>>20, priv->start); | 829 | priv->asize>>20, priv->start); |
830 | iounmap (priv->start); | 830 | iounmap (priv->start); |
831 | } | 831 | } |
832 | 832 | ||
833 | kfree (mtd->priv); | 833 | kfree (mtd->priv); |
834 | del_mtd_device (mtd); | 834 | del_mtd_device (mtd); |
835 | kfree (mtd); | 835 | kfree (mtd); |
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index 84fa91392a8c..6faee6c6958c 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /*====================================================================== | 1 | /*====================================================================== |
2 | 2 | ||
3 | $Id: slram.c,v 1.34 2005/01/06 21:16:42 jwboyer Exp $ | 3 | $Id: slram.c,v 1.36 2005/11/07 11:14:25 gleixner Exp $ |
4 | 4 | ||
5 | This driver provides a method to access memory not used by the kernel | 5 | This driver provides a method to access memory not used by the kernel |
6 | itself (i.e. if the kernel commandline mem=xxx is used). To actually | 6 | itself (i.e. if the kernel commandline mem=xxx is used). To actually |
@@ -18,14 +18,14 @@ | |||
18 | <start>: start of the memory region, decimal or hex (0xabcdef) | 18 | <start>: start of the memory region, decimal or hex (0xabcdef) |
19 | <end/offset>: end of the memory region. It's possible to use +0x1234 | 19 | <end/offset>: end of the memory region. It's possible to use +0x1234 |
20 | to specify the offset instead of the absolute address | 20 | to specify the offset instead of the absolute address |
21 | 21 | ||
22 | NOTE: | 22 | NOTE: |
23 | With slram it's only possible to map a contigous memory region. Therfore | 23 | With slram it's only possible to map a contigous memory region. Therfore |
24 | if there's a device mapped somewhere in the region specified slram will | 24 | if there's a device mapped somewhere in the region specified slram will |
25 | fail to load (see kernel log if modprobe fails). | 25 | fail to load (see kernel log if modprobe fails). |
26 | 26 | ||
27 | - | 27 | - |
28 | 28 | ||
29 | Jochen Schaeuble <psionic@psionic.de> | 29 | Jochen Schaeuble <psionic@psionic.de> |
30 | 30 | ||
31 | ======================================================================*/ | 31 | ======================================================================*/ |
@@ -89,10 +89,10 @@ static int slram_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
89 | if (instr->addr + instr->len > mtd->size) { | 89 | if (instr->addr + instr->len > mtd->size) { |
90 | return(-EINVAL); | 90 | return(-EINVAL); |
91 | } | 91 | } |
92 | 92 | ||
93 | memset(priv->start + instr->addr, 0xff, instr->len); | 93 | memset(priv->start + instr->addr, 0xff, instr->len); |
94 | 94 | ||
95 | /* This'll catch a few races. Free the thing before returning :) | 95 | /* This'll catch a few races. Free the thing before returning :) |
96 | * I don't feel at all ashamed. This kind of thing is possible anyway | 96 | * I don't feel at all ashamed. This kind of thing is possible anyway |
97 | * with flash, but unlikely. | 97 | * with flash, but unlikely. |
98 | */ | 98 | */ |
@@ -170,12 +170,12 @@ static int register_device(char *name, unsigned long start, unsigned long length | |||
170 | } | 170 | } |
171 | (*curmtd)->mtdinfo = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); | 171 | (*curmtd)->mtdinfo = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); |
172 | (*curmtd)->next = NULL; | 172 | (*curmtd)->next = NULL; |
173 | 173 | ||
174 | if ((*curmtd)->mtdinfo) { | 174 | if ((*curmtd)->mtdinfo) { |
175 | memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info)); | 175 | memset((char *)(*curmtd)->mtdinfo, 0, sizeof(struct mtd_info)); |
176 | (*curmtd)->mtdinfo->priv = | 176 | (*curmtd)->mtdinfo->priv = |
177 | kmalloc(sizeof(slram_priv_t), GFP_KERNEL); | 177 | kmalloc(sizeof(slram_priv_t), GFP_KERNEL); |
178 | 178 | ||
179 | if (!(*curmtd)->mtdinfo->priv) { | 179 | if (!(*curmtd)->mtdinfo->priv) { |
180 | kfree((*curmtd)->mtdinfo); | 180 | kfree((*curmtd)->mtdinfo); |
181 | (*curmtd)->mtdinfo = NULL; | 181 | (*curmtd)->mtdinfo = NULL; |
@@ -188,7 +188,7 @@ static int register_device(char *name, unsigned long start, unsigned long length | |||
188 | E("slram: Cannot allocate new MTD device.\n"); | 188 | E("slram: Cannot allocate new MTD device.\n"); |
189 | return(-ENOMEM); | 189 | return(-ENOMEM); |
190 | } | 190 | } |
191 | 191 | ||
192 | if (!(((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start = | 192 | if (!(((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start = |
193 | ioremap(start, length))) { | 193 | ioremap(start, length))) { |
194 | E("slram: ioremap failed\n"); | 194 | E("slram: ioremap failed\n"); |
@@ -223,7 +223,7 @@ static int register_device(char *name, unsigned long start, unsigned long length | |||
223 | T("slram: Mapped from 0x%p to 0x%p\n", | 223 | T("slram: Mapped from 0x%p to 0x%p\n", |
224 | ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start, | 224 | ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start, |
225 | ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->end); | 225 | ((slram_priv_t *)(*curmtd)->mtdinfo->priv)->end); |
226 | return(0); | 226 | return(0); |
227 | } | 227 | } |
228 | 228 | ||
229 | static void unregister_devices(void) | 229 | static void unregister_devices(void) |
@@ -256,7 +256,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength) | |||
256 | char *buffer; | 256 | char *buffer; |
257 | unsigned long devstart; | 257 | unsigned long devstart; |
258 | unsigned long devlength; | 258 | unsigned long devlength; |
259 | 259 | ||
260 | if ((!devname) || (!szstart) || (!szlength)) { | 260 | if ((!devname) || (!szstart) || (!szlength)) { |
261 | unregister_devices(); | 261 | unregister_devices(); |
262 | return(-EINVAL); | 262 | return(-EINVAL); |
@@ -264,7 +264,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength) | |||
264 | 264 | ||
265 | devstart = simple_strtoul(szstart, &buffer, 0); | 265 | devstart = simple_strtoul(szstart, &buffer, 0); |
266 | devstart = handle_unit(devstart, buffer); | 266 | devstart = handle_unit(devstart, buffer); |
267 | 267 | ||
268 | if (*(szlength) != '+') { | 268 | if (*(szlength) != '+') { |
269 | devlength = simple_strtoul(szlength, &buffer, 0); | 269 | devlength = simple_strtoul(szlength, &buffer, 0); |
270 | devlength = handle_unit(devlength, buffer) - devstart; | 270 | devlength = handle_unit(devlength, buffer) - devstart; |
@@ -278,7 +278,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength) | |||
278 | E("slram: Illegal start / length parameter.\n"); | 278 | E("slram: Illegal start / length parameter.\n"); |
279 | return(-EINVAL); | 279 | return(-EINVAL); |
280 | } | 280 | } |
281 | 281 | ||
282 | if ((devstart = register_device(devname, devstart, devlength))){ | 282 | if ((devstart = register_device(devname, devstart, devlength))){ |
283 | unregister_devices(); | 283 | unregister_devices(); |
284 | return((int)devstart); | 284 | return((int)devstart); |
@@ -335,7 +335,7 @@ static int init_slram(void) | |||
335 | } | 335 | } |
336 | #else | 336 | #else |
337 | int count; | 337 | int count; |
338 | 338 | ||
339 | for (count = 0; (map[count]) && (count < SLRAM_MAX_DEVICES_PARAMS); | 339 | for (count = 0; (map[count]) && (count < SLRAM_MAX_DEVICES_PARAMS); |
340 | count++) { | 340 | count++) { |
341 | } | 341 | } |
@@ -350,10 +350,10 @@ static int init_slram(void) | |||
350 | if (parse_cmdline(devname, map[i * 3 + 1], map[i * 3 + 2])!=0) { | 350 | if (parse_cmdline(devname, map[i * 3 + 1], map[i * 3 + 2])!=0) { |
351 | return(-EINVAL); | 351 | return(-EINVAL); |
352 | } | 352 | } |
353 | 353 | ||
354 | } | 354 | } |
355 | #endif /* !MODULE */ | 355 | #endif /* !MODULE */ |
356 | 356 | ||
357 | return(0); | 357 | return(0); |
358 | } | 358 | } |
359 | 359 | ||