Skip to content

Commit

Permalink
arch/arm64/imx9: Replace memcpy by while loop
Browse files Browse the repository at this point in the history
libc memcpy cannot access fspi memory space correctly
remove unnecessary debugassert

Signed-off-by: Jouni Ukkonen <[email protected]>
  • Loading branch information
joukkone committed Nov 26, 2024
1 parent 59e8e98 commit da05a18
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/arm64/src/imx9/imx9_flexspi_nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,12 +790,15 @@ static ssize_t imx9_flexspi_nor_read(struct mtd_dev_s *dev,
}

src = priv->ahb_base + offset;
DEBUGASSERT(((uintptr_t)src & ALIGN_MASK) == 0);

up_invalidate_dcache((uintptr_t)buffer,
(uintptr_t)buffer + ALIGN_UP(nbytes));
int n = nbytes;

memcpy(buffer, src, nbytes);
while (n-- > 0)
{
*buffer++ = *src++;
}

up_clean_dcache((uintptr_t)buffer, (uintptr_t)buffer + ALIGN_UP(nbytes));

Expand Down

0 comments on commit da05a18

Please sign in to comment.