Merge branch 'master' of git://git.denx.de/u-boot-arm
[platform/kernel/u-boot.git] / board / samsung / smdkv310 / smdkv310.c
index d9caca7..015b920 100644 (file)
 #include <asm/arch/cpu.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/periph.h>
+#include <asm/arch/pinmux.h>
 #include <asm/arch/sromc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
-struct s5pc210_gpio_part1 *gpio1;
-struct s5pc210_gpio_part2 *gpio2;
+struct exynos4_gpio_part1 *gpio1;
+struct exynos4_gpio_part2 *gpio2;
 
 static void smc9115_pre_init(void)
 {
@@ -52,8 +54,8 @@ static void smc9115_pre_init(void)
 
 int board_init(void)
 {
-       gpio1 = (struct s5pc210_gpio_part1 *) S5PC210_GPIO_PART1_BASE;
-       gpio2 = (struct s5pc210_gpio_part2 *) S5PC210_GPIO_PART2_BASE;
+       gpio1 = (struct exynos4_gpio_part1 *) EXYNOS4_GPIO_PART1_BASE;
+       gpio2 = (struct exynos4_gpio_part2 *) EXYNOS4_GPIO_PART2_BASE;
 
        smc9115_pre_init();
 
@@ -137,3 +139,47 @@ int board_mmc_init(bd_t *bis)
        return err;
 }
 #endif
+
+static int board_uart_init(void)
+{
+       int err;
+
+       err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("UART0 not configured\n");
+               return err;
+       }
+
+       err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("UART1 not configured\n");
+               return err;
+       }
+
+       err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("UART2 not configured\n");
+               return err;
+       }
+
+       err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("UART3 not configured\n");
+               return err;
+       }
+
+       return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+       int err;
+       err = board_uart_init();
+       if (err) {
+               debug("UART init failed\n");
+               return err;
+       }
+       return err;
+}
+#endif