Commit a125babc authored by Tony Lindgren's avatar Tony Lindgren

MUSB: Fix TUSB register access

TUSB uses non-flat register model, and also has TUSB specific
ep registers in addition to shared MUSB ep registers.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6c2e4b39
......@@ -329,6 +329,10 @@ struct musb_hw_ep {
void __iomem *fifo;
void __iomem *regs;
#ifdef CONFIG_USB_TUSB6010
void __iomem *conf;
#endif
/* index in musb->aLocalEnd[] */
u8 bLocalEnd;
......
......@@ -108,8 +108,7 @@
#ifdef CONFIG_USB_TUSB6010
/* TUSB6010 EP0 configuration register is special */
#define MGC_TUSB_OFFSET(_bEnd, _bOffset) \
(_bEnd ? (0x400 + (((_bEnd - 1) & 0xf) << 2) + (_bOffset)) : \
((_bEnd - 0x400) + TUSB_EP0_CONF + (_bOffset)))
(0x10 + _bOffset)
#include "tusb6010.h" /* needed "only" for TUSB_EP0_CONF */
#endif
......
......@@ -1127,6 +1127,10 @@ static int __devinit musb_core_init(u16 wType, struct musb *pThis)
#ifdef CONFIG_USB_TUSB6010
hw_ep->fifo_async = pThis->async + 0x400 + MUSB_FIFO_OFFSET(i);
hw_ep->fifo_sync = pThis->sync + 0x400 + MUSB_FIFO_OFFSET(i);
if (i == 0)
hw_ep->conf = pBase - 0x400 + TUSB_EP0_CONF;
else
hw_ep->conf = pBase + 0x400 + (((i - 1) & 0xf) << 2);
#endif
hw_ep->regs = MGC_END_OFFSET(i, 0) + pBase;
......
......@@ -34,7 +34,7 @@
void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf)
{
void __iomem *ep_conf = hw_ep->regs;
void __iomem *ep_conf = hw_ep->conf;
void __iomem *fifo = hw_ep->fifo;
u8 epnum = hw_ep->bLocalEnd;
u8 *bufp = (u8 *)buf;
......@@ -90,7 +90,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf)
void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
{
void __iomem *ep_conf = hw_ep->regs;
void __iomem *ep_conf = hw_ep->conf;
void __iomem *fifo = hw_ep->fifo;
u8 epnum = hw_ep->bLocalEnd;
u8 *bufp = (u8 *)buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment