FMC-and-SDB.txt 3.7 KB

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