Skip to contentSkip to conversation

Allow absence of mach/io.h

PATCH New Eric Miao 4 participants 9 messages Jun 25, 2010 – Jul 23, 2010

Subsystems (8)
lore
Share & tools
lore

Eric Miao

author
#0 lore raw

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.

author
#1 lore raw

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
index 62b0a90..84b4b17 100644
@@ -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
index a6e0f9e..ccf69ed 100644
@@ -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
index f08451d..c261d7b 100644
@@ -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
index d08b1b7..7aef4d9 100644
@@ -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
#2 lore raw

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

---

?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
index 62b0a90..84b4b17 100644
@@ -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
index a6e0f9e..ccf69ed 100644
@@ -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
index f08451d..c261d7b 100644
@@ -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
index d08b1b7..7aef4d9 100644
@@ -20,6 +20,5 @@
 
 ?#define __io(a) ? ? ? ?__typesafe_io(a)
 ?#define __mem_pci(a) ? (a)
-#define __mem_isa(a) ? (a)
 

?#endif
--
1.7.1

author
#3 lore raw

PATCH 2/4 shmobile: change __io() definition to use __typesafe_io()

In reply to Eric Miao

From: 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
index 7339fe4..df793df 100644
@@ -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
author
#6 lore raw

PATCH 3/4 Introduce USE_DEFAULT_IO_H to use default definitions in asm/io.h

In reply to 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 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
index 1f254bd..46c00a1 100644
@@ -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
index c980156..179d317 100644
@@ -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
#7 lore raw

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 specific mach/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

author
#8 lore raw

PATCH 4/4 Make pxa and mmp to USE_DEFAULT_IO_H

In reply to Eric Miao

From: 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
index 46c00a1..f2da68a 100644
@@ -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
deleted file mode 100644
index e7adf3d..0000000
@@ -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
deleted file mode 100644
index 262691f..0000000
@@ -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