Patchwork [net,1/7] bnx2x: Fix LED blink rate for 578xx

login
register
mail settings
Submitter Yaniv Rosner
Date Oct. 26, 2011, 9:40 a.m.
Message ID <1319622039-10553-2-git-send-email-yanivr@broadcom.com>
Download mbox | patch
Permalink /patch/121839/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Yaniv Rosner - Oct. 26, 2011, 9:40 a.m.
Adjust blink rate on 578xx to fit its clock rate.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x/bnx2x_link.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
index ba15bdc..5777dcd 100644
--- a/drivers/net/bnx2x/bnx2x_link.c
+++ b/drivers/net/bnx2x/bnx2x_link.c
@@ -45,6 +45,9 @@ 
 #define MCPR_IMC_COMMAND_READ_OP	1
 #define MCPR_IMC_COMMAND_WRITE_OP	2
 
+/* LED Blink rate that will achieve ~15.9Hz */
+#define LED_BLINK_RATE_VAL_E3		354
+#define LED_BLINK_RATE_VAL_E1X_E2	480
 /***********************************************************/
 /*			Shortcut definitions		   */
 /***********************************************************/
@@ -5953,8 +5956,12 @@  int bnx2x_set_led(struct link_params *params,
 
 		REG_WR(bp, NIG_REG_LED_CONTROL_OVERRIDE_TRAFFIC_P0 + port*4, 0);
 		/* Set blinking rate to ~15.9Hz */
-		REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_P0 + port*4,
-		       LED_BLINK_RATE_VAL);
+		if (CHIP_IS_E3(bp))
+			REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_P0 + port*4,
+			       LED_BLINK_RATE_VAL_E3);
+		else
+			REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_P0 + port*4,
+			       LED_BLINK_RATE_VAL_E1X_E2);
 		REG_WR(bp, NIG_REG_LED_CONTROL_BLINK_RATE_ENA_P0 +
 		       port*4, 1);
 		tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED);