diff options
Diffstat (limited to 'arch/arm/mach-tegra/headsmp.S')
-rw-r--r-- | arch/arm/mach-tegra/headsmp.S | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/headsmp.S b/arch/arm/mach-tegra/headsmp.S index 6addc78cb6b2..4a317fae6860 100644 --- a/arch/arm/mach-tegra/headsmp.S +++ b/arch/arm/mach-tegra/headsmp.S | |||
@@ -2,10 +2,11 @@ | |||
2 | #include <linux/init.h> | 2 | #include <linux/init.h> |
3 | 3 | ||
4 | #include <asm/cache.h> | 4 | #include <asm/cache.h> |
5 | 5 | #include <asm/asm-offsets.h> | |
6 | #include <mach/iomap.h> | 6 | #include <asm/hardware/cache-l2x0.h> |
7 | 7 | ||
8 | #include "flowctrl.h" | 8 | #include "flowctrl.h" |
9 | #include "iomap.h" | ||
9 | #include "reset.h" | 10 | #include "reset.h" |
10 | #include "sleep.h" | 11 | #include "sleep.h" |
11 | 12 | ||
@@ -69,6 +70,64 @@ ENTRY(tegra_secondary_startup) | |||
69 | b secondary_startup | 70 | b secondary_startup |
70 | ENDPROC(tegra_secondary_startup) | 71 | ENDPROC(tegra_secondary_startup) |
71 | 72 | ||
73 | #ifdef CONFIG_PM_SLEEP | ||
74 | /* | ||
75 | * tegra_resume | ||
76 | * | ||
77 | * CPU boot vector when restarting the a CPU following | ||
78 | * an LP2 transition. Also branched to by LP0 and LP1 resume after | ||
79 | * re-enabling sdram. | ||
80 | */ | ||
81 | ENTRY(tegra_resume) | ||
82 | bl v7_invalidate_l1 | ||
83 | /* Enable coresight */ | ||
84 | mov32 r0, 0xC5ACCE55 | ||
85 | mcr p14, 0, r0, c7, c12, 6 | ||
86 | |||
87 | cpu_id r0 | ||
88 | cmp r0, #0 @ CPU0? | ||
89 | bne cpu_resume @ no | ||
90 | |||
91 | #ifdef CONFIG_ARCH_TEGRA_3x_SOC | ||
92 | /* Are we on Tegra20? */ | ||
93 | mov32 r6, TEGRA_APB_MISC_BASE | ||
94 | ldr r0, [r6, #APB_MISC_GP_HIDREV] | ||
95 | and r0, r0, #0xff00 | ||
96 | cmp r0, #(0x20 << 8) | ||
97 | beq 1f @ Yes | ||
98 | /* Clear the flow controller flags for this CPU. */ | ||
99 | mov32 r2, TEGRA_FLOW_CTRL_BASE + FLOW_CTRL_CPU0_CSR @ CPU0 CSR | ||
100 | ldr r1, [r2] | ||
101 | /* Clear event & intr flag */ | ||
102 | orr r1, r1, \ | ||
103 | #FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG | ||
104 | movw r0, #0x0FFD @ enable, cluster_switch, immed, & bitmaps | ||
105 | bic r1, r1, r0 | ||
106 | str r1, [r2] | ||
107 | 1: | ||
108 | #endif | ||
109 | |||
110 | #ifdef CONFIG_HAVE_ARM_SCU | ||
111 | /* enable SCU */ | ||
112 | mov32 r0, TEGRA_ARM_PERIF_BASE | ||
113 | ldr r1, [r0] | ||
114 | orr r1, r1, #1 | ||
115 | str r1, [r0] | ||
116 | #endif | ||
117 | |||
118 | /* L2 cache resume & re-enable */ | ||
119 | l2_cache_resume r0, r1, r2, l2x0_saved_regs_addr | ||
120 | |||
121 | b cpu_resume | ||
122 | ENDPROC(tegra_resume) | ||
123 | #endif | ||
124 | |||
125 | #ifdef CONFIG_CACHE_L2X0 | ||
126 | .globl l2x0_saved_regs_addr | ||
127 | l2x0_saved_regs_addr: | ||
128 | .long 0 | ||
129 | #endif | ||
130 | |||
72 | .align L1_CACHE_SHIFT | 131 | .align L1_CACHE_SHIFT |
73 | ENTRY(__tegra_cpu_reset_handler_start) | 132 | ENTRY(__tegra_cpu_reset_handler_start) |
74 | 133 | ||
@@ -122,6 +181,17 @@ ENTRY(__tegra_cpu_reset_handler) | |||
122 | 1: | 181 | 1: |
123 | #endif | 182 | #endif |
124 | 183 | ||
184 | /* Waking up from LP2? */ | ||
185 | ldr r9, [r12, #RESET_DATA(MASK_LP2)] | ||
186 | tst r9, r11 @ if in_lp2 | ||
187 | beq __is_not_lp2 | ||
188 | ldr lr, [r12, #RESET_DATA(STARTUP_LP2)] | ||
189 | cmp lr, #0 | ||
190 | bleq __die @ no LP2 startup handler | ||
191 | bx lr | ||
192 | |||
193 | __is_not_lp2: | ||
194 | |||
125 | #ifdef CONFIG_SMP | 195 | #ifdef CONFIG_SMP |
126 | /* | 196 | /* |
127 | * Can only be secondary boot (initial or hotplug) but CPU 0 | 197 | * Can only be secondary boot (initial or hotplug) but CPU 0 |