diff options
Diffstat (limited to 'common/board_f.c')
-rw-r--r-- | common/board_f.c | 57 |
1 files changed, 38 insertions, 19 deletions
diff --git a/common/board_f.c b/common/board_f.c index 4ea4cb21be..6203d85619 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -14,6 +14,7 @@ #include <linux/compiler.h> #include <version.h> #include <environment.h> +#include <dm.h> #include <fdtdec.h> #include <fs.h> #if defined(CONFIG_CMD_IDE) @@ -37,6 +38,7 @@ #include <os.h> #include <post.h> #include <spi.h> +#include <status_led.h> #include <trace.h> #include <watchdog.h> #include <asm/errno.h> @@ -52,6 +54,7 @@ #ifdef CONFIG_SANDBOX #include <asm/state.h> #endif +#include <dm/root.h> #include <linux/compiler.h> /* @@ -78,25 +81,15 @@ DECLARE_GLOBAL_DATA_PTR; ************************************************************************ * May be supplied by boards if desired */ -inline void __coloured_LED_init(void) {} -void coloured_LED_init(void) - __attribute__((weak, alias("__coloured_LED_init"))); -inline void __red_led_on(void) {} -void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); -inline void __red_led_off(void) {} -void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); -inline void __green_led_on(void) {} -void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); -inline void __green_led_off(void) {} -void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); -inline void __yellow_led_on(void) {} -void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); -inline void __yellow_led_off(void) {} -void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); -inline void __blue_led_on(void) {} -void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); -inline void __blue_led_off(void) {} -void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); +__weak void coloured_LED_init(void) {} +__weak void red_led_on(void) {} +__weak void red_led_off(void) {} +__weak void green_led_on(void) {} +__weak void green_led_off(void) {} +__weak void yellow_led_on(void) {} +__weak void yellow_led_off(void) {} +__weak void blue_led_on(void) {} +__weak void blue_led_off(void) {} /* * Why is gd allocated a register? Prior to reloc it might be better to @@ -776,6 +769,30 @@ static int mark_bootstage(void) return 0; } +static int initf_malloc(void) +{ +#ifdef CONFIG_SYS_MALLOC_F_LEN + assert(gd->malloc_base); /* Set up by crt0.S */ + gd->malloc_limit = gd->malloc_base + CONFIG_SYS_MALLOC_F_LEN; + gd->malloc_ptr = 0; +#endif + + return 0; +} + +static int initf_dm(void) +{ +#if defined(CONFIG_DM) && defined(CONFIG_SYS_MALLOC_F_LEN) + int ret; + + ret = dm_init_and_scan(true); + if (ret) + return ret; +#endif + + return 0; +} + static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_SANDBOX setup_ram_buf, @@ -833,6 +850,8 @@ static init_fnc_t init_sequence_f[] = { sdram_adjust_866, init_timebase, #endif + initf_malloc, + initf_dm, init_baud_rate, /* initialze baudrate settings */ serial_init, /* serial communications setup */ console_init_f, /* stage 1 init of console */ |