mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
usb: host: ehci-vf: Implement board_usb_phy_mode weak function
Add board_usb_phy_mode weak function on similar lines to ehci-mx6. However since Vybrid USB does not have a true OTG, make this weak functon just return 0. The function is supposed to be implemented by the individual boards using a GPIO for providing the OTG pin functionality. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:

committed by
Marek Vasut

parent
6089f75141
commit
08c11cb5df
@ -121,6 +121,11 @@ static void usb_oc_config(int index)
|
|||||||
setbits_le32(ctrl, UCTRL_OVER_CUR_DIS);
|
setbits_le32(ctrl, UCTRL_OVER_CUR_DIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int __weak board_usb_phy_mode(int port)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int __weak board_ehci_hcd_init(int port)
|
int __weak board_ehci_hcd_init(int port)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@ -130,6 +135,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
|
|||||||
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
struct ehci_hccr **hccr, struct ehci_hcor **hcor)
|
||||||
{
|
{
|
||||||
struct usb_ehci *ehci;
|
struct usb_ehci *ehci;
|
||||||
|
enum usb_init_type type;
|
||||||
|
|
||||||
if (index >= ARRAY_SIZE(nc_reg_bases))
|
if (index >= ARRAY_SIZE(nc_reg_bases))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -148,6 +154,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
|
|||||||
*hcor = (struct ehci_hcor *)((uint32_t)*hccr +
|
*hcor = (struct ehci_hcor *)((uint32_t)*hccr +
|
||||||
HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
|
HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
|
||||||
|
|
||||||
|
type = board_usb_phy_mode(index);
|
||||||
|
if (type != init)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
if (init == USB_INIT_DEVICE) {
|
if (init == USB_INIT_DEVICE) {
|
||||||
setbits_le32(&ehci->usbmode, CM_DEVICE);
|
setbits_le32(&ehci->usbmode, CM_DEVICE);
|
||||||
writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc);
|
writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc);
|
||||||
|
Reference in New Issue
Block a user