Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
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
White Rabbit Switch - Software
Commits
5011e937
Commit
5011e937
authored
Oct 12, 2011
by
Tomasz Wlostowski
Committed by
Alessandro Rubini
Oct 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libswitchhw: imported function ppsg_sync_external_pps() from the old svn repo
parent
125264a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
pps_gen_regs.h
userspace/include/hw/pps_gen_regs.h
+10
-1
pps_gen.c
userspace/libswitchhw/pps_gen.c
+19
-0
No files found.
userspace/include/hw/pps_gen_regs.h
View file @
5011e937
...
...
@@ -3,7 +3,7 @@
* File : ../../../software/include/hw/pps_gen_regs.h
* Author : auto-generated by wbgen2 from wrsw_pps_gen.wb
* Created :
Sat Sep 11 22:22:55 2010
* Created :
Mon May 9 00:28:48 2011
* Standard : ANSI C
THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE wrsw_pps_gen.wb
...
...
@@ -14,6 +14,8 @@
#ifndef __WBGEN2_REGDEFS_WRSW_PPS_GEN_WB
#define __WBGEN2_REGDEFS_WRSW_PPS_GEN_WB
#include <inttypes.h>
#if defined( __GNUC__)
#define PACKED __attribute__ ((packed))
#else
...
...
@@ -60,6 +62,11 @@
/* definitions for register: UTC Adjustment register (least-significant part) */
/* definitions for register: UTC Adjustment register (most-significant part) */
/* definitions for register: External sync control register */
/* definitions for field: Sync to external PPS input in reg: External sync control register */
#define PPSG_ESCR_SYNC WBGEN2_GEN_MASK(0, 1)
/* [0x0]: REG Control Register */
#define PPSG_REG_CR 0x00000000
/* [0x4]: REG Nanosecond counter register */
...
...
@@ -74,4 +81,6 @@
#define PPSG_REG_ADJ_UTCLO 0x00000014
/* [0x18]: REG UTC Adjustment register (most-significant part) */
#define PPSG_REG_ADJ_UTCHI 0x00000018
/* [0x1c]: REG External sync control register */
#define PPSG_REG_ESCR 0x0000001c
#endif
userspace/libswitchhw/pps_gen.c
View file @
5011e937
...
...
@@ -61,3 +61,22 @@ int shw_pps_gen_busy()
{
return
_fpga_readl
(
FPGA_BASE_PPS_GEN
+
PPSG_REG_CR
)
&
PPSG_CR_CNT_ADJ
?
0
:
1
;
}
/* Syncs the PPS generator PPS with the externally provided signal. */
int
shw_pps_gen_sync_external_pps
()
{
TRACE
(
TRACE_INFO
,
"Syncing to external PPS.."
);
_fpga_writel
(
FPGA_BASE_PPS_GEN
+
PPSG_REG_ADJ_NSEC
,
6
);
_fpga_writel
(
FPGA_BASE_PPS_GEN
+
PPSG_REG_ESCR
,
PPSG_ESCR_SYNC
);
/* fixme: waiting here is unstable. Probably a HW bug. */
/* fixme: re-phasing the AD9516 clock is also required */
/* while(!(_fpga_readl(FPGA_BASE_PPS_GEN + PPSG_REG_ESCR) & PPSG_ESCR_SYNC))
{
sleep(1);
}*/
return
0
;
}
\ No newline at end of file
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