mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
usb: ehci-hcd: add enum usb_init_type parameter to ehci_hcd_init.
This paramter will later be used to initialize OTG ports in host or device mode. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
This commit is contained in:
parent
06d513ecb6
commit
127efc4fe8
@ -565,7 +565,8 @@ struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define SB_T35_USB_HUB_RESET_GPIO 167
|
#define SB_T35_USB_HUB_RESET_GPIO 167
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
u8 val;
|
u8 val;
|
||||||
int offset;
|
int offset;
|
||||||
|
@ -40,7 +40,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||||
};
|
};
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||||
};
|
};
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||||
};
|
};
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
|
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
|
||||||
};
|
};
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
.port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
|
.port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
|
||||||
};
|
};
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -269,7 +269,8 @@ static struct omap_usbhs_board_data usbhs_bdata = {
|
|||||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||||
};
|
};
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int utmi_clk;
|
unsigned int utmi_clk;
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
/*
|
/*
|
||||||
* EHCI host controller init
|
* EHCI host controller init
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
if (utmi_init() < 0)
|
if (utmi_init() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -21,7 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
#define EN_UPLL_TIMEOUT 500UL
|
#define EN_UPLL_TIMEOUT 500UL
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
|
at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
|
||||||
ulong start_time, tmp_time;
|
ulong start_time, tmp_time;
|
||||||
|
@ -141,7 +141,8 @@ static void reset_usb_phy(struct exynos_usb_phy *usb)
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct exynos_ehci *ctx = &exynos;
|
struct exynos_ehci *ctx = &exynos;
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@ static inline int ehci_is_fotg2xx(union ehci_faraday_regs *regs)
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **ret_hccr,
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
struct ehci_hcor **ret_hcor)
|
struct ehci_hccr **ret_hccr, struct ehci_hcor **ret_hcor)
|
||||||
{
|
{
|
||||||
struct ehci_hccr *hccr;
|
struct ehci_hccr *hccr;
|
||||||
struct ehci_hcor *hcor;
|
struct ehci_hcor *hcor;
|
||||||
|
@ -35,7 +35,8 @@ static int usb_phy_clk_valid(struct usb_ehci *ehci)
|
|||||||
*
|
*
|
||||||
* Excerpts from linux ehci fsl driver.
|
* Excerpts from linux ehci fsl driver.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct usb_ehci *ehci;
|
struct usb_ehci *ehci;
|
||||||
const char *phy_type = NULL;
|
const char *phy_type = NULL;
|
||||||
|
@ -926,17 +926,22 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
|
|||||||
struct QH *qh_list;
|
struct QH *qh_list;
|
||||||
struct QH *periodic;
|
struct QH *periodic;
|
||||||
int i;
|
int i;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (ehci_hcd_init(index, &ehcic[index].hccr, &ehcic[index].hcor))
|
rc = ehci_hcd_init(index, init, &ehcic[index].hccr, &ehcic[index].hcor);
|
||||||
return -1;
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
if (init == USB_INIT_DEVICE)
|
||||||
|
goto done;
|
||||||
|
|
||||||
/* EHCI spec section 4.1 */
|
/* EHCI spec section 4.1 */
|
||||||
if (ehci_reset(index))
|
if (ehci_reset(index))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
#if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
|
#if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
|
||||||
if (ehci_hcd_init(index, &ehcic[index].hccr, &ehcic[index].hcor))
|
rc = ehci_hcd_init(index, init, &ehcic[index].hccr, &ehcic[index].hcor);
|
||||||
return -1;
|
if (rc)
|
||||||
|
return rc;
|
||||||
#endif
|
#endif
|
||||||
/* Set the high address word (aka segment) for 64-bit controller */
|
/* Set the high address word (aka segment) for 64-bit controller */
|
||||||
if (ehci_readl(&ehcic[index].hccr->cr_hccparams) & 1)
|
if (ehci_readl(&ehcic[index].hccr->cr_hccparams) & 1)
|
||||||
@ -1037,7 +1042,7 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller)
|
|||||||
printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);
|
printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);
|
||||||
|
|
||||||
ehcic[index].rootdev = 0;
|
ehcic[index].rootdev = 0;
|
||||||
|
done:
|
||||||
*controller = &ehcic[index];
|
*controller = &ehcic[index];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
*hccr = (struct ehci_hccr *)(0xcd000100);
|
*hccr = (struct ehci_hccr *)(0xcd000100);
|
||||||
*hcor = (struct ehci_hcor *)((uint32_t) *hccr
|
*hcor = (struct ehci_hcor *)((uint32_t) *hccr
|
||||||
|
@ -74,7 +74,8 @@ static void usb_brg_adrdec_setup(void)
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
usb_brg_adrdec_setup();
|
usb_brg_adrdec_setup();
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ static void usb_platform_dr_init(volatile struct usb_ehci *ehci);
|
|||||||
* This code is derived from EHCI FSL USB Linux driver for MPC5121
|
* This code is derived from EHCI FSL USB Linux driver for MPC5121
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
volatile struct usb_ehci *ehci;
|
volatile struct usb_ehci *ehci;
|
||||||
|
|
||||||
|
@ -218,7 +218,8 @@ void __weak board_ehci_hcd_postinit(struct usb_ehci *ehci, int port)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct usb_ehci *ehci;
|
struct usb_ehci *ehci;
|
||||||
|
|
||||||
|
@ -155,7 +155,8 @@ int __weak board_ehci_hcd_init(int port)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct usb_ehci *ehci;
|
struct usb_ehci *ehci;
|
||||||
|
|
||||||
|
@ -208,7 +208,8 @@ static int mxc_set_usbcontrol(int port, unsigned int flags)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct usb_ehci *ehci;
|
struct usb_ehci *ehci;
|
||||||
#ifdef CONFIG_MX31
|
#ifdef CONFIG_MX31
|
||||||
|
@ -77,7 +77,8 @@ static int ehci_mxs_toggle_clock(const struct ehci_mxs_port *port, int enable)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -69,8 +69,8 @@ static pci_dev_t ehci_find_class(int index)
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **ret_hccr,
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
struct ehci_hcor **ret_hcor)
|
struct ehci_hccr **ret_hccr, struct ehci_hcor **ret_hcor)
|
||||||
{
|
{
|
||||||
pci_dev_t pdev;
|
pci_dev_t pdev;
|
||||||
uint32_t cmd;
|
uint32_t cmd;
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
*hccr = (struct ehci_hccr *)(CONFIG_SYS_PPC4XX_USB_ADDR);
|
*hccr = (struct ehci_hccr *)(CONFIG_SYS_PPC4XX_USB_ADDR);
|
||||||
*hcor = (struct ehci_hcor *)((uint32_t) *hccr +
|
*hcor = (struct ehci_hcor *)((uint32_t) *hccr +
|
||||||
|
@ -20,7 +20,8 @@
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
*hccr = (struct ehci_hccr *)(CONFIG_SYS_UHC0_EHCI_BASE + 0x100);
|
*hccr = (struct ehci_hccr *)(CONFIG_SYS_UHC0_EHCI_BASE + 0x100);
|
||||||
*hcor = (struct ehci_hcor *)((uint32_t)*hccr
|
*hcor = (struct ehci_hcor *)((uint32_t)*hccr
|
||||||
|
@ -734,7 +734,8 @@ int usb_process_devicetree(const void *blob)
|
|||||||
* @param hcor returns start address of EHCI HCOR registers
|
* @param hcor returns start address of EHCI HCOR registers
|
||||||
* @return 0 if ok, -1 on error (generally invalid port number)
|
* @return 0 if ok, -1 on error (generally invalid port number)
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct fdt_usb *config;
|
struct fdt_usb *config;
|
||||||
struct usb_ctlr *usbctlr;
|
struct usb_ctlr *usbctlr;
|
||||||
|
@ -15,7 +15,8 @@ int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
|
|||||||
* Create the appropriate control structures to manage
|
* Create the appropriate control structures to manage
|
||||||
* a new EHCI host controller.
|
* a new EHCI host controller.
|
||||||
*/
|
*/
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
u32 vct_hccr;
|
u32 vct_hccr;
|
||||||
|
@ -250,7 +250,8 @@ struct ehci_ctrl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Low level init functions */
|
/* Low level init functions */
|
||||||
int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor);
|
int ehci_hcd_init(int index, enum usb_init_type init,
|
||||||
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor);
|
||||||
int ehci_hcd_stop(int index);
|
int ehci_hcd_stop(int index);
|
||||||
|
|
||||||
#endif /* USB_EHCI_H */
|
#endif /* USB_EHCI_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user