mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 16:59:28 +08:00
arch/arm/samv7/sam_progmem: insert DMB instruction into data write loop
This change fix the regression that was introduced with https://github.com/apache/incubator-nuttx/pull/4904 In case if D-Cache in configured in Write-Through mode there is Cortex-M7 erata 1313001 that describes a situation when linefill buffer or cache contains stale data. Even if progmem write loop does not fully matches the description there is a possibility to program stale data if there is no DMB instruction after each write operation to progmem latch buffer. Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
74a4394352
commit
e545c440f4
@@ -582,6 +582,10 @@ ssize_t up_progmem_write(size_t address, const void *buffer, size_t buflen)
|
|||||||
for (i = 0; i < SAMV7_PAGE_WORDS; i++)
|
for (i = 0; i < SAMV7_PAGE_WORDS; i++)
|
||||||
{
|
{
|
||||||
*dest++ = *src++;
|
*dest++ = *src++;
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARMV7M_DCACHE_WRITETHROUGH
|
||||||
|
ARM_DMB();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush the data cache to memory */
|
/* Flush the data cache to memory */
|
||||||
|
|||||||
Reference in New Issue
Block a user