Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Gateware
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
12
Issues
12
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Gateware
Commits
c020a8f4
Commit
c020a8f4
authored
May 02, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt/ipc: enable_ptracker() call
parent
ad61f748
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
45 deletions
+80
-45
rt_ipc.c
rt/ipc/rt_ipc.c
+23
-45
rt_ipc.h
rt/ipc/rt_ipc.h
+57
-0
No files found.
rt/ipc/rt_ipc.c
View file @
c020a8f4
...
...
@@ -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
;
...
...
rt/ipc/rt_ipc.h
View file @
c020a8f4
...
...
@@ -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
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