Lines Matching defs:sc

75 	struct ehci_softc	 sc;
87 void omehci_soft_phy_reset(struct omehci_softc *sc, unsigned int port);
109 struct omehci_softc *sc = (struct omehci_softc *)self;
112 char *devname = sc->sc.sc_bus.bdev.dv_xname;
122 sc->sc.iot = faa->fa_iot;
123 sc->sc.sc_bus.dmatag = faa->fa_dmat;
127 sc->port_mode[i] = EHCI_HCD_OMAP_MODE_UNKNOWN;
140 sc->port_mode[i] = EHCI_HCD_OMAP_MODE_PHY;
142 sc->port_mode[i] = EHCI_HCD_OMAP_MODE_HSIC;
144 sc->port_mode[i] = EHCI_HCD_OMAP_MODE_TLL ;
159 if (bus_space_map(sc->sc.iot, reg[0], reg[1], 0, &sc->sc.ioh)) {
163 sc->sc.sc_size = reg[1];
165 if (bus_space_map(sc->sc.iot, faa->fa_reg[0].addr, faa->fa_reg[0].size,
166 0, &sc->uhh_ioh)) {
172 if (sc->tll_avail &&
173 bus_space_map(sc->sc.iot, aa->aa_dev->mem[2].addr,
174 aa->aa_dev->mem[2].size, 0, &sc->tll_ioh)) {
184 if (omehci_init(sc))
188 sc->sc.sc_offs = EREAD1(&sc->sc, EHCI_CAPLENGTH);
189 EOWRITE2(&sc->sc, EHCI_USBINTR, 0);
191 sc->sc_ih = arm_intr_establish_fdt(node, IPL_USB,
192 ehci_intr, &sc->sc, devname);
193 if (sc->sc_ih == NULL) {
199 strlcpy(sc->sc.sc_vendor, "TI OMAP", sizeof(sc->sc.sc_vendor));
200 r = ehci_init(&sc->sc);
207 config_found(self, &sc->sc.sc_bus, usbctlprint);
212 arm_intr_disestablish(sc->sc_ih);
213 sc->sc_ih = NULL;
216 bus_space_unmap(sc->sc.iot, sc->tll_ioh, aa->aa_dev->mem[2].size);
219 bus_space_unmap(sc->sc.iot, sc->uhh_ioh, faa->fa_reg[0].size);
221 bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
222 sc->sc.sc_size = 0;
228 omehci_init(struct omehci_softc *sc)
243 sc->ehci_rev = bus_space_read_4(sc->sc.iot, sc->uhh_ioh,
247 if (sc->ehci_rev == OMAP_EHCI_REV1) {
252 bus_space_write_4(sc->sc.iot, sc->tll_ioh,
259 while ((bus_space_read_4(sc->sc.iot, sc->tll_ioh,
271 bus_space_write_4(sc->sc.iot, sc->tll_ioh,
275 } else if (sc->ehci_rev == OMAP_EHCI_REV2) {
281 if (sc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) {
284 } else if (sc->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL)
286 else if (sc->port_mode[0] == EHCI_HCD_OMAP_MODE_HSIC)
289 if (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) {
292 } else if (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL)
294 else if (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_HSIC)
299 reg = bus_space_read_4(sc->sc.iot, sc->uhh_ioh,
301 if (sc->ehci_rev == OMAP_EHCI_REV1) {
309 } else if (sc->ehci_rev == OMAP_EHCI_REV2) {
315 bus_space_write_4(sc->sc.iot, sc->uhh_ioh, OMAP_USBHOST_UHH_SYSCONFIG,
318 reg = bus_space_read_4(sc->sc.iot, sc->uhh_ioh,
327 if (sc->ehci_rev == OMAP_EHCI_REV1) {
328 if (sc->port_mode[0] == EHCI_HCD_OMAP_MODE_UNKNOWN)
330 if (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_UNKNOWN)
332 if (sc->port_mode[2] == EHCI_HCD_OMAP_MODE_UNKNOWN)
336 if ((sc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) ||
337 (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) ||
338 (sc->port_mode[2] == EHCI_HCD_OMAP_MODE_PHY))
342 } else if (sc->ehci_rev == OMAP_EHCI_REV2) {
349 if (sc->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL)
351 else if (sc->port_mode[0] == EHCI_HCD_OMAP_MODE_HSIC)
354 if (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL)
356 else if (sc->port_mode[1] == EHCI_HCD_OMAP_MODE_HSIC)
360 bus_space_write_4(sc->sc.iot, sc->uhh_ioh, OMAP_USBHOST_UHH_HOSTCONFIG, reg);
364 if (sc->port_mode[i] == EHCI_HCD_OMAP_MODE_PHY)
370 omap_ehci_utmi_init(sc, tll_ch_mask);
377 reg = bus_space_read_4(sc->sc.iot, sc->sc.ioh, OMAP_USBHOST_USBCMD);
380 bus_space_write_4(sc->sc.iot, sc->sc.ioh, OMAP_USBHOST_USBCMD, reg);
384 if (sc->port_mode[i] == EHCI_HCD_OMAP_MODE_PHY)
385 omehci_soft_phy_reset(sc, i);
391 omehci_soft_phy_reset(struct omehci_softc *sc, unsigned int port)
406 bus_space_write_4(sc->sc.iot, sc->sc.ioh, OMAP_USBHOST_INSNREG05_ULPI, reg);
410 while ((bus_space_read_4(sc->sc.iot, sc->sc.ioh, OMAP_USBHOST_INSNREG05_ULPI)
426 struct omehci_softc *sc = (struct omehci_softc *)self;
433 if (sc->sc_ih != NULL) {
434 arm_intr_disestablish(sc->sc_ih);
435 sc->sc_ih = NULL;
438 if (sc->sc.sc_size) {
439 bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
440 sc->sc.sc_size = 0;
451 struct omehci_softc *sc = (struct omehci_softc *)self;
455 sc->sc.sc_bus.use_polling++;
457 sc->sc.sc_bus.use_polling--;
460 sc->sc.sc_bus.use_polling++;
462 sc->sc.sc_bus.use_polling--;
465 ehci_reset(&sc->sc);