diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-07-08 11:02:32 -0400 |
---|---|---|
committer | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2015-07-25 11:16:51 -0400 |
commit | 88ed69f2a1e1e8e5eb9e16d8cdebd9d5f1deef67 (patch) | |
tree | 0f09f4712704e9c34a28c84b3c29781861a3a939 | |
parent | a101b53d3af16255c0038aad26902be590a96ffa (diff) |
ARM: mvebu: prepare mvebu_pm_store_bootinfo() to support multiple SoCs
As we are going to introduce support for Armada 38x in pm.c, split out
the Armada XP part of mvebu_pm_store_bootinfo() into
mvebu_pm_store_armadaxp_bootinfo(), and make the former retunr an
error when an unsupported SoC is used.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
-rw-r--r-- | arch/arm/mach-mvebu/pm.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/arm/mach-mvebu/pm.c b/arch/arm/mach-mvebu/pm.c index eca650b4efc8..02fdf67a4898 100644 --- a/arch/arm/mach-mvebu/pm.c +++ b/arch/arm/mach-mvebu/pm.c | |||
@@ -105,12 +105,10 @@ static phys_addr_t mvebu_internal_reg_base(void) | |||
105 | return of_translate_address(np, in_addr); | 105 | return of_translate_address(np, in_addr); |
106 | } | 106 | } |
107 | 107 | ||
108 | static void mvebu_pm_store_bootinfo(void) | 108 | static void mvebu_pm_store_armadaxp_bootinfo(u32 *store_addr) |
109 | { | 109 | { |
110 | u32 *store_addr; | ||
111 | phys_addr_t resume_pc; | 110 | phys_addr_t resume_pc; |
112 | 111 | ||
113 | store_addr = phys_to_virt(BOOT_INFO_ADDR); | ||
114 | resume_pc = virt_to_phys(armada_370_xp_cpu_resume); | 112 | resume_pc = virt_to_phys(armada_370_xp_cpu_resume); |
115 | 113 | ||
116 | /* | 114 | /* |
@@ -151,14 +149,33 @@ static void mvebu_pm_store_bootinfo(void) | |||
151 | writel(BOOT_MAGIC_LIST_END, store_addr); | 149 | writel(BOOT_MAGIC_LIST_END, store_addr); |
152 | } | 150 | } |
153 | 151 | ||
152 | static int mvebu_pm_store_bootinfo(void) | ||
153 | { | ||
154 | u32 *store_addr; | ||
155 | |||
156 | store_addr = phys_to_virt(BOOT_INFO_ADDR); | ||
157 | |||
158 | if (of_machine_is_compatible("marvell,armadaxp")) | ||
159 | mvebu_pm_store_armadaxp_bootinfo(store_addr); | ||
160 | else | ||
161 | return -ENODEV; | ||
162 | |||
163 | return 0; | ||
164 | } | ||
165 | |||
154 | static int mvebu_pm_enter(suspend_state_t state) | 166 | static int mvebu_pm_enter(suspend_state_t state) |
155 | { | 167 | { |
168 | int ret; | ||
169 | |||
156 | if (state != PM_SUSPEND_MEM) | 170 | if (state != PM_SUSPEND_MEM) |
157 | return -EINVAL; | 171 | return -EINVAL; |
158 | 172 | ||
173 | ret = mvebu_pm_store_bootinfo(); | ||
174 | if (ret) | ||
175 | return ret; | ||
176 | |||
159 | cpu_pm_enter(); | 177 | cpu_pm_enter(); |
160 | 178 | ||
161 | mvebu_pm_store_bootinfo(); | ||
162 | cpu_suspend(0, mvebu_pm_powerdown); | 179 | cpu_suspend(0, mvebu_pm_powerdown); |
163 | 180 | ||
164 | outer_resume(); | 181 | outer_resume(); |