|
|
|
@ -37,10 +37,12 @@ static int
|
|
|
|
|
cmd_flashmem_run( chain_t *chain, char *params[] )
|
|
|
|
|
{
|
|
|
|
|
int msbin;
|
|
|
|
|
int noverify = 0;
|
|
|
|
|
uint32_t adr = 0;
|
|
|
|
|
FILE *f;
|
|
|
|
|
int paramc = cmd_params( params );
|
|
|
|
|
|
|
|
|
|
if (cmd_params( params ) != 3)
|
|
|
|
|
if (paramc < 3)
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if (!bus) {
|
|
|
|
@ -52,15 +54,20 @@ cmd_flashmem_run( chain_t *chain, char *params[] )
|
|
|
|
|
if (!msbin && cmd_get_number( params[1], &adr ))
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if (paramc > 3)
|
|
|
|
|
noverify = strcasecmp( "noverify", params[3] ) == 0;
|
|
|
|
|
else
|
|
|
|
|
noverify = 0;
|
|
|
|
|
|
|
|
|
|
f = fopen( params[2], "rb" );
|
|
|
|
|
if (!f) {
|
|
|
|
|
printf( _("Unable to open file `%s'!\n"), params[2] );
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if (msbin)
|
|
|
|
|
flashmsbin( bus, f );
|
|
|
|
|
flashmsbin( bus, f, noverify );
|
|
|
|
|
else
|
|
|
|
|
flashmem( bus, f, adr );
|
|
|
|
|
flashmem( bus, f, adr, noverify );
|
|
|
|
|
fclose( f );
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
@ -72,18 +79,19 @@ cmd_flashmem_help( void )
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
printf( _(
|
|
|
|
|
"Usage: %s ADDR FILENAME\n"
|
|
|
|
|
"Usage: %s FILENAME\n"
|
|
|
|
|
"Usage: %s ADDR FILENAME [noverify]\n"
|
|
|
|
|
"Usage: %s FILENAME [noverify]\n"
|
|
|
|
|
"Program FILENAME content to flash memory.\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"ADDR target address for raw binary image\n"
|
|
|
|
|
"FILENAME name of the input file\n"
|
|
|
|
|
"%-10s FILENAME is in MS .bin format (for WinCE)\n"
|
|
|
|
|
"%-10s if specified, verification is skipped\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"ADDR could be in decimal or hexadecimal (prefixed with 0x) form.\n"
|
|
|
|
|
"\n"
|
|
|
|
|
"Supported Flash Memories:\n"
|
|
|
|
|
), "flashmem", "flashmem msbin", "msbin" );
|
|
|
|
|
), "flashmem", "flashmem msbin", "msbin", "noverify" );
|
|
|
|
|
|
|
|
|
|
for (i = 0; flash_drivers[i]; i++)
|
|
|
|
|
printf( _("%s\n %s\n"), _(flash_drivers[i]->name), _(flash_drivers[i]->description) );
|
|
|
|
|