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
4
Merge Requests
4
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
19a1a285
Commit
19a1a285
authored
May 09, 2013
by
Grzegorz Daniluk
Committed by
Alessandro Rubini
May 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new t24p calibration fixed
parent
6de5d4af
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
13 deletions
+36
-13
rxts_calibrator.c
dev/rxts_calibrator.c
+5
-1
rxts_calibrator.h
include/rxts_calibrator.h
+1
-1
ppsi-wrappers.c
lib/ppsi-wrappers.c
+1
-1
ptp-noposix-wrappers.c
lib/ptp-noposix-wrappers.c
+19
-2
ppsi
ppsi
+1
-1
wrc_main.c
wrc_main.c
+9
-1
wrc_ptp_noposix.c
wrc_ptp_noposix.c
+0
-6
No files found.
dev/rxts_calibrator.c
View file @
19a1a285
...
...
@@ -225,7 +225,11 @@ static int calib_t24p_master(uint32_t *value)
int
rv
;
rv
=
eeprom_phtrans
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
,
value
,
0
);
printf
(
"t24p read from EEPROM: %d ps
\n
"
,
*
value
);
if
(
rv
<
0
)
printf
(
"Something went wrong while reading from EEPROM: %d
\n
"
,
rv
);
else
printf
(
"t24p read from EEPROM: %d ps
\n
"
,
*
value
);
return
rv
;
}
...
...
include/rxts_calibrator.h
View file @
19a1a285
...
...
@@ -13,6 +13,6 @@
void
rxts_calibration_start
();
int
rxts_calibration_update
(
int
*
t24p_value
);
int
measure_t24p
(
uint32_t
*
value
);
int
calib_t24p
(
int
mode
,
in
t
*
value
);
int
calib_t24p
(
int
mode
,
uint32_
t
*
value
);
#endif
lib/ppsi-wrappers.c
View file @
19a1a285
...
...
@@ -31,7 +31,7 @@ static int read_phase_val(hexp_port_state_t *state)
return
0
;
}
extern
int32_t
cal_phase_transition
;
extern
u
int32_t
cal_phase_transition
;
extern
int32_t
sfp_alpha
;
int
halexp_get_port_state
(
hexp_port_state_t
*
state
,
const
char
*
port_name
)
...
...
lib/ptp-noposix-wrappers.c
View file @
19a1a285
...
...
@@ -11,6 +11,8 @@
#include "../PTPWRd/datatypes.h"
#include "wrc_ptp.h"
#include <syscon.h>
#include <rxts_calibrator.h>
#include <wrc.h>
uint64_t
ptpd_netif_get_msec_tics
(
void
)
{
...
...
@@ -74,7 +76,7 @@ static int read_phase_val(hexp_port_state_t *state)
return
0
;
}
extern
int32_t
cal_phase_transition
;
extern
u
int32_t
cal_phase_transition
;
extern
int32_t
sfp_alpha
;
int
halexp_get_port_state
(
hexp_port_state_t
*
state
,
const
char
*
port_name
)
...
...
@@ -131,7 +133,22 @@ int ptpd_netif_locking_enable(int txrx, const char *ifaceName, int priority)
int
ptpd_netif_locking_poll
(
int
txrx
,
const
char
*
ifaceName
,
int
priority
)
{
return
spll_check_lock
(
0
)
?
PTPD_NETIF_READY
:
PTPD_NETIF_ERROR
;
int
locked
;
static
int
t24p_calibrated
=
0
;
locked
=
spll_check_lock
(
0
);
if
(
!
locked
)
{
t24p_calibrated
=
0
;
}
else
if
(
locked
&&
!
t24p_calibrated
)
{
/*run t24p calibration if needed*/
mprintf
(
"running t24p calibration
\n
"
);
calib_t24p
(
WRC_MODE_SLAVE
,
&
cal_phase_transition
);
t24p_calibrated
=
1
;
}
return
locked
?
PTPD_NETIF_READY
:
PTPD_NETIF_ERROR
;
}
int
ptpd_netif_read_calibration_data
(
const
char
*
ifaceName
,
uint64_t
*
deltaTx
,
...
...
ppsi
@
70d8dbec
Subproject commit
cc84c606faeb506404fe63dcd219bd77e7dd6a3f
Subproject commit
70d8dbecf2a6cf72dbac93078c42dc8a83decfe1
wrc_main.c
View file @
19a1a285
...
...
@@ -22,13 +22,14 @@
#include "ptpd.h"
#include "ptpd_netif.h"
#include "i2c.h"
//
#include "eeprom.h"
#include "eeprom.h"
#include "softpll_ng.h"
#include "onewire.h"
#include "pps_gen.h"
#include "sockitowm.h"
#include "shell.h"
#include "lib/ipv4.h"
#include "rxts_calibrator.h"
#include "wrc_ptp.h"
...
...
@@ -61,6 +62,11 @@ static void wrc_initialize()
w1_scan_bus
(
&
wrpc_w1_bus
);
#endif
/*initialize I2C bus*/
mi2c_init
(
WRPC_FMC_I2C
);
/*check if EEPROM is onboard*/
eeprom_present
(
WRPC_FMC_I2C
,
FMC_EEPROM_ADR
);
mac_addr
[
0
]
=
0x08
;
//
mac_addr
[
1
]
=
0x00
;
// CERN OUI
mac_addr
[
2
]
=
0x30
;
//
...
...
@@ -85,6 +91,8 @@ static void wrc_initialize()
minic_init
();
shw_pps_gen_init
();
wrc_ptp_init
();
//try reading t24 phase transition from EEPROM
calib_t24p
(
WRC_MODE_MASTER
,
&
cal_phase_transition
);
#ifdef CONFIG_ETHERBONE
ipv4_init
(
"wru1"
);
...
...
wrc_ptp_noposix.c
View file @
19a1a285
...
...
@@ -18,9 +18,6 @@
#include "wrc_ptp.h"
#include "pps_gen.h"
#include "uart.h"
#include "rxts_calibrator.h"
extern
int32_t
cal_phase_transition
;
static
RunTimeOpts
rtOpts
=
{
.
ifaceName
=
{
"wr1"
},
...
...
@@ -141,9 +138,6 @@ int wrc_ptp_set_mode(int mode)
}
mprintf
(
"
\n
"
);
/*t24p calibration here*/
calib_t24p
(
mode
,
&
cal_phase_transition
);
if
(
mode
==
WRC_MODE_MASTER
||
mode
==
WRC_MODE_GM
)
shw_pps_gen_enable_output
(
1
);
...
...
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