From 09fd5dd3539d11529016a31495b44a9cb82413e3 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Wed, 24 May 2023 14:53:58 -0500 Subject: 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. --- bsps/shared/dev/spi/xqspipsu-flash-helper.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'bsps/shared') 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; +} -- cgit v1.2.3