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 ...
随机推荐
- 2017.7.4 ACM校内赛 Round 2
这是一个向导 A - hdu 3652 B - bzoj 4152 C - bzoj 2429 D - bzoj 1087 E - bzoj 1566 F - bzoj 4043 G - bzoj 1 ...
- 【前端】javascript+jquery实现手风琴式的滚动banner或产品展示图
实现效果 实现步骤 // 鼠标放入到li中该盒子变宽,其他盒子变窄,鼠标移开大盒子,恢复原样 // 实现步骤 // 1. 给li添加背景 // 2. 绑定onmouseover事件,鼠标放入到li中, ...
- windows10下使用source insight出现"source insight program editor已停止工作"的问题
一.背景 1.1 OS 版本 windows 10 1.2 source insight版本 source insight 3.50.0034 二.解决方案 删除"我的文档"下面的source ins ...
- CSU 1808 地铁(最短路变形)
http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1808 题意: Bobo 居住在大城市 ICPCCamp. ICPCCamp 有 n 个地铁站, ...
- HDU 6069 Counting Divisors(唯一分解定理+因子数)
http://acm.hdu.edu.cn/showproblem.php?pid=6069 题意: 思路: 根据唯一分解定理,$n={a_{1}}^{p1}*{a2_{}}^{p2}...*{a_{ ...
- UVa 247 电话圈(Floyd传递闭包)
https://vjudge.net/problem/UVA-247 题意: 如果两个人相互打电话,则说他们在同一个电话圈里.例如,a打给b,b打给c,c打给d,d打给a,则这4个人在同一个圈里:如果 ...
- Linux——系统开关机指令简单学习笔记
关机: 命令名称:shutdown 命令所在路径:/usr/sbin/shutdown 执行权限:root 语法:shutdown 功能描述:关机 范例:# shutdown -h now 重启: 命 ...
- Codeforces Round #225 (Div. 2) E. Propagating tree dfs序+-线段树
题目链接:点击传送 E. Propagating tree time limit per test 2 seconds memory limit per test 256 megabytes inpu ...
- nginx configuration
Now that you know how to manage the service itself, you should take a few minutes to familiarize you ...
- python 集合删除元素
#Create a new set num_set = , , , , , ]) #Discard number num_set.discard() print(num_set)