void __iomem *fifo;
void __iomem *regs;
+#ifdef CONFIG_USB_TUSB6010
+ void __iomem *conf;
+#endif
+
/* index in musb->aLocalEnd[] */
u8 bLocalEnd;
#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
#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;
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;
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;