Enable USB TEST mode on custom board and kernel

We have a custom board with a customized Linux v4.9 and we want to enable the USB TEST mode for USB 2 and 3. We have followed the instruction of the application note “USB 2.0 Compliance Test Guide (DA0719007)” and enabled some registers on the TK1 but we did not see any activity on both the USB-2.0 and -3.0. We’ve tried the supplied executables but they seem to be build for another kernel version because they want to access some files in the /sys folder which are not available on ours (or differently mapped). Can someone guide me on all the steps necessary to manually enable the USB test mode for both the USB-2.0 and -3.0 controllers? Both USB controllers seems to work fine btw when a device is hooked-up, so they function that is not the problem.

Hi,
below steps are for our kernel, but you’re on customized Linux v4.9, I’m not sure if this can help:

  1. Before test, the power control settings need to be ON in order to prevent USB xHCI controller from going to sleep during the test. From the shell, enter the following commands.
    echo on > /sys/bus/usb/devices/usb1/power/control
    echo on > /sys/bus/usb/devices/usb2/power/control
  2. The compliance registers must be set after USB 3.0 test fixture connected to Tegra, checking registers as below.
    T_XUSB_XHCI_OP_PORTSC[8:5] = Ah (TX)/ 05h (RX)
    T_XUSB_XHCI_EC_DBCAP_DCPORTSC[8:5] =Ah (TX)/ 05h (RX)