Skip to content
Snippets Groups Projects
Commit a9c847cb authored by Stefan Roese's avatar Stefan Roese Committed by Scott Wood
Browse files

nand_spl: nand_boot.c: Remove CONFIG_SYS_NAND_READ_DELAY


There are multiple reasons why this define should be removed:

First it saves some space and therefore fixes a problem we have on
the canyonlands_nand and glacier_nand targets right now.

Second, the define was hackish and would most likely not work on all
board using nand_boot.c. Boards not providing a real dev_ready()
function should implement a board specific function instead.

I checked and it seems, that all boards using nand_boot.c right now
already implement a board specific dev_ready() function. So this
patch should not break any boards and will result in smaller
NAND_SPL images.

Signed-off-by: default avatarStefan Roese <sr@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Sughosh Ganu <urwithsughosh@gmail.com>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Tested-by: default avatarSughosh Ganu <urwithsughosh@gmail.com>
Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
parent a89a9901
No related merge requests found
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
#include <nand.h> #include <nand.h>
#include <asm/io.h> #include <asm/io.h>
#define CONFIG_SYS_NAND_READ_DELAY \
{ volatile int dummy; int i; for (i=0; i<10000; i++) dummy = i; }
static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS; static int nand_ecc_pos[] = CONFIG_SYS_NAND_ECCPOS;
#if (CONFIG_SYS_NAND_PAGE_SIZE <= 512) #if (CONFIG_SYS_NAND_PAGE_SIZE <= 512)
...@@ -61,11 +58,8 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8 ...@@ -61,11 +58,8 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
/* /*
* Wait a while for the data to be ready * Wait a while for the data to be ready
*/ */
if (this->dev_ready) while (!this->dev_ready(mtd))
while (!this->dev_ready(mtd)) ;
;
else
CONFIG_SYS_NAND_READ_DELAY;
return 0; return 0;
} }
...@@ -80,11 +74,8 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8 ...@@ -80,11 +74,8 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
void (*hwctrl)(struct mtd_info *mtd, int cmd, void (*hwctrl)(struct mtd_info *mtd, int cmd,
unsigned int ctrl) = this->cmd_ctrl; unsigned int ctrl) = this->cmd_ctrl;
if (this->dev_ready) while (!this->dev_ready(mtd))
while (!this->dev_ready(mtd)) ;
;
else
CONFIG_SYS_NAND_READ_DELAY;
/* Emulate NAND_CMD_READOOB */ /* Emulate NAND_CMD_READOOB */
if (cmd == NAND_CMD_READOOB) { if (cmd == NAND_CMD_READOOB) {
...@@ -120,11 +111,8 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8 ...@@ -120,11 +111,8 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
/* /*
* Wait a while for the data to be ready * Wait a while for the data to be ready
*/ */
if (this->dev_ready) while (!this->dev_ready(mtd))
while (!this->dev_ready(mtd)) ;
;
else
CONFIG_SYS_NAND_READ_DELAY;
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment