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
6
Merge Requests
6
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
6174a3db
Commit
6174a3db
authored
Jun 04, 2019
by
José López Jiménez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SoftPLL: Ext pll lock now from regs instead of SPI read
parent
bb2d891e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
ad9516.c
dev/ad9516.c
+2
-0
softpll_regs.h
softpll/hw/softpll_regs.h
+8
-1
spll_external.c
softpll/spll_external.c
+4
-1
No files found.
dev/ad9516.c
View file @
6174a3db
...
...
@@ -231,6 +231,8 @@ static void ad9516_sync_outputs(void *spi_base)
}
// This function is related to a not very well documented bug in the external softpll init code.
int
ext_ad9516_locked
(
void
)
{
if
((
ad9516_read_reg
((
void
*
)
BASE_SPI_EXT_BOARD
,
0x1f
)
&
1
))
...
...
softpll/hw/softpll_regs.h
View file @
6174a3db
...
...
@@ -3,7 +3,7 @@
* File : softpll_regs.h
* Author : auto-generated by wbgen2 from spll_wb_slave.wb
* Created :
Thu Dec 3 15:09:41 2015
* Created :
Mon Jun 3 10:25:43 2019
* Standard : ANSI C
THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE spll_wb_slave.wb
...
...
@@ -14,7 +14,11 @@
#ifndef __WBGEN2_REGDEFS_SPLL_WB_SLAVE_WB
#define __WBGEN2_REGDEFS_SPLL_WB_SLAVE_WB
#ifdef __KERNEL__
#include <linux/types.h>
#else
#include <inttypes.h>
#endif
#if defined( __GNUC__)
#define PACKED __attribute__ ((packed))
...
...
@@ -68,6 +72,9 @@
/* definitions for field: EXT_REF_STOPPED in reg: External Clock Control Register */
#define SPLL_ECCR_EXT_REF_STOPPED WBGEN2_GEN_MASK(3, 1)
/* definitions for field: EXT_REF_PLLLOCK in reg: External Clock Control Register */
#define SPLL_ECCR_EXT_REF_PLLLOCK WBGEN2_GEN_MASK(4, 1)
/* definitions for field: EXT_PLL_RST in reg: External Clock Control Register */
#define SPLL_ECCR_EXT_REF_PLLRST WBGEN2_GEN_MASK(31, 1)
...
...
softpll/spll_external.c
View file @
6174a3db
...
...
@@ -58,6 +58,9 @@ int external_locked(volatile struct spll_external_state *s)
if
(
!
gpio_in
(
GPIO_EXT_BOARD_DETECT
)
&&
(
!
(
SPLL
->
ECCR
&
SPLL_ECCR_EXT_REF_LOCKED
)
||
// ext PLL became unlocked
(
SPLL
->
ECCR
&
SPLL_ECCR_EXT_REF_STOPPED
)))
// 10MHz unplugged (only SPEC)
return
0
;
if
(
!
(
gpio_in
(
GPIO_EXT_BOARD_DETECT
)
&&
(
SPLL
->
ECCR
&
SPLL_ECCR_EXT_REF_PLLLOCK
)))
return
0
;
//FIXME A bug prevents the correct locking if the external lock check is executed
// Correct way to solve it: export the LOCK signal from the gateware and check it
// if (gpio_in(GPIO_EXT_BOARD_DETECT) && ext_ad9516_locked())
...
...
@@ -121,7 +124,7 @@ int external_align_fsm(volatile struct spll_external_state *s)
if
(
!
gpio_in
(
GPIO_EXT_BOARD_DETECT
)
&&
SPLL
->
ECCR
&
SPLL_ECCR_EXT_REF_STOPPED
)
s
->
align_state
=
ALIGN_STATE_WAIT_CLKIN
;
else
if
((
!
gpio_in
(
GPIO_EXT_BOARD_DETECT
)
&&
SPLL
->
ECCR
&
SPLL_ECCR_EXT_REF_LOCKED
)
||
gpio_in
(
GPIO_EXT_BOARD_DETECT
)
&&
ext_ad9516_locked
()
)
gpio_in
(
GPIO_EXT_BOARD_DETECT
)
&&
SPLL
->
ECCR
&
SPLL_ECCR_EXT_REF_PLLLOCK
)
s
->
align_state
=
ALIGN_STATE_START
;
done_sth
++
;
break
;
...
...
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