mtd/progmem: fix incorrect range of cache invalidatation on erase
up_progmem_erasepage() is invalidating too small range of data cache. We
should invalidate whole region of block unit which might be different
with page size. This fixes the smart and smartfs malfunctioning when
block and page units different.
@@ -129,12 +129,12 @@ ssize_t up_progmem_erasepage(size_t page)
s5j_sflash_enable_wp();
/* Invalidate cache */
- arch_invalidate_dcache(addr, addr + up_progmem_pagesize(page));
+ arch_invalidate_dcache(addr, addr + up_progmem_blocksize());
/* Restore IRQs */
irqrestore(irqs);
- return up_progmem_pagesize(page);
+ return up_progmem_blocksize();
}
ssize_t up_progmem_ispageerased(size_t page)
