Merge tag 'video-for-2021.01-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot...
[platform/kernel/u-boot.git] / common / board_f.c
index e670155..9f441c4 100644 (file)
@@ -215,8 +215,6 @@ static int announce_dram_init(void)
 static int show_dram_config(void)
 {
        unsigned long long size;
-
-#ifdef CONFIG_NR_DRAM_BANKS
        int i;
 
        debug("\nRAM Configuration:\n");
@@ -229,9 +227,6 @@ static int show_dram_config(void)
 #endif
        }
        debug("\nDRAM:  ");
-#else
-       size = gd->ram_size;
-#endif
 
        print_size(size, "");
        board_add_ram_info(0);
@@ -242,10 +237,8 @@ static int show_dram_config(void)
 
 __weak int dram_init_banksize(void)
 {
-#if defined(CONFIG_NR_DRAM_BANKS) && defined(CONFIG_SYS_SDRAM_BASE)
-       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_dram[0].start = gd->ram_base;
        gd->bd->bi_dram[0].size = get_effective_memsize();
-#endif
 
        return 0;
 }
@@ -254,11 +247,7 @@ __weak int dram_init_banksize(void)
 static int init_func_i2c(void)
 {
        puts("I2C:   ");
-#ifdef CONFIG_SYS_I2C
        i2c_init_all();
-#else
-       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-#endif
        puts("ready\n");
        return 0;
 }
@@ -403,6 +392,8 @@ static int reserve_video(void)
        ret = video_reserve(&addr);
        if (ret)
                return ret;
+       debug("Reserving %luk for video at: %08lx\n",
+             (unsigned long)gd->relocaddr - addr, addr);
        gd->relocaddr = addr;
 #elif defined(CONFIG_LCD)
 #  ifdef CONFIG_FB_ADDR
@@ -584,7 +575,9 @@ static int reserve_stacks(void)
 static int reserve_bloblist(void)
 {
 #ifdef CONFIG_BLOBLIST
-       gd->start_addr_sp = reserve_stack_aligned(CONFIG_BLOBLIST_SIZE);
+       /* Align to a 4KB boundary for easier reading of addresses */
+       gd->start_addr_sp = ALIGN_DOWN(gd->start_addr_sp - CONFIG_BLOBLIST_SIZE,
+                                      0x1000);
        gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE);
 #endif
 
@@ -607,9 +600,6 @@ int setup_bdinfo(void)
 {
        struct bd_info *bd = gd->bd;
 
-       bd->bi_memstart = gd->ram_base;  /* start of memory */
-       bd->bi_memsize = gd->ram_size;   /* size in bytes */
-
        if (IS_ENABLED(CONFIG_SYS_HAS_SRAM)) {
                bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */
                bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;  /* size  of SRAM */
@@ -618,13 +608,6 @@ int setup_bdinfo(void)
        return arch_setup_bdinfo();
 }
 
-#if defined(CONFIG_MIPS) || defined(CONFIG_SH)
-static int setup_board_part1(void)
-{
-       return 0;
-}
-#endif
-
 #ifdef CONFIG_POST
 static int init_post(void)
 {
@@ -926,6 +909,9 @@ static const init_fnc_t init_sequence_f[] = {
         *  - board info struct
         */
        setup_dest_addr,
+#ifdef CONFIG_OF_BOARD_FIXUP
+       fix_fdt,
+#endif
 #ifdef CONFIG_PRAM
        reserve_pram,
 #endif
@@ -945,15 +931,9 @@ static const init_fnc_t init_sequence_f[] = {
        reserve_stacks,
        dram_init_banksize,
        show_dram_config,
-       setup_bdinfo,
-#if defined(CONFIG_MIPS) || defined(CONFIG_SH)
-       setup_board_part1,
-#endif
        INIT_FUNC_WATCHDOG_RESET
+       setup_bdinfo,
        display_new_sp,
-#ifdef CONFIG_OF_BOARD_FIXUP
-       fix_fdt,
-#endif
        INIT_FUNC_WATCHDOG_RESET
        reloc_fdt,
        reloc_bootstage,