From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Hershberger Date: Tue, 3 Mar 2015 20:40:56 -0600 Subject: [U-Boot] [PATCH v5 02/27] common: Make sure arch-specific map_sysmem() is defined In-Reply-To: <1425436881-10323-1-git-send-email-joe.hershberger@ni.com> References: <1424822552-4366-1-git-send-email-joe.hershberger@ni.com> <1425436881-10323-1-git-send-email-joe.hershberger@ni.com> Message-ID: <1425436881-10323-3-git-send-email-joe.hershberger@ni.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In the case where the arch defines a custom map_sysmem(), make sure that including just common.h is sufficient to have these functions as they are when the arch does not override it. Signed-off-by: Joe Hershberger --- Changes in v5: -Moved to a separate header mapmem.h Changes in v4: -New to v4 Changes in v3: None Changes in v2: None arch/arm/lib/bootm.c | 1 + common/board_f.c | 1 + common/board_r.c | 1 + common/bootm.c | 1 + common/cmd_bootm.c | 1 + common/cmd_demo.c | 1 + common/cmd_fat.c | 1 + common/cmd_fdt.c | 1 + common/cmd_lzmadec.c | 1 + common/cmd_md5sum.c | 1 + common/cmd_mem.c | 1 + common/cmd_nvedit.c | 1 + common/cmd_pxe.c | 1 + common/cmd_sf.c | 1 + common/cmd_source.c | 1 + common/cmd_trace.c | 1 + common/cmd_ximg.c | 1 + common/hash.c | 1 + common/image-fdt.c | 1 + common/image-fit.c | 1 + common/image.c | 1 + common/iotrace.c | 1 + common/lcd.c | 1 + common/malloc_simple.c | 1 + drivers/demo/demo-simple.c | 1 + drivers/i2c/i2c-uniphier-f.c | 1 + drivers/i2c/i2c-uniphier.c | 1 + drivers/mtd/spi/sf_probe.c | 1 + drivers/serial/ns16550.c | 1 + drivers/serial/serial_uniphier.c | 1 + fs/fs.c | 1 + include/common.h | 17 ----------------- include/mapmem.h | 32 ++++++++++++++++++++++++++++++++ lib/trace.c | 1 + test/compression.c | 1 + test/dm/cmd_dm.c | 1 + 36 files changed, 66 insertions(+), 17 deletions(-) create mode 100644 include/mapmem.h diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 0c1298a..42b052c 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/common/board_f.c b/common/board_f.c index 4d8b8a6..1b7e7d9 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -23,6 +23,7 @@ #include #include #include +#include /* TODO: Can we move these into arch/ headers? */ #ifdef CONFIG_8xx diff --git a/common/board_r.c b/common/board_r.c index 4fcd4f6..af0f274 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -33,6 +33,7 @@ #endif #include #include +#include #ifdef CONFIG_BITBANGMII #include #endif diff --git a/common/bootm.c b/common/bootm.c index 34f60bb..6842029 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 48199bf..b3d3968 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/common/cmd_demo.c b/common/cmd_demo.c index 8a10bdf..209dc4a 100644 --- a/common/cmd_demo.c +++ b/common/cmd_demo.c @@ -9,6 +9,7 @@ #include #include +#include #include struct udevice *demo_dev; diff --git a/common/cmd_fat.c b/common/cmd_fat.c index c00fb28..aae993d 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 48b3e70..682b655 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #define MAX_LEVEL 32 /* how deeply nested we will go */ diff --git a/common/cmd_lzmadec.c b/common/cmd_lzmadec.c index 7b0b3fd..1ad9ed6 100644 --- a/common/cmd_lzmadec.c +++ b/common/cmd_lzmadec.c @@ -12,6 +12,7 @@ #include #include +#include #include #include diff --git a/common/cmd_md5sum.c b/common/cmd_md5sum.c index d22ace5..23bb81e 100644 --- a/common/cmd_md5sum.c +++ b/common/cmd_md5sum.c @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/common/cmd_mem.c b/common/cmd_mem.c index bcb3ee3..66a41da 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -20,6 +20,7 @@ #endif #include #include +#include #include #include #include diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 855808c..be792ae 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c index 7e32c95..96f963d 100644 --- a/common/cmd_pxe.c +++ b/common/cmd_pxe.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 5c788e9..01c37de 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/common/cmd_source.c b/common/cmd_source.c index 6881bc9..d2a881d 100644 --- a/common/cmd_source.c +++ b/common/cmd_source.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #if defined(CONFIG_8xx) diff --git a/common/cmd_trace.c b/common/cmd_trace.c index 8c630e6..1e62a1a 100644 --- a/common/cmd_trace.c +++ b/common/cmd_trace.c @@ -6,6 +6,7 @@ #include #include +#include #include #include diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c index 64b9186..8b8645c 100644 --- a/common/cmd_ximg.c +++ b/common/cmd_ximg.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #if defined(CONFIG_BZIP2) #include diff --git a/common/hash.c b/common/hash.c index d154d02..b4e3e80 100644 --- a/common/hash.c +++ b/common/hash.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/common/image-fdt.c b/common/image-fdt.c index d9e4728..7e2da7b 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #ifndef CONFIG_SYS_FDT_PAD diff --git a/common/image-fit.c b/common/image-fit.c index 778d2a1..4eb4d42 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -16,6 +16,7 @@ #else #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; #endif /* !USE_HOSTCC*/ diff --git a/common/image.c b/common/image.c index a911aa9..f3277c9 100644 --- a/common/image.c +++ b/common/image.c @@ -27,6 +27,7 @@ #include #include +#include #if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT) #include diff --git a/common/iotrace.c b/common/iotrace.c index ced426e..2725563 100644 --- a/common/iotrace.c +++ b/common/iotrace.c @@ -7,6 +7,7 @@ #define IOTRACE_IMPL #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/common/lcd.c b/common/lcd.c index f33942c..6982759 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/common/malloc_simple.c b/common/malloc_simple.c index 64ae036..d445199 100644 --- a/common/malloc_simple.c +++ b/common/malloc_simple.c @@ -8,6 +8,7 @@ #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/drivers/demo/demo-simple.c b/drivers/demo/demo-simple.c index 2bcb7df..f069748 100644 --- a/drivers/demo/demo-simple.c +++ b/drivers/demo/demo-simple.c @@ -10,6 +10,7 @@ #include #include #include +#include #include static int simple_hello(struct udevice *dev, int ch) diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c index 6707edd..ffa6ce5 100644 --- a/drivers/i2c/i2c-uniphier-f.c +++ b/drivers/i2c/i2c-uniphier-f.c @@ -13,6 +13,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/drivers/i2c/i2c-uniphier.c b/drivers/i2c/i2c-uniphier.c index 64a9ed8..760457f 100644 --- a/drivers/i2c/i2c-uniphier.c +++ b/drivers/i2c/i2c-uniphier.c @@ -13,6 +13,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index 4103723..ffc4caa 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index eb00f1c..61b36b6 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/serial/serial_uniphier.c b/drivers/serial/serial_uniphier.c index e8a1608..d36d20d 100644 --- a/drivers/serial/serial_uniphier.c +++ b/drivers/serial/serial_uniphier.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/fs/fs.c b/fs/fs.c index 483273f..ac0897d 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/include/common.h b/include/common.h index 77c55c6..3ccc6f3 100644 --- a/include/common.h +++ b/include/common.h @@ -845,23 +845,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 index 0000000..42ef3e8 --- /dev/null +++ b/include/mapmem.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2015 National Instruments + * + * (C) Copyright 2015 + * Joe Hershberger + * + * 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 +# 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 */ diff --git a/lib/trace.c b/lib/trace.c index 711e5b5..ad5e07b 100644 --- a/lib/trace.c +++ b/lib/trace.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include diff --git a/test/compression.c b/test/compression.c index ea2e4ad..7ef3a8c 100644 --- a/test/compression.c +++ b/test/compression.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/test/dm/cmd_dm.c b/test/dm/cmd_dm.c index 79a674e..195815e 100644 --- a/test/dm/cmd_dm.c +++ b/test/dm/cmd_dm.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include -- 1.7.11.5