1 From 81f75bbf67c7a26ea1266ac93b9319bb985d588d Mon Sep 17 00:00:00 2001
2 From: Eilon Greenstein <eilong@broadcom.com>
3 Date: Thu, 22 Jan 2009 03:37:31 +0000
4 Subject: bnx2x: Reset HW before use
5 Acked-by: Karsten Keil <kkeil@novell.com>
8 To avoid complications, make sure that the HW is in reset (as it should be)
9 before trying to take it out of reset. In normal flows, the HW is indeed in rest
10 so this should have no effect
12 Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
15 drivers/net/bnx2x_main.c | 17 +++++++++--------
16 1 files changed, 9 insertions(+), 8 deletions(-)
18 Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
19 ===================================================================
20 --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c
21 +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
22 @@ -5151,12 +5151,21 @@ static void enable_blocks_attention(stru
26 +static void bnx2x_reset_common(struct bnx2x *bp)
29 + REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
31 + REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
34 static int bnx2x_init_common(struct bnx2x *bp)
38 DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp));
40 + bnx2x_reset_common(bp);
41 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff);
42 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc);
44 @@ -6643,14 +6652,6 @@ static void bnx2x_reset_port(struct bnx2
45 /* TODO: Close Doorbell port? */
48 -static void bnx2x_reset_common(struct bnx2x *bp)
51 - REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
53 - REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
56 static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code)
58 DP(BNX2X_MSG_MCP, "function %d reset_code %x\n",