Page MenuHomeFreeBSD

Add SPI driver for Rockchip platform
ClosedPublic

Authored by gonzo on Oct 24 2019, 10:07 PM.
Tags
None
Referenced Files
F81434822: D22148.diff
Tue, Apr 16, 7:54 AM
Unknown Object (File)
Jan 13 2024, 11:20 AM
Unknown Object (File)
Dec 20 2023, 3:24 AM
Unknown Object (File)
Nov 15 2023, 3:20 PM
Unknown Object (File)
Nov 9 2023, 1:46 AM
Unknown Object (File)
Nov 8 2023, 11:29 PM
Unknown Object (File)
Nov 6 2023, 12:47 PM
Unknown Object (File)
Oct 15 2023, 10:15 PM
Subscribers

Details

Summary

SPI driver for Rockchip IP works only in PIO mode for now. DMA is not supported yet.
For now the driver supports only RK3399 compatibility string but it should work with older SoCs too.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27223
Build 25487: arc lint + arc unit

Event Timeline

Add GENERIC config change

sys/arm64/rockchip/clk/rk3399_cru.c
1587

hack leftovers.

1617

hack leftovers.

sys/arm64/rockchip/rk_spi.c
151

IP only have CS0 and CS1, we should add a checks here and return EINVAL

192

Is this needed ?
and if it is why not doing the same for the rxfifo ?

gonzo added inline comments.
sys/arm64/rockchip/rk_spi.c
192

This is what Linux driver does and I think it's to handle SPI chips on older SoCs. RX fifo has the same size as TX fifo AFAIK, so there is no need to do it twice.

Check value of CS and return EINVAL if it's more than max

OK for me.
If you could split the commits between clocks and driver that would be great.

This revision is now accepted and ready to land.Oct 25 2019, 8:26 PM