diff options
author | Randall Spangler <rspangler@chromium.org> | 2013-04-30 12:16:39 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-05-09 16:36:53 -0700 |
commit | 1e4b0b6194b3ff16233e824daa4bab18a8dcce0f (patch) | |
tree | de57b1a8f1bbda6be2f515ae2a59882ef6365e23 /LICENSE | |
parent | d2ca284bc6da637aabb0dbfd4a4d67451646f23a (diff) | |
download | chrome-ec-1e4b0b6194b3ff16233e824daa4bab18a8dcce0f.tar.gz |
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>
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions