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
7
Merge Requests
7
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
23a0d3a1
Commit
23a0d3a1
authored
Jul 10, 2020
by
Tomasz Wlostowski
Committed by
Grzegorz Daniluk
Oct 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
boards/afcz: enable VCO APR check by default
parent
3adcd26d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
board.c
boards/afcz/board.c
+16
-6
board.h
boards/afcz/board.h
+1
-3
No files found.
boards/afcz/board.c
View file @
23a0d3a1
...
...
@@ -435,21 +435,24 @@ static int calc_apr(int meas_min, int meas_max, int f_center )
static
void
check_vco_freq
(
int
cm_channel
,
int
cm_ref
,
void
(
*
dac_setter
)(
int
))
{
int
f_min
,
f_max
;
wb_cm_configure
(
&
board
.
clk_mon
,
cm_ref
,
2
,
10
000000
);
wb_cm_configure
(
&
board
.
clk_mon
,
cm_ref
,
5
,
1
000000
);
wb_cm_set_ref_frequency
(
&
board
.
clk_mon
,
CPU_CLOCK
);
dac_setter
(
0
);
timer_delay_ms
(
10
);
timer_delay_ms
(
1
);
wb_cm_restart
(
&
board
.
clk_mon
);
while
(
!
(
wb_cm_read
(
&
board
.
clk_mon
)
&
(
1
<<
cm_channel
)
)
);
f_min
=
board
.
clk_mon
.
freqs
[
cm_channel
];
dac_setter
(
65535
);
timer_delay_ms
(
1
0
);
timer_delay_ms
(
1
);
wb_cm_restart
(
&
board
.
clk_mon
);
while
(
!
(
wb_cm_read
(
&
board
.
clk_mon
)
&
(
1
<<
cm_channel
)
)
);
f_max
=
board
.
clk_mon
.
freqs
[
cm_channel
];
dac_setter
(
32768
);
timer_delay
(
1
);
pp_printf
(
"VCO ch %d: Low=%d Hz Hi=%d Hz, APR = %d ppm.
\n
"
,
cm_channel
,
f_min
,
f_max
,
calc_apr
(
f_min
,
f_max
,
62500000
)
);
}
...
...
@@ -584,9 +587,16 @@ int wrc_board_early_init()
tca9548_select_channels
(
&
board
.
si57x
.
master
,
0x70
,
1
<<
AFCZ_I2C_MUX_CHANNEL_SI570
);
// check_vco_freq( AFCZ_CM_CHANNEL_CLK_DMTD, AFCZ_CM_CHANNEL_CLK_SYS, set_dmtd_dac );
//check_vco_freq( AFCZ_CM_CHANNEL_CLK_REF, AFCZ_CM_CHANNEL_CLK_SYS, set_main_dac );
#if 1
set_dmtd_dac
(
32767
);
set_main_dac
(
32767
);
// cross-check the REF and DDMTD clocks
pp_printf
(
"Checking DDMTD and REF clock frequencies:
\n
"
);
check_vco_freq
(
AFCZ_CM_CHANNEL_CLK_DMTD
,
AFCZ_CM_CHANNEL_CLK_REF
,
set_dmtd_dac
);
check_vco_freq
(
AFCZ_CM_CHANNEL_CLK_REF
,
AFCZ_CM_CHANNEL_CLK_DMTD
,
set_main_dac
);
#endif
return
0
;
}
...
...
boards/afcz/board.h
View file @
23a0d3a1
...
...
@@ -26,9 +26,7 @@
#define BASE_CLOCK_MONITOR (BASE_AUXWB + 0xc0)
#define AFCZ_CM_CHANNEL_CLK_PCB 0
#define AFCZ_CM_CHANNEL_CLK_PHY_RX 1
#define AFCZ_CM_CHANNEL_CLK_REF 2
#define AFCZ_CM_CHANNEL_CLK_SYS 3
#define AFCZ_CM_CHANNEL_CLK_REF 1
#define AFCZ_CM_CHANNEL_CLK_DMTD 5
#define AFCZ_IC33_CLK_SI570_1_IN 13
...
...
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