common: Make sure arch-specific map_sysmem() is defined
authorJoe Hershberger <joe.hershberger@ni.com>
Sun, 22 Mar 2015 22:08:59 +0000 (17:08 -0500)
committerSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2015 17:11:09 +0000 (11:11 -0600)
In the case where the arch defines a custom map_sysmem(), make sure that
including just mapmem.h is sufficient to have these functions as they
are when the arch does not override it.

Also split the non-arch specific functions out of common.h

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
36 files changed:
arch/arm/lib/bootm.c
common/board_f.c
common/board_r.c
common/bootm.c
common/cmd_bootm.c
common/cmd_demo.c
common/cmd_fat.c
common/cmd_fdt.c
common/cmd_lzmadec.c
common/cmd_md5sum.c
common/cmd_mem.c
common/cmd_nvedit.c
common/cmd_pxe.c
common/cmd_sf.c
common/cmd_source.c
common/cmd_trace.c
common/cmd_ximg.c
common/hash.c
common/image-fdt.c
common/image-fit.c
common/image.c
common/iotrace.c
common/lcd.c
common/malloc_simple.c
drivers/demo/demo-simple.c
drivers/i2c/i2c-uniphier-f.c
drivers/i2c/i2c-uniphier.c
drivers/mtd/spi/sf_probe.c
drivers/serial/ns16550.c
drivers/serial/serial_uniphier.c
fs/fs.c
include/common.h
include/mapmem.h [new file with mode: 0644]
lib/trace.c
test/compression.c
test/dm/cmd_dm.c

index 2d6b6761548a8e3bcb7baaffdbe0343b7acc8334..b1bff8ce265d771f6bbc293f60175e71c8079bbc 100644 (file)
@@ -18,6 +18,7 @@
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
 #include <libfdt.h>
+#include <mapmem.h>
 #include <fdt_support.h>
 #include <asm/bootm.h>
 #include <asm/secure.h>
index a570390f77f5aef90f701a0e886018a644801a10..775df1419e6c990b66213c148bef7d2a96c7af9d 100644 (file)
@@ -23,6 +23,7 @@
 #include <i2c.h>
 #include <initcall.h>
 #include <logbuff.h>
+#include <mapmem.h>
 
 /* TODO: Can we move these into arch/ headers? */
 #ifdef CONFIG_8xx
index af01e1cb9983e849b7ad14d95a3f0c9a4aec0495..514bac8667a043bf653bfda42cd65d493d7abaa0 100644 (file)
@@ -33,6 +33,7 @@
 #endif
 #include <logbuff.h>
 #include <malloc.h>
+#include <mapmem.h>
 #ifdef CONFIG_BITBANGMII
 #include <miiphy.h>
 #endif
index 34f60bbb5319e0fe8bea2c8ac0c5db85fdcae76f..6842029dfb4c31dd87d6a6a9152b7f04e71aeb3d 100644 (file)
@@ -13,6 +13,7 @@
 #include <fdt_support.h>
 #include <lmb.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <asm/io.h>
 #include <linux/lzo.h>
 #include <lzma/LzmaTypes.h>
index 4f77f22f94c41935adbc694e167de17e3df694ec..6b6aca66fd20b90e8b0bbfd1fa01f9899dbf8c37 100644 (file)
@@ -16,6 +16,7 @@
 #include <image.h>
 #include <lmb.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <nand.h>
 #include <asm/byteorder.h>
 #include <linux/compiler.h>
index 8a10bdf42a8906b9f212fe82c3d42afc79d5c028..209dc4a57ce71b57fc8ef93c0961aa38e7b54894 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <dm-demo.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 struct udevice *demo_dev;
index c00fb28b620b6d7108fda494f4e032724e829fe3..aae993d2b9a486c7ca1bdc16c10f7c84e9c817b9 100644 (file)
@@ -14,6 +14,7 @@
 #include <net.h>
 #include <ata.h>
 #include <asm/io.h>
+#include <mapmem.h>
 #include <part.h>
 #include <fat.h>
 #include <fs.h>
index 48b3e7041576495665280e3c04e32fecafaccfcb..682b6553958fe5afcf60fe78af4c3230f5d03915 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/global_data.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 #define MAX_LEVEL      32              /* how deeply nested we will go */
index 7b0b3fdd901b75f7f3ab64fee03cdafe783420b0..1ad9ed6ce96a5c37f32b2eb2f702cfc1787232bb 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 #include <lzma/LzmaTools.h>
index d22ace52206580052e47073eb47d6e59bb9d936c..23bb81e88cbf02ca73224b244e1c2359cd9c9f2a 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <mapmem.h>
 #include <u-boot/md5.h>
 #include <asm/io.h>
 
