i2c tools better naming scheme
[cr816-sim.git] / tools / README
blob9a00ba3c8072a9cc02e6a25a59abbda8875ce129
1 1. load userspace i2c
2         modprobe i2c-dev
3 2. configure variables in i2c_config.sh for your linux i2c adapter
4         SMB_IFACE=$((0))
5         SMB_ADDR=$((0xb))
6         you can get your interface/adapter by
7         i2cdetect -l
8 3. load i2c configuration into shell (or use direct values)
9         . ./i2c_config.sh
10 4. check current mode of adapter (working registers may differ)
11         i2cdump -y ${SMB_IFACE} ${SMB_ADDR}
12         - boot/empty 
13                 registers 0-0x1b
14         - test/offline/calibration?
15                 registers 0x40-0x4a, 0x50-0x5a, 0x72, 0x73, 0x80
16         - norm/online
17                 registers 0-0x1c, 0x20-0x23, 0x2f, 0x30-0x33, 0x3b-0x3f, 0x50-0x54, 0x71-0x72
18         (in test and normal mode, some registers can be temporarily enabled)
19 5. use the correct command set for actual mode
20         boot<->norm can be switched by commands
21         booting to normal mode needs to have magic word at word 0x5 in code space (may be bricked)
22         switching to test/offline mode can be done only manually (unknown other methods)
23                 backup!
24                 flash[0x60c] = 0x3c;
25                 flash[0x60d] = 0x7e;
26                 + reboot
27         switching back to online mode needs to return the original values (backup)
29 flash/erase mostly untested
30 mcu space is strictly divided into code space and data space
31         code space has 2 regions: userspace flash, boot maskrom (probably inaccessible)
32         data space has 3 regions: RAM, flash, IO