sdbfs.README 2.73 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

SDB (Self Describing Bus) is designed withing the fpga-config-space OHWR
project. See http://www.ohwr.org/projects/fpga-config-space/wiki

The "sdbfs" implementation of SDB is a storage layout that lays out
data in a device using the same data structures we deviced for memory
spaces.

The tools/sdbfs directory includes the template to generate an sdbfs
to be written in the device's eeprom. It includes 4 files, which
have their "device-id" in SDB, using the first 4 characters of the name:
seen as devices from an sdn 

         file name           sdb device name
         -----------------------------------
         mac-ddress             mac-
         wr-init                wr-i
         sfp-database           sfp-
         calibration            cali

All the files are empty at this point, but ./tools/sdbfs/--SDB-CONFIG--
assigns a size to each of them.  The code in wrpc-sw can read and write
the files.

All related tools (gensdbfs and so on) and their documentation live in
the fpga-config-space packages, sdbfs subdirectory.


To create the filesystem image: "gensdbfs tools/sdbfs /tmp/sdb-wrpc.bin"
(please note that empty files have no data to be stored, so no space is
wasted on disk for them and the output file is short).

33 34
To create the flash filesystem image, don't forget about setting the sector
size. For flash chip on SPEC card, it is 64k:
35 36 37 38 39 40 41
gensdbfs -b 65536 tools/sdbfs-flash /tmp/sdb-wrpc.bin

For non-Linux users, who want to use Xilinx Impact or promgen to merge their own
bitstream with the sdbfs image for standalone SPEC/SVEC operation, the image
generated has to be modified. Normally, first part of the sdbfs image is the
empty gateware file. These bytes have to be cut:
cut -b 1507329- /tmp/sdb-wrpc.bin > /tmp/sdb-wrpc-standalone.bin
42

43 44 45 46 47 48 49 50 51 52 53 54 55
To check: "sdb-read -l /tmp/sdb-wrpc.bin":

   46696c6544617461:2e202020 @ 00000000-0000037f .
   46696c6544617461:77722d69 @ 00000140-0000023f wr-init
   46696c6544617461:6d61632d @ 00000240-00000245 mac-address
   46696c6544617461:7366702d @ 00000280-000002ff sfp-database
   46696c6544617461:63616c69 @ 00000300-0000037f calibration

This states where the various files are.

To write to w1-eeprom:  "tools/wrpc-w1-write 0 320 < /tmp/sdb-wrpc.bin"
(this assumes that the size is 320 bytes.

56 57 58
To write to the flash: "tools/flash-write 0 320 < /tmp/sdb-wrpc.bin"
(again, assuming a 320-byte-sized image file).

59 60 61 62 63 64 65 66
The next boot of lm32 will show it found the files:

   sdbfs: found at 0 in W1
   file 0x2e202020 @    0, name .
   file 0x77722d69 @  320, name wr-init
   file 0x6d61632d @  576, name mac-address
   file 0x7366702d @  640, name sfp-database
   file 0x63616c69 @  768, name calibration
67 68

To read the flash: "tools/flash-read 0 320 > /tmp/flash.bin",
69
and then check the flash image file: "sdb-read -l /tmp/flash.bin".