]> git.sur5r.net Git - u-boot/commitdiff
net/designware: ensure device private data is DMA aligned.
authorIan Campbell <ijc@hellion.org.uk>
Thu, 8 May 2014 21:26:32 +0000 (22:26 +0100)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sun, 25 May 2014 15:23:12 +0000 (17:23 +0200)
struct dw_eth_dev contains fields which are accessed via DMA, so make sure it
is aligned to a dma boundary. Without this I see:
    ERROR: v7_dcache_inval_range - start address is not aligned - 0x7fb677e0

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Reviewed-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Marek Vasut <marex@denx.de>
drivers/net/designware.c

index 78751b2600c683a9bb9079c0a28b8c7beeab266c..41ab3ac0b6fd0cb9d72a9d03ac0d0526bf9edc6e 100644 (file)
@@ -414,7 +414,8 @@ int designware_initialize(ulong base_addr, u32 interface)
         * Since the priv structure contains the descriptors which need a strict
         * buswidth alignment, memalign is used to allocate memory
         */
-       priv = (struct dw_eth_dev *) memalign(16, sizeof(struct dw_eth_dev));
+       priv = (struct dw_eth_dev *) memalign(ARCH_DMA_MINALIGN,
+                                             sizeof(struct dw_eth_dev));
        if (!priv) {
                free(dev);
                return -ENOMEM;