Skip to content
  • Jonas Karlman's avatar
    rockchip: Migrate to use DM_USB_GADGET on RK3328 · 1bc4e8eb
    Jonas Karlman authored and Kever Yang's avatar Kever Yang committed
    USB gadget is not working fully as expected on RK3328, it uses a
    board_usb_init() function to initialize the DWC2 OTG port.
    
    The board_usb_init() function does not intgrate with the generic phy
    framework and as a result the USB phy is not properly configured before
    or after USB gadget use.
    
    Having both USB_DWC2 and DWC2_OTG enabled for the same board is also
    causing some issues.
    
    Trying to use rockusb or ums command after usb stop result in a freeze
    due to usb stop is putting the phy in a suspended state.
    
      => usb start
      => usb stop
      => ums 0 mmc 0
      --> freeze due to usb phy is suspended <--
    
    Fix this by only using one of USB_DWC2 (host) or DWC2_OTG (peripheral)
    depending on the most likely usage of the otg port and by migrating to
    use DM_USB_GADGET instead of a board_usb_init() function.
    
    The nanopi-r2 and orangepi-r1-plus variants share OTG and power using a
    Type-C connector, mark these boards dr_mode as peripheral, the most
    likely usage is for recove...
    1bc4e8eb