* [PATCH] shmobile: fix map_io init usage
@ 2011-05-01 16:28 Jean-Christophe PLAGNIOL-VILLARD
2011-05-13 1:56 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-01 16:28 UTC (permalink / raw)
To: linux-arm-kernel
switch early init to init_early and introduce soc map_io
with this Patch we will not do any more early device setup during the map io
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
---
arch/arm/mach-shmobile/Makefile | 2 +-
arch/arm/mach-shmobile/board-ag5evm.c | 20 ++----------
arch/arm/mach-shmobile/board-ap4evb.c | 20 ++----------
arch/arm/mach-shmobile/board-g3evm.c | 20 ++----------
arch/arm/mach-shmobile/board-g4evm.c | 20 ++----------
arch/arm/mach-shmobile/board-mackerel.c | 20 ++----------
arch/arm/mach-shmobile/include/mach/common.h | 1 +
arch/arm/mach-shmobile/map_io.c | 44 ++++++++++++++++++++++++++
8 files changed, 61 insertions(+), 86 deletions(-)
create mode 100644 arch/arm/mach-shmobile/map_io.c
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index e2507f6..260e09d 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -3,7 +3,7 @@
#
# Common objects
-obj-y := timer.o console.o clock.o pm_runtime.o
+obj-y := map_io.o timer.o console.o clock.o pm_runtime.o
# CPU objects
obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 3e6f0aa..b30b11d 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -43,7 +43,6 @@
#include <mach/common.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/hardware/gic.h>
#include <asm/hardware/cache-l2x0.h>
@@ -335,22 +334,8 @@ static struct platform_device *ag5evm_devices[] __initdata = {
&mipidsi0_device,
};
-static struct map_desc ag5evm_io_desc[] __initdata = {
- /* create a 1:1 entity map for 0xe6xxxxxx
- * used by CPGA, INTC and PFC.
- */
- {
- .virtual = 0xe6000000,
- .pfn = __phys_to_pfn(0xe6000000),
- .length = 256 << 20,
- .type = MT_DEVICE_NONSHARED
- },
-};
-
-static void __init ag5evm_map_io(void)
+static void __init ag5evm_init_early(void)
{
- iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
-
/* setup early devices and console here as well */
sh73a0_add_early_devices();
shmobile_setup_console();
@@ -474,9 +459,10 @@ struct sys_timer ag5evm_timer = {
};
MACHINE_START(AG5EVM, "ag5evm")
- .map_io = ag5evm_map_io,
+ .map_io = shmobile_map_io,
.init_irq = ag5evm_init_irq,
.handle_irq = shmobile_handle_irq_gic,
+ .init_early = ag5evm_init_early,
.init_machine = ag5evm_init,
.timer = &ag5evm_timer,
MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 1e35fa9..ed55c01 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -59,7 +59,6 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/setup.h>
@@ -1092,22 +1091,8 @@ static struct i2c_board_info i2c1_devices[] = {
},
};
-static struct map_desc ap4evb_io_desc[] __initdata = {
- /* create a 1:1 entity map for 0xe6xxxxxx
- * used by CPGA, INTC and PFC.
- */
- {
- .virtual = 0xe6000000,
- .pfn = __phys_to_pfn(0xe6000000),
- .length = 256 << 20,
- .type = MT_DEVICE_NONSHARED
- },
-};
-
-static void __init ap4evb_map_io(void)
+static void __init ap4evb_init_early(void)
{
- iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
-
/* setup early devices and console here as well */
sh7372_add_early_devices();
shmobile_setup_console();
@@ -1359,9 +1344,10 @@ static struct sys_timer ap4evb_timer = {
};
MACHINE_START(AP4EVB, "ap4evb")
- .map_io = ap4evb_map_io,
+ .map_io = shmobile_map_io,
.init_irq = sh7372_init_irq,
.handle_irq = shmobile_handle_irq_intc,
+ .init_early = ap4evb_init_early,
.init_machine = ap4evb_init,
.timer = &ap4evb_timer,
MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index ef4613b..20eeacf 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -36,7 +36,6 @@
#include <mach/common.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
#include <asm/mach/time.h>
/*
@@ -245,22 +244,8 @@ static struct platform_device *g3evm_devices[] __initdata = {
&irda_device,
};
-static struct map_desc g3evm_io_desc[] __initdata = {
- /* create a 1:1 entity map for 0xe6xxxxxx
- * used by CPGA, INTC and PFC.
- */
- {
- .virtual = 0xe6000000,
- .pfn = __phys_to_pfn(0xe6000000),
- .length = 256 << 20,
- .type = MT_DEVICE_NONSHARED
- },
-};
-
-static void __init g3evm_map_io(void)
+static void __init g3evm_init_early(void)
{
- iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
-
/* setup early devices and console here as well */
sh7367_add_early_devices();
shmobile_setup_console();
@@ -364,9 +349,10 @@ static struct sys_timer g3evm_timer = {
};
MACHINE_START(G3EVM, "g3evm")
- .map_io = g3evm_map_io,
+ .map_io = shmobile_map_io,
.init_irq = sh7367_init_irq,
.handle_irq = shmobile_handle_irq_intc,
+ .init_early = g3evm_init_early,
.init_machine = g3evm_init,
.timer = &g3evm_timer,
MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index c87a7b7..079dd35 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -37,7 +37,6 @@
#include <mach/common.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
#include <asm/mach/time.h>
/*
@@ -259,22 +258,8 @@ static struct platform_device *g4evm_devices[] __initdata = {
&sdhi1_device,
};
-static struct map_desc g4evm_io_desc[] __initdata = {
- /* create a 1:1 entity map for 0xe6xxxxxx
- * used by CPGA, INTC and PFC.
- */
- {
- .virtual = 0xe6000000,
- .pfn = __phys_to_pfn(0xe6000000),
- .length = 256 << 20,
- .type = MT_DEVICE_NONSHARED
- },
-};
-
-static void __init g4evm_map_io(void)
+static void __init g4evm_init_early(void)
{
- iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
-
/* setup early devices and console here as well */
sh7377_add_early_devices();
shmobile_setup_console();
@@ -407,9 +392,10 @@ static struct sys_timer g4evm_timer = {
};
MACHINE_START(G4EVM, "g4evm")
- .map_io = g4evm_map_io,
+ .map_io = shmobile_map_io,
.init_irq = sh7377_init_irq,
.handle_irq = shmobile_handle_irq_intc,
+ .init_early = g4evm_init_early,
.init_machine = g4evm_init,
.timer = &g4evm_timer,
MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 7da2ca2..f05a673 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -56,7 +56,6 @@
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
-#include <asm/mach/map.h>
#include <asm/mach-types.h>
/*
@@ -1007,22 +1006,8 @@ static struct i2c_board_info i2c1_devices[] = {
},
};
-static struct map_desc mackerel_io_desc[] __initdata = {
- /* create a 1:1 entity map for 0xe6xxxxxx
- * used by CPGA, INTC and PFC.
- */
- {
- .virtual = 0xe6000000,
- .pfn = __phys_to_pfn(0xe6000000),
- .length = 256 << 20,
- .type = MT_DEVICE_NONSHARED
- },
-};
-
-static void __init mackerel_map_io(void)
+static void __init mackerel_init_early(void)
{
- iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
-
/* setup early devices and console here as well */
sh7372_add_early_devices();
shmobile_setup_console();
@@ -1232,9 +1217,10 @@ static struct sys_timer mackerel_timer = {
};
MACHINE_START(MACKEREL, "mackerel")
- .map_io = mackerel_map_io,
+ .map_io = shmobile_map_io,
.init_irq = sh7372_init_irq,
.handle_irq = shmobile_handle_irq_intc,
+ .init_early = mackerel_init_early,
.init_machine = mackerel_init,
.timer = &mackerel_timer,
MACHINE_END
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 013ac0e..cc7fdbc 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -1,6 +1,7 @@
#ifndef __ARCH_MACH_COMMON_H
#define __ARCH_MACH_COMMON_H
+extern void shmobile_map_io(void);
extern struct sys_timer shmobile_timer;
extern void shmobile_setup_console(void);
extern void shmobile_secondary_vector(void);
diff --git a/arch/arm/mach-shmobile/map_io.c b/arch/arm/mach-shmobile/map_io.c
new file mode 100644
index 0000000..1a62855
--- /dev/null
+++ b/arch/arm/mach-shmobile/map_io.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 Magnus Damm
+ * Copyright (C) 2008 Yoshihiro Shimoda
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+
+#include <mach/common.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/setup.h>
+
+static struct map_desc shmobile_io_desc[] __initdata = {
+ /* create a 1:1 entity map for 0xe6xxxxxx
+ * used by CPGA, INTC and PFC.
+ */
+ {
+ .virtual = 0xe6000000,
+ .pfn = __phys_to_pfn(0xe6000000),
+ .length = 256 << 20,
+ .type = MT_DEVICE_NONSHARED
+ },
+};
+
+void __init shmobile_map_io(void)
+{
+ iotable_init(shmobile_io_desc, ARRAY_SIZE(shmobile_io_desc));
+}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] shmobile: fix map_io init usage
2011-05-01 16:28 [PATCH] shmobile: fix map_io init usage Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-13 1:56 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-14 10:26 ` Russell King - ARM Linux
2011-05-16 4:28 ` Magnus Damm
0 siblings, 2 replies; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-13 1:56 UTC (permalink / raw)
To: linux-arm-kernel
On 18:28 Sun 01 May , Jean-Christophe PLAGNIOL-VILLARD wrote:
> switch early init to init_early and introduce soc map_io
>
> with this Patch we will not do any more early device setup during the map io
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Magnus Damm <magnus.damm@gmail.com>
ping
Best Regards,
J.
> ---
> arch/arm/mach-shmobile/Makefile | 2 +-
> arch/arm/mach-shmobile/board-ag5evm.c | 20 ++----------
> arch/arm/mach-shmobile/board-ap4evb.c | 20 ++----------
> arch/arm/mach-shmobile/board-g3evm.c | 20 ++----------
> arch/arm/mach-shmobile/board-g4evm.c | 20 ++----------
> arch/arm/mach-shmobile/board-mackerel.c | 20 ++----------
> arch/arm/mach-shmobile/include/mach/common.h | 1 +
> arch/arm/mach-shmobile/map_io.c | 44 ++++++++++++++++++++++++++
> 8 files changed, 61 insertions(+), 86 deletions(-)
> create mode 100644 arch/arm/mach-shmobile/map_io.c
>
> diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
> index e2507f6..260e09d 100644
> --- a/arch/arm/mach-shmobile/Makefile
> +++ b/arch/arm/mach-shmobile/Makefile
> @@ -3,7 +3,7 @@
> #
>
> # Common objects
> -obj-y := timer.o console.o clock.o pm_runtime.o
> +obj-y := map_io.o timer.o console.o clock.o pm_runtime.o
>
> # CPU objects
> obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
> diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
> index 3e6f0aa..b30b11d 100644
> --- a/arch/arm/mach-shmobile/board-ag5evm.c
> +++ b/arch/arm/mach-shmobile/board-ag5evm.c
> @@ -43,7 +43,6 @@
> #include <mach/common.h>
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> #include <asm/mach/time.h>
> #include <asm/hardware/gic.h>
> #include <asm/hardware/cache-l2x0.h>
> @@ -335,22 +334,8 @@ static struct platform_device *ag5evm_devices[] __initdata = {
> &mipidsi0_device,
> };
>
> -static struct map_desc ag5evm_io_desc[] __initdata = {
> - /* create a 1:1 entity map for 0xe6xxxxxx
> - * used by CPGA, INTC and PFC.
> - */
> - {
> - .virtual = 0xe6000000,
> - .pfn = __phys_to_pfn(0xe6000000),
> - .length = 256 << 20,
> - .type = MT_DEVICE_NONSHARED
> - },
> -};
> -
> -static void __init ag5evm_map_io(void)
> +static void __init ag5evm_init_early(void)
> {
> - iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
> -
> /* setup early devices and console here as well */
> sh73a0_add_early_devices();
> shmobile_setup_console();
> @@ -474,9 +459,10 @@ struct sys_timer ag5evm_timer = {
> };
>
> MACHINE_START(AG5EVM, "ag5evm")
> - .map_io = ag5evm_map_io,
> + .map_io = shmobile_map_io,
> .init_irq = ag5evm_init_irq,
> .handle_irq = shmobile_handle_irq_gic,
> + .init_early = ag5evm_init_early,
> .init_machine = ag5evm_init,
> .timer = &ag5evm_timer,
> MACHINE_END
> diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
> index 1e35fa9..ed55c01 100644
> --- a/arch/arm/mach-shmobile/board-ap4evb.c
> +++ b/arch/arm/mach-shmobile/board-ap4evb.c
> @@ -59,7 +59,6 @@
>
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> #include <asm/mach/time.h>
> #include <asm/setup.h>
>
> @@ -1092,22 +1091,8 @@ static struct i2c_board_info i2c1_devices[] = {
> },
> };
>
> -static struct map_desc ap4evb_io_desc[] __initdata = {
> - /* create a 1:1 entity map for 0xe6xxxxxx
> - * used by CPGA, INTC and PFC.
> - */
> - {
> - .virtual = 0xe6000000,
> - .pfn = __phys_to_pfn(0xe6000000),
> - .length = 256 << 20,
> - .type = MT_DEVICE_NONSHARED
> - },
> -};
> -
> -static void __init ap4evb_map_io(void)
> +static void __init ap4evb_init_early(void)
> {
> - iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
> -
> /* setup early devices and console here as well */
> sh7372_add_early_devices();
> shmobile_setup_console();
> @@ -1359,9 +1344,10 @@ static struct sys_timer ap4evb_timer = {
> };
>
> MACHINE_START(AP4EVB, "ap4evb")
> - .map_io = ap4evb_map_io,
> + .map_io = shmobile_map_io,
> .init_irq = sh7372_init_irq,
> .handle_irq = shmobile_handle_irq_intc,
> + .init_early = ap4evb_init_early,
> .init_machine = ap4evb_init,
> .timer = &ap4evb_timer,
> MACHINE_END
> diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
> index ef4613b..20eeacf 100644
> --- a/arch/arm/mach-shmobile/board-g3evm.c
> +++ b/arch/arm/mach-shmobile/board-g3evm.c
> @@ -36,7 +36,6 @@
> #include <mach/common.h>
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> #include <asm/mach/time.h>
>
> /*
> @@ -245,22 +244,8 @@ static struct platform_device *g3evm_devices[] __initdata = {
> &irda_device,
> };
>
> -static struct map_desc g3evm_io_desc[] __initdata = {
> - /* create a 1:1 entity map for 0xe6xxxxxx
> - * used by CPGA, INTC and PFC.
> - */
> - {
> - .virtual = 0xe6000000,
> - .pfn = __phys_to_pfn(0xe6000000),
> - .length = 256 << 20,
> - .type = MT_DEVICE_NONSHARED
> - },
> -};
> -
> -static void __init g3evm_map_io(void)
> +static void __init g3evm_init_early(void)
> {
> - iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
> -
> /* setup early devices and console here as well */
> sh7367_add_early_devices();
> shmobile_setup_console();
> @@ -364,9 +349,10 @@ static struct sys_timer g3evm_timer = {
> };
>
> MACHINE_START(G3EVM, "g3evm")
> - .map_io = g3evm_map_io,
> + .map_io = shmobile_map_io,
> .init_irq = sh7367_init_irq,
> .handle_irq = shmobile_handle_irq_intc,
> + .init_early = g3evm_init_early,
> .init_machine = g3evm_init,
> .timer = &g3evm_timer,
> MACHINE_END
> diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
> index c87a7b7..079dd35 100644
> --- a/arch/arm/mach-shmobile/board-g4evm.c
> +++ b/arch/arm/mach-shmobile/board-g4evm.c
> @@ -37,7 +37,6 @@
> #include <mach/common.h>
> #include <asm/mach-types.h>
> #include <asm/mach/arch.h>
> -#include <asm/mach/map.h>
> #include <asm/mach/time.h>
>
> /*
> @@ -259,22 +258,8 @@ static struct platform_device *g4evm_devices[] __initdata = {
> &sdhi1_device,
> };
>
> -static struct map_desc g4evm_io_desc[] __initdata = {
> - /* create a 1:1 entity map for 0xe6xxxxxx
> - * used by CPGA, INTC and PFC.
> - */
> - {
> - .virtual = 0xe6000000,
> - .pfn = __phys_to_pfn(0xe6000000),
> - .length = 256 << 20,
> - .type = MT_DEVICE_NONSHARED
> - },
> -};
> -
> -static void __init g4evm_map_io(void)
> +static void __init g4evm_init_early(void)
> {
> - iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
> -
> /* setup early devices and console here as well */
> sh7377_add_early_devices();
> shmobile_setup_console();
> @@ -407,9 +392,10 @@ static struct sys_timer g4evm_timer = {
> };
>
> MACHINE_START(G4EVM, "g4evm")
> - .map_io = g4evm_map_io,
> + .map_io = shmobile_map_io,
> .init_irq = sh7377_init_irq,
> .handle_irq = shmobile_handle_irq_intc,
> + .init_early = g4evm_init_early,
> .init_machine = g4evm_init,
> .timer = &g4evm_timer,
> MACHINE_END
> diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
> index 7da2ca2..f05a673 100644
> --- a/arch/arm/mach-shmobile/board-mackerel.c
> +++ b/arch/arm/mach-shmobile/board-mackerel.c
> @@ -56,7 +56,6 @@
>
> #include <asm/mach/arch.h>
> #include <asm/mach/time.h>
> -#include <asm/mach/map.h>
> #include <asm/mach-types.h>
>
> /*
> @@ -1007,22 +1006,8 @@ static struct i2c_board_info i2c1_devices[] = {
> },
> };
>
> -static struct map_desc mackerel_io_desc[] __initdata = {
> - /* create a 1:1 entity map for 0xe6xxxxxx
> - * used by CPGA, INTC and PFC.
> - */
> - {
> - .virtual = 0xe6000000,
> - .pfn = __phys_to_pfn(0xe6000000),
> - .length = 256 << 20,
> - .type = MT_DEVICE_NONSHARED
> - },
> -};
> -
> -static void __init mackerel_map_io(void)
> +static void __init mackerel_init_early(void)
> {
> - iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
> -
> /* setup early devices and console here as well */
> sh7372_add_early_devices();
> shmobile_setup_console();
> @@ -1232,9 +1217,10 @@ static struct sys_timer mackerel_timer = {
> };
>
> MACHINE_START(MACKEREL, "mackerel")
> - .map_io = mackerel_map_io,
> + .map_io = shmobile_map_io,
> .init_irq = sh7372_init_irq,
> .handle_irq = shmobile_handle_irq_intc,
> + .init_early = mackerel_init_early,
> .init_machine = mackerel_init,
> .timer = &mackerel_timer,
> MACHINE_END
> diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
> index 013ac0e..cc7fdbc 100644
> --- a/arch/arm/mach-shmobile/include/mach/common.h
> +++ b/arch/arm/mach-shmobile/include/mach/common.h
> @@ -1,6 +1,7 @@
> #ifndef __ARCH_MACH_COMMON_H
> #define __ARCH_MACH_COMMON_H
>
> +extern void shmobile_map_io(void);
> extern struct sys_timer shmobile_timer;
> extern void shmobile_setup_console(void);
> extern void shmobile_secondary_vector(void);
> diff --git a/arch/arm/mach-shmobile/map_io.c b/arch/arm/mach-shmobile/map_io.c
> new file mode 100644
> index 0000000..1a62855
> --- /dev/null
> +++ b/arch/arm/mach-shmobile/map_io.c
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2010 Magnus Damm
> + * Copyright (C) 2008 Yoshihiro Shimoda
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; version 2 of the License.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/io.h>
> +
> +#include <mach/common.h>
> +
> +#include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
> +#include <asm/setup.h>
> +
> +static struct map_desc shmobile_io_desc[] __initdata = {
> + /* create a 1:1 entity map for 0xe6xxxxxx
> + * used by CPGA, INTC and PFC.
> + */
> + {
> + .virtual = 0xe6000000,
> + .pfn = __phys_to_pfn(0xe6000000),
> + .length = 256 << 20,
> + .type = MT_DEVICE_NONSHARED
> + },
> +};
> +
> +void __init shmobile_map_io(void)
> +{
> + iotable_init(shmobile_io_desc, ARRAY_SIZE(shmobile_io_desc));
> +}
> --
> 1.7.4.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] shmobile: fix map_io init usage
2011-05-13 1:56 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-05-14 10:26 ` Russell King - ARM Linux
2011-05-16 4:28 ` Magnus Damm
1 sibling, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-05-14 10:26 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, May 13, 2011 at 03:56:53AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 18:28 Sun 01 May , Jean-Christophe PLAGNIOL-VILLARD wrote:
> > switch early init to init_early and introduce soc map_io
> >
> > with this Patch we will not do any more early device setup during the map io
> >
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> > Cc: Paul Mundt <lethal@linux-sh.org>
> > Cc: Magnus Damm <magnus.damm@gmail.com>
> ping
Ultimately up to Paul and Magnus, but from my POV, it looks fine to me.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] shmobile: fix map_io init usage
2011-05-13 1:56 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-14 10:26 ` Russell King - ARM Linux
@ 2011-05-16 4:28 ` Magnus Damm
2011-05-16 7:49 ` Russell King - ARM Linux
1 sibling, 1 reply; 6+ messages in thread
From: Magnus Damm @ 2011-05-16 4:28 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, May 13, 2011 at 10:56 AM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 18:28 Sun 01 May ? ? , Jean-Christophe PLAGNIOL-VILLARD wrote:
>> switch early init to init_early and introduce soc map_io
>>
>> with this Patch we will not do any more early device setup during the map io
>>
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
>> Cc: Paul Mundt <lethal@linux-sh.org>
>> Cc: Magnus Damm <magnus.damm@gmail.com>
> ping
Why? The device init order is changed by this patch to setup the
serial console later. I fail to see the benefit. Basically, the serial
console setup is delayed to happen in ->init_early() instead of
->map_io(). In practice this means that we restrict ourselves to not
be able to output debug messages on the serial console from a bunch of
calls in setup_arch().
/ magnus
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] shmobile: fix map_io init usage
2011-05-16 4:28 ` Magnus Damm
@ 2011-05-16 7:49 ` Russell King - ARM Linux
2011-05-18 10:56 ` Magnus Damm
0 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-05-16 7:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, May 16, 2011 at 01:28:34PM +0900, Magnus Damm wrote:
> On Fri, May 13, 2011 at 10:56 AM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 18:28 Sun 01 May ? ? , Jean-Christophe PLAGNIOL-VILLARD wrote:
> >> switch early init to init_early and introduce soc map_io
> >>
> >> with this Patch we will not do any more early device setup during the map io
> >>
> >> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> >> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> >> Cc: Paul Mundt <lethal@linux-sh.org>
> >> Cc: Magnus Damm <magnus.damm@gmail.com>
> > ping
>
> Why? The device init order is changed by this patch to setup the
> serial console later. I fail to see the benefit. Basically, the serial
> console setup is delayed to happen in ->init_early() instead of
> ->map_io(). In practice this means that we restrict ourselves to not
> be able to output debug messages on the serial console from a bunch of
> calls in setup_arch().
Because that's how its supposed to work. map_io is for setting up the
device mappings. Those mappings need flushing out to RAM on some CPUs
to be visible, and that's taken care of _after_ map_io has returned.
If the page table entries haven't found their way to RAM, accessing
devices in map_io will cause a fault, and produce a silently non-booting
kernel. With a write-alloc writeback cache policy, this becomes more
likely than the default policy of a read-alloc writeback cache.
Platforms should not do their own cache and TLB maintainence in their
map_io callback to make it work either - should we need to change
things that means going through all platforms.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] shmobile: fix map_io init usage
2011-05-16 7:49 ` Russell King - ARM Linux
@ 2011-05-18 10:56 ` Magnus Damm
0 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2011-05-18 10:56 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, May 16, 2011 at 4:49 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, May 16, 2011 at 01:28:34PM +0900, Magnus Damm wrote:
>> On Fri, May 13, 2011 at 10:56 AM, Jean-Christophe PLAGNIOL-VILLARD
>> <plagnioj@jcrosoft.com> wrote:
>> > On 18:28 Sun 01 May ? ? , Jean-Christophe PLAGNIOL-VILLARD wrote:
>> >> switch early init to init_early and introduce soc map_io
>> >>
>> >> with this Patch we will not do any more early device setup during the map io
>> >>
>> >> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> >> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
>> >> Cc: Paul Mundt <lethal@linux-sh.org>
>> >> Cc: Magnus Damm <magnus.damm@gmail.com>
>> > ping
>>
>> Why? The device init order is changed by this patch to setup the
>> serial console later. I fail to see the benefit. Basically, the serial
>> console setup is delayed to happen in ->init_early() instead of
>> ->map_io(). In practice this means that we restrict ourselves to not
>> be able to output debug messages on the serial console from a bunch of
>> calls in setup_arch().
>
> Because that's how its supposed to work. ?map_io is for setting up the
> device mappings. ?Those mappings need flushing out to RAM on some CPUs
> to be visible, and that's taken care of _after_ map_io has returned.
>
> If the page table entries haven't found their way to RAM, accessing
> devices in map_io will cause a fault, and produce a silently non-booting
> kernel. ?With a write-alloc writeback cache policy, this becomes more
> likely than the default policy of a read-alloc writeback cache.
>
> Platforms should not do their own cache and TLB maintainence in their
> map_io callback to make it work either - should we need to change
> things that means going through all platforms.
Ok, I understand. Thanks for the detailed explanation Russell.
I've just tested this patch on AG5EVM / sh73a0 and it seems to work well.
Acked-by: Magnus Damm <damm@opensource.se>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-18 10:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-01 16:28 [PATCH] shmobile: fix map_io init usage Jean-Christophe PLAGNIOL-VILLARD
2011-05-13 1:56 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-14 10:26 ` Russell King - ARM Linux
2011-05-16 4:28 ` Magnus Damm
2011-05-16 7:49 ` Russell King - ARM Linux
2011-05-18 10:56 ` Magnus Damm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.