summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2009-02-24 11:30:34 +0100
committerKim Phillips <kim.phillips@freescale.com>2009-03-05 18:21:17 -0600
commit19f0e93041dbfe22f8d39b98e4f7f9ea87b77803 (patch)
treedaee9618bf97254766a44843f66bd797732b6d4f /board
parentdb1d72afd77287bc8577210f3f71ab249dcf146f (diff)
downloadu-boot-imx-19f0e93041dbfe22f8d39b98e4f7f9ea87b77803.zip
u-boot-imx-19f0e93041dbfe22f8d39b98e4f7f9ea87b77803.tar.gz
u-boot-imx-19f0e93041dbfe22f8d39b98e4f7f9ea87b77803.tar.bz2
83xx, kmeter1: add I2C, dtt, eeprom support
This patch adds I2C support for the Keymile kmeter1 board. It uses the First I2C Controller from the CPU, for accessing 4 temperature sensors, an eeprom with IVM data and the booteeprom over a pca9547 mux. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/keymile/common/common.c2
-rw-r--r--board/keymile/kmeter1/kmeter1.c33
2 files changed, 34 insertions, 1 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 1338950..48ce613 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -318,7 +318,7 @@ int ivm_read_eeprom (void)
if (buf != NULL)
dev_addr = simple_strtoul ((char *)buf, NULL, 16);
- if (eeprom_read (dev_addr, 0, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) != 0) {
+ if (i2c_read(dev_addr, 0, 1, i2c_buffer, CONFIG_SYS_IVM_EEPROM_MAX_LEN) != 0) {
printf ("Error reading EEprom\n");
return -2;
}
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/kmeter1/kmeter1.c
index f04a57a..a3c58ae 100644
--- a/board/keymile/kmeter1/kmeter1.c
+++ b/board/keymile/kmeter1/kmeter1.c
@@ -59,6 +59,23 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
{0, 0, 0, 0, QE_IOP_TAB_END},
};
+static int board_init_i2c_busses (void)
+{
+ I2C_MUX_DEVICE *dev = NULL;
+ uchar *buf;
+
+ /* Set up the Bus for the DTTs */
+ buf = (unsigned char *) getenv ("dtt_bus");
+ if (buf != NULL)
+ dev = i2c_mux_ident_muxstring (buf);
+ if (dev == NULL) {
+ printf ("Error couldn't add Bus for DTT\n");
+ printf ("please setup dtt_bus to where your\n");
+ printf ("DTT is found.\n");
+ }
+ return 0;
+}
+
int board_early_init_r (void)
{
void *reg = (void *)(CONFIG_SYS_IMMR + 0x14a8);
@@ -80,6 +97,13 @@ int board_early_init_r (void)
return 0;
}
+int misc_init_r (void)
+{
+ /* add board specific i2c busses */
+ board_init_i2c_busses ();
+ return 0;
+}
+
int fixed_sdram(void)
{
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
@@ -156,3 +180,12 @@ void ft_board_setup (void *blob, bd_t *bd)
ft_cpu_setup (blob, bd);
}
#endif
+
+#if defined(CONFIG_HUSH_INIT_VAR)
+extern int ivm_read_eeprom (void);
+int hush_init_var (void)
+{
+ ivm_read_eeprom ();
+ return 0;
+}
+#endif