diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2014-06-06 18:30:43 -0400 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2014-09-08 12:38:42 -0400 |
commit | e97c4eb342055b24da886b56377dc0093e835b4a (patch) | |
tree | 52d4f22a3385f74dbdf6c693533045e4e6fc881e /arch | |
parent | 325f29da0d21900a78a91724acd6640e59f3e13c (diff) |
ARM: OMAP5 / DRA7: PM: Provide a dummy startup function for CPU hotplug
Dont assume that all OMAP4+ code will be able to use OMAP4 hotplug
logic. On OMAP5, DRA7, we do not need this in place yet, also,
currently the CPU startup pointer is located in omap4_cpu_pm_info
instead of cpu_pm_ops.
So, isolate the function to hotplug_restart pointer in cpu_pm_ops
where it should have belonged, initalize them as per valid startup
pointers for OMAP4430/60 as in current logic, however provide
dummy_cpu_resume to be the startup location as well.
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[nm@ti.com: split this out of original code and isolate it]
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/omap-mpuss-lowpower.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c index 53d8de5764e8..207fce2d6932 100644 --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c | |||
@@ -69,7 +69,6 @@ struct omap4_cpu_pm_info { | |||
69 | void __iomem *scu_sar_addr; | 69 | void __iomem *scu_sar_addr; |
70 | void __iomem *wkup_sar_addr; | 70 | void __iomem *wkup_sar_addr; |
71 | void __iomem *l2x0_sar_addr; | 71 | void __iomem *l2x0_sar_addr; |
72 | void (*secondary_startup)(void); | ||
73 | }; | 72 | }; |
74 | 73 | ||
75 | /** | 74 | /** |
@@ -77,6 +76,7 @@ struct omap4_cpu_pm_info { | |||
77 | * @finish_suspend: CPU suspend finisher function pointer | 76 | * @finish_suspend: CPU suspend finisher function pointer |
78 | * @resume: CPU resume function pointer | 77 | * @resume: CPU resume function pointer |
79 | * @scu_prepare: CPU Snoop Control program function pointer | 78 | * @scu_prepare: CPU Snoop Control program function pointer |
79 | * @hotplug_restart: CPU restart function pointer | ||
80 | * | 80 | * |
81 | * Structure holds functions pointer for CPU low power operations like | 81 | * Structure holds functions pointer for CPU low power operations like |
82 | * suspend, resume and scu programming. | 82 | * suspend, resume and scu programming. |
@@ -85,6 +85,7 @@ struct cpu_pm_ops { | |||
85 | int (*finish_suspend)(unsigned long cpu_state); | 85 | int (*finish_suspend)(unsigned long cpu_state); |
86 | void (*resume)(void); | 86 | void (*resume)(void); |
87 | void (*scu_prepare)(unsigned int cpu_id, unsigned int cpu_state); | 87 | void (*scu_prepare)(unsigned int cpu_id, unsigned int cpu_state); |
88 | void (*hotplug_restart)(void); | ||
88 | }; | 89 | }; |
89 | 90 | ||
90 | static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info); | 91 | static DEFINE_PER_CPU(struct omap4_cpu_pm_info, omap4_pm_info); |
@@ -108,6 +109,7 @@ struct cpu_pm_ops omap_pm_ops = { | |||
108 | .finish_suspend = default_finish_suspend, | 109 | .finish_suspend = default_finish_suspend, |
109 | .resume = dummy_cpu_resume, | 110 | .resume = dummy_cpu_resume, |
110 | .scu_prepare = dummy_scu_prepare, | 111 | .scu_prepare = dummy_scu_prepare, |
112 | .hotplug_restart = dummy_cpu_resume, | ||
111 | }; | 113 | }; |
112 | 114 | ||
113 | /* | 115 | /* |
@@ -312,7 +314,7 @@ int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) | |||
312 | 314 | ||
313 | pwrdm_clear_all_prev_pwrst(pm_info->pwrdm); | 315 | pwrdm_clear_all_prev_pwrst(pm_info->pwrdm); |
314 | pwrdm_set_next_pwrst(pm_info->pwrdm, power_state); | 316 | pwrdm_set_next_pwrst(pm_info->pwrdm, power_state); |
315 | set_cpu_wakeup_addr(cpu, virt_to_phys(pm_info->secondary_startup)); | 317 | set_cpu_wakeup_addr(cpu, virt_to_phys(omap_pm_ops.hotplug_restart)); |
316 | omap_pm_ops.scu_prepare(cpu, power_state); | 318 | omap_pm_ops.scu_prepare(cpu, power_state); |
317 | 319 | ||
318 | /* | 320 | /* |
@@ -385,10 +387,6 @@ int __init omap4_mpuss_init(void) | |||
385 | CPU1_WAKEUP_NS_PA_ADDR_OFFSET; | 387 | CPU1_WAKEUP_NS_PA_ADDR_OFFSET; |
386 | pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1; | 388 | pm_info->l2x0_sar_addr = sar_base + L2X0_SAVE_OFFSET1; |
387 | } | 389 | } |
388 | if (cpu_is_omap446x()) | ||
389 | pm_info->secondary_startup = omap4460_secondary_startup; | ||
390 | else | ||
391 | pm_info->secondary_startup = omap4_secondary_startup; | ||
392 | 390 | ||
393 | pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm"); | 391 | pm_info->pwrdm = pwrdm_lookup("cpu1_pwrdm"); |
394 | if (!pm_info->pwrdm) { | 392 | if (!pm_info->pwrdm) { |
@@ -422,12 +420,16 @@ int __init omap4_mpuss_init(void) | |||
422 | omap_pm_ops.finish_suspend = omap4_finish_suspend; | 420 | omap_pm_ops.finish_suspend = omap4_finish_suspend; |
423 | omap_pm_ops.resume = omap4_cpu_resume; | 421 | omap_pm_ops.resume = omap4_cpu_resume; |
424 | omap_pm_ops.scu_prepare = scu_pwrst_prepare; | 422 | omap_pm_ops.scu_prepare = scu_pwrst_prepare; |
423 | omap_pm_ops.hotplug_restart = omap4_secondary_startup; | ||
425 | cpu_context_offset = OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET; | 424 | cpu_context_offset = OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET; |
426 | } else if (soc_is_omap54xx() || soc_is_dra7xx()) { | 425 | } else if (soc_is_omap54xx() || soc_is_dra7xx()) { |
427 | cpu_context_offset = OMAP54XX_RM_CPU0_CPU0_CONTEXT_OFFSET; | 426 | cpu_context_offset = OMAP54XX_RM_CPU0_CPU0_CONTEXT_OFFSET; |
428 | enable_mercury_retention_mode(); | 427 | enable_mercury_retention_mode(); |
429 | } | 428 | } |
430 | 429 | ||
430 | if (cpu_is_omap446x()) | ||
431 | omap_pm_ops.hotplug_restart = omap4460_secondary_startup; | ||
432 | |||
431 | return 0; | 433 | return 0; |
432 | } | 434 | } |
433 | 435 | ||