Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i3c_controller: Bug fixes for I2C devices and lower sclk speed #1514

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gastmaier
Copy link
Contributor

@gastmaier gastmaier commented Nov 8, 2024

PR Description

Some rework to better support slow I2C devices (100kHz, 400kHz).
I2C speed can be lower than I3C open drain speed.
The new I2C_MOD allows to configure this speed.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the code style guidelines
  • I have performed a self-review of changes
  • I have compiled all hdl projects and libraries affected by this PR
  • I have tested in hardware affected projects, at least on relevant boards
  • I have commented my code, at least hard-to-understand parts
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe files, Copyright etc)
  • I have not introduced new Warnings/Critical Warnings on compilation
  • I have added new hdl testbenches or updated existing ones

@gastmaier gastmaier changed the title i3c_controller: Bug fixes for I2C devices and slower speed. i3c_controller: Bug fixes for I2C devices and lower sclk speed Nov 14, 2024
There is no guarantee that the device driver will use the same xfer
(to yield repeated start (Sr)), for multiple concurrent transfer.
Instead, it may queue multiple xfers which generate
(...Stop)+(Start...).
This case would cause the bit modulation to yield a
[Stop+RepeatedStart], generating an "extra" clock bit.
Check for the bit-mod if the current state is Stop, if so, clear
the autoset Sr state reg, ensuring a [Stop+Start].

Signed-off-by: Jorge Marques <[email protected]>
I2C RX transfers should stop with last ACK-bit as a NACK and then a
stop, previously, the controller would ACK all bytes and then stop.

Signed-off-by: Jorge Marques <[email protected]>
For backwards compatibility with slow I2C devices (100kHz, 400kHz), add
a parameter to further divide the open drain speed.
I3C devices still operate at 1.5MHz in open drain mode, since the I3C
clock cycles are filtered by the I2C 50ns Spike filter.

Signed-off-by: Jorge Marques <[email protected]>
Signed-off-by: Jorge Marques <[email protected]>
@gastmaier
Copy link
Contributor Author

Rebased only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants