summaryrefslogtreecommitdiffstats
path: root/bsps/shared/dev/spi/xqspipsu-flash-helper.c
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2023-06-21 10:47:33 -0500
committerJoel Sherrill <joel@rtems.org>2023-06-22 10:46:33 -0500
commit333fd02631196f5d0034903f8634bcced32684d0 (patch)
tree72ff573db85e9f98336f1bb091d1f1abecae394e /bsps/shared/dev/spi/xqspipsu-flash-helper.c
parentbsps/sparc: Deprecate BSP-specific interrupt API (diff)
downloadrtems-333fd02631196f5d0034903f8634bcced32684d0.tar.bz2
bsps/xqspipsu: Handle SMP systems properly
The NOR driver was not written with SMP systems and caching in mind. This makes the IsBusy flag volatile for updates across cores and introduces cache flushing and invalidation where necessary for data manipulated by the DMA engine in the QSPI peripheral.
Diffstat (limited to 'bsps/shared/dev/spi/xqspipsu-flash-helper.c')
-rw-r--r--bsps/shared/dev/spi/xqspipsu-flash-helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bsps/shared/dev/spi/xqspipsu-flash-helper.c b/bsps/shared/dev/spi/xqspipsu-flash-helper.c
index 4e018bf2fa..c9d8273b87 100644
--- a/bsps/shared/dev/spi/xqspipsu-flash-helper.c
+++ b/bsps/shared/dev/spi/xqspipsu-flash-helper.c
@@ -314,6 +314,7 @@ static int FlashReadID(XQspiPsu *QspiPsuPtr)
}
while (TransferInProgress);
+ rtems_cache_invalidate_multiple_data_lines(ReadBfrPtr, 3);
/* In case of dual, read both and ensure they are same make/size */
/*
@@ -860,6 +861,7 @@ int QspiPsu_NOR_Read(
while (TransferInProgress);
}
+ rtems_cache_invalidate_multiple_data_lines(ReadBuffer, ByteCount);
return 0;
}
@@ -1047,6 +1049,7 @@ static int MultiDieRead(
Address += data_len;
remain_len -= data_len;
}
+ rtems_cache_invalidate_multiple_data_lines(ReadBfrPtr, ByteCount);
return 0;
}