X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=bbb-usb.git;a=blobdiff_plain;f=src%2Fsys%2Farch%2Farmv7%2Fomap%2Fammusb.c;h=5b6200a6c0e6bffdb5448ce1eaf3277cc2f0ec29;hp=eedb9791ac36475c536d2f24a3f69ca729024806;hb=HEAD;hpb=a6ba6281fbb7e4275eb6529c7a94a3d2a657462a diff --git a/src/sys/arch/armv7/omap/ammusb.c b/src/sys/arch/armv7/omap/ammusb.c index eedb979..5b6200a 100644 --- a/src/sys/arch/armv7/omap/ammusb.c +++ b/src/sys/arch/armv7/omap/ammusb.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2017 Ian Sutton - * Copyright (c) 2013 Oleksandr Tymoshenko + * 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 @@ -28,12 +28,21 @@ #include #include #include +#include + +#include #include #include - #include +#include +#include +#include +#include +#include +#include + #include #include @@ -114,9 +123,7 @@ ammusb_attach(struct device *parent, struct device *self, void *args) 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; @@ -138,8 +145,17 @@ ammusb_attach(struct device *parent, struct device *self, void *args) &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