From: wdenk Date: Wed, 2 Oct 2002 20:50:49 +0000 (+0000) Subject: * Run watchdog POST on every power-on X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c827abdd55cdbaea0c8879558a9f0d6d90aaa290;p=users%2Frw%2Fppcboot.git * Run watchdog POST on every power-on * Fix problems with LWMON's 100 ms watchdog period * Fix bug in init sequence (caused by injudicious code re-arrangement) * Increase monitor size for TQM8xxL to 256 kB; more memory is needed when using redundand environment * Fix building under FreeBSD --- diff --git a/CHANGELOG b/CHANGELOG index a060ac9..f0c0cbb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,18 @@ Modifications since 1.2.0: ====================================================================== +* Run watchdog POST on every power-on + +* Fix problems with LWMON's 100 ms watchdog period + +* Fix bug in init sequence (caused by injudicious code + re-arrangement) + +* Increase monitor size for TQM8xxL to 256 kB; more memory is needed + when using redundand environment + +* Fix building under FreeBSD + * Fix flash sector size for SMDK2400, and flash bank size for TRAB * Fix undefined variables problem in lib_ppc/board.c for some boards diff --git a/cpu/mpc8xx/i2c.c b/cpu/mpc8xx/i2c.c index fcbeac0..9d5d9d2 100644 --- a/cpu/mpc8xx/i2c.c +++ b/cpu/mpc8xx/i2c.c @@ -33,6 +33,9 @@ #include #include +#ifdef CONFIG_LWMON +#include +#endif /* define to enable debug messages */ #undef DEBUG_I2C @@ -611,6 +614,10 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) uchar xaddr[4]; int rc; +#ifdef CONFIG_LWMON + WATCHDOG_RESET(); +#endif + xaddr[0] = (addr >> 24) & 0xFF; xaddr[1] = (addr >> 16) & 0xFF; xaddr[2] = (addr >> 8) & 0xFF; diff --git a/cpu/mpc8xx/interrupts.c b/cpu/mpc8xx/interrupts.c index d613643..3f3559e 100644 --- a/cpu/mpc8xx/interrupts.c +++ b/cpu/mpc8xx/interrupts.c @@ -309,12 +309,18 @@ void timer_interrupt(struct pt_regs *regs) #if defined(CONFIG_WATCHDOG) || defined(CFG_CMA_LCD_HEARTBEAT) - /* - * The shortest watchdog period of all boards is (so far) - * approx. 1 sec, thus re-trigger watchdog at least + + /* + * The shortest watchdog period of all boards (except LWMON) + * is approx. 1 sec, thus re-trigger watchdog at least * every 500 ms = CFG_HZ / 2 */ +#ifndef CONFIG_LWMON if ((timestamp % (CFG_HZ / 2)) == 0) { +#else + if ((timestamp % (CFG_HZ / 20)) == 0) { +#endif + #if defined(CFG_CMA_LCD_HEARTBEAT) extern void lcd_heartbeat(void); lcd_heartbeat(); diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h index 204f2b6..4eec70c 100644 --- a/include/configs/TQM823L.h +++ b/include/configs/TQM823L.h @@ -140,11 +140,7 @@ */ #define CFG_SDRAM_BASE 0x00000000 #define CFG_FLASH_BASE 0x40000000 -#if defined(DEBUG) #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ -#else -#define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ -#endif #define CFG_MONITOR_BASE CFG_FLASH_BASE #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ diff --git a/include/configs/TQM850L.h b/include/configs/TQM850L.h index 5213c0a..71ea2a8 100644 --- a/include/configs/TQM850L.h +++ b/include/configs/TQM850L.h @@ -132,11 +132,7 @@ */ #define CFG_SDRAM_BASE 0x00000000 #define CFG_FLASH_BASE 0x40000000 -#if defined(DEBUG) #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ -#else -#define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ -#endif #define CFG_MONITOR_BASE CFG_FLASH_BASE #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h index 3c7dd61..68151b4 100644 --- a/include/configs/TQM855L.h +++ b/include/configs/TQM855L.h @@ -132,11 +132,7 @@ */ #define CFG_SDRAM_BASE 0x00000000 #define CFG_FLASH_BASE 0x40000000 -#if defined(DEBUG) #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ -#else -#define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ -#endif #define CFG_MONITOR_BASE CFG_FLASH_BASE #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ diff --git a/include/configs/TQM860L.h b/include/configs/TQM860L.h index 82a4903..a3d6b27 100644 --- a/include/configs/TQM860L.h +++ b/include/configs/TQM860L.h @@ -141,11 +141,7 @@ */ #define CFG_SDRAM_BASE 0x00000000 #define CFG_FLASH_BASE 0x40000000 -#if defined(DEBUG) #define CFG_MONITOR_LEN (256 << 10) /* Reserve 256 kB for Monitor */ -#else -#define CFG_MONITOR_LEN (192 << 10) /* Reserve 192 kB for Monitor */ -#endif #define CFG_MONITOR_BASE CFG_FLASH_BASE #define CFG_MALLOC_LEN (128 << 10) /* Reserve 128 kB for malloc() */ diff --git a/include/elf.h b/include/elf.h index 82e8ca8..ed238c3 100644 --- a/include/elf.h +++ b/include/elf.h @@ -33,9 +33,10 @@ #ifndef _ELF_H #define _ELF_H -#if defined(__BEOS__) || \ - defined(__NetBSD__) || \ - defined(__sun__) || \ +#if defined(__BEOS__) || \ + defined(__NetBSD__) || \ + defined(__FreeBSD__) || \ + defined(__sun__) || \ defined(__APPLE__) #include #elif defined(__linux__) && defined(USE_HOSTCC) diff --git a/include/version.h b/include/version.h index 165558e..197f8c5 100644 --- a/include/version.h +++ b/include/version.h @@ -24,6 +24,6 @@ #ifndef __VERSION_H__ #define __VERSION_H__ -#define PPCBOOT_VERSION "PPCBoot 1.2.0" +#define PPCBOOT_VERSION "PPCBoot 1.2.1" #endif /* __VERSION_H__ */ diff --git a/lib_ppc/board.c b/lib_ppc/board.c index defbb34..007de0b 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -556,58 +556,6 @@ void board_init_r (gd_t *id, ulong dest_addr) gd->reloc_off = dest_addr - CFG_MONITOR_BASE; - /* - * Fill in missing fields of bd_info. - * We do this here, where we have "normal" access to the - * environment; we used to do this still running from ROM, - * where had to use getenv_r(), which can be pretty slow when - * the environment is in EEPROM. - */ - s = getenv ("ethaddr"); -#if defined (CONFIG_MBX) || defined (CONFIG_RPXCLASSIC) || defined(CONFIG_IAD210) - if (s == NULL) - board_get_enetaddr (bd->bi_enetaddr); - else -#endif - for (i = 0; i < 6; ++i) { - bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0; - if (s) - s = (*e) ? e + 1 : e; - } -#ifdef CONFIG_HERMES - if ((gd->board_type >> 16) == 2) - bd->bi_ethspeed = gd->board_type & 0xFFFF; - else - bd->bi_ethspeed = 0xFFFF; -#endif - -#ifdef CONFIG_NX823 - load_sernum_ethaddr (); -#endif - -#if defined(CFG_GT_6426x) || defined(CONFIG_PN62) - /* handle the 2nd ethernet address */ - - s = getenv ("eth1addr"); - - for (i = 0; i < 6; ++i) { - bd->bi_enet1addr[i] = s ? simple_strtoul (s, &e, 16) : 0; - if (s) - s = (*e) ? e + 1 : e; - } -#endif -#if defined(CFG_GT_6426x) - /* handle the 3rd ethernet address */ - - s = getenv ("eth2addr"); - - for (i = 0; i < 6; ++i) { - bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0; - if (s) - s = (*e) ? e + 1 : e; - } -#endif - /* * We have to relocate the command table manually */ @@ -733,6 +681,59 @@ void board_init_r (gd_t *id, ulong dest_addr) /* relocate environment function pointers etc. */ env_relocate (); + /* + * Fill in missing fields of bd_info. + * We do this here, where we have "normal" access to the + * environment; we used to do this still running from ROM, + * where had to use getenv_r(), which can be pretty slow when + * the environment is in EEPROM. + */ + s = getenv ("ethaddr"); +#if defined (CONFIG_MBX) || defined (CONFIG_RPXCLASSIC) || defined(CONFIG_IAD210) + if (s == NULL) + board_get_enetaddr (bd->bi_enetaddr); + else +#endif + for (i = 0; i < 6; ++i) { + bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0; + if (s) + s = (*e) ? e + 1 : e; + } +#ifdef CONFIG_HERMES + if ((gd->board_type >> 16) == 2) + bd->bi_ethspeed = gd->board_type & 0xFFFF; + else + bd->bi_ethspeed = 0xFFFF; +#endif + +#ifdef CONFIG_NX823 + load_sernum_ethaddr (); +#endif + +#if defined(CFG_GT_6426x) || defined(CONFIG_PN62) + /* handle the 2nd ethernet address */ + + s = getenv ("eth1addr"); + + for (i = 0; i < 6; ++i) { + bd->bi_enet1addr[i] = s ? simple_strtoul (s, &e, 16) : 0; + if (s) + s = (*e) ? e + 1 : e; + } +#endif +#if defined(CFG_GT_6426x) + /* handle the 3rd ethernet address */ + + s = getenv ("eth2addr"); + + for (i = 0; i < 6; ++i) { + bd->bi_enet2addr[i] = s ? simple_strtoul (s, &e, 16) : 0; + if (s) + s = (*e) ? e + 1 : e; + } +#endif + + #if defined(CONFIG_TQM8xxL) || defined(CONFIG_TQM8260) || \ defined(CONFIG_CCM) load_sernum_ethaddr (); diff --git a/post/tests.c b/post/tests.c index b200703..dfe5c32 100644 --- a/post/tests.c +++ b/post/tests.c @@ -55,7 +55,7 @@ struct post_test post_list[] = "Watchdog timer test", "watchdog", "This test checks the watchdog timer.", - POST_RAM | POST_POWERFAIL | POST_MANUAL | POST_REBOOT, + POST_RAM | POST_POWERON | POST_POWERFAIL | POST_MANUAL | POST_REBOOT, &watchdog_post_test }, #endif