[rtems commit] bsps/qspipsu: Calculate correct parallel mode size

Joel Sherrill joel at rtems.org
Mon Feb 19 15:26:18 UTC 2024


Module:    rtems
Branch:    master
Commit:    8f8f04323488c802033ebb0cc4d2888e6774f999
Changeset: http://git.rtems.org/rtems/commit/?id=8f8f04323488c802033ebb0cc4d2888e6774f999

Author:    Kinsey Moore <kinsey.moore at oarcorp.com>
Date:      Mon Feb 12 11:13:23 2024 -0600

bsps/qspipsu: Calculate correct parallel mode size

Stacked mode doubles the number of sectors and device size while
parallel mode doubles the sector size and the device size. Make sure
that this is accounted for in the device size accessor.

---

 bsps/shared/dev/spi/xqspipsu-flash-helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bsps/shared/dev/spi/xqspipsu-flash-helper.c b/bsps/shared/dev/spi/xqspipsu-flash-helper.c
index 69c4035e6a..10e1066173 100644
--- a/bsps/shared/dev/spi/xqspipsu-flash-helper.c
+++ b/bsps/shared/dev/spi/xqspipsu-flash-helper.c
@@ -2333,7 +2333,8 @@ u32 QspiPsu_NOR_Get_Sector_Size(XQspiPsu *QspiPsuPtr)
 
 u32 QspiPsu_NOR_Get_Device_Size(XQspiPsu *QspiPsuPtr)
 {
-  if(QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_STACKED) {
+  if(QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_STACKED
+     || QspiPsuPtr->Config.ConnectionMode == XQSPIPSU_CONNECTION_MODE_PARALLEL) {
     return Flash_Config_Table[FCTIndex].FlashDeviceSize * 2;
   }
   return Flash_Config_Table[FCTIndex].FlashDeviceSize;



More information about the vc mailing list