Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
ce18c9e9
Commit
ce18c9e9
authored
May 18, 2016
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'host-again'
parents
4cb4375c
5e871eaf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
6 deletions
+56
-6
Makefile
Makefile
+3
-1
host.mk
host/host.mk
+1
-0
socket.c
host/socket.c
+26
-4
spll.c
host/spll.c
+25
-0
softpll.mk
softpll/softpll.mk
+1
-1
No files found.
Makefile
View file @
ce18c9e9
...
@@ -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
...
...
host/host.mk
View file @
ce18c9e9
...
@@ -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
host/socket.c
View file @
ce18c9e9
...
@@ -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
;
}
}
...
...
host/spll.c
0 → 100644
View file @
ce18c9e9
#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
;
}
softpll/softpll.mk
View file @
ce18c9e9
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 \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment