diff options
author | Wolfgang Denk <wd@denx.de> | 2009-07-22 22:57:21 (GMT) |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-07-22 22:57:21 (GMT) |
commit | faca03ca0e7b16f551f10fa895cb8d4bbe0122a0 (patch) | |
tree | 7ff0f0dbb7c7b354371a4259d53b8f670146c2e7 /board | |
parent | 05c37340183ff097b29d66e8d7862fc21162bc6e (diff) | |
parent | 49a7720b215aa3da24bb13266c4c194012f499a6 (diff) | |
download | u-boot-faca03ca0e7b16f551f10fa895cb8d4bbe0122a0.tar.xz |
Merge branch 'master' of /home/wd/git/u-boot/custodians
Diffstat (limited to 'board')
-rw-r--r-- | board/keymile/common/common.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 2594623..ec27bda 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -424,6 +424,7 @@ static int get_scl (void) #endif +#if !defined(CONFIG_KMETER1) static void writeStartSeq (void) { set_sda (1); @@ -474,6 +475,7 @@ static int i2c_make_abort (void) get_sda (); return ret; } +#endif /** * i2c_init_board - reset i2c bus. When the board is powercycled during a @@ -481,6 +483,23 @@ static int i2c_make_abort (void) */ void i2c_init_board(void) { +#if defined(CONFIG_KMETER1) + struct fsl_i2c *dev; + dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET); + uchar dummy; + + out_8 (&dev->cr, (I2C_CR_MSTA)); + out_8 (&dev->cr, (I2C_CR_MEN | I2C_CR_MSTA)); + dummy = in_8(&dev->dr); + dummy = in_8(&dev->dr); + if (dummy != 0xff) { + dummy = in_8(&dev->dr); + } + out_8 (&dev->cr, (I2C_CR_MEN)); + out_8 (&dev->cr, 0x00); + out_8 (&dev->cr, (I2C_CR_MEN)); + +#else #if defined(CONFIG_HARD_I2C) volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR ; volatile i2c8260_t *i2c = (i2c8260_t *)&immap->im_i2c; @@ -500,6 +519,7 @@ void i2c_init_board(void) /* Set the PortPins back to use for I2C */ setports (0); #endif +#endif } #endif #endif |