Skip to content
Patryk Mężydło edited this page Aug 28, 2017 · 2 revisions

Final report

The task consisted of creating software support for FPGA cape (based on iCE40 device). The project provides the BeagleBoard.org community with easy to implement and powerful tools for realization of projects based on Programmable Logic Device (FPGA). For the purpose of project realization, I have received one BeagleWire prototype from the BeagleBoard.org community. During the first phase of the project I got familiar with the hardware.

My first task was to compile custom Linux kernel Image for BeagleBone Black embedded board. The next task consisted in porting IceStorm toolchain to ARM platform [1].

The first phase of the whole project lasted relatively briefly. During the second phase of the project I developed communication between ARM and FPGA. Since communication is based on shared memory between FPGA and ARM, I had to configure GPMC bus[2]. Later I created a simple library[3] for C language which helps in use of FPGA logic, as well as a simple example of UART communication. Then the project moved on to the longest 3 phase, during which I created a few ready to use solutions written in Verilog which help to add different kinds of peripherals (PWM[4], SPI[5], I2C[6], UART[7], GPIO[8]). Each peripheral module is mapped in ARM memory. GPIO ip core uses a ready driver from Linux kernel tree (gpio-mmio.c driver). I have written 3 Linux drivers for I2C[9], SPI[10], PWM[11]. Uart ip core has a simple C application. Owing to a lack of sufficient time during GSoC, I have not written Linux driver for UART. During GSoC I created 9 different components [12] for ip cores. Each component and ip core has documentation[13]. Documentation yet needs to be completed.

[1] https://github.com/pmezydlo/BeagleWire/blob/master/scripts/install_IceStorm.sh
[2] https://github.com/pmezydlo/BeagleWire/blob/master/DTS/BW-ICE40Cape-00A0.dts
[3] https://github.com/pmezydlo/BeagleWire/tree/master/bridge_lib
[4] https://github.com/pmezydlo/BeagleWire/tree/master/examples/pwm
[5] https://github.com/pmezydlo/BeagleWire/tree/master/examples/spi
[6] https://github.com/pmezydlo/BeagleWire/tree/master/examples/i2c
[7] https://github.com/pmezydlo/BeagleWire/tree/master/examples/uart
[8] https://github.com/pmezydlo/BeagleWire/tree/master/examples/gpio
[9] https://github.com/pmezydlo/BeagleWire/blob/master/drivers/i2c-ice40.c
[10] https://github.com/pmezydlo/BeagleWire/blob/master/drivers/spi-ice40.c
[11] https://github.com/pmezydlo/BeagleWire/blob/master/drivers/pwm-ice40.c
[12] https://github.com/pmezydlo/BeagleWire/tree/master/components
[13] https://github.com/pmezydlo/BeagleWire/tree/master/documentation

What did not work and why:

The code is readable and well-written, but the project’s documentation still needs some work to be done. Since I did not have enough time to write a UART driver, I have created only a simple application that allows the use of UART ip core from the userspace.

What I have learned during GSoC:

  • upstream process and interaction with maintainers
  • how to create a variety of types of modules connected to the linux kernel
  • handling devices mapped in memory
  • creating a correct and visually aesthetic code compatible with the linux kernel coding style
  • planning and describing a project
  • how bus, device and driver work
  • character device drivers and fs operations in practice
  • methods for debugging and fault finding
  • better git use
  • FPGA programming
  • and many more ;)

What's next:

Together with Michael I plan to continue work on FPGA capes. I want to improve the SPI driver, make it more generic and submit it to Linux kernel tree. In the next GSoC 2018 edition I intend to become a mentor in BeagleBoard.org foundation.

A few words in conclusion:

The final report does not end my adventure with linux kernel and BeagleBoard community. These three months have shown me that developing features of Linux is not that difficult. They also gave me an exciting opportunity to work with BeagleBoard community and to get to know many wonderful people. I would like to thank Michael and Jonathan for kindly rescuing me when I was stuck and for such a great amount of knowledge they shared with me. Many thanks to everyone who helped and supported me during GSoC. You are amazing.