diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2012-12-13 11:26:43 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-14 08:36:36 +0100 |
commit | 25fcfb2efa87a346e2ab83638a7985b516a7d7a2 (patch) | |
tree | 7a59f2f01a4ec6b70c865beb1b3a13b925ef3808 /arch/arm/boards/crystalfontz-cfa10036 | |
parent | 0ccb9aebcd98d99fdc22d938240c65c7466e8146 (diff) | |
download | barebox-25fcfb2efa87a346e2ab83638a7985b516a7d7a2.tar.gz barebox-25fcfb2efa87a346e2ab83638a7985b516a7d7a2.tar.xz |
ARM: cfa10036: Add the AT24HC02 I2C EEPROM
This EEPROM is found on the expansion boards available for the 10036
module. Since we won't need to do anything fancy except reading/writing
from it, use bitbanging to communicate with it.
This EEPROM will hold mostly the board_id so that we can determine if
there is an expansion board plugged in and what expansion board it is.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/crystalfontz-cfa10036')
-rw-r--r-- | arch/arm/boards/crystalfontz-cfa10036/cfa10036.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c index 522d2d783d..df0ead914c 100644 --- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c +++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c @@ -26,6 +26,10 @@ #include <net.h> #include <sizes.h> +#include <i2c/i2c.h> +#include <i2c/i2c-gpio.h> +#include <i2c/at24.h> + #include <mach/clock.h> #include <mach/imx-regs.h> #include <mach/iomux-imx28.h> @@ -58,6 +62,10 @@ static const uint32_t cfa10036_pads[] = { SSP0_SCK | VE_3_3V | BITKEEPER(0), /* MCI slot power control 1 = off */ PWM3_GPIO | VE_3_3V | GPIO_OUT | GPIO_VALUE(0), + + /* i2c0 */ + AUART0_TX_GPIO | VE_3_3V | PULLUP(1), + AUART0_RX_GPIO | VE_3_3V | PULLUP(1), }; static struct mxs_mci_platform_data mci_pdata = { @@ -67,6 +75,18 @@ static struct mxs_mci_platform_data mci_pdata = { .f_max = 25000000, }; +static struct i2c_board_info cfa10036_i2c_devices[] = { + { + I2C_BOARD_INFO("24c02", 0x50) + }, +}; + +static struct i2c_gpio_platform_data i2c_gpio_pdata = { + .sda_pin = 3 * 32 + 1, + .scl_pin = 3 * 32 + 0, + .udelay = 5, /* ~100 kHz */ +}; + static int cfa10036_mem_init(void) { arm_add_mem_device("ram0", IMX_MEMORY_BASE, 128 * 1024 * 1024); @@ -97,6 +117,9 @@ static int cfa10036_devices_init(void) add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, SZ_8K, IORESOURCE_MEM, NULL); + i2c_register_board_info(0, cfa10036_i2c_devices, ARRAY_SIZE(cfa10036_i2c_devices)); + add_generic_device_res("i2c-gpio", 0, NULL, 0, &i2c_gpio_pdata); + return 0; } device_initcall(cfa10036_devices_init); |