usb: common: add a routine to print the OTG state

Add a usb_otg_state_string() routine to print the OTG state for
debugging

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Core files for the DWC2 driver

The core code provides basic services for accessing and managing
the DWC_otg hardware. These services are used by both the Host
Controller Driver and (in future) the Peripheral Controller Driver.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
HCD files for the DWC2 driver

These files contain the HCD code, and implement the Linux
hc_driver API. Support for both slave mode and buffer DMA mode
of the controller is included.

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
HCD descriptor DMA support for the DWC2 driver

This file contains code to support the HCD descriptor DMA mode of
the controller

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
PCI bus interface for the DWC2 driver

This file contains the PCI bus interface "glue" for the DWC2 driver

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Hook the DWC2 driver into the build system

Add the DWC2 Kconfig and Makefile, and modify the USB Kconfig and
Makefile to include them

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Add a MAINTAINERS entry for the DWC2 driver

Add myself as maintainer of the DWC2 driver

Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
platform device wrapper for RPI USB controller
HACK: enable DWC2 OTG on RPi

Turn on USB power first in U-Boot:

// msg with 2 parameters, up to 2 responses
setenv prop-2-2 'mw.l 0x00001000 0x00000020 ; mw.l 0x00001004 0x00000000 ; mw.l 0x00001008 \$tag ; mw.l 0x0000100c 0x00000008 ; mw.l 0x00001010 0x00000008 ; mw.l 0x00001014 \$p1 ; mw.l 0x00001018 \$p2 ; mw.l 0x0000101c 0x00000000 ; md.l 0x1000 8'

// send msg, read/dump response
setenv send-rec 'mw 0x2000b8a0 0x00001008 ; md 0x2000b880 1 ; md.l 0x00001000 8'

// set power, devid==p1 (3==USB), state,wait==p2 (3==ON/WAIT)
setenv tag 0x28001 ; setenv p1 3 ; setenv p2 3; run prop-2-2 ; run send-rec

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
HACK: don't pass irq to usb_add_hcd()

Without this, the HCD IRQ handler keeps getting called over and over due
to OTGINT status being set. For some reason, the shared IRQ handler
dwc2_handle_common_intr() is not getting called to clear this. Perhaps
IRQF_SHARED isn't working on the Pi for some reason. With this change,
dwc2_handle_common_intr() does get called and immediately clears the IRQ
status, but of course without HCD interrupts hooked, the port doesn't
work. But at least the system boots without hanging.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>