diff mbox series

[U-Boot,v3,19/31] kconfig: Introduce HAVE_ARCH_IOMAP

Message ID 1539595287-31378-20-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Simon Glass
Headers show
Series virtio: Introduce VirtIO driver support | expand

Commit Message

Bin Meng Oct. 15, 2018, 9:21 a.m. UTC
Introduce a new Kconfig option for architecture codes to control
whether it provides io{read,write}{8,16,32} I/O accessor functions.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 include/linux/io.h | 4 ++++
 lib/Kconfig        | 6 ++++++
 2 files changed, 10 insertions(+)

Comments

Simon Glass Oct. 24, 2018, 5:31 p.m. UTC | #1
Introduce a new Kconfig option for architecture codes to control
whether it provides io{read,write}{8,16,32} I/O accessor functions.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 include/linux/io.h | 4 ++++
 lib/Kconfig        | 6 ++++++
 2 files changed, 10 insertions(+)

Applied to u-boot-dm/next, thanks!
diff mbox series

Patch

diff --git a/include/linux/io.h b/include/linux/io.h
index d1b3efe..9badab4 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -7,6 +7,7 @@ 
 #include <linux/types.h>
 #include <asm/io.h>
 
+#ifndef CONFIG_HAVE_ARCH_IOMAP
 static inline u8 ioread8(const volatile void __iomem *addr)
 {
 	return readb(addr);
@@ -21,6 +22,7 @@  static inline u32 ioread32(const volatile void __iomem *addr)
 {
 	return readl(addr);
 }
+#endif /* !CONFIG_HAVE_ARCH_IOMAP */
 
 #ifdef CONFIG_64BIT
 static inline u64 ioread64(const volatile void __iomem *addr)
@@ -29,6 +31,7 @@  static inline u64 ioread64(const volatile void __iomem *addr)
 }
 #endif /* CONFIG_64BIT */
 
+#ifndef CONFIG_HAVE_ARCH_IOMAP
 static inline void iowrite8(u8 value, volatile void __iomem *addr)
 {
 	writeb(value, addr);
@@ -43,6 +46,7 @@  static inline void iowrite32(u32 value, volatile void __iomem *addr)
 {
 	writel(value, addr);
 }
+#endif /* !CONFIG_HAVE_ARCH_IOMAP */
 
 #ifdef CONFIG_64BIT
 static inline void iowrite64(u64 value, volatile void __iomem *addr)
diff --git a/lib/Kconfig b/lib/Kconfig
index ccab426..847e797 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -21,6 +21,12 @@  config DYNAMIC_CRC_TABLE
 	  Enable this option to calculate entries for CRC tables at runtime.
 	  This can be helpful when reducing the size of the build image
 
+config HAVE_ARCH_IOMAP
+	bool
+	help
+	  Enable this option if architecture provides io{read,write}{8,16,32}
+	  I/O accessor functions.
+
 config HAVE_PRIVATE_LIBGCC
 	bool