What these suggested device tree changes do is entirely replacing hardware SPI with software (bit banged) SPI.
Yes, this will make full duplex work, but it will also make flash rom (file system) access muuuch slower (because software SPI max speed is ~1Mbit/s, while hardware SPI is ~40Mbit/s if I correctly recall).
However, no need for that - you can use software SPI with the Omega2 without changing the device tree (which would require building your own OpenWrt image), thanks to the spi-gpio-custom
module. You just can't use the same pins (7,8,9) as the hardware SPI does, so you'd need to reserve 3 other GPIOs for it (you can re-use GPIO6, SPI_CS1
, however).
The only reason to switch to software SPI entirely would be when you absolutely can't spare those 3 separate GPIOs and slowing down file system access by a factor 40 is not an issue.
Otherwise, just use spi-gpio-custom
to create a separate SPI interface for your device(s) that need full duplex, it's as simple as:
# insmod spi-gpio-custom bus<Y>=<devid>,<SCK>,<MOSI>,<MISO>,<mode>,<speedInHz>,<CS>
insmod spi-gpio-custom bus0=2,11,5,4,0,100000,18
- bus0=2 means that the software SPI device appears as
/dev/spidev2.0
(first CS, second would be /dev/spidev2.1
etc.)
- GPIO11 is the SPI clock SCK
- GPIO5 is MOSI
- GPIO4 is MISO
- mode is 0, which means standard SPI
- speed is set to 100000 which would mean 100kHz, but it is irrelevant because software SPI always runs as fast as it can, ~1MHz on the MT7688, which is still slow in general SPI terms.
- GPIO18 finally will be CS for the device.
You can also have more than one device, by adding more (mode, speed, CS) triples, or you can run without CS by leaving it unspecified. The full syntax is:
# insmod spi-gpio-custom bus<Y>=<devid>,<SCK>,<MOSI>,<MISO>,<mode0>,<speedInHz0>[,<CS0>[,<mode1>,<speedInHz1>,<CS1>[,<mode2,...]]]