1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-25 20:04:03 +02:00

add 'nmark' command

This commit is contained in:
xiangfu 2009-06-26 02:24:03 +00:00
parent 4ee26b812b
commit 4827a1b2c8

View File

@ -47,6 +47,7 @@ static const char COMMAND[][30]=
"unselect",
"chip",
"unchip",
"nmark",
"nmake",
"load",
"memtest",
@ -116,6 +117,32 @@ int handle_nerase(void)
return 1;
}
int handle_nmark(void)
{
int i;
if (com_argc < 4) {
printf("\n Usage:");
printf(" nerase (1) (2) (3) ");
printf("\n 1:bad block number"
"\n 2:device index number"
"\n 3:flash chip index number ");
return -1;
}
init_nand_in();
nand_in.start = atoi(com_argv[1]);
nand_in.dev = atoi(com_argv[2]);
if (atoi(com_argv[3])>=MAX_DEV_NUM) {
printf("\n Flash index number overflow!");
return -1;
}
(nand_in.cs_map)[atoi(com_argv[3])] = 1;
nand_markbad(&nand_in);
return 1;
}
int command_interpret(char * com_buf)
{
char *buf = com_buf;
@ -188,6 +215,9 @@ int command_handle(char *buf)
case 20:
boot(STAGE1_FILE_PATH, STAGE2_FILE_PATH);
break;
case 26:
handle_nmark();
break;
default:
printf("\n command not support or input error!");
break;