ARM: at91: fix ordering of SRAM and PM initialization
authorNicolas Ferre <nicolas.ferre@atmel.com>
Fri, 23 Jan 2015 10:47:37 +0000 (11:47 +0100)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Mon, 26 Jan 2015 12:43:35 +0000 (13:43 +0100)
The PM initialization needs internal SRAM for allocating a gen_pool and
use it to store its PM code. So we need to have of_platform_populate() before
this code.

Suggested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
arch/arm/mach-at91/board-dt-rm9200.c
arch/arm/mach-at91/board-dt-sam9.c
arch/arm/mach-at91/board-dt-sama5.c

index 0455c96d32b1b567fc86e15a66c36e96ddf51afc..d47c4433444dc428dfb899c21d9b1ffe45c992af 100644 (file)
@@ -33,9 +33,9 @@ static void __init at91rm9200_dt_timer_init(void)
 
 static void __init rm9200_dt_device_init(void)
 {
-       at91_rm9200_pm_init();
-
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
+       at91_rm9200_pm_init();
 }
 
 
index 8391b9558c2249f2da0ca7a5fcab0b7d220577ef..f5d922e57655dd542ab215be3b2c179e09f4da7c 100644 (file)
 
 static void __init sam9_dt_device_init(void)
 {
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
        arm_pm_idle = at91sam9_idle;
        at91_sam9260_pm_init();
-
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static const char *at91_dt_board_compat[] __initconst = {
@@ -48,10 +48,10 @@ MACHINE_END
 
 static void __init sam9g45_dt_device_init(void)
 {
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
        arm_pm_idle = at91sam9_idle;
        at91_sam9g45_pm_init();
-
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static const char *at91_9g45_board_compat[] __initconst = {
@@ -69,10 +69,10 @@ MACHINE_END
 
 static void __init sam9x5_dt_device_init(void)
 {
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
        arm_pm_idle = at91sam9_idle;
        at91_sam9x5_pm_init();
-
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
 static const char *at91_9x5_board_compat[] __initconst = {
index b7338966c8ab6e8f79fef3cf5464c3925713d608..86cffcdef14502d312fc3cd43beea9947a50ba0a 100644 (file)
@@ -28,8 +28,8 @@
 
 static void __init sama5_dt_device_init(void)
 {
-       at91_sam9x5_pm_init();
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+       at91_sam9x5_pm_init();
 }
 
 static const char *sama5_dt_board_compat[] __initconst = {