Hi DaneLLL.
Thank you for your response and script.
I tried run compliance test(TEST_J) with your script.
But test was failed. I wasn’t able to observe TEST_J’s waveform.
So I have two questions.
Question:
- Is your script's control sequence correct?
I compared logs between your script and tegra_hc_port_test_v3_static by code inserted printk statement(see following code diff).
I think the "ClearPortFeature USB_PORT_FEAT_POWER" sequence is lacked in your script from printk's kernel log result.
PORTSC_PLS register was 4 in tegra_hc_port_test_v3_static and 5 in your script.
- Is xhci-hub.c's control correct?
I guess that xhci-hub.c's control target is Intel XHCI controller. I googled "XHCI HOST CONTROLLER"
I found extensible-host-controler-interface-usb-xhci.pdf in Intel's HP.
https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf
I read "4.19.1.1 state machine" and "4.19.6 Port Test Modes" in this document.
I think that the sequence in "4.19.6 Port Test Modes" is not done by "case USB_PORT_FEAT_TEST statement block".
My test enviroment.
Target board : Jetson TX1 Developer Kit
code : L4T Sources 24.2.1 http://developer.nvidia.com/embedded/dlc/l4t-sources-24-2-1
lsusb dump : Insert Transcend’s USB memory in USB3.0 type A port.
Bus 002 Device 002: ID 0955:09ff NVidia Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 1307:0163 Transcend Information, Inc. 256MB/512MB/1GB Flash Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
“code inserted printk statement”
diff --git a/kernel/drivers/usb/host/xhci-hub.c b/kernel/drivers/usb/host/xhci-hub.c
--- a/kernel/drivers/usb/host/xhci-hub.c
+++ b/kernel/drivers/usb/host/xhci-hub.c
@@ -20,6 +20,7 @@
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/init.h>
#include <linux/gfp.h>
#include <asm/unaligned.h>
#include <linux/usb/otg.h>
@@ -555,17 +556,27 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
u16 wake_mask = 0;
u16 timeout = 0;
u16 test_selector = 0;
+ int i;
max_ports = xhci_get_ports(hcd, &port_array);
bus_state = &xhci->bus_state[hcd_index(hcd)];
+ printk("test msg : file %s : typeReq[%x] wValue[%x] wIndex[%x] wLength[%x] buf = [",__func__,typeReq,wValue,wIndex,wLength);
+ for(i=0;i < wLength ; i++)
+ {
+ printk("%x ",buf[i]);
+ }
+ printk("]\n");
+
@@ -931,11 +954,18 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
if (xhci_halt(xhci))
goto error;
+ temp = xhci_readl(xhci, port_array[wIndex]);
+ printk("test msg Before PORTSC [%x], index [%x] \n",temp,wIndex );
/* Start test mode in PORTPMSC */
temp = xhci_readl(xhci, port_array[wIndex] + 1);
temp = xhci_port_state_to_neutral(temp);
+ test_selector = 0x04;
temp |= test_selector << 28;
xhci_writel(xhci, temp, port_array[wIndex] + 1);
+
+ temp = xhci_readl(xhci, port_array[wIndex]);
+ printk("test msg After PORTSC [%x], index [%x] \n",temp,wIndex );
+ temp = xhci_readl(xhci, port_array[wIndex]+1);
+ printk("test msg PORTPMSC [%x] \n",temp);
break;
" tegra_hc_port_test_v3_static log " I confirmed test packet waveform with oscilloscope.
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[1] wLength[4] buf = [20 79 40 ad ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[2] wLength[4] buf = [20 79 40 ad ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [20 79 40 ad ]
test msg : file xhci_hub_control : typeReq[2301] wValue[10] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[4] wLength[4] buf = [20 79 40 ad ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[5] wLength[4] buf = [20 79 40 ad ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [10 fb cb fd ]
test msg : file xhci_hub_control : typeReq[2303] wValue[4] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [f0 f8 cb fd ]
test msg : file xhci_hub_control : typeReq[2301] wValue[14] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[2301] wValue[8] wIndex[2] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[2303] wValue[15] wIndex[402] wLength[0] buf = []
test msg SetPortFeature USB_PORT_FEAT_TEST
test msg Before PORTSC [80], index [1]
test msg After PORTSC [80], index [1]
test msg PORTPMSC [0]
test msg : file xhci_hub_control : typeReq[2303] wValue[4] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [50 f8 25 ef ]
test msg : file xhci_hub_control : typeReq[2301] wValue[14] wIndex[3] wLength[0] buf = []
“your script log”
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[1] wLength[4] buf = [20 79 20 fe ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[2] wLength[4] buf = [20 79 20 fe ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [20 79 20 fe ]
test msg : file xhci_hub_control : typeReq[2301] wValue[10] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[4] wLength[4] buf = [20 79 20 fe ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[5] wLength[4] buf = [20 79 20 fe ]
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [10 fb cb fd ]
test msg : file xhci_hub_control : typeReq[2303] wValue[4] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [f0 f8 cb fd ]
test msg : file xhci_hub_control : typeReq[2301] wValue[14] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a006] wValue[2900] wIndex[0] wLength[f] buf = [d0 7c 65 ef c0 ff ff ff 64 43 65 0 c0 ff ff ]
test msg : file xhci_hub_control : typeReq[2303] wValue[15] wIndex[102] wLength[0] buf = []
test msg SetPortFeature USB_PORT_FEAT_TEST
test msg Before PORTSC [2a0], index [1]
test msg After PORTSC [2a0], index [1]
test msg PORTPMSC [f0000000]
test msg : file xhci_hub_control : typeReq[2303] wValue[4] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[a300] wValue[0] wIndex[3] wLength[4] buf = [50 38 ba b0 ]
test msg : file xhci_hub_control : typeReq[2301] wValue[14] wIndex[3] wLength[0] buf = []
test msg : file xhci_hub_control : typeReq[2301] wValue[1] wIndex[3] wLength[0] buf = []