Page MenuHomeFreeBSD

rk_i2c bug fix
ClosedPublic

Authored by br on Nov 8 2020, 1:26 PM.

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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