Commit 97539f1e authored by Ariel Elior's avatar Ariel Elior Committed by David S. Miller

bnx2x: FW assertion changes

This is mostly a semantic change which modifies the code parsing and printing
of FW asserts.
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarAriel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58fee00f
...@@ -650,119 +650,98 @@ static void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr, ...@@ -650,119 +650,98 @@ static void bnx2x_write_dmae_phys_len(struct bnx2x *bp, dma_addr_t phys_addr,
bnx2x_write_dmae(bp, phys_addr + offset, addr + offset, len); bnx2x_write_dmae(bp, phys_addr + offset, addr + offset, len);
} }
enum storms {
XSTORM,
TSTORM,
CSTORM,
USTORM,
MAX_STORMS
};
#define STORMS_NUM 4
#define REGS_IN_ENTRY 4
static inline int bnx2x_get_assert_list_entry(struct bnx2x *bp,
enum storms storm,
int entry)
{
switch (storm) {
case XSTORM:
return XSTORM_ASSERT_LIST_OFFSET(entry);
case TSTORM:
return TSTORM_ASSERT_LIST_OFFSET(entry);
case CSTORM:
return CSTORM_ASSERT_LIST_OFFSET(entry);
case USTORM:
return USTORM_ASSERT_LIST_OFFSET(entry);
case MAX_STORMS:
default:
BNX2X_ERR("unknown storm\n");
}
return -EINVAL;
}
static int bnx2x_mc_assert(struct bnx2x *bp) static int bnx2x_mc_assert(struct bnx2x *bp)
{ {
char last_idx; char last_idx;
int i, rc = 0; int i, j, rc = 0;
u32 row0, row1, row2, row3; enum storms storm;
u32 regs[REGS_IN_ENTRY];
u32 bar_storm_intmem[STORMS_NUM] = {
BAR_XSTRORM_INTMEM,
BAR_TSTRORM_INTMEM,
BAR_CSTRORM_INTMEM,
BAR_USTRORM_INTMEM
};
u32 storm_assert_list_index[STORMS_NUM] = {
XSTORM_ASSERT_LIST_INDEX_OFFSET,
TSTORM_ASSERT_LIST_INDEX_OFFSET,
CSTORM_ASSERT_LIST_INDEX_OFFSET,
USTORM_ASSERT_LIST_INDEX_OFFSET
};
char *storms_string[STORMS_NUM] = {
"XSTORM",
"TSTORM",
"CSTORM",
"USTORM"
};
/* XSTORM */ for (storm = XSTORM; storm < MAX_STORMS; storm++) {
last_idx = REG_RD8(bp, BAR_XSTRORM_INTMEM + last_idx = REG_RD8(bp, bar_storm_intmem[storm] +
XSTORM_ASSERT_LIST_INDEX_OFFSET); storm_assert_list_index[storm]);
if (last_idx) if (last_idx)
BNX2X_ERR("XSTORM_ASSERT_LIST_INDEX 0x%x\n", last_idx); BNX2X_ERR("%s_ASSERT_LIST_INDEX 0x%x\n",
storms_string[storm], last_idx);
/* print the asserts */ /* print the asserts */
for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) { for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) {
/* read a single assert entry */
row0 = REG_RD(bp, BAR_XSTRORM_INTMEM + for (j = 0; j < REGS_IN_ENTRY; j++)
XSTORM_ASSERT_LIST_OFFSET(i)); regs[j] = REG_RD(bp, bar_storm_intmem[storm] +
row1 = REG_RD(bp, BAR_XSTRORM_INTMEM + bnx2x_get_assert_list_entry(bp,
XSTORM_ASSERT_LIST_OFFSET(i) + 4); storm,
row2 = REG_RD(bp, BAR_XSTRORM_INTMEM + i) +
XSTORM_ASSERT_LIST_OFFSET(i) + 8); sizeof(u32) * j);
row3 = REG_RD(bp, BAR_XSTRORM_INTMEM +
XSTORM_ASSERT_LIST_OFFSET(i) + 12); /* log entry if it contains a valid assert */
if (regs[0] != COMMON_ASM_INVALID_ASSERT_OPCODE) {
if (row0 != COMMON_ASM_INVALID_ASSERT_OPCODE) { BNX2X_ERR("%s_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n",
BNX2X_ERR("XSTORM_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n", storms_string[storm], i, regs[3],
i, row3, row2, row1, row0); regs[2], regs[1], regs[0]);
rc++; rc++;
} else { } else {
break; break;
} }
} }
/* TSTORM */
last_idx = REG_RD8(bp, BAR_TSTRORM_INTMEM +
TSTORM_ASSERT_LIST_INDEX_OFFSET);
if (last_idx)
BNX2X_ERR("TSTORM_ASSERT_LIST_INDEX 0x%x\n", last_idx);
/* print the asserts */
for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) {
row0 = REG_RD(bp, BAR_TSTRORM_INTMEM +
TSTORM_ASSERT_LIST_OFFSET(i));
row1 = REG_RD(bp, BAR_TSTRORM_INTMEM +
TSTORM_ASSERT_LIST_OFFSET(i) + 4);
row2 = REG_RD(bp, BAR_TSTRORM_INTMEM +
TSTORM_ASSERT_LIST_OFFSET(i) + 8);
row3 = REG_RD(bp, BAR_TSTRORM_INTMEM +
TSTORM_ASSERT_LIST_OFFSET(i) + 12);
if (row0 != COMMON_ASM_INVALID_ASSERT_OPCODE) {
BNX2X_ERR("TSTORM_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n",
i, row3, row2, row1, row0);
rc++;
} else {
break;
}
} }
/* CSTORM */ BNX2X_ERR("Chip Revision: %s, FW Version: %d_%d_%d\n",
last_idx = REG_RD8(bp, BAR_CSTRORM_INTMEM + CHIP_IS_E1(bp) ? "everest1" :
CSTORM_ASSERT_LIST_INDEX_OFFSET); CHIP_IS_E1H(bp) ? "everest1h" :
if (last_idx) CHIP_IS_E2(bp) ? "everest2" : "everest3",
BNX2X_ERR("CSTORM_ASSERT_LIST_INDEX 0x%x\n", last_idx); BCM_5710_FW_MAJOR_VERSION,
BCM_5710_FW_MINOR_VERSION,
/* print the asserts */ BCM_5710_FW_REVISION_VERSION);
for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) {
row0 = REG_RD(bp, BAR_CSTRORM_INTMEM +
CSTORM_ASSERT_LIST_OFFSET(i));
row1 = REG_RD(bp, BAR_CSTRORM_INTMEM +
CSTORM_ASSERT_LIST_OFFSET(i) + 4);
row2 = REG_RD(bp, BAR_CSTRORM_INTMEM +
CSTORM_ASSERT_LIST_OFFSET(i) + 8);
row3 = REG_RD(bp, BAR_CSTRORM_INTMEM +
CSTORM_ASSERT_LIST_OFFSET(i) + 12);
if (row0 != COMMON_ASM_INVALID_ASSERT_OPCODE) {
BNX2X_ERR("CSTORM_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n",
i, row3, row2, row1, row0);
rc++;
} else {
break;
}
}
/* USTORM */
last_idx = REG_RD8(bp, BAR_USTRORM_INTMEM +
USTORM_ASSERT_LIST_INDEX_OFFSET);
if (last_idx)
BNX2X_ERR("USTORM_ASSERT_LIST_INDEX 0x%x\n", last_idx);
/* print the asserts */
for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) {
row0 = REG_RD(bp, BAR_USTRORM_INTMEM +
USTORM_ASSERT_LIST_OFFSET(i));
row1 = REG_RD(bp, BAR_USTRORM_INTMEM +
USTORM_ASSERT_LIST_OFFSET(i) + 4);
row2 = REG_RD(bp, BAR_USTRORM_INTMEM +
USTORM_ASSERT_LIST_OFFSET(i) + 8);
row3 = REG_RD(bp, BAR_USTRORM_INTMEM +
USTORM_ASSERT_LIST_OFFSET(i) + 12);
if (row0 != COMMON_ASM_INVALID_ASSERT_OPCODE) {
BNX2X_ERR("USTORM_ASSERT_INDEX 0x%x = 0x%08x 0x%08x 0x%08x 0x%08x\n",
i, row3, row2, row1, row0);
rc++;
} else {
break;
}
}
return rc; return rc;
} }
......
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