design:

  when uboot load kerne failed,we can switch to stanbdy system;

how to realize:

  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的更多相关文章

  1. 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 ...

  2. auto switch HTTP protocol Chrome Extension

    auto switch HTTP protocol Chrome Extension HTTPS auto switch to HTTP VPN https://chrome.google.com/w ...

  3. learning uboot switch to standby system using button

    pseudocode: If(reset_button was pressed ) { Change  uboot env bootslot^1 }

  4. learning uboot test command

    uboot commad test test - minimal test like /bin/sh so we can use test command to some judge for exam ...

  5. learning uboot distro design in am335x-evm board

    reference: uboot_dir/doc/README.distro Linux distributions are faced with supporting a variety of bo ...

  6. learning uboot how to enable watchdog in qca4531 cpu

    find cpu datasheet , watchdog relate registers: 0x18060008 watchdong timer control 0x1806000c watchd ...

  7. learning uboot enable protect console

    reference :https://github.com/lentinj/u-boot/blob/master/doc/README.autoboot how to enable protect s ...

  8. learning uboot bootargs panic parameter

    By passing the kernel panic parameter, the system automatically resets after 3 seconds when kernel p ...

  9. learning uboot source command

    reference: http://www.denx.de/wiki/DULG/UBootCmdGroupExec => help source source - run script from ...

随机推荐

  1. Windows10 蓝屏 DRIVER_IRQL_NOT_LESS_OR_EQUAL (vfilter.sys)的可能解决方法

    早上我的笔记本从休眠中开机的时候突然出现了蓝屏,这个蓝屏在前几天出现过了.两次提示的终止代码都一样.我的笔记本型号是DELL XPS15 9560 我的笔记本配置: 类别 型号 内存 16GB DDR ...

  2. 棋盘状态压缩dp

    状态压缩入门DP整理 只针对入门 一般都是用2进制的方法,压缩成一个数,所以n的范围都会特变小 一些套路 状态一般是很多的,可以搜索或者位运算筛选一下,基本都是这样的吧 当要存两个状态或者数组存不下的 ...

  3. Java 多线程中的任务分解机制-ForkJoinPool,以及CompletableFuture

    ForkJoinPool的优势在于,可以充分利用多cpu,多核cpu的优势,把一个任务拆分成多个“小任务”,把多个“小任务”放到多个处理器核心上并行执行:当多个“小任务”执行完成之后,再将这些执行结果 ...

  4. 【第二十七章】 springboot + zipkin(brave-okhttp实现)

    本文截取自:http://blog.csdn.net/liaokailin/article/details/52077620 一.前提 1.zipkin基本知识:附8 zipkin 2.启动zipki ...

  5. 51nod 1070 Bash游戏 V4

    这种博弈题  都是打表找规律 可我连怎么打表都不会 这个是凑任务的吧....以后等脑子好些了 再琢磨吧 就是斐波那契数列中的数 是必败态 #include<bits/stdc++.h> u ...

  6. 解决Eclipse 项目报错:Unbound classpath container: ‘JRE System Library [JavaSE-1.7]

    MyEclipse出现下面两条报错: The project cannot be built until build path errors are resolved HelloWord Unknow ...

  7. Unity 之 transform

    transform.Translate 1.function Translate (translation : Vector3, relativeTo : Space = Space.Self) : ...

  8. div滚动条时div内容显示一半

    本文为博主原创,未经允许不得转载 今天在做页面浏览器适配时,将页面中的一个div进行放大时,出现了滚动条,但滚动条对应div中的 内容只能显示一半. 仔细对应属性样式时,div具有overflow:h ...

  9. HDU 1083 Courses(二分图匹配模板)

    http://acm.hdu.edu.cn/showproblem.php?pid=1083 题意:有p门课和n个学生,每个学生都选了若干门课,每门课都要找一个同学来表演,且一个同学只能表演一门课,判 ...

  10. MySQL查询优化之性能提升一个数量级

    这段时间一直在用kettle做数据抽取和报表,写SQL便是家常便饭了,200行+SQL经常要写.甚至写过最长的一个SQL500多行将近600行.这么长的SQL估计大部分人连看的意愿都没有,读起来也比较 ...