diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2023-05-24 14:53:58 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2023-06-08 09:48:44 -0500 |
commit | 09fd5dd3539d11529016a31495b44a9cb82413e3 (patch) | |
tree | 5274947a7f9962d365dbb704e9eeef5ac9663a03 /bsps/shared | |
parent | bsps/xqspipsu: Calculate erase sectors correctly (diff) | |
download | rtems-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.c | 16 |
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; +} |