bsps/xnandpsu: Always wrap page to device size

The xnandpsu driver conditionally tries to wrap page index to NAND chip
size causing an off-by-one error where the first page of the second chip
is not wrapped correctly. This removes the conditional so that page
index is always wrapped.
This commit is contained in:
Kinsey Moore
2023-10-19 14:20:25 -05:00
committed by Joel Sherrill
parent 3363fabb9d
commit bb6ed3bed7

View File

@@ -1482,7 +1482,11 @@ s32 XNandPsu_Write(XNandPsu *InstancePtr, u64 Offset, u64 Length, u8 *SrcBuf)
}
Target = (u32) (OffsetVar/InstancePtr->Geometry.TargetSize);
#ifdef __rtems__
{
#else
if (Page > InstancePtr->Geometry.NumTargetPages) {
#endif
Page %= InstancePtr->Geometry.NumTargetPages;
}
@@ -1597,7 +1601,11 @@ s32 XNandPsu_Read(XNandPsu *InstancePtr, u64 Offset, u64 Length, u8 *DestBuf)
}
Target = (u32) (OffsetVar/InstancePtr->Geometry.TargetSize);
#ifdef __rtems__
{
#else
if (Page > InstancePtr->Geometry.NumTargetPages) {
#endif
Page %= InstancePtr->Geometry.NumTargetPages;
}
/* Check if partial read */