Commit e5e3a0e3 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: set PTP's clockClass depending on a clock configuration

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 9def24ca
......@@ -627,6 +627,10 @@ config TIME_GM
This options selects the White Rabbit Switch as a grandmaster,
i.e. it uses its input channels to track an Atomic or GPS and
claim to be a PTP authoritative source on the network.
The clockClass is set to 6 which designates a clock that is
synchronized to a primary reference time source.
The value of the clockClass can be overridden by the user in
a separate configuration parameter (CONFIG_PTP_OPT_CLOCK_CLASS).
config TIME_FM
bool "Free-Running Master"
......@@ -634,6 +638,11 @@ config TIME_FM
The White Rabbit Switch pretends to be a master on his PTP
network, but it doesn't sync to an external source. Its own
internal clocks and counters are used to drive timing.
The clockClass is set to 52 which designates a clock that shall not
be a slave to another clock i the domain.
The value of the clockClass can be overridden by the user in
a separate configuration parameter (CONFIG_PTP_OPT_CLOCK_CLASS).
config TIME_BC
bool "Boundary Clock"
......@@ -641,6 +650,9 @@ config TIME_BC
The White Rabbit Switch is a normal PTP Boundary Clock: it is
slave on one of its ports and master on the other ones, according
to the standard Best Master Clock algorithm.
The clockClass is set to 248 which is the default clockClass.
The value of the clockClass can be overridden by the user in
a separate configuration parameter (CONFIG_PTP_OPT_CLOCK_CLASS).
endchoice
......
......@@ -805,6 +805,9 @@ appropriate way, before the respective service is started.
external reference; or a normal ``boundary-clock'' (BC) device that
is slave on some ports and master on other ports.
The PTP's clockClass is set based on which option is selected.
For the GM the clockClass is 6, for the FM is 52, for the BC is 248.
@item CONFIG_PTP_PORT_PARAMS
@itemx CONFIG_PTP_CUSTOM
@itemx CONFIG_PTP_REMOTE_CONF
......
......@@ -21,8 +21,19 @@ echo "# This file will be overwritten at next boot." >> $OUTPUT_FILE
#copy top of ppsi.conf
cat $PRE_FILE >> $OUTPUT_FILE
if [ -n "$CONFIG_PTP_OPT_CLOCK_CLASS" ]; then
echo clock-class "$CONFIG_PTP_OPT_CLOCK_CLASS" >> $OUTPUT_FILE
else
if [ "$CONFIG_TIME_GM" = "y" ]; then
echo clock-class 6 >> $OUTPUT_FILE
fi
if [ "$CONFIG_TIME_FM" = "y" ]; then
echo clock-class 52 >> $OUTPUT_FILE
fi
if [ "$CONFIG_TIME_BC" = "y" ]; then
echo clock-class 248 >> $OUTPUT_FILE
fi
fi
if [ -n "$CONFIG_PTP_OPT_CLOCK_ACCURACY" ]; then
......@@ -52,6 +63,9 @@ if [ -n "$CONFIG_PTP_OPT_PRIORITY2" ]; then
echo priority2 "$CONFIG_PTP_OPT_PRIORITY2" >> $OUTPUT_FILE
fi
# 2 new lines
echo -n -e "\n\n" >> $OUTPUT_FILE
for i_zero in {01..18};do
# unset parametes
unset p_name
......
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