Merge branch 'master' of git://git.denx.de/u-boot-usb
This commit is contained in:
commit
30aaa774df
|
|
@ -339,17 +339,6 @@ static int ehci_usb_probe(struct udevice *dev)
|
||||||
return ehci_register(dev, hccr, hcor, &vf_ehci_ops, 0, priv->init_type);
|
return ehci_register(dev, hccr, hcor, &vf_ehci_ops, 0, priv->init_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ehci_usb_remove(struct udevice *dev)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = ehci_deregister(dev);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct udevice_id vf_usb_ids[] = {
|
static const struct udevice_id vf_usb_ids[] = {
|
||||||
{ .compatible = "fsl,vf610-usb" },
|
{ .compatible = "fsl,vf610-usb" },
|
||||||
{ }
|
{ }
|
||||||
|
|
@ -361,7 +350,7 @@ U_BOOT_DRIVER(usb_ehci) = {
|
||||||
.of_match = vf_usb_ids,
|
.of_match = vf_usb_ids,
|
||||||
.bind = vf_usb_bind,
|
.bind = vf_usb_bind,
|
||||||
.probe = ehci_usb_probe,
|
.probe = ehci_usb_probe,
|
||||||
.remove = ehci_usb_remove,
|
.remove = ehci_deregister,
|
||||||
.ops = &ehci_usb_ops,
|
.ops = &ehci_usb_ops,
|
||||||
.ofdata_to_platdata = vf_usb_ofdata_to_platdata,
|
.ofdata_to_platdata = vf_usb_ofdata_to_platdata,
|
||||||
.platdata_auto_alloc_size = sizeof(struct usb_platdata),
|
.platdata_auto_alloc_size = sizeof(struct usb_platdata),
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,7 @@ static int ep_link(ohci_t *ohci, ed_t *edi)
|
||||||
ed->hwNextED = 0;
|
ed->hwNextED = 0;
|
||||||
flush_dcache_ed(ed);
|
flush_dcache_ed(ed);
|
||||||
if (ohci->ed_controltail == NULL)
|
if (ohci->ed_controltail == NULL)
|
||||||
ohci_writel(ed, &ohci->regs->ed_controlhead);
|
ohci_writel((uintptr_t)ed, &ohci->regs->ed_controlhead);
|
||||||
else
|
else
|
||||||
ohci->ed_controltail->hwNextED =
|
ohci->ed_controltail->hwNextED =
|
||||||
m32_swap((unsigned long)ed);
|
m32_swap((unsigned long)ed);
|
||||||
|
|
@ -700,7 +700,7 @@ static int ep_link(ohci_t *ohci, ed_t *edi)
|
||||||
ed->hwNextED = 0;
|
ed->hwNextED = 0;
|
||||||
flush_dcache_ed(ed);
|
flush_dcache_ed(ed);
|
||||||
if (ohci->ed_bulktail == NULL)
|
if (ohci->ed_bulktail == NULL)
|
||||||
ohci_writel(ed, &ohci->regs->ed_bulkhead);
|
ohci_writel((uintptr_t)ed, &ohci->regs->ed_bulkhead);
|
||||||
else
|
else
|
||||||
ohci->ed_bulktail->hwNextED =
|
ohci->ed_bulktail->hwNextED =
|
||||||
m32_swap((unsigned long)ed);
|
m32_swap((unsigned long)ed);
|
||||||
|
|
@ -753,7 +753,7 @@ static void periodic_unlink(struct ohci *ohci, volatile struct ed *ed,
|
||||||
|
|
||||||
/* ED might have been unlinked through another path */
|
/* ED might have been unlinked through another path */
|
||||||
while (*ed_p != 0) {
|
while (*ed_p != 0) {
|
||||||
if (((struct ed *)
|
if (((struct ed *)(uintptr_t)
|
||||||
m32_swap((unsigned long)ed_p)) == ed) {
|
m32_swap((unsigned long)ed_p)) == ed) {
|
||||||
*ed_p = ed->hwNextED;
|
*ed_p = ed->hwNextED;
|
||||||
aligned_ed_p = (unsigned long)ed_p;
|
aligned_ed_p = (unsigned long)ed_p;
|
||||||
|
|
@ -762,7 +762,7 @@ static void periodic_unlink(struct ohci *ohci, volatile struct ed *ed,
|
||||||
aligned_ed_p + ARCH_DMA_MINALIGN);
|
aligned_ed_p + ARCH_DMA_MINALIGN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ed_p = &(((struct ed *)
|
ed_p = &(((struct ed *)(uintptr_t)
|
||||||
m32_swap((unsigned long)ed_p))->hwNextED);
|
m32_swap((unsigned long)ed_p))->hwNextED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -798,7 +798,7 @@ static int ep_unlink(ohci_t *ohci, ed_t *edi)
|
||||||
if (ohci->ed_controltail == ed) {
|
if (ohci->ed_controltail == ed) {
|
||||||
ohci->ed_controltail = ed->ed_prev;
|
ohci->ed_controltail = ed->ed_prev;
|
||||||
} else {
|
} else {
|
||||||
((ed_t *)m32_swap(
|
((ed_t *)(uintptr_t)m32_swap(
|
||||||
*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
|
*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -819,7 +819,7 @@ static int ep_unlink(ohci_t *ohci, ed_t *edi)
|
||||||
if (ohci->ed_bulktail == ed) {
|
if (ohci->ed_bulktail == ed) {
|
||||||
ohci->ed_bulktail = ed->ed_prev;
|
ohci->ed_bulktail = ed->ed_prev;
|
||||||
} else {
|
} else {
|
||||||
((ed_t *)m32_swap(
|
((ed_t *)(uintptr_t)m32_swap(
|
||||||
*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
|
*((__u32 *)&ed->hwNextED)))->ed_prev = ed->ed_prev;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -914,12 +914,13 @@ static void td_fill(ohci_t *ohci, unsigned int info,
|
||||||
|
|
||||||
/* fill the old dummy TD */
|
/* fill the old dummy TD */
|
||||||
td = urb_priv->td [index] =
|
td = urb_priv->td [index] =
|
||||||
(td_t *)(m32_swap(urb_priv->ed->hwTailP) & ~0xf);
|
(td_t *)(uintptr_t)
|
||||||
|
(m32_swap(urb_priv->ed->hwTailP) & ~0xf);
|
||||||
|
|
||||||
td->ed = urb_priv->ed;
|
td->ed = urb_priv->ed;
|
||||||
td->next_dl_td = NULL;
|
td->next_dl_td = NULL;
|
||||||
td->index = index;
|
td->index = index;
|
||||||
td->data = (__u32)data;
|
td->data = (uintptr_t)data;
|
||||||
#ifdef OHCI_FILL_TRACE
|
#ifdef OHCI_FILL_TRACE
|
||||||
if (usb_pipebulk(urb_priv->pipe) && usb_pipeout(urb_priv->pipe)) {
|
if (usb_pipebulk(urb_priv->pipe) && usb_pipeout(urb_priv->pipe)) {
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
|
|
@ -1099,7 +1100,7 @@ static void check_status(td_t *td_list)
|
||||||
* we reverse the reversed done-list */
|
* we reverse the reversed done-list */
|
||||||
static td_t *dl_reverse_done_list(ohci_t *ohci)
|
static td_t *dl_reverse_done_list(ohci_t *ohci)
|
||||||
{
|
{
|
||||||
__u32 td_list_hc;
|
uintptr_t td_list_hc;
|
||||||
td_t *td_rev = NULL;
|
td_t *td_rev = NULL;
|
||||||
td_t *td_list = NULL;
|
td_t *td_list = NULL;
|
||||||
|
|
||||||
|
|
@ -1862,7 +1863,7 @@ static int hc_start(ohci_t *ohci)
|
||||||
ohci_writel(0, &ohci->regs->ed_controlhead);
|
ohci_writel(0, &ohci->regs->ed_controlhead);
|
||||||
ohci_writel(0, &ohci->regs->ed_bulkhead);
|
ohci_writel(0, &ohci->regs->ed_bulkhead);
|
||||||
|
|
||||||
ohci_writel((__u32)ohci->hcca,
|
ohci_writel((uintptr_t)ohci->hcca,
|
||||||
&ohci->regs->hcca); /* reset clears this */
|
&ohci->regs->hcca); /* reset clears this */
|
||||||
|
|
||||||
fminterval = 0x2edf;
|
fminterval = 0x2edf;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ static int ohci_usb_probe(struct udevice *dev)
|
||||||
extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0;
|
extra_ahb_gate_mask = 1 << AHB_GATE_OFFSET_USB_EHCI0;
|
||||||
#endif
|
#endif
|
||||||
priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
|
priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK;
|
||||||
priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST;
|
priv->phy_index = ((uintptr_t)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST;
|
||||||
priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
|
priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
|
||||||
extra_ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
|
extra_ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST;
|
||||||
priv->usb_gate_mask <<= priv->phy_index;
|
priv->usb_gate_mask <<= priv->phy_index;
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,15 @@
|
||||||
/*
|
/*
|
||||||
* e.g. PCI controllers need this
|
* e.g. PCI controllers need this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <asm/io.h>
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
|
#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
|
||||||
# define ohci_readl(a) __swap_32(*((volatile u32 *)(a)))
|
# define ohci_readl(a) __swap_32(readl(a))
|
||||||
# define ohci_writel(a, b) (*((volatile u32 *)(b)) = __swap_32((volatile u32)a))
|
# define ohci_writel(v, a) writel(__swap_32(v), a)
|
||||||
#else
|
#else
|
||||||
# define ohci_readl(a) (*((volatile u32 *)(a)))
|
# define ohci_readl(a) readl(a)
|
||||||
# define ohci_writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
|
# define ohci_writel(v, a) writel(v, a)
|
||||||
#endif /* CONFIG_SYS_OHCI_SWAP_REG_ACCESS */
|
#endif /* CONFIG_SYS_OHCI_SWAP_REG_ACCESS */
|
||||||
|
|
||||||
#if ARCH_DMA_MINALIGN > 16
|
#if ARCH_DMA_MINALIGN > 16
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,6 @@ static int xhci_usb_probe(struct udevice *dev)
|
||||||
return xhci_register(dev, ctx->hcd, hcor);
|
return xhci_register(dev, ctx->hcd, hcor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xhci_usb_remove(struct udevice *dev)
|
|
||||||
{
|
|
||||||
return xhci_deregister(dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
|
static int xhci_usb_ofdata_to_platdata(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
|
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
|
||||||
|
|
@ -89,7 +84,7 @@ U_BOOT_DRIVER(usb_xhci) = {
|
||||||
.of_match = xhci_usb_ids,
|
.of_match = xhci_usb_ids,
|
||||||
.ofdata_to_platdata = xhci_usb_ofdata_to_platdata,
|
.ofdata_to_platdata = xhci_usb_ofdata_to_platdata,
|
||||||
.probe = xhci_usb_probe,
|
.probe = xhci_usb_probe,
|
||||||
.remove = xhci_usb_remove,
|
.remove = xhci_deregister,
|
||||||
.ops = &xhci_usb_ops,
|
.ops = &xhci_usb_ops,
|
||||||
.platdata_auto_alloc_size = sizeof(struct mvebu_xhci_platdata),
|
.platdata_auto_alloc_size = sizeof(struct mvebu_xhci_platdata),
|
||||||
.priv_auto_alloc_size = sizeof(struct mvebu_xhci),
|
.priv_auto_alloc_size = sizeof(struct mvebu_xhci),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue