diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-10-05 11:18:42 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-12 02:33:25 -0500 |
commit | f06368f7d15f6fc323ba0c71aec67b9b2dd5614a (patch) | |
tree | 4617c5685c41d4d96ec1a0470feed931a68ed04c /drivers/mtd/nand | |
parent | 9467114ef43c971f0ae8aee3729d412125a2f432 (diff) |
mxc_nand: disable sp_en bit only once
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 4a696820d6d4..2e3f3fbcd67c 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -274,16 +274,10 @@ static void send_page(struct mtd_info *mtd, unsigned int ops) | |||
274 | static void send_read_id(struct mxc_nand_host *host) | 274 | static void send_read_id(struct mxc_nand_host *host) |
275 | { | 275 | { |
276 | struct nand_chip *this = &host->nand; | 276 | struct nand_chip *this = &host->nand; |
277 | uint16_t tmp; | ||
278 | 277 | ||
279 | /* NANDFC buffer 0 is used for device ID output */ | 278 | /* NANDFC buffer 0 is used for device ID output */ |
280 | writew(0x0, host->regs + NFC_BUF_ADDR); | 279 | writew(0x0, host->regs + NFC_BUF_ADDR); |
281 | 280 | ||
282 | /* Read ID into main buffer */ | ||
283 | tmp = readw(host->regs + NFC_CONFIG1); | ||
284 | tmp &= ~NFC_SP_EN; | ||
285 | writew(tmp, host->regs + NFC_CONFIG1); | ||
286 | |||
287 | writew(NFC_ID, host->regs + NFC_CONFIG2); | 281 | writew(NFC_ID, host->regs + NFC_CONFIG2); |
288 | 282 | ||
289 | /* Wait for operation to complete */ | 283 | /* Wait for operation to complete */ |
@@ -307,7 +301,7 @@ static uint16_t get_dev_status(struct mxc_nand_host *host) | |||
307 | { | 301 | { |
308 | void __iomem *main_buf = host->main_area1; | 302 | void __iomem *main_buf = host->main_area1; |
309 | uint32_t store; | 303 | uint32_t store; |
310 | uint16_t ret, tmp; | 304 | uint16_t ret; |
311 | /* Issue status request to NAND device */ | 305 | /* Issue status request to NAND device */ |
312 | 306 | ||
313 | /* store the main area1 first word, later do recovery */ | 307 | /* store the main area1 first word, later do recovery */ |
@@ -316,11 +310,6 @@ static uint16_t get_dev_status(struct mxc_nand_host *host) | |||
316 | * corruption of read/write buffer on status requests. */ | 310 | * corruption of read/write buffer on status requests. */ |
317 | writew(1, host->regs + NFC_BUF_ADDR); | 311 | writew(1, host->regs + NFC_BUF_ADDR); |
318 | 312 | ||
319 | /* Read status into main buffer */ | ||
320 | tmp = readw(host->regs + NFC_CONFIG1); | ||
321 | tmp &= ~NFC_SP_EN; | ||
322 | writew(tmp, host->regs + NFC_CONFIG1); | ||
323 | |||
324 | writew(NFC_STATUS, host->regs + NFC_CONFIG2); | 313 | writew(NFC_STATUS, host->regs + NFC_CONFIG2); |
325 | 314 | ||
326 | /* Wait for operation to complete */ | 315 | /* Wait for operation to complete */ |
@@ -739,8 +728,10 @@ static int __init mxcnd_probe(struct platform_device *pdev) | |||
739 | } else | 728 | } else |
740 | BUG(); | 729 | BUG(); |
741 | 730 | ||
731 | /* disable interrupt and spare enable */ | ||
742 | tmp = readw(host->regs + NFC_CONFIG1); | 732 | tmp = readw(host->regs + NFC_CONFIG1); |
743 | tmp |= NFC_INT_MSK; | 733 | tmp |= NFC_INT_MSK; |
734 | tmp &= ~NFC_SP_EN; | ||
744 | writew(tmp, host->regs + NFC_CONFIG1); | 735 | writew(tmp, host->regs + NFC_CONFIG1); |
745 | 736 | ||
746 | init_waitqueue_head(&host->irq_waitq); | 737 | init_waitqueue_head(&host->irq_waitq); |