board_f: Drop setup_dram_config() wrapper
[oweals/u-boot.git] / board / samsung / common / board.c
index 1a4e8c9c99a1d6520cb824052cd19f004ccc0760..49e4db2de95080779619e2782c7ce6c0b9df9a5f 100644 (file)
@@ -27,6 +27,8 @@
 #include <usb.h>
 #include <dwc3-uboot.h>
 #include <samsung/misc.h>
+#include <dm/pinctrl.h>
+#include <dm.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -97,7 +99,7 @@ int board_init(void)
 int dram_init(void)
 {
        unsigned int i;
-       u32 addr;
+       unsigned long addr;
 
        for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
                addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE);
@@ -106,10 +108,10 @@ int dram_init(void)
        return 0;
 }
 
-void dram_init_banksize(void)
+int dram_init_banksize(void)
 {
        unsigned int i;
-       u32 addr, size;
+       unsigned long addr, size;
 
        for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
                addr = CONFIG_SYS_SDRAM_BASE + (i * SDRAM_BANK_SIZE);
@@ -118,10 +120,13 @@ void dram_init_banksize(void)
                gd->bd->bi_dram[i].start = addr;
                gd->bd->bi_dram[i].size = size;
        }
+
+       return 0;
 }
 
 static int board_uart_init(void)
 {
+#ifndef CONFIG_PINCTRL_EXYNOS
        int err, uart_id, ret = 0;
 
        for (uart_id = PERIPH_ID_UART0; uart_id <= PERIPH_ID_UART3; uart_id++) {
@@ -133,6 +138,9 @@ static int board_uart_init(void)
                }
        }
        return ret;
+#else
+       return 0;
+#endif
 }
 
 #ifdef CONFIG_BOARD_EARLY_INIT_F
@@ -152,20 +160,6 @@ int board_early_init_f(void)
        board_i2c_init(gd->fdt_blob);
 #endif
 
-#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_EXYNOS_FB)
-/*
- * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs
- * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix, to reserve
- * FB memory at a very early stage. So, we need to fill panel_info.vl_col,
- * panel_info.vl_row and panel_info.vl_bpix before lcd_setmem() is called.
- */
-       err = exynos_lcd_early_init(gd->fdt_blob);
-       if (err) {
-               debug("LCD early init failed\n");
-               return err;
-       }
-#endif
-
        return exynos_early_init_f();
 }
 #endif
@@ -179,7 +173,6 @@ int power_init_board(void)
 }
 #endif
 
-#ifdef CONFIG_OF_CONTROL
 #ifdef CONFIG_SMC911X
 static int decode_sromc(const void *blob, struct fdt_sromc *config)
 {
@@ -260,7 +253,7 @@ int board_eth_init(bd_t *bis)
 #ifdef CONFIG_GENERIC_MMC
 static int init_mmc(void)
 {
-#ifdef CONFIG_SDHCI
+#ifdef CONFIG_MMC_SDHCI
        return exynos_mmc_init(gd->fdt_blob);
 #else
        return 0;
@@ -269,7 +262,7 @@ static int init_mmc(void)
 
 static int init_dwmmc(void)
 {
-#ifdef CONFIG_DWMMC
+#ifdef CONFIG_MMC_DW
        return exynos_dwmmc_init(gd->fdt_blob);
 #else
        return 0;
@@ -304,13 +297,12 @@ int checkboard(void)
        printf("Board: %s\n", board_info ? board_info : "unknown");
 #ifdef CONFIG_BOARD_TYPES
        board_info = get_board_type();
-
-       printf("Model: %s\n", board_info ? board_info : "unknown");
+       if (board_info)
+               printf("Type:  %s\n", board_info);
 #endif
        return 0;
 }
 #endif
-#endif /* CONFIG_OF_CONTROL */
 
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)