@@ -3276,6 +3276,66 @@ static int udma_setup_resources(struct udma_dev *ud)
3276
3276
return ch_count ;
3277
3277
}
3278
3278
3279
+ #ifdef CONFIG_DEBUG_FS
3280
+ static void udma_dbg_summary_show_chan (struct seq_file * s ,
3281
+ struct dma_chan * chan )
3282
+ {
3283
+ struct udma_chan * uc = to_udma_chan (chan );
3284
+ struct udma_chan_config * ucc = & uc -> config ;
3285
+
3286
+ seq_printf (s , " %-13s| %s" , dma_chan_name (chan ),
3287
+ chan -> dbg_client_name ?: "in-use" );
3288
+ seq_printf (s , " (%s, " , dmaengine_get_direction_text (uc -> config .dir ));
3289
+
3290
+ switch (uc -> config .dir ) {
3291
+ case DMA_MEM_TO_MEM :
3292
+ seq_printf (s , "chan%d pair [0x%04x -> 0x%04x], " , uc -> tchan -> id ,
3293
+ ucc -> src_thread , ucc -> dst_thread );
3294
+ break ;
3295
+ case DMA_DEV_TO_MEM :
3296
+ seq_printf (s , "rchan%d [0x%04x -> 0x%04x], " , uc -> rchan -> id ,
3297
+ ucc -> src_thread , ucc -> dst_thread );
3298
+ break ;
3299
+ case DMA_MEM_TO_DEV :
3300
+ seq_printf (s , "tchan%d [0x%04x -> 0x%04x], " , uc -> tchan -> id ,
3301
+ ucc -> src_thread , ucc -> dst_thread );
3302
+ break ;
3303
+ default :
3304
+ seq_printf (s , ")\n" );
3305
+ return ;
3306
+ }
3307
+
3308
+ if (ucc -> ep_type == PSIL_EP_NATIVE ) {
3309
+ seq_printf (s , "PSI-L Native" );
3310
+ if (ucc -> metadata_size ) {
3311
+ seq_printf (s , "[%s" , ucc -> needs_epib ? " EPIB" : "" );
3312
+ if (ucc -> psd_size )
3313
+ seq_printf (s , " PSDsize:%u" , ucc -> psd_size );
3314
+ seq_printf (s , " ]" );
3315
+ }
3316
+ } else {
3317
+ seq_printf (s , "PDMA" );
3318
+ if (ucc -> enable_acc32 || ucc -> enable_burst )
3319
+ seq_printf (s , "[%s%s ]" ,
3320
+ ucc -> enable_acc32 ? " ACC32" : "" ,
3321
+ ucc -> enable_burst ? " BURST" : "" );
3322
+ }
3323
+
3324
+ seq_printf (s , ", %s)\n" , ucc -> pkt_mode ? "Packet mode" : "TR mode" );
3325
+ }
3326
+
3327
+ static void udma_dbg_summary_show (struct seq_file * s ,
3328
+ struct dma_device * dma_dev )
3329
+ {
3330
+ struct dma_chan * chan ;
3331
+
3332
+ list_for_each_entry (chan , & dma_dev -> channels , device_node ) {
3333
+ if (chan -> client_count )
3334
+ udma_dbg_summary_show_chan (s , chan );
3335
+ }
3336
+ }
3337
+ #endif /* CONFIG_DEBUG_FS */
3338
+
3279
3339
#define TI_UDMAC_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \
3280
3340
BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \
3281
3341
BIT(DMA_SLAVE_BUSWIDTH_3_BYTES) | \
@@ -3362,6 +3422,9 @@ static int udma_probe(struct platform_device *pdev)
3362
3422
ud -> ddev .device_resume = udma_resume ;
3363
3423
ud -> ddev .device_terminate_all = udma_terminate_all ;
3364
3424
ud -> ddev .device_synchronize = udma_synchronize ;
3425
+ #ifdef CONFIG_DEBUG_FS
3426
+ ud -> ddev .dbg_summary_show = udma_dbg_summary_show ;
3427
+ #endif
3365
3428
3366
3429
ud -> ddev .device_free_chan_resources = udma_free_chan_resources ;
3367
3430
ud -> ddev .src_addr_widths = TI_UDMAC_BUSWIDTHS ;
0 commit comments