From af2a35fb1f432c78e6181172ff4df34d37ff5154 Mon Sep 17 00:00:00 2001 From: Troy Kisky Date: Thu, 19 Jul 2012 08:18:22 +0000 Subject: i.mx: iomux-v3.h: move to imx-common include directory Signed-off-by: Troy Kisky --- board/freescale/mx6qarm2/mx6qarm2.c | 2 +- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c index 1367b880285..340c4c4393b 100644 --- a/board/freescale/mx6qarm2/mx6qarm2.c +++ b/board/freescale/mx6qarm2/mx6qarm2.c @@ -24,9 +24,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 0eae96d3a37..34f65e98e47 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -22,12 +22,12 @@ #include #include +#include #include #include -#include -#include #include #include +#include #include #include #include -- cgit v1.2.3 From 9c06782863a9add2e75e940cf375ebb44a273212 Mon Sep 17 00:00:00 2001 From: Troy Kisky Date: Thu, 19 Jul 2012 08:18:26 +0000 Subject: mx6qsabrelite: add i2c multi-bus support This includes bus recovery support. Signed-off-by: Troy Kisky Acked-by: Jason Liu --- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 50 ++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'board') diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 34f65e98e47..01e508354aa 100644 --- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c +++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -77,9 +78,48 @@ iomux_v3_cfg_t uart2_pads[] = { MX6Q_PAD_EIM_D27__UART2_RXD | MUX_PAD_CTRL(UART_PAD_CTRL), }; -iomux_v3_cfg_t i2c3_pads[] = { - MX6Q_PAD_GPIO_5__I2C3_SCL | MUX_PAD_CTRL(I2C_PAD_CTRL), - MX6Q_PAD_GPIO_16__I2C3_SDA | MUX_PAD_CTRL(I2C_PAD_CTRL), +#define PC MUX_PAD_CTRL(I2C_PAD_CTRL) + +/* I2C1, SGTL5000 */ +struct i2c_pads_info i2c_pad_info0 = { + .scl = { + .i2c_mode = MX6Q_PAD_EIM_D21__I2C1_SCL | PC, + .gpio_mode = MX6Q_PAD_EIM_D21__GPIO_3_21 | PC, + .gp = GPIO_NUMBER(3, 21) + }, + .sda = { + .i2c_mode = MX6Q_PAD_EIM_D28__I2C1_SDA | PC, + .gpio_mode = MX6Q_PAD_EIM_D28__GPIO_3_28 | PC, + .gp = GPIO_NUMBER(3, 28) + } +}; + +/* I2C2 Camera, MIPI */ +struct i2c_pads_info i2c_pad_info1 = { + .scl = { + .i2c_mode = MX6Q_PAD_KEY_COL3__I2C2_SCL | PC, + .gpio_mode = MX6Q_PAD_KEY_COL3__GPIO_4_12 | PC, + .gp = GPIO_NUMBER(4, 12) + }, + .sda = { + .i2c_mode = MX6Q_PAD_KEY_ROW3__I2C2_SDA | PC, + .gpio_mode = MX6Q_PAD_KEY_ROW3__GPIO_4_13 | PC, + .gp = GPIO_NUMBER(4, 13) + } +}; + +/* I2C3, J15 - RGB connector */ +struct i2c_pads_info i2c_pad_info2 = { + .scl = { + .i2c_mode = MX6Q_PAD_GPIO_5__I2C3_SCL | PC, + .gpio_mode = MX6Q_PAD_GPIO_5__GPIO_1_5 | PC, + .gp = GPIO_NUMBER(1, 5) + }, + .sda = { + .i2c_mode = MX6Q_PAD_GPIO_16__I2C3_SDA | PC, + .gpio_mode = MX6Q_PAD_GPIO_16__GPIO_7_11 | PC, + .gp = GPIO_NUMBER(7, 11) + } }; iomux_v3_cfg_t usdhc3_pads[] = { @@ -346,7 +386,9 @@ int board_init(void) #ifdef CONFIG_MXC_SPI setup_spi(); #endif - imx_iomux_v3_setup_multiple_pads(i2c3_pads, ARRAY_SIZE(i2c3_pads)); + setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0); + setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); + setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); #ifdef CONFIG_CMD_SATA setup_sata(); -- cgit v1.2.3 From c82b050ead18081a594a66c913124b4e5e6c004c Mon Sep 17 00:00:00 2001 From: Rajeshwari Shinde Date: Mon, 23 Jul 2012 21:23:55 +0000 Subject: 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 Signed-off-by: Doug Anderson Signed-off-by: Rajeshwari Shinde Acked-by: Simon Glass --- board/samsung/smdk5250/smdk5250.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'board') 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 #include +#include #include #include #include @@ -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 -- cgit v1.2.3 From e69e482bbf16795539af112d6a21d4ddaee35105 Mon Sep 17 00:00:00 2001 From: Holger Brunck Date: Fri, 27 Jul 2012 04:58:13 +0000 Subject: km/common: remove printfs for i2c deblocking code This code will also be used before reallocation and during this time we are not allowed to do these printings. Signed-off-by: Holger Brunck Acked-by: Prafulla Wadaskar Acked-by: Heiko Schocher --- board/keymile/common/common.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'board') diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 1013f42e11e..a90f1124fbe 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -151,7 +151,6 @@ int i2c_make_abort(void) sda_state = get_sda(); if (scl_state && sda_state) { ret = 0; - printf("[INFO] i2c abort after %d clocks\n", i); break; } } @@ -159,8 +158,6 @@ int i2c_make_abort(void) if (ret == 0) for (i = 0; i < 5; i++) i2c_write_start_seq(); - else - printf("[ERROR] i2c abort failed\n"); /* respect stop setup time */ udelay(DELAY_ABORT_SEQ); -- cgit v1.2.3