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

Improve I2C timing (again) #5916

Merged
merged 2 commits into from
Feb 1, 2024
Merged

Improve I2C timing (again) #5916

merged 2 commits into from
Feb 1, 2024

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Jan 31, 2024

Improve I2C timing by:

  1. setting the SDA hold time to 300ns, and
  2. increasing the drive strength to improve the signal quality at 1MHz.

Prompted by #5914.

Boosting the drive strength on I2C pins allows SCL to achieve safe
voltage swings, even at 1MHz.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Failing to set a reasonable SDA hold time can cause SDA to change too
close to the falling edge of SCL. 300ns is the recommended minimum
interval between the two at 100kHz and 400kHz, and also seems to
work at 1MHz, so use that.

See: raspberrypi#5914

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell
Copy link
Contributor Author

pelwell commented Jan 31, 2024

@JinShil You may want to give this PR a try, as the fault it corrects might have been the cause of your problems with the 9306.

@pelwell pelwell merged commit 3bcc388 into raspberrypi:rpi-6.6.y Feb 1, 2024
12 checks passed
@JinShil
Copy link
Contributor

JinShil commented Feb 2, 2024

I've tested this on my existing hardware with the 9306. It results in the same symptoms described in #5853, when the hardware is running out of spec at 1MHz. But up to and including 400kHz it works fine. I'm still waiting on new hardware to test a 1MHz clock running within spec.

@pelwell
Copy link
Contributor Author

pelwell commented Feb 2, 2024

Thanks for trying.

@JinShil
Copy link
Contributor

JinShil commented Feb 7, 2024

I tested a new I2C device with this PR today. The device is a GP8403 DAC.

With #5802, there were quite a few errors at both 100kHz and 400kHz. However, after updating to this PR, the errors vanished. So, this PR appears to be a significant improvement.

I'm still waiting on 1MHz hardware, and will test that when I get my hands on it.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 7, 2024
kernel: Improve I2C timing (again)
See: raspberrypi/linux#5916

kernel: drm/vc4: Drop planes that have 0 destination size
See: raspberrypi/linux#5929

kernel: drm: rp1: VEC and DPI drivers: Fix bug #5901
See: raspberrypi/linux#5925

kernel: drivers: media: cfe: Increase default size of embedded buffer
See: raspberrypi/linux#5923

kernel: RP1 VEC: Use tv_mode from command line, align enum with drm_connector; tidy
See: raspberrypi/linux#5885

kernel: ARM: dts: Standardise downstream Pi GPIO pin names
See: raspberrypi/linux#5902

kernel: ASoC: DACplusADCPro - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5919

kernel: ASoC: adds support for Hifiberry AMP4Pro to the dacplus driver
See: raspberrypi/linux#5918

kernel: ASoC: DACplus - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5917
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Feb 7, 2024
kernel: Improve I2C timing (again)
See: raspberrypi/linux#5916

kernel: drm/vc4: Drop planes that have 0 destination size
See: raspberrypi/linux#5929

kernel: drm: rp1: VEC and DPI drivers: Fix bug #5901
See: raspberrypi/linux#5925

kernel: drivers: media: cfe: Increase default size of embedded buffer
See: raspberrypi/linux#5923

kernel: RP1 VEC: Use tv_mode from command line, align enum with drm_connector; tidy
See: raspberrypi/linux#5885

kernel: ARM: dts: Standardise downstream Pi GPIO pin names
See: raspberrypi/linux#5902

kernel: ASoC: DACplusADCPro - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5919

kernel: ASoC: adds support for Hifiberry AMP4Pro to the dacplus driver
See: raspberrypi/linux#5918

kernel: ASoC: DACplus - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5917
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 8, 2024
See: raspberrypi/linux#5923

kernel: overlays: Delete deprecated overlay mpu6050

kernel: overlays: Correct some compatible strings

kernel: ASoC: DACplusADCPro - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5919

kernel: ASoC: adds support for Hifiberry AMP4Pro to the dacplus driver
See: raspberrypi/linux#5918

kernel: ASoC: DACplus - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5917

kernel: Improve I2C timing (again)
See: raspberrypi/linux#5916

kernel: Update PiTFT overlays for compatibility and consistency
See: raspberrypi/linux#5903

kernel: Support non-standard I2C timings on Pi 5
See: raspberrypi/linux#5853

kernel: overlays: Add pcie-32bit-dma-pi5-overlay to enable 32bit DMA on the Pi 5's external PCIe interface
See: raspberrypi/linux#5897

kernel: Improvement on backup-switchover-mode overlay value definitions
See: raspberrypi/linux#5884

kernel: Pisound updates for Pi 5
See: raspberrypi/linux#5872
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Feb 8, 2024
See: raspberrypi/linux#5923

kernel: overlays: Delete deprecated overlay mpu6050

kernel: overlays: Correct some compatible strings

kernel: ASoC: DACplusADCPro - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5919

kernel: ASoC: adds support for Hifiberry AMP4Pro to the dacplus driver
See: raspberrypi/linux#5918

kernel: ASoC: DACplus - fix 16bit sample support in clock consumer mode
See: raspberrypi/linux#5917

kernel: Improve I2C timing (again)
See: raspberrypi/linux#5916

kernel: Update PiTFT overlays for compatibility and consistency
See: raspberrypi/linux#5903

kernel: Support non-standard I2C timings on Pi 5
See: raspberrypi/linux#5853

kernel: overlays: Add pcie-32bit-dma-pi5-overlay to enable 32bit DMA on the Pi 5's external PCIe interface
See: raspberrypi/linux#5897

kernel: Improvement on backup-switchover-mode overlay value definitions
See: raspberrypi/linux#5884

kernel: Pisound updates for Pi 5
See: raspberrypi/linux#5872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants