Introduction

The FPGA subsystem supports reprogramming FPGAs dynamically underLinux. Some of the core intentions of the FPGA subsystems are:

  • The FPGA subsystem is vendor agnostic.
  • The FPGA subsystem separates upper layers (userspace interfaces andenumeration) from lower layers that know how to program a specificFPGA.
  • Code should not be shared between upper and lower layers. Thisshould go without saying. If that seems necessary, there’s probablyframework functionality that can be added that will benefitother users. Write the linux-fpga mailing list and maintainers andseek out a solution that expands the framework for broad reuse.
  • Generally, when adding code, think of the future. Plan for reuse.

The framework in the kernel is divided into:

FPGA Manager

If you are adding a new FPGA or a new method of programming an FPGA,this is the subsystem for you. Low level FPGA manager drivers containthe knowledge of how to program a specific device. This subsystemincludes the framework in fpga-mgr.c and the low level drivers thatare registered with it.

FPGA Bridge

FPGA Bridges prevent spurious signals from going out of an FPGA or aregion of an FPGA during programming. They are disabled beforeprogramming begins and re-enabled afterwards. An FPGA bridge may beactual hard hardware that gates a bus to a CPU or a soft (“freeze”)bridge in FPGA fabric that surrounds a partial reconfiguration regionof an FPGA. This subsystem includes fpga-bridge.c and the low leveldrivers that are registered with it.

FPGA Region

If you are adding a new interface to the FPGA framework, add it on topof an FPGA region.

The FPGA Region framework (fpga-region.c) associates managers andbridges as reconfigurable regions. A region may refer to the wholeFPGA in full reconfiguration or to a partial reconfiguration region.

The Device Tree FPGA Region support (of-fpga-region.c) handlesreprogramming FPGAs when device tree overlays are applied.