[U-Boot-Users] PATCH: Add command support for second I2C controller

Menon, Nishanth x0nishan at ti.com
Tue May 16 17:14:26 CEST 2006


Looks like my previous mail got blocked..
Here is the implementation I was speaking about:
common/cmd_i2c.c:
#if defined(CFG_I2C_BUS_SELECT)
int do_i2c_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
       int bus_idx, bus_spd, res = 0;
       if (argc < 3) {
               printf("Usage[%d]:\n%s\n", argc, cmdtp->usage);
               return 1;
       }
       bus_idx = simple_strtoul(argv[1], NULL, 16);
       bus_spd = simple_strtoul(argv[2], NULL, 16);
       printf("Setting bus[%d] to Speed[%d]: ", bus_idx, bus_spd);
       res = select_bus(bus_idx, bus_spd);
       if (res) {
               printf("FAILED\n");
       } else {
               printf("PASS\n");
       }
       return res;
}
#endif                         /* bus select */
#if defined(CFG_I2C_BUS_SELECT)
U_BOOT_CMD(ibus, 3, 1, do_i2c_bus,
          "ibus    - Select i2c Bus\n",
          "bus_index speed\n    - Selects the bus index and sets the
speed (0x64(ST),0x190(FS),0xD48(HS))\n"
          "      (reports success/failure)\n");
#endif
Each board implementation can choose to implement select_bus() and
implement logic to handle speed mods, once a user gives a ibus, they can
use old commands to control devices on the bus..
Regards,
Nishanth Menon

> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net [mailto:u-boot-users-
> admin at lists.sourceforge.net] On Behalf Of Menon, Nishanth
> Sent: Tuesday, May 16, 2006 10:11 AM
> To: bwarren at qstreams.com; u-boot-users at lists.sourceforge.net
> Subject: RE: [U-Boot-Users] PATCH: Add command support for second I2C
> controller
> 
> Hi Ben,
> Some reasons why I am against the approach of giving i2c bus along
with
> the command itself:
> 1. Cannot handle scenarios of HS controllers.
> 2. cmd_i2c is a debug interface, once a bus is selected, we would like
> to do read and write operations to a specific chip. To repeat the bus
> number all the time is a overhead.
> 3. To a smaller extent, older users need to be aware of the change
> involved.
> 4. a simpler and lesser intrusive implementation adding an additional
> command to select bus can achieve the same functionality. (I send a
> previous mail with this).
> > Attached is a patch to common/cmd_i2c.c that allows access to two
I2C
> > controllers on a board.  Note that this doesn't actually change any
> 5. importantly, common/cmd_i2c.c is a bad place to limit i2c busses..
> each board/.. file should be given the functionality.
> Regards,
> Nishanth Menon
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
> http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users




More information about the U-Boot mailing list