aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2010-01-15 08:31:29 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-16 04:01:52 -0500
commitc89ec8b9de887cda0879d27036fce8d2a2fd6400 (patch)
treeb666d58ef68e09a900d0349fbd27e21c9f3ee31a
parent8aae2600030f54494f9061d2cde141802d774be9 (diff)
qlge: Add probe regs to firmware dump.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/qlge/qlge_dbg.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c
index 1d026141b78d..913ca1e10e3e 100644
--- a/drivers/net/qlge/qlge_dbg.c
+++ b/drivers/net/qlge/qlge_dbg.c
@@ -123,6 +123,53 @@ static int ql_get_mpi_regs(struct ql_adapter *qdev, u32 * buf,
123 return status; 123 return status;
124} 124}
125 125
126/* Read the ASIC probe dump */
127static unsigned int *ql_get_probe(struct ql_adapter *qdev, u32 clock,
128 u32 valid, u32 *buf)
129{
130 u32 module, mux_sel, probe, lo_val, hi_val;
131
132 for (module = 0; module < PRB_MX_ADDR_MAX_MODS; module++) {
133 if (!((valid >> module) & 1))
134 continue;
135 for (mux_sel = 0; mux_sel < PRB_MX_ADDR_MAX_MUX; mux_sel++) {
136 probe = clock
137 | PRB_MX_ADDR_ARE
138 | mux_sel
139 | (module << PRB_MX_ADDR_MOD_SEL_SHIFT);
140 ql_write32(qdev, PRB_MX_ADDR, probe);
141 lo_val = ql_read32(qdev, PRB_MX_DATA);
142 if (mux_sel == 0) {
143 *buf = probe;
144 buf++;
145 }
146 probe |= PRB_MX_ADDR_UP;
147 ql_write32(qdev, PRB_MX_ADDR, probe);
148 hi_val = ql_read32(qdev, PRB_MX_DATA);
149 *buf = lo_val;
150 buf++;
151 *buf = hi_val;
152 buf++;
153 }
154 }
155 return buf;
156}
157
158static int ql_get_probe_dump(struct ql_adapter *qdev, unsigned int *buf)
159{
160 /* First we have to enable the probe mux */
161 ql_write_mpi_reg(qdev, MPI_TEST_FUNC_PRB_CTL, MPI_TEST_FUNC_PRB_EN);
162 buf = ql_get_probe(qdev, PRB_MX_ADDR_SYS_CLOCK,
163 PRB_MX_ADDR_VALID_SYS_MOD, buf);
164 buf = ql_get_probe(qdev, PRB_MX_ADDR_PCI_CLOCK,
165 PRB_MX_ADDR_VALID_PCI_MOD, buf);
166 buf = ql_get_probe(qdev, PRB_MX_ADDR_XGM_CLOCK,
167 PRB_MX_ADDR_VALID_XGM_MOD, buf);
168 buf = ql_get_probe(qdev, PRB_MX_ADDR_FC_CLOCK,
169 PRB_MX_ADDR_VALID_FC_MOD, buf);
170 return 0;
171
172}
126 173
127/* Read out the routing index registers */ 174/* Read out the routing index registers */
128static int ql_get_routing_index_registers(struct ql_adapter *qdev, u32 *buf) 175static int ql_get_routing_index_registers(struct ql_adapter *qdev, u32 *buf)
@@ -558,6 +605,13 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
558 if (status) 605 if (status)
559 goto err; 606 goto err;
560 607
608 ql_build_coredump_seg_header(&mpi_coredump->probe_dump_seg_hdr,
609 PROBE_DUMP_SEG_NUM,
610 sizeof(struct mpi_coredump_segment_header)
611 + sizeof(mpi_coredump->probe_dump),
612 "Probe Dump");
613 ql_get_probe_dump(qdev, &mpi_coredump->probe_dump[0]);
614
561 ql_build_coredump_seg_header(&mpi_coredump->routing_reg_seg_hdr, 615 ql_build_coredump_seg_header(&mpi_coredump->routing_reg_seg_hdr,
562 ROUTING_INDEX_SEG_NUM, 616 ROUTING_INDEX_SEG_NUM,
563 sizeof(struct mpi_coredump_segment_header) 617 sizeof(struct mpi_coredump_segment_header)