aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Meng2018-10-15 04:21:15 -0500
committerSimon Glass2018-11-14 11:16:27 -0600
commit2895c4b7d65e1a65f7d8804126f91ee91e8e2481 (patch)
treef860e20b97f39bb6c64d85582866c3cdc60f8194
parent440d9a47f7ac442194685845ae2cca90e62cb0fd (diff)
downloadu-boot-2895c4b7d65e1a65f7d8804126f91ee91e8e2481.tar.gz
u-boot-2895c4b7d65e1a65f7d8804126f91ee91e8e2481.tar.xz
u-boot-2895c4b7d65e1a65f7d8804126f91ee91e8e2481.zip
kconfig: Introduce HAVE_ARCH_IOMAP
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>
-rw-r--r--include/linux/io.h4
-rw-r--r--lib/Kconfig6
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/io.h b/include/linux/io.h
index d1b3efed9d..9badab49b0 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -7,6 +7,7 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <asm/io.h> 8#include <asm/io.h>
9 9
10#ifndef CONFIG_HAVE_ARCH_IOMAP
10static inline u8 ioread8(const volatile void __iomem *addr) 11static inline u8 ioread8(const volatile void __iomem *addr)
11{ 12{
12 return readb(addr); 13 return readb(addr);
@@ -21,6 +22,7 @@ static inline u32 ioread32(const volatile void __iomem *addr)
21{ 22{
22 return readl(addr); 23 return readl(addr);
23} 24}
25#endif /* !CONFIG_HAVE_ARCH_IOMAP */
24 26
25#ifdef CONFIG_64BIT 27#ifdef CONFIG_64BIT
26static inline u64 ioread64(const volatile void __iomem *addr) 28static inline u64 ioread64(const volatile void __iomem *addr)
@@ -29,6 +31,7 @@ static inline u64 ioread64(const volatile void __iomem *addr)
29} 31}
30#endif /* CONFIG_64BIT */ 32#endif /* CONFIG_64BIT */
31 33
34#ifndef CONFIG_HAVE_ARCH_IOMAP
32static inline void iowrite8(u8 value, volatile void __iomem *addr) 35static inline void iowrite8(u8 value, volatile void __iomem *addr)
33{ 36{
34 writeb(value, addr); 37 writeb(value, addr);
@@ -43,6 +46,7 @@ static inline void iowrite32(u32 value, volatile void __iomem *addr)
43{ 46{
44 writel(value, addr); 47 writel(value, addr);
45} 48}
49#endif /* !CONFIG_HAVE_ARCH_IOMAP */
46 50
47#ifdef CONFIG_64BIT 51#ifdef CONFIG_64BIT
48static inline void iowrite64(u64 value, volatile void __iomem *addr) 52static inline void iowrite64(u64 value, volatile void __iomem *addr)
diff --git a/lib/Kconfig b/lib/Kconfig
index ccab426e12..847e797a3a 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -21,6 +21,12 @@ config DYNAMIC_CRC_TABLE
21 Enable this option to calculate entries for CRC tables at runtime. 21 Enable this option to calculate entries for CRC tables at runtime.
22 This can be helpful when reducing the size of the build image 22 This can be helpful when reducing the size of the build image
23 23
24config HAVE_ARCH_IOMAP
25 bool
26 help
27 Enable this option if architecture provides io{read,write}{8,16,32}
28 I/O accessor functions.
29
24config HAVE_PRIVATE_LIBGCC 30config HAVE_PRIVATE_LIBGCC
25 bool 31 bool
26 32