diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-08-31 18:24:24 +0200 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-09-01 14:21:34 +0200 |
commit | 36d375faf5cff98e8dca32aabbbb1ec6036437dd (patch) | |
tree | ba828554f9f7775e5970da69c298f599bf300fc7 /lib_avr32 | |
parent | abdde2b1d570b1ee77606bf783444fcddf7f0965 (diff) |
avr32: Use board_postclk_init instead of gclk_init
Replace the avr32-specific gclk_init() board hook with the standard
board_postclk_init() hook which is supposed to run at the same point
during initialization.
Provide a dummy weak alias for boards not implementing this hook. The
cost of this is:
- 2 bytes for the dummy function (retal 0)
- 2 bytes for each unnecessary function call (short rcall)
which is a pretty small price to pay for avoiding lots of #ifdef
clutter. In this particular case, all boards probably end up slightly
smaller because we avoid the conditional checking if the gclk_init
symbol is NULL.
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'lib_avr32')
-rw-r--r-- | lib_avr32/board.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib_avr32/board.c b/lib_avr32/board.c index d6423d4f3f9..19d76d2cacc 100644 --- a/lib_avr32/board.c +++ b/lib_avr32/board.c @@ -47,6 +47,13 @@ static unsigned long mem_malloc_start = 0; static unsigned long mem_malloc_end = 0; static unsigned long mem_malloc_brk = 0; +/* Weak aliases for optional board functions */ +static int __do_nothing(void) +{ + return 0; +} +int board_postclk_init(void) __attribute__((weak, alias("__do_nothing"))); + /* The malloc area is right below the monitor image in RAM */ static void mem_malloc_init(void) { @@ -187,6 +194,7 @@ void board_init_f(ulong board_type) /* Perform initialization sequence */ board_early_init_f(); cpu_init(); + board_postclk_init(); env_init(); init_baudrate(); serial_init(); |