summaryrefslogtreecommitdiffstats
path: root/bsps/aarch64
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2023-10-18 15:33:45 -0500
committerJoel Sherrill <joel@rtems.org>2023-10-27 11:33:44 -0500
commit3339afb82eb198bf7b8a3f8f7d2e51d2f274cd2a (patch)
tree4ce2934d2dee5b00fb5273e43a34f0a2a4300bb5 /bsps/aarch64
parentvalidation: Add wrapped bsp_interrupt_dispatch for MicroBlaze (diff)
downloadrtems-3339afb82eb198bf7b8a3f8f7d2e51d2f274cd2a.tar.bz2
bsps/aarch64/zynqmp/nand: Erase using offset
Prefer use of XNandPsu_Erase instead of XNandPsu_EraseBlock since the XNandPsu driver does not expose the primitives necessary to ensure device readiness after the operation is complete.
Diffstat (limited to 'bsps/aarch64')
-rw-r--r--bsps/aarch64/xilinx-zynqmp/jffs2_xnandpsu.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/bsps/aarch64/xilinx-zynqmp/jffs2_xnandpsu.c b/bsps/aarch64/xilinx-zynqmp/jffs2_xnandpsu.c
index ab0eb1ccd5..cf2a7d8192 100644
--- a/bsps/aarch64/xilinx-zynqmp/jffs2_xnandpsu.c
+++ b/bsps/aarch64/xilinx-zynqmp/jffs2_xnandpsu.c
@@ -105,21 +105,15 @@ static int flash_erase(
{
XNandPsu *nandpsu = get_flash_control(super)->nandpsu;
rtems_status_code sc;
- uint32_t BlockSize = nandpsu->Geometry.BlockSize;
- uint32_t DeviceSize = nandpsu->Geometry.DeviceSize;
- uint32_t BlockIndex;
- uint32_t DeviceIndex;
+ uint64_t BlockSize = nandpsu->Geometry.BlockSize;
if (offset > nandpsu->Geometry.DeviceSize) {
return -EIO;
}
- DeviceIndex = offset / DeviceSize;
- BlockIndex = (offset % DeviceSize) / BlockSize;
-
/* Perform erase operation. */
rtems_mutex_lock(&(get_flash_control(super)->access_lock));
- sc = XNandPsu_EraseBlock(nandpsu, DeviceIndex, BlockIndex);
+ sc = XNandPsu_Erase(nandpsu, RTEMS_ALIGN_DOWN(offset, BlockSize), BlockSize);
rtems_mutex_unlock(&(get_flash_control(super)->access_lock));
if (sc ) {
return -EIO;