summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2012-07-31 22:07:42 +0200
committerWolfgang Denk <wd@denx.de>2012-07-31 22:07:42 +0200
commit948fa1713cce09dd958bda41eb5c97015a217f91 (patch)
tree26ccc8735233389f214af564a4bfc75a7e041668 /board
parentd978780b2e676c005460cd561f4f15b5220bdf49 (diff)
parente69e482bbf16795539af112d6a21d4ddaee35105 (diff)
downloadu-boot-imx-948fa1713cce09dd958bda41eb5c97015a217f91.zip
u-boot-imx-948fa1713cce09dd958bda41eb5c97015a217f91.tar.gz
u-boot-imx-948fa1713cce09dd958bda41eb5c97015a217f91.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-i2c
* 'master' of git://git.denx.de/u-boot-i2c: km/common: remove printfs for i2c deblocking code CONFIG: SMDK5250: I2C: Enable I2C I2C: Add support for Multi channel I2C: Modify the I2C driver for EXYNOS5 I2C: Move struct s3c24x0_i2c to a common place. EXYNOS: PINMUX: Add pinmux support for I2C EXYNOS5: define EXYNOS5_I2C_SPACING EXYNOS: Add I2C base address. EXYNOS: CLK: Add i2c clock mx6qsabrelite: add i2c multi-bus support imx-common: add i2c.c for bus recovery support i.mx53: add definition for I2C3_BASE_ADDR i.mx: iomux-v3.c: move to imx-common directory i.mx: iomux-v3.h: move to imx-common include directory iomux-v3: remove include of mx6x_pins.h mxc_i2c: finish adding CONFIG_I2C_MULTI_BUS support mxc_i2c: add bus recovery support mxc_i2c: prep work for multiple busses support mxc_i2c: add i2c_regs argument to i2c_imx_stop mxc_i2c: add retries mxc_i2c: check for arbitration lost mxc_i2c: change slave addr if conflicts with destination. mxc_i2c: don't disable controller after every transaction mxc_i2c: place i2c_reset code inline mxc_i2c: place imx_start code inline mxc_i2c: remove redundant read mxc_i2c: combine i2c_imx_bus_busy and i2c_imx_trx_complete into wait_for_sr_state mxc_i2c.c: code i2c_probe as a 0 length i2c_write mxc_i2c: call i2c_imx_stop on error in i2c_read/i2c_write mxc_i2c: create i2c_init_transfer mxc_i2c: clear i2sr before waiting for bit mxc_i2c: create tx_byte function mxc_i2c: remove ifdef of CONFIG_HARD_I2C mxc_i2c: fix i2c_imx_stop i2c: deblock i2c bus also if accessed before realocation Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/mx6qarm2/mx6qarm2.c2
-rw-r--r--board/freescale/mx6qsabrelite/mx6qsabrelite.c54
-rw-r--r--board/keymile/common/common.c3
-rw-r--r--board/samsung/smdk5250/smdk5250.c30
4 files changed, 78 insertions, 11 deletions
diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c
index 1367b88..340c4c4 100644
--- a/board/freescale/mx6qarm2/mx6qarm2.c
+++ b/board/freescale/mx6qarm2/mx6qarm2.c
@@ -24,9 +24,9 @@
#include <asm/io.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/mx6x_pins.h>
-#include <asm/arch/iomux-v3.h>
#include <asm/errno.h>
#include <asm/gpio.h>
+#include <asm/imx-common/iomux-v3.h>
#include <mmc.h>
#include <fsl_esdhc.h>
#include <miiphy.h>
diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index 0eae96d..01e5083 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -22,12 +22,13 @@
#include <common.h>
#include <asm/io.h>
+#include <asm/arch/clock.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/mx6x_pins.h>
-#include <asm/arch/iomux-v3.h>
-#include <asm/arch/clock.h>
#include <asm/errno.h>
#include <asm/gpio.h>
+#include <asm/imx-common/iomux-v3.h>
+#include <asm/imx-common/mxc_i2c.h>
#include <mmc.h>
#include <fsl_esdhc.h>
#include <micrel.h>
@@ -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();
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 1013f42..a90f112 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);
diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index 3b078da..fae7d6f 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