Files
OpenCellular/include
Randall Spangler 1e4b0b6194 Implement I2C passthru command
This is a revised version of passthru which more closely resembles the
kernel interface.  It allows multiple read/write messages in a single
transaction, and sends back one accumulated result.

BUG=chrome-os-partner:18778
BRANCH=none
TEST=On link, from root shell:
    ectool i2cxfer 0 0xb 6 0x21
    Read bytes: 0x05 0x41 0x52 0x52 0x4f 0x57

(I did not actually run this with the updated code)

On pit, in U-Boot:

Read i2c values:
Peach #  crosec i2c md 48 0
0000: 00 00 3e 00 12 20 4b bf ff ff 20 00 1e 1e 1e 1f    ..>.. K... .....
Peach #  crosec i2c md 48 0 20
0000: 00 00 3e 00 12 20 4b bf ff ff 20 00 1e 1e 1e 1f    ..>.. K... .....
0010: 1f 1f 1f 1f 1f 1f 20 00 00 07 00 00 00 00 00 00    ...... .........

Update value at offset 10:
Peach #  crosec i2c mw 48 10 4
Peach #  crosec i2c md 48 0 20
0000: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>....... .....
0010: 04 1f 1f 1f 1f 1f 20 00 00 07 00 00 00 00 00 00    ...... .........
Peach #

On pit, in kernel:

localhost ~ # i2cdetect -y -a -r 20
 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

localhost ~ # i2cdump -f -y 20 0x48
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>.?.???. .????
10: 1f 1f 0e 1f 1f 0e 20 00 00 07 00 00 00 00 00 00    ?????? ..?......
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

localhost ~ # i2cset -f -y 20 0x48 0x10 0
localhost ~ # i2cdump -f -y 20 0x48
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>.?.???. .????
10: 00 1f 0e 1f 1f 0e 20 00 00 07 00 00 00 00 00 00    .????? ..?......
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

localhost ~ # i2cset -f -y 20 0x48 0x10 0x1f
localhost ~ # i2cdump -f -y 20 0x48
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 3e 00 12 00 0b 1f 1f ff 20 00 1e 1e 1e 1f    ..>.?.???. .????
10: 1f 1f 0e 1f 1f 0e 20 00 00 07 00 00 00 00 00 00    ?????? ..?......

Change-Id: I14d47e1712828f726ac5caddc4beede251570ad3
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Updated to simplify protocol:
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49958
Commit-Queue: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
2013-05-09 16:36:53 -07:00
..
2013-04-30 10:38:43 -07:00
2012-10-24 10:09:20 -07:00
2013-04-05 14:28:42 -07:00
2013-03-26 18:03:20 -07:00
2013-04-03 11:49:07 -07:00
2013-05-09 16:36:53 -07:00
2011-12-07 19:10:02 +00:00
2012-10-26 09:49:38 -07:00
2013-04-10 14:24:10 -07:00
2013-04-24 00:06:00 -07:00
2012-10-30 12:42:46 -07:00
2012-11-04 20:27:57 -08:00
2011-12-07 19:10:02 +00:00
2012-10-25 14:12:11 -07:00
2011-12-07 19:10:02 +00:00
2012-10-25 14:12:10 -07:00
2012-10-25 17:03:44 -07:00
2012-08-09 17:40:37 -07:00
2013-05-08 18:11:01 -07:00
2012-10-26 13:10:57 -07:00
2012-10-29 16:52:49 -07:00
2012-10-30 12:42:43 -07:00