All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/2] ARM: shmobile: r8a7740: Do not use early devices with DT reference
@ 2013-02-28 17:00 Bastian Hecht
  0 siblings, 0 replies; 2+ messages in thread
From: Bastian Hecht @ 2013-02-28 17:00 UTC (permalink / raw)
  To: linux-sh

Do not initialise any early devices when using the minimal DT
reference code. Only the delay needs to be initialised.

Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
---
v2: new patch added to the patchset.

This patch is done the same way as ARM: shmobile: r8a7779: Do not use early devices with DT reference (c0f7d218d5d8623bc1a6728cd30011aa7c4e6f87)

 .../board-armadillo800eva-reference.c              |   10 +++-----
 arch/arm/mach-shmobile/include/mach/common.h       |    2 +-
 arch/arm/mach-shmobile/setup-r8a7740.c             |   24 ++++++++------------
 3 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
index 6991fb1..5ed2299 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c
@@ -208,12 +208,8 @@ static void __init eva_init(void)
 	/* Early BRESP enable, Shared attribute override enable, 32K*8way */
 	l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff);
 #endif
-}
-
-static void __init eva_timer_init(void)
-{
+	/* clocks are setup late during boot in the case of DT */
 	r8a7740_clock_init(MD_CK0 | MD_CK2);
-
 	/* the rate of extal1 clock must be set before late_time_init */
 	eva_clock_init();
 }
@@ -232,13 +228,13 @@ static const char *eva_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference")
 	.map_io		= r8a7740_map_io,
-	.init_early	= r8a7740_add_early_devices_dt,
+	.init_early	= r8a7740_init_delay,
 	.init_irq	= r8a7740_init_irq_of,
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= eva_init,
 	.init_late	= shmobile_init_late,
-	.init_time	= eva_timer_init,
+	.init_time	= shmobile_timer_init,
 	.dt_compat	= eva_boards_compat_dt,
 	.restart	= eva_restart,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index d08a0b8..c9267ed 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -51,11 +51,11 @@ extern struct clk sh73a0_extal2_clk;
 extern struct clk sh73a0_extcki_clk;
 extern struct clk sh73a0_extalr_clk;
 
+extern void r8a7740_init_delay(void);
 extern void r8a7740_init_irq_of(void);
 extern void r8a7740_init_irq(void);
 extern void r8a7740_map_io(void);
 extern void r8a7740_add_early_devices(void);
-extern void r8a7740_add_early_devices_dt(void);
 extern void r8a7740_add_standard_devices(void);
 extern void r8a7740_add_standard_devices_dt(void);
 extern void r8a7740_clock_init(u8 md_ck);
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 5312aad..f35e7c2 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -378,7 +378,7 @@ static struct platform_device tmu02_device = {
 	.num_resources	= ARRAY_SIZE(tmu02_resources),
 };
 
-static struct platform_device *r8a7740_early_devices[] __initdata = {
+static struct platform_device *r8a7740_devices_dt[] __initdata = {
 	&scif0_device,
 	&scif1_device,
 	&scif2_device,
@@ -805,8 +805,8 @@ void __init r8a7740_add_standard_devices(void)
 	r8a7740_init_pm_domains();
 
 	/* add devices */
-	platform_add_devices(r8a7740_early_devices,
-			    ARRAY_SIZE(r8a7740_early_devices));
+	platform_add_devices(r8a7740_devices_dt,
+			    ARRAY_SIZE(r8a7740_devices_dt));
 	platform_add_devices(r8a7740_late_devices,
 			     ARRAY_SIZE(r8a7740_late_devices));
 
@@ -826,8 +826,8 @@ void __init r8a7740_add_standard_devices(void)
 
 void __init r8a7740_add_early_devices(void)
 {
-	early_platform_add_devices(r8a7740_early_devices,
-				   ARRAY_SIZE(r8a7740_early_devices));
+	early_platform_add_devices(r8a7740_devices_dt,
+				   ARRAY_SIZE(r8a7740_devices_dt));
 
 	/* setup early console here as well */
 	shmobile_setup_console();
@@ -835,15 +835,9 @@ void __init r8a7740_add_early_devices(void)
 
 #ifdef CONFIG_USE_OF
 
-void __init r8a7740_add_early_devices_dt(void)
+void __init r8a7740_init_delay(void)
 {
 	shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */
-
-	early_platform_add_devices(r8a7740_early_devices,
-				   ARRAY_SIZE(r8a7740_early_devices));
-
-	/* setup early console here as well */
-	shmobile_setup_console();
 }
 
 static const struct of_dev_auxdata r8a7740_auxdata_lookup[] __initconst = {
@@ -852,8 +846,8 @@ static const struct of_dev_auxdata r8a7740_auxdata_lookup[] __initconst = {
 
 void __init r8a7740_add_standard_devices_dt(void)
 {
-	platform_add_devices(r8a7740_early_devices,
-			    ARRAY_SIZE(r8a7740_early_devices));
+	platform_add_devices(r8a7740_devices_dt,
+			    ARRAY_SIZE(r8a7740_devices_dt));
 
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     r8a7740_auxdata_lookup, NULL);
@@ -874,7 +868,7 @@ static const char *r8a7740_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
 	.map_io		= r8a7740_map_io,
-	.init_early	= r8a7740_add_early_devices_dt,
+	.init_early	= r8a7740_init_delay,
 	.init_irq	= r8a7740_init_irq_of,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= add_standard_devices,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 2/2] ARM: shmobile: r8a7740: Do not use early devices with DT reference
@ 2013-03-01  1:13 Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2013-03-01  1:13 UTC (permalink / raw)
  To: linux-sh

On Thu, Feb 28, 2013 at 12:00:10PM -0600, Bastian Hecht wrote:
> Do not initialise any early devices when using the minimal DT
> reference code. Only the delay needs to be initialised.

Thanks this looks good to me.
I have added this to the topic/intc-of intc branch.

The reason that I have added this it and the other
Armadillo800EVA-reference
patches there is that I believe that they depend on the INTC DT bindings
which currently live in that topic branch.

If there is a way to remove that dependency please let me know.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-01  1:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 17:00 [PATCH v2 2/2] ARM: shmobile: r8a7740: Do not use early devices with DT reference Bastian Hecht
2013-03-01  1:13 Simon Horman

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.