common: Add get_effective_memsize() to memsize.c
[oweals/u-boot.git] / arch / arm / lib / board.c
index 34f50b08a5cd8ae9a284cd776b9628b231e48fa3..ba62394a9d49d72638bc0896f1d81c2631bcb8d6 100644 (file)
@@ -197,8 +197,6 @@ static int arm_pci_init(void)
  */
 typedef int (init_fnc_t) (void);
 
-int print_cpuinfo(void);
-
 void __dram_init_banksize(void)
 {
        gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
@@ -250,9 +248,7 @@ init_fnc_t *init_sequence[] = {
        serial_init,            /* serial communications setup */
        console_init_f,         /* stage 1 init of console */
        display_banner,         /* say that we are here */
-#if defined(CONFIG_DISPLAY_CPUINFO)
        print_cpuinfo,          /* display cpu info (and speed) */
-#endif
 #if defined(CONFIG_DISPLAY_BOARDINFO)
        checkboard,             /* display board info */
 #endif
@@ -280,7 +276,7 @@ void board_init_f(ulong bootflag)
        gd->mon_len = _bss_end_ofs;
 #ifdef CONFIG_OF_EMBED
        /* Get a pointer to the FDT */
-       gd->fdt_blob = _binary_dt_dtb_start;
+       gd->fdt_blob = __dtb_db_begin;
 #elif defined CONFIG_OF_SEPARATE
        /* FDT is at end of image */
        gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
@@ -322,7 +318,7 @@ void board_init_f(ulong bootflag)
        gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
 #endif
 
-       addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
+       addr = CONFIG_SYS_SDRAM_BASE + get_effective_memsize();
 
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
@@ -344,7 +340,7 @@ void board_init_f(ulong bootflag)
 
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
        /* reserve TLB table */
-       gd->arch.tlb_size = 4096 * 4;
+       gd->arch.tlb_size = PGTABLE_SIZE;
        addr -= gd->arch.tlb_size;
 
        /* round down to next 64 kB limit */
@@ -419,6 +415,7 @@ void board_init_f(ulong bootflag)
        }
 #endif
 
+#ifndef CONFIG_ARM64
        /* setup stackpointer for exeptions */
        gd->irq_sp = addr_sp;
 #ifdef CONFIG_USE_IRQ
@@ -431,11 +428,14 @@ void board_init_f(ulong bootflag)
 
        /* 8-byte alignment for ABI compliance */
        addr_sp &= ~0x07;
+#else  /* CONFIG_ARM64 */
+       /* 16-byte alignment for ABI compliance */
+       addr_sp &= ~0x0f;
+#endif /* CONFIG_ARM64 */
 #else
        addr_sp += 128; /* leave 32 words for abort-stack   */
        gd->irq_sp = addr_sp;
 #endif
-       interrupt_init();
 
        debug("New Stack Pointer is: %08lx\n", addr_sp);
 
@@ -637,6 +637,8 @@ void board_init_r(gd_t *id, ulong dest_addr)
        misc_init_r();
 #endif
 
+        /* set up exceptions */
+       interrupt_init();
        /* enable exceptions */
        enable_interrupts();