From b4116ede36da628a517a94d6cba9dba4a02104a4 Mon Sep 17 00:00:00 2001 From: "Patil, Rachna" Date: Sun, 22 Jan 2012 23:47:01 +0000 Subject: ARM: AM33XX: Add i2c support Add i2c driver board hookup for AM335X EVM Signed-off-by: Chandan Nath Signed-off-by: Patil, Rachna --- board/ti/am335x/evm.c | 7 +++++++ board/ti/am335x/mux.c | 13 +++++++++++++ 2 files changed, 20 insertions(+) (limited to 'board/ti') diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c index 6a9f788299..13dc60361a 100644 --- a/board/ti/am335x/evm.c +++ b/board/ti/am335x/evm.c @@ -18,6 +18,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -42,6 +43,12 @@ int init_basic_setup(void) int board_init(void) { enable_uart0_pin_mux(); + +#ifdef CONFIG_I2C + enable_i2c0_pin_mux(); + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +#endif + init_basic_setup(); return 0; diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c index 4cb0cdf361..9ccb43642b 100644 --- a/board/ti/am335x/mux.c +++ b/board/ti/am335x/mux.c @@ -272,6 +272,14 @@ static struct module_pin_mux mmc0_pin_mux[] = { }; #endif +static struct module_pin_mux i2c0_pin_mux[] = { + {OFFSET(i2c0_sda), (MODE(0) | RXACTIVE | + PULLUDEN | SLEWCTRL)}, /* I2C_DATA */ + {OFFSET(i2c0_scl), (MODE(0) | RXACTIVE | + PULLUDEN | SLEWCTRL)}, /* I2C_SCLK */ + {-1}, +}; + /* * Configure the pin mux for the module */ @@ -297,3 +305,8 @@ void enable_mmc0_pin_mux(void) configure_module_pin_mux(mmc0_pin_mux); } #endif + +void enable_i2c0_pin_mux(void) +{ + configure_module_pin_mux(i2c0_pin_mux); +} -- cgit v1.2.3