learning uboot auto switch to stanbdy system in qca4531 cpu
design:
when uboot load kerne failed,we can switch to stanbdy system;
when boot fail, we can let uboot env bootKenrelFailCount++, then save to uboot_env partiton.
watchdog timeout will trigger cpu reset, when bootKernelFailCount bigger than a fixed number
we can realize switch to stanbdy system
reference code:
void bootKernelFailProcess(){
char buf[100]=0;
char *s;
int bootKernelFailCount =0;
s=getenv("bootKernelFailCount");
bootKernelFailCount =++atoi(s);
sprintf(buf,"setenv bootKernelFailCount %d", bootKernelFailCount);
run_command(buf,0);
run_command("saveenv",0);
}
void changeBootslotFunction(){
char buf[100]=0;
int bootslot=0;
s=getenv("bootslot");
bootslot=atoi(s)^1;
sprintf(buf,"setenv bootslot %d",bootslot);
run_command(buf,0);
run_command("saveenv",0);
}
void bootKernelFailCountDetect(){
if( atoi(getenv("bootKernelfailCount ")) > 2 ){
run_command("setenv bootKernelFailCount 0",0);
changeBootslotFunction();
}
}
learning uboot auto switch to stanbdy system in qca4531 cpu的更多相关文章
- learning uboot how to set ddr parameter in qca4531 cpu
DDR工作频率 在600MHZ. include/configs/board953x.h #define CFG_PLL_FREQ CFG_PLL_650_600_200 #d ...
- auto switch HTTP protocol Chrome Extension
auto switch HTTP protocol Chrome Extension HTTPS auto switch to HTTP VPN https://chrome.google.com/w ...
- learning uboot switch to standby system using button
pseudocode: If(reset_button was pressed ) { Change uboot env bootslot^1 }
- learning uboot test command
uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...
- learning uboot distro design in am335x-evm board
reference: uboot_dir/doc/README.distro Linux distributions are faced with supporting a variety of bo ...
- learning uboot how to enable watchdog in qca4531 cpu
find cpu datasheet , watchdog relate registers: 0x18060008 watchdong timer control 0x1806000c watchd ...
- learning uboot enable protect console
reference :https://github.com/lentinj/u-boot/blob/master/doc/README.autoboot how to enable protect s ...
- learning uboot bootargs panic parameter
By passing the kernel panic parameter, the system automatically resets after 3 seconds when kernel p ...
- learning uboot source command
reference: http://www.denx.de/wiki/DULG/UBootCmdGroupExec => help source source - run script from ...
随机推荐
- 20145333茹翔《网络对抗技术》Exp6 信息搜集技术
20145333茹翔<网络对抗技术>Exp6 信息搜集技术 实验内容 本次实验的目标是掌握信息搜集的最基础技能.具体有(1)各种搜索技巧的应用(2)DNS IP注册信息的查询 (3)基本的 ...
- Android实践项目汇报(四)
全国天气客户端 本周学习计划 添加修改功能,完成项目 实际完成情况 1.成功显示当天及后几天的天气信息 通过修改chaxun.java程序,比较JSON数据格式中JSONObject("to ...
- bzoj 1010 玩具装箱toy -斜率优化
P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京.他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中.P教授有编号为1...N的N件玩具,第i件玩具 ...
- LightOJ - 1247 Matrix Game (Nim博弈)题解
题意: 给一个矩阵,每一次一个玩家可以从任意一行中选任意数量的格子并从中拿石头(但最后总数要大于等于1),问你谁赢 思路: 一开始以为只能一行拿一个... 将每一行石子数相加就转化为经典的Nim博弈 ...
- Large Division(大数)题解
Given two integers, a and b, you should check whether a is divisible by b or not. We know that an in ...
- [BZOJ1103][POI2007]大都市meg dfs序+树状数组
Description 在经济全球化浪潮的影响下,习惯于漫步在清晨的乡间小路的邮递员Blue Mary也开始骑着摩托车传递邮件了.不过,她经常回忆起以前在乡间漫步的情景.昔日,乡下有依次编号为1..n ...
- 【Coursera】Seventh Week
Application Layer:Use the services of the TCP layer Quick Review Link Layer(Ethernet):gets the data ...
- self用法
- React Native 之轮播图swiper组件
注释:swiper组件是第三方组件 所以在使用之前应该先在命令行安装,然后将第三方的模块引入(第三方模块地址:https://github.com/leecade/react-native-swipe ...
- 如何理解并正确使用MySql索引
原文链接:https://my.oschina.net/feinik/blog/1305784 1.概述 索引是存储引擎用于快速查找记录的一种数据结构,通过合理的使用数据库索引可以大大提高系统的访问性 ...