Commit ce18c9e9 authored by Alessandro Rubini's avatar Alessandro Rubini

Merge branch 'host-again'

parents 4cb4375c 5e871eaf
...@@ -63,6 +63,8 @@ obj-$(CONFIG_EMBEDDED_NODE) += \ ...@@ -63,6 +63,8 @@ obj-$(CONFIG_EMBEDDED_NODE) += \
cflags-$(CONFIG_LM32) += -mmultiply-enabled -mbarrel-shift-enabled cflags-$(CONFIG_LM32) += -mmultiply-enabled -mbarrel-shift-enabled
ldflags-$(CONFIG_LM32) = -mmultiply-enabled -mbarrel-shift-enabled \ ldflags-$(CONFIG_LM32) = -mmultiply-enabled -mbarrel-shift-enabled \
-nostdlib -T $(LDS-y) -nostdlib -T $(LDS-y)
arch-files-$(CONFIG_LM32) = $(OUTPUT).ram $(OUTPUT).vhd $(OUTPUT).mif
# packet-filter rules: for CONFIG_VLAN we use both sets # packet-filter rules: for CONFIG_VLAN we use both sets
pfilter-y := rules-novlan.bin pfilter-y := rules-novlan.bin
...@@ -109,7 +111,7 @@ OUTPUT := $(OUTPUT-y) ...@@ -109,7 +111,7 @@ OUTPUT := $(OUTPUT-y)
GIT_VER = $(shell git describe --always --dirty | sed 's;^wr-switch-sw-;;') GIT_VER = $(shell git describe --always --dirty | sed 's;^wr-switch-sw-;;')
all: tools $(OUTPUT).ram $(OUTPUT).vhd $(OUTPUT).mif all: tools $(OUTPUT).elf $(arch-files-y)
.PRECIOUS: %.elf %.bin .PRECIOUS: %.elf %.bin
.PHONY: all tools clean gitmodules $(PPSI)/ppsi.o .PHONY: all tools clean gitmodules $(PPSI)/ppsi.o
......
...@@ -6,5 +6,6 @@ obj-$(CONFIG_HOST_PROCESS) += \ ...@@ -6,5 +6,6 @@ obj-$(CONFIG_HOST_PROCESS) += \
host/fake-flash.o \ host/fake-flash.o \
host/fake-hw.o \ host/fake-hw.o \
host/ptp.o \ host/ptp.o \
host/spll.o \
host/socket.o host/socket.o
...@@ -140,9 +140,12 @@ int minic_rx_frame(struct wr_ethhdr *hdr, uint8_t * payload, uint32_t buf_size, ...@@ -140,9 +140,12 @@ int minic_rx_frame(struct wr_ethhdr *hdr, uint8_t * payload, uint32_t buf_size,
struct hw_timestamp *hwts) struct hw_timestamp *hwts)
{ {
unsigned char frame[1500]; unsigned char frame[1500];
struct timespec ts;
int ret; int ret;
ret = recv(sock, frame, sizeof(frame), MSG_DONTWAIT); ret = recv(sock, frame, sizeof(frame), MSG_DONTWAIT);
clock_gettime(CLOCK_REALTIME, &ts);
if (ret < 0 && errno == EAGAIN) if (ret < 0 && errno == EAGAIN)
return 0; return 0;
if (ret < 0) { if (ret < 0) {
...@@ -158,6 +161,11 @@ int minic_rx_frame(struct wr_ethhdr *hdr, uint8_t * payload, uint32_t buf_size, ...@@ -158,6 +161,11 @@ int minic_rx_frame(struct wr_ethhdr *hdr, uint8_t * payload, uint32_t buf_size,
ret = buf_size; ret = buf_size;
} }
memcpy(payload, frame + 14, ret); memcpy(payload, frame + 14, ret);
hwts->sec = ts.tv_sec;
hwts->nsec = ts.tv_nsec;
hwts->phase = 0;
net_verbose("%s: %9li.%09i.%03i\n", __func__, (long)hwts->sec,
hwts->nsec, hwts->phase);
return ret; return ret;
} }
...@@ -165,14 +173,28 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t * payload, uint32_t size, ...@@ -165,14 +173,28 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t * payload, uint32_t size,
struct hw_timestamp *hwts) struct hw_timestamp *hwts)
{ {
unsigned char frame[1500]; unsigned char frame[1500];
struct timespec ts;
int hsize, len;
if (hdr->ethtype == htons(0x8100))
hsize = sizeof(struct wr_ethhdr_vlan);
else
hsize = sizeof(struct wr_ethhdr);
printf("%s\n", __func__); printf("%s\n", __func__);
dumpstruct(stdout, "tx header", hdr, 14); dumpstruct(stdout, "tx header", hdr, hsize);
dumpstruct(stdout, "tx payload", payload, size); dumpstruct(stdout, "tx payload", payload, size);
memcpy(frame, hdr, 14); memcpy(frame, hdr, hsize);
memcpy(frame + 14, payload, size); memcpy(frame + hsize, payload, size);
return send(sock, frame, size + 14, 0); clock_gettime(CLOCK_REALTIME, &ts);
len = send(sock, frame, size + hsize, 0);
hwts->sec = ts.tv_sec;
hwts->nsec = ts.tv_nsec;
hwts->phase = 0;
net_verbose("%s: %9li.%09i.%03i\n", __func__, (long)hwts->sec,
hwts->nsec, hwts->phase);
return len;
} }
......
#include "softpll_ng.h"
void spll_very_init(void)
{}
void spll_init(int mode, int ref_channel, int align_pps)
{}
void spll_enable_ptracker(int ref_channel, int enable)
{}
void spll_set_phase_shift(int out_channel, int32_t value_picoseconds)
{}
int spll_shifter_busy(int out_channel)
{ return 1; }
int spll_check_lock(int out_channel)
{ return 0; }
int spll_update(void)
{ return 0; }
int spll_read_ptracker(int ref_channel, int32_t *phase_ps, int *enabled)
{ return 0; }
obj-y += \ obj-$(CONFIG_LM32) += \
softpll/spll_common.o \ softpll/spll_common.o \
softpll/spll_external.o \ softpll/spll_external.o \
softpll/spll_helper.o \ softpll/spll_helper.o \
......
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