summaryrefslogtreecommitdiff
path: root/board/samsung
diff options
context:
space:
mode:
authorRajeshwari Shinde <rajeshwari.s@samsung.com>2012-07-23 21:23:55 +0000
committerHeiko Schocher <hs@denx.de>2012-07-31 08:03:19 +0200
commitc82b050ead18081a594a66c913124b4e5e6c004c (patch)
treee3db75bd9263b7bd2a796ac680235a2ecb009474 /board/samsung
parent178239de194a0e84d07b8e48fb74cb156f654d75 (diff)
CONFIG: SMDK5250: I2C: Enable I2C
This enables I2C support on smdk5250. Pinmux setting moved to board file to avoid repeated setting of gpio lines. Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/samsung')
-rw-r--r--board/samsung/smdk5250/smdk5250.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index 3b078da65d8..fae7d6f0ed6 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <asm/io.h>
+#include <i2c.h>
#include <netdev.h>
#include <asm/arch/cpu.h>
#include <asm/arch/gpio.h>
@@ -172,9 +173,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