Search code examples
armusbu-boot

Newish U-Boot on Rockchip RK3588 fails to detect USB keyboard


This is another question in a series with my previous ones about the Rockchip RK3588 and preparing a custom, more up-to-date U-Boot version (based off one from this year, 2023) for it that I was first interested in getting video working on, and now I'm moving on to USB after discovering that the video system does mostly work, it just apparently did not like my other monitor, perhaps because it was not a "true" HDMI monitor but adapted via a DVI->HDMI connection; that is not relevant to this post, just contextualizing details.

For those who have not seen the previous post, I am using this Rockchip SoC as given on a "Firefly ITX-3588J" board, which is built in a Mini-ITX form factor and has four USB ports on the back, together with a strange single USB port sticking up vertically off the board in a position that is internal to the case. When I connect a USB keyboard to any of the four back ports, it fails to be detected, but connecting it to the single internal port works. The following is the U-Boot output with "#define DEBUG" enabled at several source files related to USB and with the keyboard attached to one of the four back ports. And yes, I've added as many apparently relevant device tree entries as I could seem to find from the BSP provided trees.

Bus usb@fc840000: USB OHCI 1.0                                                  
Bus usb@fc8c0000: USB OHCI 1.0                                                  
scanning bus usb@fc840000 for devices...                                        
Calling usb_setup_device(), portnr=0                                            
 - Setting up device usb@fc840000...                                            
read_descriptor for 'usb@fc840000': ret=0                                       
** usb_find_child returns -2                                                    
usb_find_and_bind_driver: Searching for driver                                  
usb_find_and_bind_driver: Match found: usb_hub                                  
usb_scan_device: Probing 'usb_hub', plat=00000000eb507c90                       
usb_hub_post_probe                                                              
1 ports detected                                                                
ganged power switching                                                          
standalone hub                                                                  
no over-current protection                                                      
power on to power good time: 4ms                                                
hub controller current requirement: 0mA                                         
port 1 is removable                                                             
get_hub_status returned status 0, change 0                                      
local power source is good                                                      
no over-current condition exists                                                
enabling power on all ports                                                     
port 1 returns 0                                                                
pgood_delay=4ms                                                                 
devnum=1 poweron: query_delay=100 connect_timeout=3100                          
 dev->maxchild = 1                                                              
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
 (... lots of spew elided ...)                                   
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
devnum=1 port=1: timeout                                                        
1 USB Device(s) found                                                           
scanning bus usb@fc8c0000 for devices...                                        
Calling usb_setup_device(), portnr=0                                            
 - Setting up device usb@fc8c0000...                                            
read_descriptor for 'usb@fc8c0000': ret=0                                       
** usb_find_child returns -2                                                    
usb_find_and_bind_driver: Searching for driver                                  
usb_find_and_bind_driver: Match found: usb_hub                                  
usb_scan_device: Probing 'usb_hub', plat=00000000eb515e70                       
usb_hub_post_probe                                                              
1 ports detected                                                                
ganged power switching                                                          
standalone hub                                                                  
no over-current protection                                                      
power on to power good time: 4ms                                                
hub controller current requirement: 0mA                                         
port 1 is removable                                                             
get_hub_status returned status 0, change 0                                      
local power source is good                                                      
no over-current condition exists                                                
enabling power on all ports                                                     
port 1 returns 0                                                                
pgood_delay=4ms                                                                 
devnum=1 poweron: query_delay=100 connect_timeout=3100                          
 dev->maxchild = 1                                                              
Port 1 Status 101 Change 1                                                      
devnum=1 port=1: USB dev found                                                  
portstatus 101, change 1, 12 Mb/s                                               
usb_hub_port_reset: resetting 'usb_hub' port 1...                               
portstatus 103, change 10, 12 Mb/s                                              
STAT_C_CONNECTION = 0 STAT_CONNECTION = 1  USB_PORT_STAT_ENABLE 1               
Calling usb_setup_device(), portnr=1                                            
 - Setting up device usb_hub...                                                 
read_descriptor for 'usb_hub': ret=0                                            
** usb_find_child returns -2                                                    
usb_find_and_bind_driver: Searching for driver                                  
usb_find_and_bind_driver: Match found: usb_hub                                  
usb_scan_device: Probing 'usb_hub', plat=00000000eb5173b0                       
usb_hub_post_probe                                                              
4 ports detected                                                                
ganged power switching                                                          
standalone hub                                                                  
global over-current protection                                                  
power on to power good time: 100ms                                              
hub controller current requirement: 100mA                                       
port 1 is removable                                                             
port 2 is removable                                                             
port 3 is removable                                                             
port 4 is removable                                                             
get_hub_status returned status 0, change 0                                      
local power source is good                                                      
no over-current condition exists                                                
enabling power on all ports                                                     
port 1 returns 0                                                                
port 2 returns 0                                                                
port 3 returns 0                                                                
port 4 returns 0                                                                
pgood_delay=100ms                                                               
devnum=2 poweron: query_delay=100 connect_timeout=3100                          
 dev->maxchild = 4                                                              
Port 3 Status 100 Change 0                                                      
Port 4 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 2 Status 100 Change 0                                                      
Port 3 Status 100 Change 0                                                      
Port 4 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 2 Status 100 Change 0                                                      
Port 3 Status 100 Change 0                                                      
Port 4 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 2 Status 100 Change 0                                                      
Port 3 Status 100 Change 0                                                      
Port 4 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 2 Status 100 Change 0                                                      
Port 3 Status 100 Change 0                                                      
Port 4 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 2 Status 100 Change 0                                                      
 (... lots of spew elided ...)                                             
Port 2 Status 100 Change 0                                                      
Port 3 Status 100 Change 0                                                      
Port 4 Status 100 Change 0                                                      
Port 1 Status 100 Change 0                                                      
Port 2 Status 100 Change 0                                                      
Port 3 Status 100 Change 0                                                      
devnum=2 port=3: timeout                                                        
Port 4 Status 100 Change 0                                                      
devnum=2 port=4: timeout                                                        
Port 1 Status 100 Change 0                                                      
devnum=2 port=1: timeout                                                        
Port 2 Status 100 Change 0                                                      
devnum=2 port=2: timeout                                                        
2 USB Device(s) found                                                           
scan end                                                                        
No ethernet found.                                                              
No ethernet found.                                                              
=> usb info                                                                     
1: Hub,  USB Revision 1.10                                                      
 -  U-Boot Root Hub                                                             
 - Class: Hub                                                                   
 - PacketSize: 8  Configurations: 1                                             
 - Vendor: 0x0000  Product 0x0000 Version 0.0                                   
   Configuration: 1                                                             
   - Interfaces: 1 Self Powered 0mA                                             
     Interface: 0                                                               
     - Alternate Setting 0, Endpoints: 1                                        
     - Class Hub                                                                
     - Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms                       
                                                                                
1: Hub,  USB Revision 1.10                                                      
 -  U-Boot Root Hub                                                             
 - Class: Hub                                                                   
 - PacketSize: 8  Configurations: 1                                             
 - Vendor: 0x0000  Product 0x0000 Version 0.0                                   
   Configuration: 1                                                             
   - Interfaces: 1 Self Powered 0mA                                             
     Interface: 0                                                               
     - Alternate Setting 0, Endpoints: 1                                        
     - Class Hub                                                                
     - Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms                       
                                                                                
2: Hub,  USB Revision 2.0                                                       
 -  USB 2.0 Hub [MTT]                                                           
 - Class: Hub                                                                   
 - PacketSize: 64  Configurations: 1                                            
 - Vendor: 0x1a40  Product 0x0101 Version 1.0                                   
   Configuration: 1                                                             
   - Interfaces: 1 Self Powered Remote Wakeup 100mA                             
     Interface: 0                                                               
     - Alternate Setting 0, Endpoints: 1                                        
     - Class Hub                                                                
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 255ms                       
                                                                                
=>

From this and the device tree info, I've ascertained there are at least two root hubs on the RK3588, one of which is exposed via that strange onboard port and the other of which is wired onboard into a secondary hub that then becomes the 4 back-end ports, which appears to be a Terminus Technology FE1.1 (you can see it identified above via its USB vendor:product code 1a40:0101) hub.

The output seems to suggest the system is able to "feel" this hub, but is then unable to bring up any devices attached to its 4 ports. Note that each of the 4 ports repeatedly returns a status code of hex 100 which appears to indicate (from the definitions in the U-Boot source file include/usb_defs.h) that power to the port is on but no device is connected (that should be 101 or 103). Power on is further confirmed by affixing a USB mouse, which causes the bottom light to light. Neither the mouse nor 2 separate kinds of USB keyboards are recognized in the U-Boot program, however (note that nothing other than hubs appears in the usb info output).

What could be going on here? FWIW, I am using the stock USB drivers; no special modifications (beyond enabling/adding debug output) have been made.


Solution

  • there are at least two root hubs ... and the other of which is wired onboard into a secondary hub ...

    Instead of making wild guesses, your time could be better spent reading the ITX-3588J documentation. It clearly indicates that the "four USB ports on the back" are USB 3.0 ports. The "strange onboard port", as well as three more ports using headers, are USB 2.x ports.

    Your U-Boot log only has messages from the drivers for the two USB 2.x controllers of the RK3588 .
    The drivers for any of the three USB 3.0 controllers are apparently silent, and perhaps not even enabled? That could be the simplest explanation as to why no plugged-in device is "recognized".