]> git.sur5r.net Git - u-boot/blobdiff - board/samsung/smdk5250/smdk5250.c
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
[u-boot] / board / samsung / smdk5250 / smdk5250.c
index 3b078da65d86ab2174f2b14b64a43a307ea51fe9..4c50342e5cdcb7145e3faa035243bab222688de4 100644 (file)
 
 #include <common.h>
 #include <asm/io.h>
+#include <i2c.h>
 #include <netdev.h>
+#include <spi.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/sromc.h>
+#include <pmic.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -62,6 +65,12 @@ static int smc9115_pre_init(void)
 int board_init(void)
 {
        gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
+#if defined(CONFIG_PMIC)
+       pmic_init();
+#endif
+#ifdef CONFIG_EXYNOS_SPI
+       spi_init();
+#endif
        return 0;
 }
 
@@ -130,13 +139,13 @@ int board_mmc_init(bd_t *bis)
 {
        int err;
 
-       err = exynos_pinmux_config(PERIPH_ID_SDMMC2, PINMUX_FLAG_NONE);
+       err = exynos_pinmux_config(PERIPH_ID_SDMMC0, PINMUX_FLAG_8BIT_MODE);
        if (err) {
-               debug("SDMMC2 not configured\n");
+               debug("SDMMC0 not configured\n");
                return err;
        }
 
-       err = s5p_mmc_init(2, 4);
+       err = s5p_mmc_init(0, 8);
        return err;
 }
 #endif
@@ -172,9 +181,36 @@ static int board_uart_init(void)
        return 0;
 }
 
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+static int board_i2c_init(void)
+{
+       int i, err;
+
+       for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
+               err = exynos_pinmux_config((PERIPH_ID_I2C0 + i),
+                                               PINMUX_FLAG_NONE);
+               if (err) {
+                       debug("I2C%d not configured\n", (PERIPH_ID_I2C0 + i));
+                       return err;
+               }
+       }
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+       return 0;
+}
+#endif
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
-       return board_uart_init();
+       int err;
+       err = board_uart_init();
+       if (err) {
+               debug("UART init failed\n");
+               return err;
+       }
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+       err = board_i2c_init();
+#endif
+       return err;
 }
 #endif