Allow absence of mach/io.h
Subsystems (8)
cover Allow absence of mach/io.h
Introduce USE_DEFAULT_IO_H to allow default definitions of
IO_SPACE_LIMIT
__mem_pci()
__io()
And most SoC can actually use these default definitions without the need to have a specific mach/io.h. PXA and MMP are two examples in the last patch, where the files are removed.
PATCH 1/4 Remove useless __mem_isa() definitions
From: Eric Miao <[email protected]>
__mem_isa() is used nowhere, keeping it there will just add confusion.
--- arch/arm/mach-davinci/include/mach/io.h | 1 - arch/arm/mach-iop13xx/include/mach/io.h | 1 - arch/arm/mach-ns9xxx/include/mach/io.h | 1 - arch/arm/plat-stmp3xxx/include/mach/io.h | 1 - 4 files changed, 0 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/include/mach/io.h +0 -1
@@ -19,7 +19,6 @@*/ #define __io (a) __typesafe_io(a)#define __mem_pci (a) (a) -#define __mem_isa (a) (a)#ifndef __ASSEMBLER__#define __arch_ioremap (p, s, t) davinci_ioremap(p, s, t)
arch/arm/mach-iop13xx/include/mach/io.h +0 -1
@@ -23,7 +23,6 @@#define __io (a) __iop13xx_io(a)#define __mem_pci (a) (a) -#define __mem_isa (a) (a)extern void __iomem *__iop13xx_io (unsigned long io_addr); extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
arch/arm/mach-ns9xxx/include/mach/io.h +0 -1
@@ -15,6 +15,5 @@#define __io (a) __typesafe_io(a)#define __mem_pci (a) (a) -#define __mem_isa (a) (IO_BASE + (a))#endif /* ifndef __ASM_ARCH_IO_H */
arch/arm/plat-stmp3xxx/include/mach/io.h +0 -1
@@ -20,6 +20,5 @@#define __io (a) __typesafe_io(a)#define __mem_pci (a) (a) -#define __mem_isa (a) (a)#endif
Signature · 1 line
1.7.1
PATCH 1/4 Remove useless __mem_isa() definitions
Quoted 4 lines · Eric Miao
From: Eric Miao <[email protected]>
__mem_isa()is used nowhere, keeping it there will just add confusion.
Ping?
Quoted 58 lines
Signed-off-by Eric Miao <[email protected]>---
?arch/arm/mach-davinci/include/mach/io.h ?| ? ?1 - ?arch/arm/mach-iop13xx/include/mach/io.h ?| ? ?1 - ?arch/arm/mach-ns9xxx/include/mach/io.h ? | ? ?1 - ?arch/arm/plat-stmp3xxx/include/mach/io.h | ? ?1 -?4 files changed, 0 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/include/mach/io.h +0
-0@@ -19,7 +19,6 @@?*/
?#define__io(a)? ? ? ? ? ? ? ? ? ? ? ?__typesafe_io(a) ?#define__mem_pci(a)? ? ? ? ? (a)
-#define__mem_isa(a)? ? ? ? ? (a)?#ifndef
__ASSEMBLER__
?#define__arch_ioremap(p, s, t)? ? ? ?davinci_ioremap(p, s, t)arch/arm/mach-iop13xx/include/mach/io.h +0
-1@@ -23,7 +23,6 @@ ?#define __io(a) __iop13xx_io(a) ?#define __mem_pci(a) (a) -#define __mem_isa (a) (a) ?extern void __iomem * __iop13xx_io(unsigned long io_addr); ?extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,arch/arm/mach-ns9xxx/include/mach/io.h +0
-1@@ -15,6 +15,5 @@ ?#define __io(a) ? ? ? ? ? ? ? ?__typesafe_io(a) ?#define __mem_pci(a) ? ?(a) -#define __mem_isa (a) ? ?(IO_BASE + (a))?#endif /* ifndef
__ASM_ARCH_IO_H*/arch/arm/plat-stmp3xxx/include/mach/io.h +0
-1@@ -20,6 +20,5 @@ ?#define __io(a) ? ? ? ?__typesafe_io(a) ?#define __mem_pci(a) ? (a) -#define __mem_isa (a) ? (a)?#endif
--
1.7.1
PATCH 2/4 shmobile: change __io() definition to use __typesafe_io()
In reply to Eric MiaoFrom: Eric Miao <[email protected]>
--- arch/arm/mach-shmobile/include/mach/io.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-shmobile/include/mach/io.h +1 -1
@@ -3,7 +3,7 @@#define IO_SPACE_LIMIT 0xffffffff -#define __io (a) ((void __iomem *)(a)) +#define __io (a) __typesafe_io(a)#define __mem_pci (a) (a)#endif /* __ASM_MACH_IO_H */
Signature · 1 line
1.7.1
Magnus Damm
maintainerPATCH 2/4 shmobile: change __io() definition to use __typesafe_io()
Quoted 5 lines · Eric Miao
From: Eric Miao <[email protected]>
Cc Magnus Damm <[email protected]>Signed-off-by Eric Miao <[email protected]>---
FYI, Paul Mundt handles the genesis-2.6 git tree, so you probably also want to CC him and/or the linux-sh list.
Thank you!
/ magnus
PATCH 2/4 shmobile: change __io() definition to use __typesafe_io()
Quoted 12 lines · Magnus Damm
Quoted 5 lines · Eric Miao
From: Eric Miao <[email protected]>
Cc Magnus Damm <[email protected]>Signed-off-by Eric Miao <[email protected]>---
Acked-by Magnus Damm <[email protected]>FYI, Paul Mundt handles the genesis-2.6 git tree, so you probably also want to CC him and/or the linux-sh list.
Cc'ed. Thanks.
PATCH 3/4 Introduce USE_DEFAULT_IO_H to use default definitions in asm/io.h
In reply to Eric MiaoFrom: Eric Miao <[email protected]>
For those machines that can just use the default definitions in asm/io.h, there is no need to have a machine specific mach/io.h. Introduce an config option for them.
--- arch/arm/Kconfig | 3 +++ arch/arm/include/asm/io.h | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
arch/arm/Kconfig +3 -0
@@ -189,6 +189,9 @@ config VECTORS_BASE help The base address of exception vectors. +config USE_DEFAULT_IO_H + def_bool n + source "init/Kconfig" source "kernel/Kconfig.freezer"
arch/arm/include/asm/io.h +6 -0
@@ -97,7 +97,13 @@ static inline void __iomem *__typesafe_io(unsigned long addr)/* * Now, pick up the machine-defined IO definitions */ +#ifndef CONFIG_USE_DEFAULT_IO_H #include <mach/io.h> +#else +#define IO_SPACE_LIMIT 0xffffffff +#define __io (a) __typesafe_io(a) +#define __mem_pci (a) (a) +#endif /* * IO port access primitives
Signature · 1 line
1.7.1
PATCH 3/4 Introduce USE_DEFAULT_IO_H to use default definitions in asm/io.h
Quoted 5 lines · Eric Miao
From: Eric Miao <[email protected]>
For those machines that can just use the default definitions in
asm/io.h, there is no need to have a machine specificmach/io.h. Introduce an config option for them.
I like this approach. This allows us to transition specific machines gradually, and provide a clear set of conditions for multiple machine families to be eventually compilable together.
Nicolas
PATCH 4/4 Make pxa and mmp to USE_DEFAULT_IO_H
In reply to Eric MiaoFrom: Eric Miao <[email protected]>
--- arch/arm/Kconfig | 2 ++ arch/arm/mach-mmp/include/mach/io.h | 21 --------------------- arch/arm/mach-pxa/include/mach/io.h | 18 ------------------ 3 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 arch/arm/mach-mmp/include/mach/io.h delete mode 100644 arch/arm/mach-pxa/include/mach/io.h
arch/arm/Kconfig +2 -0
@@ -517,6 +517,7 @@ config ARCH_MMP select GENERIC_CLOCKEVENTS select TICK_ONESHOT select PLAT_PXA + select USE_DEFAULT_IO_H help Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
@@ -582,6 +583,7 @@ config ARCH_PXA select GENERIC_CLOCKEVENTS select TICK_ONESHOT select PLAT_PXA + select USE_DEFAULT_IO_H help Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
arch/arm/mach-mmp/include/mach/io.h deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* linux/arch/arm/mach-mmp/include/mach/io.h -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -*/ - -#ifndef __ASM_MACH_IO_H -#define __ASM_MACH_IO_H - -#define IO_SPACE_LIMIT 0xffffffff - -/* -* We don't actually have real ISA nor PCI buses, but there is so many -* drivers out there that might just work if we fake them... -*/ -#define __io (a) __typesafe_io(a) -#define __mem_pci (a) (a) - -#endif /* __ASM_MACH_IO_H */
arch/arm/mach-pxa/include/mach/io.h deleted +0 -18
@@ -1,18 +0,0 @@ -/* -* arch/arm/mach-pxa/include/mach/io.h -* -* Copied from asm/arch/sa1100/io.h -*/ -#ifndef __ASM_ARM_ARCH_IO_H -#define __ASM_ARM_ARCH_IO_H - -#define IO_SPACE_LIMIT 0xffffffff - -/* -* We don't actually have real ISA nor PCI buses, but there is so many -* drivers out there that might just work if we fake them... -*/ -#define __io (a) __typesafe_io(a) -#define __mem_pci (a) (a) - -#endif
Signature · 1 line
1.7.1