PINE64
swap SPI_CLK_M2 and SPI_CSN0_M2 - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85)
+--- Forum: Linux on Rock64 (https://forum.pine64.org/forumdisplay.php?fid=88)
+--- Thread: swap SPI_CLK_M2 and SPI_CSN0_M2 (/showthread.php?tid=5473)

Pages: 1 2


RE: swap SPI_CLK_M2 and SPI_CSN0_M2 - dontpostalot - 01-10-2018

Assuming you want to connect a second SPI slave-device you'll need a second dedicated CS signal (one of the available GPIO pins), and make sure only one of them is active (low) at any given time.

It's probably also a good idea to put a ~200Ohm resistor on your MISO line when you're experimenting with this, just in case Wink


RE: swap SPI_CLK_M2 and SPI_CSN0_M2 - GaryLa - 01-10-2018

Ok, that's what I was doing. I misinterpreted what you were saying about the device tree.

I thought you found some way of using the CSN0_M2 select for your own purposes.

I'm obviously not understanding something... If you're not using CSN0_M2 for your own chip select, and you're using an unrelated GPIO, then why bother disabling the on-board flash?

It if doesn't get selected, it tri-states MISO and other than the pull-ups on the Rock64, it is invisible.


RE: swap SPI_CLK_M2 and SPI_CSN0_M2 - dontpostalot - 01-11-2018

That's because I'm having a second *master* device on the SPI bus, and it's not the flash chip I needed to disable (for which CSN0_M2 is fine) but the driving pins (CLK & MOSI) on the Rock. I verified this can be done on the command line (a C library to control the GPIOs is still on my todo- or wish-list though...).


RE: swap SPI_CLK_M2 and SPI_CSN0_M2 - GaryLa - 01-11-2018

That makes sense. Although, is there a period of time from Power On to reading the device tree that you'll have SPI bus contention?

Does any pre-device tree code access that flash?


RE: swap SPI_CLK_M2 and SPI_CSN0_M2 - dontpostalot - 01-11-2018

Not 100% sure on that one tbh but the GPIOs *should* come up as inputs (with their drivers disabled), at least until the dtb tells them otherwise. Maybe someone can confirm this is indeed the behaviour?


RE: swap SPI_CLK_M2 and SPI_CSN0_M2 - mcerveny - 08-18-2018

FYI - enable SPI (with ayufan kernel with backported configfs) and RFE to rework SPI connectivity.