diff --git a/tools/sdbfs.README b/tools/sdbfs.README new file mode 100644 index 0000000000000000000000000000000000000000..1edc6e32f8bc5360bfe85f7d5e56bdd8a5c4c6b9 --- /dev/null +++ b/tools/sdbfs.README @@ -0,0 +1,53 @@ + +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). + +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. + +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 diff --git a/tools/sdbfs/--SDB-CONFIG-- b/tools/sdbfs/--SDB-CONFIG-- new file mode 100644 index 0000000000000000000000000000000000000000..7c641244cd3d9c95a071b061c228227ef0f1d69a --- /dev/null +++ b/tools/sdbfs/--SDB-CONFIG-- @@ -0,0 +1,30 @@ +# +# Even though in I2C eeproms we are going to be a subdirectory, not starting +# at offset zero at all, we want to start at zero *wihin* our space. +# This is actually the default, but stating it is better. +. + position = 0 + +# Then, we have a number of writable files. By default (i.e. no config) +# all existing files are created as read-only files with current contents +# and exact size. +# +# Allocation granularity is 64 bytes + +mac-address + write = 1 + maxsize = 6 + +wr-init + write = 1 + maxsize = 256 + +# each sfp takes 29 bytes, 4 of them fit in 128 bytes +sfp-database + write = 1 + maxsize = 128 + +# I don't know what this is +calibration + write = 1 + maxsize = 128 diff --git a/tools/sdbfs/calibration b/tools/sdbfs/calibration new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/sdbfs/mac-address b/tools/sdbfs/mac-address new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/sdbfs/sfp-database b/tools/sdbfs/sfp-database new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/sdbfs/wr-init b/tools/sdbfs/wr-init new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391