Alessandro Rubini | 6c62a89 | 2013-06-18 23:47:35 +0200 | [diff] [blame] | 1 | fmc-fakedev |
| 2 | =========== |
| 3 | |
| 4 | This package includes a software-only device, called fmc-fakedev, which |
| 5 | is able to register up to 4 mezzanines (by default it registers one). |
| 6 | Unlike the SPEC driver, which creates an FMC device for each PCI cards |
| 7 | it manages, this module creates a single instance of its set of |
| 8 | mezzanines. |
| 9 | |
| 10 | It is meant as the simplest possible example of how a driver should be |
| 11 | written, and it includes a fake EEPROM image (built using the tools |
| 12 | described in *note FMC Identification::),, which by default is |
| 13 | replicated for each fake mezzanine. |
| 14 | |
| 15 | You can also use this device to verify the match algorithms, by asking |
| 16 | it to test your own EEPROM image. You can provide the image by means of |
| 17 | the eeprom= module parameter: the new EEPROM image is loaded, as usual, |
| 18 | by means of the firmware loader. This example shows the defaults and a |
| 19 | custom EEPROM image: |
| 20 | |
| 21 | spusa.root# insmod fmc-fakedev.ko |
| 22 | [ 99.971247] fake-fmc-carrier: mezzanine 0 |
| 23 | [ 99.975393] Manufacturer: fake-vendor |
| 24 | [ 99.979624] Product name: fake-design-for-testing |
| 25 | spusa.root# rmmod fmc-fakedev |
| 26 | spusa.root# insmod fmc-fakedev.ko eeprom=fdelay-eeprom.bin |
| 27 | [ 121.447464] fake-fmc-carrier: Mezzanine 0: eeprom "fdelay-eeprom.bin" |
| 28 | [ 121.462725] fake-fmc-carrier: mezzanine 0 |
| 29 | [ 121.466858] Manufacturer: CERN |
| 30 | [ 121.470477] Product name: FmcDelay1ns4cha |
| 31 | spusa.root# rmmod fmc-fakedev |
| 32 | |
| 33 | After loading the device, you can use the write_ee method do modify its |
| 34 | own internal fake EEPROM: whenever the image is overwritten starting at |
| 35 | offset 0, the module will unregister and register again the FMC device. |
| 36 | This is shown in fmc-write-eeprom.txt |