Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
FMC DEL 1ns 4cha
Commits
391c07d8
Commit
391c07d8
authored
May 16, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/lib/fdelay-gs: reconfigure the card on sync lost
parent
754b2473
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
fdelay-gs.c
software/lib/fdelay-gs.c
+16
-1
fdelay_lib.c
software/lib/fdelay_lib.c
+9
-1
No files found.
software/lib/fdelay-gs.c
View file @
391c07d8
...
...
@@ -266,7 +266,7 @@ void enable_termination(fdelay_device_t *b, int enable)
void
enable_wr
(
fdelay_device_t
*
b
,
int
index
)
{
int
lock_retries
=
1
0
;
int
lock_retries
=
5
0
;
printf
(
"Locking to WR network [board=%d]..."
,
index
);
fflush
(
stdout
);
fdelay_configure_sync
(
b
,
FDELAY_SYNC_LOCAL
);
...
...
@@ -424,6 +424,9 @@ void sighandler(int sig)
}
}
int
fdelay_dbg_sync_lost
(
fdelay_device_t
*
dev
);
int
main
(
int
argc
,
char
*
argv
[])
{
int
i
,
maxfd
=
-
1
;
...
...
@@ -457,8 +460,20 @@ int main(int argc, char *argv[])
continue
;
// printf(".");
handle_readout
(
&
boards
[
i
]);
if
(
fdelay_dbg_sync_lost
(
boards
[
i
].
b
))
{
printf
(
"Weird, sync lost @ board %x. Reconfiguring...
\n
"
,
boards
[
i
].
b
);
configure_board
(
&
boards
[
i
]);
}
}
usleep
(
100
);
}
}
software/lib/fdelay_lib.c
View file @
391c07d8
...
...
@@ -1388,13 +1388,21 @@ int fdelay_check_sync(fdelay_device_t *dev)
// fprintf(stderr, "TCR %x\n", fd_readl(FD_REG_TCR) & FD_TCR_WR_LOCKED);
if
(
hw
->
wr_enabled
&&
(
fd_readl
(
FD_REG_TCR
)
&
FD_TCR_WR_LOCKED
))
{
fd_writel
(
FD_EIC_ISR_SYNC_STATUS
,
FD_REG_EIC_ISR
);
fd_writel
(
FD_EIC_ISR_SYNC_STATUS
,
FD_REG_EIC_IER
);
return
1
;
else
if
(
!
hw
->
wr_enabled
)
}
else
if
(
!
hw
->
wr_enabled
)
return
1
;
return
0
;
}
int
fdelay_dbg_sync_lost
(
fdelay_device_t
*
dev
)
{
fd_decl_private
(
dev
)
return
(
fd_readl
(
FD_REG_EIC_ISR
)
&
FD_EIC_ISR_SYNC_STATUS
)
?
1
:
0
;
}
# if 0
...
...
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