bnx2x: Fix LED blink rate for 578xx
authorYaniv Rosner <yanivr@broadcom.com>
Thu, 27 Oct 2011 05:09:45 +0000 (05:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Oct 2011 20:14:14 +0000 (16:14 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c

index 818723c9e6783aa97b6e2340cd84c7ab44578cfa..edc9259f4be51d6be6b6383908a234b01cb409b6 100644 (file)
@@ -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               */
 /***********************************************************/
@@ -5954,8 +5957,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);