* [PATCH] arch/score/include/asm/io.h: Add generic io map functions when MMU enabled
@ 2014-06-18 5:06 Chen Gang
2014-06-18 19:59 ` Lennox Wu
0 siblings, 1 reply; 3+ messages in thread
From: Chen Gang @ 2014-06-18 5:06 UTC (permalink / raw)
To: Liqin Chen, lennox.wu; +Cc: linux-kernel@vger.kernel.org
score did not implement some io map functions when MMU enabled, so need
add generic io map functions, just like some other architectures have
done (e.g. sparc64, s390, and mn10300), or will cause compiling issue.
The related error (allmodconfig under score):
CC drivers/clocksource/sh_cmt.o
drivers/clocksource/sh_cmt.c: In function 'sh_cmt_map_memory':
drivers/clocksource/sh_cmt.c:932:2: error: implicit declaration of function 'ioremap_nocache' [-Werror=implicit-function-declaration]
cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));
^
drivers/clocksource/sh_cmt.c:932:15: warning: assignment makes pointer from integer without a cast
cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));
^
drivers/clocksource/sh_cmt.c: In function 'sh_cmt_map_memory_legacy':
drivers/clocksource/sh_cmt.c:953:18: warning: assignment makes pointer from integer without a cast
cmt->mapbase_ch = ioremap_nocache(res->start, resource_size(res));
^
drivers/clocksource/sh_cmt.c:963:15: warning: assignment makes pointer from integer without a cast
cmt->mapbase = ioremap_nocache(res2 ? res2->start :
^
drivers/clocksource/sh_cmt.c:968:3: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
iounmap(cmt->mapbase_ch);
^
cc1: some warnings being treated as errors
make[2]: *** [drivers/clocksource/sh_cmt.o] Error 1
make[1]: *** [drivers/clocksource] Error 2
make: *** [drivers] Error 2
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
arch/score/include/asm/io.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/score/include/asm/io.h b/arch/score/include/asm/io.h
index 574c8827..d67aeea 100644
--- a/arch/score/include/asm/io.h
+++ b/arch/score/include/asm/io.h
@@ -3,6 +3,22 @@
#include <asm-generic/io.h>
+#ifdef CONFIG_MMU
+static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
+{
+ return (void __iomem *) (unsigned long)offset;
+}
+
+#define __ioremap(offset, size, flags) ioremap(offset, size)
+
+#define ioremap_nocache ioremap
+#define ioremap_wc ioremap_nocache
+
+static inline void iounmap(void __iomem *addr)
+{
+}
+#endif
+
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
#endif /* _ASM_SCORE_IO_H */
--
1.9.2.459.g68773ac
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] arch/score/include/asm/io.h: Add generic io map functions when MMU enabled
2014-06-18 5:06 [PATCH] arch/score/include/asm/io.h: Add generic io map functions when MMU enabled Chen Gang
@ 2014-06-18 19:59 ` Lennox Wu
2014-06-19 1:26 ` Chen Gang
0 siblings, 1 reply; 3+ messages in thread
From: Lennox Wu @ 2014-06-18 19:59 UTC (permalink / raw)
To: Chen Gang; +Cc: Liqin Chen, linux-kernel@vger.kernel.org
Hi Chen,
Although "SuperH Timer Support" are never used in our platforms, we
can still consider if these functions are necessary.
Could you send the config to us?
Best,
Lennox
2014-06-18 13:06 GMT+08:00 Chen Gang <gang.chen.5i5j@gmail.com>:
> score did not implement some io map functions when MMU enabled, so need
> add generic io map functions, just like some other architectures have
> done (e.g. sparc64, s390, and mn10300), or will cause compiling issue.
>
> The related error (allmodconfig under score):
>
> CC drivers/clocksource/sh_cmt.o
> drivers/clocksource/sh_cmt.c: In function 'sh_cmt_map_memory':
> drivers/clocksource/sh_cmt.c:932:2: error: implicit declaration of function 'ioremap_nocache' [-Werror=implicit-function-declaration]
> cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));
> ^
> drivers/clocksource/sh_cmt.c:932:15: warning: assignment makes pointer from integer without a cast
> cmt->mapbase = ioremap_nocache(mem->start, resource_size(mem));
> ^
> drivers/clocksource/sh_cmt.c: In function 'sh_cmt_map_memory_legacy':
> drivers/clocksource/sh_cmt.c:953:18: warning: assignment makes pointer from integer without a cast
> cmt->mapbase_ch = ioremap_nocache(res->start, resource_size(res));
> ^
> drivers/clocksource/sh_cmt.c:963:15: warning: assignment makes pointer from integer without a cast
> cmt->mapbase = ioremap_nocache(res2 ? res2->start :
> ^
> drivers/clocksource/sh_cmt.c:968:3: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
> iounmap(cmt->mapbase_ch);
> ^
> cc1: some warnings being treated as errors
> make[2]: *** [drivers/clocksource/sh_cmt.o] Error 1
> make[1]: *** [drivers/clocksource] Error 2
> make: *** [drivers] Error 2
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
> arch/score/include/asm/io.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/arch/score/include/asm/io.h b/arch/score/include/asm/io.h
> index 574c8827..d67aeea 100644
> --- a/arch/score/include/asm/io.h
> +++ b/arch/score/include/asm/io.h
> @@ -3,6 +3,22 @@
>
> #include <asm-generic/io.h>
>
> +#ifdef CONFIG_MMU
> +static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
> +{
> + return (void __iomem *) (unsigned long)offset;
> +}
> +
> +#define __ioremap(offset, size, flags) ioremap(offset, size)
> +
> +#define ioremap_nocache ioremap
> +#define ioremap_wc ioremap_nocache
> +
> +static inline void iounmap(void __iomem *addr)
> +{
> +}
> +#endif
> +
> #define virt_to_bus virt_to_phys
> #define bus_to_virt phys_to_virt
> #endif /* _ASM_SCORE_IO_H */
> --
> 1.9.2.459.g68773ac
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] arch/score/include/asm/io.h: Add generic io map functions when MMU enabled
2014-06-18 19:59 ` Lennox Wu
@ 2014-06-19 1:26 ` Chen Gang
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2014-06-19 1:26 UTC (permalink / raw)
To: Lennox Wu; +Cc: Liqin Chen, linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
On 06/19/2014 03:59 AM, Lennox Wu wrote:
> Hi Chen,
> Although "SuperH Timer Support" are never used in our platforms, we
> can still consider if these functions are necessary.
> Could you send the config to us?
It is allmodconfig under score for next-20140616, please check the
attachment for details.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
[-- Attachment #2: allmod_config.tar.gz --]
[-- Type: application/x-gzip, Size: 16927 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-19 1:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 5:06 [PATCH] arch/score/include/asm/io.h: Add generic io map functions when MMU enabled Chen Gang
2014-06-18 19:59 ` Lennox Wu
2014-06-19 1:26 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox