Page MenuHomeFreeBSD

rk_i2c bug fix
ClosedPublic

Authored by br on Nov 8 2020, 1:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 26, 4:51 AM
Unknown Object (File)
Fri, Oct 25, 4:21 PM
Unknown Object (File)
Sun, Oct 13, 7:47 PM
Unknown Object (File)
Oct 5 2024, 12:25 PM
Unknown Object (File)
Oct 5 2024, 6:48 AM
Unknown Object (File)
Oct 4 2024, 10:48 PM
Unknown Object (File)
Oct 2 2024, 2:10 PM
Unknown Object (File)
Oct 2 2024, 12:20 PM
Subscribers

Details

Summary

o Support for transfers > 32 bytes
o Fix slave address setting

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

br requested review of this revision.Nov 8 2020, 1:26 PM
sys/arm64/rockchip/rk_i2c.c
535

Mhm, that should be | LSB I think.

sys/arm64/rockchip/rk_i2c.c
535

yes, but does not matter, since controller sets this bit internally depending on mode

sys/arm64/rockchip/rk_i2c.c
363

That will not work if the transfer is not for a multiple of 32.

sys/arm64/rockchip/rk_i2c.c
363

why?

sys/arm64/rockchip/rk_i2c.c
363

If I understand correctly if you try to do a transfer with a len of 48 bytes the first 32 bytes will be transmitted first (as it's the max length that this controller can support) but on the second transfer instead of setting TXCOUNT to 16 we will set it to 32 as you check sc->msg->len and not taking into account what have been transmitted already.

o Consider amount of bytes already transferred
o Add a small delay (not sure why it is needed, maybe another bug)

fix transfer_len for reading as well. I think eliminate a need of delay

sys/arm64/rockchip/rk_i2c.c
363

You are right, thanks!
I think driver works for me just fine now

This revision is now accepted and ready to land.May 26 2021, 7:11 AM