mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
bsps/xnandpsu: Ensure buffer cache sync
When a buffer is modified by both hardware components such as DMA and by software components, the buffer cache state must be kept in sync so that data is not accidentally thrown away during future invalidations.
This commit is contained in:
committed by
Joel Sherrill
parent
2b5526aa5e
commit
41d43cef6c
@@ -1619,6 +1619,12 @@ s32 XNandPsu_Read(XNandPsu *InstancePtr, u64 Offset, u64 Length, u8 *DestBuf)
|
||||
}
|
||||
if (PartialBytes > 0U) {
|
||||
(void)Xil_MemCpy(DestBufPtr, BufPtr + Col, NumBytes);
|
||||
#ifdef __rtems__
|
||||
/* The destination buffer is touched by hardware, synchronize */
|
||||
if (InstancePtr->Config.IsCacheCoherent == 0) {
|
||||
Xil_DCacheFlushRange((INTPTR)(void *)DestBufPtr, NumBytes);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
DestBufPtr += NumBytes;
|
||||
OffsetVar += NumBytes;
|
||||
|
||||
Reference in New Issue
Block a user