]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mmc: dw_mmc: Fix cache alignment issue
authorMarek Vasut <marex@denx.de>
Sun, 14 Sep 2014 23:18:15 +0000 (01:18 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 6 Oct 2014 15:34:40 +0000 (17:34 +0200)
The DMA descriptors used by the DW MMC block must be aligned to cacheline
size, otherwise we are unable to properly flush/inval cache over them and
we get data corruption.

The reason I chose this approach of expanding the structure is because
the driver allocates the descriptors in bulk. This approach does waste
space by inserting slop inbetween the descriptors, but it makes access
to the descriptors easy as the compiler does know the real size of the
structure. It also makes cache operations easy, since the size of the
structure is cache aligned and the structure start address is as well.

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: Pantelis Antoniou <panto@antoniou-consulting.com>
Acked-by: Pavel Machek <pavel@denx.de>
include/dwmmc.h

index b67f11b113fe8a66f9084e992a20c85d34906a36..109f7c8ac7f7e677c5357b7ab3bbf55d984a1859 100644 (file)
@@ -157,7 +157,7 @@ struct dwmci_idmac {
        u32 cnt;
        u32 addr;
        u32 next_addr;
-};
+} __aligned(ARCH_DMA_MINALIGN);
 
 static inline void dwmci_writel(struct dwmci_host *host, int reg, u32 val)
 {