Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

HW IP Features

...

Table of Contents

Introduction

...

Table of Contents

Introduction

This page provides information about the Cadence I2C driver which can be found on Xilinx Git and mainline as i2c-cadence.c
Zynq has two I2C hard IP. I2C can be used as a master with this linux driver.
There is support for repeated start with some limitations.

HW IP Features

  • Master mode
  • Support 16 bytes FIFO
  • Programmable normal and fast bus data rates
  • Interrupt support
  • Repeated start support using HOLD bit
  • FIFO control using HOLD bit
  • Slave monitoring support in Master mode.

...

  • Repeated start after a read transfer is not supported by this controller. A warning is given when this condition is detected by the driver.
  • The following are the controller errata:
  • Missing glitch filter.
  • I2C Master Generates Invalid Read Transactions
  • Missing I2C Master Completion Interrupt.
  • Timing requirement violations
    • I2C - Standard Mode running faster than 90 kHz violates tHD; STA timing requirement.
    • I2C - Fast Mode running faster than 384kHz violates tLOW; STA timing requirement.
    • I2C - Fast Mode running faster than 384 kHz violates tBUF; STA timing requirement.
  • I2C Missing Arbitration On Repeated Start.
  • Multi-master configuration works only if all the participating masters are operating at the same frequency.

Important AR links

  • Zynq-7000 AP SoC, I2C - Missing Glitch Filter Implementation in Zynq PS I2C Controller AR# 61861
  • Zynq-7000 AP SoC, I2C - I2C Master Generates Invalid Read Transactions AR# 61664
  • Zynq-7000 AP SoC, I2C - Missing I2C Master Completion Interrupt AR# 61665
  • Zynq-7000 AP SoC, I2C - I2C Missing Arbitration on Repeated Start AR# 60695
  • Zynq-7000 AP SoC, I2C - Standard Mode running faster than 90 kHz violates tHD; STA timing requirement AR# 59366
  • Zynq-7000 AP SoC, I2C - Fast Mode running faster than 384kHz violates tLOW; STA timing requirement AR# 60693
  • Zynq-7000 AP SoC, I2C - Fast Mode running faster than 384 kHz violates tBUF; STA timing requirement AR# 60694

...

Code Block
themeMidnight
- dd if=/dev/urandom of/urandom of=eeprom_in.bin bs=1 count=128 skip=0
128+0 records in
128+0 records out
128 bytes (128B) copied, 0.001327 seconds, 94.2KB/s

2. Write BIN file to EEPROM

Code Block
themeMidnight
- dd if=eeprom_in.bin of=/sys/bus/i2c/devices/0-0054/eeprom bs=1 count=128 skip=0
128+0 records in
128+0 records out
128 bytes (128B) copied, 02.001327539178 seconds, 94.2KB50B/s

2. Write BIN file to 3. Read Data From EEPROM

Code Block
themeMidnight
- dd if=eeprom_in.bin of=/sys/bus/i2c/devices/0-0054/eeprom of=eeprom_out.bin bs=1 count=128 skip=0
128+0 records in
128+0 records out
128 bytes (128B) copied, 2.539178 seconds, 50B/s

3. Read Data From EEPROM

Code Block
themeMidnight
- dd if=/sys/bus/i2c/devices/0-0054/eeprom of=eeprom_out.bin bs=1 count=128 skip=0
128+0 records in
128+0 records out
128 bytes (128B) copied, 0.065103 seconds, 1.9KB/s

Expected Output

Verify data using md5sum tools

Code Block
themeMidnight
- md5sum eeprom_in.bin eeprom_out.bin
e83e141e1d9f71b3f820652f502239d2 eeprom_in.bin
e83e141e1d9f71b3f820652f502239d2 eeprom_out.bin

Mainline Status

This driver is currently in sync with mainline kernel driver.

...


128+0 records in
128+0 records out
128 bytes (128B) copied, 0.065103 seconds, 1.9KB/s

Expected Output

Verify data using md5sum tools

Code Block
themeMidnight
- md5sum eeprom_in.bin eeprom_out.bin
e83e141e1d9f71b3f820652f502239d2 eeprom_in.bin
e83e141e1d9f71b3f820652f502239d2 eeprom_out.bin

Mainline Status

This driver is currently in sync with mainline kernel driver.

ChangeLog

2024.1

Summary

  • Remove unused CDNS_I2C_DATA_INTR_DEPTH define
  • Remove irq field from driver state struct
  • Remove redundant expression in if clause
  • Remove always false ternary operator
  • Remove unnecessary register reads
  • Allow to specify the FIFO depth
  • Detect maximum transfer size
  • Add reset controller support
  • Fix runtime PM leak on error path
  • Convert to platform remove callback returning void
  • Fix the kernel-doc warnings

Commits

72f94ffi2c: cadence: Remove unused CDNS_I2C_DATA_INTR_DEPTH define

2264997i2c: cadence: Remove irq field from driver state struct

a4a1a78i2c: cadence: Remove redundant expression in if clause

e9d373ci2c: cadence: Remove always false ternary operator

ff0cf7bi2c: cadence: Remove unnecessary register reads

a069fcdi2c: cadence: Allow to specify the FIFO depth

ba06487i2c: cadence: Detect maximum transfer size

0cbc9a2i2c: cadence: Add reset controller support

ae1664fi2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path

e190a0ci2c: Convert to platform remove callback returning void

637f33ai2c: cadence: Fix the kernel-doc warnings

2023.2

  • None

2023.1

Summary

  • Support PEC for SMBus block read
  • Add standard bus recovery support
  • Fix regression with bus recovery

Commits

9fdf6d9i2c: cadence: Support PEC for SMBus block read

58b9242i2c: cadence: Add standard bus recovery support

8bfd4eci2c: cadence: Fix regression with bus recovery

2022.2

Summary

  • Change large transfer count reset logic to be unconditional

Commits

42ab616i2c: cadence: Change large transfer count reset logic to be unconditional

2022.1

Summary

  • Add IRQ check
  • Fix reference leak when pm_runtime_get_sync fails

Commits

ed35515i2c: cadence: add IRQ check

b14b31fi2c: cadence: fix reference leak when pm_runtime_get_sync fails


Related Links
None