Lines Matching refs:isc
228 * @isc: omap ehci device context
239 omap_ehci_utmi_init(struct omap_ehci_softc *isc, unsigned int en_mask)
248 reg = omap_tll_read_4(isc, OMAP_USBTLL_TLL_CHANNEL_CONF(i));
254 omap_tll_write_4(isc, OMAP_USBTLL_TLL_CHANNEL_CONF(i), reg);
258 reg = omap_tll_read_4(isc, OMAP_USBTLL_TLL_SHARED_CONF);
266 omap_tll_write_4(isc, OMAP_USBTLL_TLL_SHARED_CONF, reg);
270 reg = omap_tll_read_4(isc, OMAP_USBTLL_TLL_CHANNEL_CONF(i));
277 omap_tll_write_4(isc, OMAP_USBTLL_TLL_CHANNEL_CONF(i), reg);
283 * @isc: omap ehci device context
294 omap_ehci_soft_phy_reset(struct omap_ehci_softc *isc, unsigned int port)
309 omap_ehci_write_4(isc, OMAP_USBHOST_INSNREG05_ULPI, reg);
312 while ((omap_ehci_read_4(isc, OMAP_USBHOST_INSNREG05_ULPI)
319 device_printf(isc->sc_dev, "PHY reset operation timed out\n");
328 * @isc: omap ehci device context
341 omap_ehci_init(struct omap_ehci_softc *isc)
350 device_printf(isc->sc_dev, "Starting TI EHCI USB Controller\n");
358 if (isc->phy_reset[i]) {
360 if ((isc->reset_gpio_pin[i] != -1) && (isc->sc_gpio_dev != NULL)) {
361 GPIO_PIN_SETFLAGS(isc->sc_gpio_dev, isc->reset_gpio_pin[i],
363 GPIO_PIN_SET(isc->sc_gpio_dev, isc->reset_gpio_pin[i],
375 isc->ehci_rev = omap_uhh_read_4(isc, OMAP_USBHOST_UHH_REVISION);
376 device_printf(isc->sc_dev, "UHH revision 0x%08x\n", isc->ehci_rev);
379 if (isc->ehci_rev == OMAP_EHCI_REV1) {
385 omap_tll_write_4(isc, OMAP_USBTLL_SYSCONFIG, TLL_SYSCONFIG_SOFTRESET);
391 while ((omap_tll_read_4(isc, OMAP_USBTLL_SYSSTATUS) &
398 device_printf(isc->sc_dev, "TLL reset operation timed out\n");
404 device_printf(isc->sc_dev, "TLL RESET DONE\n");
411 omap_tll_write_4(isc, OMAP_USBTLL_SYSCONFIG, TLL_SYSCONFIG_ENAWAKEUP |
416 } else if (isc->ehci_rev == OMAP_EHCI_REV2) {
423 if (isc->ehci_rev == OMAP_EHCI_REV2) {
424 if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) {
427 } else if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL)
429 else if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_HSIC)
432 if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) {
435 } else if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL)
437 else if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_HSIC)
443 reg = omap_uhh_read_4(isc, OMAP_USBHOST_UHH_SYSCONFIG);
444 if (isc->ehci_rev == OMAP_EHCI_REV1) {
452 } else if (isc->ehci_rev == OMAP_EHCI_REV2) {
458 omap_uhh_write_4(isc, OMAP_USBHOST_UHH_SYSCONFIG, reg);
459 device_printf(isc->sc_dev, "OMAP_UHH_SYSCONFIG: 0x%08x\n", reg);
461 reg = omap_uhh_read_4(isc, OMAP_USBHOST_UHH_HOSTCONFIG);
469 if (isc->ehci_rev == OMAP_EHCI_REV1) {
470 if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_UNKNOWN)
472 if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_UNKNOWN)
474 if (isc->port_mode[2] == EHCI_HCD_OMAP_MODE_UNKNOWN)
478 if ((isc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY) ||
479 (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY) ||
480 (isc->port_mode[2] == EHCI_HCD_OMAP_MODE_PHY))
485 } else if (isc->ehci_rev == OMAP_EHCI_REV2) {
492 if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL)
494 else if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_HSIC)
497 if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL)
499 else if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_HSIC)
503 omap_uhh_write_4(isc, OMAP_USBHOST_UHH_HOSTCONFIG, reg);
504 device_printf(isc->sc_dev, "UHH setup done, uhh_hostconfig=0x%08x\n", reg);
516 omap_ehci_write_4(isc, OMAP_USBHOST_INSNREG04,
521 if ((isc->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL) ||
522 (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL) ||
523 (isc->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)) {
525 if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_TLL)
527 if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_TLL)
529 if (isc->port_mode[2] == EHCI_HCD_OMAP_MODE_TLL)
533 omap_ehci_utmi_init(isc, tll_ch_mask);
546 if (isc->phy_reset[i] && (isc->reset_gpio_pin[i] != -1)
547 && (isc->sc_gpio_dev != NULL)) {
548 GPIO_PIN_SET(isc->sc_gpio_dev,
549 isc->reset_gpio_pin[i], GPIO_PIN_HIGH);
558 reg = omap_ehci_read_4(isc, OMAP_USBHOST_USBCMD);
561 omap_ehci_write_4(isc, OMAP_USBHOST_USBCMD, reg);
564 if (isc->port_mode[0] == EHCI_HCD_OMAP_MODE_PHY)
565 omap_ehci_soft_phy_reset(isc, 0);
566 if (isc->port_mode[1] == EHCI_HCD_OMAP_MODE_PHY)
567 omap_ehci_soft_phy_reset(isc, 1);
585 * @isc: omap ehci device context
596 omap_ehci_fini(struct omap_ehci_softc *isc)
600 device_printf(isc->sc_dev, "Stopping TI EHCI USB Controller\n");
609 omap_uhh_write_4(isc, OMAP_USBHOST_UHH_SYSCONFIG, 0x0002);
610 while ((omap_uhh_read_4(isc, OMAP_USBHOST_UHH_SYSSTATUS) & 0x07) == 0x00) {
615 device_printf(isc->sc_dev, "operation timed out\n");
628 omap_tll_write_4(isc, OMAP_USBTLL_SYSCONFIG, 0x0002);
629 while ((omap_tll_read_4(isc, OMAP_USBTLL_SYSSTATUS) & (0x01)) == 0x00) {
634 device_printf(isc->sc_dev, "operation timed out\n");
644 device_printf(isc->sc_dev, "Clock to USB host has been disabled\n");
768 struct omap_ehci_softc *isc = device_get_softc(dev);
773 ehci_softc_t *sc = &isc->base;
786 isc->sc_dev = dev;
821 isc->uhh_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
822 if (!isc->uhh_mem_res) {
828 isc->tll_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
829 if (!isc->tll_mem_res) {
850 isc->sc_gpio_dev = devclass_get_device(devclass_find("gpio"), 0);
851 if (isc->sc_gpio_dev == NULL) {
858 isc->phy_reset[i] = 0;
859 isc->port_mode[i] = EHCI_HCD_OMAP_MODE_UNKNOWN;
860 isc->reset_gpio_pin[i] = -1;
874 isc->port_mode[i] = fdt32_to_cpu(*phyconf_ptr);
875 isc->phy_reset[i] = fdt32_to_cpu(*(phyconf_ptr + 1));
876 isc->reset_gpio_pin[i] = fdt32_to_cpu(*(phyconf_ptr + 2));
883 err = omap_ehci_init(isc);
940 struct omap_ehci_softc *isc = device_get_softc(dev);
941 ehci_softc_t *sc = &isc->base;
984 if (isc->tll_mem_res) {
985 bus_release_resource(dev, SYS_RES_MEMORY, 0, isc->tll_mem_res);
986 isc->tll_mem_res = NULL;
988 if (isc->uhh_mem_res) {
989 bus_release_resource(dev, SYS_RES_MEMORY, 0, isc->uhh_mem_res);
990 isc->uhh_mem_res = NULL;
995 omap_ehci_fini(isc);