linux/drivers/thunderbolt
Gil Fine 54e418106c thunderbolt: Add debugfs interface
This adds debugfs interface that can be used for debugging possible
issues in hardware/software. It exposes router and adapter config spaces
through files like this:

  /sys/kernel/debug/thunderbolt/<DEVICE>/regs
  /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT1>/regs
  /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT1>/path
  /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT1>/counters
  /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT2>/regs
  /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT2>/path
  /sys/kernel/debug/thunderbolt/<DEVICE>/<PORT2>/counters
  ...

The "regs" is either the router or port configuration space register
dump. The "path" is the port path configuration space and "counters" is
the optional counters configuration space.

These files contains one register per line so it should be easy to use
normal filtering tools to find the registers of interest if needed.

The router and adapter regs file becomes writable when
CONFIG_USB4_DEBUGFS_WRITE is enabled (which is not supposed to be done
in production systems) and in this case the developer can write "offset
value" lines there to modify the hardware directly. For convenience this
also supports the long format the read side produces (but ignores the
additional fields). The counters file can be written even when
CONFIG_USB4_DEBUGFS_WRITE is not enabled and it is only used to clear
the counter values.

Signed-off-by: Gil Fine <gil.fine@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-03 12:21:08 +03:00
..
acpi.c thunderbolt: Create device links from ACPI description 2020-09-03 12:06:42 +03:00
cap.c thunderbolt: Introduce tb_switch_next_cap() 2020-09-03 12:21:07 +03:00
ctl.c thunderbolt: No need to warn in TB_CFG_ERROR_INVALID_CONFIG_SPACE 2020-09-03 12:21:08 +03:00
ctl.h thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
debugfs.c thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
dma_port.c thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
dma_port.h thunderbolt: Convert rest of the driver files to use SPDX identifier 2018-10-02 15:52:08 -07:00
domain.c thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
eeprom.c thunderbolt: Add support for authenticate on disconnect 2020-07-01 13:51:49 +03:00
icm.c thunderbolt: Use bit 31 to check if Firmware CM is running in Tiger Lake 2020-09-03 12:06:40 +03:00
Kconfig thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
lc.c thunderbolt: Enable wakes from system suspend 2020-09-03 12:06:42 +03:00
Makefile thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
nhi_ops.c thunderbolt: Software CM only should set force power in Tiger Lake 2020-09-03 12:06:40 +03:00
nhi_regs.h thunderbolt: Add support for Intel Ice Lake 2019-08-26 12:15:06 +03:00
nhi.c thunderbolt: Create device links from ACPI description 2020-09-03 12:06:42 +03:00
nhi.h thunderbolt: Add support for Intel Tiger Lake 2020-04-23 09:57:59 +03:00
nvm.c thunderbolt: Add support for separating the flush to SPI and authenticate 2020-07-01 13:51:49 +03:00
path.c thunderbolt: Add USB3 bandwidth management 2020-06-22 19:58:20 +03:00
property.c thunderbolt: property: Fix a missing check of kzalloc 2019-03-28 11:30:47 +03:00
quirks.c thunderbolt: Fix old style declaration warning 2020-07-02 14:50:11 +03:00
retimer.c thunderbolt: Add support for on-board retimers 2020-06-22 19:58:32 +03:00
sb_regs.h thunderbolt: Add support for on-board retimers 2020-06-22 19:58:32 +03:00
switch.c thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
tb_msgs.h thunderbolt: Populate PG field in hot plug acknowledgment packet 2019-12-18 15:34:25 +01:00
tb_regs.h thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
tb.c thunderbolt: Add runtime PM for Software CM 2020-09-03 12:06:42 +03:00
tb.h thunderbolt: Add debugfs interface 2020-09-03 12:21:08 +03:00
test.c thunderbolt: merge fix for kunix_resource changes 2020-08-09 11:06:10 -07:00
tmu.c thunderbolt: Add support for Time Management Unit 2019-12-18 15:41:15 +01:00
tunnel.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
tunnel.h thunderbolt: Add USB3 bandwidth management 2020-06-22 19:58:20 +03:00
usb4.c thunderbolt: Enable wakes from system suspend 2020-09-03 12:06:42 +03:00
xdomain.c thunderbolt: Build initial XDomain property block upon first connect 2020-06-22 19:58:05 +03:00