Commit 84ebc48c authored by Alessandro Rubini's avatar Alessandro Rubini

general: remove references to ptp-noposix

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 35e279ee
...@@ -165,21 +165,10 @@ config PRINTF_NONE ...@@ -165,21 +165,10 @@ config PRINTF_NONE
but not suited for wrpc-sw. See pp_printf/README for details. but not suited for wrpc-sw. See pp_printf/README for details.
endchoice endchoice
choice
prompt "Choose your preferred ptp engine"
depends on DEVELOPER
config PPSI config PPSI
boolean "ppsi" boolean
help
Select this option for the ppsi engine
config PTP_NOPOSIX
boolean "ptp-noposix"
help help
Select this option for the ptp-noposix engine Select this option for the ppsi engine (now only option)
endchoice
config DETERMINISTIC_BINARY config DETERMINISTIC_BINARY
depends on DEVELOPER depends on DEVELOPER
......
...@@ -13,7 +13,6 @@ SIZE = $(CROSS_COMPILE)size ...@@ -13,7 +13,6 @@ SIZE = $(CROSS_COMPILE)size
AUTOCONF = $(CURDIR)/include/generated/autoconf.h AUTOCONF = $(CURDIR)/include/generated/autoconf.h
PTP_NOPOSIX = ptp-noposix
PPSI = ppsi PPSI = ppsi
# we miss CONFIG_ARCH_LM32 as we have no other archs by now # we miss CONFIG_ARCH_LM32 as we have no other archs by now
...@@ -34,35 +33,6 @@ cflags-y = -ffreestanding -include $(AUTOCONF) -Iinclude/std -Iinclude \ ...@@ -34,35 +33,6 @@ cflags-y = -ffreestanding -include $(AUTOCONF) -Iinclude/std -Iinclude \
-I. -Isoftpll -Iipc -I. -Isoftpll -Iipc
cflags-y += -I$(CURDIR)/pp_printf cflags-y += -I$(CURDIR)/pp_printf
cflags-$(CONFIG_PTP_NOPOSIX) += \
-DPTPD_FREESTANDING \
-DWRPC_EXTRA_SLIM \
-DPTPD_MSBF \
-DPTPD_DBG \
-DPTPD_NO_DAEMON \
-DNEW_SINGLE_WRFSM \
-DPTPD_TRACE_MASK=0 \
-include $(PTP_NOPOSIX)/compat.h \
-include $(PTP_NOPOSIX)/PTPWRd/dep/trace.h \
-include $(PTP_NOPOSIX)/libposix/ptpd-wrappers.h \
-I$(PTP_NOPOSIX)/libptpnetif \
-I$(PTP_NOPOSIX)/PTPWRd
obj-$(CONFIG_PTP_NOPOSIX) += wrc_ptp_noposix.o \
monitor/monitor.o \
lib/ptp-noposix-wrappers.o \
$(PTP_NOPOSIX)/PTPWRd/arith.o \
$(PTP_NOPOSIX)/PTPWRd/bmc.o \
$(PTP_NOPOSIX)/PTPWRd/dep/msg.o \
$(PTP_NOPOSIX)/PTPWRd/dep/net.o \
$(PTP_NOPOSIX)/PTPWRd/dep/sys.o \
$(PTP_NOPOSIX)/PTPWRd/dep/timer.o \
$(PTP_NOPOSIX)/PTPWRd/dep/wr_servo.o \
$(PTP_NOPOSIX)/PTPWRd/dep/servo.o \
$(PTP_NOPOSIX)/PTPWRd/protocol.o \
$(PTP_NOPOSIX)/PTPWRd/wr_protocol.o \
$(PTP_NOPOSIX)/libposix/freestanding-startup.o
cflags-$(CONFIG_PPSI) += \ cflags-$(CONFIG_PPSI) += \
-ffreestanding \ -ffreestanding \
-include include/ppsi-wrappers.h \ -include include/ppsi-wrappers.h \
...@@ -179,8 +149,7 @@ tools: ...@@ -179,8 +149,7 @@ tools:
# if needed, check out the submodules (first time only), so users # if needed, check out the submodules (first time only), so users
# who didn't read carefully the manual won't get confused # who didn't read carefully the manual won't get confused
gitmodules: gitmodules:
@test -d ptp-noposix/libposix || echo "Checking out submodules" @test -d ppsi/arch-wrpc || echo "Checking out submodules"
@test -d ptp-noposix/libposix || git submodule update --init
@test -d ppsi/arch-wrpc || git submodule update --init @test -d ppsi/arch-wrpc || git submodule update --init
......
...@@ -66,5 +66,5 @@ SECTIONS ...@@ -66,5 +66,5 @@ SECTIONS
PROVIDE(_fstack = ORIGIN(stack) + LENGTH(stack) - 4); PROVIDE(_fstack = ORIGIN(stack) + LENGTH(stack) - 4);
} }
/* We need to provide mprintf to ptp-noposix object files, if missing */ /* We need to provide mprintf to developers with old habits, if missing */
PROVIDE(mprintf = pp_printf); PROVIDE(mprintf = pp_printf);
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
extern void __you_should_not_call_printf_from_wrpc_sw(void); extern void __you_should_not_call_printf_from_wrpc_sw(void);
extern void __you_should_not_divide_ll_in_wrpc_sw(void); extern void __you_should_not_divide_ll_in_wrpc_sw(void);
#undef printf /* Under ptp-noposix, this is #defined to mprintf */
int printf(const char *fmt, ...) int printf(const char *fmt, ...)
{ {
__you_should_not_call_printf_from_wrpc_sw(); __you_should_not_call_printf_from_wrpc_sw();
......
#
# Automatically generated make config: don't edit
#
# CONFIG_WR_SWITCH is not set
CONFIG_WR_NODE=y
CONFIG_PRINT_BUFSIZE=128
CONFIG_PRINTF_XINT=y
CONFIG_RAMSIZE=90112
CONFIG_STACKSIZE=2048
# CONFIG_PPSI is not set
CONFIG_UART=y
CONFIG_W1=y
# CONFIG_ETHERBONE is not set
# CONFIG_CMD_CONFIG is not set
#
# wrpc-sw is tainted if you change the following options
#
CONFIG_DEVELOPER=y
# CONFIG_CHECK_RESET is not set
# CONFIG_PRINTF_FULL is not set
# CONFIG_PRINTF_MINI is not set
# CONFIG_PRINTF_NONE is not set
CONFIG_PTP_NOPOSIX=y
# CONFIG_DETERMINISTIC_BINARY is not set
# CONFIG_UART_SW is not set
# CONFIG_SDB_EEPROM is not set
CONFIG_LEGACY_EEPROM=y
/* /*
* This includes stuff that is needed to link ppsi into wrpc-sw * This includes stuff that is needed to link ppsi into wrpc-sw
* *
* It is included by the command line (-include) like ptp-noposix's * It is included by the command line (-include).
* ptpd-wrappers.h is. It is a subset of that file, with only needed stuff * It is a subset of the older "ptpd-wrappers.h", in ptp-noposix
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
......
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2011,2012 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <stdio.h>
#include <time.h>
#include <wrc.h>
#include <w1.h>
#include "board.h"
#include "ptpd_exports.h"
#include "hal_exports.h"
#include "softpll_ng.h"
#include "minic.h"
#include "pps_gen.h"
#include "util.h"
#include "syscon.h"
#include "onewire.h"
#include "lib/ipv4.h"
#define PRINT64_FACTOR 1000000000
char* print64(unsigned long long x)
{
uint32_t h_half, l_half;
static char buf[2*10+1]; //2x 32-bit value + \0
if (x < PRINT64_FACTOR)
sprintf(buf, "%u", (uint32_t)x);
else{
h_half = (uint32_t)(x/PRINT64_FACTOR);
l_half = (uint32_t)(x-h_half*PRINT64_FACTOR);
sprintf(buf, "%u%u", h_half, l_half);
}
return buf;
}
extern ptpdexp_sync_state_t cur_servo_state;
extern int wrc_man_phase;
void wrc_mon_gui(void)
{
static uint32_t last;
hexp_port_state_t ps;
int tx, rx;
uint64_t sec;
uint32_t nsec;
#ifdef CONFIG_ETHERBONE
uint8_t ip[4];
#endif
if (!last)
last = timer_get_tics();
if (time_before(timer_get_tics(), last + wrc_ui_refperiod))
return;
last = timer_get_tics();
term_clear();
pcprintf(1, 1, C_BLUE, "WR PTP Core Sync Monitor v 1.0");
pcprintf(2, 1, C_GREY, "Esc = exit");
shw_pps_gen_get_time(&sec, &nsec);
cprintf(C_BLUE, "\n\nTAI Time: ");
cprintf(C_WHITE, "%s", format_time(sec));
/*show_ports */
halexp_get_port_state(&ps, NULL);
pcprintf(4, 1, C_BLUE, "\n\nLink status:");
pcprintf(6, 1, C_WHITE, "%s: ", "wru1");
if (ps.up)
cprintf(C_GREEN, "Link up ");
else
cprintf(C_RED, "Link down ");
if (ps.up) {
minic_get_stats(&tx, &rx);
cprintf(C_GREY, "(RX: %d, TX: %d), mode: ", rx, tx);
switch (ps.mode) {
case HEXP_PORT_MODE_WR_MASTER:
cprintf(C_WHITE, "WR Master ");
break;
case HEXP_PORT_MODE_WR_SLAVE:
cprintf(C_WHITE, "WR Slave ");
break;
}
if (ps.is_locked)
cprintf(C_GREEN, "Locked ");
else
cprintf(C_RED, "NoLock ");
if (ps.rx_calibrated && ps.tx_calibrated)
cprintf(C_GREEN, "Calibrated ");
else
cprintf(C_RED, "Uncalibrated ");
#ifdef CONFIG_ETHERBONE
cprintf(C_WHITE, "\nIPv4: ");
getIP(ip);
if (needIP)
cprintf(C_RED, "BOOTP running");
else
cprintf(C_GREEN, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
#endif
/* show_servo */
cprintf(C_BLUE, "\n\nSynchronization status:\n\n");
if (!cur_servo_state.valid) {
cprintf(C_RED,
"Master mode or sync info not valid\n\n");
return;
}
cprintf(C_GREY, "Servo state: ");
cprintf(C_WHITE, "%s\n", cur_servo_state.slave_servo_state);
cprintf(C_GREY, "Phase tracking: ");
if (cur_servo_state.tracking_enabled)
cprintf(C_GREEN, "ON\n");
else
cprintf(C_RED, "OFF\n");
cprintf(C_GREY, "Synchronization source: ");
cprintf(C_WHITE, "%s\n", cur_servo_state.sync_source);
cprintf(C_GREY, "Aux clock status: ");
int n_ref, n_out, i;
spll_get_num_channels(&n_ref, &n_out);
for(i = 0; i<n_out - 1; i++)
{
const char *aux_stat = spll_get_aux_status_string(i);
cprintf(C_GREY,"%d:", i);
cprintf(C_GREEN,"%s ", aux_stat);
}
mprintf("\n");
cprintf(C_BLUE, "\nTiming parameters:\n\n");
cprintf(C_GREY, "Round-trip time (mu): ");
cprintf(C_WHITE, "%s ps\n", print64(cur_servo_state.mu));
cprintf(C_GREY, "Master-slave delay: ");
cprintf(C_WHITE, "%s ps\n", print64(cur_servo_state.delay_ms));
cprintf(C_GREY, "Master PHY delays: ");
cprintf(C_WHITE, "TX: %d ps, RX: %d ps\n",
(int32_t) cur_servo_state.delta_tx_m,
(int32_t) cur_servo_state.delta_rx_m);
cprintf(C_GREY, "Slave PHY delays: ");
cprintf(C_WHITE, "TX: %d ps, RX: %d ps\n",
(int32_t) cur_servo_state.delta_tx_s,
(int32_t) cur_servo_state.delta_rx_s);
cprintf(C_GREY, "Total link asymmetry: ");
cprintf(C_WHITE, "%9d ps\n",
(int32_t) (cur_servo_state.total_asymmetry));
cprintf(C_GREY, "Cable rtt delay: ");
cprintf(C_WHITE, "%9s ps\n", print64(cur_servo_state.mu -
cur_servo_state.delta_tx_m -
cur_servo_state.delta_rx_m -
cur_servo_state.delta_tx_s -
cur_servo_state.delta_rx_s));
cprintf(C_GREY, "Clock offset: ");
cprintf(C_WHITE, "%9d ps\n",
(int32_t) (cur_servo_state.cur_offset));
cprintf(C_GREY, "Phase setpoint: ");
cprintf(C_WHITE, "%9d ps\n",
(int32_t) (cur_servo_state.cur_setpoint));
cprintf(C_GREY, "Skew: ");
cprintf(C_WHITE, "%9d ps\n",
(int32_t) (cur_servo_state.cur_skew));
cprintf(C_GREY, "Manual phase adjustment: ");
cprintf(C_WHITE, "%9d ps\n", (int32_t) (wrc_man_phase));
cprintf(C_GREY, "Update counter: ");
cprintf(C_WHITE, "%9d \n",
(int32_t) (cur_servo_state.update_count));
}
cprintf(C_GREY, "--");
return;
}
int wrc_log_stats(uint8_t onetime)
{
static uint32_t last;
hexp_port_state_t ps;
int tx, rx;
int aux_stat;
uint64_t sec;
uint32_t nsec;
if (!last)
last = timer_get_tics();
if (!onetime && time_before(timer_get_tics(), last + wrc_ui_refperiod))
return 0;
last = timer_get_tics();
shw_pps_gen_get_time(&sec, &nsec);
halexp_get_port_state(&ps, NULL);
minic_get_stats(&tx, &rx);
mprintf("lnk:%d rx:%d tx:%d ", ps.up, rx, tx);
mprintf("lock:%d ", ps.is_locked ? 1 : 0);
mprintf("sv:%d ", cur_servo_state.valid ? 1 : 0);
mprintf("ss:'%s' ", cur_servo_state.slave_servo_state);
aux_stat = spll_get_aux_status(0);
mprintf("aux:%x ", aux_stat);
mprintf("sec:%d nsec:%d ", (uint32_t) sec, nsec); /* fixme: clock is not always 125 MHz */
mprintf("mu:%s ", print64(cur_servo_state.mu));
mprintf("dms:%s ", print64(cur_servo_state.delay_ms));
mprintf("dtxm:%d drxm:%d ", (int32_t) cur_servo_state.delta_tx_m,
(int32_t) cur_servo_state.delta_rx_m);
mprintf("dtxs:%d drxs:%d ", (int32_t) cur_servo_state.delta_tx_s,
(int32_t) cur_servo_state.delta_rx_s);
mprintf("asym:%d ", (int32_t) (cur_servo_state.total_asymmetry));
mprintf("crtt:%s ", print64(cur_servo_state.mu -
cur_servo_state.delta_tx_m -
cur_servo_state.delta_rx_m -
cur_servo_state.delta_tx_s -
cur_servo_state.delta_rx_s));
mprintf("cko:%d ", (int32_t) (cur_servo_state.cur_offset));
mprintf("setp:%d ", (int32_t) (cur_servo_state.cur_setpoint));
mprintf("hd:%d md:%d ad:%d ", spll_get_dac(-1), spll_get_dac(0),
spll_get_dac(1));
mprintf("ucnt:%d ", (int32_t) cur_servo_state.update_count);
if (1) {
int32_t temp;
//first read the value from previous measurement,
//first one will be random, I know
temp = w1_read_temp_bus(&wrpc_w1_bus, W1_FLAG_COLLECT);
//then initiate new conversion for next loop cycle
w1_read_temp_bus(&wrpc_w1_bus, W1_FLAG_NOWAIT);
mprintf("temp: %d.%04d C", temp >> 16,
(int)((temp & 0xffff) * 10 * 1000 >> 16));
}
mprintf("\n");
return 0;
}
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