Commit 99c0c2bf authored by Maciej Lipinski's avatar Maciej Lipinski

[HAL/leds] implement LPDC calibration blinking also for rx calibration

So far, only LDPC tx calibration was indicated by blinking link led,
now the same behavior was added when LPDC rx calibration is ongoing.
parent 89c6c28e
......@@ -215,6 +215,9 @@ static int port_fsm_state_link_down(fsm_t *fsm, int eventMsk, int isNewState) {
/* measure bitslide regardless of LPDC support,
(if not supported, the value of the register will be zero) */
uint32_t bit_slide_steps;
/* Finish blinking for LPCC rx calibration, the led will be
set appropriately if it gets to the link_up state. */
led_set_wrmode(ps->hw_index,SFP_LED_WRMODE_OFF);
if (pcs_readl(ps, 16, &bit_slide_steps) >= 0) {
bit_slide_steps = (bit_slide_steps >> 4) & 0x1f;
/* FIXME: use proper register names */
......
......@@ -185,6 +185,7 @@ static int _hal_port_rx_setup_state_start(fsm_t *fsm, int eventMsk, int isNewSta
rxSetup->attempts = 0;
rts_enable_ptracker(ps->hw_index, 0);
led_set_wrmode(ps->hw_index,SFP_LED_WRMODE_CALIB);
fsm_fire_state(fsm, HAL_PORT_RX_SETUP_STATE_RESET_PCS);
} else {
// Restart the time-out
......
......@@ -162,7 +162,8 @@ static int port_tx_setup_fsm_state_start(fsm_t *fsm, int eventMsk, int isNewStat
MDIO_LPC_CTRL_DMTD_SOURCE_TXOUTCLK,
MDIO_LPC_CTRL);
led_set_wrmode(ps->hw_index,SFP_LED_WRMODE_TX_CALIB);
/* start indicating LPDC rx calibration. */
led_set_wrmode(ps->hw_index,SFP_LED_WRMODE_CALIB);
fsm_fire_state(fsm, HAL_PORT_TX_SETUP_STATE_RESET_PCS);
}
return 0;
......
......@@ -61,7 +61,7 @@ void led_link_update(struct hal_port_state *ps) {
unsigned char value=_leds.link_leds_map_to_update[i];
if ( value != _leds.link_leds_map[i] ||
value == SFP_LED_WRMODE_TX_CALIB /* always update to blink*/) {
value == SFP_LED_WRMODE_CALIB /* always update to blink*/) {
_leds.link_leds_map[i]=value;
/* update the LED, don't forget to turn off LEDs if needed */
......@@ -79,7 +79,7 @@ void led_link_update(struct hal_port_state *ps) {
case SFP_LED_WRMODE_MASTER:
shw_sfp_set_generic(i, 1,SFP_LED_WRMODE1 | SFP_LED_WRMODE2);
break;
case SFP_LED_WRMODE_TX_CALIB:
case SFP_LED_WRMODE_CALIB:
if(led_get_blink_state()){ // SFP_LED_WRMODE_OTHER
shw_sfp_set_generic(i, 0, SFP_LED_WRMODE1);
shw_sfp_set_generic(i, 1, SFP_LED_WRMODE2);
......
......@@ -14,7 +14,7 @@
#define SFP_LED_WRMODE_OTHER (2) /* orange */
#define SFP_LED_WRMODE_MASTER (3) /* yellow */
#define SFP_LED_WRMODE_OFF (4) /* to off entire WRMODE LED */
#define SFP_LED_WRMODE_TX_CALIB (5) /* LPDC Tx calibration */
#define SFP_LED_WRMODE_CALIB (5) /* LPDC calibration */
/* Prototypes */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment