diff --git a/Kconfig b/Kconfig index d68c87ad8adac75c574e04b11839a77912bd2085..b966d0dd9b9a2a136e259b3262fa1ad45a92e97f 100644 --- a/Kconfig +++ b/Kconfig @@ -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 diff --git a/arch-wrs/Makefile b/arch-wrs/Makefile index c0e36118cd0c85aeb1641635efe8954256c10610..758441b33b4dd293c8bb63e31bf3148091526c52 100644 --- a/arch-wrs/Makefile +++ b/arch-wrs/Makefile @@ -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 diff --git a/arch-wrs/include/ppsi-wrs.h b/arch-wrs/include/ppsi-wrs.h index 734ad3365a5f358b4610c8a5dc62005331008873..383c454aad375e5b4f3c9caf474247f9c1941f04 100644 --- a/arch-wrs/include/ppsi-wrs.h +++ b/arch-wrs/include/ppsi-wrs.h @@ -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 diff --git a/arch-wrs/main-loop.c b/arch-wrs/main-loop.c index 5140d90aed66e6c1fe2d686257aa5c24f8e53878..e06bff3c8fe360ce8f8fcd541f73470f5a29eea7 100644 --- a/arch-wrs/main-loop.c +++ b/arch-wrs/main-loop.c @@ -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(); } } diff --git a/arch-wrs/wrs-ipcserver.c b/arch-wrs/wrs-ipcserver.c index 1dd2e1ad0ec3db9a4dccc682bc0240a6ef77ffa3..70a1ed11781c034fbaabd6371992840ceaf2539f 100644 --- a/arch-wrs/wrs-ipcserver.c +++ b/arch-wrs/wrs-ipcserver.c @@ -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_TRACKING) + wr_servo_enable_tracking(value); - if(cmd == PTPDEXP_COMMAND_MAN_ADJUST_PHASE) - wr_servo_man_adjust_phase(value); - } + if(cmd == PTPDEXP_COMMAND_MAN_ADJUST_PHASE) + wr_servo_man_adjust_phase(value); return 0; } diff --git a/arch-wrs/wrs-startup.c b/arch-wrs/wrs-startup.c index 649a8e9aa15c071a1ac7ff947e6ca3b74cf5b70d..e7608c6745683c4ecefe18a221eb89f8ae18443b 100644 --- a/arch-wrs/wrs-startup.c +++ b/arch-wrs/wrs-startup.c @@ -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,55 +96,53 @@ 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) { - pp_printf("ppsi: Can't connect with HAL " - "shared memory\n"); - exit(1); - } - if (hal_head->version != HAL_SHMEM_VERSION) { - pp_printf("ppsi: unknown HAL's shm version %i " - "(known is %i)\n", hal_head->version, - HAL_SHMEM_VERSION); - exit(1); - } + /* 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) { + pp_printf("ppsi: Can't connect with HAL " + "shared memory\n"); + exit(1); + } + if (hal_head->version != HAL_SHMEM_VERSION) { + pp_printf("ppsi: unknown HAL's shm version %i " + "(known is %i)\n", hal_head->version, + HAL_SHMEM_VERSION); + exit(1); + } - h = (void *)hal_head + hal_head->data_off; - hal_nports = h->nports; + h = (void *)hal_head + hal_head->data_off; + hal_nports = h->nports; - hal_ports = wrs_shm_follow(hal_head, h->ports); + hal_ports = wrs_shm_follow(hal_head, h->ports); - if (!hal_ports) { - pp_printf("ppsi: unable to follow hal_ports pointer " - "in HAL's shmem\n"); - exit(1); - } + if (!hal_ports) { + pp_printf("ppsi: unable to follow hal_ports pointer " + "in HAL's shmem\n"); + exit(1); + } - /* And create your own channel, until we move to shmem too */ - ppsi_ch = minipc_server_create("ptpd", 0); - if (!ppsi_ch) { /* FIXME should we retry ? */ - pp_printf("ppsi: could not create minipc server"); - exit(1); - } - wrs_init_ipcserver(ppsi_ch); + /* And create your own channel, until we move to shmem too */ + ppsi_ch = minipc_server_create("ptpd", 0); + if (!ppsi_ch) { /* FIXME should we retry ? */ + pp_printf("ppsi: could not create minipc server"); + exit(1); + } + wrs_init_ipcserver(ppsi_ch); - ppsi_head = wrs_shm_get(wrs_shm_ptp, "ppsi", - WRS_SHM_WRITE | WRS_SHM_LOCKED); - if (!ppsi_head) { - fprintf(stderr, "Fatal: could not create shmem: %s\n", - strerror(errno)); - exit(1); - } - alloc_fn = wrs_shm_alloc; - ppsi_head->version = WRS_PPSI_SHMEM_VERSION; + ppsi_head = wrs_shm_get(wrs_shm_ptp, "ppsi", + WRS_SHM_WRITE | WRS_SHM_LOCKED); + if (!ppsi_head) { + fprintf(stderr, "Fatal: could not create shmem: %s\n", + strerror(errno)); + exit(1); } + 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,8 +237,7 @@ 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_shm_write(ppsi_head, WRS_SHM_WRITE_END); wrs_main_loop(ppg); return 0; /* never reached */ diff --git a/configs/wrpc-nonwr_defconfig b/configs/wrpc-nonwr_defconfig deleted file mode 100644 index 31668140079f57370f92c0670e96c8e8123959bf..0000000000000000000000000000000000000000 --- a/configs/wrpc-nonwr_defconfig +++ /dev/null @@ -1,15 +0,0 @@ -# -# 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="" diff --git a/configs/wrs-nonwr_defconfig b/configs/wrs-nonwr_defconfig deleted file mode 100644 index 4da22ea71022e97604cb18da8811be9b95e893b3..0000000000000000000000000000000000000000 --- a/configs/wrs-nonwr_defconfig +++ /dev/null @@ -1,15 +0,0 @@ -# -# 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=""