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 ...
随机推荐
- POJ1703-Find them, Catch them 并查集构造
Find them, Catch them 好久没有做并查集的题,竟然快把并查集忘完了. 题意:大致是有两个监狱,n个 ...
- [BZOJ2120][BZOJ2453]数颜色
[BZOJ2120]数颜色 试题描述 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问.墨墨会像你发布如下指令: 1. Q L R代表询问你从第L支画笔到第R支画笔中 ...
- 【贪心+DFS】D. Field expansion
http://codeforces.com/contest/799/problem/D [题意] 给定长方形的两条边h和w,你可以从给出的n个数字中随意选出一个x,把h或者w乘上x(每个x最多用一次) ...
- bzoj 3786 星系探索 dfs+splay
[BZOJ3786]星系探索 Description 物理学家小C的研究正遇到某个瓶颈. 他正在研究的是一个星系,这个星系中有n个星球,其中有一个主星球(方便起见我们默认其为1号星球),其余的所有星球 ...
- 后缀排序(codevs 1500)
题目描述 Description 天凯是MIT的新生.Prof. HandsomeG给了他一个长度为n的由小写字母构成的字符串,要求他把该字符串的n个后缀(suffix)从小到大排序. 何谓后缀?假设 ...
- 【BZOJ1225】求正整数(数论)
题意:对于任意输入的正整数n,请编程求出具有n个不同因子的最小正整数m. n<=50000 思路:记得以前好像看的是maigo的题解 n即为将m分解为质数幂次的乘积后的次数+1之积 经检验只需要 ...
- BZOJ3126: [Usaco2013 Open]Photo
n<=200000个点,m<=100000个区间,每个区间有且仅有一个点,求最多几个点,无解-1. http://www.cnblogs.com/Chorolop/p/7570191.ht ...
- msp430项目编程02
msp430中项目---液晶1602显示 1.液晶1602工作原理 2.电路原理说明 3.代码(静态显示) 4.代码(动态显示) 5.项目总结 msp430项目编程 msp430入门学习
- AS3实现ToolTip效果
AS3核心类中没有ToolTip类,Flex中的ToolTip类没法用在AS3工程中,Aswing的JToolTip不错,不过如果仅仅为了使用这一个类而导入Aswing就不太明智了.由于最近的项目需要 ...
- Topcoder 658 650 point
Topcoder 658 div2 500 加强版 不过给了<=20,暴力肯定不行. 然后想DP方程,先二分可能需要的最大次数mid; 然后根据 mid 构造 DP方程. 假设x[i]需要 x个 ...