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)
Tue, Nov 19, 7:58 PM
Unknown Object (File)
Sat, Nov 16, 9:31 AM
Unknown Object (File)
Mon, Nov 11, 2:17 AM
Unknown Object (File)
Tue, Oct 29, 7:18 PM
Unknown Object (File)
Sat, Oct 26, 12:55 PM
Unknown Object (File)
Oct 20 2024, 7:44 AM
Unknown Object (File)
Oct 18 2024, 1:17 AM
Unknown Object (File)
Oct 17 2024, 8:51 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/arm/freescale/vybrid/vf_i2c.c
250

Missing call to bus_release_resources

sys/conf/files.arm64
109

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

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

That should be optional <driver_name> iicbus SOC_NXP_LS1046A

sys/arm/freescale/vybrid/vf_i2c.c
192

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.