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
87
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
3093401e
Commit
3093401e
authored
12 years ago
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rt: enable_ptracker() call
parent
c4f7247f
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
rt/ipc/rt_ipc.c
+23
-45
23 additions, 45 deletions
rt/ipc/rt_ipc.c
rt/ipc/rt_ipc.h
+57
-0
57 additions, 0 deletions
rt/ipc/rt_ipc.h
with
80 additions
and
45 deletions
rt/ipc/rt_ipc.c
+
23
−
45
View file @
3093401e
...
...
@@ -12,6 +12,8 @@
#include
<sys/types.h>
#include
"minipc.h"
#define RTIPC_EXPORT_STRUCTURES
#include
"rt_ipc.h"
#include
<softpll_ng.h>
...
...
@@ -102,7 +104,8 @@ void rts_update()
{
int
i
;
int
n_ref
;
int
enabled
;
spll_get_num_channels
(
&
n_ref
,
NULL
);
pstate
.
flags
=
(
spll_check_lock
(
0
)
?
RTS_DMTD_LOCKED
|
RTS_REF_LOCKED
:
0
);
...
...
@@ -124,8 +127,11 @@ void rts_update()
if
(
spll_shifter_busy
(
0
))
CH
.
flags
|=
CHAN_SHIFTING
;
}
if
(
spll_read_ptracker
(
i
,
&
CH
.
phase_loopback
))
CH
.
flags
|=
CHAN_PMEAS_READY
;
if
(
spll_read_ptracker
(
i
,
&
CH
.
phase_loopback
,
&
enabled
))
CH
.
flags
|=
CHAN_PMEAS_READY
;
CH
.
flags
|=
(
enabled
?
CHAN_PTRACKER_ENABLED
:
0
);
}
#undef CH
...
...
@@ -152,7 +158,8 @@ static int rts_get_state_func(const struct minipc_pd *pd, uint32_t *args, void *
tmp
->
flags
=
htonl
(
pstate
.
flags
);
tmp
->
holdover_duration
=
htonl
(
pstate
.
holdover_duration
);
tmp
->
mode
=
htonl
(
pstate
.
mode
);
tmp
->
delock_count
=
spll_get_delock_count
();
for
(
i
=
0
;
i
<
RTS_PLL_CHANNELS
;
i
++
)
{
tmp
->
channels
[
i
].
priority
=
htonl
(
pstate
.
channels
[
i
].
priority
);
...
...
@@ -181,47 +188,11 @@ static int rts_adjust_phase_func(const struct minipc_pd *pd, uint32_t *args, voi
*
(
int
*
)
ret
=
rts_adjust_phase
((
int
)
args
[
0
],
(
int
)
args
[
1
]);
}
static
int
rts_enable_ptracker_func
(
const
struct
minipc_pd
*
pd
,
uint32_t
*
args
,
void
*
ret
)
{
*
(
int
*
)
ret
=
spll_enable_ptracker
((
int
)
args
[
0
],
(
int
)
args
[
1
]);
}
const
struct
minipc_pd
rtipc_rts_get_state_struct
=
{
.
f
=
rts_get_state_func
,
.
name
=
"aaaa"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_STRUCT
,
struct
rts_pll_state
),
.
args
=
{
MINIPC_ARG_END
},
};
const
struct
minipc_pd
rtipc_rts_set_mode_struct
=
{
.
f
=
rts_set_mode_func
,
.
name
=
"bbbb"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
const
struct
minipc_pd
rtipc_rts_lock_channel_struct
=
{
.
f
=
rts_lock_channel_func
,
.
name
=
"cccc"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
const
struct
minipc_pd
rtipc_rts_adjust_phase_struct
=
{
.
f
=
rts_adjust_phase_func
,
.
name
=
"dddd"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
/* The mailbox is mapped at 0x7000 in the linker script */
...
...
@@ -235,10 +206,17 @@ int rtipc_init()
if
(
!
server
)
return
1
;
rtipc_rts_set_mode_struct
.
f
=
rts_set_mode_func
;
rtipc_rts_get_state_struct
.
f
=
rts_get_state_func
;
rtipc_rts_lock_channel_struct
.
f
=
rts_lock_channel_func
;
rtipc_rts_adjust_phase_struct
.
f
=
rts_adjust_phase_func
;
rtipc_rts_enable_ptracker_struct
.
f
=
rts_enable_ptracker_func
;
minipc_export
(
server
,
&
rtipc_rts_set_mode_struct
);
minipc_export
(
server
,
&
rtipc_rts_get_state_struct
);
minipc_export
(
server
,
&
rtipc_rts_lock_channel_struct
);
minipc_export
(
server
,
&
rtipc_rts_adjust_phase_struct
);
minipc_export
(
server
,
&
rtipc_rts_adjust_phase_struct
);
minipc_export
(
server
,
&
rtipc_rts_enable_ptracker_struct
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
rt/ipc/rt_ipc.h
+
57
−
0
View file @
3093401e
...
...
@@ -18,6 +18,8 @@
#define CHAN_DISABLED (1<<4)
/* Channel is busy adjusting phase */
#define CHAN_SHIFTING (1<<5)
/* Channel is busy adjusting phase */
#define CHAN_PTRACKER_ENABLED (1<<6)
/* DMTD clock is present */
#define RTS_DMTD_LOCKED (1<<0)
...
...
@@ -83,6 +85,8 @@ struct rts_pll_state {
/* mode of operation (RTS_MODE_xxx) */
uint32_t
mode
;
uint32_t
delock_count
;
};
/* API */
...
...
@@ -99,5 +103,58 @@ int rts_set_mode(int mode);
/* Reference channel configuration (BC mode only) */
int
rts_lock_channel
(
int
channel
,
int
priority
);
/* Enabled/disables phase tracking on a particular port */
int
rts_enable_ptracker
(
int
channel
,
int
enable
);
#ifdef RTIPC_EXPORT_STRUCTURES
static
struct
minipc_pd
rtipc_rts_get_state_struct
=
{
.
name
=
"aaaa"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_STRUCT
,
struct
rts_pll_state
),
.
args
=
{
MINIPC_ARG_END
},
};
static
struct
minipc_pd
rtipc_rts_set_mode_struct
=
{
.
name
=
"bbbb"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
static
struct
minipc_pd
rtipc_rts_lock_channel_struct
=
{
.
name
=
"cccc"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
static
struct
minipc_pd
rtipc_rts_adjust_phase_struct
=
{
.
name
=
"dddd"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
static
struct
minipc_pd
rtipc_rts_enable_ptracker_struct
=
{
.
name
=
"eeee"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
#endif
#endif
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