]> 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 8bf9acca48b4e9eaf7e8172c17558b48096cfe79..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
@@ -550,7 +542,7 @@ static int setup_board_part1(void)
 #if defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
        bd->bi_immr_base = CONFIG_SYS_IMMR;     /* base  of IMMR register     */
 #endif
-#if defined(CONFIG_MPC5xxx) || defined(CONFIG_M68K)
+#if defined(CONFIG_M68K)
        bd->bi_mbar_base = CONFIG_SYS_MBAR;     /* base of internal registers */
 #endif
 #if defined(CONFIG_MPC83xx)
@@ -574,13 +566,6 @@ static int setup_board_part2(void)
        bd->bi_sccfreq = gd->arch.scc_clk;
        bd->bi_vco = gd->arch.vco_out;
 #endif /* CONFIG_CPM2 */
-#if defined(CONFIG_MPC512X)
-       bd->bi_ipsfreq = gd->arch.ips_clk;
-#endif /* CONFIG_MPC512X */
-#if defined(CONFIG_MPC5xxx)
-       bd->bi_ipbfreq = gd->arch.ipb_clk;
-       bd->bi_pcifreq = gd->pci_clk;
-#endif /* CONFIG_MPC5xxx */
 #if defined(CONFIG_M68K) && defined(CONFIG_PCI)
        bd->bi_pcifreq = gd->pci_clk;
 #endif
@@ -734,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;
@@ -743,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");
@@ -816,6 +801,9 @@ static const init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_DISPLAY_CPUINFO)
        print_cpuinfo,          /* display cpu info (and speed) */
 #endif
+#if defined(CONFIG_DTB_RESELECT)
+       embedded_dtb_select,
+#endif
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        show_board_info,
 #endif
@@ -890,9 +878,6 @@ static const init_fnc_t init_sequence_f[] = {
        setup_board_part2,
 #endif
        display_new_sp,
-#ifdef CONFIG_SYS_EXTBDINFO
-       setup_board_extra,
-#endif
 #ifdef CONFIG_OF_BOARD_FIXUP
        fix_fdt,
 #endif
@@ -917,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;
 
@@ -986,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.