Turris Omnia routers are equipped with GPIO connector. How to use it? We have added detailed instructions.
Is it useful or useless function?
From the perspective of the Universe is it offcourse useless…
From my perspective it is useful. It currently connnects to a GPS module with PPS. There are more ideas on my mind but none realized for the moment.
Will there be a description how to use PWM?
I would like to control the fan.
The GPIO on the Marvell SoC does not support real PWM.
To control a 4pin fan you could use a small MCU like ATtiny85, a few resistors and an optional transistor. The connection to the Omnia could be I2C, UART or plain GPIO. Plain GPIO would not support speed readback and a maximum of 16 speed steps using 4 GPIO. The I2C or UART connections can make the fan speed available.
OK, but will the software PWM ?
Like this: PWM emulation with GPIO [Old OpenWrt Wiki]
100 Hz is far too slow to get a fan controlled. Target about 25000 Hz.
But there may be another option: the GPIO parts may have a blink function. As it seems to be unused you may get 2 PWM controllable pins. GPIO 18 and any other GPIO. The GPIO chips seem to be feed by the 25 MHz clock so it is realistic to get fast enough for a fan. It would only need a DTB change as it is already in the kernel and used for the WRT1900AC.
Now the bad news: only Armada 370 and XP seem to support this. I doubt this but who knows. One way to check would be writing the correct values to the registers and try.
Patches 202 to 206 at https://github.com/CZ-NIC/turris-os/tree/test/target/linux/mvebu/patches-4.4 enable this for the WRT1900AC and are included in the Turris Omnia kernel.