Commit ff867c60 authored by Alessandro Rubini's avatar Alessandro Rubini

general: add PPSi as an alternative to ptp-noposix

The PPSi daemon can now be selected in Kconfig. This commit
changes configuration and the build scripts to support either of them.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent d61b388a
......@@ -15,3 +15,21 @@ config BR2_CONFIGFILE
scripts print a warning and use the default file. Incorrect
files lead to unpredicatable results.
choice
prompt "PTP daemon implementation"
config PTP_NOPOSIX
bool "Use ptp-noposix daemon"
help
This implementation is being phased out, because it became
unmaintainable over time. However, it is still the default
at this point in time, because it has been tested and used
for a long time.
config PPSI
bool "Use PPSi daemon"
help
PPSi (PTP Ported to Silicon) is the new implementation, which
is already the default PTP run in the White Rabbit node.
endchoice
#!/bin/bash
# check variables, like all scripts herein do
WRS_SCRIPT_NAME=$(basename $0)
if [ -z "$WRS_BASE_DIR" ]; then
echo "$0: Plesae set WRS_BASE_DIR" >& 2
exit 1
fi
. ${WRS_BASE_DIR}/scripts/wrs_functions
# This step is controlled by Kconfig: skip it if not selected
if [ "x$CONFIG_PPSI" = "x" ]; then
exit 0
fi
wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE
wrs_echo "--- PTP daemon (PPSi repository as a submodule)"
# checkout, in case the user didn't do that
cd ${WRS_BASE_DIR}/..
git submodule init -q
git submodule update -q
cd userspace/ppsi
make clean
# we need LINUX and CROSS_COMPILE. The latter is there for sure
if [ "x$LINUX" == "x" ]; then
export LINUX="$WRS_OUTPUT_DIR/build/linux-2.6.39"
fi
make ARCH=wrs PROTO_EXT=whiterabbit || wrs_die "cannot build PPSi"
install -d "$WRS_OUTPUT_DIR/images/wr/bin"
install ppsi "$WRS_OUTPUT_DIR/images/wr/bin"
......@@ -7,6 +7,11 @@ if [ -z "$WRS_BASE_DIR" ]; then
fi
. ${WRS_BASE_DIR}/scripts/wrs_functions
# This step is controlled by Kconfig: skip it if not selected
if [ "x$CONFIG_PTP_NOPOSIX" = "x" ]; then
exit 0
fi
wrs_check_vars WRS_OUTPUT_DIR WRS_DOWNLOAD_DIR CROSS_COMPILE
wrs_echo "--- PTP daemon (noposix repository as a submodule)"
......
......@@ -124,8 +124,7 @@ wrs_build_step () {
script="$WRS_SCRIPTS_DIR/$2"
if [ -f $markerfile ]; then
wrs_echo "Marker $1 exists:"
wrs_echo " not running $2"
wrs_echo "$1 done; skipping script $2"
return
fi
......@@ -157,6 +156,7 @@ wrs_build_step 03-barebox wrs_build_barebox
wrs_build_step 04-kernel wrs_build_kernel
wrs_build_step 05-modules wrs_build_modules
wrs_build_step 06-ptp-noposix wrs_build_ptp_noposix
wrs_build_step 06-ppsi wrs_build_ppsi
wrs_build_step 07-wrs-userspace wrs_build_userspace
wrs_build_step 08-wrs-gateware wrs_build_gateware
wrs_build_step 09-wrap-rootfs wrs_build_wraprootfs
......
#
# Automatically generated make config: don't edit
#
CONFIG_BR2_CONFIGFILE="wrs_release_br2_config"
# CONFIG_PTP_NOPOSIX is not set
CONFIG_PPSI=y
......@@ -2,3 +2,5 @@
# Automatically generated make config: don't edit
#
CONFIG_BR2_CONFIGFILE="wrs_release_br2_config"
CONFIG_PTP_NOPOSIX=y
# CONFIG_PPSI is not set
......@@ -6,5 +6,17 @@ export WR_HOME="/wr"
$WR_HOME/bin/wrsw_hal -c $WR_HOME/etc/wrsw_hal.conf &> /dev/kmsg &
$WR_HOME/bin/wrsw_rtud >& /dev/kmsg &
$WR_HOME/bin/ptpd -A -c >& /dev/null &
# run ptp-noposix or ppsi, whatever is installed
if [ -x $WR_HOME/bin/ptpd ]; then
$WR_HOME/bin/ptpd -A -c >& /dev/null &
exit 0
fi
if [ -x $WR_HOME/bin/ppsi ]; then
$WR_HOME/bin/pppsi >& /dev/kmsg &
exit 0
fi
echo "No WR-PTP dameon found" >&2
exit 1
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