ARM: OMAP2+: am33xx: Add AM335XEVM machine support
authorAfzal Mohammed <afzal@ti.com>
Thu, 10 May 2012 19:08:49 +0000 (00:38 +0530)
committerTony Lindgren <tony@atomide.com>
Tue, 5 Jun 2012 07:52:37 +0000 (00:52 -0700)
This patch adds minimal support for AM335X machine init.

During last merge window, two separate patches supporting am33xx
machine init had been submitted,

1. Link to earlier Baseport patch submission (Legacy):
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg59325.html
2. Link to earlier DT based machine init support patch submission:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg61398.html

And both had got accepted at that time, but got missed during
merge window.

But now, since we have taken decision to make am33xx as a separate
class and not to follow omap3 family, these patches needs to changes
accordingly (only changes),

 - Combine both the patches, since early init and timer init
   used in board-generic.c file requires them.
 - Remove dependency on AM3517EVM, and only use DT approach
   for machine init.
 - Change the config option (as changed recently)
   CONFIG_SOC_OMAPAM33XX --> CONFIG_SOC_AM33XX

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-generic.c
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/irq.c
arch/arm/mach-omap2/timer.c

index 20293465786701f8650e1377ea070c6eee536673..2f2abfb82d848532668503aed30291ae34422fea 100644 (file)
@@ -112,6 +112,24 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
 MACHINE_END
 #endif
 
+#ifdef CONFIG_SOC_AM33XX
+static const char *am33xx_boards_compat[] __initdata = {
+       "ti,am33xx",
+       NULL,
+};
+
+DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
+       .reserve        = omap_reserve,
+       .map_io         = am33xx_map_io,
+       .init_early     = am33xx_init_early,
+       .init_irq       = omap_init_irq,
+       .handle_irq     = omap3_intc_handle_irq,
+       .init_machine   = omap_generic_init,
+       .timer          = &omap3_am33xx_timer,
+       .dt_compat      = am33xx_boards_compat,
+MACHINE_END
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 static const char *omap4_boards_compat[] __initdata = {
        "ti,omap4",
index be9dfd1abe603f247c089f7c0feab81bb3402223..56f687bebd0af43b54a07416cfcb274d2279c132 100644 (file)
@@ -120,6 +120,7 @@ extern void omap2_init_common_infrastructure(void);
 extern struct sys_timer omap2_timer;
 extern struct sys_timer omap3_timer;
 extern struct sys_timer omap3_secure_timer;
+extern struct sys_timer omap3_am33xx_timer;
 extern struct sys_timer omap4_timer;
 
 void omap2420_init_early(void);
@@ -130,6 +131,7 @@ void omap3630_init_early(void);
 void omap3_init_early(void);   /* Do not use this one */
 void am35xx_init_early(void);
 void ti81xx_init_early(void);
+void am33xx_init_early(void);
 void omap4430_init_early(void);
 void omap3_init_late(void);    /* Do not use this one */
 void omap4430_init_late(void);
index 8d014ba04abcc7fe0fe0416db50dcb212458bb94..5d6b2346bf755fdf88d73914ef5f536682100a4a 100644 (file)
@@ -477,6 +477,16 @@ void __init ti81xx_init_late(void)
 }
 #endif
 
+#ifdef CONFIG_SOC_AM33XX
+void __init am33xx_init_early(void)
+{
+       omap2_set_globals_am33xx();
+       omap3xxx_check_revision();
+       ti81xx_check_features();
+       omap_common_init_early();
+}
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 void __init omap4430_init_early(void)
 {
index fdc4303be563169dedbd458bd8391a16e43e252b..428685f650601d8cef27f807b90adccc38f7171f 100644 (file)
@@ -279,7 +279,7 @@ int __init omap_intc_of_init(struct device_node *node,
        return 0;
 }
 
-#ifdef CONFIG_ARCH_OMAP3
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX)
 static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
 
 void omap_intc_save_context(void)
index 840929bd9daecce4ef8e1ee95c2d404a2536c9c4..ea6a0eb13f053db8bd141ef0e1aecaa386bcb38d 100644 (file)
@@ -368,6 +368,11 @@ OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE,
 OMAP_SYS_TIMER(3_secure)
 #endif
 
+#ifdef CONFIG_SOC_AM33XX
+OMAP_SYS_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, 2, OMAP4_MPU_SOURCE)
+OMAP_SYS_TIMER(3_am33xx)
+#endif
+
 #ifdef CONFIG_ARCH_OMAP4
 #ifdef CONFIG_LOCAL_TIMERS
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer,