6db20da93c95c50ef935d78402e8ed26814868c5
[oweals/openwrt.git] /
1 From 765e7a067eebf372687048ba0242e27f43cf0d71 Mon Sep 17 00:00:00 2001
2 From: Nishanth Menon <nm@ti.com>
3 Date: Wed, 16 Oct 2013 15:39:02 +0000
4 Subject: ARM: OMAP2+: add missing lateinit hook for calling pm late init
5
6 AM335x, AM43xx, OMAP5 and DRA7 have missing late init hook. Introduce
7 SoC specific hook with a call to OMAP2+ generic lateinit hook. This
8 allows the generic late initializations such as cpufreq hooks to be
9 active.
10
11 Based on out-of-tree patches that need to be introduced in
12 mainline, this introduction allows us to provide the foundation for
13 further SoC specific features as they are developed.
14
15 Cc: Benoit Cousson <bcousson@baylibre.com>
16 Cc: Kevin Hilman <khilman@deeprootsystems.com>
17 Cc: Paul Walmsley <paul@pwsan.com>
18 Cc: Tony Lindgren <tony@atomide.com>
19 Signed-off-by: Nishanth Menon <nm@ti.com>
20 Signed-off-by: Tony Lindgren <tony@atomide.com>
21 ---
22 --- a/arch/arm/mach-omap2/board-generic.c
23 +++ b/arch/arm/mach-omap2/board-generic.c
24 @@ -180,6 +180,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM3
25         .init_irq       = omap_intc_of_init,
26         .handle_irq     = omap3_intc_handle_irq,
27         .init_machine   = omap_generic_init,
28 +       .init_late      = am33xx_init_late,
29         .init_time      = omap3_gptimer_timer_init,
30         .dt_compat      = am33xx_boards_compat,
31         .restart        = am33xx_restart,
32 @@ -219,6 +220,7 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP
33         .init_early     = omap5_init_early,
34         .init_irq       = omap_gic_of_init,
35         .init_machine   = omap_generic_init,
36 +       .init_late      = omap5_init_late,
37         .init_time      = omap5_realtime_timer_init,
38         .dt_compat      = omap5_boards_compat,
39         .restart        = omap44xx_restart,
40 @@ -234,6 +236,7 @@ static const char *am43_boards_compat[]
41  DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
42         .map_io         = am33xx_map_io,
43         .init_early     = am43xx_init_early,
44 +       .init_late      = am43xx_init_late,
45         .init_irq       = omap_gic_of_init,
46         .init_machine   = omap_generic_init,
47         .init_time      = omap3_sync32k_timer_init,
48 @@ -252,6 +255,7 @@ DT_MACHINE_START(DRA7XX_DT, "Generic DRA
49         .smp            = smp_ops(omap4_smp_ops),
50         .map_io         = omap5_map_io,
51         .init_early     = dra7xx_init_early,
52 +       .init_late      = dra7xx_init_late,
53         .init_irq       = omap_gic_of_init,
54         .init_machine   = omap_generic_init,
55         .init_time      = omap5_realtime_timer_init,
56 --- a/arch/arm/mach-omap2/common.h
57 +++ b/arch/arm/mach-omap2/common.h
58 @@ -98,6 +98,7 @@ void am35xx_init_early(void);
59  void ti81xx_init_early(void);
60  void am33xx_init_early(void);
61  void am43xx_init_early(void);
62 +void am43xx_init_late(void);
63  void omap4430_init_early(void);
64  void omap5_init_early(void);
65  void omap3_init_late(void);    /* Do not use this one */
66 @@ -109,8 +110,11 @@ void omap35xx_init_late(void);
67  void omap3630_init_late(void);
68  void am35xx_init_late(void);
69  void ti81xx_init_late(void);
70 +void am33xx_init_late(void);
71 +void omap5_init_late(void);
72  int omap2_common_pm_late_init(void);
73  void dra7xx_init_early(void);
74 +void dra7xx_init_late(void);
75  
76  #ifdef CONFIG_SOC_BUS
77  void omap_soc_device_init(void);
78 --- a/arch/arm/mach-omap2/io.c
79 +++ b/arch/arm/mach-omap2/io.c
80 @@ -583,6 +583,11 @@ void __init am33xx_init_early(void)
81         omap_hwmod_init_postsetup();
82         omap_clk_init = am33xx_clk_init;
83  }
84 +
85 +void __init am33xx_init_late(void)
86 +{
87 +       omap_common_late_init();
88 +}
89  #endif
90  
91  #ifdef CONFIG_SOC_AM43XX
92 @@ -596,6 +601,11 @@ void __init am43xx_init_early(void)
93         omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM43XX_PRCM_BASE), NULL);
94         omap3xxx_check_revision();
95  }
96 +
97 +void __init am43xx_init_late(void)
98 +{
99 +       omap_common_late_init();
100 +}
101  #endif
102  
103  #ifdef CONFIG_ARCH_OMAP4
104 @@ -651,6 +661,11 @@ void __init omap5_init_early(void)
105         omap54xx_hwmod_init();
106         omap_hwmod_init_postsetup();
107  }
108 +
109 +void __init omap5_init_late(void)
110 +{
111 +       omap_common_late_init();
112 +}
113  #endif
114  
115  #ifdef CONFIG_SOC_DRA7XX
116 @@ -671,6 +686,11 @@ void __init dra7xx_init_early(void)
117         dra7xx_hwmod_init();
118         omap_hwmod_init_postsetup();
119  }
120 +
121 +void __init dra7xx_init_late(void)
122 +{
123 +       omap_common_late_init();
124 +}
125  #endif
126  
127