index 1cbf84f98524494a987a00cda128b440f67b166b..45e471ca82bae8efd9fe49e050bcd5a20a86cb6c 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 #include <hash.h>
 #include <inttypes.h>
+#include <mapmem.h>
 #include <watchdog.h>
 #include <asm/io.h>
 #include <linux/compiler.h>
index 855808c3e4a4d58bc3437da32725a3b725face01..be792ae746163d32048c27b6af22e1ff2ae98b2a 100644 (file)
@@ -31,6 +31,7 @@
 #include <search.h>
 #include <errno.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <watchdog.h>
 #include <linux/stddef.h>
 #include <asm/byteorder.h>
index 7e32c95df3217bc575dd39be2a71fd3f6e0deea3..96f963ddd77606d9fe9a23dd8853e198c059d07f 100644 (file)
@@ -8,6 +8,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <errno.h>
index 20f14d3fc457b2d405dd79f57cd1a37ae12a44d3..6aabf39302ce5e9000d19777a1622b27d1d52189 100644 (file)
@@ -10,6 +10,7 @@
 #include <div64.h>
 #include <dm.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <spi.h>
 #include <spi_flash.h>
 
index 6881bc9ddd3382c02c4c6130f313e5efca0066f3..d2a881ddc798f32c5a598f57245a208b9bb8036d 100644 (file)
@@ -19,6 +19,7 @@
 #include <command.h>
 #include <image.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #if defined(CONFIG_8xx)
index 8c630e6a8423f67283c2c4174e0960c1b83338f0..1e62a1a1999e37bae3c3bdfc413185568eff4a25 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <mapmem.h>
 #include <trace.h>
 #include <asm/io.h>
 
index 64b9186d738920dabf3e8573dcebaecdbb3ee562..8b8645c9e1367028690eb6098465509fe60f446a 100644 (file)
@@ -15,6 +15,7 @@
 #include <common.h>
 #include <command.h>
 #include <image.h>
+#include <mapmem.h>
 #include <watchdog.h>
 #if defined(CONFIG_BZIP2)
 #include <bzlib.h>
index 9e9f84b9fb43b0c86b16bab668a9244f0419fd0b..c94c98be9e13d755af9501371b3eaee28e226a70 100644 (file)
@@ -14,6 +14,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <hw_sha.h>
 #include <asm/io.h>
 #include <asm/errno.h>
index d9e47283c716c4d47b709e1390a78dd376f95b08..7e2da7b3b7218d10c40167e1d80c0d678ff47c1a 100644 (file)
@@ -14,6 +14,7 @@
 #include <errno.h>
 #include <image.h>
 #include <libfdt.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 #ifndef CONFIG_SYS_FDT_PAD
index 778d2a148be67b921be72fb58a155a0813cccdc9..4eb4d42655e9bebb0fae767d89961327a100e0c8 100644 (file)
@@ -16,6 +16,7 @@
 #else
 #include <common.h>
 #include <errno.h>
+#include <mapmem.h>
 #include <asm/io.h>
 DECLARE_GLOBAL_DATA_PTR;
 #endif /* !USE_HOSTCC*/
index 162b68269d575196c54608949818aa92a45525b8..abc0d890f289d622503f7e028ade7a48dc55478c 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <environment.h>
 #include <image.h>
+#include <mapmem.h>
 
 #if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
index ced426ea5c65f2f3c8b2a3e0ed030199a4cc0490..2725563e8f9adab65b01995f542e6ce324d582c7 100644 (file)
@@ -7,6 +7,7 @@
 #define IOTRACE_IMPL
 
 #include <common.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index f33942c617c15b9a526598b1955e18d636e60704..6982759e9e2a34a9bd180ed27f949ccd72192ee2 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/types.h>
 #include <stdio_dev.h>
 #include <lcd.h>
+#include <mapmem.h>
 #include <watchdog.h>
 #include <asm/unaligned.h>
 #include <splash.h>
index 64ae0365afc52f055621e2c2e6e18e9c095dc9ed..d445199c58aaa3a6b06c3b102b06f23b61193855 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index 2bcb7dfb479c4c123b3e2b875e4df4c680906290..f069748e051258ba4a11bab5a54240fad3edfda8 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <dm.h>
 #include <dm-demo.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 static int simple_hello(struct udevice *dev, int ch)
