FPGA_Linux_module - timvideos/litex-buildenv GitHub Wiki
Project: Write a Linux kernel module that provides an interface to a "hardware" encryption module (with MMIO and DMA interfaces) implemented in Migen.
To be used as part of the HowTo-LCA2018-FPGA-Miniconf.
LCA2018-FPGA-Miniconf is a day long event that walks attendees though all the building blocks to bring up a Linux environment on an FPGA. Then you have a UI, C compiler, debugger and maybe even Python REPL that can work directly with your half baked FPGA implementation.
That's the goal. Before that can happen, someone needs to write the following:
- A ridiculously simple encryption algorithm that can encode and decode data. XOR is fine, we don't want real crypto.
- MMIO and DMA interfaces to #1
- A realistic linux module that can pass data back and forth to #2.
- Docs subtitle for someone that knows C and FPGA. It does not need to be self contained, links to other resources is encouraged.
The current vision is to re-use a 15 year old linux module workshop:
http://ozlabs.org/~rusty/lca-kernel-tutorial-2005-full.ppt
That was writing a driver for LR3k hardware (Love Rusty 3000) that didn't exist in the real world because that's hard and expensive. The LR3k hardware was implemented as part of a the QEMU VM.
Now that FPGA is a thing, the hardware can be something implemented in FPGA.
The LR3k was a (virtual) pci device. Given the Linux OS and encryption algorithm will be on the same silicon, it would be better to use a simpler API? (interface?) like MMIO.
Here are links to the
LR3k patch to QEMU: https://linux.org.au/conf/2005/kernel-tute/README.txt qemu-lr3k.patch qemu-0.6.1.tar.gz in http://mirror.slingshot.co.nz/pub/linux.conf.au/2005/cdrom-beta-2/kerneltute/
this page describes the hardware https://docs.google.com/document/d/e/2PACX-1vTCbsWycq6HTfIet-ynicf76VEKOLt_k_Bya3OOWKpDCZL3yIphy-CR5GNfPaQCfUt0PUIHDY_ugxWL/pub#h.6bcdftf66eq4
other links from #TimVideos
https://github.com/timvideos/HDMI2USB-litex-firmware/blob/master/firmware/processor.c then maybe https://github.com/enjoy-digital/litevideo/blob/9b4169d5d1e2c400a86ea0cbdb800730d84dc40b/litevideo/output/core.py
recommended reference: https://lwn.net/Kernel/LDD3/ Title: Linux Device Drivers, Third Edition [LWN.net] (at lwn.net)
45min video of Tim's fpga talk: http://youtu.be/181-roBM0tI or https://archive.org/details/teardown_portland_2018-Eating_Rabbits_A_guide_to_using_Python_to_conquer_FPGA_video_systems