43#include <sys/condvar.h>
44#include <sys/kernel.h>
45#include <sys/module.h>
47#include <dev/ofw/ofw_bus.h>
48#include <dev/ofw/ofw_bus_subr.h>
65 struct resource *
res[3];
69 { SYS_RES_MEMORY, 0, RF_ACTIVE },
70 { SYS_RES_MEMORY, 1, RF_ACTIVE },
71 { SYS_RES_IRQ, 0, RF_ACTIVE },
75#define EHCI_HC_DEVSTR "Qualcomm USB 2.0 controller"
84 if (!ofw_bus_is_compatible(
dev,
"qcom,ci-hdrc"))
89 return (BUS_PROBE_DEFAULT);
96 bus_space_handle_t bsh;
100 esc = device_get_softc(
dev);
108 device_printf(
dev,
"could not allocate resources\n");
122 bsh = rman_get_bushandle(esc->
res[0]);
125 if (bus_space_subregion(sc->
sc_io_tag, bsh, 0x100,
127 panic(
"%s: unable to subregion USB host registers",
128 device_get_name(
dev));
132 device_printf(
dev,
"Could not add USB device\n");
140 err = bus_setup_intr(
dev, esc->
res[2], INTR_TYPE_BIO | INTR_MPSAFE,
143 device_printf(
dev,
"Could not setup irq, %d\n", err);
153 err = device_probe_and_attach(sc->
sc_bus.
bdev);
157 device_printf(
dev,
"USB init failed err=%d\n", err);
174 sc = device_get_softc(
dev);
179 device_delete_child(
dev, bdev);
182 device_delete_children(
dev);
190 device_printf(
dev,
"Could not tear down irq, %d\n",
200 bus_release_resource(
dev, SYS_RES_MEMORY, 0,
215 DEVMETHOD(device_suspend, bus_generic_suspend),
216 DEVMETHOD(device_resume, bus_generic_resume),
217 DEVMETHOD(device_shutdown, bus_generic_shutdown),
void ehci_interrupt(ehci_softc_t *sc)
void ehci_detach(ehci_softc_t *sc)
usb_error_t ehci_init(ehci_softc_t *sc)
struct ehci_softc ehci_softc_t
#define EHCI_SCFLG_DONEINIT
#define EHCI_SCFLG_DONTRESET
#define EHCI_SCFLG_NORESTERM
usb_bus_mem_cb_t ehci_iterate_hw_softc
static struct resource_spec ehci_msm_spec[]
MODULE_DEPEND(ehci_msm, usb, 1, 1, 1)
static int ehci_msm_probe(device_t dev)
DRIVER_MODULE(ehci_msm, simplebus, ehci_driver, ehci_devclass, 0, 0)
static devclass_t ehci_devclass
static device_detach_t ehci_msm_detach
static device_method_t ehci_methods[]
static device_attach_t ehci_msm_attach
static driver_t ehci_driver
struct usb_device * sc_devices[EHCI_MAX_DEVICES]
struct resource * sc_irq_res
bus_space_handle_t sc_io_hdl
struct resource * sc_io_res
bus_space_tag_t sc_io_tag
struct usb_device ** devices
#define USB_GET_DMA_TAG(dev)
void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb)