Skip to content

Commit f4b9f40

Browse files
committed
ARM: OMAP4+: Initialize SAR RAM base early for proper CPU1 reset for kexec
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>
1 parent 99eb45f commit f4b9f40

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

arch/arm/mach-omap2/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ extern void gic_dist_enable(void);
257257
extern bool gic_dist_disabled(void);
258258
extern void gic_timer_retrigger(void);
259259
extern void omap_smc1(u32 fn, u32 arg);
260+
extern void omap4_sar_ram_init(void);
260261
extern void __iomem *omap4_get_sar_ram_base(void);
261262
extern void omap_do_wfi(void);
262263

arch/arm/mach-omap2/io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ void __init omap4430_init_early(void)
690690
omap4xxx_check_revision();
691691
omap4xxx_check_features();
692692
omap2_prcm_base_init();
693+
omap4_sar_ram_init();
693694
omap4_pm_init_early();
694695
omap44xx_voltagedomains_init();
695696
omap44xx_powerdomains_init();
@@ -718,6 +719,7 @@ void __init omap5_init_early(void)
718719
omap4_pm_init_early();
719720
omap2_prcm_base_init();
720721
omap5xxx_check_revision();
722+
omap4_sar_ram_init();
721723
omap54xx_voltagedomains_init();
722724
omap54xx_powerdomains_init();
723725
omap54xx_clockdomains_init();

arch/arm/mach-omap2/omap4-common.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,11 @@ void __iomem *omap4_get_sar_ram_base(void)
266266
}
267267

268268
/*
269-
* SAR RAM used to save and restore the HW
270-
* context in low power modes
269+
* SAR RAM used to save and restore the HW context in low power modes.
270+
* Note that we need to initialize this very early for kexec. See
271+
* omap4_mpuss_early_init().
271272
*/
272-
static int __init omap4_sar_ram_init(void)
273+
void __init omap4_sar_ram_init(void)
273274
{
274275
unsigned long sar_base;
275276

@@ -282,16 +283,13 @@ static int __init omap4_sar_ram_init(void)
282283
else if (soc_is_omap54xx())
283284
sar_base = OMAP54XX_SAR_RAM_BASE;
284285
else
285-
return -ENOMEM;
286+
return;
286287

287288
/* Static mapping, never released */
288289
sar_ram_base = ioremap(sar_base, SZ_16K);
289290
if (WARN_ON(!sar_ram_base))
290-
return -ENOMEM;
291-
292-
return 0;
291+
return;
293292
}
294-
omap_early_initcall(omap4_sar_ram_init);
295293

296294
static const struct of_device_id intc_match[] = {
297295
{ .compatible = "ti,omap4-wugen-mpu", },

0 commit comments

Comments
 (0)