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 ...
随机推荐
- Leetcode 318.最大单词长度乘积
最大单词长度乘积 . 示例 1: 输入: ["abcw","baz","foo","bar","xtfn&qu ...
- Leetcode 229.求众数II
求众数II 给定一个大小为 n 的数组,找出其中所有出现超过 ⌊ n/3 ⌋ 次的元素. 说明: 要求算法的时间复杂度为 O(n),空间复杂度为 O(1). 示例 1: 输入: [3,2,3] 输出: ...
- BGP路由属性详解
Weight属性:cisco私有的BGP属性参数,它只适用于一台路由器中的路由,也就是不会传递给任何其他的路由器.他的取值范围为<0-65535>,这个数越大优先级越高,默认从邻居学到的路 ...
- 【git】远程仓库版本回退方法
1 简介 最近在使用git时遇到了远程分支需要版本回滚的情况,于是做了一下研究,写下这篇博客. 2 问题 如果提交了一个错误的版本,怎么回退版本? 如果提交了一个错误的版本到远程分支,怎么回退远程分支 ...
- jquery制作图片瀑布流点击按钮加载更多内容
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> ...
- APP后端处理表情的一些技巧
app应用中文字夹带表情是个很常见的现象.甚至一些40多岁的大叔级用户,也喜欢在自己的昵称中夹带表情,在产品运营后发现这个现象,彻底颠覆了我的世界观. 在后台处理表情的时间,我遇到过下面3个问题: 1 ...
- SVN 学习笔记-高级操作
所谓高级操作,只是曲高和寡,其实都不怎么用的.但是关键时候,可能会很有用. 这个高级只是针对基本操作而言.有些操作可能也是比较基本的. 清除锁 有时候我们在操作的时候,可能系统崩溃了,或者SVN非正常 ...
- 干掉H5audio音频标签的下载按钮
audio::-internal-media-controls-download-button {display:none;}audio::-webkit-media-controls {overfl ...
- SAS学习笔记 - R的数据操作
1.对象 1.1 对象及其内在属性 R中的处理数据就是对象,每个对象可以包含多个元素.对象有两个内在属性:类型和长度.类型是对象元素的基本种类,共四种:数值型,字符型,复数型和逻辑型.对象的类型和长度 ...
- burpsuite破解版
来源:http://www.vuln.cn/8847