This patch adds I2C support for OMAP3 and fixes JFFS2 warnings Signed-off-by: Sunil Kumar Shashi Ranjan Syed Mohammed Khasim --- drivers/i2c/omap24xx_i2c.c | 35 ++++++++++++++++++++++++++++++----- u-boot_beagle/fs/jffs2/jffs2_1pass.c | 6 +++++- 2 files changed, 35 insertions(+), 6 deletions(-) --- orig_u-boot/drivers/i2c/omap24xx_i2c.c 2008-03-10 11:58:19.000000000 +0530 +++ u-boot_beagle/drivers/i2c/omap24xx_i2c.c 2008-04-02 11:44:34.000000000 +0530 @@ -22,11 +22,13 @@ #include -#ifdef CONFIG_DRIVER_OMAP24XX_I2C +#if defined(CONFIG_DRIVER_OMAP24XX_I2C) || defined(CONFIG_DRIVER_OMAP34XX_I2C) #include #include +#define inb(a) __raw_readb(a) +#define outb(a,v) __raw_writeb(a,v) #define inw(a) __raw_readw(a) #define outw(a,v) __raw_writew(a,v) @@ -114,7 +116,11 @@ static int i2c_read_byte (u8 devaddr, u8 status = wait_for_pin (); if (status & I2C_STAT_RRDY) { - *value = inw (I2C_DATA); +#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) + *value = inb(I2C_DATA); +#else + *value = inw(I2C_DATA); +#endif udelay (20000); } else { i2c_error = 1; @@ -155,8 +161,23 @@ static int i2c_write_byte (u8 devaddr, u status = wait_for_pin (); if (status & I2C_STAT_XRDY) { - /* send out two bytes */ - outw ((value << 8) + regoffset, I2C_DATA); +#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) + /* send out 1 byte */ + outb(regoffset, I2C_DATA); + outw(I2C_STAT_XRDY, I2C_STAT); + status = wait_for_pin(); + if ((status & I2C_STAT_XRDY)) { + /* send out next 1 byte */ + outb(value, I2C_DATA); + outw(I2C_STAT_XRDY, I2C_STAT); + } else { + i2c_error = 1; + } +#else + /* send out two bytes */ + outw ((value << 8) + regoffset, I2C_DATA); +#endif + /* must have enough delay to allow BB bit to go low */ udelay (50000); if (inw (I2C_STAT) & I2C_STAT_NACK) { @@ -193,7 +214,11 @@ static void flush_fifo(void) while(1){ stat = inw(I2C_STAT); if(stat == I2C_STAT_RRDY){ - inw(I2C_DATA); +#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) + inb(I2C_DATA); +#else + inw(I2C_DATA); +#endif outw(I2C_STAT_RRDY,I2C_STAT); udelay(1000); }else diff -purN orig_u-boot/fs/jffs2/jffs2_1pass.c u-boot_beagle/fs/jffs2/jffs2_1pass.c --- orig_u-boot/fs/jffs2/jffs2_1pass.c 2008-03-10 11:58:19.000000000 +0530 +++ u-boot_beagle/fs/jffs2/jffs2_1pass.c 2008-04-02 11:06:04.000000000 +0530 @@ -310,7 +310,9 @@ static inline void *get_node_mem_nor(u32 */ static inline void *get_fl_mem(u32 off, u32 size, void *ext_buf) { +#if (defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)) || defined(ONFIG_CMD_FLASH) struct mtdids *id = current_part->dev->id; +#endif #if defined(CONFIG_CMD_FLASH) if (id->type == MTD_DEV_TYPE_NOR) @@ -328,7 +330,9 @@ static inline void *get_fl_mem(u32 off, static inline void *get_node_mem(u32 off) { - struct mtdids *id = current_part->dev->id; +#if (defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)) || defined(ONFIG_CMD_FLASH) + struct mtdids *id = current_part->dev->id; +#endif #if defined(CONFIG_CMD_FLASH) if (id->type == MTD_DEV_TYPE_NOR)