identifiers.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. FMC Identification
  2. ******************
  3. The FMC standard requires every compliant mezzanine to carry
  4. identification information in an I2C EEPROM. The information must be
  5. laid out according to the "IPMI Platform Management FRU Information",
  6. where IPMI is a lie I'd better not expand, and FRU means "Field
  7. Replaceable Unit".
  8. The FRU information is an intricate unreadable binary blob that must
  9. live at offset 0 of the EEPROM, and typically extends for a few hundred
  10. bytes. The standard allows the application to use all the remaining
  11. storage area of the EEPROM as it wants.
  12. This chapter explains how to create your own EEPROM image and how to
  13. write it in your mezzanine, as well as how devices and drivers are
  14. paired at run time. EEPROM programming uses tools that are part of this
  15. package and SDB (part of the fpga-config-space package).
  16. The first sections are only interesting for manufacturers who need to
  17. write the EEPROM. If you are just a software developer writing an FMC
  18. device or driver, you may jump straight to *note SDB Support::.
  19. Building the FRU Structure
  20. ==========================
  21. If you want to know the internals of the FRU structure and despair, you
  22. can retrieve the document from
  23. `http://download.intel.com/design/servers/ipmi/FRU1011.pdf' . The
  24. standard is awful and difficult without reason, so we only support the
  25. minimum mandatory subset - we create a simple structure and parse it
  26. back at run time, but we are not able to either generate or parse more
  27. arcane features like non-english languages and 6-bit text. If you need
  28. more items of the FRU standard for your boards, please submit patches.
  29. This package includes the Python script that Matthieu Cattin wrote to
  30. generate the FRU binary blob, based on an helper libipmi by Manohar
  31. Vanga and Matthieu himself. I changed the test script to receive
  32. parameters from the command line or from the environment (the command
  33. line takes precedence)
  34. To make a long story short, in order to build a standard-compliant
  35. binary file to be burned in your EEPROM, you need the following items:
  36. Environment Opt Official Name Default
  37. ---------------------------------------------------------------------
  38. FRU_VENDOR -v "Board Manufacturer" fmc-example
  39. FRU_NAME -n "Board Product Name" mezzanine
  40. FRU_SERIAL -s `Board Serial Number" 0001
  41. FRU_PART -p "Board Part Number" sample-part
  42. FRU_OUTPUT -o not applicable /dev/stdout
  43. The "Official Name" above is what you find in the FRU official
  44. documentation, chapter 11, page 7 ("Board Info Area Format"). The
  45. output option is used to save the generated binary to a specific file
  46. name instead of stdout.
  47. You can pass the items to the FRU generator either in the environment
  48. or on the command line. This package has currently no support for
  49. specifying power consumption or such stuff, but I plan to add it as
  50. soon as I find some time for that.
  51. FIXME: consumption etc for FRU are here or in PTS?
  52. The following example creates a binary image for a specific board:
  53. ./tools/fru-generator -v CERN -n FmcAdc100m14b4cha \
  54. -s HCCFFIA___-CR000003 -p EDA-02063-V5-0 > eeprom.bin
  55. The following example shows a script that builds several binary EEPROM
  56. images for a series of boards, changing the serial number for each of
  57. them. The script uses a mix of environment variables and command line
  58. options, and uses the same string patterns shown above.
  59. #!/bin/sh
  60. export FRU_VENDOR="CERN"
  61. export FRU_NAME="FmcAdc100m14b4cha"
  62. export FRU_PART="EDA-02063-V5-0"
  63. serial="HCCFFIA___-CR"
  64. for number in $(seq 1 50); do
  65. # build number-string "ns"
  66. ns="$(printf %06d $number)"
  67. ./fru-generator -s "${serial}${ns}" > eeprom-${ns}.bin
  68. done
  69. Using SDB-FS in the EEPROM
  70. ==========================
  71. If you want to use SDB as a filesystem in the EEPROM device within the
  72. mezzanine, you should create one such filesystem using gensdbfs, from
  73. the fpga-config-space package on OHWR.
  74. By using an SBD filesystem you can cluster several files in a single
  75. EEPROM, so both the host system and a soft-core running in the FPGA (if
  76. any) can access extra production-time information.
  77. We chose to use SDB as a storage filesystem because the format is very
  78. simple, and both the host system and the soft-core will likely already
  79. include support code for such format. The SDB library offered by the
  80. fpga-config-space is less than 1kB under LM32, so it proves quite up to
  81. the task.
  82. The SDB entry point (which acts as a directory listing) cannot live at
  83. offset zero in the flash device, because the FRU information must live
  84. there. To avoid wasting precious storage space while still allowing
  85. for more-than-minimal FRU structures, the fmc.ko will look for the SDB
  86. record at address 256, 512 and 1024.
  87. In order to generate the complete EEPROM image you'll need a
  88. configuration file for gensdbfs: you tell the program where to place
  89. the sdb entry point, and you must force the FRU data file to be placed
  90. at the beginning of the storage device. If needed, you can also place
  91. other files at a special offset (we sometimes do it for backward
  92. compatibility with drivers we wrote before implementing SDB for flash
  93. memory).
  94. The directory tools/sdbfs of this package includes a well-commented
  95. example that you may want to use as a starting point (the comments are
  96. in the file called -SDB-CONFIG-). Reading documentation for gensdbfs
  97. is a suggested first step anyways.
  98. This package (generic FMC bus support) only accesses two files in the
  99. EEPROM: the FRU information, at offset zero, with a suggested filename
  100. of IPMI-FRU and the short name for the mezzanine, in a file called
  101. name. The IPMI-FRU name is not mandatory, but a strongly suggested
  102. choice; the name filename is mandatory, because this is the preferred
  103. short name used by the FMC core. For example, a name of "fdelay" may
  104. supplement a Product Name like "FmcDelay1ns4cha" - exactly as
  105. demonstrated in `tools/sdbfs'.
  106. Note: SDB access to flash memory is not yet supported, so the short
  107. name currently in use is just the "Product Name" FRU string.
  108. The example in tools/sdbfs includes an extra file, that is needed by
  109. the fine-delay driver, and must live at a known address of 0x1800. By
  110. running gensdbfs on that directory you can output your binary EEPROM
  111. image (here below spusa$ is the shell prompt):
  112. spusa$ ../fru-generator -v CERN -n FmcDelay1ns4cha -s proto-0 \
  113. -p EDA-02267-V3 > IPMI-FRU
  114. spusa$ ls -l
  115. total 16
  116. -rw-rw-r-- 1 rubini staff 975 Nov 19 18:08 --SDB-CONFIG--
  117. -rw-rw-r-- 1 rubini staff 216 Nov 19 18:13 IPMI-FRU
  118. -rw-rw-r-- 1 rubini staff 11 Nov 19 18:04 fd-calib
  119. -rw-rw-r-- 1 rubini staff 7 Nov 19 18:04 name
  120. spusa$ sudo gensdbfs . /lib/firmware/fdelay-eeprom.bin
  121. spusa$ sdb-read -l -e 0x100 /lib/firmware/fdelay-eeprom.bin
  122. /home/rubini/wip/sdbfs/userspace/sdb-read: listing format is to be defined
  123. 46696c6544617461:2e202020 00000100-000018ff .
  124. 46696c6544617461:6e616d65 00000200-00000206 name
  125. 46696c6544617461:66642d63 00001800-000018ff fd-calib
  126. 46696c6544617461:49504d49 00000000-000000d7 IPMI-FRU
  127. spusa$ ../fru-dump /lib/firmware/fdelay-eeprom.bin
  128. /lib/firmware/fdelay-eeprom.bin: manufacturer: CERN
  129. /lib/firmware/fdelay-eeprom.bin: product-name: FmcDelay1ns4cha
  130. /lib/firmware/fdelay-eeprom.bin: serial-number: proto-0
  131. /lib/firmware/fdelay-eeprom.bin: part-number: EDA-02267-V3
  132. As expected, the output file is both a proper sdbfs object and an IPMI
  133. FRU information blob. The fd-calib file lives at offset 0x1800 and is
  134. over-allocated to 256 bytes, according to the configuration file for
  135. gensdbfs.