summaryrefslogtreecommitdiffstats
path: root/bsps/shared
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2023-05-24 14:53:58 -0500
committerJoel Sherrill <joel@rtems.org>2023-06-08 09:48:44 -0500
commit09fd5dd3539d11529016a31495b44a9cb82413e3 (patch)
tree5274947a7f9962d365dbb704e9eeef5ac9663a03 /bsps/shared
parentbsps/xqspipsu: Calculate erase sectors correctly (diff)
downloadrtems-09fd5dd3539d11529016a31495b44a9cb82413e3.tar.bz2
bsps/xqspipsu: Use device information from the FCT
Instead of statically defining the device parameters, use the device information available via the NOR device layer's Flash Configuration Table.
Diffstat (limited to 'bsps/shared')
-rw-r--r--bsps/shared/dev/spi/xqspipsu-flash-helper.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bsps/shared/dev/spi/xqspipsu-flash-helper.c b/bsps/shared/dev/spi/xqspipsu-flash-helper.c
index cb705ab505..4e018bf2fa 100644
--- a/bsps/shared/dev/spi/xqspipsu-flash-helper.c
+++ b/bsps/shared/dev/spi/xqspipsu-flash-helper.c
@@ -2258,3 +2258,19 @@ static int MultiDieReadEcc(
}
return 0;
}
+
+u32 QspiPsu_NOR_Get_Sector_Size(XQspiPsu *QspiPsuPtr)
+{
+ if(QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_PARALLEL) {
+ return Flash_Config_Table[FCTIndex].SectSize * 2;
+ }
+ return Flash_Config_Table[FCTIndex].SectSize;
+}
+
+u32 QspiPsu_NOR_Get_Device_Size(XQspiPsu *QspiPsuPtr)
+{
+ if(QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_STACKED) {
+ return Flash_Config_Table[FCTIndex].FlashDeviceSize * 2;
+ }
+ return Flash_Config_Table[FCTIndex].FlashDeviceSize;
+}