@@ -71,6 +71,31 @@ static const struct file_operations fw_regs_fops = {
71
71
.llseek = no_llseek ,
72
72
};
73
73
74
+ static ssize_t debug_window_read (struct file * file , char __user * to , size_t count , loff_t * ppos )
75
+ {
76
+ struct avs_dev * adev = file -> private_data ;
77
+ size_t size ;
78
+ char * buf ;
79
+ int ret ;
80
+
81
+ size = adev -> hw_cfg .dsp_cores * AVS_WINDOW_CHUNK_SIZE ;
82
+ buf = kzalloc (size , GFP_KERNEL );
83
+ if (!buf )
84
+ return - ENOMEM ;
85
+
86
+ memcpy_fromio (buf , avs_sram_addr (adev , AVS_DEBUG_WINDOW ), size );
87
+
88
+ ret = simple_read_from_buffer (to , count , ppos , buf , size );
89
+ kfree (buf );
90
+ return ret ;
91
+ }
92
+
93
+ static const struct file_operations debug_window_fops = {
94
+ .open = simple_open ,
95
+ .read = debug_window_read ,
96
+ .llseek = no_llseek ,
97
+ };
98
+
74
99
static ssize_t probe_points_read (struct file * file , char __user * to , size_t count , loff_t * ppos )
75
100
{
76
101
struct avs_dev * adev = file -> private_data ;
@@ -393,6 +418,7 @@ void avs_debugfs_init(struct avs_dev *adev)
393
418
debugfs_create_file ("strace" , 0444 , adev -> debugfs_root , adev , & strace_fops );
394
419
debugfs_create_file ("trace_control" , 0644 , adev -> debugfs_root , adev , & trace_control_fops );
395
420
debugfs_create_file ("fw_regs" , 0444 , adev -> debugfs_root , adev , & fw_regs_fops );
421
+ debugfs_create_file ("debug_window" , 0444 , adev -> debugfs_root , adev , & debug_window_fops );
396
422
397
423
debugfs_create_u32 ("trace_aging_period" , 0644 , adev -> debugfs_root ,
398
424
& adev -> aging_timer_period );
0 commit comments