Skip to content

Commit 306f4b3

Browse files
committed
Linux driver update to support FW debug enhancements.
[Why] DRAM logging support is required to enhance FW debugging. [What] Add log info to iomapped DRAM buffer from FW, read at driver side on FW triggered interrupts. Signed-off-by: vinit shukla <[email protected]>
1 parent 8a7084d commit 306f4b3

File tree

7 files changed

+526
-0
lines changed

7 files changed

+526
-0
lines changed

src/driver/amdxdna/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ amdxdna-y := \
3333
aie2_error.o \
3434
aie2_debugfs.o \
3535
aie2_message.o \
36+
aie2_logging.o \
3637
aie2_event_trace.o \
3738
aie2_ctx_runqueue.o \
3839
aie2_pm.o \

src/driver/amdxdna/aie2_debugfs.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,39 @@ static int aie2_event_trace_show(struct seq_file *m, void *unused)
296296

297297
AIE2_DBGFS_FOPS(event_trace, aie2_event_trace_show, aie2_event_trace_write);
298298

299+
static ssize_t aie2_dram_logging_write(struct file *file, const char __user *ptr,
300+
size_t len, loff_t *off)
301+
{
302+
struct amdxdna_dev_hdl *ndev = file_to_ndev_rw(file);
303+
bool state;
304+
int ret;
305+
306+
ret = kstrtobool_from_user(ptr, len, &state);
307+
if (ret) {
308+
XDNA_ERR(ndev->xdna, "Invalid input value: %d", state);
309+
return ret;
310+
}
311+
312+
aie2_assign_dram_logging_state(ndev, state);
313+
314+
return len;
315+
}
316+
317+
static int aie2_dram_logging_show(struct seq_file *m, void *unused)
318+
{
319+
struct amdxdna_dev_hdl *ndev = m->private;
320+
321+
if (aie2_is_dram_logging_enable(ndev))
322+
seq_puts(m, "Dram logging is enabled\n");
323+
else
324+
seq_puts(m, "Dram logging is disabled\n"
325+
"echo 1 > To enable logging\n");
326+
327+
return 0;
328+
}
329+
330+
AIE2_DBGFS_FOPS(dram_logging, aie2_dram_logging_show, aie2_dram_logging_write);
331+
299332
static int test_case01(struct amdxdna_dev_hdl *ndev)
300333
{
301334
int ret;
@@ -617,6 +650,7 @@ const struct {
617650
AIE2_DBGFS_FILE(telemetry_debug, 0400),
618651
AIE2_DBGFS_FILE(event_trace, 0600),
619652
AIE2_DBGFS_FILE(ctx_rq, 0400),
653+
AIE2_DBGFS_FILE(dram_logging, 0600),
620654
};
621655

622656
void aie2_debugfs_init(struct amdxdna_dev *xdna)

0 commit comments

Comments
 (0)