aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-01-21 22:37:31 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-22 16:45:05 -0500
commit81f75bbf67c7a26ea1266ac93b9319bb985d588d (patch)
tree29bc0801b3ffab742ed0d02e637988bab605db53 /drivers
parent637f883739b32746889a191f282c9ea2590ecf4f (diff)
bnx2x: Reset HW before use
To avoid complications, make sure that the HW is in reset (as it should be) before trying to take it out of reset. In normal flows, the HW is indeed in rest so this should have no effect Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bnx2x_main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 074374ff93f3..ed8b34665931 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -5148,12 +5148,21 @@ static void enable_blocks_attention(struct bnx2x *bp)
5148} 5148}
5149 5149
5150 5150
5151static void bnx2x_reset_common(struct bnx2x *bp)
5152{
5153 /* reset_common */
5154 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
5155 0xd3ffff7f);
5156 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
5157}
5158
5151static int bnx2x_init_common(struct bnx2x *bp) 5159static int bnx2x_init_common(struct bnx2x *bp)
5152{ 5160{
5153 u32 val, i; 5161 u32 val, i;
5154 5162
5155 DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp)); 5163 DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp));
5156 5164
5165 bnx2x_reset_common(bp);
5157 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); 5166 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff);
5158 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc); 5167 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc);
5159 5168
@@ -6640,14 +6649,6 @@ static void bnx2x_reset_port(struct bnx2x *bp)
6640 /* TODO: Close Doorbell port? */ 6649 /* TODO: Close Doorbell port? */
6641} 6650}
6642 6651
6643static void bnx2x_reset_common(struct bnx2x *bp)
6644{
6645 /* reset_common */
6646 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
6647 0xd3ffff7f);
6648 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
6649}
6650
6651static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code) 6652static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code)
6652{ 6653{
6653 DP(BNX2X_MSG_MCP, "function %d reset_code %x\n", 6654 DP(BNX2X_MSG_MCP, "function %d reset_code %x\n",