summaryrefslogtreecommitdiff
path: root/drivers/net/designware.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2014-09-15 00:50:37 +0200
committerMarek Vasut <marex@denx.de>2014-10-06 17:36:40 +0200
commit4f68678b1941af7d75f391d1189c776fb434dc08 (patch)
tree92b9959a2a139e236bdb731da2eee9ee977e802b /drivers/net/designware.c
parent58ec63d6bcbe392ebed83197c90dc743f3b9e701 (diff)
downloadu-boot-imx-4f68678b1941af7d75f391d1189c776fb434dc08.zip
u-boot-imx-4f68678b1941af7d75f391d1189c776fb434dc08.tar.gz
u-boot-imx-4f68678b1941af7d75f391d1189c776fb434dc08.tar.bz2
net: dwc: Fix cache alignment issues
Fix remaining cache alignment issues in the DWC Ethernet driver. Please note that the cache handling in the driver is making the code hideous and thus the next patch cleans that up. In order to make this change reviewable though, the cleanup is split from it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@altera.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Tom Rini <trini@ti.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Pavel Machek <pavel@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Acked-by: Pavel Machek <pavel@denx.de>
Diffstat (limited to 'drivers/net/designware.c')
-rw-r--r--drivers/net/designware.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 7186e3b..aaf146d 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -303,7 +303,8 @@ static int dw_eth_send(struct eth_device *dev, void *packet, int length)
/* Flush data to be sent */
flush_dcache_range((unsigned long)desc_p->dmamac_addr,
- (unsigned long)desc_p->dmamac_addr + length);
+ (unsigned long)desc_p->dmamac_addr +
+ roundup(length, ARCH_DMA_MINALIGN));
#if defined(CONFIG_DW_ALTDESCRIPTOR)
desc_p->txrx_status |= DESC_TXSTS_TXFIRST | DESC_TXSTS_TXLAST;
@@ -372,7 +373,8 @@ static int dw_eth_recv(struct eth_device *dev)
/* Flush only status field - others weren't changed */
flush_dcache_range((unsigned long)&desc_p->txrx_status,
(unsigned long)&desc_p->txrx_status +
- sizeof(desc_p->txrx_status));
+ roundup(sizeof(desc_p->txrx_status),
+ ARCH_DMA_MINALIGN));
/* Test the wrap-around condition. */
if (++desc_num >= CONFIG_RX_DESCR_NUM)