Page MenuHomeFreeBSD

Add SPI driver for Rockchip platform
ClosedPublic

Authored by gonzo on Oct 24 2019, 10:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 4:52 PM
Unknown Object (File)
Wed, Dec 4, 11:19 PM
Unknown Object (File)
Sun, Dec 1, 11:18 PM
Unknown Object (File)
Nov 22 2024, 10:31 PM
Unknown Object (File)
Nov 22 2024, 10:07 PM
Unknown Object (File)
Nov 21 2024, 12:12 AM
Unknown Object (File)
Nov 16 2024, 2:04 PM
Unknown Object (File)
Nov 16 2024, 7:37 AM
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