[PATCH 01/11] lib: Import iomem_copy from Linux Kernel

Kumar, Udit u-kumar1 at ti.com
Mon Oct 13 20:11:25 CEST 2025


On 10/13/2025 8:19 AM, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan at nxp.com>
>
> memcpy_{from,to}io and memset_io is needed for i.MX8M to write
> TCM area. So import the APIs from Linux Kernel 6.17.
>
> Reviewed-by: Ye Li <ye.li at nxp.com>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>   include/asm-generic/io.h |  37 +++++++++++++
>   lib/Makefile             |   1 +
>   lib/iomem_copy.c         | 136 +++++++++++++++++++++++++++++++++++++++++++++++

>   3 files changed, 174 insertions(+)
>
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index 13d99cfb5973399209c00adee0080ff83414c064..cf981ad3501f935c714b7580536540e7aba249c1 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -3,6 +3,7 @@
>    * Generic I/O functions.
>    *
>    * Copyright (c) 2016 Imagination Technologies Ltd.
> + * Copyright 2025 NXP
>    */
>   
>   #ifndef __ASM_GENERIC_IO_H__
> @@ -453,5 +454,41 @@ static inline void iowrite64_rep(volatile void __iomem *addr,
>   #endif
>   #endif /* CONFIG_64BIT */
>   
> +#ifndef memset_io

If you are on arm, then

arch/arm/include/asm/io.h defines these io functions, for ARM64 and 
non-ARM64 platform,

In your SOC, how this works.

> +/**
> + * memset_io -	Set a range of I/O memory to a constant value
> + * @addr:	The beginning of the I/O-memory range to set
> + * @val:	The value to set the memory to
> + * @count:	The number of bytes to set
> + *
> + * Set a range of I/O memory to a given value.
> + */
> +void memset_io(volatile void __iomem *addr, int val, size_t count);
> +#endif
> +
> +#ifndef memcpy_fromio
> +/**
> [..]



More information about the U-Boot mailing list