]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/board_f.c
sunxi: increase SYS_MONITOR_LEN
[karo-tx-uboot.git] / common / board_f.c
index 7a95794882508d465905c7a363069ef73b351e17..7951fd16fe0d7b8c01939f0c23205747e6e6948a 100644 (file)
@@ -272,6 +272,8 @@ static int setup_mon_len(void)
        gd->mon_len = (ulong)&_end - (ulong)_init;
 #elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2)
        gd->mon_len = CONFIG_SYS_MONITOR_LEN;
+#elif defined(CONFIG_NDS32)
+       gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
 #else
        /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */
        gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
@@ -722,6 +724,7 @@ static int jump_to_copy(void)
         * with the stack in SDRAM and Global Data in temporary memory
         * (CPU cache)
         */
+       arch_setup_gd(gd->new_gd);
        board_init_f_r_trampoline(gd->start_addr_sp);
 #else
        relocate_code(gd->start_addr_sp, gd->new_gd, gd->relocaddr);
@@ -771,9 +774,6 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_OF_CONTROL
        fdtdec_setup,
 #endif
-#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
-       x86_fsp_init,
-#endif
 #ifdef CONFIG_TRACE
        trace_early_init,
 #endif
@@ -781,6 +781,9 @@ static init_fnc_t init_sequence_f[] = {
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
        /* TODO: can this go into arch_cpu_init()? */
        probecpu,
+#endif
+#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
+       x86_fsp_init,
 #endif
        arch_cpu_init,          /* basic arch cpu dependent setup */
        mark_bootstage,
@@ -799,7 +802,8 @@ static init_fnc_t init_sequence_f[] = {
        /* TODO: can we rename this to timer_init()? */
        init_timebase,
 #endif
-#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_BLACKFIN)
+#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \
+               defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32)
        timer_init,             /* initialize timer */
 #endif
 #ifdef CONFIG_SYS_ALLOC_DPRAM
@@ -865,7 +869,8 @@ static init_fnc_t init_sequence_f[] = {
 #endif
        announce_dram_init,
        /* TODO: unify all these dram functions? */
-#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
+#if defined(CONFIG_ARM) || defined(CONFIG_X86) || defined(CONFIG_NDS32) || \
+               defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32)
        dram_init,              /* configure available RAM banks */
 #endif
 #if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_M68K)
@@ -1034,16 +1039,26 @@ void board_init_f_r(void)
 }
 #endif /* CONFIG_X86 */
 
+/* Unfortunately x86 can't compile this code as gd cannot be assigned */
 #ifndef CONFIG_X86
+__weak void arch_setup_gd(struct global_data *gd_ptr)
+{
+       gd = gd_ptr;
+}
+#endif /* !CONFIG_X86 */
+
 ulong board_init_f_mem(ulong top)
 {
+       struct global_data *gd_ptr;
+
        /* Leave space for the stack we are running with now */
        top -= 0x40;
 
        top -= sizeof(struct global_data);
        top = ALIGN(top, 16);
-       gd = (struct global_data *)top;
-       memset((void *)gd, '\0', sizeof(*gd));
+       gd_ptr = (struct global_data *)top;
+       memset(gd_ptr, '\0', sizeof(*gd));
+       arch_setup_gd(gd_ptr);
 
 #ifdef CONFIG_SYS_MALLOC_F_LEN
        top -= CONFIG_SYS_MALLOC_F_LEN;
@@ -1052,4 +1067,3 @@ ulong board_init_f_mem(ulong top)
 
        return top;
 }
-#endif /* !CONFIG_X86 */