Sunday, July 10, 2022

Intel DE10 Nano FPGA Board: Using the Deprecated Altera VIP Frame Reader

I have the DE10-Nano Kit from Terasic, which has a chip with FPGA fabric together with a dual-core ARM processor. You can run Linux from an SD card just like a mini computer system. I have been wanting to update the Linux kernel (version 4.14) and the FPGA hardware design, which now uses outdated Altera design IP for the frame buffer. 

Terasic offers example Linux set ups and hardware design files, but these have not been updated for a few years and use old Linux kernels and old Quartus projects. Graphical output is possible via the HDMI port, but Linux needs to use a frame buffer to store each video frame. The Altera Video Image Processing (VIP) Frame Reader for graphics output was last updated in 2014 and is now deprecated. Moreover, support for this hardware component was dropped from the Linux kernel at the start of 2020. The successor is the Intel Video and Image Processing (VIP) Frame Buffer II, but this IP requires a paid license without tether or time limits. I could not figure out the process of purchasing the IP, because all the web links led me in a circle with no offer of a web form or sales contact. In summary, it just seems like a dead end for my hobby purposes.

I decided to keep using the deprecated Altera Video Image Processing (VIP) Frame Reader, and to instead update to a more recent Linux kernel (version 5.15.30) with the hope that I could patch back the kernel module for the Altera VIP Frame Reader, called altvipfb. My first attempt was to simply revert the reversion. This did not work, and I got a stack trace during boot up when the altvipfb module was being loaded (altvipfb_probe).

My next attempt was to look at the source code of the altvipfb2 module (altvipfb2.haltvipfb2.caltvipfb2-plat.c), which is the successor to altvipfb, in the hope that the code would be similar enough to help give me clues as to how to modernise altvipfb's usage of the frame buffer API. Luckily, this was the case and I was able to reorder the initialisation sequence of the module and update a few API calls and have the altvipfb driver working! A summary of the changes can be found in my gist: