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)
Fri, Nov 22, 10:31 PM
Unknown Object (File)
Fri, Nov 22, 10:07 PM
Unknown Object (File)
Thu, Nov 21, 12:12 AM
Unknown Object (File)
Sat, Nov 16, 2:04 PM
Unknown Object (File)
Sat, Nov 16, 7:37 AM
Unknown Object (File)
Wed, Nov 13, 7:12 PM
Unknown Object (File)
Mon, Nov 11, 2:35 AM
Unknown Object (File)
Thu, Nov 7, 8:19 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