aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-09-17 12:17:19 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-09-17 12:19:31 -0400
commit9b4f2e9576658c4e52d95dc8d309f51b2e2db096 (patch)
tree7b1902b0f931783fccc6fee45c6f9c16b4fde5ce /drivers/mtd/nand
parent3c6c65f5ed5a6d307bd607aecd06d658c0934d88 (diff)
parent803db244b9f71102e366fd689000c1417b9a7508 (diff)
ieee1394: merge from Linus
Conflicts: drivers/ieee1394/hosts.c Patch "lockdep: annotate ieee1394 skb-queue-head locking" was meddling with patch "ieee1394: fix kerneldoc of hpsb_alloc_host". Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/ams-delta.c10
-rw-r--r--drivers/mtd/nand/nand_base.c26
-rw-r--r--drivers/mtd/nand/nand_ecc.c3
-rw-r--r--drivers/mtd/nand/sharpsl.c7
4 files changed, 21 insertions, 25 deletions
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index d7897dc6b3c8..a0ba07c36ee9 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -130,11 +130,13 @@ static void ams_delta_hwcontrol(struct mtd_info *mtd, int cmd,
130 if (ctrl & NAND_CTRL_CHANGE) { 130 if (ctrl & NAND_CTRL_CHANGE) {
131 unsigned long bits; 131 unsigned long bits;
132 132
133 bits = (~ctrl & NAND_NCE) << 2; 133 bits = (~ctrl & NAND_NCE) ? AMS_DELTA_LATCH2_NAND_NCE : 0;
134 bits |= (ctrl & NAND_CLE) << 7; 134 bits |= (ctrl & NAND_CLE) ? AMS_DELTA_LATCH2_NAND_CLE : 0;
135 bits |= (ctrl & NAND_ALE) << 6; 135 bits |= (ctrl & NAND_ALE) ? AMS_DELTA_LATCH2_NAND_ALE : 0;
136 136
137 ams_delta_latch2_write(0xC2, bits); 137 ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_CLE |
138 AMS_DELTA_LATCH2_NAND_ALE |
139 AMS_DELTA_LATCH2_NAND_NCE, bits);
138 } 140 }
139 141
140 if (cmd != NAND_CMD_NONE) 142 if (cmd != NAND_CMD_NONE)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 80a76654d963..0a54d003ef34 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -155,7 +155,7 @@ static u16 nand_read_word(struct mtd_info *mtd)
155/** 155/**
156 * nand_select_chip - [DEFAULT] control CE line 156 * nand_select_chip - [DEFAULT] control CE line
157 * @mtd: MTD device structure 157 * @mtd: MTD device structure
158 * @chip: chipnumber to select, -1 for deselect 158 * @chipnr: chipnumber to select, -1 for deselect
159 * 159 *
160 * Default select function for 1 chip devices. 160 * Default select function for 1 chip devices.
161 */ 161 */
@@ -542,7 +542,6 @@ static void nand_command(struct mtd_info *mtd, unsigned int command,
542 * Send command to NAND device. This is the version for the new large page 542 * Send command to NAND device. This is the version for the new large page
543 * devices We dont have the separate regions as we have in the small page 543 * devices We dont have the separate regions as we have in the small page
544 * devices. We must emulate NAND_CMD_READOOB to keep the code compatible. 544 * devices. We must emulate NAND_CMD_READOOB to keep the code compatible.
545 *
546 */ 545 */
547static void nand_command_lp(struct mtd_info *mtd, unsigned int command, 546static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
548 int column, int page_addr) 547 int column, int page_addr)
@@ -656,7 +655,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
656 655
657/** 656/**
658 * nand_get_device - [GENERIC] Get chip for selected access 657 * nand_get_device - [GENERIC] Get chip for selected access
659 * @this: the nand chip descriptor 658 * @chip: the nand chip descriptor
660 * @mtd: MTD device structure 659 * @mtd: MTD device structure
661 * @new_state: the state which is requested 660 * @new_state: the state which is requested
662 * 661 *
@@ -696,13 +695,12 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state)
696/** 695/**
697 * nand_wait - [DEFAULT] wait until the command is done 696 * nand_wait - [DEFAULT] wait until the command is done
698 * @mtd: MTD device structure 697 * @mtd: MTD device structure
699 * @this: NAND chip structure 698 * @chip: NAND chip structure
700 * 699 *
701 * Wait for command done. This applies to erase and program only 700 * Wait for command done. This applies to erase and program only
702 * Erase can take up to 400ms and program up to 20ms according to 701 * Erase can take up to 400ms and program up to 20ms according to
703 * general NAND and SmartMedia specs 702 * general NAND and SmartMedia specs
704 * 703 */
705*/
706static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip) 704static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
707{ 705{
708 706
@@ -896,6 +894,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
896/** 894/**
897 * nand_transfer_oob - [Internal] Transfer oob to client buffer 895 * nand_transfer_oob - [Internal] Transfer oob to client buffer
898 * @chip: nand chip structure 896 * @chip: nand chip structure
897 * @oob: oob destination address
899 * @ops: oob ops structure 898 * @ops: oob ops structure
900 */ 899 */
901static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, 900static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
@@ -946,6 +945,7 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
946 * 945 *
947 * @mtd: MTD device structure 946 * @mtd: MTD device structure
948 * @from: offset to read from 947 * @from: offset to read from
948 * @ops: oob ops structure
949 * 949 *
950 * Internal function. Called with chip held. 950 * Internal function. Called with chip held.
951 */ 951 */
@@ -1093,9 +1093,10 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
1093 1093
1094 ret = nand_do_read_ops(mtd, from, &chip->ops); 1094 ret = nand_do_read_ops(mtd, from, &chip->ops);
1095 1095
1096 *retlen = chip->ops.retlen;
1097
1096 nand_release_device(mtd); 1098 nand_release_device(mtd);
1097 1099
1098 *retlen = chip->ops.retlen;
1099 return ret; 1100 return ret;
1100} 1101}
1101 1102
@@ -1203,7 +1204,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,
1203 pos = steps * (eccsize + chunk); 1204 pos = steps * (eccsize + chunk);
1204 steps = 0; 1205 steps = 0;
1205 } else 1206 } else
1206 pos = eccsize + chunk; 1207 pos = eccsize;
1207 1208
1208 chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); 1209 chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
1209 for (i = 0; i < steps; i++) { 1210 for (i = 0; i < steps; i++) {
@@ -1566,7 +1567,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob,
1566 bytes = min_t(size_t, len, free->length); 1567 bytes = min_t(size_t, len, free->length);
1567 boffs = free->offset; 1568 boffs = free->offset;
1568 } 1569 }
1569 memcpy(chip->oob_poi + woffs, oob, bytes); 1570 memcpy(chip->oob_poi + boffs, oob, bytes);
1570 oob += bytes; 1571 oob += bytes;
1571 } 1572 }
1572 return oob; 1573 return oob;
@@ -1691,9 +1692,10 @@ static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
1691 1692
1692 ret = nand_do_write_ops(mtd, to, &chip->ops); 1693 ret = nand_do_write_ops(mtd, to, &chip->ops);
1693 1694
1695 *retlen = chip->ops.retlen;
1696
1694 nand_release_device(mtd); 1697 nand_release_device(mtd);
1695 1698
1696 *retlen = chip->ops.retlen;
1697 return ret; 1699 return ret;
1698} 1700}
1699 1701
@@ -1760,7 +1762,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
1760/** 1762/**
1761 * nand_write_oob - [MTD Interface] NAND write data and/or out-of-band 1763 * nand_write_oob - [MTD Interface] NAND write data and/or out-of-band
1762 * @mtd: MTD device structure 1764 * @mtd: MTD device structure
1763 * @from: offset to read from 1765 * @to: offset to write to
1764 * @ops: oob operation description structure 1766 * @ops: oob operation description structure
1765 */ 1767 */
1766static int nand_write_oob(struct mtd_info *mtd, loff_t to, 1768static int nand_write_oob(struct mtd_info *mtd, loff_t to,
@@ -2055,7 +2057,7 @@ static void nand_sync(struct mtd_info *mtd)
2055/** 2057/**
2056 * nand_block_isbad - [MTD Interface] Check if block at offset is bad 2058 * nand_block_isbad - [MTD Interface] Check if block at offset is bad
2057 * @mtd: MTD device structure 2059 * @mtd: MTD device structure
2058 * @ofs: offset relative to mtd start 2060 * @offs: offset relative to mtd start
2059 */ 2061 */
2060static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) 2062static int nand_block_isbad(struct mtd_info *mtd, loff_t offs)
2061{ 2063{
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index 2a163e4084df..dd438ca47d9a 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -65,8 +65,7 @@ static const u_char nand_ecc_precalc_table[] = {
65}; 65};
66 66
67/** 67/**
68 * nand_calculate_ecc - [NAND Interface] Calculate 3 byte ECC code 68 * nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256-byte block
69 * for 256 byte block
70 * @mtd: MTD block structure 69 * @mtd: MTD block structure
71 * @dat: raw data 70 * @dat: raw data
72 * @ecc_code: buffer for ECC 71 * @ecc_code: buffer for ECC
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c
index 21743658d150..fbeedc3184e9 100644
--- a/drivers/mtd/nand/sharpsl.c
+++ b/drivers/mtd/nand/sharpsl.c
@@ -237,11 +237,6 @@ static int __init sharpsl_nand_init(void)
237 } 237 }
238 } 238 }
239 239
240 if (machine_is_husky() || machine_is_borzoi() || machine_is_akita()) {
241 /* Need to use small eraseblock size for backward compatibility */
242 sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS;
243 }
244
245 add_mtd_partitions(sharpsl_mtd, sharpsl_partition_info, nr_partitions); 240 add_mtd_partitions(sharpsl_mtd, sharpsl_partition_info, nr_partitions);
246 241
247 /* Return happy */ 242 /* Return happy */
@@ -255,8 +250,6 @@ module_init(sharpsl_nand_init);
255 */ 250 */
256static void __exit sharpsl_nand_cleanup(void) 251static void __exit sharpsl_nand_cleanup(void)
257{ 252{
258 struct nand_chip *this = (struct nand_chip *)&sharpsl_mtd[1];
259
260 /* Release resources, unregister device */ 253 /* Release resources, unregister device */
261 nand_release(sharpsl_mtd); 254 nand_release(sharpsl_mtd);
262 255