Step 1: Open uboot source code file /common/command.c
Step 2: Add the following code:
int
do_setlcd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
int i = 0;
char *pch = NULL;
char bootargstr[300];
bool isValidArg = true;
if((strcmp(argv[1],35) != 0)
(strcmp(argv[1],43) != 0)
(strcmp(argv[1],56) != 0)
(strcmp(argv[1],70) != 0)
(strcmp(argv[1],VGA800) != 0)
(strcmp(argv[1],VGA1024) != 0) )
{
isValidArg = false;
}
if (!isValidArg)
{
printf(*** Invalid command %s \n, argv[1]);
printf(Valid command must be one of the following: \n);
printf(setlcd 35\n);
printf(setlcd 43\n);
printf(setlcd 56\n);
printf(setlcd 70\n);
printf(setlcd VGA800\n);
printf(setlcd VGA1024\n);
return -1;
}
strcpy(bootargstr, getenv(bootargs));
/* remove previous setting */
pch = strstr (bootargstr, lcdsize);
if(pch != NULL)
{
for(i = pch-bootargstr; i300; i++)
{
bootargstr<i>
= '\0';
}
}
strcat(bootargstr, lcdsize=);
strcat(bootargstr, argv[1]);
setenv(bootargs, bootargstr);
printf(set string:%s\n, bootargstr);
saveenv();
return 0;
}
U_BOOT_CMD(</i> |