Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
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
Projects
White Rabbit Switch - Software
Commits
7f2ca82a
Commit
7f2ca82a
authored
5 years ago
by
Jean-Claude BAU
Browse files
Options
Downloads
Patches
Plain Diff
wr_date: Fix issue accessing the timing mode
parent
00e214e2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userspace/ppsi
+1
-1
1 addition, 1 deletion
userspace/ppsi
userspace/tools/wr_date.c
+12
-18
12 additions, 18 deletions
userspace/tools/wr_date.c
with
13 additions
and
19 deletions
ppsi
@
3c27f391
Compare
9b1ae8a3
...
3c27f391
Subproject commit
9b1ae8a387a078755e59b3df6a2b034dc464460c
Subproject commit
3c27f391927480457dff031cdc8ccb15eb046230
This diff is collapsed.
Click to expand it.
userspace/tools/wr_date.c
+
12
−
18
View file @
7f2ca82a
...
...
@@ -21,6 +21,7 @@
#include
<libwr/softpll_export.h>
#include
<libwr/util.h>
#include
<time_lib.h>
#include
<rt_ipc.h>
#ifndef MOD_TAI
#define MOD_TAI 0x80
...
...
@@ -506,26 +507,18 @@ int wrdate_internal_set_gm(volatile struct PPSG_WB *pps) {
return
0
;
}
#define SPLL_MAGIC 0x5b1157a7
#define FPGA_SPLL_STAT 0x10006800
int
getTimingMode
(
void
)
{
static
struct
spll_stats
*
spll_stats_p
;
static
int
connected
=
FALSE
;
struct
rts_pll_state
pstate
;
if
(
spll_stats_p
==
NULL
)
{
spll_stats_p
=
create_map
(
FPGA_SPLL_STAT
,
sizeof
(
*
spll_stats_p
));
if
(
spll_stats_p
==
NULL
)
{
fprintf
(
stderr
,
"Cannot create map to Soft Pll stats
\n
"
);
return
-
1
;
}
if
(
spll_stats_p
->
magic
!=
SPLL_MAGIC
)
{
/* Wrong magic */
fprintf
(
stderr
,
"Soft PLL: unknown magic %x (known is %x)
\n
"
,
spll_stats_p
->
magic
,
SPLL_MAGIC
);
if
(
!
connected
)
{
if
(
rts_connect
(
NULL
)
<
0
)
return
-
1
;
}
connected
=
TRUE
;
}
return
spll_stats_p
->
mode
;
if
(
rts_get_state
(
&
pstate
)
<
0
)
return
-
1
;
return
pstate
.
mode
;
}
/* Frontend to the set mechanism: parse the argument */
...
...
@@ -536,7 +529,8 @@ int wrdate_set(volatile struct PPSG_WB *pps, int argc, char **argv)
struct
timeval
tv
;
if
(
!
strcmp
(
argv
[
0
],
"host"
))
{
switch
(
getTimingMode
())
{
int
tm
=
getTimingMode
();
switch
(
tm
)
{
case
SPLL_MODE_GRAND_MASTER
:
return
wrdate_internal_set_gm
(
pps
);
case
SPLL_MODE_FREE_RUNNING_MASTER
:
...
...
@@ -547,7 +541,7 @@ int wrdate_set(volatile struct PPSG_WB *pps, int argc, char **argv)
fprintf
(
stderr
,
"Slave timing mode: WR time cannot be set!!!
\n
"
);
return
-
1
;
default:
fprintf
(
stderr
,
"Cannot read Soft PLL timing mode. WR time cannot be set
.
\n
"
);
fprintf
(
stderr
,
"Cannot read Soft PLL timing mode. WR time cannot be set
(ret=%d)
\n
"
,
tm
);
return
-
1
;
}
}
...
...
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