From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Stein Date: Sat, 4 Jul 2015 11:48:43 +0200 Subject: [U-Boot] [PATCH 4/5] arm/mach-bcm283x/mbox: Flush and invalidate dcache when using fw mailbox In-Reply-To: <1436003324-8769-1-git-send-email-alexanders83@web.de> References: <1436003324-8769-1-git-send-email-alexanders83@web.de> Message-ID: <1436003324-8769-5-git-send-email-alexanders83@web.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When using dcache the setup data for the mailbox must be actually written into memory before calling into firmware. Thus flush and invalidate the memory. Signed-off-by: Alexander Stein --- arch/arm/mach-bcm283x/mbox.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-bcm283x/mbox.c b/arch/arm/mach-bcm283x/mbox.c index 1af9be7..237c76c 100644 --- a/arch/arm/mach-bcm283x/mbox.c +++ b/arch/arm/mach-bcm283x/mbox.c @@ -111,6 +111,12 @@ 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 + + buffer->buf_size)); + invalidate_dcache_range((unsigned long)buffer, + (unsigned long)((void *)buffer + + buffer->buf_size)); ret = bcm2835_mbox_call_raw(chan, phys_to_bus((u32)buffer), &rbuffer); if (ret) return ret; -- 2.4.5