Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wrpc-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
wr-cores
wrpc-sw
Commits
76a225d3
Commit
76a225d3
authored
11 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Patches
Plain Diff
fix t24p, we used default value and not the one returned from calib procedure
parent
3bc91804
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dev/eeprom.c
+6
-2
6 additions, 2 deletions
dev/eeprom.c
dev/rxts_calibrator.c
+9
-2
9 additions, 2 deletions
dev/rxts_calibrator.c
include/ptpd_netif.h
+1
-0
1 addition, 0 deletions
include/ptpd_netif.h
lib/net.c
+6
-3
6 additions, 3 deletions
lib/net.c
with
22 additions
and
7 deletions
dev/eeprom.c
+
6
−
2
View file @
76a225d3
...
@@ -225,13 +225,17 @@ int8_t eeprom_match_sfp(uint8_t i2cif, uint8_t i2c_addr, struct s_sfpinfo * sfp)
...
@@ -225,13 +225,17 @@ int8_t eeprom_match_sfp(uint8_t i2cif, uint8_t i2c_addr, struct s_sfpinfo * sfp)
int8_t
eeprom_phtrans
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
*
val
,
int8_t
eeprom_phtrans
(
uint8_t
i2cif
,
uint8_t
i2c_addr
,
uint32_t
*
val
,
uint8_t
write
)
uint8_t
write
)
{
{
int8_t
ret
;
if
(
write
)
{
if
(
write
)
{
*
val
|=
(
1
<<
31
);
*
val
|=
(
1
<<
31
);
if
(
eeprom_write
(
i2cif
,
i2c_addr
,
EE_BASE_CAL
,
(
uint8_t
*
)
val
,
if
(
eeprom_write
(
i2cif
,
i2c_addr
,
EE_BASE_CAL
,
(
uint8_t
*
)
val
,
sizeof
(
*
val
))
!=
sizeof
(
*
val
))
sizeof
(
*
val
))
!=
sizeof
(
*
val
))
ret
urn
EE_RET_I2CERR
;
ret
=
EE_RET_I2CERR
;
else
else
return
1
;
ret
=
1
;
*
val
&=
0x7fffffff
;
//return ph_trans value without validity bit
return
ret
;
}
else
{
}
else
{
if
(
eeprom_read
(
i2cif
,
i2c_addr
,
EE_BASE_CAL
,
(
uint8_t
*
)
val
,
if
(
eeprom_read
(
i2cif
,
i2c_addr
,
EE_BASE_CAL
,
(
uint8_t
*
)
val
,
sizeof
(
*
val
))
!=
sizeof
(
*
val
))
sizeof
(
*
val
))
!=
sizeof
(
*
val
))
...
...
This diff is collapsed.
Click to expand it.
dev/rxts_calibrator.c
+
9
−
2
View file @
76a225d3
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include
"softpll_ng.h"
#include
"softpll_ng.h"
#include
"wrc_ptp.h"
#include
"wrc_ptp.h"
#include
"eeprom.h"
#include
"eeprom.h"
#include
"ptpd_netif.h"
/* New calibrator for the transition phase value. A major pain in the ass for
/* New calibrator for the transition phase value. A major pain in the ass for
the folks who frequently rebuild their gatewares. The idea is described
the folks who frequently rebuild their gatewares. The idea is described
...
@@ -235,8 +236,14 @@ static int calib_t24p_master(uint32_t *value)
...
@@ -235,8 +236,14 @@ static int calib_t24p_master(uint32_t *value)
int
calib_t24p
(
int
mode
,
uint32_t
*
value
)
int
calib_t24p
(
int
mode
,
uint32_t
*
value
)
{
{
int
ret
;
if
(
mode
==
WRC_MODE_SLAVE
)
if
(
mode
==
WRC_MODE_SLAVE
)
ret
urn
calib_t24p_slave
(
value
);
ret
=
calib_t24p_slave
(
value
);
else
else
return
calib_t24p_master
(
value
);
ret
=
calib_t24p_master
(
value
);
//update phtrans value in socket struct
ptpd_netif_set_phase_transition
(
*
value
);
return
ret
;
}
}
This diff is collapsed.
Click to expand it.
include/ptpd_netif.h
+
1
−
0
View file @
76a225d3
...
@@ -242,5 +242,6 @@ void ptpd_netif_linearize_rx_timestamp(wr_timestamp_t * ts, int32_t dmtd_phase,
...
@@ -242,5 +242,6 @@ void ptpd_netif_linearize_rx_timestamp(wr_timestamp_t * ts, int32_t dmtd_phase,
int
clock_period
);
int
clock_period
);
int
ptpd_netif_enable_timing_output
(
int
enable
);
int
ptpd_netif_enable_timing_output
(
int
enable
);
int
ptpd_netif_enable_phase_tracking
(
const
char
*
if_name
);
int
ptpd_netif_enable_phase_tracking
(
const
char
*
if_name
);
void
ptpd_netif_set_phase_transition
(
uint32_t
phase
);
#endif
#endif
This diff is collapsed.
Click to expand it.
lib/net.c
+
6
−
3
View file @
76a225d3
...
@@ -56,10 +56,13 @@ int ptpd_netif_get_hw_addr(wr_socket_t * sock, mac_addr_t * mac)
...
@@ -56,10 +56,13 @@ int ptpd_netif_get_hw_addr(wr_socket_t * sock, mac_addr_t * mac)
return
0
;
return
0
;
}
}
void
ptpd_netif_set_phase_transition
(
wr_socket_t
*
sock
,
in
t
phase
)
void
ptpd_netif_set_phase_transition
(
uint32_
t
phase
)
{
{
struct
my_socket
*
s
=
(
struct
my_socket
*
)
sock
;
int
i
;
s
->
phase_transition
=
phase
;
for
(
i
=
0
;
i
<
NET_MAX_SOCKETS
;
++
i
)
{
socks
[
i
].
phase_transition
=
phase
;
}
}
}
wr_socket_t
*
ptpd_netif_create_socket
(
int
sock_type
,
int
flags
,
wr_socket_t
*
ptpd_netif_create_socket
(
int
sock_type
,
int
flags
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment