Page MenuHomeFreeBSD

Introduce VF610 I2C controller support.
ClosedPublic

Authored by dgr_semihalf.com on Apr 10 2020, 11:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 27, 4:31 PM
Unknown Object (File)
Nov 23 2024, 8:11 AM
Unknown Object (File)
Nov 23 2024, 6:12 AM
Unknown Object (File)
Nov 19 2024, 7:58 PM
Unknown Object (File)
Nov 16 2024, 9:31 AM
Unknown Object (File)
Nov 11 2024, 2:17 AM
Unknown Object (File)
Oct 29 2024, 7:18 PM
Unknown Object (File)
Oct 26 2024, 12:55 PM
Subscribers

Details

Summary

NXP LS1046A contains I2C controller compatible with Vybrid VF610.
Existing Vybrid MVF600 driver can be used to support it. For that purpose
declare driver as ofw_iicbus and add methods associated with ofw_iicbus.

For VF610 add dynamic clock prescaler calculation using clock information
from clock driver and clock frequency requested in device tree.

On the occasion add detach function and add additional error handling
in i2c_attach function.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/arm/freescale/vybrid/vf_i2c.c
250 ↗(On Diff #70394)

Missing call to bus_release_resources

sys/conf/files.arm64
109 ↗(On Diff #70394)

This should have a driver specific option. We may want iicbus enabled, but not this driver.

Added bus_release_resources call and dependency on SOC_NXP_LS1046A.

sys/arm/freescale/vybrid/vf_i2c.c
192 ↗(On Diff #71202)

Can the driver work if there is no clock ?
Since you set sc->freq below I'm not sure it can.

sys/conf/files.arm64
109 ↗(On Diff #70394)

That should be optional <driver_name> iicbus SOC_NXP_LS1046A

sys/arm/freescale/vybrid/vf_i2c.c
192 ↗(On Diff #71202)

The driver can work without clock - when no clock is found it uses the highest possible prescaler value for VF610.
For MVF600 the way driver originally worked is preserved.

Added vf_i2c as driver name in files.arm64

Hi, if you have any more comments or remarks, please let me know. Thanks.

This revision is now accepted and ready to land.May 15 2020, 10:11 AM

Replace SOC_NXP_LS1046A with SOC_NXP_LS.

This revision now requires review to proceed.May 22 2020, 8:04 PM
This revision is now accepted and ready to land.May 22 2020, 8:31 PM
This revision was automatically updated to reflect the committed changes.