Hi Jiaxun,
On 2026-07-01T11:17:53, Yao Zi <[email protected]> wrote:
> linux/io.h: Use map_physmem to implement ioremap
>
> ioremap API is here to be compatible with Linux drivers,
> to maintain compatibility we need to ensure we are using
> the same way to determine virtual address for IO devices
> from physical address.
>
> map_physmem is U-Boot's standard way for doing the trick,
> we should follow that. For architectures VA == PA it has
> no impact, for MIPS it has it's own ioremap implementation
> in asm/io.h anyway.
>
> Signed-off-by: Jiaxun Yang <[email protected]>
> Signed-off-by: Yao Zi <[email protected]>
>
> include/linux/io.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> diff --git a/include/linux/io.h b/include/linux/io.h
> @@ -59,11 +59,12 @@ static inline void iowrite64(u64 value, volatile void
> __iomem *addr)
> static inline void __iomem *ioremap(resource_size_t offset,
> resource_size_t size)
> {
> - return (void __iomem *)(unsigned long)offset;
> + return (void __iomem *)map_physmem(offset, size, MAP_NOCACHE);
> }
This affects sandbox, but should be fine.
Reviewed-by: Simon Glass <[email protected]>
Regards,
Simon