summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2016-06-24 11:22:43 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2016-06-24 11:24:09 +0200
commit14de20f15b382129b246ef51c719b848b7d45001 (patch)
tree8270e8517993640fc825c5ac496a6c12162104ac /c
parentMAINTAINERS: added self (diff)
downloadrtems-14de20f15b382129b246ef51c719b848b7d45001.tar.bz2
arm/raspberrypi: Force VC mail box buffer to be synchronized through cache.
This solution is quick fix until CPU_DATA_CACHE_ALIGNMENT is defined and cache manager is checked on all Raspberry Pi variants.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/arm/raspberrypi/misc/vc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c b/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
index 91f9174edc..e44d83ffde 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
+++ b/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
@@ -34,6 +34,7 @@
static inline bool
bcm2835_mailbox_buffer_suceeded(const bcm2835_mbox_buf_hdr *hdr)
{
+ RTEMS_COMPILER_MEMORY_BARRIER();
return (hdr->buf_code == BCM2835_MBOX_BUF_CODE_REQUEST_SUCCEED);
}
@@ -58,11 +59,22 @@ bcm2835_mailbox_buffer_flush_and_invalidate(void *buf, size_t size)
sctlr_val = arm_cp15_get_control();
+ RTEMS_COMPILER_MEMORY_BARRIER();
arm_cp15_drain_write_buffer();
if (sctlr_val & (ARM_CP15_CTRL_C | ARM_CP15_CTRL_M)) {
- arm_cp15_drain_write_buffer();
+#if 0
+ /*
+ These architecture independent RTEMS API functions should be
+ used there but CPU_DATA_CACHE_ALIGNMENT is not defined
+ for ARM architecture version used on RPi and functions
+ are dummy for now and do not provide required synchronization
+ */
rtems_cache_flush_multiple_data_lines(buf, size);
rtems_cache_invalidate_multiple_data_lines(buf, size);
+#else
+ /* Flush complete data cache */
+ arm_cp15_data_cache_clean_and_invalidate();
+#endif
}
}