root/i2c-tools/trunk/stub/i2c-stub-from-dump.8

Revision 5830, 1.7 KB (checked in by khali, 2 years ago)

Add support for multiple dumps. This makes it easier to setup test
environments with more than one I2C chip.

Line 
1.TH I2C-STUB-FROM-DUMP 8 "March 2010"
2.SH NAME
3i2c-stub-from-dump \- feed i2c-stub with dump files
4
5.SH SYNOPSIS
6.B i2c-stub-from-dump
7.IR address [, address ,...]
8.IR dump-file " [" dump-file " ...]"
9
10.SH DESCRIPTION
11i2c-stub-from-dump is a small helper script for the i2c-stub kernel driver.
12It lets you setup one or more fake I2C chips on the i2c-stub bus based on
13dumps of the chips you want to emulate.
14
15i2c-stub-from-dump requires i2cdetect and i2cset to be installed and
16reachable through the user's PATH. The former is used to find out the i2c-stub
17bus number, while the latter is used to write to the fake I2C chips.
18
19.SH EXAMPLE
20You have an I2C chip on system A. You would like to do some development on its
21driver on system B. Here are the few steps you have to follow.
22
23On system A, use i2cdump to capture a dump from the chip. Assuming that the
24chip in question lives at address 0x4c on I2C bus 0, you would run:
25
26        i2cdump -y 0 0x4c b > chip.dump
27
28Adjust the bus number and chip address for your case. i2cdetect can help
29you find out their values. If the device uses word (16-bit) register
30access instead of the traditional byte (8-bit) access, use mode \fBw\fR
31instead of \fBb\fR.
32
33Copy the dump file to system B.
34
35On system B, run:
36
37        i2c-stub-from-dump 0x4c chip.dump
38
39This will load the required i2c-dev and i2c-stub kernel drivers if needed,
40then write all the register values to the emulated I2C chip at address 0x4c.
41Again, adjust the address as needed.
42
43.SH LIMITATIONS
44There are some limitations to the kind of devices that can be handled:
45.IP \(bu
46Device must not have banks (as most Winbond devices do).
47
48.SH SEE ALSO
49i2cdump(8), i2cdetect(8), i2cset(8)
50
51.SH AUTHOR
52Jean Delvare
Note: See TracBrowser for help on using the browser.