mbox series

[RFC,0/3] Read i2c devices

Message ID 20190405055717.6424-1-rashmica.g@gmail.com
Headers show
Series Read i2c devices | expand

Message

Rashmica Gupta April 5, 2019, 5:57 a.m. UTC
This is still hacky and gross, but would be good to get some feedback so
we can get this in pdbg sooner rather than later.

The hack in libpdbg/kernel.c in patch 2 in particular needs some work.

The i2c reset function doesn't work as well as I would like... Sometimes
if you try to read from devices that don't exist, you can no longer read
from devices that do exist - using the reset func in skiboot (by doing 
i2ctransfer from i2ctools on the host or a reboot) or resetting the lbus
(./pdbg -P fsi0 -D4 putcfam 0x80d 0x20000000) sometimes but not always
fixes things.

eg reading from EEPROM0 via a PIB I2C master (host):
sudo ./pdbg -P i2cm@a1000 geti2c 0 0x50 10 8
eg reading from EEPROM0 via the CFAM I2C master (bmc):
./pdbg -P i2cm geti2c 0 0x50 10 8 

Rashmica Gupta (3):
  enable libpdbg to use i2ctools lib
  add i2cm from bmc
  add i2c get for host

 Makefile.am       |   7 +
 configure.ac      |   5 +
 libpdbg/i2cm.c    | 552 ++++++++++++++++++++++++++++++++++++++++++++++
 libpdbg/i2cm.h    | 123 +++++++++++
 libpdbg/kernel.c  |   8 +-
 libpdbg/libpdbg.h |   3 +
 libpdbg/target.c  |  11 +
 libpdbg/target.h  |   9 +
 p9-fsi.dtsi.m4    |   7 +
 p9-host.dts.m4    |  28 +++
 p9-i2c.dts.m4     |  21 ++
 p9-kernel.dts.m4  |   8 +
 src/i2c.c         |  44 ++++
 src/main.c        |   5 +-
 14 files changed, 828 insertions(+), 3 deletions(-)
 create mode 100644 libpdbg/i2cm.c
 create mode 100644 libpdbg/i2cm.h
 create mode 100644 p9-i2c.dts.m4
 create mode 100644 src/i2c.c