index fd28c1739983c91da5d332bd9abc122f9f5c9d69..d29dd4565d7de6b711f6adb476bb8e126c9d8899 100644 (file)
@@ -14,6 +14,7 @@
 #include <dm/root.h>
 #include <i2c.h>
 #include <fdtdec.h>
+#include <mapmem.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index 666272dd0d7aefe97b495612bb8c829ae3e03c73..c4972ff5012bcc5110c1c15beaf0f010ce7d1796 100644 (file)
@@ -14,6 +14,7 @@
 #include <dm/root.h>
 #include <i2c.h>
 #include <fdtdec.h>
+#include <mapmem.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
index c2dac66f03036bb32f4d4565cb1a68d6ec782aeb..d19138d9071d1365b080610bac46e649691aa84c 100644 (file)
@@ -13,6 +13,7 @@
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <spi.h>
 #include <spi_flash.h>
 #include <asm/io.h>
index 03beab5a14bced95741b483d52d8111043fa9856..67b1d60171abcaa0418dbde582d28a702a285db6 100644 (file)
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <errno.h>
 #include <fdtdec.h>
+#include <mapmem.h>
 #include <ns16550.h>
 #include <serial.h>
 #include <watchdog.h>
index 98e3b812e0b2a0fe44094acfc6036cdac14d490f..74547eb692b19eedfbe9de2aabb30aafaebe3595 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/errno.h>
 #include <dm/device.h>
 #include <dm/platform_data/serial-uniphier.h>
+#include <mapmem.h>
 #include <serial.h>
 #include <fdtdec.h>
 
diff --git a/fs/fs.c b/fs/fs.c
index 483273fe20b8212075f74526cb86aa2ae3e36988..ac0897d94a08625de0bca16a913d8fcdb6392884 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -17,6 +17,7 @@
 #include <config.h>
 #include <errno.h>
 #include <common.h>
+#include <mapmem.h>
 #include <part.h>
 #include <ext4fs.h>
 #include <fat.h>
index 9c0f1ba8117aea8e0629cc482d4750e79ced147b..932b2fc4f1ee4b5ce83a5da96f998cab77216f1b 100644 (file)
@@ -858,23 +858,6 @@ int cpu_disable(int nr);
 int cpu_release(int nr, int argc, char * const argv[]);
 #endif
 
-/* Define a null map_sysmem() if the architecture doesn't use it */
-# ifndef CONFIG_ARCH_MAP_SYSMEM
-static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
-{
-       return (void *)(uintptr_t)paddr;
-}
-
-static inline void unmap_sysmem(const void *vaddr)
-{
-}
-
-static inline phys_addr_t map_to_sysmem(const void *ptr)
-{
-       return (phys_addr_t)(uintptr_t)ptr;
-}
-# endif
-
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_PPC
diff --git a/include/mapmem.h b/include/mapmem.h
new file mode 100644 (file)
index 0000000..42ef3e8
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015 National Instruments
+ *
+ * (C) Copyright 2015
+ * Joe Hershberger <joe.hershberger@ni.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0
+ */
+
+#ifndef __MAPMEM_H
+#define __MAPMEM_H
+
+/* Define a null map_sysmem() if the architecture doesn't use it */
+# ifdef CONFIG_ARCH_MAP_SYSMEM
+#include <asm/io.h>
+# else
+static inline void *map_sysmem(phys_addr_t paddr, unsigned long len)
+{
+       return (void *)(uintptr_t)paddr;
+}
+
+static inline void unmap_sysmem(const void *vaddr)
+{
+}
+
+static inline phys_addr_t map_to_sysmem(const void *ptr)
+{
+       return (phys_addr_t)(uintptr_t)ptr;
+}
+# endif
+
+#endif /* __MAPMEM_H */
index 711e5b5836cbc2b5f98dab8bf634df0969ea6328..ad5e07bd845d6b2f23d2b97f4e437b66ca9e79f3 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <mapmem.h>
 #include <trace.h>
 #include <asm/io.h>
 #include <asm/sections.h>
index ea2e4ad22e844e6eae5e311e009bb49869c3d413..7ef3a8c9f571e8fbcf7ae46b83da3f1ae369b448 100644 (file)
@@ -10,6 +10,7 @@
 #include <bootm.h>
 #include <command.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <asm/io.h>
 
 #include <u-boot/zlib.h>
index 507f2608591abf671dcb8b71160bd65d7c58d367..8d531fd5cbd6a21bfc69bbb0641771295bcf8504 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <dm.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <errno.h>
 #include <asm/io.h>
 #include <dm/root.h>