diff options
author | Scott Sweeny <scott.sweeny@timesys.com> | 2009-04-29 17:22:04 -0400 |
---|---|---|
committer | Scott Sweeny <scott.sweeny@timesys.com> | 2009-04-29 17:22:04 -0400 |
commit | 062076cf3fd5fb8aecbd2157933e01fe28ad827f (patch) | |
tree | d66877d602cf257a6e0a72b3fbcd917e9d9841e7 | |
parent | 13c7c993f472eec5b9961750056c57f4f1494c0f (diff) |
I2C driver for OMAP3430LV SOM
This patch originally from LogicPD OMAP35x Release 1.5.0
Original Patch Name: u-boot-1.1.4-omap3430-lv-som-07.patch
-rw-r--r-- | board/omap3430lv_som/nand.c | 2 | ||||
-rw-r--r-- | board/omap3430lv_som/omap3430lv_som.c | 33 | ||||
-rw-r--r-- | board/omap3430lv_som/sys_info.c | 2 | ||||
-rw-r--r-- | common/env_nand.c | 2 | ||||
-rw-r--r-- | drivers/omap24xx_i2c.c | 4 | ||||
-rw-r--r-- | include/configs/omap3530lv_som.h | 3 |
6 files changed, 41 insertions, 5 deletions
diff --git a/board/omap3430lv_som/nand.c b/board/omap3430lv_som/nand.c index a1489b6b97..3246690ab8 100644 --- a/board/omap3430lv_som/nand.c +++ b/board/omap3430lv_som/nand.c @@ -532,6 +532,8 @@ void board_post_nand_init(struct mtd_info *mtd) // Set u-boot environment offset as *last* block in NAND boot_flash_off = this->chipsize - (1<<this->phys_erase_shift); + printk("%s: boot_flash_off 0x%x\n", __FUNCTION__, boot_flash_off); + } #endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */ diff --git a/board/omap3430lv_som/omap3430lv_som.c b/board/omap3430lv_som/omap3430lv_som.c index 472d2b6f98..a4220dca41 100644 --- a/board/omap3430lv_som/omap3430lv_som.c +++ b/board/omap3430lv_som/omap3430lv_som.c @@ -266,6 +266,36 @@ int misc_init_r(void) #ifdef CONFIG_DRIVER_OMAP34XX_I2C i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE); #endif + +#ifdef CONFIG_DRIVER_OMAP34XX_I2C + + { + unsigned char data; + unsigned short msg; + + // Need to turn on VAUX1 to 3.0v to driver level + // shifters and power the production data chip as well + // as the TSC2004 touch controller + + // Select the output voltage + data = 0x04; + i2c_write(I2C_TRITON2, 0x72, 1, &data, 1); + // Select the Processor resource group + data = 0x20; + i2c_write(I2C_TRITON2, 0x72, 1, &data, 1); + // Enable I2C access to the Power bus + data = 0x02; + i2c_write(I2C_TRITON2, 0x4a, 1, &data, 1); + // Send message MSB + msg = (1<<13) | (1<<4) | (0xd<<0); // group(process_grp1):resource(vaux1):res_active; + data = msg >> 8; + i2c_write(I2C_TRITON2, 0x4b, 1, &data, 1); + // Send message LSB + data = msg & 0xff; + i2c_write(I2C_TRITON2, 0x4c, 1, &data, 1); + } +#endif + ether_init(); /* better done here so timers are init'ed */ return (0); } @@ -358,6 +388,7 @@ int dram_init(void) /* fixme... dont know why this func is crashing in ZeBu */ display_board_info(btype); #endif + /* If a second bank of DDR is attached to CS1 this is * where it can be started. Early init code will init * memory on CS0. @@ -373,6 +404,8 @@ int dram_init(void) gd->bd->bi_dram[1].start = PHYS_SDRAM_1+size0; gd->bd->bi_dram[1].size = size1; + + return 0; } diff --git a/board/omap3430lv_som/sys_info.c b/board/omap3430lv_som/sys_info.c index eaeeffe8c0..b961555f66 100644 --- a/board/omap3430lv_som/sys_info.c +++ b/board/omap3430lv_som/sys_info.c @@ -258,7 +258,7 @@ void display_board_info(u32 btype) printf("OMAP%s-%s rev %d, CPU-OPP%s L3-%sMHz\n", cpu_s, sec_s, rev, p_cpu, p_l3); - printf("OMAP3430LAB %s Version + %s (Boot %s)\n", db_s, + printf("OMAP3430LV_SOM %s Version + %s (Boot %s)\n", db_s, mem_s, bootmode[2]); } diff --git a/common/env_nand.c b/common/env_nand.c index b00d649197..b5b4e98bdc 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -291,7 +291,7 @@ void env_relocate_spec (void) ulong total; int ret; - // printf("%s: off 0x%x size 0x%x read %p\n", __FUNCTION__, CFG_ENV_OFFSET, CFG_ENV_SIZE, nand_info[0].read); + printf("%s: off 0x%x size 0x%x read %p\n", __FUNCTION__, CFG_ENV_OFFSET, CFG_ENV_SIZE, nand_info[0].read); total = CFG_ENV_SIZE; ret = nand_read(&nand_info[0], CFG_ENV_OFFSET, &total, (u_char*)env_ptr); if (ret || total != CFG_ENV_SIZE) diff --git a/drivers/omap24xx_i2c.c b/drivers/omap24xx_i2c.c index 8fe641f810..cbce3064d5 100644 --- a/drivers/omap24xx_i2c.c +++ b/drivers/omap24xx_i2c.c @@ -31,7 +31,7 @@ static u32 i2c_base = I2C_DEFAULT_BASE; static u32 i2c_speed = CFG_I2C_SPEED; -//#define DEBUG +// #define DEBUG 1 #if DEBUG @@ -450,7 +450,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar * buffer, int len) for (i = 0; i < len; i++) { if (i2c_write_byte(chip, addr + i, buffer[i])) { - printf("I2C read: I/O error\n"); + printf("I2C write: I/O error\n"); i2c_init(i2c_speed, CFG_I2C_SLAVE); return 1; } diff --git a/include/configs/omap3530lv_som.h b/include/configs/omap3530lv_som.h index 397dbb1e9e..fb9eef1ddc 100644 --- a/include/configs/omap3530lv_som.h +++ b/include/configs/omap3530lv_som.h @@ -175,7 +175,8 @@ "ramdisksize=45000\0" \ "nfsoptions=,wsize=1500,rsize=1500\0" \ "nfsboot=setenv bootargs display=${display} console=${consoledev},${baudrate} root=/dev/nfs rw nfsroot=${serverip}:${rootpath}${nfsoptions} ip=dhcp;tftpboot ${loadaddr} uImage;bootm ${loadaddr}\0" \ - "ramboot=setenv bootargs display=${display} console=${consoledev},${baudrate} root=/dev/ram rw ramdisk_size=${ramdisksize};tftpboot ${loadaddr} uImage;tftpboot ${rootfsaddr} rootfs.ext2.gz.uboot;bootm ${loadaddr} ${rootfsaddr}\0" + "ramboot=setenv bootargs display=${display} console=${consoledev},${baudrate} root=/dev/ram rw ramdisk_size=${ramdisksize};tftpboot ${loadaddr} uImage;tftpboot ${rootfsaddr} rootfs.ext2.gz.uboot;bootm ${loadaddr} ${rootfsaddr}\0" \ + "xipboot=setenv bootargs display=${display} console=${consoledev},${baudrate} root=/dev/ram rw ramdisk_size=${ramdisksize};bootm ${loadaddr} ${rootfsaddr}\0" #endif #else #define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=/dev/nfs rw nfsroot=192.168.3.5:/opt/nfs-exports/ltib-omap ip=dhcp" |