blob: fa14e0b245215ee50f1bafdeaddefae0b7b3dbfa [file] [log] [blame]
Alessandro Rubini022c6742013-06-18 23:47:24 +02001
2FMC (FPGA Mezzanine Card) is the standard we use for our I/O devices,
3in the context of White Rabbit and related hardware.
4
5In our I/O environments we need to write drivers for each mezzanine
6card, and such drivers must work regardless of the carrier being used.
7To achieve this, we abstract the FMC interface.
8
9We have a carrier for PCI-E called SPEC and one for VME called SVEC,
10but more are planned. Also, we support stand-alone devices (usually
11plugged on a SPEC card), controlled through Etherbone, developed by GSI.
12
13Code and documentation for the FMC bus was born as part of the spec-sw
14project, but now it lives in its own project. Other projects, i.e.
15software support for the various carriers, should include this as a
16submodule.
17
18The most up to date version of code and documentation is always
19available from the repository you can clone from:
20
21 git://ohwr.org/fmc-projects/fmc-bus.git (read-only)
22 git@ohwr.org:fmc-projects/fmc-bus.git (read-write for developers)
23
24Selected versions of the documentation, as well as complete tar
25archives for selected revisions are placed to the Files section of the
26project: `http://www.ohwr.org/projects/fmc-bus/files'
27
28
29What is FMC
30***********
31
32FMC, as said, stands for "FPGA Mezzanine Card". It is a standard
33developed by the VME consortium called VITA (VMEbus International Trade
34Association and ratified by ANSI, the American National Standard
35Institute. The official documentation is called "ANSI-VITA 57.1".
36
37The FMC card is an almost square PCB, around 70x75 millimeters, that is
38called mezzanine in this document. It usually lives plugged into
39another PCB for power supply and control; such bigger circuit board is
40called carrier from now on, and a single carrier may host more than one
41mezzanine.
42
43In the typical application the mezzanine is mostly analog while the
44carrier is mostly digital, and hosts an FPGA that must be configured to
45match the specific mezzanine and the desired application. Thus, you may
46need to load different FPGA images to drive different instances of the
47same mezzanine.
48
49FMC, as such, is not a bus in the usual meaning of the term, because
50most carriers have only one connector, and carriers with several
51connectors have completely separate electrical connections to them.
52This package, however, implements a bus as a software abstraction.
53
54
55What is SDB
56***********
57
58SDB (Self Describing Bus) is a set of data structures that we use for
59enumerating the internal structure of an FPGA image. We also use it as
60a filesystem inside the FMC EEPROM.
61
62SDB is not mandatory for use of this FMC kernel bus, but if you have SDB
63this package can make good use of it. SDB itself is developed in the
64fpga-config-space OHWR project. The link to the repository is
65`git://ohwr.org/hdl-core-lib/fpga-config-space.git' and what is used in
66this project lives in the sdbfs subdirectory in there.
67
68SDB support for FMC is described in *note FMC Identification:: and
69*note SDB Support::
70
71
72SDB Support
73***********
74
75The fmc.ko bus driver exports a few functions to help drivers taking
76advantage of the SDB information that may be present in your own FPGA
77memory image.
78
79The module exports the following functions, in the special header
80<linux/fmc-sdb.h>. The linux/ prefix in the name is there because we
81plan to submit it upstream in the future, and don't want to force
82changes on our drivers if that happens.
83
84 int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address);
85 void fmc_show_sdb_tree(struct fmc_device *fmc);
86 signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor,
87 uint32_t device, unsigned long *sz);
88 int fmc_free_sdb_tree(struct fmc_device *fmc);