summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 66b1710)
raw | patch | inline | side by side (parent: 66b1710)
author | Hao Zhang <hzhang@ti.com> | |
Thu, 5 Jun 2014 20:36:50 +0000 (16:36 -0400) | ||
committer | Hao Zhang <hzhang@ti.com> | |
Thu, 5 Jun 2014 20:36:50 +0000 (16:36 -0400) |
The new parameter is introduced due to an RBL bug in k2l and k2e
devices that EMIF16 NAND boot can only boot an image burnt in
countinuous good nand blocks.
devices that EMIF16 NAND boot can only boot an image burnt in
countinuous good nand blocks.
writer/nand/evmk2e/bin/nand_writer_input.txt | [changed mode: 0644->0755] | patch | blob | history |
writer/nand/evmk2h/bin/nand_writer_input.txt | patch | blob | history | |
writer/nand/evmk2l/bin/nand_writer_input.txt | [changed mode: 0644->0755] | patch | blob | history |
writer/nand/src/nandwriter.c | patch | blob | history |
diff --git a/writer/nand/evmk2e/bin/nand_writer_input.txt b/writer/nand/evmk2e/bin/nand_writer_input.txt
file_name = app.bin
start_addr = 0
rbl_ecc = 0
-
+skip_bad = 1
diff --git a/writer/nand/evmk2h/bin/nand_writer_input.txt b/writer/nand/evmk2h/bin/nand_writer_input.txt
index 340b140cd137db7127562279d8ae48827f4d6f65..ec82083bc6e29d83e7d2253f28a71f80defe12fa 100755 (executable)
file_name = app.bin
start_addr = 0
rbl_ecc = 0
-
+skip_bad = 0
diff --git a/writer/nand/evmk2l/bin/nand_writer_input.txt b/writer/nand/evmk2l/bin/nand_writer_input.txt
file_name = app.bin
start_addr = 0
rbl_ecc = 0
-
+skip_bad = 1
index 72dfc37c2d7a06e59badaf3cba781c9010a06364..f474d5aaaac46538329916c49c00064005e321fb 100755 (executable)
#include "types.h"
/* NAND writer utility version */
-char version[] = "01.00.00.03";
+char version[] = "01.00.00.04";
/* The input file name is hard coded */
char *input_file = "nand_writer_input.txt";
#define FILE_NAME "file_name"
#define START_ADDR "start_addr"
#define RBL_ECC "rbl_ecc"
+#define SKIP_BAD "skip_bad"
/* Memory address to store the write data */
#define WRITE_DATA_ADDRESS 0x80000000
uint32_t startAddr; /* Start address to write */
uint32_t writeBytes; /* Number of bytes to be written into the device */
uint8_t flags; /* Flag used for EVMK2H for multiple ECC formats */
+ uint8_t skip_bad_blks; /* Flag used to skip bad blocks */
uint8_t *writeData; /* Address to store the write data */
uint8_t *readData; /* Address to store the read data */
uint32_t wPos, wLen;
uint32_t block, start_block;
uint8_t *scrach_block;
+ uint32_t num_blks;
+ uint32_t bad_block_found;
if (swap_byte)
{
start_block = nandWriterInfo.startAddr / nandWriterInfo.blockSizeBytes;
+ /* skip the bad blocks if the flag is set */
+ if (nandWriterInfo.skip_bad_blks)
+ {
+ num_blks = nandWriterInfo.writeBytes / nandWriterInfo.blockSizeBytes;
+ if ((nandWriterInfo.writeBytes - nandWriterInfo.blockSizeBytes * num_blks) > 0)
+ num_blks++;
+
+ while (TRUE)
+ {
+ bad_block_found = FALSE;
+ for (block = start_block; block < start_block + num_blks; block++)
+ {
+ if (checkBadBlockMark(p_device, block))
+ {
+ start_block = block + 1;
+ bad_block_found = TRUE;
+ break;
+ }
+ }
+ if (bad_block_found == FALSE)
+ break;
+ }
+ }
+
/* Program the NAND */
for (block = start_block, wPos = 0; wPos < nandWriterInfo.writeBytes; block++, wPos += nandWriterInfo.blockSizeBytes)
{
nandWriterInfo.flags = 0;
}
+ /* Scan skip bad block input parameter */
+ fgets(line, MAX_LINE_LENGTH, fp);
+ key = (char *)strtok(line, tokens);
+ data = (char *)strtok(NULL, tokens);
+
+ if(strlen(data) != 0 && (strcmp(key, SKIP_BAD) == 0))
+ {
+ nandWriterInfo.skip_bad_blks = (uint8_t)atoi(data);
+ }
+ else
+ {
+ nandWriterInfo.skip_bad_blks = 0;
+ }
+
return TRUE;
}