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
65fb29b5
Commit
65fb29b5
authored
Nov 23, 2015
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
softpll and dump: add a log of the last 16 fifo values
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
734840b7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
5 deletions
+46
-5
softpll_ng.c
softpll/softpll_ng.c
+19
-5
softpll_ng.h
softpll/softpll_ng.h
+8
-0
wrpc-dump.c
tools/wrpc-dump.c
+19
-0
No files found.
softpll/softpll_ng.c
View file @
65fb29b5
...
...
@@ -224,16 +224,30 @@ static inline void update_loops(struct softpll_state *s, int tag_value, int tag_
}
}
struct
spll_fifo_log
fifo_log
[
FIFO_LOG_LEN
];
void
_irq_entry
(
void
)
{
struct
softpll_state
*
s
=
(
struct
softpll_state
*
)
&
softpll
;
uint32_t
trr
;
int
i
,
tag_source
,
tag_value
;
static
uint16_t
tag_count
;
struct
spll_fifo_log
*
l
;
/* check if there are more tags in the FIFO
*/
/* check if there are more tags in the FIFO, and log them
*/
while
(
!
(
SPLL
->
TRR_CSR
&
SPLL_TRR_CSR_EMPTY
))
{
volatile
uint32_t
trr
=
SPLL
->
TRR_R0
;
int
tag_source
=
SPLL_TRR_R0_CHAN_ID_R
(
trr
);
int
tag_value
=
SPLL_TRR_R0_VALUE_R
(
trr
);
trr
=
SPLL
->
TRR_R0
;
/* save this to a circular buffer */
i
=
tag_count
%
FIFO_LOG_LEN
;
l
=
fifo_log
+
i
;
l
->
trr
=
trr
;
l
->
irq_count
=
s
->
irq_count
&
0xffff
;
l
->
tag_count
=
tag_count
++
;
/* And process the values */
tag_source
=
SPLL_TRR_R0_CHAN_ID_R
(
trr
);
tag_value
=
SPLL_TRR_R0_VALUE_R
(
trr
);
sequencing_fsm
(
s
,
tag_value
,
tag_source
);
update_loops
(
s
,
tag_value
,
tag_source
);
...
...
softpll/softpll_ng.h
View file @
65fb29b5
...
...
@@ -193,5 +193,13 @@ struct softpll_state {
struct
spll_ptracker_state
ptrackers
[
MAX_PTRACKERS
];
};
struct
spll_fifo_log
{
uint32_t
trr
;
uint16_t
irq_count
;
uint16_t
tag_count
;
};
#define FIFO_LOG_LEN 16
#endif // __SOFTPLL_NG_H
tools/wrpc-dump.c
View file @
65fb29b5
...
...
@@ -464,6 +464,16 @@ static struct dump_info pll_info [] = {
/* FIXME: aux_state and ptracker_state -- variable-len arrays */
};
#undef DUMP_STRUCT
#define DUMP_STRUCT struct spll_fifo_log
static
struct
dump_info
fifo_info
[]
=
{
DUMP_FIELD
(
uint32_t
,
trr
),
DUMP_FIELD
(
uint16_t
,
irq_count
),
DUMP_FIELD
(
uint16_t
,
tag_count
),
};
/* Use: wrs_dump_memory <file> <hex-offset> <name> */
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -517,6 +527,15 @@ int main(int argc, char **argv)
dump_many_fields
(
mapaddr
+
offset
,
ARRAY_AND_SIZE
(
pll_info
));
}
if
(
!
strcmp
(
argv
[
3
],
"fifo"
))
{
int
i
;
printf
(
"fifo log at 0x%lx
\n
"
,
offset
);
for
(
i
=
0
;
i
<
FIFO_LOG_LEN
;
i
++
)
dump_many_fields
(
mapaddr
+
offset
+
i
*
sizeof
(
struct
spll_fifo_log
),
ARRAY_AND_SIZE
(
fifo_info
));
}
if
(
!
strcmp
(
argv
[
3
],
"ppg"
))
{
printf
(
"ppg at 0x%lx
\n
"
,
offset
);
dump_many_fields
(
mapaddr
+
offset
,
...
...
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