]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: AT91: DT: pm: Select ram controller standby based on DT
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Wed, 16 Oct 2013 14:24:57 +0000 (16:24 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 16 Oct 2013 21:51:47 +0000 (23:51 +0200)
Move non-dt selection to ioremap_registers init which is only called not
non-dt board.

So we can support sam9n12/sam9x5/sama5d3 too.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/setup.c

index 0d234f2a04b3a6195d781eaa134d6dcb36f8e03a..25805f2f6010f3d7b98035f9c8e3b1e09524a4e3 100644 (file)
@@ -328,6 +328,7 @@ static void __init at91rm9200_ioremap_registers(void)
 {
        at91rm9200_ioremap_st(AT91RM9200_BASE_ST);
        at91_ioremap_ramc(0, AT91RM9200_BASE_MC, 256);
+       at91_pm_set_standby(at91rm9200_standby);
 }
 
 static void __init at91rm9200_initialize(void)
@@ -338,8 +339,6 @@ static void __init at91rm9200_initialize(void)
        /* Initialize GPIO subsystem */
        at91_gpio_init(at91rm9200_gpio,
                cpu_is_at91rm9200_bga() ? AT91RM9200_BGA : AT91RM9200_PQFP);
-
-       at91_pm_set_standby(at91rm9200_standby);
 }
 
 
index 3b43d562d79cf23d2335a243b0826ae7d9555fe4..f8629a3fa2452791b6215c19f77124813e1d3f5f 100644 (file)
@@ -343,6 +343,7 @@ static void __init at91sam9260_ioremap_registers(void)
        at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT);
        at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
        at91_ioremap_matrix(AT91SAM9260_BASE_MATRIX);
+       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 static void __init at91sam9260_initialize(void)
@@ -352,8 +353,6 @@ static void __init at91sam9260_initialize(void)
 
        /* Register GPIO subsystem */
        at91_gpio_init(at91sam9260_gpio, 3);
-
-       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 /* --------------------------------------------------------------------
index a0857c30a914995ed880cb1f03e5e36766699bde..1f3867a17a289beee4bb1a44ae64ca3bc96b044d 100644 (file)
@@ -285,6 +285,7 @@ static void __init at91sam9261_ioremap_registers(void)
        at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT);
        at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
        at91_ioremap_matrix(AT91SAM9261_BASE_MATRIX);
+       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 static void __init at91sam9261_initialize(void)
@@ -294,8 +295,6 @@ static void __init at91sam9261_initialize(void)
 
        /* Register GPIO subsystem */
        at91_gpio_init(at91sam9261_gpio, 3);
-
-       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 /* --------------------------------------------------------------------
index 103a95baa8e2501c640857fe8ae0b1b66dcac337..90d455d294a1814e7e72722b5614b4d15548c298 100644 (file)
@@ -322,6 +322,7 @@ static void __init at91sam9263_ioremap_registers(void)
        at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0);
        at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
        at91_ioremap_matrix(AT91SAM9263_BASE_MATRIX);
+       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 static void __init at91sam9263_initialize(void)
@@ -331,8 +332,6 @@ static void __init at91sam9263_initialize(void)
 
        /* Register GPIO subsystem */
        at91_gpio_init(at91sam9263_gpio, 5);
-
-       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 /* --------------------------------------------------------------------
index f29731e9968c8de666bd6f05a910d3be3855fc2a..e9bf0b8f40eb745d317e2d1d50c500eea1491aa4 100644 (file)
@@ -371,6 +371,7 @@ static void __init at91sam9g45_ioremap_registers(void)
        at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT);
        at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC);
        at91_ioremap_matrix(AT91SAM9G45_BASE_MATRIX);
+       at91_pm_set_standby(at91_ddr_standby);
 }
 
 static void __init at91sam9g45_initialize(void)
@@ -380,8 +381,6 @@ static void __init at91sam9g45_initialize(void)
 
        /* Register GPIO subsystem */
        at91_gpio_init(at91sam9g45_gpio, 5);
-
-       at91_pm_set_standby(at91_ddr_standby);
 }
 
 /* --------------------------------------------------------------------
index 9e28f419f4143ce2e000c39f998adca67fc66530..88995af09c043abf6198124d1c651d60ac03b0ff 100644 (file)
@@ -288,6 +288,7 @@ static void __init at91sam9rl_ioremap_registers(void)
        at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT);
        at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
        at91_ioremap_matrix(AT91SAM9RL_BASE_MATRIX);
+       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 static void __init at91sam9rl_initialize(void)
@@ -297,8 +298,6 @@ static void __init at91sam9rl_initialize(void)
 
        /* Register GPIO subsystem */
        at91_gpio_init(at91sam9rl_gpio, 4);
-
-       at91_pm_set_standby(at91sam9_sdram_standby);
 }
 
 /* --------------------------------------------------------------------
index b17fbcf4d9e8f34dbd876ea96af334dae4780efc..094b3459c288e37700c42ea85a57ced905323eda 100644 (file)
@@ -23,6 +23,7 @@
 #include "at91_shdwc.h"
 #include "soc.h"
 #include "generic.h"
+#include "pm.h"
 
 struct at91_init_soc __initdata at91_boot_soc;
 
@@ -376,15 +377,16 @@ static void at91_dt_rstc(void)
 }
 
 static struct of_device_id ramc_ids[] = {
-       { .compatible = "atmel,at91rm9200-sdramc" },
-       { .compatible = "atmel,at91sam9260-sdramc" },
-       { .compatible = "atmel,at91sam9g45-ddramc" },
+       { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
+       { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
+       { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
        { /*sentinel*/ }
 };
 
 static void at91_dt_ramc(void)
 {
        struct device_node *np;
+       const struct of_device_id *of_id;
 
        np = of_find_matching_node(NULL, ramc_ids);
        if (!np)
@@ -396,6 +398,12 @@ static void at91_dt_ramc(void)
        /* the controller may have 2 banks */
        at91_ramc_base[1] = of_iomap(np, 1);
 
+       of_id = of_match_node(ramc_ids, np);
+       if (!of_id)
+               pr_warn("AT91: ramc no standby function available\n");
+       else
+               at91_pm_set_standby(of_id->data);
+
        of_node_put(np);
 }