ppc: Move wdt_last to arch_global_data

Move this field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2012-12-13 20:49:03 +00:00 committed by Tom Rini
parent 923a662f2f
commit a0d3c820c4
2 changed files with 7 additions and 7 deletions

View file

@ -125,6 +125,9 @@ struct arch_global_data {
#ifdef CONFIG_SYS_FPGA_COUNT
unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
#endif
#if defined(CONFIG_WD_MAX_RATE)
unsigned long long wdt_last; /* trace watch-dog triggering rate */
#endif
};
/*
@ -172,9 +175,6 @@ typedef struct global_data {
#endif
#if defined(CONFIG_LWMON) || defined(CONFIG_LWMON5)
unsigned long kbd_status;
#endif
#if defined(CONFIG_WD_MAX_RATE)
unsigned long long wdt_last; /* trace watch-dog triggering rate */
#endif
void **jt; /* jump table */
char env_buf[32]; /* buffer for getenv() before reloc. */

View file

@ -357,16 +357,16 @@ void hw_watchdog_reset(void)
* Don't allow watch-dog triggering more frequently than
* the predefined value CONFIG_WD_MAX_RATE [ticks].
*/
if (ct >= gd->wdt_last) {
if ((ct - gd->wdt_last) < CONFIG_WD_MAX_RATE)
if (ct >= gd->arch.wdt_last) {
if ((ct - gd->arch.wdt_last) < CONFIG_WD_MAX_RATE)
return;
} else {
/* Time base counter had been reset */
if (((unsigned long long)(-1) - gd->wdt_last + ct) <
if (((unsigned long long)(-1) - gd->arch.wdt_last + ct) <
CONFIG_WD_MAX_RATE)
return;
}
gd->wdt_last = get_ticks();
gd->arch.wdt_last = get_ticks();
#endif
/*