thunderbolt: Expose router DROM through debugfs
Subsystems (2)
PATCH 1/1 thunderbolt: Expose router DROM through debugfs
Router DROM contains information that might be usable for development and debugging purposes. For example when new entries are added to the USB4 spec it is useful to be able to look for them without need to change the kernel.
For this reason expose the DROM through debugfs.
Signed-off-by Mika Westerberg <[email protected]>
--- drivers/thunderbolt/debugfs.c | 2 + drivers/thunderbolt/eeprom.c | 78 ++++++++++++++++++++--------------- drivers/thunderbolt/tb.h | 5 +++ 3 files changed, 51 insertions(+), 34 deletions(-)
drivers/thunderbolt/debugfs.c +2 -0
@@ -2413,6 +2413,8 @@ void tb_switch_debugfs_init(struct tb_switch *sw) sw->debugfs_dir = debugfs_dir;debugfs_create_file ("regs" ,DEBUGFS_MODE , debugfs_dir, sw, &switch_regs_fops); +if (sw->drom) +debugfs_create_blob ("drom" ,0400 , debugfs_dir, &sw->drom_blob);tb_switch_for_each_port (sw, port) {struct dentry *debugfs_dir;
drivers/thunderbolt/eeprom.c +44 -34
134 lines not on this page · raw message
drivers/thunderbolt/tb.h +5 -0
@@ -9,6 +9,7 @@#ifndef TB_H_ #define TB_H_ +#include <linux/debugfs.h> #include <linux/nvmem-provider.h> #include <linux/pci.h> #include <linux/thunderbolt.h>
@@ -160,6 +161,7 @@ struct tb_switch_tmu {* @max_pcie_credits: Router preferred number of buffers for PCIe * @max_dma_credits: Router preferred number of buffers for DMA/P2P * @clx: CLx states on the upstream link of the router +* @drom_blob: DROM debugfs blob wrapper * * When the switch is being added or removed to the domain (other * switches) you need to have domain lock held.
@@ -212,6 +214,9 @@ struct tb_switch {unsigned int max_pcie_credits;unsigned int max_dma_credits;unsigned int clx; +#ifdef CONFIG_DEBUG_FS +struct debugfs_blob_wrapper drom_blob; +#endif };/**
Signature · 1 line
2.45.2
Mika Westerberg
AppliedQuoted 8 lines · Mika Westerberg
Router DROM contains information that might be usable for development and debugging purposes. For example when new entries are added to the USB4 spec it is useful to be able to look for them without need to change the kernel.
For this reason expose the DROM through debugfs.
Signed-off-by Mika Westerberg <[email protected]>
Applied to thunderbolt.git/next.