]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/mach-bcm283x/mbox.c
arm/mach-bcm283x/mbox: Flush and invalidate dcache when using fw mailbox
[karo-tx-uboot.git] / arch / arm / mach-bcm283x / mbox.c
index 1af9be78c68a3ccb5ba019a3f1e95e9122160142..311bd8feaab071fdb7ffdb23477ef8c68cdbcd23 100644 (file)
@@ -111,9 +111,18 @@ int bcm2835_mbox_call_prop(u32 chan, struct bcm2835_mbox_hdr *buffer)
        dump_buf(buffer);
 #endif
 
+       flush_dcache_range((unsigned long)buffer,
+                          (unsigned long)((void *)buffer +
+                          roundup(buffer->buf_size, ARCH_DMA_MINALIGN)));
+
        ret = bcm2835_mbox_call_raw(chan, phys_to_bus((u32)buffer), &rbuffer);
        if (ret)
                return ret;
+
+       invalidate_dcache_range((unsigned long)buffer,
+                               (unsigned long)((void *)buffer +
+                               roundup(buffer->buf_size, ARCH_DMA_MINALIGN)));
+
        if (rbuffer != phys_to_bus((u32)buffer)) {
                printf("mbox: Response buffer mismatch\n");
                return -1;