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
31
Issues
31
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
bf199e49
Commit
bf199e49
authored
Nov 17, 2014
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrs: fixed structure to export softpll stats
parent
36a79864
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
ram-wrs.ld
arch/lm32/ram-wrs.ld
+8
-1
softpll_ng.c
softpll/softpll_ng.c
+24
-0
softpll_ng.h
softpll/softpll_ng.h
+15
-0
No files found.
arch/lm32/ram-wrs.ld
View file @
bf199e49
...
@@ -31,8 +31,9 @@ ENTRY(_start)
...
@@ -31,8 +31,9 @@ ENTRY(_start)
MEMORY
MEMORY
{
{
ram
: ORIGIN = 0x0000
0000, LENGTH = 0x7000
ram
: ORIGIN = 0x
0000, LENGTH = 0x7000
mbox : ORIGIN = 0x7000, LENGTH = 0x1000
mbox : ORIGIN = 0x7000, LENGTH = 0x1000
stats : ORIGIN = 0x8000, LENGTH = 0x1000
}
}
SECTIONS
SECTIONS
...
@@ -60,6 +61,12 @@ SECTIONS
...
@@ -60,6 +61,12 @@ SECTIONS
*(.mbox)
*(.mbox)
} > mbox
} > mbox
.stats : {
. = ALIGN(4);
_fstats = .;
*(.stats)
} > stats
/* First location in stack is highest address in RAM */
/* First location in stack is highest address in RAM */
PROVIDE(_fstack = ORIGIN(ram) + LENGTH(ram) - 4);
PROVIDE(_fstack = ORIGIN(ram) + LENGTH(ram) - 4);
}
}
...
...
softpll/softpll_ng.c
View file @
bf199e49
...
@@ -19,6 +19,10 @@ volatile struct PPSG_WB *PPSG;
...
@@ -19,6 +19,10 @@ volatile struct PPSG_WB *PPSG;
int
spll_n_chan_ref
,
spll_n_chan_out
;
int
spll_n_chan_ref
,
spll_n_chan_out
;
#if defined(CONFIG_WR_SWITCH)
struct
spll_stats
*
stats_ptr
=
0x8000
;
#endif
/*
/*
* The includes below contain code (not only declarations) to enable
* The includes below contain code (not only declarations) to enable
* the compiler to inline functions where necessary and save some CPU
* the compiler to inline functions where necessary and save some CPU
...
@@ -636,12 +640,32 @@ void spll_set_dac(int index, int value)
...
@@ -636,12 +640,32 @@ void spll_set_dac(int index, int value)
void
spll_update
()
void
spll_update
()
{
{
struct
spll_stats
temp_stats
;
switch
(
softpll
.
mode
)
{
switch
(
softpll
.
mode
)
{
case
SPLL_MODE_GRAND_MASTER
:
case
SPLL_MODE_GRAND_MASTER
:
external_align_fsm
(
&
softpll
.
ext
);
external_align_fsm
(
&
softpll
.
ext
);
break
;
break
;
}
}
spll_update_aux_clocks
();
spll_update_aux_clocks
();
#if defined(CONFIG_WR_SWITCH)
/* for WRS update .stat section in memory */
temp_stats
.
magic
=
0x5b1157a7
;
temp_stats
.
ver
=
1
;
temp_stats
.
valid
=
0
;
temp_stats
.
mode
=
softpll
.
mode
;
temp_stats
.
irq_cnt
=
irq_count
;
temp_stats
.
seq_state
=
softpll
.
seq_state
;
temp_stats
.
align_state
=
softpll
.
ext
.
align_state
;
temp_stats
.
H_lock
=
softpll
.
helper
.
ld
.
locked
;
temp_stats
.
M_lock
=
softpll
.
mpll
.
ld
.
locked
;
temp_stats
.
H_y
=
softpll
.
helper
.
pi
.
y
;
temp_stats
.
M_y
=
softpll
.
mpll
.
pi
.
y
;
temp_stats
.
del_cnt
=
softpll
.
delock_count
;
stats_ptr
->
valid
=
0
;
*
stats_ptr
=
temp_stats
;
stats_ptr
->
valid
=
1
;
#endif
}
}
static
int
spll_measure_frequency
(
int
osc
)
static
int
spll_measure_frequency
(
int
osc
)
...
...
softpll/softpll_ng.h
View file @
bf199e49
...
@@ -129,5 +129,20 @@ int spll_get_dac(int out_channel);
...
@@ -129,5 +129,20 @@ int spll_get_dac(int out_channel);
void
check_vco_frequencies
();
void
check_vco_frequencies
();
/* info reported through .stat section */
struct
spll_stats
{
int
magic
;
/* 0x5b1157a7 = SPLLSTAT ?;)*/
int
ver
;
/* version of the structure */
char
valid
;
/* is the stat info valid */
int
mode
;
int
irq_cnt
;
int
seq_state
;
int
align_state
;
int
H_lock
;
int
M_lock
;
int
H_y
,
M_y
;
int
del_cnt
;
};
#endif // __SOFTPLL_NG_H
#endif // __SOFTPLL_NG_H
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