bind to IRQ & pull in lots of ehci/usb sources
authorkremlin <ian@kremlin.cc>
Sun, 12 Feb 2017 04:32:28 +0000 (22:32 -0600)
committerkremlin <ian@kremlin.cc>
Sun, 12 Feb 2017 04:32:28 +0000 (22:32 -0600)
src/sys/arch/armv7/omap/ammusb.c

index eedb9791ac36475c536d2f24a3f69ca729024806..727312b91eb0f1ba9cc218a3755fa5c58be19eb0 100644 (file)
 #include <sys/systm.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
+#include <sys/rwlock.h>
+
+#include <machine/intr.h>
 
 #include <dev/ofw/openfirm.h>
 #include <dev/ofw/fdt.h>
-
 #include <machine/fdt.h>
 
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdivar.h>
+#include <dev/usb/usb_mem.h>
+#include <dev/usb/ehcireg.h>
+#include <dev/usb/ehcivar.h>
+
 #include <armv7/omap/prcmvar.h>
 #include <armv7/omap/sitara_cm.h>
 
@@ -138,8 +147,14 @@ ammusb_attach(struct device *parent, struct device *self, void *args)
            &sc->sc_ioh_ctl))
                panic("%s: bus_space_map failed!", __func__);
 
+       /* not the right revision number XXX */
        rev = HREAD4(sc, sc->sc_ioh_ctl, 0x0);
        printf(": rev %d.%d\n", rev >> 4 &0xf, rev & 0xf);
+
+       sc->sc_ih = arm_intr_establish_fdt(faa->fa_node, IPL_USB, ehci_intr,
+           &sc->sc_dev, DEVNAME(sc));
+
+       /* XXX set OTG state here */
 }
 
 int