<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.8.1">
</HEAD>
<BODY>
I received your direct e-mail immediately - it's the mailing list ones that seem to be taking a vacation for a few days...<BR>
<BR>
On Tue, 2006-05-16 at 10:14 -0500, Menon, Nishanth wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Looks like my previous mail got blocked..</FONT>
<FONT COLOR="#000000">Here is the implementation I was speaking about:</FONT>
<FONT COLOR="#000000">common/cmd_i2c.c:</FONT>
<FONT COLOR="#000000">#if defined(CFG_I2C_BUS_SELECT)</FONT>
<FONT COLOR="#000000">int do_i2c_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])</FONT>
<FONT COLOR="#000000">{</FONT>
<FONT COLOR="#000000"> int bus_idx, bus_spd, res = 0;</FONT>
<FONT COLOR="#000000"> if (argc < 3) {</FONT>
<FONT COLOR="#000000"> printf("Usage[%d]:\n%s\n", argc, cmdtp->usage);</FONT>
<FONT COLOR="#000000"> return 1;</FONT>
<FONT COLOR="#000000"> }</FONT>
<FONT COLOR="#000000"> bus_idx = simple_strtoul(argv[1], NULL, 16);</FONT>
<FONT COLOR="#000000"> bus_spd = simple_strtoul(argv[2], NULL, 16);</FONT>
<FONT COLOR="#000000"> printf("Setting bus[%d] to Speed[%d]: ", bus_idx, bus_spd);</FONT>
<FONT COLOR="#000000"> res = select_bus(bus_idx, bus_spd);</FONT>
<FONT COLOR="#000000"> if (res) {</FONT>
<FONT COLOR="#000000"> printf("FAILED\n");</FONT>
<FONT COLOR="#000000"> } else {</FONT>
<FONT COLOR="#000000"> printf("PASS\n");</FONT>
<FONT COLOR="#000000"> }</FONT>
<FONT COLOR="#000000"> return res;</FONT>
<FONT COLOR="#000000">}</FONT>
<FONT COLOR="#000000">#endif /* bus select */</FONT>
<FONT COLOR="#000000">#if defined(CFG_I2C_BUS_SELECT)</FONT>
<FONT COLOR="#000000">U_BOOT_CMD(ibus, 3, 1, do_i2c_bus,</FONT>
<FONT COLOR="#000000"> "ibus - Select i2c Bus\n",</FONT>
<FONT COLOR="#000000"> "bus_index speed\n - Selects the bus index and sets the</FONT>
<FONT COLOR="#000000">speed (0x64(ST),0x190(FS),0xD48(HS))\n"</FONT>
<FONT COLOR="#000000"> " (reports success/failure)\n");</FONT>
<FONT COLOR="#000000">#endif</FONT>
<FONT COLOR="#000000">Each board implementation can choose to implement select_bus() and</FONT>
<FONT COLOR="#000000">implement logic to handle speed mods, once a user gives a ibus, they can</FONT>
<FONT COLOR="#000000">use old commands to control devices on the bus..</FONT>
<FONT COLOR="#000000">Regards,</FONT>
<FONT COLOR="#000000">Nishanth Menon</FONT>
<FONT COLOR="#000000">> -----Original Message-----</FONT>
<FONT COLOR="#000000">> From: <A HREF="mailto:u-boot-users-admin@lists.sourceforge.net">u-boot-users-admin@lists.sourceforge.net</A> [mailto:u-boot-users-</FONT>
<FONT COLOR="#000000">> <A HREF="mailto:admin@lists.sourceforge.net">admin@lists.sourceforge.net</A>] On Behalf Of Menon, Nishanth</FONT>
<FONT COLOR="#000000">> Sent: Tuesday, May 16, 2006 10:11 AM</FONT>
<FONT COLOR="#000000">> To: <A HREF="mailto:bwarren@qstreams.com">bwarren@qstreams.com</A>; <A HREF="mailto:u-boot-users@lists.sourceforge.net">u-boot-users@lists.sourceforge.net</A></FONT>
<FONT COLOR="#000000">> Subject: RE: [U-Boot-Users] PATCH: Add command support for second I2C</FONT>
<FONT COLOR="#000000">> controller</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Hi Ben,</FONT>
<FONT COLOR="#000000">> Some reasons why I am against the approach of giving i2c bus along</FONT>
<FONT COLOR="#000000">with</FONT>
<FONT COLOR="#000000">> the command itself:</FONT>
<FONT COLOR="#000000">> 1. Cannot handle scenarios of HS controllers.</FONT>
<FONT COLOR="#000000">> 2. cmd_i2c is a debug interface, once a bus is selected, we would like</FONT>
<FONT COLOR="#000000">> to do read and write operations to a specific chip. To repeat the bus</FONT>
<FONT COLOR="#000000">> number all the time is a overhead.</FONT>
<FONT COLOR="#000000">> 3. To a smaller extent, older users need to be aware of the change</FONT>
<FONT COLOR="#000000">> involved.</FONT>
<FONT COLOR="#000000">> 4. a simpler and lesser intrusive implementation adding an additional</FONT>
<FONT COLOR="#000000">> command to select bus can achieve the same functionality. (I send a</FONT>
<FONT COLOR="#000000">> previous mail with this).</FONT>
<FONT COLOR="#000000">> > Attached is a patch to common/cmd_i2c.c that allows access to two</FONT>
<FONT COLOR="#000000">I2C</FONT>
<FONT COLOR="#000000">> > controllers on a board. Note that this doesn't actually change any</FONT>
<FONT COLOR="#000000">> 5. importantly, common/cmd_i2c.c is a bad place to limit i2c busses..</FONT>
<FONT COLOR="#000000">> each board/.. file should be given the functionality.</FONT>
<FONT COLOR="#000000">> Regards,</FONT>
<FONT COLOR="#000000">> Nishanth Menon</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> -------------------------------------------------------</FONT>
<FONT COLOR="#000000">> Using Tomcat but need to do more? Need to support web services,</FONT>
<FONT COLOR="#000000">security?</FONT>
<FONT COLOR="#000000">> Get stuff done quickly with pre-integrated technology to make your job</FONT>
<FONT COLOR="#000000">> easier</FONT>
<FONT COLOR="#000000">> Download IBM WebSphere Application Server v.1.0.1 based on Apache</FONT>
<FONT COLOR="#000000">Geronimo</FONT>
<FONT COLOR="#000000">> <A HREF="http://sel.as-us.falkag.net/sel?cmd=k&kid">http://sel.as-us.falkag.net/sel?cmd=k&kid</A>0709&bid&3057&dat1642</FONT>
<FONT COLOR="#000000">> _______________________________________________</FONT>
<FONT COLOR="#000000">> U-Boot-Users mailing list</FONT>
<FONT COLOR="#000000">> <A HREF="mailto:U-Boot-Users@lists.sourceforge.net">U-Boot-Users@lists.sourceforge.net</A></FONT>
<FONT COLOR="#000000">> <A HREF="https://lists.sourceforge.net/lists/listinfo/u-boot-users">https://lists.sourceforge.net/lists/listinfo/u-boot-users</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>