/*
* Copyright (c) 2017 Ian Sutton <ian@ce.gl>
- * Copyright (c) 2013 Oleksandr Tymoshenko <gonzo@freebsd.org>
+ * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#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>
struct fdt_attach_args *faa = args;
uint32_t rev, phy_reg[2];
- int phy_node;
-
- phy_node = -1;
+ int phy_node = -1, irq;
sc->sc_iot = faa->fa_iot;
&sc->sc_ioh_ctl))
panic("%s: bus_space_map failed!", __func__);
+ irq = faa->fa_intr[0];
+ sc->sc_ih = arm_intr_establish(irq, IPL_BIO, ammusb_intr, sc, DEVNAME(sc));
+
+ /* 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