{
p = getenv("bootsystem");
if (NULL == p) {
printf("*** Warning use default bootsystem:android ***\n");
p = "android";
setenv("bootsystem", (char *)p);
saveenv();
}
printf("Boot system :%s\n", p);
if(!strcmp(p, "android"))
{
boot_system_flags = 0;
}
else if(!strcmp(p, "qt"))
{
boot_system_flags = 1;
}
else if(!strcmp(p, "ubuntu"))
{
boot_system_flags = 2;
}
p = getenv("lcdtype");
if (NULL == p) {
printf("*** Warning use default lcdtype:9.7 ***\n");
p = "9.7";
setenv("lcdtype", (char *)p);
saveenv();
}
printf("LCD type:%s\n", p);
if(!strcmp(p, "9.7"))
{
lcd_type = 0;
//sprintf(displayArgs, "video=mxcfb0:dev=ldb,LDB-XGA,bpp=32 video=mxcfb1:off
video=mxcfb2:off fbmem=30M");
sprintf(displayArgs, "video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666,bpp=32 ldb=sin1
video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb2:off fbmem=48M");
}
else if(!strcmp(p, "7.0"))
{
lcd_type = 1;
//sprintf(displayArgs, "video=mxcfb0:dev=ldb,LDB-7inch,bpp=32 video=mxcfb1:off
video=mxcfb2:off fbmem=30M");
sprintf(displayArgs, "video=mxcfb0:dev=ldb,LDB-7inch,if=RGB666,bpp=32 ldb=sin1
video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb2:off fbmem=48M");
}
else if(!strcmp(p, "4.3"))
{
lcd_type = 2;
//sprintf(displayArgs, "video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off
video=mxcfb2:off fbmem=10M");
sprintf(displayArgs, "video=mxcfb0:dev=lcd,VGA_480272,if=RGB24,bpp=32
video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb2:off fbmem=48M");
}
/* add by cym 20170814 */
else if(!strcmp(p, "1024x600"))
{
lcd_type = 3;
//sprintf(displayArgs, "video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off
video=mxcfb2:off fbmem=10M");
sprintf(displayArgs, "video=mxcfb0:dev=lcd,VGA_1024600,if=RGB24,bpp=32
video=mxcfb1:dev=hdmi,1920x1080M@60,if=RGB24 video=mxcfb2:off fbmem=48M");
}
/* end add */
else if(!strcmp(p, "hdmi"))
{
sprintf(displayArgs, "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32
video=mxcfb1:off video=mxcfb2:off fbmem=48M");
}
else
{
sprintf(displayArgs, "video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off
video=mxcfb2:off fbmem=10M");
}
if(0 == boot_system_flags)//Android
{
sprintf(bootargs, "console=ttymxc2,115200 init=/init %s vmalloc=400M
androidboot.console=ttymxc2 androidboot.hardware=freescale
androidboot.serialno=1a0d39d4e3013411", displayArgs);
//
setenv("bootargs", bootargs);
// sprintf(bootargs, "console=NULL init=/init %s vmalloc=400M androidboot.console=NULL
androidboot.hardware=freescale androidboot.serialno=1a0d39d4e3013411", displayArgs);
setenv("bootargs", bootargs);
p = getenv("bootcmd");
if((p == NULL) || (strstr(p, "booti mmc3"))
|| (strstr(p, "mmc dev 3; mmc read 0x10800000 0x800 0x3000; bootm")))
{
setenv("bootcmd", "booti mmc3");
}
}
else if(1 == boot_system_flags)//QT
{
sprintf(bootargs, "console=ttymxc0,115200 %s root=/dev/mmcblk0p1 rootwait",
displayArgs);
setenv("bootargs", bootargs);
p = getenv("bootcmd");
if((p == NULL) || (strstr(p, "booti mmc3"))
|| (strstr(p, "mmc dev 3; mmc read 0x10800000 0x800 0x3000;
bootm")))
{
setenv("bootcmd", "mmc dev 3; mmc read 0x10800000 0x800 0x3000; bootm");
}
}
else if(2 == boot_system_flags)//Ubuntu
{
sprintf(bootargs, "console=ttymxc0,115200 %s root=/dev/mmcblk0p1 rootwait
bootsystem=%s", displayArgs, getenv("bootsystem"));
setenv("bootargs", bootargs);
p = getenv("bootcmd");
if((p == NULL) || (strstr(p, "booti mmc3"))
|| (strstr(p, "mmc dev 3; mmc read 0x10800000 0x800 0x3000;
bootm")))
{
setenv("bootcmd", "mmc dev 3; mmc read 0x10800000 0x800 0x3000; bootm");
}
}
}