]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/board_f.c
Merge git://git.denx.de/u-boot-uniphier
[people/ms/u-boot.git] / common / board_f.c
index ffa84e356614b61c198145909769544db263e25b..9220815441e51f58d34eac914c570a84da206bd1 100644 (file)
@@ -118,7 +118,7 @@ __weak void board_add_ram_info(int use_default)
 
 static int init_baud_rate(void)
 {
-       gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
+       gd->baudrate = env_get_ulong("baudrate", 10, CONFIG_BAUDRATE);
        return 0;
 }
 
@@ -211,14 +211,6 @@ static int init_func_spi(void)
 }
 #endif
 
-__maybe_unused
-static int zero_global_data(void)
-{
-       memset((void *)gd, '\0', sizeof(gd_t));
-
-       return 0;
-}
-
 static int setup_mon_len(void)
 {
 #if defined(__ARM__) || defined(__MICROBLAZE__)
@@ -324,7 +316,7 @@ static int reserve_pram(void)
 {
        ulong reg;
 
-       reg = getenv_ulong("pram", 10, CONFIG_PRAM);
+       reg = env_get_ulong("pram", 10, CONFIG_PRAM);
        gd->relocaddr -= (reg << 10);           /* size is in kB */
        debug("Reserving %ldk for protected RAM at %08lx\n", reg,
              gd->relocaddr);
@@ -340,7 +332,7 @@ static int reserve_round_4k(void)
 }
 
 #ifdef CONFIG_ARM
-static int reserve_mmu(void)
+__weak int reserve_mmu(void)
 {
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
        /* reserve TLB table */
@@ -418,7 +410,7 @@ static int reserve_uboot(void)
         */
        gd->relocaddr -= gd->mon_len;
        gd->relocaddr &= ~(4096 - 1);
-#ifdef CONFIG_E500
+#if defined(CONFIG_E500) || defined(CONFIG_MIPS)
        /* round down to next 64 kB limit so that IVPR stays aligned */
        gd->relocaddr &= ~(65536 - 1);
 #endif
@@ -727,7 +719,7 @@ static int initf_bootstage(void)
 
 static int initf_console_record(void)
 {
-#if defined(CONFIG_CONSOLE_RECORD) && defined(CONFIG_SYS_MALLOC_F_LEN)
+#if defined(CONFIG_CONSOLE_RECORD) && CONFIG_VAL(SYS_MALLOC_F_LEN)
        return console_record_init();
 #else
        return 0;
@@ -736,7 +728,7 @@ static int initf_console_record(void)
 
 static int initf_dm(void)
 {
-#if defined(CONFIG_DM) && defined(CONFIG_SYS_MALLOC_F_LEN)
+#if defined(CONFIG_DM) && CONFIG_VAL(SYS_MALLOC_F_LEN)
        int ret;
 
        bootstage_start(BOOTSTATE_ID_ACCUM_DM_F, "dm_f");
@@ -910,25 +902,6 @@ static const init_fnc_t init_sequence_f[] = {
 
 void board_init_f(ulong boot_flags)
 {
-#ifdef CONFIG_SYS_GENERIC_GLOBAL_DATA
-       /*
-        * For some architectures, global data is initialized and used before
-        * calling this function. The data should be preserved. For others,
-        * CONFIG_SYS_GENERIC_GLOBAL_DATA should be defined and use the stack
-        * here to host global data until relocation.
-        */
-       gd_t data;
-
-       gd = &data;
-
-       /*
-        * Clear global data before it is accessed at debug print
-        * in initcall_run_list. Otherwise the debug print probably
-        * get the wrong value of gd->have_console.
-        */
-       zero_global_data();
-#endif
-
        gd->flags = boot_flags;
        gd->have_console = 0;
 
@@ -979,6 +952,9 @@ void board_init_f_r(void)
         * UART if available.
         */
        gd->flags &= ~GD_FLG_SERIAL_READY;
+#ifdef CONFIG_TIMER
+       gd->timer = NULL;
+#endif
 
        /*
         * U-Boot has been copied into SDRAM, the BSS has been cleared etc.