i2c-mlxcpld 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Driver i2c-mlxcpld
  2. Author: Michael Shych <michaelsh@mellanox.com>
  3. This is the Mellanox I2C controller logic, implemented in Lattice CPLD
  4. device.
  5. Device supports:
  6. - Master mode.
  7. - One physical bus.
  8. - Polling mode.
  9. This controller is equipped within the next Mellanox systems:
  10. "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800",
  11. "msn2740", "msn2100".
  12. The next transaction types are supported:
  13. - Receive Byte/Block.
  14. - Send Byte/Block.
  15. - Read Byte/Block.
  16. - Write Byte/Block.
  17. Registers:
  18. CPBLTY 0x0 - capability reg.
  19. Bits [6:5] - transaction length. b01 - 72B is supported,
  20. 36B in other case.
  21. Bit 7 - SMBus block read support.
  22. CTRL 0x1 - control reg.
  23. Resets all the registers.
  24. HALF_CYC 0x4 - cycle reg.
  25. Configure the width of I2C SCL half clock cycle (in 4 LPC_CLK
  26. units).
  27. I2C_HOLD 0x5 - hold reg.
  28. OE (output enable) is delayed by value set to this register
  29. (in LPC_CLK units)
  30. CMD 0x6 - command reg.
  31. Bit 0, 0 = write, 1 = read.
  32. Bits [7:1] - the 7bit Address of the I2C device.
  33. It should be written last as it triggers an I2C transaction.
  34. NUM_DATA 0x7 - data size reg.
  35. Number of data bytes to write in read transaction
  36. NUM_ADDR 0x8 - address reg.
  37. Number of address bytes to write in read transaction.
  38. STATUS 0x9 - status reg.
  39. Bit 0 - transaction is completed.
  40. Bit 4 - ACK/NACK.
  41. DATAx 0xa - 0x54 - 68 bytes data buffer regs.
  42. For write transaction address is specified in four first bytes
  43. (DATA1 - DATA4), data starting from DATA4.
  44. For read transactions address is sent in a separate transaction and
  45. specified in the four first bytes (DATA0 - DATA3). Data is read
  46. starting from DATA0.