Skip to content

Commit 7aed9c3

Browse files
Jouni Ukkonenjoukkone
Jouni Ukkonen
authored andcommitted
arch/arm64/imx9: Replace memcpy by while loop
libc memcpy cannot access fspi memory space correctly remove unnecessary debugassert and cache operations Signed-off-by: Jouni Ukkonen <[email protected]>
1 parent d48f2da commit 7aed9c3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

arch/arm64/src/imx9/imx9_flexspi_nor.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -790,14 +790,13 @@ static ssize_t imx9_flexspi_nor_read(struct mtd_dev_s *dev,
790790
}
791791

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

795-
up_invalidate_dcache((uintptr_t)buffer,
796-
(uintptr_t)buffer + ALIGN_UP(nbytes));
794+
int n = nbytes;
797795

798-
memcpy(buffer, src, nbytes);
799-
800-
up_clean_dcache((uintptr_t)buffer, (uintptr_t)buffer + ALIGN_UP(nbytes));
796+
while (n-- > 0)
797+
{
798+
*buffer++ = *src++;
799+
}
801800

802801
finfo("return nbytes: %d\n", (int)nbytes);
803802
return (ssize_t)nbytes;

0 commit comments

Comments
 (0)