Feed the watchdog in u-boot for 8610 board.
PATCH 1/1 Feed the watchdog in u-boot for 8610 board.
The watchdog on 8610 board is enabled by setting sw[6] to on. Once enabled, the watchdog can not be disabled by software. So feed the dog in u-boot is necessary for normal operation.
Signed-off-by Jason Jin <[email protected]>
--- cpu/mpc86xx/cpu.c | 14 ++++++++++++++ cpu/mpc86xx/interrupts.c | 1 + include/asm-ppc/immap_86xx.h | 14 +++++++++++++- include/configs/MPC8610HPCD.h | 3 ++- 4 files changed, 30 insertions(+), 2 deletions(-)
cpu/mpc86xx/cpu.c +14 -0
@@ -213,6 +213,20 @@ get_tbclk(void)void watchdog_reset (void ) { + +#if defined(CONFIG_MPC8610 ) +/*This actually feed the hard enabled watchdog*/ +volatile immap_t *immap = (immap_t *)CFG_IMMR ; +volatile ccsr_wdt_t *wdt = &immap->im_wdt; +volatile ccsr_gur_t *gur = &immap->im_gur; +u32 tmp = gur->pordevsr; + +if (tmp &0x4000 ) { + wdt->swsrr =0x556c ; + wdt->swsrr =0xaa39 ; + } +#endif + }#endif /* CONFIG_WATCHDOG */
cpu/mpc86xx/interrupts.c +1 -0
@@ -36,6 +36,7 @@#include <command.h> #include <asm/processor.h> #include <ppc_asm.tmpl> +#include <watchdog.h> unsigned long decrementer_count;/* count value for 1e6/HZ microseconds */ unsigned long timestamp;
include/asm-ppc/immap_86xx.h +13 -1
@@ -1304,9 +1304,19 @@ typedef struct ccsr_gur {uint lynxdcr1;/* 0xe0f08 - Lynx debug control register 1*/ int res14[6 ];uint ddrioovcr;/* 0xe0f24 - DDR IO Overdrive Control register */ -char res15[61656 ]; +char res15[216 ]; } ccsr_gur_t; +/*Watchdog register block(0xe_4000-0xe_4fff)*/ +typedef struct ccsr_wdt { +uint res0; +uint swcrr;/* System watchdog control register */ +uint swcnr;/* System watchdog count register */ +char res1[2 ]; +ushort swsrr;/* System watchdog service register */ +char res2[4080 ]; +}ccsr_wdt_t ; + typedef struct immap { ccsr_local_mcm_t im_local_mcm; ccsr_ddr_t im_ddr1;
@@ -1330,6 +1340,8 @@ typedef struct immap {char res5[389120 ];ccsr_rio_t im_rio;ccsr_gur_t im_gur; +char res6[12288 ]; +ccsr_wdt_t im_wdt; } immap_t;extern immap_t *immr;
include/configs/MPC8610HPCD.h +2 -1
@@ -486,7 +486,8 @@#endif -#undef CONFIG_WATCHDOG/* watchdog disabled */ +#define CONFIG_WATCHDOG /* watchdog enabled */ +#define CFG_WATCHDOG_FREQ 5000/*Feed interval, 5s*/ /*DIU Configuration*/ #define DIU_CONNECT_TO_DVI /* DIU controller connects to DVI encoder*/
Signature · 1 line
1.5.2
Jon Loeliger
AppliedPATCH 1/1 Feed the watchdog in u-boot for 8610 board.
Quoted 7 lines · Jason Jin
The watchdog on 8610 board is enabled by setting sw[6] to on. Once enabled, the watchdog can not be disabled by software. So feed the dog in u-boot is necessary for normal operation.
Signed-off-by Jason Jin <[email protected]>---
Applied to -mpc86xx repo with some white-space cleanup.
cpu/mpc86xx/cpu.c get_tbclk(void) · line 219
Quoted 12 lines
cpu/mpc86xx/cpu.c +3
-0@@ -213,6 +213,20 @@ get_tbclk(void)void watchdog_reset (void ) { +if (tmp &0x4000 ) { + wdt->swsrr =0x556c ; + wdt->swsrr =0xaa39 ;
Also, if we had a patch that documented those
magic numbers, that would be good.
Thanks,
jdl