mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-10-02 19:22:00 +02:00
Merge git://git.denx.de/u-boot-usb
This commit is contained in:
commit
eab76dfd5b
@ -44,7 +44,7 @@ static void ums_fini(void)
|
|||||||
for (i = 0; i < ums_count; i++)
|
for (i = 0; i < ums_count; i++)
|
||||||
free((void *)ums[i].name);
|
free((void *)ums[i].name);
|
||||||
free(ums);
|
free(ums);
|
||||||
ums = 0;
|
ums = NULL;
|
||||||
ums_count = 0;
|
ums_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
|
static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
|
||||||
int argc, char * const argv[])
|
int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
const char *usb_controller;
|
const char *usb_controller;
|
||||||
|
@ -1386,11 +1386,6 @@ static void at91rm9200_udc_pullup(struct at91_udc *udc, int is_on)
|
|||||||
gpio_set_value(udc->board.pullup_pin, !active);
|
gpio_set_value(udc->board.pullup_pin, !active);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct at91_udc_caps at91rm9200_udc_caps = {
|
|
||||||
.init = at91rm9200_udc_init,
|
|
||||||
.pullup = at91rm9200_udc_pullup,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int at91sam9260_udc_init(struct at91_udc *udc)
|
static int at91sam9260_udc_init(struct at91_udc *udc)
|
||||||
{
|
{
|
||||||
struct at91_ep *ep;
|
struct at91_ep *ep;
|
||||||
@ -1503,11 +1498,6 @@ static int at91sam9263_udc_init(struct at91_udc *udc)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct at91_udc_caps at91sam9263_udc_caps = {
|
|
||||||
.init = at91sam9263_udc_init,
|
|
||||||
.pullup = at91sam9260_udc_pullup,
|
|
||||||
};
|
|
||||||
|
|
||||||
int usb_gadget_handle_interrupts(int index)
|
int usb_gadget_handle_interrupts(int index)
|
||||||
{
|
{
|
||||||
struct at91_udc *udc = controller;
|
struct at91_udc *udc = controller;
|
||||||
|
@ -43,6 +43,7 @@ struct dwc2_priv {
|
|||||||
struct dwc2_core_regs *regs;
|
struct dwc2_core_regs *regs;
|
||||||
int root_hub_devnum;
|
int root_hub_devnum;
|
||||||
bool ext_vbus;
|
bool ext_vbus;
|
||||||
|
bool hnp_srp_disable;
|
||||||
bool oc_disable;
|
bool oc_disable;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -394,6 +395,9 @@ static void dwc_otg_core_init(struct dwc2_priv *priv)
|
|||||||
usbcfg |= DWC2_GUSBCFG_ULPI_CLK_SUS_M;
|
usbcfg |= DWC2_GUSBCFG_ULPI_CLK_SUS_M;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (priv->hnp_srp_disable)
|
||||||
|
usbcfg |= DWC2_GUSBCFG_FORCEHOSTMODE;
|
||||||
|
|
||||||
writel(usbcfg, ®s->gusbcfg);
|
writel(usbcfg, ®s->gusbcfg);
|
||||||
|
|
||||||
/* Program the GAHBCFG Register. */
|
/* Program the GAHBCFG Register. */
|
||||||
@ -422,12 +426,16 @@ static void dwc_otg_core_init(struct dwc2_priv *priv)
|
|||||||
|
|
||||||
writel(ahbcfg, ®s->gahbcfg);
|
writel(ahbcfg, ®s->gahbcfg);
|
||||||
|
|
||||||
/* Program the GUSBCFG register for HNP/SRP. */
|
/* Program the capabilities in GUSBCFG Register */
|
||||||
setbits_le32(®s->gusbcfg, DWC2_GUSBCFG_HNPCAP | DWC2_GUSBCFG_SRPCAP);
|
usbcfg = 0;
|
||||||
|
|
||||||
|
if (!priv->hnp_srp_disable)
|
||||||
|
usbcfg |= DWC2_GUSBCFG_HNPCAP | DWC2_GUSBCFG_SRPCAP;
|
||||||
#ifdef CONFIG_DWC2_IC_USB_CAP
|
#ifdef CONFIG_DWC2_IC_USB_CAP
|
||||||
setbits_le32(®s->gusbcfg, DWC2_GUSBCFG_IC_USB_CAP);
|
usbcfg |= DWC2_GUSBCFG_IC_USB_CAP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
setbits_le32(®s->gusbcfg, usbcfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1244,6 +1252,11 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)
|
|||||||
if (prop)
|
if (prop)
|
||||||
priv->oc_disable = true;
|
priv->oc_disable = true;
|
||||||
|
|
||||||
|
prop = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
|
||||||
|
"hnp-srp-disable", NULL);
|
||||||
|
if (prop)
|
||||||
|
priv->hnp_srp_disable = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,13 +102,11 @@ struct usb_linux_config_descriptor {
|
|||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
#if defined CONFIG_EHCI_DESC_BIG_ENDIAN
|
#if defined CONFIG_EHCI_DESC_BIG_ENDIAN
|
||||||
#define ehci_readl(x) cpu_to_be32((*((volatile u32 *)(x))))
|
#define ehci_readl(x) cpu_to_be32(readl(x))
|
||||||
#define ehci_writel(a, b) (*((volatile u32 *)(a)) = \
|
#define ehci_writel(a, b) writel(cpu_to_be32(b), a)
|
||||||
cpu_to_be32(((volatile u32)b)))
|
|
||||||
#else
|
#else
|
||||||
#define ehci_readl(x) cpu_to_le32((*((volatile u32 *)(x))))
|
#define ehci_readl(x) cpu_to_le32(readl(x))
|
||||||
#define ehci_writel(a, b) (*((volatile u32 *)(a)) = \
|
#define ehci_writel(a, b) writel(cpu_to_le32(b), a)
|
||||||
cpu_to_le32(((volatile u32)b)))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined CONFIG_EHCI_MMIO_BIG_ENDIAN
|
#if defined CONFIG_EHCI_MMIO_BIG_ENDIAN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user