输入特定字符进入uboot

因串口干扰容易造成直接进入uboot命令行,不启动kernel的问题
现排查解决
uboot/common/autoboot.c

输入./.进入uboot

static int __abortboot(int bootdelay)
{
	int abort = 0;
	unsigned long ts;
	char c;
	int abort_stage = 0;
	
#ifdef CONFIG_MENUPROMPT
	printf(CONFIG_MENUPROMPT);
#else
	printf("Hit any key to stop autoboot: %2d ", bootdelay);
#endif

	/*
	 * Check if key already pressed
	 */
	if (tstc()) {	/* we got a key press	*/
		c = getc(); 
		puts("\b\b\b 0");
		if (!abort_stage && c == '.') abort_stage = 0x1;
	}

	while ((bootdelay > 0) && (!abort)) {
		--bootdelay;
		/* delay 1000 ms */
		ts = get_timer(0);
		do {
			if (tstc()) {	/* we got a key press	*/
				
				c = getc();  
				if (!abort_stage && c == '.') abort_stage = 0x1;
				else if (abort_stage == 1 && c == '/') abort_stage = 0x2;
				else if (abort_stage == 2 && c == '.') {

					bootdelay = 0;	/* no more delay	*/
					abort = 1;
					break;
				}				
			}
			udelay(10000);
		} while (!abort && get_timer(ts) < 1000);

		printf("\b\b\b%2d ", bootdelay);
	}

	putc('\n');

	return abort;
}
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值