Commit 81f75bbf authored by Eilon Greenstein's avatar Eilon Greenstein Committed by David S. Miller

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: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 637f8837
...@@ -5148,12 +5148,21 @@ static void enable_blocks_attention(struct bnx2x *bp) ...@@ -5148,12 +5148,21 @@ static void enable_blocks_attention(struct bnx2x *bp)
} }
static void bnx2x_reset_common(struct bnx2x *bp)
{
/* reset_common */
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
0xd3ffff7f);
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
}
static int bnx2x_init_common(struct bnx2x *bp) static int bnx2x_init_common(struct bnx2x *bp)
{ {
u32 val, i; u32 val, i;
DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp)); DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp));
bnx2x_reset_common(bp);
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff);
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc); REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc);
...@@ -6640,14 +6649,6 @@ static void bnx2x_reset_port(struct bnx2x *bp) ...@@ -6640,14 +6649,6 @@ static void bnx2x_reset_port(struct bnx2x *bp)
/* TODO: Close Doorbell port? */ /* TODO: Close Doorbell port? */
} }
static void bnx2x_reset_common(struct bnx2x *bp)
{
/* reset_common */
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
0xd3ffff7f);
REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
}
static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code) static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code)
{ {
DP(BNX2X_MSG_MCP, "function %d reset_code %x\n", DP(BNX2X_MSG_MCP, "function %d reset_code %x\n",
......
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