Page MenuHomeFreeBSD

Add SPI driver for Rockchip platform
ClosedPublic

Authored by gonzo on Oct 24 2019, 10:07 PM.
Tags
None
Referenced Files
F81581849: D22148.diff
Thu, Apr 18, 11:31 AM
Unknown Object (File)
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
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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

Add GENERIC config change

sys/arm64/rockchip/clk/rk3399_cru.c
1587 ↗(On Diff #63668)

hack leftovers.

1618 ↗(On Diff #63668)

hack leftovers.

sys/arm64/rockchip/rk_spi.c
150 ↗(On Diff #63668)

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

191 ↗(On Diff #63668)

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
191 ↗(On Diff #63668)

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