diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2011-06-13 21:33:25 -0400 |
---|---|---|
committer | David S. Miller <davem@conan.davemloft.net> | 2011-06-15 10:56:14 -0400 |
commit | 7a25cc7315e4d846cebbecd31bc4d79e7d2d6db3 (patch) | |
tree | de12b07dc43283ff94f29774a13a0f16bd5c0c94 /drivers/net/bnx2x/bnx2x_main.c | |
parent | 361c391e2339eb8d479feec9042ec6e822593350 (diff) |
bnx2x: dump FW memory when appropriate msglvl is raised
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 2b4b376a69fb..3c06b1400397 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -833,9 +833,9 @@ static int bnx2x_mc_assert(struct bnx2x *bp) | |||
833 | return rc; | 833 | return rc; |
834 | } | 834 | } |
835 | 835 | ||
836 | static void bnx2x_fw_dump(struct bnx2x *bp) | 836 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) |
837 | { | 837 | { |
838 | u32 addr; | 838 | u32 addr, val; |
839 | u32 mark, offset; | 839 | u32 mark, offset; |
840 | __be32 data[9]; | 840 | __be32 data[9]; |
841 | int word; | 841 | int word; |
@@ -844,6 +844,14 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
844 | BNX2X_ERR("NO MCP - can not dump\n"); | 844 | BNX2X_ERR("NO MCP - can not dump\n"); |
845 | return; | 845 | return; |
846 | } | 846 | } |
847 | netdev_printk(lvl, bp->dev, "bc %d.%d.%d\n", | ||
848 | (bp->common.bc_ver & 0xff0000) >> 16, | ||
849 | (bp->common.bc_ver & 0xff00) >> 8, | ||
850 | (bp->common.bc_ver & 0xff)); | ||
851 | |||
852 | val = REG_RD(bp, MCP_REG_MCPR_CPU_PROGRAM_COUNTER); | ||
853 | if (val == REG_RD(bp, MCP_REG_MCPR_CPU_PROGRAM_COUNTER)) | ||
854 | printk("%s" "MCP PC at 0x%x\n", lvl, val); | ||
847 | 855 | ||
848 | if (BP_PATH(bp) == 0) | 856 | if (BP_PATH(bp) == 0) |
849 | trace_shmem_base = bp->common.shmem_base; | 857 | trace_shmem_base = bp->common.shmem_base; |
@@ -853,9 +861,9 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
853 | mark = REG_RD(bp, addr); | 861 | mark = REG_RD(bp, addr); |
854 | mark = (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) | 862 | mark = (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) |
855 | + ((mark + 0x3) & ~0x3) - 0x08000000; | 863 | + ((mark + 0x3) & ~0x3) - 0x08000000; |
856 | pr_err("begin fw dump (mark 0x%x)\n", mark); | 864 | printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); |
857 | 865 | ||
858 | pr_err(""); | 866 | printk("%s", lvl); |
859 | for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) { | 867 | for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) { |
860 | for (word = 0; word < 8; word++) | 868 | for (word = 0; word < 8; word++) |
861 | data[word] = htonl(REG_RD(bp, offset + 4*word)); | 869 | data[word] = htonl(REG_RD(bp, offset + 4*word)); |
@@ -868,7 +876,12 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
868 | data[8] = 0x0; | 876 | data[8] = 0x0; |
869 | pr_cont("%s", (char *)data); | 877 | pr_cont("%s", (char *)data); |
870 | } | 878 | } |
871 | pr_err("end of fw dump\n"); | 879 | printk("%s" "end of fw dump\n", lvl); |
880 | } | ||
881 | |||
882 | static inline void bnx2x_fw_dump(struct bnx2x *bp) | ||
883 | { | ||
884 | bnx2x_fw_dump_lvl(bp, KERN_ERR); | ||
872 | } | 885 | } |
873 | 886 | ||
874 | void bnx2x_panic_dump(struct bnx2x *bp) | 887 | void bnx2x_panic_dump(struct bnx2x *bp) |