]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
net: sh-eth: Fix misaligned cache operation warning
authorNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Fri, 1 Dec 2017 04:56:08 +0000 (13:56 +0900)
committerJoe Hershberger <joe.hershberger@ni.com>
Mon, 15 Jan 2018 18:05:26 +0000 (12:05 -0600)
When we using network on board using sh-eth, it prints a lot of
"CACHE: Misaligned operation at range" messages.
This commit fixes this problem.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/sh_eth.c

index f28f388ea928996cb72d36053e1dea5d39a2608b..6edb51e12fa6da8f4849eaf3573e86487614c3c5 100644 (file)
@@ -29,7 +29,8 @@
 
 #if defined(CONFIG_SH_ETHER_CACHE_WRITEBACK) && !defined(CONFIG_SYS_DCACHE_OFF)
 #define flush_cache_wback(addr, len)    \
-               flush_dcache_range((u32)addr, (u32)(addr + len - 1))
+               flush_dcache_range((u32)addr, \
+               (u32)(addr + ALIGN(len, CONFIG_SH_ETHER_ALIGNE_SIZE)))
 #else
 #define flush_cache_wback(...)
 #endif
@@ -205,7 +206,7 @@ static int sh_eth_tx_desc_init(struct sh_eth_dev *eth)
                goto err;
        }
 
-       flush_cache_wback((u32)port_info->tx_desc_alloc, alloc_desc_size);
+       flush_cache_wback(port_info->tx_desc_alloc, alloc_desc_size);
 
        /* Make sure we use a P2 address (non-cacheable) */
        port_info->tx_desc_base =