diff options
-rwxr-xr-x | writer/nand/evmk2h/bin/nand_writer_input.txt | 3 | ||||
-rwxr-xr-x | writer/nand/src/nandwriter.c | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/writer/nand/evmk2h/bin/nand_writer_input.txt b/writer/nand/evmk2h/bin/nand_writer_input.txt index 009e6a1..340b140 100755 --- a/writer/nand/evmk2h/bin/nand_writer_input.txt +++ b/writer/nand/evmk2h/bin/nand_writer_input.txt | |||
@@ -1,5 +1,6 @@ | |||
1 | file_name = app.bin | 1 | file_name = app.bin |
2 | start_addr = 16384 | 2 | start_addr = 0 |
3 | rbl_ecc = 0 | ||
3 | 4 | ||
4 | 5 | ||
5 | 6 | ||
diff --git a/writer/nand/src/nandwriter.c b/writer/nand/src/nandwriter.c index b8fe3c0..af89f9a 100755 --- a/writer/nand/src/nandwriter.c +++ b/writer/nand/src/nandwriter.c | |||
@@ -58,6 +58,7 @@ volatile uint32_t nand_erase_flag = 0; | |||
58 | /* Parameters defined in the input_file */ | 58 | /* Parameters defined in the input_file */ |
59 | #define FILE_NAME "file_name" | 59 | #define FILE_NAME "file_name" |
60 | #define START_ADDR "start_addr" | 60 | #define START_ADDR "start_addr" |
61 | #define RBL_ECC "rbl_ecc" | ||
61 | 62 | ||
62 | /* Memory address to store the write data */ | 63 | /* Memory address to store the write data */ |
63 | #define WRITE_DATA_ADDRESS 0x80000000 | 64 | #define WRITE_DATA_ADDRESS 0x80000000 |
@@ -79,6 +80,7 @@ typedef struct NAND_WRITER_INFO_tag | |||
79 | uint32_t deviceTotalBytes; /* Total number of bytes available in the device */ | 80 | uint32_t deviceTotalBytes; /* Total number of bytes available in the device */ |
80 | uint32_t startAddr; /* Start address to write */ | 81 | uint32_t startAddr; /* Start address to write */ |
81 | uint32_t writeBytes; /* Number of bytes to be written into the device */ | 82 | uint32_t writeBytes; /* Number of bytes to be written into the device */ |
83 | uint8_t flags; /* Flag used for EVMK2H for multiple ECC formats */ | ||
82 | uint8_t *writeData; /* Address to store the write data */ | 84 | uint8_t *writeData; /* Address to store the write data */ |
83 | uint8_t *readData; /* Address to store the read data */ | 85 | uint8_t *readData; /* Address to store the read data */ |
84 | 86 | ||
@@ -434,6 +436,19 @@ parse_input_file | |||
434 | } | 436 | } |
435 | 437 | ||
436 | nandWriterInfo.startAddr = (uint32_t)atoi(data); | 438 | nandWriterInfo.startAddr = (uint32_t)atoi(data); |
439 | |||
440 | fgets(line, MAX_LINE_LENGTH, fp); | ||
441 | key = (char *)strtok(line, tokens); | ||
442 | data = (char *)strtok(NULL, tokens); | ||
443 | |||
444 | if(strlen(data) != 0 && (strcmp(key, RBL_ECC) == 0)) | ||
445 | { | ||
446 | nandWriterInfo.flags = (uint8_t)atoi(data); | ||
447 | } | ||
448 | else | ||
449 | { | ||
450 | nandWriterInfo.flags = 0; | ||
451 | } | ||
437 | 452 | ||
438 | return TRUE; | 453 | return TRUE; |
439 | } | 454 | } |
@@ -551,7 +566,7 @@ void main () | |||
551 | return; | 566 | return; |
552 | } | 567 | } |
553 | #if (defined(_EVMC6657L_) || defined(DEVICE_K2H) || defined(DEVICE_K2K)) | 568 | #if (defined(_EVMC6657L_) || defined(DEVICE_K2H) || defined(DEVICE_K2K)) |
554 | p_device = platform_device_open(PLATFORM_DEVID_MT29F1G08ABCHC, 0); | 569 | p_device = platform_device_open(PLATFORM_DEVID_MT29F1G08ABCHC, nandWriterInfo.flags); |
555 | #else | 570 | #else |
556 | p_device = platform_device_open(PLATFORM_DEVID_NAND512R3A2D, 0); | 571 | p_device = platform_device_open(PLATFORM_DEVID_NAND512R3A2D, 0); |
557 | #endif | 572 | #endif |