From c790b04d230363d03939dc008bcc80f3ba4de1ae Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 11 May 2009 15:50:12 +0200 Subject: lib_arch/board.c: Move malloc initialization before flash_init() This patch moves the malloc initialization before calling flash_init(). Upcoming changes to the NOR FLASH common CFI driver with optional MTD infrastructure and MTD concatenation support will call malloc(). And nothing really speaks against enabling malloc just a little earlier in the boot stage. Some architectures already enable malloc before calling flash_init() so they don't need any changes here. Signed-off-by: Stefan Roese Cc: Wolfgang Denk Cc: Mike Frysinger Cc: Scott McNutt Cc: Shinya Kuribayashi Cc: Nobuhiro Iwamatsu Cc: Daniel Hellstrom Cc: Jean-Christophe PLAGNIOL-VILLARD Cc: John Rigby --- lib_m68k/board.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib_m68k') diff --git a/lib_m68k/board.c b/lib_m68k/board.c index db45b00..584d1ff 100644 --- a/lib_m68k/board.c +++ b/lib_m68k/board.c @@ -519,6 +519,10 @@ void board_init_r (gd_t *id, ulong dest_addr) */ trap_init (CONFIG_SYS_SDRAM_BASE); + /* initialize malloc() area */ + mem_malloc_init (); + malloc_bin_reloc (); + #if !defined(CONFIG_SYS_NO_FLASH) puts ("FLASH: "); @@ -563,10 +567,6 @@ void board_init_r (gd_t *id, ulong dest_addr) WATCHDOG_RESET (); - /* initialize malloc() area */ - mem_malloc_init (); - malloc_bin_reloc (); - #ifdef CONFIG_SPI # if !defined(CONFIG_ENV_IS_IN_EEPROM) spi_init_f (); -- cgit v1.1 From 42a83765d54f042b4079e05a3438789542429981 Mon Sep 17 00:00:00 2001 From: Richard Retanubun Date: Fri, 20 Mar 2009 15:30:10 -0400 Subject: Adds WATCHDOG_RESET() function call to lib_m68k dtimer_interrupt. Ported from lib_ppc/interrupts.c, this adds the ability for the coldfire system timer to auto-reset the watchdog when dtimer_interrupts is called. Signed-off-by: Richard Retanubun --- lib_m68k/time.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib_m68k') diff --git a/lib_m68k/time.c b/lib_m68k/time.c index 697d67e..29269f6 100644 --- a/lib_m68k/time.c +++ b/lib_m68k/time.c @@ -27,10 +27,15 @@ #include #include +#include DECLARE_GLOBAL_DATA_PTR; -static ulong timestamp; +static volatile ulong timestamp = 0; + +#ifndef CONFIG_SYS_WATCHDOG_FREQ +#define CONFIG_SYS_WATCHDOG_FREQ (CONFIG_SYS_HZ / 2) +#endif #if defined(CONFIG_MCFTMR) #ifndef CONFIG_SYS_UDELAY_BASE @@ -76,6 +81,12 @@ void dtimer_interrupt(void *not_used) if ((CONFIG_SYS_TMRPND_REG & CONFIG_SYS_TMRINTR_MASK) == CONFIG_SYS_TMRINTR_PEND) { timerp->ter = (DTIM_DTER_CAP | DTIM_DTER_REF); timestamp++; + + #if defined(CONFIG_WATCHDOG) || defined (CONFIG_HW_WATCHDOG) + if ((timestamp % (CONFIG_SYS_WATCHDOG_FREQ)) == 0) { + WATCHDOG_RESET (); + } + #endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */ return; } } -- cgit v1.1 From dc26965ad3acdfb18780361d77a276b2843a90af Mon Sep 17 00:00:00 2001 From: Richard Retanubun Date: Mon, 23 Mar 2009 13:35:48 -0400 Subject: Compier warning cleanup Follow up to git commit: 19b5b533ccd522abeb501d510750693c35e20456 Cleanup on compiler warnings on unused variables now that bd->bi_enetaddr is no longer used. Signed-off-by: Richard Retanubun --- lib_m68k/board.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib_m68k') diff --git a/lib_m68k/board.c b/lib_m68k/board.c index 584d1ff..7d4ffc7 100644 --- a/lib_m68k/board.c +++ b/lib_m68k/board.c @@ -438,9 +438,8 @@ board_init_f (ulong bootflag) void board_init_r (gd_t *id, ulong dest_addr) { cmd_tbl_t *cmdtp; - char *s, *e; + char *s; bd_t *bd; - int i; extern void malloc_bin_reloc (void); #ifndef CONFIG_ENV_IS_NOWHERE -- cgit v1.1