Commit 594beec6 authored by Alessandro Rubini's avatar Alessandro Rubini

whiterabbit: arch-wrs and arch-wrpc can't be build without WR support

This was a trial of mine, but it really has never been working (at least
on wrs -- I think nobody ever tried a non-wr code base on wrpc).

Too much of the timetamping, servo, pll, is dependent on WR being
available, this academic idea doesn't make much sense, so let's remove
a number of conditionals (and associated potential bugs).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent b8ebe5fe
......@@ -68,23 +68,14 @@ config ARCH
default "sim" if ARCH_SIMULATOR
choice EXTENSION
prompt "Protocol Extension"
# This is not a choice any more: it is mandated by the architecture
config EXT_WR
bool "White Rabbit" if ARCH_WRS || ARCH_WRPC
help
Build WR-PTP (which is able to works as a standard PTP agent,
when the peer is not WR-aware).
bool
default y if ARCH_WRS || ARCH_WRPC
config EXT_NONE
bool "None"
default y
help
Select not protocol extension (build standard PTP-V2 daemon).
endchoice
bool
default !EXT_WR
config EXTENSION
string
......
......@@ -19,8 +19,9 @@ OBJ-y += $A/wrs-startup.o \
lib/drop.o \
lib/div64.o
# The user can set TIME=, but wrs is default
TIME ?= wrs
# These two are mandatory for arch-wrs
TIME = wrs
PROTO_EXT = whiterabbit
include time-$(TIME)/Makefile
......
......@@ -4,12 +4,6 @@
*
* Released to the public domain
*/
#ifdef CONFIG_EXT_WR
# define BUILT_WITH_WHITERABBIT 1
#else
# define BUILT_WITH_WHITERABBIT 0
#endif
/*
* These are the functions provided by the various wrs files
......
......@@ -56,8 +56,7 @@ static int run_all_state_machines(struct pp_globals *ppg)
ppi->n_ops->exit(ppi);
ppi->frgn_rec_num = 0;
ppi->frgn_rec_best = -1;
if (BUILT_WITH_WHITERABBIT
&& ppg->ebest_idx == ppi->port_idx)
if (ppg->ebest_idx == ppi->port_idx)
wr_servo_reset();
}
}
......
......@@ -28,13 +28,11 @@ static struct minipc_pd __rpcdef_cmd = {
/* Execute command coming ipc */
static int wrsipc_cmd(int cmd, int value)
{
if (BUILT_WITH_WHITERABBIT) {
if(cmd == PTPDEXP_COMMAND_TRACKING)
wr_servo_enable_tracking(value);
if(cmd == PTPDEXP_COMMAND_MAN_ADJUST_PHASE)
wr_servo_man_adjust_phase(value);
}
return 0;
}
......
......@@ -26,11 +26,7 @@
#include <ppsi-wrs.h>
#include <libwr/shmem.h>
#if BUILT_WITH_WHITERABBIT
# define WRSW_HAL_RETRIES 1000
#else
# define WRSW_HAL_RETRIES 0
#endif
#define WRSW_HAL_TIMEOUT 2000000 /* us */
......@@ -100,12 +96,11 @@ int main(int argc, char **argv)
usleep(WRSW_HAL_TIMEOUT);
}
if (BUILT_WITH_WHITERABBIT && !hal_ch) {
if (!hal_ch) {
pp_printf("ppsi: could not connect to HAL RPC");
exit(1);
}
if (BUILT_WITH_WHITERABBIT) {
/* If we connected, we also know "for sure" shmem is there */
hal_head = wrs_shm_get(wrs_shm_hal,"", WRS_SHM_READ);
if (!hal_head || !hal_head->data_off) {
......@@ -148,7 +143,6 @@ int main(int argc, char **argv)
}
alloc_fn = wrs_shm_alloc;
ppsi_head->version = WRS_PPSI_SHMEM_VERSION;
}
ppg = alloc_fn(ppsi_head, sizeof(*ppg));
ppg->defaultDS = alloc_fn(ppsi_head, sizeof(*ppg->defaultDS));
......@@ -243,7 +237,6 @@ int main(int argc, char **argv)
ppsi_drop_init(ppg, seed);
/* release lock from wrs_shm_get */
if (BUILT_WITH_WHITERABBIT)
wrs_shm_write(ppsi_head, WRS_SHM_WRITE_END);
wrs_main_loop(ppg);
......
#
# Automatically generated make config: don't edit
#
# CONFIG_ARCH_UNIX is not set
# CONFIG_ARCH_BARE_I386 is not set
# CONFIG_ARCH_BARE_X86_64 is not set
CONFIG_ARCH_WRPC=y
# CONFIG_ARCH_WRS is not set
CONFIG_ARCH="wrpc"
# CONFIG_EXT_WR is not set
CONFIG_EXT_NONE=y
CONFIG_EXTENSION=""
CONFIG_CROSS_COMPILE="/opt/gcc-lm32/bin/lm32-elf-"
CONFIG_ARCH_CFLAGS=""
CONFIG_ARCH_LDFLAGS=""
#
# Automatically generated make config: don't edit
#
# CONFIG_ARCH_UNIX is not set
# CONFIG_ARCH_BARE_I386 is not set
# CONFIG_ARCH_BARE_X86_64 is not set
# CONFIG_ARCH_WRPC is not set
CONFIG_ARCH_WRS=y
CONFIG_ARCH="wrs"
# CONFIG_EXT_WR is not set
CONFIG_EXT_NONE=y
CONFIG_EXTENSION=""
CONFIG_CROSS_COMPILE="/opt/arm-wrswitch/bin/arm-linux-"
CONFIG_ARCH_CFLAGS=""
CONFIG_ARCH_LDFLAGS=""
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