[PATCH 1/8] qi-export-s3c2442-nand-bad-block-check.patch
Andy Green
andy at openmoko.com
Tue Feb 3 19:12:17 CET 2009
At least GTA02 specific code is now interested in bad blocks.
Rename the function and export it.
Signed-off-by: Andy Green <andy at openmoko.com>
---
src/cpu/s3c2442/nand_read.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/cpu/s3c2442/nand_read.c b/src/cpu/s3c2442/nand_read.c
index bec2e8b..8d05380 100644
--- a/src/cpu/s3c2442/nand_read.c
+++ b/src/cpu/s3c2442/nand_read.c
@@ -56,11 +56,12 @@ static inline void nand_wait(void)
#define NAND_BLOCK_MASK (NAND_PAGE_SIZE - 1)
#define NAND_BLOCK_SIZE (NAND_PAGE_SIZE * 64)
-static int is_bad_block(unsigned long block_index)
+int s3c2442_nand_is_bad_block(unsigned long block_index)
{
unsigned char data;
unsigned long page_num;
+ nand_select();
nand_clear_RnB();
page_num = block_index >> 2; /* addr / 2048 */
NFCMD = NAND_CMD_READ0;
@@ -130,8 +131,8 @@ int nand_read_ll(unsigned char *buf, unsigned long start_block512,
;
while (blocks512 > 0) {
- if (is_bad_block(start_block512) ||
- is_bad_block(start_block512 + 4)) {
+ if (s3c2442_nand_is_bad_block(start_block512) ||
+ s3c2442_nand_is_bad_block(start_block512 + 4)) {
start_block512 += 4;
blocks512 += 4;
if (bad_count++ == 4)
More information about the openmoko-kernel
mailing list