mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-26 00:09:43 +02:00
add 'nmark' command
This commit is contained in:
parent
4ee26b812b
commit
4827a1b2c8
@ -47,6 +47,7 @@ static const char COMMAND[][30]=
|
|||||||
"unselect",
|
"unselect",
|
||||||
"chip",
|
"chip",
|
||||||
"unchip",
|
"unchip",
|
||||||
|
"nmark",
|
||||||
"nmake",
|
"nmake",
|
||||||
"load",
|
"load",
|
||||||
"memtest",
|
"memtest",
|
||||||
@ -116,6 +117,32 @@ int handle_nerase(void)
|
|||||||
return 1;
|
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)
|
int command_interpret(char * com_buf)
|
||||||
{
|
{
|
||||||
char *buf = com_buf;
|
char *buf = com_buf;
|
||||||
@ -188,6 +215,9 @@ int command_handle(char *buf)
|
|||||||
case 20:
|
case 20:
|
||||||
boot(STAGE1_FILE_PATH, STAGE2_FILE_PATH);
|
boot(STAGE1_FILE_PATH, STAGE2_FILE_PATH);
|
||||||
break;
|
break;
|
||||||
|
case 26:
|
||||||
|
handle_nmark();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf("\n command not support or input error!");
|
printf("\n command not support or input error!");
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user