Commit 08b3b632 authored by Benoit Rat's avatar Benoit Rat

Merged in ben-191104-sdbfs_format (pull request #11)

Ben 191104 sdbfs format
parents 35c3778d 4d70efd9
...@@ -90,6 +90,8 @@ $if(listings)$ ...@@ -90,6 +90,8 @@ $if(listings)$
\lstset{% \lstset{%
basicstyle=\small\ttfamily, basicstyle=\small\ttfamily,
breaklines=true, breaklines=true,
keepspaces=true,
showstringspaces=false,
fancyvrb=true, fancyvrb=true,
tabsize=2, tabsize=2,
columns=fullflexible, columns=fullflexible,
......
...@@ -333,7 +333,7 @@ Once you have your system running with the boards plugged, you need to: ...@@ -333,7 +333,7 @@ Once you have your system running with the boards plugged, you need to:
* Check that the boards has been detected * Check that the boards has been detected
* Install the tools to build drivers, etc... * Install the tools to build drivers, etc...
* The drivers : `spec-sw` * The drivers : `spec-sw`, `fmc-dio-5chttla`, `wr-nic`
SPEC detection SPEC detection
...@@ -585,7 +585,7 @@ obtain appropriate permission on the device: `sudo usermod -a -G dialout $USER` ...@@ -585,7 +585,7 @@ obtain appropriate permission on the device: `sudo usermod -a -G dialout $USER`
The White Rabbit Core Shell The White Rabbit Core Shell
---------------------------- ----------------------------
Once you are in the UART you should obtain the White Rabit Core console (`wrc#`). Once you are in the UART you should obtain the WR PTP Core console (`wrc#`).
A complete reference of the shell commands is included in the [wrpc.pdf] manual or A complete reference of the shell commands is included in the [wrpc.pdf] manual or
you can read them in the [Wiki](https://www.ohwr.org/project/wr-cores/wikis/home) you can read them in the [Wiki](https://www.ohwr.org/project/wr-cores/wikis/home)
...@@ -603,6 +603,128 @@ For the tutorial we will use the following names: ...@@ -603,6 +603,128 @@ For the tutorial we will use the following names:
* `wrc2#` for `wrc#` console of the main board (wri1/busID=0x0100) on the PC02 * `wrc2#` for `wrc#` console of the main board (wri1/busID=0x0100) on the PC02
Initial Configuration using SDBFS partition
------------------------------------
Since version 3.0 of WR PTP Core ([wrpc-sw]), the on-board flash memory chip on the carrier
is used as a default place for storing calibration parameters and an init script.
The storage format of this information is organized in an SDBFS filesystem that **MUST BE** pre-formatted and
should be properly configured at least once (in case it has not been done during the manufacturing tests).
### Checking if SDBFS is properly formatted
The first thing to do is to verify that the SDBFS has been properly formatted and configured.
To do so you should check the trace messages while [connecting to the UART](#connect-to-the-uarts).
In case you see an error while WR Core is initializing such as:
~~~~~{.sh}
WR Core: starting up...
...
No SDB filesystem in i2c eeprom
~~~~~~~~~~
Or
~~~~~{.sh}
WR Core: starting up...
...
get_persistent_mac: SDB error
get_persistent_mac: SDB file is empty
get_persistent_mac: Using W1 serial number
~~~~~~~~~~
This means that SDBFS as not been founded or that SDBFS is not properly formatted (corrupted).
In this case you should format SDBFS as detailed in the [next section](#formatting-sdbfs).
In case SDBFS is found but an error message about an "empty SDB file" appears when retrieving
the MAC address of the device: you should jump to
[configuring the MAC address](#configuring-mac-address) section.
~~~~~{.sh}
WR Core: starting up...
sdbfs: found at 3014656 in Flash
...
get_persistent_mac: SDB file is empty
get_persistent_mac: Using W1 serial number
~~~~~~~~~~
If none of these warnings arise during initialization this mean that you can skip the next
steps and go directly to [configuring slave & master mode](#configure-in-slave-master-mode) section.
### Formatting SDBFS
> **Warning**: You should skip the following step if you have verified that
> the SDBFS is [properly formatted](#checking-if-sdbfs-is-properly-formatted).
Therefore, starting from v3.0 you have to write the empty
SDBFS filesystem image to the flash before running the WRPC. The simplest way of
doing this is by calling a WR PTP Core shell command:
~~~~~{.sh}
wrc# sdb fs 0
~~~~~
You should see the output similar to:
~~~~~{.sh}
filename: . ; first: 2e0000; last: 32007f
filename: wr-init ; first: 2f0000; last: 2f00ff
filename: calibration ; first: 300000; last: 30007f
filename: mac-address ; first: 310000; last: 310005
filename: sfp-database ; first: 320000; last: 32007f
Formatting SDBFS in Flash(0x2e0000)...
~~~~~
After formatting the SDBFS, you should reconfigure the
[MAC address](#configuring-mac-address) and the
[calibration](#calibration).
> **Note:** Other methods exists to format SDBFS with a pre-existing binary files:
> through the PCIe bus ([wrpc-sw].pdf > Appendix C), or using a Xilinx JTAG cable when
> [running in standalone](#run-in-standalone).
### Configuring MAC address
> **Note:** Configuring properly the MAC address is recommanded but not mandatory.
In case you get the messages at the initialization of WR PTP Core:
~~~~~{.sh}
WR Core: starting up...
...
get_persistent_mac: SDB file is empty
get_persistent_mac: Using W1 serial number
~~~~~
Your [SPEC] board will use a "auto-generated" MAC address using the
thermometer serial number (W1) as is unique among SPEC devices.
And if even if this MAC should be uniq on this network it has not been
officially assigned following the [IEEE OUI].
You should get the MAC for your board from its manufacturer. To configure the
address and store it into the Flash/EEPROM (so that it's automatically loaded
every time the WRPC starts) you should type two commands in the shell:
~~~~~{.sh}
wrc# mac set xx:xx:xx:xx:xx:xx
wrc# mac setp xx:xx:xx:xx:xx:xx
~~~~~
where `xx:xx:xx:xx:xx:xx` is the MAC address of your board.
To verify it back, you should run
~~~~~{.sh}
wrc# mac get
~~~~~
After rebooting the machine.
Configure in slave & master mode Configure in slave & master mode
-------------------------------- --------------------------------
...@@ -770,11 +892,11 @@ For example you can set it up like this ...@@ -770,11 +892,11 @@ For example you can set it up like this
After reprogramming/rebooting the FGPA, the channels are set up by default as: After reprogramming/rebooting the FGPA, the channels are set up by default as:
#. Channel 0 (connector #1) output a PPS signal: `p` 1. Channel 0 (connector #1) output a PPS signal: `p`
#. Channel 1 (connector #2) low state: `0`. 2. Channel 1 (connector #2) low state: `0`.
#. Channel 2 (connector #3) same as ch1: low state: `0` 3. Channel 2 (connector #3) same as ch1: low state: `0`
#. Channel 3 (connector #4) is configured as input with termination impedance: `i`. 4. Channel 3 (connector #4) is configured as input with termination impedance: `i`.
#. Channel 4 (connector #5) is in Clock Mode with termination: `C`. 5. Channel 4 (connector #5) is in Clock Mode with termination: `C`.
To reset to the default mode you can reset/reprogram the FPGA or set it back with: To reset to the default mode you can reset/reprogram the FPGA or set it back with:
...@@ -1747,6 +1869,7 @@ References ...@@ -1747,6 +1869,7 @@ References
[FMC fine-delay]: https://sevensols.com/index.php/fmc-del/ [FMC fine-delay]: https://sevensols.com/index.php/fmc-del/
[OHWR]: http://www.ohwr.org/projects/white-rabbit [OHWR]: http://www.ohwr.org/projects/white-rabbit
[Seven Solutions]: http://www.sevensols.com [Seven Solutions]: http://www.sevensols.com
[IEEE OUI]: https://standards.ieee.org/products-services/regauth/index.html
[wr-switch-guide.pdf]: https://sevensols.com/index.php/products/white-rabbit-switch/ [wr-switch-guide.pdf]: https://sevensols.com/index.php/products/white-rabbit-switch/
[wr-nic]: http://www.ohwr.org/projects/wr-nic/ [wr-nic]: http://www.ohwr.org/projects/wr-nic/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment