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

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.G ...

  2. R语言低级绘图函数-abline 转载

    abline 函数的作用是在一张图表上添加直线, 可以是一条斜线,通过x或y轴的交点和斜率来确定位置:也可以是一条水平或者垂直的线,只需要指定与x轴或y轴交点的位置就可以了 常见用法: 1)添加直线 ...

  3. UOJ #103:【APIO2014】Palindromes

    题意: 考虑一个只包含小写拉丁字母的字符串s.我们定义s的一个子串t的“出 现值”为t在s中的出现次数乘以t的长度.请你求出s的所有回文子串中的最 大出现值. 学会马拉车之后发现还需要后缀数组才能AC ...

  4. python 获取当前时间戳

    #!/usr/bin/python # -*- coding: UTF- -*- import time; # 引入time模块 ticks = time.time() print("当前时 ...

  5. testNG 学习笔记 Day 3 常用的断言

    TestNG中最常用的一个断言类是Assert.java,里面有多个静态方法,这个类我们习惯叫硬断言.对应的还有一个软断言的类,叫SoftAssert.java,这个类是需要创建实例对象,才能调用相关 ...

  6. SQL 常用的命令

    --修改表名 --格式:SP_RENAME TABLENAME,NEWTABLENAME SP_RENAME TABLENAME,NEWTABLENAME --只能对表,不能对临时表 --修改字段名 ...

  7. SQLServer随机取记录

    SQLServer本身并没有提供随机读取记录的功能,但我们可以通过一些方法来实现这个目的.本文介绍了其中几种方法并比较了各自的优劣. 方法一:直接通过Sql语句实现,如: SELECT TOP 100 ...

  8. Oracle监听服务

    Oracle数据库中的主要用户及其作用 No. 用户名 默认密码 描述 1 sys change_on_install 数据库的超级管理员 2 system manager 数据库的普通管理员 3 s ...

  9. CentOS下的Autoconf和AutoMake(实践篇) 2

    阅读过<Linux下的Autoconf和AutoMake(理论篇)>之后,进入到实践环节.实验环境:CentOS release 6.7 (Final) x64 1.检查一下这4个工具是否 ...

  10. Dalvik VM (DVM) 与Java VM (JVM) 的区别?

    Dalvik虚拟机存在于Android系统,JVM是java虚拟机,两者都是虚拟机,本文就对两者进行比较,讲述它们的不同. Dalvik虚拟机是Google等厂商合作开发的Android移动设备平台的 ...