Novena/Fpga

Novena contains an LX45 attached to several buses, namely EIM, SPI, and I2C. It is configured by writing a .bit file over SPI.

Development
For development, it is common to directly bitbang the hardware. Given a bitstream file "novena_fpga.bit", configure the FPGA by running:

sudo rmmod kosagi-fpga-driver echo 135 | sudo tee /sys/class/gpio/export 2> /dev/null echo out | sudo tee /sys/class/gpio/gpio135/direction 2> /dev/null echo 0 | sudo tee /sys/class/gpio/gpio135/value 2> /dev/null echo 1 | sudo tee /sys/class/gpio/gpio135/value 2> /dev/null sudo dd if=novena_fpga.bit of=/dev/spidev2.0 bs=128 sudo ./devmem2 0x020c8160 w 0x00000D2B
 * 1) Flip reset
 * 1) Turn on FPGA clock

Production
For production, wrap everything up in a kernel module. An example of a driver is at https://github.com/xobs/novena-scope-drivers/blob/master/kernel/kosagi-fpga-kernel.c