Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/allwinner/a10_ehci.c
Show First 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | if (err) { | ||||
device_printf(self, "Could not setup irq, %d\n", err); | device_printf(self, "Could not setup irq, %d\n", err); | ||||
sc->sc_intr_hdl = NULL; | sc->sc_intr_hdl = NULL; | ||||
goto error; | goto error; | ||||
} | } | ||||
sc->sc_flags |= EHCI_SCFLG_DONTRESET; | sc->sc_flags |= EHCI_SCFLG_DONTRESET; | ||||
/* Enable clock for USB */ | /* Enable clock for USB */ | ||||
a10_clk_usb_activate(); | a10_clk_ehci_activate(); | ||||
/* Give power to USB */ | /* Give power to USB */ | ||||
GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_OUTPUT); | GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_OUTPUT); | ||||
GPIO_PIN_SET(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_HIGH); | GPIO_PIN_SET(sc_gpio_dev, GPIO_USB2_PWR, GPIO_PIN_HIGH); | ||||
/* Give power to USB */ | /* Give power to USB */ | ||||
GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_OUTPUT); | GPIO_PIN_SETFLAGS(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_OUTPUT); | ||||
GPIO_PIN_SET(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_HIGH); | GPIO_PIN_SET(sc_gpio_dev, GPIO_USB1_PWR, GPIO_PIN_HIGH); | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | a10_ehci_detach(device_t self) | ||||
reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); | reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); | ||||
reg_value &= ~SW_AHB_INCR8; /* AHB INCR8 disable */ | reg_value &= ~SW_AHB_INCR8; /* AHB INCR8 disable */ | ||||
reg_value &= ~SW_AHB_INCR4; /* AHB burst type INCR4 disable */ | reg_value &= ~SW_AHB_INCR4; /* AHB burst type INCR4 disable */ | ||||
reg_value &= ~SW_AHB_INCRX_ALIGN; /* AHB INCRX align disable */ | reg_value &= ~SW_AHB_INCRX_ALIGN; /* AHB INCRX align disable */ | ||||
reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ | reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ | ||||
A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); | A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); | ||||
/* Disable clock for USB */ | /* Disable clock for USB */ | ||||
a10_clk_usb_deactivate(); | a10_clk_ehci_deactivate(); | ||||
return (0); | return (0); | ||||
} | } | ||||
static device_method_t ehci_methods[] = { | static device_method_t ehci_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, a10_ehci_probe), | DEVMETHOD(device_probe, a10_ehci_probe), | ||||
DEVMETHOD(device_attach, a10_ehci_attach), | DEVMETHOD(device_attach, a10_ehci_attach), | ||||
Show All 18 Lines |