diff options
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 044a57483027..30eeb4c65528 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -118,9 +118,6 @@ struct mxc_nand_host { | |||
118 | int spare_len; | 118 | int spare_len; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | /* Define delays in microsec for NAND device operations */ | ||
122 | #define TROP_US_DELAY 2000 | ||
123 | |||
124 | /* OOB placement block for use with hardware ecc generation */ | 121 | /* OOB placement block for use with hardware ecc generation */ |
125 | static struct nand_ecclayout nandv1_hw_eccoob_smallpage = { | 122 | static struct nand_ecclayout nandv1_hw_eccoob_smallpage = { |
126 | .eccbytes = 5, | 123 | .eccbytes = 5, |
@@ -185,10 +182,10 @@ static irqreturn_t mxc_nfc_irq(int irq, void *dev_id) | |||
185 | /* This function polls the NANDFC to wait for the basic operation to | 182 | /* This function polls the NANDFC to wait for the basic operation to |
186 | * complete by checking the INT bit of config2 register. | 183 | * complete by checking the INT bit of config2 register. |
187 | */ | 184 | */ |
188 | static void wait_op_done(struct mxc_nand_host *host, int max_retries, | 185 | static void wait_op_done(struct mxc_nand_host *host, int useirq) |
189 | int useirq) | ||
190 | { | 186 | { |
191 | uint32_t tmp; | 187 | uint32_t tmp; |
188 | int max_retries = 2000; | ||
192 | 189 | ||
193 | if (useirq) { | 190 | if (useirq) { |
194 | if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { | 191 | if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { |
@@ -230,7 +227,7 @@ static void send_cmd(struct mxc_nand_host *host, uint16_t cmd, int useirq) | |||
230 | writew(NFC_CMD, host->regs + NFC_CONFIG2); | 227 | writew(NFC_CMD, host->regs + NFC_CONFIG2); |
231 | 228 | ||
232 | /* Wait for operation to complete */ | 229 | /* Wait for operation to complete */ |
233 | wait_op_done(host, TROP_US_DELAY, useirq); | 230 | wait_op_done(host, useirq); |
234 | } | 231 | } |
235 | 232 | ||
236 | /* This function sends an address (or partial address) to the | 233 | /* This function sends an address (or partial address) to the |
@@ -244,7 +241,7 @@ static void send_addr(struct mxc_nand_host *host, uint16_t addr, int islast) | |||
244 | writew(NFC_ADDR, host->regs + NFC_CONFIG2); | 241 | writew(NFC_ADDR, host->regs + NFC_CONFIG2); |
245 | 242 | ||
246 | /* Wait for operation to complete */ | 243 | /* Wait for operation to complete */ |
247 | wait_op_done(host, TROP_US_DELAY, islast); | 244 | wait_op_done(host, islast); |
248 | } | 245 | } |
249 | 246 | ||
250 | static void send_page(struct mtd_info *mtd, unsigned int ops) | 247 | static void send_page(struct mtd_info *mtd, unsigned int ops) |
@@ -266,7 +263,7 @@ static void send_page(struct mtd_info *mtd, unsigned int ops) | |||
266 | writew(ops, host->regs + NFC_CONFIG2); | 263 | writew(ops, host->regs + NFC_CONFIG2); |
267 | 264 | ||
268 | /* Wait for operation to complete */ | 265 | /* Wait for operation to complete */ |
269 | wait_op_done(host, TROP_US_DELAY, true); | 266 | wait_op_done(host, true); |
270 | } | 267 | } |
271 | } | 268 | } |
272 | 269 | ||
@@ -281,7 +278,7 @@ static void send_read_id(struct mxc_nand_host *host) | |||
281 | writew(NFC_ID, host->regs + NFC_CONFIG2); | 278 | writew(NFC_ID, host->regs + NFC_CONFIG2); |
282 | 279 | ||
283 | /* Wait for operation to complete */ | 280 | /* Wait for operation to complete */ |
284 | wait_op_done(host, TROP_US_DELAY, true); | 281 | wait_op_done(host, true); |
285 | 282 | ||
286 | if (this->options & NAND_BUSWIDTH_16) { | 283 | if (this->options & NAND_BUSWIDTH_16) { |
287 | void __iomem *main_buf = host->main_area0; | 284 | void __iomem *main_buf = host->main_area0; |
@@ -313,7 +310,7 @@ static uint16_t get_dev_status(struct mxc_nand_host *host) | |||
313 | writew(NFC_STATUS, host->regs + NFC_CONFIG2); | 310 | writew(NFC_STATUS, host->regs + NFC_CONFIG2); |
314 | 311 | ||
315 | /* Wait for operation to complete */ | 312 | /* Wait for operation to complete */ |
316 | wait_op_done(host, TROP_US_DELAY, true); | 313 | wait_op_done(host, true); |
317 | 314 | ||
318 | /* Status is placed in first word of main buffer */ | 315 | /* Status is placed in first word of main buffer */ |
319 | /* get status, then recovery area 1 data */ | 316 | /* get status, then recovery area 1 data */ |