• skip to content



flink-project

Universal Serial Interface to FPGA's

User Tools

  • Admin
  • Log In

Site Tools

  • Recent Changes
  • Media Manager
  • Sitemap
You are here: start » flink_linux

Sidebar

Navigation

  • Home
  • flink VHDL subdevices and interfaces
  • flink Linux Kernel Modules
  • flink Userspace Library
  • flink Library Lite
  • flink Utilities
  • flink Python Library
  • flink Java Library

  • flink First Steps
  • flink on a Phytec PCM032 Board
  • flink on a Digilent ZYBO
flink_linux

This is an old revision of the document!


flink Linux Kernel Modules

Downloads

  • flink Linux Kernel Modules on Github

This is the user documentation for the flink kernel modules. They offer drivers capabilities to communicate with various hardware interfaces. For more information about the inner workings see flink Linux Kernel Modules on Github. The driver API can be found under API

Overview

When flink is used on a Linux based system the flink library in userspace communicates with the hardware by means of several kernel modules. The basic module is flink.ko. Further, every flink device needs one more kernel module for each hardware interface which is used to communicate with an external FPGA. This could be flink_pci.ko or flink_spi.ko. They use the appropriate Linux subsystem pci or spi, respectively.

Requirements

  • Linux based operating system
  • GCC 4.6 or newer
  • GNU make

Building

  • Clone git repository:
     git clone https://github.com/flink-project/flinklinux.git
  • Choose the target plattform and find its appropriate kernel configuration together with the kernel headers. Find more help about this in Compiling a New Kernel

  • Build for the host plattform with:
    make
  • Build for a plattform different from the host with:
    make ARCH=arch CROSS_COMPILE=comp KERNELDIR=path

    with the following settings

    • arch: target plattform such as powerpc or arm
    • comp: cross compiler such as powerpc-linux-gnu- or arm-linux-gnueabi-
    • path: path to kernel headers

  • The makefile will switch to the kernel directory, read the current configuration and compile all necessary flink kernel modules for the choosen target plattform.
  • Use depmod to create suitable dependency files for the new modules. This step is not necessary if modules are loaded with insmod.

Installation

  • Move new kernel modules into the default location to /lib/modules/version of the target plattform.
  • Load each module with insmod, e.g.
    insmod flink.ko
  • If dependency files were created beforehand its better to use
    modprobe flink.ko
  • Some kernel module must be loaded with the appropriate arguments according to the target board specifications (see below)

Module Parameters

Determine the availabe parameters for each kernel module with the command modinfo. The following table shows the currently available modules with their parameters.

module parameters description example
flink.ko core module
flink_pci.ko vendor id, product id for pci interface flink_pci vid=0x1172 (Altera) pid=4
flink_spi.ko device memory length (see below) for spi interface flink_spi dev_mem_length=0x280
mpc5200/flink_lpb.ko device memory length (see below) for local plus bus mpc5200/flink_lpb dev_mem_length=0x280
imx6/flink_eim.ko for EIM bus

Busses like PCI have discoverability built into them. Any device connected to such a bus can tell the system, what kind of device it is and what resources it uses. On the SPI this is not possible. Therefore, you must provide the total device memory length when loading the module. This length is determined by the number and types of the subdevices implemented in VHDL, see flink VHDL. \\If an info subdevice is present, it will give the information about the memory length and the parameter can be ommitted, see info_subdevice.

Performance

When parallel busses such as PCI or LocalPlusBus are used, any flink transfer happens very quickly and basically depends on the speed of the bus and the FPGA. Care has to be taken when using the SPI interface. The standard SPI subsystem in a standard Linux distribution uses an internal queueing mechanism which is rather slow. Subsequent transfers of a message are separated by approximately 70μs. Further, every flink read or write includes a 8 byte transfer (address and data phase). Though SPI allows for full duplex transfers this feature cannot be used here.
IMPORTANT When using SPI timing considerations become crucial. As a rule of thumb: Every flink transfer (such as updating a PWM high time or reading a encoder value takes up to 200μs. SPI should be used for low-frequency control application with not too many parallel channels.

flink_linux.1427204346.txt.gz · Last modified: 2016/02/25 13:32 (external edit)

Page Tools

  • Show pagesource
  • Old revisions
  • Back to top
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki