USB眼圖


/**********************************************************************
 *                            USB眼圖
 * 說明:
 *     對於USB眼圖,並不是很清楚這種硬件特性,USB控制器一般本身自帶測試
 * 模式,所以只需要修改寄存器來發送對應的測試包就行了。USB Hub可以用usb-tools。
 *
 *                                2018-7-11 深圳 寶安西鄉 曾劍鋒
 *********************************************************************/

一、參考文檔:
    1. USB 眼圖測試
        https://community.nxp.com/thread/357113
    2. The solution for the USB test
        https://community.nxp.com/thread/321605
    3. i.MX6Q/eye pattern of USB HS1 setup
        https://community.nxp.com/thread/383925
    4. I.MX6 series USB Certification Guides
        https://community.nxp.com/docs/DOC-105609
    5. 65.6 USB Core Memory Map/Register Definition
6. https://github.com/felipebalbi/usb-tools
7. USB HOST TEST MODE
http://eagerhsu.blogspot.com/2012/07/usb-host-test-mode.html
8. USB High Speed Electrical Test
https://github.com/MicrochipTech/USB-Hub-Linux-Examples/tree/master/General%20USB%20Examples/USB%20High%20Speed%20Electrical%20Test
二、原理說明: The USB controller is compliant with the EHCI specification. The test modes are set by the PTC bits in the PORTSC register (bits 19-16). 三、USB_nPORTSC1 field descriptions

四、測試示例:
    memtool 0x2184184 1               //read the register settings, address of the other USB port is 0x2184384
    memtool 0x2184184=0x18441205      // Force to output Test Packet for Eye Diagram Test  
    memtool 0x2184184=0x18411205      //Force to output J_STATE
    memtool 0x2184184=0x18421205      // Force to output K_STATE
    memtool 0x2184184=0x18431205      // Force to output SE0 (host) / NAK (device)
    memtool 0x2184384=0x18001305      // Force to output Reset
    memtool 0x2184384=0x18001285      //Ho Force to output Suspend
    memtool 0x2184384=0x18001245      // Force to output Resume

五、PORTSCn地址信息:
    | Absolute |
    | address  |                                         | Width     |
    | (hex)    | Register name                           | (in bits) | Access Reset value
    +----------+-----------------------------------------+-----------+-------------------
    | 218_4184 | Port Status & Control (USB_UOG_PORTSC1) |  32       | R/W    1000_0000h
    +----------+-----------------------------------------+-----------+-------------------
    | 218_4384 | Port Status & Control (USB_UH1_PORTSC1) |  32       | R/W    1000_0000h
    +----------+-----------------------------------------+-----------+-------------------
    | 218_4584 | Port Status & Control (USB_UH2_PORTSC1) |  32       | R/W    1000_0000h
    +----------+-----------------------------------------+-----------+-------------------
    | 218_4784 | Port Status & Control (USB_UH3_PORTSC1) |  32       | R/W    1000_0000h

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM