u8 bDmaOk;
void __iomem *pBase = pThis->pRegs;
struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd;
+ void __iomem *epio = pEnd->regs;
struct musb_qh *qh;
u16 wPacketSize;
/* protocol/endpoint/interval/NAKlimit */
if (bEnd) {
- MGC_WriteCsr8(pBase, MGC_O_HDRC_TXTYPE, bEnd,
- qh->type_reg);
+ musb_writeb(epio, MGC_O_HDRC_TXTYPE, qh->type_reg);
if (can_bulk_split(pThis, qh->type))
MGC_WriteCsr16(pBase, MGC_O_HDRC_TXMAXP, bEnd,
wPacketSize
else
MGC_WriteCsr16(pBase, MGC_O_HDRC_TXMAXP, bEnd,
wPacketSize);
- MGC_WriteCsr8(pBase, MGC_O_HDRC_TXINTERVAL, bEnd,
- qh->intv_reg);
+ musb_writeb(epio, MGC_O_HDRC_TXINTERVAL, qh->intv_reg);
} else {
- MGC_WriteCsr8(pBase, MGC_O_HDRC_NAKLIMIT0, 0,
- qh->intv_reg);
+ musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, qh->intv_reg);
if (pThis->bIsMultipoint)
- MGC_WriteCsr8(pBase, MGC_O_HDRC_TYPE0, 0,
+ musb_writeb(epio, MGC_O_HDRC_TYPE0,
qh->type_reg);
}
int status = 0;
void __iomem *pBase = pThis->pRegs;
struct musb_hw_ep *pEnd = pThis->control_ep;
+ void __iomem *epio = pEnd->regs;
struct musb_qh *qh = pEnd->in_qh;
u8 bComplete = FALSE;
irqreturn_t retval = IRQ_NONE;
MGC_SelectEnd(pBase, 0);
wCsrVal = MGC_ReadCsr16(pBase, MGC_O_HDRC_CSR0, 0);
- wCount = MGC_ReadCsr8(pBase, MGC_O_HDRC_COUNT0, 0);
+ wCount = musb_readb(epio, MGC_O_HDRC_COUNT0);
DBG(4, "<== csr0 %04x, qh %p, count %d, urb %p, stage %d\n",
wCsrVal, qh, wCount, pUrb, pThis->bEnd0Stage);
MGC_WriteCsr16(pBase, MGC_O_HDRC_CSR0, 0, wCsrVal);
}
- MGC_WriteCsr8(pBase, MGC_O_HDRC_NAKLIMIT0, 0, 0);
+ musb_writeb(epio, MGC_O_HDRC_NAKLIMIT0, 0);
/* clear it */
MGC_WriteCsr16(pBase, MGC_O_HDRC_CSR0, 0, 0);
u8 *pBuffer = NULL;
struct urb *pUrb;
struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd;
+ void __iomem *epio = pEnd->regs;
struct musb_qh *qh = pEnd->out_qh;
u32 status = 0;
void __iomem *pBase = pThis->pRegs;
MGC_WriteCsr16(pBase, MGC_O_HDRC_TXCSR, bEnd, wTxCsrVal);
/* REVISIT may need to clear FLUSHFIFO ... */
MGC_WriteCsr16(pBase, MGC_O_HDRC_TXCSR, bEnd, wTxCsrVal);
- MGC_WriteCsr8(pBase, MGC_O_HDRC_TXINTERVAL, bEnd, 0);
+ musb_writeb(epio, MGC_O_HDRC_TXINTERVAL, 0);
bDone = TRUE;
}
{
struct urb *pUrb;
struct musb_hw_ep *pEnd = pThis->aLocalEnd + bEnd;
+ void __iomem *epio = pEnd->regs;
struct musb_qh *qh = pEnd->in_qh;
size_t xfer_len;
void __iomem *pBase = pThis->pRegs;
DBG(3, "end %d RX proto error\n", bEnd);
status = -EPROTO;
- MGC_WriteCsr8(pBase, MGC_O_HDRC_RXINTERVAL, bEnd, 0);
+ musb_writeb(epio, MGC_O_HDRC_RXINTERVAL, 0);
} else if (wRxCsrVal & MGC_M_RXCSR_DATAERROR) {
xfer_len = dma->dwActualLength;
}
musb_h_flush_rxfifo(pEnd, 0);
- MGC_WriteCsr8(pBase, MGC_O_HDRC_RXINTERVAL, bEnd, 0);
+ musb_writeb(epio, MGC_O_HDRC_RXINTERVAL, 0);
bDone = TRUE;
goto finish;
}
* using hw_ep->regs, for all access except writing INDEX
*/
#ifdef MUSB_FLAT_REG
-#define MGC_ReadCsr8(_pBase, _bOffset, _bEnd) \
- musb_readb((_pBase), MGC_END_OFFSET((_bEnd), (_bOffset)))
#define MGC_ReadCsr16(_pBase, _bOffset, _bEnd) \
musb_readw((_pBase), MGC_END_OFFSET((_bEnd), (_bOffset)))
-#define MGC_WriteCsr8(_pBase, _bOffset, _bEnd, _bData) \
- musb_writeb((_pBase), MGC_END_OFFSET((_bEnd), (_bOffset)), (_bData))
#define MGC_WriteCsr16(_pBase, _bOffset, _bEnd, _bData) \
musb_writew((_pBase), MGC_END_OFFSET((_bEnd), (_bOffset)), (_bData))
#else
-#define MGC_ReadCsr8(_pBase, _bOffset, _bEnd) \
- musb_readb(_pBase, (_bOffset + 0x10))
#define MGC_ReadCsr16(_pBase, _bOffset, _bEnd) \
musb_readw(_pBase, (_bOffset + 0x10))
-#define MGC_WriteCsr8(_pBase, _bOffset, _bEnd, _bData) \
- musb_writeb(_pBase, (_bOffset + 0x10), _bData)
#define MGC_WriteCsr16(_pBase, _bOffset, _bEnd, _bData) \
musb_writew(_pBase, (_bOffset + 0x10), _bData)
#endif