summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-08-15 11:38:33 +0200
committerHans de Goede <hdegoede@redhat.com>2015-08-31 08:43:41 +0200
commit630cf2e7628502b410622fcfa72bd553a94dfa93 (patch)
treef399dcfe7dde66aa25d2acf278144eef0cd1d8d8 /drivers/mtd
parent10d069b79734942226223178a9e18b26da60002f (diff)
downloadu-boot-imx-630cf2e7628502b410622fcfa72bd553a94dfa93.zip
u-boot-imx-630cf2e7628502b410622fcfa72bd553a94dfa93.tar.gz
u-boot-imx-630cf2e7628502b410622fcfa72bd553a94dfa93.tar.bz2
sunxi_nand_spl: We only need to reset the nand chip once
There is no need to reset the nand chip for every ecc-block read. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/sunxi_nand_spl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/mtd/nand/sunxi_nand_spl.c b/drivers/mtd/nand/sunxi_nand_spl.c
index 46654e4..56c0be0 100644
--- a/drivers/mtd/nand/sunxi_nand_spl.c
+++ b/drivers/mtd/nand/sunxi_nand_spl.c
@@ -162,6 +162,16 @@ void nand_init(void)
NFC_CTL_RESET, MAX_RETRIES)) {
printf("Couldn't initialize nand\n");
}
+
+ /* reset NAND */
+ writel(NFC_SEND_CMD1 | NFC_WAIT_FLAG | NAND_CMD_RESET,
+ SUNXI_NFC_BASE + NFC_CMD);
+
+ if (!check_value(SUNXI_NFC_BASE + NFC_ST, NFC_CMD_INT_FLAG,
+ MAX_RETRIES)) {
+ printf("Error timeout waiting for nand reset\n");
+ return;
+ }
}
static void nand_read_page(unsigned int real_addr, dma_addr_t dst,
@@ -223,16 +233,6 @@ static void nand_read_page(unsigned int real_addr, dma_addr_t dst,
return;
}
- /* set CMD */
- writel(NFC_SEND_CMD1 | NFC_WAIT_FLAG | NAND_CMD_RESET,
- SUNXI_NFC_BASE + NFC_CMD);
-
- if (!check_value(SUNXI_NFC_BASE + NFC_ST, NFC_CMD_INT_FLAG,
- MAX_RETRIES)) {
- printf("Error while initilizing command interrupt\n");
- return;
- }
-
page = real_addr / CONFIG_NAND_SUNXI_SPL_PAGE_SIZE;
column = real_addr % CONFIG_NAND_SUNXI_SPL_PAGE_SIZE;