]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: OMAP4+: Initialize SAR RAM base early for proper CPU1 reset for kexec
authorTony Lindgren <tony@atomide.com>
Wed, 22 Jun 2016 08:59:39 +0000 (01:59 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 23 Jun 2016 05:55:47 +0000 (22:55 -0700)
Prepare things for making kexec work on SMP omap variants by initializing
SARM RAM base early. This allows us to configure CPU1 for kexec in case
the previous kernel has put CPU1 in low power mode.

Note that this should not prevent moving other SAR RAM code to live
under drivers. However for kexec, we will need this very early.

Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/io.c
arch/arm/mach-omap2/omap4-common.c

index f7666b9f3b21c2256aafeedb932eee6027b90700..9cbae6e059a379fefe8abea8c658e6fbd547faf9 100644 (file)
@@ -257,6 +257,7 @@ extern void gic_dist_enable(void);
 extern bool gic_dist_disabled(void);
 extern void gic_timer_retrigger(void);
 extern void omap_smc1(u32 fn, u32 arg);
+extern void omap4_sar_ram_init(void);
 extern void __iomem *omap4_get_sar_ram_base(void);
 extern void omap_do_wfi(void);
 
index 49de4dd227be4b7513b2aa7c414016464a86ce38..4548cb9f673ee6da6082f2b28bc554caabda7c3e 100644 (file)
@@ -690,6 +690,7 @@ void __init omap4430_init_early(void)
        omap4xxx_check_revision();
        omap4xxx_check_features();
        omap2_prcm_base_init();
+       omap4_sar_ram_init();
        omap4_pm_init_early();
        omap44xx_voltagedomains_init();
        omap44xx_powerdomains_init();
@@ -718,6 +719,7 @@ void __init omap5_init_early(void)
        omap4_pm_init_early();
        omap2_prcm_base_init();
        omap5xxx_check_revision();
+       omap4_sar_ram_init();
        omap54xx_voltagedomains_init();
        omap54xx_powerdomains_init();
        omap54xx_clockdomains_init();
index fb6fe26a8f8fee34f172523c3c80c77a6d012d66..cf65ab8bb0046f69d3bc244cc4636f2ead54a8b8 100644 (file)
@@ -266,10 +266,11 @@ void __iomem *omap4_get_sar_ram_base(void)
 }
 
 /*
- * SAR RAM used to save and restore the HW
- * context in low power modes
+ * SAR RAM used to save and restore the HW context in low power modes.
+ * Note that we need to initialize this very early for kexec. See
+ * omap4_mpuss_early_init().
  */
-static int __init omap4_sar_ram_init(void)
+void __init omap4_sar_ram_init(void)
 {
        unsigned long sar_base;
 
@@ -282,16 +283,13 @@ static int __init omap4_sar_ram_init(void)
        else if (soc_is_omap54xx())
                sar_base = OMAP54XX_SAR_RAM_BASE;
        else
-               return -ENOMEM;
+               return;
 
        /* Static mapping, never released */
        sar_ram_base = ioremap(sar_base, SZ_16K);
        if (WARN_ON(!sar_ram_base))
-               return -ENOMEM;
-
-       return 0;
+               return;
 }
-omap_early_initcall(omap4_sar_ram_init);
 
 static const struct of_device_id intc_match[] = {
        { .compatible = "ti,omap4-wugen-mpu", },