1 // SPDX-License-Identifier: GPL-2.0+
4 * Armando Visconti, ST Micoelectronics, <armando.visconti@st.com>.
7 * Marvell Semiconductor <www.marvell.com>
8 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
15 #include <linux/delay.h>
17 #include <asm/arch/hardware.h>
18 #include <asm/arch/spr_misc.h>
20 static void spear6xx_usbh_stop(void)
22 struct misc_regs *const misc_p =
23 (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
24 u32 periph1_rst = readl(misc_p->periph1_rst);
26 periph1_rst |= PERIPH_USBH1 | PERIPH_USBH2;
27 writel(periph1_rst, misc_p->periph1_rst);
30 periph1_rst &= ~(PERIPH_USBH1 | PERIPH_USBH2);
31 writel(periph1_rst, misc_p->periph1_rst);
35 * Create the appropriate control structures to manage
36 * a new EHCI host controller.
38 int ehci_hcd_init(int index, enum usb_init_type init,
39 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
45 ehci = CONFIG_SYS_UHC0_EHCI_BASE;
48 ehci = CONFIG_SYS_UHC1_EHCI_BASE;
51 printf("ERROR: wrong controller index!\n");
55 *hccr = (struct ehci_hccr *)(ehci + 0x100);
56 *hcor = (struct ehci_hcor *)((uint32_t) *hccr +
57 HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
59 debug("SPEAr-ehci: init hccr %x and hcor %x hc_length %d\n",
60 (uint32_t)*hccr, (uint32_t)*hcor,
61 (uint32_t)HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
67 * Destroy the appropriate control structures corresponding
68 * the the EHCI host controller.
70 int ehci_hcd_stop(int index)
72 #if defined(CONFIG_SPEAR600)