mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] asm-generic: define IOMEM for assembly as well
@ 2023-01-09 17:58 Ahmad Fatoum
  2023-01-10 14:38 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-01-09 17:58 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

In interest of type safety, we should start using IOMEM() for register
MMIO base addresses that we keep in headers for PBL. Some of these
addresses are used from assembly code as well, so define IOMEM() for
that case.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 include/asm-generic/io.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index e41b4df40366..51f65ceb0a2e 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -442,7 +442,11 @@ static inline void *phys_to_virt(unsigned long phys)
 #endif
 
 #ifndef IOMEM
+#ifndef __ASSEMBLY__
 #define IOMEM(addr)	((void __force __iomem *)(addr))
+#else
+#define IOMEM(addr)	addr
+#endif
 #endif
 
 #define __io_virt(x) ((void __force *)(x))
-- 
2.38.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] asm-generic: define IOMEM for assembly as well
  2023-01-09 17:58 [PATCH] asm-generic: define IOMEM for assembly as well Ahmad Fatoum
@ 2023-01-10 14:38 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-01-10 14:38 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, Jan 09, 2023 at 06:58:28PM +0100, Ahmad Fatoum wrote:
> In interest of type safety, we should start using IOMEM() for register
> MMIO base addresses that we keep in headers for PBL. Some of these
> addresses are used from assembly code as well, so define IOMEM() for
> that case.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
>  include/asm-generic/io.h | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index e41b4df40366..51f65ceb0a2e 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -442,7 +442,11 @@ static inline void *phys_to_virt(unsigned long phys)
>  #endif
>  
>  #ifndef IOMEM
> +#ifndef __ASSEMBLY__
>  #define IOMEM(addr)	((void __force __iomem *)(addr))
> +#else
> +#define IOMEM(addr)	addr
> +#endif
>  #endif
>  
>  #define __io_virt(x) ((void __force *)(x))
> -- 
> 2.38.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-10 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 17:58 [PATCH] asm-generic: define IOMEM for assembly as well Ahmad Fatoum
2023-01-10 14:38 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox