From patchwork Tue Jan 19 13:14:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 73864 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0JDEssb022883 for ; Tue, 19 Jan 2010 13:14:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752057Ab0ASNO4 (ORCPT ); Tue, 19 Jan 2010 08:14:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752048Ab0ASNO4 (ORCPT ); Tue, 19 Jan 2010 08:14:56 -0500 Received: from smtp.nokia.com ([192.100.105.134]:27304 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995Ab0ASNOy (ORCPT ); Tue, 19 Jan 2010 08:14:54 -0500 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0JDEAHA006872; Tue, 19 Jan 2010 07:14:53 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 15:14:50 +0200 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 19 Jan 2010 15:14:49 +0200 Received: from localhost.localdomain (esdhcp04088.research.nokia.com [172.21.40.88]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o0JDESMu002814; Tue, 19 Jan 2010 15:14:44 +0200 From: Felipe Balbi To: Tony Lindgren Cc: Linux OMAP Mailing List , felipe.balbi@nokia.com Subject: [PATCH/USB 10/16] usb: musb: clean up commit 'workaround Blackfin FIFO anomalies' Date: Tue, 19 Jan 2010 15:14:09 +0200 Message-Id: <1263906855-28341-11-git-send-email-felipe.balbi@nokia.com> X-Mailer: git-send-email 1.6.6.rc0 In-Reply-To: <1263906855-28341-1-git-send-email-felipe.balbi@nokia.com> References: <1263906855-28341-1-git-send-email-felipe.balbi@nokia.com> X-OriginalArrivalTime: 19 Jan 2010 13:14:49.0779 (UTC) FILETIME=[61304830:01CA9909] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index ad26e65..bcee133 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -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 *epio = hw_ep->regs; u8 epnum = hw_ep->epnum; - u16 dma_reg = 0; prefetch((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); if (!ANOMALY_05000380 && epnum != 0) { - flush_dcache_range((unsigned int)src, - (unsigned int)(src + len)); + u16 dma_reg; + + flush_dcache_range((unsigned long)src, + (unsigned long)(src + len)); /* 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); 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); SSYNC(); @@ -79,12 +80,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) SSYNC(); if (unlikely((unsigned long)src & 0x01)) - outsw_8((unsigned long)fifo, src, - len & 0x01 ? (len >> 1) + 1 : len >> 1); + outsw_8((unsigned long)fifo, src, (len + 1) >> 1); else - outsw((unsigned long)fifo, src, - len & 0x01 ? (len >> 1) + 1 : len >> 1); - + outsw((unsigned long)fifo, src, (len + 1) >> 1); } } /* @@ -94,19 +92,19 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) { void __iomem *fifo = hw_ep->fifo; u8 epnum = hw_ep->epnum; - u16 dma_reg = 0; if (ANOMALY_05000467 && epnum != 0) { + u16 dma_reg; - invalidate_dcache_range((unsigned int)dst, - (unsigned int)(dst + len)); + invalidate_dcache_range((unsigned long)dst, + (unsigned long)(dst + len)); /* 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); 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); SSYNC();