aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2013-08-20 18:19:15 -0400
committerStephen Warren <swarren@nvidia.com>2013-09-17 15:44:22 -0400
commitfddb770dbe468876ea6562e21f817813baa15082 (patch)
tree4fa86b10675ff495b69882994bc9fd6156d44e74
parent6ae894166c249398da16fe8dc5ab6112f996203b (diff)
ARM: tegra: move resume vector define to irammap.h
irammap.h's purpose is to define the layout/usage of IRAM. As such, TEGRA_IRAM_CODE_AREA should have been added there rather than iomap.h. Move the define, and rename it something more descriptive. Cc: Joseph Lo <josephl@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/iomap.h2
-rw-r--r--arch/arm/mach-tegra/irammap.h6
-rw-r--r--arch/arm/mach-tegra/pm.c8
-rw-r--r--arch/arm/mach-tegra/reset.c2
-rw-r--r--arch/arm/mach-tegra/sleep-tegra20.S5
-rw-r--r--arch/arm/mach-tegra/sleep-tegra30.S5
6 files changed, 17 insertions, 11 deletions
diff --git a/arch/arm/mach-tegra/iomap.h b/arch/arm/mach-tegra/iomap.h
index 3f5fa0749bde..7e0c1809c2dc 100644
--- a/arch/arm/mach-tegra/iomap.h
+++ b/arch/arm/mach-tegra/iomap.h
@@ -24,8 +24,6 @@
24#define TEGRA_IRAM_BASE 0x40000000 24#define TEGRA_IRAM_BASE 0x40000000
25#define TEGRA_IRAM_SIZE SZ_256K 25#define TEGRA_IRAM_SIZE SZ_256K
26 26
27#define TEGRA_IRAM_CODE_AREA (TEGRA_IRAM_BASE + SZ_4K)
28
29#define TEGRA_HOST1X_BASE 0x50000000 27#define TEGRA_HOST1X_BASE 0x50000000
30#define TEGRA_HOST1X_SIZE 0x24000 28#define TEGRA_HOST1X_SIZE 0x24000
31 29
diff --git a/arch/arm/mach-tegra/irammap.h b/arch/arm/mach-tegra/irammap.h
index 501952a84344..e32e1742c9a1 100644
--- a/arch/arm/mach-tegra/irammap.h
+++ b/arch/arm/mach-tegra/irammap.h
@@ -23,4 +23,10 @@
23#define TEGRA_IRAM_RESET_HANDLER_OFFSET 0 23#define TEGRA_IRAM_RESET_HANDLER_OFFSET 0
24#define TEGRA_IRAM_RESET_HANDLER_SIZE SZ_1K 24#define TEGRA_IRAM_RESET_HANDLER_SIZE SZ_1K
25 25
26/*
27 * This area is used for LPx resume vector, only while LPx power state is
28 * active. At other times, the AVP may use this area for arbitrary purposes
29 */
30#define TEGRA_IRAM_LPx_RESUME_AREA (TEGRA_IRAM_BASE + SZ_4K)
31
26#endif 32#endif
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index ed294a04e1d3..36ed88af1cc1 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -263,10 +263,10 @@ static void tegra_suspend_enter_lp1(void)
263 tegra_pmc_suspend(); 263 tegra_pmc_suspend();
264 264
265 /* copy the reset vector & SDRAM shutdown code into IRAM */ 265 /* copy the reset vector & SDRAM shutdown code into IRAM */
266 memcpy(iram_save_addr, IO_ADDRESS(TEGRA_IRAM_CODE_AREA), 266 memcpy(iram_save_addr, IO_ADDRESS(TEGRA_IRAM_LPx_RESUME_AREA),
267 iram_save_size);
268 memcpy(IO_ADDRESS(TEGRA_IRAM_CODE_AREA), tegra_lp1_iram.start_addr,
269 iram_save_size); 267 iram_save_size);
268 memcpy(IO_ADDRESS(TEGRA_IRAM_LPx_RESUME_AREA),
269 tegra_lp1_iram.start_addr, iram_save_size);
270 270
271 *((u32 *)tegra_cpu_lp1_mask) = 1; 271 *((u32 *)tegra_cpu_lp1_mask) = 1;
272} 272}
@@ -276,7 +276,7 @@ static void tegra_suspend_exit_lp1(void)
276 tegra_pmc_resume(); 276 tegra_pmc_resume();
277 277
278 /* restore IRAM */ 278 /* restore IRAM */
279 memcpy(IO_ADDRESS(TEGRA_IRAM_CODE_AREA), iram_save_addr, 279 memcpy(IO_ADDRESS(TEGRA_IRAM_LPx_RESUME_AREA), iram_save_addr,
280 iram_save_size); 280 iram_save_size);
281 281
282 *(u32 *)tegra_cpu_lp1_mask = 0; 282 *(u32 *)tegra_cpu_lp1_mask = 0;
diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index fd0bbf8a6c94..568f5bbf979d 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -82,7 +82,7 @@ void __init tegra_cpu_reset_handler_init(void)
82 82
83#ifdef CONFIG_PM_SLEEP 83#ifdef CONFIG_PM_SLEEP
84 __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_LP1] = 84 __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_LP1] =
85 TEGRA_IRAM_CODE_AREA; 85 TEGRA_IRAM_LPx_RESUME_AREA;
86 __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_LP2] = 86 __tegra_cpu_reset_handler_data[TEGRA_RESET_STARTUP_LP2] =
87 virt_to_phys((void *)tegra_resume); 87 virt_to_phys((void *)tegra_resume);
88#endif 88#endif
diff --git a/arch/arm/mach-tegra/sleep-tegra20.S b/arch/arm/mach-tegra/sleep-tegra20.S
index 5c3bd11c9838..aaaf3abd2688 100644
--- a/arch/arm/mach-tegra/sleep-tegra20.S
+++ b/arch/arm/mach-tegra/sleep-tegra20.S
@@ -25,6 +25,7 @@
25#include <asm/cp15.h> 25#include <asm/cp15.h>
26#include <asm/cache.h> 26#include <asm/cache.h>
27 27
28#include "irammap.h"
28#include "sleep.h" 29#include "sleep.h"
29#include "flowctrl.h" 30#include "flowctrl.h"
30 31
@@ -235,7 +236,7 @@ ENTRY(tegra20_sleep_core_finish)
235 mov32 r0, tegra20_tear_down_core 236 mov32 r0, tegra20_tear_down_core
236 mov32 r1, tegra20_iram_start 237 mov32 r1, tegra20_iram_start
237 sub r0, r0, r1 238 sub r0, r0, r1
238 mov32 r1, TEGRA_IRAM_CODE_AREA 239 mov32 r1, TEGRA_IRAM_LPx_RESUME_AREA
239 add r0, r0, r1 240 add r0, r0, r1
240 241
241 mov pc, r3 242 mov pc, r3
@@ -328,7 +329,7 @@ tegra20_iram_start:
328 * The physical address of tegra_resume expected to be stored in 329 * The physical address of tegra_resume expected to be stored in
329 * PMC_SCRATCH41. 330 * PMC_SCRATCH41.
330 * 331 *
331 * NOTE: THIS *MUST* BE RELOCATED TO TEGRA_IRAM_CODE_AREA. 332 * NOTE: THIS *MUST* BE RELOCATED TO TEGRA_IRAM_LPx_RESUME_AREA.
332 */ 333 */
333ENTRY(tegra20_lp1_reset) 334ENTRY(tegra20_lp1_reset)
334 /* 335 /*
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index 63fa91b5fafb..c6fc15cb25df 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -20,6 +20,7 @@
20#include <asm/asm-offsets.h> 20#include <asm/asm-offsets.h>
21#include <asm/cache.h> 21#include <asm/cache.h>
22 22
23#include "irammap.h"
23#include "fuse.h" 24#include "fuse.h"
24#include "sleep.h" 25#include "sleep.h"
25#include "flowctrl.h" 26#include "flowctrl.h"
@@ -262,7 +263,7 @@ ENTRY(tegra30_sleep_core_finish)
262 mov32 r0, tegra30_tear_down_core 263 mov32 r0, tegra30_tear_down_core
263 mov32 r1, tegra30_iram_start 264 mov32 r1, tegra30_iram_start
264 sub r0, r0, r1 265 sub r0, r0, r1
265 mov32 r1, TEGRA_IRAM_CODE_AREA 266 mov32 r1, TEGRA_IRAM_LPx_RESUME_AREA
266 add r0, r0, r1 267 add r0, r0, r1
267 268
268 mov pc, r3 269 mov pc, r3
@@ -314,7 +315,7 @@ tegra30_iram_start:
314 * The physical address of tegra_resume expected to be stored in 315 * The physical address of tegra_resume expected to be stored in
315 * PMC_SCRATCH41. 316 * PMC_SCRATCH41.
316 * 317 *
317 * NOTE: THIS *MUST* BE RELOCATED TO TEGRA_IRAM_CODE_AREA. 318 * NOTE: THIS *MUST* BE RELOCATED TO TEGRA_IRAM_LPx_RESUME_AREA.
318 */ 319 */
319ENTRY(tegra30_lp1_reset) 320ENTRY(tegra30_lp1_reset)
320 /* 321 /*