1I2C-STUB-FROM-DUMP(8) System Manager's Manual I2C-STUB-FROM-DUMP(8)
2
3
4
6 i2c-stub-from-dump - feed i2c-stub with a dump file
7
8
10 i2c-stub-from-dump address dump-file
11
12
14 i2c-stub-from-dump is a small helper script for the i2c-stub kernel
15 driver. It lets you setup a fake I2C chip on the i2c-stub bus based on
16 a dump of the chip you want to emulate.
17
18 i2c-stub-from-dump requires i2cdetect and i2cset to be installed and
19 reachable through the user's PATH. The former is used to find out the
20 i2c-stub bus number, while the latter is used to write to the fake I2C
21 chip.
22
23
25 You have an I2C chip on system A. You would like to do some development
26 on its driver on system B. Here are the few steps you have to follow.
27
28 On system A, use i2cdump to capture a dump from the chip. Assuming that
29 the chip in question lives at address 0x4c on I2C bus 0, you would run:
30
31 i2cdump -y 0 0x4c b > chip.dump
32
33 Adjust the bus number and chip address for your case. i2cdetect can
34 help you find out their values. If the device uses word (16-bit) regis‐
35 ter access instead of the traditional byte (8-bit) access, use mode w
36 instead of b.
37
38 Copy the dump file to system B.
39
40 On system B, run:
41
42 i2c-stub-from-dump 0x4c chip.dump
43
44 This will load the required i2c-dev and i2c-stub kernel drivers if
45 needed, then write all the register values to the emulated I2C chip at
46 address 0x4c. Again, adjust the address as needed.
47
48
50 There are some limitations to the kind of devices that can be handled:
51
52 · Device must not have banks (as most Winbond devices do).
53
54
56 i2cdump(8), i2cdetect(8), i2cset(8)
57
58
60 Jean Delvare
61
62
63
64 April 2008 I2C-STUB-FROM-DUMP(8)