* [PATCH] sh: pass through ioremap() for non-mmu processors
@ 2009-04-28 7:59 Magnus Damm
2009-04-28 8:49 ` Paul Mundt
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Magnus Damm @ 2009-04-28 7:59 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@igel.co.jp>
This patch modifies the ioremap() handling for CONFIG_MMU=n.
All 32-bit SuperH processors currently go through __ioremap_mode()
and check for IO_TRAPPED and directly mapped segments. With this
patch we simplify the MMU less case with a pass through version of
__ioremap_mode() which just returns the physical address.
The effects of this is change are:
- fix non-MMU ioremap() of high address hardware blocks (sh7203 CMT)
- IO_TRAPPED is never checked for
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
arch/sh/Kconfig | 1 +
arch/sh/include/asm/io.h | 13 +++++++------
2 files changed, 8 insertions(+), 6 deletions(-)
--- 0001/arch/sh/Kconfig
+++ work/arch/sh/Kconfig 2009-04-21 15:54:59.000000000 +0900
@@ -136,6 +136,7 @@ config ARCH_HAS_DEFAULT_IDLE
config IO_TRAPPED
bool
+ depends on MMU
source "init/Kconfig"
--- 0001/arch/sh/include/asm/io.h
+++ work/arch/sh/include/asm/io.h 2009-04-21 15:18:02.000000000 +0900
@@ -228,12 +228,6 @@ void __iounmap(void __iomem *addr);
unsigned long onchip_remap(unsigned long addr, unsigned long size,
const char *name);
extern void onchip_unmap(unsigned long vaddr);
-#else
-#define __ioremap(offset, size, flags) ((void __iomem *)(offset))
-#define __iounmap(addr) do { } while (0)
-#define onchip_remap(addr, size, name) (addr)
-#define onchip_unmap(addr) do { } while (0)
-#endif /* CONFIG_MMU */
static inline void __iomem *
__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
@@ -269,6 +263,13 @@ __ioremap_mode(unsigned long offset, uns
return __ioremap(offset, size, flags);
}
+#else
+#define onchip_remap(addr, size, name) (addr)
+#define onchip_unmap(addr) do { } while (0)
+#define __ioremap_mode(offset, size, flags) (void __iomem *)(offset)
+#define __iounmap(addr) do { } while (0)
+#endif /* CONFIG_MMU */
+
#define ioremap(offset, size) \
__ioremap_mode((offset), (size), 0)
#define ioremap_nocache(offset, size) \
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sh: pass through ioremap() for non-mmu processors
2009-04-28 7:59 [PATCH] sh: pass through ioremap() for non-mmu processors Magnus Damm
@ 2009-04-28 8:49 ` Paul Mundt
2009-04-29 14:44 ` [PATCH] sh: pass through ioremap() for non-mmu processors V2 Magnus Damm
2009-04-30 3:53 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-04-28 8:49 UTC (permalink / raw)
To: linux-sh
On Tue, Apr 28, 2009 at 04:59:34PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm@igel.co.jp>
>
> This patch modifies the ioremap() handling for CONFIG_MMU=n.
>
> All 32-bit SuperH processors currently go through __ioremap_mode()
> and check for IO_TRAPPED and directly mapped segments. With this
> patch we simplify the MMU less case with a pass through version of
> __ioremap_mode() which just returns the physical address.
>
> The effects of this is change are:
> - fix non-MMU ioremap() of high address hardware blocks (sh7203 CMT)
> - IO_TRAPPED is never checked for
>
> Signed-off-by: Magnus Damm <damm@igel.co.jp>
> ---
>
> arch/sh/Kconfig | 1 +
> arch/sh/include/asm/io.h | 13 +++++++------
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> --- 0001/arch/sh/Kconfig
> +++ work/arch/sh/Kconfig 2009-04-21 15:54:59.000000000 +0900
> @@ -136,6 +136,7 @@ config ARCH_HAS_DEFAULT_IDLE
>
> config IO_TRAPPED
> bool
> + depends on MMU
>
You have failed at Kconfig. select trumps depends, so this has no impact
for platforms that select IO_TRAPPED. You will have to switch the
platforms that select this over to handling the dependency properly on
their own.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] sh: pass through ioremap() for non-mmu processors V2
2009-04-28 7:59 [PATCH] sh: pass through ioremap() for non-mmu processors Magnus Damm
2009-04-28 8:49 ` Paul Mundt
@ 2009-04-29 14:44 ` Magnus Damm
2009-04-30 3:53 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Magnus Damm @ 2009-04-29 14:44 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@igel.co.jp>
This is V2 of the CONFIG_MMU=n pass through ioremap() patch.
All 32-bit SuperH processors currently go through __ioremap_mode()
and check for IO_TRAPPED and directly mapped segments. With this
patch we simplify the MMU less case with a pass through version of
__ioremap_mode() which just returns the physical address.
The effects of this is change are:
- fix non-MMU ioremap() of high address hardware blocks (sh7203 CMT)
- make sure IO_TRAPPED is not selected
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
Changes since V1:
- rework Kconfig bits
arch/sh/boards/Kconfig | 6 +++---
arch/sh/include/asm/io.h | 13 +++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
--- 0001/arch/sh/boards/Kconfig
+++ work/arch/sh/boards/Kconfig 2009-04-28 18:07:39.000000000 +0900
@@ -121,7 +121,7 @@ config SH_RTS7751R2D
bool "RTS7751R2D"
depends on CPU_SUBTYPE_SH7751R
select SYS_SUPPORTS_PCI
- select IO_TRAPPED
+ select IO_TRAPPED if MMU
help
Select RTS7751R2D if configuring for a Renesas Technology
Sales SH-Graphics board.
@@ -145,13 +145,13 @@ config SH_HIGHLANDER
bool "Highlander"
depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
select SYS_SUPPORTS_PCI
- select IO_TRAPPED
+ select IO_TRAPPED if MMU
config SH_SH7785LCR
bool "SH7785LCR"
depends on CPU_SUBTYPE_SH7785
select SYS_SUPPORTS_PCI
- select IO_TRAPPED
+ select IO_TRAPPED if MMU
config SH_SH7785LCR_29BIT_PHYSMAPS
bool "SH7785LCR 29bit physmaps"
--- 0001/arch/sh/include/asm/io.h
+++ work/arch/sh/include/asm/io.h 2009-04-28 12:40:43.000000000 +0900
@@ -228,12 +228,6 @@ void __iounmap(void __iomem *addr);
unsigned long onchip_remap(unsigned long addr, unsigned long size,
const char *name);
extern void onchip_unmap(unsigned long vaddr);
-#else
-#define __ioremap(offset, size, flags) ((void __iomem *)(offset))
-#define __iounmap(addr) do { } while (0)
-#define onchip_remap(addr, size, name) (addr)
-#define onchip_unmap(addr) do { } while (0)
-#endif /* CONFIG_MMU */
static inline void __iomem *
__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
@@ -269,6 +263,13 @@ __ioremap_mode(unsigned long offset, uns
return __ioremap(offset, size, flags);
}
+#else
+#define onchip_remap(addr, size, name) (addr)
+#define onchip_unmap(addr) do { } while (0)
+#define __ioremap_mode(offset, size, flags) (void __iomem *)(offset)
+#define __iounmap(addr) do { } while (0)
+#endif /* CONFIG_MMU */
+
#define ioremap(offset, size) \
__ioremap_mode((offset), (size), 0)
#define ioremap_nocache(offset, size) \
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] sh: pass through ioremap() for non-mmu processors V2
2009-04-28 7:59 [PATCH] sh: pass through ioremap() for non-mmu processors Magnus Damm
2009-04-28 8:49 ` Paul Mundt
2009-04-29 14:44 ` [PATCH] sh: pass through ioremap() for non-mmu processors V2 Magnus Damm
@ 2009-04-30 3:53 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-04-30 3:53 UTC (permalink / raw)
To: linux-sh
On Wed, Apr 29, 2009 at 11:44:28PM +0900, Magnus Damm wrote:
> This is V2 of the CONFIG_MMU=n pass through ioremap() patch.
>
> All 32-bit SuperH processors currently go through __ioremap_mode()
> and check for IO_TRAPPED and directly mapped segments. With this
> patch we simplify the MMU less case with a pass through version of
> __ioremap_mode() which just returns the physical address.
>
> The effects of this is change are:
> - fix non-MMU ioremap() of high address hardware blocks (sh7203 CMT)
> - make sure IO_TRAPPED is not selected
On Wed, Apr 29, 2009 at 11:50:37PM +0900, Magnus Damm wrote:
> This patch contains various fixes for 16-bit cmt hardware.
> With this applied periodic clockevents work fine on sh7203.
Both applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-30 3:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28 7:59 [PATCH] sh: pass through ioremap() for non-mmu processors Magnus Damm
2009-04-28 8:49 ` Paul Mundt
2009-04-29 14:44 ` [PATCH] sh: pass through ioremap() for non-mmu processors V2 Magnus Damm
2009-04-30 3:53 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox