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
41b62c30
Commit
41b62c30
authored
Nov 14, 2019
by
Grzegorz Daniluk
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset serdes on link down
parent
1223d94f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
hal_shmem.h
userspace/libwr/include/libwr/hal_shmem.h
+1
-0
hal_port_fsm_rx.c
userspace/wrsw_hal/hal_port_fsm_rx.c
+14
-1
No files found.
userspace/libwr/include/libwr/hal_shmem.h
View file @
41b62c30
...
...
@@ -85,6 +85,7 @@ typedef struct {
timeout_t
earlyup_timeout
;
timeout_t
align_to_link_timeout
;
timeout_t
restart_timeout
;
timeout_t
watchdog_timeout
;
int
attempts
;
}
halPortLpdcRx_t
;
...
...
userspace/wrsw_hal/hal_port_fsm_rx.c
View file @
41b62c30
...
...
@@ -165,9 +165,11 @@ static int _hal_port_rx_setup_state_start(fsm_t *fsm, int eventMsk, int isNewSta
}
if
(
ps
->
lpdc
.
isSupported
)
{
if
(
isNewState
)
if
(
isNewState
)
{
// Restart the time-out
libwr_tmo_restart
(
&
rxSetup
->
earlyup_timeout
);
libwr_tmo_restart
(
&
rxSetup
->
watchdog_timeout
);
}
/* Wait a bit to make sure early_link_up is reseted. This
timeout is initialized in hal_port_rx_setup_init_fsm(),
...
...
@@ -189,6 +191,15 @@ static int _hal_port_rx_setup_state_start(fsm_t *fsm, int eventMsk, int isNewSta
}
else
{
// Restart the time-out
libwr_tmo_restart
(
&
rxSetup
->
earlyup_timeout
);
/* if there is no early linkup, restart RX of the transceiver, is it stuck?? */
if
(
libwr_tmo_expired
(
&
rxSetup
->
watchdog_timeout
))
{
pr_warning
(
"--------- restarting transceiver %s ------------
\n
"
,
ps
->
name
);
pcs_writel
(
ps
,
MDIO_LPC_CTRL_TX_ENABLE
|
MDIO_LPC_CTRL_DMTD_SOURCE_RXRECCLK
|
MDIO_LPC_CTRL_RESET_RX
,
MDIO_LPC_CTRL
);
libwr_tmo_restart
(
&
rxSetup
->
watchdog_timeout
);
}
}
}
else
{
/* nothing to do, go waiting for link_up*/
...
...
@@ -452,6 +463,8 @@ void hal_port_rx_setup_fsm_init(struct hal_port_state * ps ) {
// This timer is used to leave enough time to the FSM in the other side to detect a link down
libwr_tmo_init
(
&
ps
->
lpdc
.
rxSetup
->
restart_timeout
,
100
,
0
);
libwr_tmo_init
(
&
rxSetup
->
watchdog_timeout
,
2000
,
0
);
}
/**
* This time-out is used to impose the same minimum of RX calibration time
...
...
Grzegorz Daniluk
@greg.d
mentioned in commit
b52ca4d4
·
Nov 22, 2019
mentioned in commit
b52ca4d4
mentioned in commit b52ca4d474749a6c0309fd61f5409ab3d81a4778
Toggle commit list
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