I.MX6 天嵌 E9 U-boot menu hacking
/************************************************************************************
* I.MX6 天嵌 E9 U-boot menu hacking
* 说明:
* 天嵌在U-boot中添加了自己的选择menu,想看一下怎么实现的。
*
* 2016-8-5 深圳 南山平山村 曽剑锋
***********************************************************************************/ void start_armboot (void)
{
......
/* main_loop() can return to retry autoboot, if so just run it again. */
e9_board_lcd_poweron();
for (;;) {
main_loop (); ---------------------------------------------+
} |
|
/* NOTREACHED - no way out of command loop except booting */ |
} |
|
void main_loop (void) <------------------------------------------+
{ ......
/*
* Main Loop for Monitor Command Processing
*/
#ifdef CONFIG_CMD_MENU
run_command("menu", ); ----------+
#endif |
...... |
} |
|
U_BOOT_CMD( |
menu, , , do_menu, <---------+-----------------+
"display a menu, to select the items to do something", |
"\n" |
"\tdisplay a menu, to select the items to do something" |
); |
|
int do_menu (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) <-----+
{ ---------+
menu_shell(); |
return ; |
} |
|
void menu_shell(void) <--------+
{
char keyselect;
char cmd_buf[];
char *ptmp;
do
{
printf("\r\n##### Boot for IMX6 Main Menu #####\r\n");
printf("[1]boot from emmc\n");
printf("[2]boot from sdcard\n");
printf("[3]boot from tftp\n");
printf("[5]download from sdcard\n");
printf("[0]setting boot args\n");
printf("[q]exit to command mode\n");
printf("Enter your selection: ");
keyselect = getc();
printf("%c\n", keyselect);
switch (keyselect)
{
#if 0
case '':
if(refresh_bootargs("emmc")==)
run_command("booti mmc3",);
break;
case '':
if(refresh_bootargs("sdcard")==)
run_command("booti mmc1",);
break;
case '':
if(refresh_bootargs("tftp_nfs")==)
{
ptmp = getenv("kernelimgname");
sprintf(cmd_buf,"tftp 0x10800000 %s;bootm 0x10800000",ptmp);
run_command(cmd_buf,);
}
break;
case '':
do_boot_para_setting(NULL);
break;
case '':
sprintf(cmd_buf,"booti mmc1 recovery",ptmp);
run_command(cmd_buf,);
break;
#endif
case '':
ptmp = getenv("bootcmd");
if(strcmp(ptmp,"run bootcmd_mmc_ubuntu") == )
run_command("run bootcmd_mmc_ubuntu", );
else if (strcmp(ptmp,"run bootcmd_mmc_android") == )
run_command("run bootcmd_mmc_android", );
else
run_command("run bootcmd_mmc_linux", );
break;
case '': break;
case '':
run_command("run bootcmd_net", );
break;
case '':
do_boot_para_setting(NULL); -------------+
break; |
case '': |
sprintf(cmd_buf,"run bootargs_base_andorid; |
booti mmc1 recovery",ptmp); |
run_command(cmd_buf,); |
break; |
|
} |
|
} |
while ((keyselect != 'q') && (keyselect != 'Q')); |
} |
|
static int do_boot_para_setting(char *pbuf) <------------+
{
int i;
char c; do
{
printf("\r\n##### param setting #####\r\n");
printf("[1]setting nfs args\n");
printf("[2]setting tftp args\n");
printf("[3]setting display args\n");
printf("[4]setting default boot\n");
printf("[s]save setting\n");
printf("[q]quit\n");
printf("Enter your selection: ");
c = getc();
printf("%c\n", c);
switch (c)
{
case '':
do_nfs_para_setting(NULL);
break;
case '':
do_tftp_para_setting(NULL);
break;
case '':
do_disp_para_setting(NULL); -------------+
break; |
case '': |
do_media_para_setting(NULL); |
break; |
case 's': |
run_command("saveenv", ); |
break; |
} |
} |
while (c != 'q'); |
} |
|
static int do_disp_para_setting(char *pbuf) <------------+
{
lcd_menu_shell(); -----------+
return ; |
} |
|
void lcd_menu_shell() <----------+
{
char c;
char cmd_buf[];
char cmd_buf_all[];
int need_renew = ;
while ()
{
lcd_menu_usage();
c = getc();
printf("%c\n", c);
if ((c == ''))
{
sprintf(cmd_buf, " video=mxcfb0:");
if (lcd_setting(&cmd_buf[strlen(cmd_buf)]) != )
{
strcat(cmd_buf, " video=mxcfb1:off video=mxcfb2:off fbmem=48M");
sprintf(cmd_buf_all, "setenv displayArgs %s", cmd_buf);
run_command(cmd_buf_all, );
}
}
else if (c == '')
{
for (;;)
{
printf("\r\n##### display select for android #####\r\n");
printf("[1] 800*600 for LVDS->VGA \r\n");
printf("[2] 1024*768 for FPC->VGA \r\n"); // video=mxcfb0:dev=lcd,if=RGB24,TQ-VGA_1024768,bpp=32 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M
printf("[3] 1280*768 for FPC->VGA\r\n"); //video=mxcfb1:dev=lcd,if=RGB24,TQ-VGA_1280768,bpp=32 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB2em4,bpp=32 video=mxcfb2:off fbmem=28M,48M
printf("[4] 1360*768 for FPC->VGA\r\n"); //video=mxcfb1:dev=lcd,if=RGB24,TQ-VGA_1360768,bpp=32 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB2em4,bpp=32 video=mxcfb2:off fbmem=28M,48M
printf("[5] 1920*1080 for FPC->VGA\r\n"); //video=mxcfb1:dev=lcd,if=RGB24,TQ
printf("[6] 1366*768 for LVDS->VGA \r\n");
printf("[7] 1920*1080 for LVDS (need 2 lvds ports) \r\n");
printf("[q] quit \r\n");
printf("Enter your selection: ");
c = getc();
printf("%c\n", c);
if (c == '')
{
sprintf(cmd_buf_all, "dev=ldb,TQ-ldb_800600,if=RGB666,bpp=32 ldb=dul0");
sprintf(cmd_buf_all, "setenv displayArgs %s", cmd_buf);
run_command(cmd_buf_all, );
break;
}
else if (c == '')
{
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb0:dev=lcd,if=RGB24,TQ-VGA_1024768,bpp=32 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M");
run_command(cmd_buf_all, );
break;
}
else if (c == '')
{
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb1:dev=lcd,if=RGB24,TQ-VGA_1280768,bpp=32 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M");
run_command(cmd_buf_all, );
break;
}
else if (c == '')
{
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb1:dev=lcd,if=RGB24,TQ-VGA_1360768,bpp=32 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M");
run_command(cmd_buf_all, );
break;
}
else if (c == '')
{
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb1:dev=lcd,if=RGB24,TQ-VGA_19201080,bpp=32 video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M");
run_command(cmd_buf_all, );
break;
}
else if (c == '')
{
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb0:dev=ldb,LDB-XGA,if=RGB666,bpp=32 ldb=dul0 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M");
run_command(cmd_buf_all, );
break;
}
else if (c == '')
{
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb0:dev=ldb,LDB-1080P60,if=RGB24,bpp=32 ldb=spl0 video=mxcfb1:dev=hdmi,1280x720M@60,if=RGB24,bpp=32 video=mxcfb2:off fbmem=28M,48M");
run_command(cmd_buf_all, );
break;
}
else if (c == 'q')
{
break;
}
printf("ill param\n");
}
}
else if(c == '')
{//video=mxcfb0:dev=ldb,TQ-ldb_1024768,if=RGB666 ldb=sep1
sprintf(cmd_buf_all, "setenv displayArgs video=mxcfb0:dev=ldb,TQ-ldb_1024768,if=RGB666 ldb=sep1");
run_command(cmd_buf_all, );
}
else if(c == 's')
{
run_command("saveenv", );
}
else if (c == 'q')
{
break;
}
}
}
I.MX6 天嵌 E9 U-boot menu hacking的更多相关文章
- 天嵌E9平台下进行USB Wifi模块RT3070驱动的移植
因为项目工作须要,要在天嵌E9平台下实现wifi的点对点,点对多点的传输. Wifi 模块芯片:雷凌3070芯片 嵌入式平台:E9(ARM) 交叉编译环境:arm-none-linux-gnueabi ...
- Ubuntu 通过 Live CD 更新grub恢复引导Boot Menu
工作需要更换主板,但是不想重装电脑. 怎么办呢? 其实并不需要重装电脑,只需要回复boot menu即可. 1. 首先用u盘制作一个ubuntu的live CD(请自行百度),然后通过u盘启动, 选择 ...
- win7启动老是自动进入Boot Menu无法进入系统
如图 进入bios设置 点击startup 选择UEFI/Legacy Boot 那里的Legacy Only选项,选择另一个就会出现这种问题 正常进入系统
- 开机进入boot menu和application menu,无法开机
1.开机点击F1进入到bios界面 2.进入Security—Secure Boot—Disabled 如果不修改Secure boot选项为Disabled,在光驱引导时可能会出现报错 3. ...
- I.MX6 Manufacturing Tool V2 (MFGTool2) ucl2.xml hacking
<!-- * Copyright (C) 2010-2013, Freescale Semiconductor, Inc. All Rights Reserved. * The CFG elem ...
- bios中只有windows boot manager下用U盘启动
在重装系统的时候,很多时候都是先进入bios设置成U盘启动项,然后进行安装,如果年代久远一点的,就设置成光驱启动,再进行:随着时间的推行,光驱已经开始淘汰了,也怀念以前的光驱装机的时光!-:) 开始进 ...
- [转载] 关于Windows Boot Manager、Bootmgfw.efi、Bootx64.efi、bcdboot.exe 的详解
原帖: http://bbs.wuyou.net/forum.php?mod=viewthread&tid=303679 前言:1.本教程针对于UEFI启动来叙述的,根据普遍的支持UEFI的机 ...
- Spring Boot 2.0 的快速入门(图文教程)
摘要: 原创出处 https://www.bysocket.com 「公众号:泥瓦匠BYSocket 」欢迎关注和转载,保留摘要,谢谢! Spring Boot 2.0 的快速入门(图文教程) 大家都 ...
- ubuntu windows10 in GPT HDD GRUB Boot
some thing wrong with my input, I can just use English -_-!!! The HDD have two kinds of formart, GP ...
随机推荐
- iis性能监控
文章:对于IIS上的应用程序池监控 文章:IIS并发连接数及性能优化
- tree(poj 1741)
题意:给一颗n个节点的树,每条边上有一个距离v(v<=1000).定义d(u,v)为u到v的最小距离.给定k值,求有多少点对(u,v)使u到v的距离小于等于k. /* 照着点分治模板敲了敲,有很 ...
- ubuntu,CentOS永久修改主机名
1.查看主机名 在Ubuntu系统中,快速查看主机名有多种方法: 其一,打开一个GNOME终端窗口,在命令提示符中可以看到主机名,主机名通常位于“@”符号后: 其二,在终端窗口中输入命令:hostna ...
- Codeforces Round #292 (Div. 2) D. Drazil and Tiles [拓扑排序 dfs]
传送门 D. Drazil and Tiles time limit per test 2 seconds memory limit per test 256 megabytes Drazil cre ...
- Object-C Xcode 编译提示 note: please rebuild precompiled header ZWYLPrefixHeader
错误提示如下图 解决思路: 由于手欠不小心,在.pch文件上的第一行加了几个文字,删除以后,还有一个空行,估计是这个空行引起的.删除这个空行,就好了.
- 混合APP开发框架资料汇总
Ionic(ionicframework)一款接近原生的Html5移动App开发框架 会html css js就可以开发app,Ionic基于angualrjs框架是一个专注于开发移动wap以及app ...
- makefile的语法及写法
什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional的程序员,makefile还是要 ...
- Ubuntu 16.04安装Fiddler抓包工具(基于Mono,且会有BUG)
说明:Fiddler官方提供了Mono版本的,但是只有2014版本的,不是最新的,并且运行期间会有BUG,比如界面错乱卡死等等,但是勉强能代理,抓SSL的包,如果使用了要做好心理准备.将就一下还是可以 ...
- Org-mode五分钟教程ZZZ
Table of Contents 1 源起 2 简介 2.1 获取 org-mode 2.2 安装 3 基础用法 3.1 创建一个新文件 3.2 简单的任务列表 3.3 使用标题组织一篇文章 3.4 ...
- 【python】Python的字典get方法:从字典中获取一个值
转自: http://blog.sina.com.cn/s/blog_6be89284010183xm.html