cxgb4: Enable cim_la dump to support T6
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
df459ebc33
commit
b7660642b7
|
@ -151,6 +151,45 @@ static int cim_la_show_3in1(struct seq_file *seq, void *v, int idx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cim_la_show_t6(struct seq_file *seq, void *v, int idx)
|
||||
{
|
||||
if (v == SEQ_START_TOKEN) {
|
||||
seq_puts(seq, "Status Inst Data PC LS0Stat "
|
||||
"LS0Addr LS0Data LS1Stat LS1Addr LS1Data\n");
|
||||
} else {
|
||||
const u32 *p = v;
|
||||
|
||||
seq_printf(seq, " %02x %04x%04x %04x%04x %04x%04x %08x %08x %08x %08x %08x %08x\n",
|
||||
(p[9] >> 16) & 0xff, /* Status */
|
||||
p[9] & 0xffff, p[8] >> 16, /* Inst */
|
||||
p[8] & 0xffff, p[7] >> 16, /* Data */
|
||||
p[7] & 0xffff, p[6] >> 16, /* PC */
|
||||
p[2], p[1], p[0], /* LS0 Stat, Addr and Data */
|
||||
p[5], p[4], p[3]); /* LS1 Stat, Addr and Data */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cim_la_show_pc_t6(struct seq_file *seq, void *v, int idx)
|
||||
{
|
||||
if (v == SEQ_START_TOKEN) {
|
||||
seq_puts(seq, "Status Inst Data PC\n");
|
||||
} else {
|
||||
const u32 *p = v;
|
||||
|
||||
seq_printf(seq, " %02x %08x %08x %08x\n",
|
||||
p[3] & 0xff, p[2], p[1], p[0]);
|
||||
seq_printf(seq, " %02x %02x%06x %02x%06x %02x%06x\n",
|
||||
(p[6] >> 8) & 0xff, p[6] & 0xff, p[5] >> 8,
|
||||
p[5] & 0xff, p[4] >> 8, p[4] & 0xff, p[3] >> 8);
|
||||
seq_printf(seq, " %02x %04x%04x %04x%04x %04x%04x\n",
|
||||
(p[9] >> 16) & 0xff, p[9] & 0xffff, p[8] >> 16,
|
||||
p[8] & 0xffff, p[7] >> 16, p[7] & 0xffff,
|
||||
p[6] >> 16);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cim_la_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int ret;
|
||||
|
@ -162,9 +201,18 @@ static int cim_la_open(struct inode *inode, struct file *file)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
p = seq_open_tab(file, adap->params.cim_la_size / 8, 8 * sizeof(u32), 1,
|
||||
cfg & UPDBGLACAPTPCONLY_F ?
|
||||
cim_la_show_3in1 : cim_la_show);
|
||||
if (is_t6(adap->params.chip)) {
|
||||
/* +1 to account for integer division of CIMLA_SIZE/10 */
|
||||
p = seq_open_tab(file, (adap->params.cim_la_size / 10) + 1,
|
||||
10 * sizeof(u32), 1,
|
||||
cfg & UPDBGLACAPTPCONLY_F ?
|
||||
cim_la_show_pc_t6 : cim_la_show_t6);
|
||||
} else {
|
||||
p = seq_open_tab(file, adap->params.cim_la_size / 8,
|
||||
8 * sizeof(u32), 1,
|
||||
cfg & UPDBGLACAPTPCONLY_F ? cim_la_show_3in1 :
|
||||
cim_la_show);
|
||||
}
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in New Issue