【海思内核驱动篇】

您所在的位置:网站首页 uboot屏蔽输入 【海思内核驱动篇】

【海思内核驱动篇】

2024-07-14 05:23| 来源: 网络整理| 查看: 265

【海思内核驱动篇】-(3)uboot命令行ctrl+c 1.前言

海思uboot默认进入到uboot命令行是任意键进入,这样有可能串口输入会影响uboot正常启动,导致进入到uboot命令行模式。这个可以在uboot源码中修改。

2.修改uboot命令行

uboot进入uboot命令行模式任意键进去,现在要改成ctrl+c进入。

1.上电进board_init_r-->init_sequence_r-->run_main_loop

-->main_loop-->bootdelay_process-->autoboot_command主要就是这么个流程

2.具体怎么决定是进命令行还是启动kernel是在autoboot_command决定的

如果要设置组合按键,需要修改的是/common/main.c 文件,具体调用流程自行跟踪。

static int __abortboot(int bootdelay) { int abort = 0; unsigned long ts; #ifdef CONFIG_MENUPROMPT printf(CONFIG_MENUPROMPT); #else printf("Hit ctrl+c to stop autoboot: %2d ", bootdelay); #endif #if defined CONFIG_ZERO_BOOTDELAY_CHECK //20200518 /* * Check if key already pressed */ if (tstc()) { /* we got a key press */ (void) getc(); /* consume input */ puts("\b\b\b 0"); abort = 1; /* don't auto boot */ } #endif while ((bootdelay > 0) && (!abort)) { --bootdelay; /* delay 1000 ms */ ts = get_timer(0); do { if (tstc()) { /* we got a key press */ if(0x03 == getc()){ //新增 ctrl+c ascii为0x03 20200518 abort = 1; /* don't auto boot */ bootdelay = 0; /* no more delay */ # ifdef CONFIG_MENUKEY menukey = getc(); # else (void) getc(); /* consume input */ # endif break; } } udelay(10000); } while (!abort && get_timer(ts) < 1000); printf("\b\b\b%2d ", bootdelay); } putc('\n'); return abort; }


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3