Commit 1ca9e9ca authored by Bryan Wu's avatar Bryan Wu Committed by Greg Kroah-Hartman

usb: musb: clean up commit 'workaround Blackfin FIFO anomalies'

The version applied had a few comments which are now
done.

Thanks to Sergei for pointing out.
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
Signed-off-by: default avatarCliff Cai <cliff.cai@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 56596923
...@@ -30,7 +30,6 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -30,7 +30,6 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
void __iomem *fifo = hw_ep->fifo; void __iomem *fifo = hw_ep->fifo;
void __iomem *epio = hw_ep->regs; void __iomem *epio = hw_ep->regs;
u8 epnum = hw_ep->epnum; u8 epnum = hw_ep->epnum;
u16 dma_reg = 0;
prefetch((u8 *)src); prefetch((u8 *)src);
...@@ -42,15 +41,17 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -42,15 +41,17 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
dump_fifo_data(src, len); dump_fifo_data(src, len);
if (!ANOMALY_05000380 && epnum != 0) { if (!ANOMALY_05000380 && epnum != 0) {
flush_dcache_range((unsigned int)src, u16 dma_reg;
(unsigned int)(src + len));
flush_dcache_range((unsigned long)src,
(unsigned long)(src + len));
/* Setup DMA address register */ /* Setup DMA address register */
dma_reg = (u16) ((u32) src & 0xFFFF); dma_reg = (u32)src;
bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_LOW), dma_reg); bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_LOW), dma_reg);
SSYNC(); SSYNC();
dma_reg = (u16) (((u32) src >> 16) & 0xFFFF); dma_reg = (u32)src >> 16;
bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_HIGH), dma_reg); bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_HIGH), dma_reg);
SSYNC(); SSYNC();
...@@ -79,12 +80,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -79,12 +80,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
SSYNC(); SSYNC();
if (unlikely((unsigned long)src & 0x01)) if (unlikely((unsigned long)src & 0x01))
outsw_8((unsigned long)fifo, src, outsw_8((unsigned long)fifo, src, (len + 1) >> 1);
len & 0x01 ? (len >> 1) + 1 : len >> 1);
else else
outsw((unsigned long)fifo, src, outsw((unsigned long)fifo, src, (len + 1) >> 1);
len & 0x01 ? (len >> 1) + 1 : len >> 1);
} }
} }
/* /*
...@@ -94,19 +92,19 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) ...@@ -94,19 +92,19 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
{ {
void __iomem *fifo = hw_ep->fifo; void __iomem *fifo = hw_ep->fifo;
u8 epnum = hw_ep->epnum; u8 epnum = hw_ep->epnum;
u16 dma_reg = 0;
if (ANOMALY_05000467 && epnum != 0) { if (ANOMALY_05000467 && epnum != 0) {
u16 dma_reg;
invalidate_dcache_range((unsigned int)dst, invalidate_dcache_range((unsigned long)dst,
(unsigned int)(dst + len)); (unsigned long)(dst + len));
/* Setup DMA address register */ /* Setup DMA address register */
dma_reg = (u16) ((u32) dst & 0xFFFF); dma_reg = (u32)dst;
bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_LOW), dma_reg); bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_LOW), dma_reg);
SSYNC(); SSYNC();
dma_reg = (u16) (((u32) dst >> 16) & 0xFFFF); dma_reg = (u32)dst >> 16;
bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_HIGH), dma_reg); bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_HIGH), dma_reg);
SSYNC(); SSYNC();
......
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