码迷,mamicode.com
首页 > 其他好文 > 详细

learning uboot how to enable watchdog in qca4531 cpu

时间:2019-01-09 17:33:20      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:gis   write   ini   gen   purpose   pos   eset   stage   cti   

find cpu datasheet , watchdog relate registers:

 

0x18060008 watchdong timer control

0x1806000c watchdog timer

 

we can read and write watchdog register under uboot console:


#mw 0x1806000c 0xffffffff  1

#mw 0x1806000c 0x10000000  1

#mw 0x18060008    0x3  1

#md 0x18060008  1

#md 0x1806000c 1

 

 

// init watchdog function

//init watchdog timer

//int watchdon timer control

 

// watchdog action  bit[1:0]

#define No_action                         0

#define General_purpose_interrupt         1

#define Non_maskable_interrupt            2

#define Full_chip_reset                   3

 

 

#define WATCHDOG_TIMER_CONTROL  0x18060008

#define WATCHDOG_TIMER          0x1806000c

 

void enable_watchdog(){

        ath_reg_wr(WATCHDOG_TIMER,0xffffffff);

        ath_reg_wr(WATCHDOG_TIMER_CONTROL, Full_chip_reset);

}

 

void disable_watchdog(){

        ath_reg_wr(WATCHDOG_TIMER_CONTROL, No_action);

}

 

void feed_watchdog(){

        ath_reg_wr(WATCHDOG_TIMER,0xffffffff);

}

after we  encapsulated watchdog interface; we can enable watchdog in the uboot bootup stage

learning uboot how to enable watchdog in qca4531 cpu

标签:gis   write   ini   gen   purpose   pos   eset   stage   cti   

原文地址:https://www.cnblogs.com/lianghong881018/p/10245496.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!