Commit 7a4696c3 authored by Alessandro Rubini's avatar Alessandro Rubini

massive: rename arch-spec to arch-wrpc

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 07ea72f7
......@@ -23,7 +23,7 @@ build_diags () {
build_ext () {
unset PROTO_EXT
build_diags
if [ "$ARCH" = "spec" ]; then
if [ "$ARCH" = "wrpc" ]; then
export PROTO_EXT=whiterabbit
build_diags
fi
......@@ -37,24 +37,24 @@ done
PREFIX_gnu_linux=""
PREFIX_bare_i386=""
PREFIX_bare_x86_64=""
PREFIX_spec="/opt/gcc-lm32/bin/lm32-elf-"
PREFIX_wrpc="/opt/gcc-lm32/bin/lm32-elf-"
CC_gnu_linux="gcc"
CC_bare_i386="gcc -m32"
CC_bare_x86_64="gcc -m64"
CC_spec="${PREFIX_spec}gcc"
CC_wrpc="${PREFIX_wrpc}gcc"
LD_gnu_linux="ld"
LD_bare_i386="ld -m elf_i386"
LD_bare_x86_64="ld -m elf_x86_64"
LD_spec="${PREFIX_spec}ld"
LD_wrpc="${PREFIX_wrpc}ld"
# Defaults, overridden by command line, later
SHOW_UNDEF=false
ARCHS="gnu-linux bare-i386 bare-x86-64"
if [ "x${WRPCSW_ROOT}" != "x" ]; then
ARCHS="$ARCHS spec"
ARCHS="$ARCHS wrpc"
fi
# Parse command line, so we can limit the archs we build for
......@@ -66,7 +66,7 @@ while [ $# -gt 0 ]; do
ARCHS="$1";;
bare-x86-64)
ARCHS="$1";;
spec)
wrpc)
ARCHS="$1";;
bare)
ARCHS="bare-i386 bare-x86-64";;
......
......@@ -27,11 +27,11 @@ LIBARCH := $A/libarch.a
LIBS += -L$A -larch
OBJ-libarch := $A/spec-socket.o \
$A/spec-io.o \
$A/spec-timer.o \
$A/spec-spll.o \
$A/spec-calibration.o \
OBJ-libarch := $A/wrpc-socket.o \
$A/wrpc-io.o \
$A/wrpc-timer.o \
$A/wrpc-spll.o \
$A/wrpc-calibration.o \
lib/div64.o
$(LIBARCH): $(OBJ-libarch)
......@@ -43,9 +43,9 @@ ppsi-bin: $(TARGET) $(TARGET).bin
# to build the target, we need -lstd again, in case we call functions that
# were not selected yet (e.g., pp_open_instance() ).
$(TARGET): $(TARGET).o $A/crt0.o $(LIBARCH) $A/main-loop.o $A/spec-startup.o
$(TARGET): $(TARGET).o $A/crt0.o $(LIBARCH) $A/main-loop.o $A/wrpc-startup.o
$(CC) -Wl,-Map,$(TARGET).map2 $(ARCH_LDFLAGS) -o $@ $A/crt0.o \
$(TARGET).o $(specdev-objects) $A/main-loop.o $A/spec-startup.o \
$(TARGET).o $(specdev-objects) $A/main-loop.o $A/wrpc-startup.o \
-L$A -larch $(LIBS)
$(TARGET).bin: $(TARGET)
......
......@@ -5,10 +5,10 @@
#include <endpoint.h>
#include <ppsi/ppsi.h>
#include <softpll_ng.h>
#include "spec.h"
#include "wrpc.h"
#include "../proto-ext-whiterabbit/wr-constants.h"
static int spec_read_calibration_data(struct pp_instance *ppi,
static int wrpc_read_calibration_data(struct pp_instance *ppi,
uint32_t *deltaTx, uint32_t *deltaRx, int32_t *fix_alpha,
int32_t *clock_period)
{
......@@ -52,22 +52,22 @@ static int spec_read_calibration_data(struct pp_instance *ppi,
/* Begin of exported functions */
int spec_calibrating_disable(struct pp_instance *ppi, int txrx)
int wrpc_calibrating_disable(struct pp_instance *ppi, int txrx)
{
return WR_HW_CALIB_OK;
}
int spec_calibrating_enable(struct pp_instance *ppi, int txrx)
int wrpc_calibrating_enable(struct pp_instance *ppi, int txrx)
{
return WR_HW_CALIB_OK;
}
int spec_calibrating_poll(struct pp_instance *ppi, int txrx, uint32_t *delta)
int wrpc_calibrating_poll(struct pp_instance *ppi, int txrx, uint32_t *delta)
{
uint32_t delta_rx = 0, delta_tx = 0;
/* FIXME: why delta was 64bit whereas ep_get_deltas accepts 32bit? */
spec_read_calibration_data(ppi, &delta_tx, &delta_rx, NULL, NULL);
wrpc_read_calibration_data(ppi, &delta_tx, &delta_rx, NULL, NULL);
if (txrx == WR_HW_CALIB_TX)
*delta = delta_tx;
......@@ -77,7 +77,7 @@ int spec_calibrating_poll(struct pp_instance *ppi, int txrx, uint32_t *delta)
return WR_HW_CALIB_READY;
}
int spec_calibration_pattern_enable(struct pp_instance *ppi,
int wrpc_calibration_pattern_enable(struct pp_instance *ppi,
unsigned int calibrationPeriod,
unsigned int calibrationPattern,
unsigned int calibrationPatternLen)
......@@ -86,30 +86,30 @@ int spec_calibration_pattern_enable(struct pp_instance *ppi,
return WR_HW_CALIB_OK;
}
int spec_calibration_pattern_disable(struct pp_instance *ppi)
int wrpc_calibration_pattern_disable(struct pp_instance *ppi)
{
ep_cal_pattern_disable();
return WR_HW_CALIB_OK;
}
int wr_calibrating_disable(struct pp_instance *ppi, int txrx)
__attribute__((alias("spec_calibrating_disable")));
__attribute__((alias("wrpc_calibrating_disable")));
int wr_calibrating_enable(struct pp_instance *ppi, int txrx)
__attribute__((alias("spec_calibrating_enable")));
__attribute__((alias("wrpc_calibrating_enable")));
int wr_calibrating_poll(struct pp_instance *ppi, int txrx, uint32_t *delta)
__attribute__((alias("spec_calibrating_poll")));
__attribute__((alias("wrpc_calibrating_poll")));
int wr_calibration_pattern_enable(struct pp_instance *ppi,
unsigned int calibrationPeriod, unsigned int calibrationPattern,
unsigned int calibrationPatternLen)
__attribute__((alias("spec_calibration_pattern_enable")));
__attribute__((alias("wrpc_calibration_pattern_enable")));
int wr_calibration_pattern_disable(struct pp_instance *ppi)
__attribute__((alias("spec_calibration_pattern_disable")));
__attribute__((alias("wrpc_calibration_pattern_disable")));
int wr_read_calibration_data(struct pp_instance *ppi,
uint32_t *deltaTx, uint32_t *deltaRx, int32_t *fix_alpha,
int32_t *clock_period)
__attribute__((alias("spec_read_calibration_data")));
__attribute__((alias("wrpc_read_calibration_data")));
......@@ -4,7 +4,7 @@
#include <ppsi/ppsi.h>
#include <uart.h>
#include <pps_gen.h>
#include "spec.h"
#include "wrpc.h"
void pp_puts(const char *s)
{
......@@ -20,14 +20,14 @@ void pp_get_tstamp(TimeInternal *t) //uint32_t *sptr)
t->nanoseconds = (int32_t)nsec;
}
int32_t spec_set_tstamp(TimeInternal *t)
int32_t wrpc_set_tstamp(TimeInternal *t)
{
shw_pps_gen_set_time(t->seconds, t->nanoseconds);
return 0; /* SPEC uses a sort of monotonic tstamp for timers */
}
int spec_adj_freq(Integer32 adj)
int wrpc_adj_freq(Integer32 adj)
{
/* FIXME: this adjusts nanoseconds, not frequency */
shw_pps_gen_adjust(PPSG_ADJUST_NSEC, adj);
......@@ -35,7 +35,7 @@ int spec_adj_freq(Integer32 adj)
}
int pp_adj_freq(Integer32 adj)
__attribute__((alias("spec_adj_freq")));
__attribute__((alias("wrpc_adj_freq")));
int32_t pp_set_tstamp(TimeInternal *t)
__attribute__((alias("spec_set_tstamp")));
__attribute__((alias("wrpc_set_tstamp")));
......@@ -2,7 +2,7 @@
* Alessandro Rubini for CERN, 2011 -- GNU LGPL v2.1 or later
*/
#include <ppsi/ppsi.h>
#include "spec.h"
#include "wrpc.h"
#include <syscon.h>
#include <pps_gen.h>
#include <minic.h>
......@@ -11,11 +11,11 @@
#include <softpll_ng.h>
#include <ptpd_netif.h>
int spec_errno;
int wrpc_errno;
Octet buffer_out[PP_PACKET_SIZE + 14]; // 14 is ppi->proto_ofst for ethernet mode
/* This function should init the minic and get the mac address */
int spec_open_ch(struct pp_instance *ppi)
int wrpc_open_ch(struct pp_instance *ppi)
{
wr_socket_t *sock;
mac_addr_t mac;
......@@ -39,7 +39,7 @@ int spec_open_ch(struct pp_instance *ppi)
}
/* To receive and send packets, we call the minic low-level stuff */
int spec_recv_packet(struct pp_instance *ppi, void *pkt, int len,
int wrpc_recv_packet(struct pp_instance *ppi, void *pkt, int len,
TimeInternal *t)
{
int got;
......@@ -63,7 +63,7 @@ int spec_recv_packet(struct pp_instance *ppi, void *pkt, int len,
return got;
}
int spec_send_packet(struct pp_instance *ppi, void *pkt, int len,
int wrpc_send_packet(struct pp_instance *ppi, void *pkt, int len,
TimeInternal *t, int chtype, int use_pdelay_addr)
{
int snt;
......@@ -101,19 +101,19 @@ int spec_send_packet(struct pp_instance *ppi, void *pkt, int len,
return snt;
}
int spec_net_init(struct pp_instance *ppi)
int wrpc_net_init(struct pp_instance *ppi)
{
ppi->buf_out = buffer_out;
ppi->buf_out = PROTO_PAYLOAD(ppi->buf_out);
ppi->buf_out+= 4 - (((int)ppi->buf_out) % 4); /* FIXME Alignment */
spec_open_ch(ppi);
wrpc_open_ch(ppi);
return 0;
}
int spec_net_shutdown(struct pp_instance *ppi)
int wrpc_net_shutdown(struct pp_instance *ppi)
{
ptpd_netif_close_socket(
(wr_socket_t *)NP(ppi)->ch[PP_NP_EVT].custom);
......@@ -121,11 +121,11 @@ int spec_net_shutdown(struct pp_instance *ppi)
}
int pp_net_init(struct pp_instance *ppi)
__attribute__((alias("spec_net_init")));
__attribute__((alias("wrpc_net_init")));
int pp_net_shutdown(struct pp_instance *ppi)
__attribute__((alias("spec_net_shutdown")));
__attribute__((alias("wrpc_net_shutdown")));
int pp_recv_packet(struct pp_instance *ppi, void *pkt, int len, TimeInternal *t)
__attribute__((alias("spec_recv_packet")));
__attribute__((alias("wrpc_recv_packet")));
int pp_send_packet(struct pp_instance *ppi, void *pkt, int len, TimeInternal *t,
int chtype, int use_pdelay_addr)
__attribute__((alias("spec_send_packet")));
__attribute__((alias("wrpc_send_packet")));
......@@ -8,42 +8,42 @@
#include <softpll_ng.h>
#include "../proto-ext-whiterabbit/wr-constants.h"
int spec_spll_locking_enable(struct pp_instance *ppi)
int wrpc_spll_locking_enable(struct pp_instance *ppi)
{
spll_init(SPLL_MODE_SLAVE, 0, 1);
spll_enable_ptracker(0, 1);
return WR_SPLL_OK;
}
int spec_spll_locking_poll(struct pp_instance *ppi)
int wrpc_spll_locking_poll(struct pp_instance *ppi)
{
return spll_check_lock(0) ? WR_SPLL_READY : WR_SPLL_ERROR;
}
int spec_spll_locking_disable(struct pp_instance *ppi)
int wrpc_spll_locking_disable(struct pp_instance *ppi)
{
/* softpll_disable(); */
return WR_SPLL_OK;
}
int spec_spll_enable_ptracker(struct pp_instance *ppi)
int wrpc_spll_enable_ptracker(struct pp_instance *ppi)
{
spll_enable_ptracker(0, 1);
return WR_SPLL_OK;
}
int spec_enable_timing_output(struct pp_instance *ppi, int enable)
int wrpc_enable_timing_output(struct pp_instance *ppi, int enable)
{
shw_pps_gen_enable_output(enable);
return WR_SPLL_OK;
}
int spec_adjust_in_progress()
int wrpc_adjust_in_progress()
{
return shw_pps_gen_busy() || spll_shifter_busy(0);
}
int spec_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
int wrpc_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
{
if(adjust_sec)
shw_pps_gen_adjust(PPSG_ADJUST_SEC, adjust_sec);
......@@ -52,32 +52,32 @@ int spec_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
return 0;
}
int spec_adjust_phase(int32_t phase_ps)
int wrpc_adjust_phase(int32_t phase_ps)
{
spll_set_phase_shift(SPLL_ALL_CHANNELS, phase_ps);
return WR_SPLL_OK;
}
int wr_locking_enable(struct pp_instance *ppi)
__attribute__((alias("spec_spll_locking_enable")));
__attribute__((alias("wrpc_spll_locking_enable")));
int wr_locking_poll(struct pp_instance *ppi)
__attribute__((alias("spec_spll_locking_poll")));
__attribute__((alias("wrpc_spll_locking_poll")));
int wr_locking_disable(struct pp_instance *ppi)
__attribute__((alias("spec_spll_locking_disable")));
__attribute__((alias("wrpc_spll_locking_disable")));
int wr_enable_ptracker(struct pp_instance *ppi)
__attribute__((alias("spec_spll_enable_ptracker")));
__attribute__((alias("wrpc_spll_enable_ptracker")));
int wr_enable_timing_output(struct pp_instance *ppi, int enable)
__attribute__((alias("spec_enable_timing_output")));
__attribute__((alias("wrpc_enable_timing_output")));
int wr_adjust_in_progress()
__attribute__((alias("spec_adjust_in_progress")));
__attribute__((alias("wrpc_adjust_in_progress")));
int wr_adjust_counters(int64_t adjust_sec, int32_t adjust_nsec)
__attribute__((alias("spec_adjust_counters")));
__attribute__((alias("wrpc_adjust_counters")));
int wr_adjust_phase(int32_t phase_ps)
__attribute__((alias("spec_adjust_phase")));
__attribute__((alias("wrpc_adjust_phase")));
......@@ -4,26 +4,26 @@
#include <syscon.h>
#include <ptpd_netif.h>
static struct pp_timer spec_timers[PP_TIMER_ARRAY_SIZE];
static struct pp_timer wrpc_timers[PP_TIMER_ARRAY_SIZE];
int spec_timer_init(struct pp_instance *ppi)
int wrpc_timer_init(struct pp_instance *ppi)
{
uint32_t i;
for(i =0; i<PP_TIMER_ARRAY_SIZE; i++)
ppi->timers[i] = &spec_timers[i];
ppi->timers[i] = &wrpc_timers[i];
return 0;
}
int spec_timer_start(uint32_t interval_ms, struct pp_timer *tm)
int wrpc_timer_start(uint32_t interval_ms, struct pp_timer *tm)
{
tm->start = ptpd_netif_get_msec_tics();
tm->interval_ms = interval_ms;
return 0;
}
int spec_timer_stop(struct pp_timer *tm)
int wrpc_timer_stop(struct pp_timer *tm)
{
tm->interval_ms = 0;
tm->start = 0;
......@@ -31,7 +31,7 @@ int spec_timer_stop(struct pp_timer *tm)
return 0;
}
int spec_timer_expired(struct pp_timer *tm)
int wrpc_timer_expired(struct pp_timer *tm)
{
uint32_t now;
......@@ -50,32 +50,32 @@ int spec_timer_expired(struct pp_timer *tm)
return 0;
}
void spec_timer_adjust_all(struct pp_instance *ppi, int32_t diff)
void wrpc_timer_adjust_all(struct pp_instance *ppi, int32_t diff)
{
/* No need for timer adjust in SPEC: it uses a sort of monotonic
* tstamp for timers
*/
}
uint32_t spec_timer_get_msec_tics(void)
uint32_t wrpc_timer_get_msec_tics(void)
{
return timer_get_tics();
}
int pp_timer_init(struct pp_instance *ppi)
__attribute__((alias("spec_timer_init")));
__attribute__((alias("wrpc_timer_init")));
int pp_timer_start(uint32_t interval_ms, struct pp_timer *tm)
__attribute__((alias("spec_timer_start")));
__attribute__((alias("wrpc_timer_start")));
int pp_timer_stop(struct pp_timer *tm)
__attribute__((alias("spec_timer_stop")));
__attribute__((alias("wrpc_timer_stop")));
int pp_timer_expired(struct pp_timer *tm)
__attribute__((alias("spec_timer_expired")));
__attribute__((alias("wrpc_timer_expired")));
void pp_timer_adjust_all(struct pp_instance *ppi, int32_t diff)
__attribute__((alias("spec_timer_adjust_all")));
__attribute__((alias("wrpc_timer_adjust_all")));
uint32_t wr_timer_get_msec_tics(void)
__attribute__((alias("spec_timer_get_msec_tics")));
__attribute__((alias("wrpc_timer_get_msec_tics")));
......@@ -2,8 +2,8 @@
* Alessandro Rubini for CERN, 2011 -- GNU LGPL v2.1 or later
* Aurelio Colosimo for CERN, 2012 -- GNU LGPL v2.1 or later
*/
#ifndef __SPEC_H
#define __SPEC_H
#ifndef __WRPC_H
#define __WRPC_H
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
......@@ -11,14 +11,14 @@
/*
* These are the functions provided by the various bare files
*/
extern int spec_open_ch(struct pp_instance *ppi);
extern int wrpc_open_ch(struct pp_instance *ppi);
extern int spec_recv_packet(struct pp_instance *ppi, void *pkt, int len,
extern int wrpc_recv_packet(struct pp_instance *ppi, void *pkt, int len,
TimeInternal *t);
extern int spec_send_packet(struct pp_instance *ppi, void *pkt, int len,
extern int wrpc_send_packet(struct pp_instance *ppi, void *pkt, int len,
TimeInternal *t, int chtype, int use_pdelay_addr);
extern void spec_main_loop(struct pp_instance *ppi);
extern void wrpc_main_loop(struct pp_instance *ppi);
extern void _irq_entry(void); /* unused, to make crt0.S happy */
extern int main(void); /* alias to ppsi_main, so crt0.S is happy */
......@@ -31,7 +31,7 @@ typedef struct {
/* WR-PTP role of the port (Master, Slave, etc.) */
int mode;
/* TX and RX delays (combined, big Deltas from the link model in the spec) */
/* TX and RX delays (combined, big Deltas from the link model in the wrpc) */
uint32_t delta_tx;
uint32_t delta_rx;
......@@ -74,14 +74,14 @@ extern int halexp_get_port_state(hexp_port_state_t *state,
/* End halexp_port_state */
/* syscall-lookalike */
extern int spec_time(void);
extern void spec_udelay(int usecs);
extern int spec_errno;
extern int wrpc_time(void);
extern void wrpc_udelay(int usecs);
extern int wrpc_errno;
/* Dev stuff */
extern void spec_putc(int c);
extern void spec_puts(const char *s);
extern int spec_testc(void);
extern void wrpc_putc(int c);
extern void wrpc_puts(const char *s);
extern int wrpc_testc(void);
static inline void delay(int x)
{
......@@ -90,7 +90,7 @@ static inline void delay(int x)
/* other network stuff, bah.... */
struct spec_ethhdr {
struct wrpc_ethhdr {
unsigned char h_dest[6];
unsigned char h_source[6];
uint16_t h_proto;
......@@ -130,4 +130,4 @@ struct spec_ethhdr {
#define REF_CLOCK_PERIOD_PS 8000
#define REF_CLOCK_FREQ_HZ 125000000
#endif
#endif /* __WRPC_H */
......@@ -33,7 +33,7 @@ __________________________________________________________
| PTP PROTOCOL | NET TRANSPORT PROTOCOL |
| IEEE1588 | WR-EXT | UDP | IEEE802.3 |
| | | | |
spec | X | X | | X |
wrpc | X | X | | X |
gnu-linux | X | | X | X |
__________|____________|_________|________|_______________|
......@@ -53,7 +53,7 @@ the extension:
arch-gnu-linux/ The default for hosted compile
arch-bare-linux/ A freestanding implementation (i386 syscalls)
arch-spec/ For the SPEC card, lm32 processor
arch-wrpc/ For WRPC-SW, lm32 processor
proto-standard/ Standard PTP implementation
proto-ext-whiterabbit/ Additional code for White Rabbit
......
......@@ -75,7 +75,7 @@ int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen);
int wr_link_on(struct pp_instance *ppi, unsigned char *pkt, int plen);
/* White Rabbit hw-dependent functions (they are indeed implemented in
* arch-spec or any other arch- */
* arch-wrpc or any other arch- */
int wr_locking_enable(struct pp_instance *ppi);
int wr_locking_poll(struct pp_instance *ppi);
int wr_locking_disable(struct pp_instance *ppi);
......
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