diff options
author | Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com> | 2014-04-21 10:53:39 -0400 |
---|---|---|
committer | Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com> | 2014-05-16 15:28:41 -0400 |
commit | 8d3d76116e17db2f78021f88bad2d6615da6a544 (patch) | |
tree | fc1d161dd5dfbaaafaa1b588bf96ebdc473ae2b3 | |
parent | 365a942247859a8e7ca8b78d4de5740e40edb67a (diff) |
ENGR00309881 ARM:imx6: Disable L1 and L2 when DDR is in self-refresh.
When switching to page tables in IRAM, we are switching from a cacheable
to non-cacheable page table. Based on recommendation from ARM, we need to
ensure that branch prediction, L1 data nd L2 are disabled when DDR is put
into self-refresh.
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com>
-rw-r--r-- | arch/arm/mach-imx/ddr3_freq_imx6.S | 71 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx6sl_wfi.S | 70 | ||||
-rw-r--r-- | arch/arm/mach-imx/lpddr2_freq_imx6.S | 53 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx6.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/suspend-imx6.S | 43 |
5 files changed, 201 insertions, 38 deletions
diff --git a/arch/arm/mach-imx/ddr3_freq_imx6.S b/arch/arm/mach-imx/ddr3_freq_imx6.S index cbba4c2a9322..26a601805b8a 100644 --- a/arch/arm/mach-imx/ddr3_freq_imx6.S +++ b/arch/arm/mach-imx/ddr3_freq_imx6.S | |||
@@ -358,15 +358,23 @@ ddr_freq_change: | |||
358 | * and 2-4G is translated by TTBR1. | 358 | * and 2-4G is translated by TTBR1. |
359 | */ | 359 | */ |
360 | 360 | ||
361 | ldr r6, =iram_tlb_phys_addr | ||
362 | ldr r7, [r6] | ||
363 | |||
361 | /* Flush the Branch Target Address Cache (BTAC) */ | 364 | /* Flush the Branch Target Address Cache (BTAC) */ |
362 | ldr r6, =0x0 | 365 | ldr r6, =0x0 |
363 | mcr p15, 0, r6, c7, c1, 6 | 366 | mcr p15, 0, r6, c7, c1, 6 |
364 | ldr r6, =iram_tlb_phys_addr | 367 | |
365 | ldr r6, [r6] | 368 | /* Disable Branch Prediction, Z bit in SCTLR. */ |
369 | mrc p15, 0, r6, c1, c0, 0 | ||
370 | bic r6, r6, #0x800 | ||
371 | mcr p15, 0, r6, c1, c0, 0 | ||
372 | |||
366 | dsb | 373 | dsb |
367 | isb | 374 | isb |
375 | |||
368 | /* Store the IRAM table in TTBR1 */ | 376 | /* Store the IRAM table in TTBR1 */ |
369 | mcr p15, 0, r6, c2, c0, 1 | 377 | mcr p15, 0, r7, c2, c0, 1 |
370 | 378 | ||
371 | /* Read TTBCR and set PD0=1, N = 1 */ | 379 | /* Read TTBCR and set PD0=1, N = 1 */ |
372 | mrc p15, 0, r6, c2, c0, 2 | 380 | mrc p15, 0, r6, c2, c0, 2 |
@@ -379,22 +387,37 @@ ddr_freq_change: | |||
379 | /* flush the TLB */ | 387 | /* flush the TLB */ |
380 | ldr r6, =0x0 | 388 | ldr r6, =0x0 |
381 | mcr p15, 0, r6, c8, c3, 0 | 389 | mcr p15, 0, r6, c8, c3, 0 |
390 | |||
382 | dsb | 391 | dsb |
383 | isb | 392 | isb |
384 | 393 | ||
385 | ldr r5, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | 394 | /* Disable L1 data cache. */ |
386 | ldr r6, =IMX_IO_P2V(MX6Q_CCM_BASE_ADDR) | 395 | mrc p15, 0, r6, c1, c0, 0 |
387 | ldr r7, =IMX_IO_P2V(MX6Q_IOMUXC_BASE_ADDR) | 396 | bic r6, r6, #0x4 |
388 | ldr r12, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | 397 | mcr p15, 0, r6, c1, c0, 0 |
389 | 398 | ||
390 | #ifdef CONFIG_CACHE_L2X0 | 399 | #ifdef CONFIG_CACHE_L2X0 |
391 | /* | 400 | /* |
392 | * Make sure the L2 buffers are drained. | 401 | * Make sure the L2 buffers are drained. |
393 | * Sync operation on L2 drains the buffers. | 402 | * Sync operation on L2 drains the buffers. |
394 | */ | 403 | */ |
395 | mov r1, #0x0 | 404 | ldr r12, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) |
396 | str r1, [r12, #L2_CACHE_SYNC] | 405 | mov r1, #0x0 |
406 | str r1, [r12, #L2_CACHE_SYNC] | ||
407 | |||
408 | /* Disable L2. */ | ||
409 | str r1, [r12, #0x100] | ||
410 | |||
411 | /* | ||
412 | * The second dsb might be needed to keep cache sync (device write) | ||
413 | * ordering with the memory accesses before it. | ||
414 | */ | ||
415 | dsb | ||
416 | isb | ||
397 | #endif | 417 | #endif |
418 | ldr r5, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | ||
419 | ldr r6, =IMX_IO_P2V(MX6Q_CCM_BASE_ADDR) | ||
420 | ldr r7, =IMX_IO_P2V(MX6Q_IOMUXC_BASE_ADDR) | ||
398 | 421 | ||
399 | /* disable automatic power saving. */ | 422 | /* disable automatic power saving. */ |
400 | ldr r0, [r5, #MMDC0_MAPSR] | 423 | ldr r0, [r5, #MMDC0_MAPSR] |
@@ -887,9 +910,23 @@ poll_conreq_clear_2: | |||
887 | beq poll_conreq_clear_2 | 910 | beq poll_conreq_clear_2 |
888 | 911 | ||
889 | done: | 912 | done: |
913 | |||
914 | #ifdef CONFIG_CACHE_L2X0 | ||
915 | /* Enable L2. */ | ||
916 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
917 | ldr r6, =0x1 | ||
918 | str r6, [r7, #0x100] | ||
919 | #endif | ||
920 | |||
921 | /* Enable L1 data cache. */ | ||
922 | mrc p15, 0, r6, c1, c0, 0 | ||
923 | orr r6, r6, #0x4 | ||
924 | mcr p15, 0, r6, c1, c0, 0 | ||
925 | |||
890 | /* Restore the TTBCR */ | 926 | /* Restore the TTBCR */ |
891 | dsb | 927 | dsb |
892 | isb | 928 | isb |
929 | |||
893 | /* Read TTBCR and set PD0=0, N = 0 */ | 930 | /* Read TTBCR and set PD0=0, N = 0 */ |
894 | mrc p15, 0, r6, c2, c0, 2 | 931 | mrc p15, 0, r6, c2, c0, 2 |
895 | bic r6, r6, #0x11 | 932 | bic r6, r6, #0x11 |
@@ -900,9 +937,19 @@ done: | |||
900 | /* flush the TLB */ | 937 | /* flush the TLB */ |
901 | ldr r6, =0x0 | 938 | ldr r6, =0x0 |
902 | mcr p15, 0, r6, c8, c3, 0 | 939 | mcr p15, 0, r6, c8, c3, 0 |
940 | |||
903 | dsb | 941 | dsb |
904 | isb | 942 | isb |
905 | 943 | ||
944 | /* Enable Branch Prediction, Z bit in SCTLR. */ | ||
945 | mrc p15, 0, r6, c1, c0, 0 | ||
946 | orr r6, r6, #0x800 | ||
947 | mcr p15, 0, r6, c1, c0, 0 | ||
948 | |||
949 | /* Flush the Branch Target Address Cache (BTAC) */ | ||
950 | ldr r6, =0x0 | ||
951 | mcr p15, 0, r6, c7, c1, 6 | ||
952 | |||
906 | /* restore registers */ | 953 | /* restore registers */ |
907 | 954 | ||
908 | ldmfd sp!, {r4-r12} | 955 | ldmfd sp!, {r4-r12} |
diff --git a/arch/arm/mach-imx/imx6sl_wfi.S b/arch/arm/mach-imx/imx6sl_wfi.S index f8556e67631e..e4ce82faaa8e 100644 --- a/arch/arm/mach-imx/imx6sl_wfi.S +++ b/arch/arm/mach-imx/imx6sl_wfi.S | |||
@@ -186,17 +186,24 @@ mx6sl_lpm_wfi: | |||
186 | * 4. Set TTBR0.N=1, implying 0-2G is translated by TTBR0 | 186 | * 4. Set TTBR0.N=1, implying 0-2G is translated by TTBR0 |
187 | * and 2-4G is translated by TTBR1. | 187 | * and 2-4G is translated by TTBR1. |
188 | */ | 188 | */ |
189 | |||
190 | ldr r6, =iram_tlb_phys_addr | ||
191 | ldr r7, [r6] | ||
192 | |||
189 | /* Flush the BTAC. */ | 193 | /* Flush the BTAC. */ |
190 | ldr r6, =0x0 | 194 | ldr r6, =0x0 |
191 | mcr p15, 0, r6, c7, c1, 6 | 195 | mcr p15, 0, r6, c7, c1, 6 |
192 | 196 | ||
193 | ldr r6, =iram_tlb_phys_addr | 197 | /* Disable Branch Prediction, Z bit in SCTLR. */ |
194 | ldr r6, [r6] | 198 | mrc p15, 0, r6, c1, c0, 0 |
199 | bic r6, r6, #0x800 | ||
200 | mcr p15, 0, r6, c1, c0, 0 | ||
201 | |||
195 | dsb | 202 | dsb |
196 | isb | 203 | isb |
197 | 204 | ||
198 | /* Store the IRAM table in TTBR1 */ | 205 | /* Store the IRAM table in TTBR1 */ |
199 | mcr p15, 0, r6, c2, c0, 1 | 206 | mcr p15, 0, r7, c2, c0, 1 |
200 | 207 | ||
201 | /* Read TTBCR and set PD0=1, N = 1 */ | 208 | /* Read TTBCR and set PD0=1, N = 1 */ |
202 | mrc p15, 0, r6, c2, c0, 2 | 209 | mrc p15, 0, r6, c2, c0, 2 |
@@ -210,29 +217,25 @@ mx6sl_lpm_wfi: | |||
210 | ldr r6, =0x0 | 217 | ldr r6, =0x0 |
211 | mcr p15, 0, r6, c8, c3, 0 | 218 | mcr p15, 0, r6, c8, c3, 0 |
212 | 219 | ||
213 | dsb | 220 | /* Disable L1 data cache. */ |
214 | isb | 221 | mrc p15, 0, r6, c1, c0, 0 |
215 | 222 | bic r6, r6, #0x4 | |
216 | ldr r1, =IMX_IO_P2V(MX6Q_IOMUXC_BASE_ADDR) | 223 | mcr p15, 0, r6, c1, c0, 0 |
217 | ldr r3, =IMX_IO_P2V(MX6Q_ANATOP_BASE_ADDR) | ||
218 | ldr r2, =IMX_IO_P2V(MX6Q_CCM_BASE_ADDR) | ||
219 | ldr r8, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | ||
220 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
221 | |||
222 | /* Store the original ARM PODF. */ | ||
223 | ldr r0, [r2, #0x10] | ||
224 | 224 | ||
225 | /* Drain all the L1 buffers. */ | ||
226 | dsb | 225 | dsb |
226 | isb | ||
227 | 227 | ||
228 | #ifdef CONFIG_CACHE_L2X0 | 228 | #ifdef CONFIG_CACHE_L2X0 |
229 | /* | 229 | /* |
230 | * Need to make sure the buffers in L2 are drained. | 230 | * Need to make sure the buffers in L2 are drained. |
231 | * Performing a sync operation does this. | 231 | * Performing a sync operation does this. |
232 | */ | 232 | */ |
233 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
233 | mov r6, #0x0 | 234 | mov r6, #0x0 |
234 | str r6, [r7, #0x730] | 235 | str r6, [r7, #0x730] |
235 | #endif | 236 | |
237 | /* Disable L2. */ | ||
238 | str r6, [r7, #0x100] | ||
236 | 239 | ||
237 | /* | 240 | /* |
238 | * The second dsb might be needed to keep cache sync (device write) | 241 | * The second dsb might be needed to keep cache sync (device write) |
@@ -240,6 +243,16 @@ mx6sl_lpm_wfi: | |||
240 | */ | 243 | */ |
241 | dsb | 244 | dsb |
242 | isb | 245 | isb |
246 | #endif | ||
247 | |||
248 | |||
249 | ldr r1, =IMX_IO_P2V(MX6Q_IOMUXC_BASE_ADDR) | ||
250 | ldr r3, =IMX_IO_P2V(MX6Q_ANATOP_BASE_ADDR) | ||
251 | ldr r2, =IMX_IO_P2V(MX6Q_CCM_BASE_ADDR) | ||
252 | ldr r8, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | ||
253 | |||
254 | /* Store the original ARM PODF. */ | ||
255 | ldr r0, [r2, #0x10] | ||
243 | 256 | ||
244 | /* Save the DDR IO state. */ | 257 | /* Save the DDR IO state. */ |
245 | sl_ddr_io_save | 258 | sl_ddr_io_save |
@@ -595,7 +608,7 @@ audio_arm_clk_restore: | |||
595 | str r6, [r2, #0xC] | 608 | str r6, [r2, #0xC] |
596 | 609 | ||
597 | wfi_restore: | 610 | wfi_restore: |
598 | /* get suspend_iram_base */ | 611 | /* get wfi_iram_base */ |
599 | mov r9, r10 | 612 | mov r9, r10 |
600 | add r9, r9, #MX6SL_WFI_IRAM_CODE_SIZE | 613 | add r9, r9, #MX6SL_WFI_IRAM_CODE_SIZE |
601 | 614 | ||
@@ -637,10 +650,23 @@ poll_dvfs_clear_1: | |||
637 | bic r6, r6, #0x100 | 650 | bic r6, r6, #0x100 |
638 | str r6, [r8, #0x410] | 651 | str r6, [r8, #0x410] |
639 | 652 | ||
653 | #ifdef CONFIG_CACHE_L2X0 | ||
654 | /* Enable L2. */ | ||
655 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
656 | ldr r6, =0x1 | ||
657 | str r6, [r7, #0x100] | ||
658 | #endif | ||
659 | |||
660 | /* Enable L1 data cache. */ | ||
661 | mrc p15, 0, r6, c1, c0, 0 | ||
662 | orr r6, r6, #0x4 | ||
663 | mcr p15, 0, r6, c1, c0, 0 | ||
664 | |||
640 | /* Restore the TTBCR */ | 665 | /* Restore the TTBCR */ |
641 | 666 | ||
642 | dsb | 667 | dsb |
643 | isb | 668 | isb |
669 | |||
644 | /* Read TTBCR and set PD0=0, N = 0 */ | 670 | /* Read TTBCR and set PD0=0, N = 0 */ |
645 | mrc p15, 0, r6, c2, c0, 2 | 671 | mrc p15, 0, r6, c2, c0, 2 |
646 | bic r6, r6, #0x11 | 672 | bic r6, r6, #0x11 |
@@ -656,6 +682,15 @@ poll_dvfs_clear_1: | |||
656 | dsb | 682 | dsb |
657 | isb | 683 | isb |
658 | 684 | ||
685 | /* Enable Branch Prediction, Z bit in SCTLR. */ | ||
686 | mrc p15, 0, r6, c1, c0, 0 | ||
687 | orr r6, r6, #0x800 | ||
688 | mcr p15, 0, r6, c1, c0, 0 | ||
689 | |||
690 | /* Flush the Branch Target Address Cache (BTAC) */ | ||
691 | ldr r6, =0x0 | ||
692 | mcr p15, 0, r6, c7, c1, 6 | ||
693 | |||
659 | /* | 694 | /* |
660 | * Add these nops so that the | 695 | * Add these nops so that the |
661 | * prefetcher will not try to get | 696 | * prefetcher will not try to get |
@@ -693,7 +728,6 @@ poll_dvfs_clear_1: | |||
693 | nop | 728 | nop |
694 | nop | 729 | nop |
695 | 730 | ||
696 | |||
697 | pop {r4-r12} | 731 | pop {r4-r12} |
698 | 732 | ||
699 | /* Restore registers */ | 733 | /* Restore registers */ |
diff --git a/arch/arm/mach-imx/lpddr2_freq_imx6.S b/arch/arm/mach-imx/lpddr2_freq_imx6.S index 3c1c076112ef..121a88bb62e8 100644 --- a/arch/arm/mach-imx/lpddr2_freq_imx6.S +++ b/arch/arm/mach-imx/lpddr2_freq_imx6.S | |||
@@ -359,16 +359,23 @@ ENTRY(mx6_lpddr2_freq_change) | |||
359 | * and 2-4G is translated by TTBR1. | 359 | * and 2-4G is translated by TTBR1. |
360 | */ | 360 | */ |
361 | 361 | ||
362 | ldr r6, =iram_tlb_phys_addr | ||
363 | ldr r7, [r6] | ||
364 | |||
365 | |||
362 | /* Flush the Branch Target Address Cache (BTAC) */ | 366 | /* Flush the Branch Target Address Cache (BTAC) */ |
363 | ldr r6, =0x0 | 367 | ldr r6, =0x0 |
364 | mcr p15, 0, r6, c7, c1, 6 | 368 | mcr p15, 0, r6, c7, c1, 6 |
365 | 369 | ||
366 | ldr r6, =iram_tlb_phys_addr | 370 | /* Disable Branch Prediction, Z bit in SCTLR. */ |
367 | ldr r6, [r6] | 371 | mrc p15, 0, r6, c1, c0, 0 |
372 | bic r6, r6, #0x800 | ||
373 | mcr p15, 0, r6, c1, c0, 0 | ||
374 | |||
368 | dsb | 375 | dsb |
369 | isb | 376 | isb |
370 | /* Store the IRAM table in TTBR1 */ | 377 | /* Store the IRAM table in TTBR1 */ |
371 | mcr p15, 0, r6, c2, c0, 1 | 378 | mcr p15, 0, r7, c2, c0, 1 |
372 | 379 | ||
373 | /* Read TTBCR and set PD0=1, N = 1 */ | 380 | /* Read TTBCR and set PD0=1, N = 1 */ |
374 | mrc p15, 0, r6, c2, c0, 2 | 381 | mrc p15, 0, r6, c2, c0, 2 |
@@ -382,29 +389,39 @@ ENTRY(mx6_lpddr2_freq_change) | |||
382 | ldr r6, =0x0 | 389 | ldr r6, =0x0 |
383 | mcr p15, 0, r6, c8, c3, 0 | 390 | mcr p15, 0, r6, c8, c3, 0 |
384 | 391 | ||
392 | /* Disable L1 data cache. */ | ||
393 | mrc p15, 0, r6, c1, c0, 0 | ||
394 | bic r6, r6, #0x4 | ||
395 | mcr p15, 0, r6, c1, c0, 0 | ||
396 | |||
385 | dsb | 397 | dsb |
386 | isb | 398 | isb |
387 | 399 | ||
388 | ldr r3, =IMX_IO_P2V(MX6Q_ANATOP_BASE_ADDR) | ||
389 | ldr r2, =IMX_IO_P2V(MX6Q_CCM_BASE_ADDR) | ||
390 | ldr r8, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | ||
391 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
392 | 400 | ||
393 | #ifdef CONFIG_CACHE_L2X0 | 401 | #ifdef CONFIG_CACHE_L2X0 |
394 | /* | 402 | /* |
395 | * Need to make sure the buffers in L2 are drained. | 403 | * Need to make sure the buffers in L2 are drained. |
396 | * Performing a sync operation does this. | 404 | * Performing a sync operation does this. |
397 | */ | 405 | */ |
406 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
398 | mov r6, #0x0 | 407 | mov r6, #0x0 |
399 | str r6, [r7, #0x730] | 408 | str r6, [r7, #0x730] |
409 | |||
400 | /* | 410 | /* |
401 | * The second dsb might be needed to keep cache sync (device write) | 411 | * The second dsb might be needed to keep cache sync (device write) |
402 | * ordering with the memory accesses before it. | 412 | * ordering with the memory accesses before it. |
403 | */ | 413 | */ |
404 | dsb | 414 | dsb |
405 | isb | 415 | isb |
416 | |||
417 | /* Disable L2. */ | ||
418 | str r6, [r7, #0x100] | ||
406 | #endif | 419 | #endif |
407 | 420 | ||
421 | ldr r3, =IMX_IO_P2V(MX6Q_ANATOP_BASE_ADDR) | ||
422 | ldr r2, =IMX_IO_P2V(MX6Q_CCM_BASE_ADDR) | ||
423 | ldr r8, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | ||
424 | |||
408 | /* Disable Automatic power savings. */ | 425 | /* Disable Automatic power savings. */ |
409 | ldr r6, [r8, #0x404] | 426 | ldr r6, [r8, #0x404] |
410 | orr r6, r6, #0x01 | 427 | orr r6, r6, #0x01 |
@@ -498,9 +515,22 @@ skip_power_down: | |||
498 | bic r6, r6, #0x100 | 515 | bic r6, r6, #0x100 |
499 | str r6, [r8, #0x410] | 516 | str r6, [r8, #0x410] |
500 | 517 | ||
518 | #ifdef CONFIG_CACHE_L2X0 | ||
519 | /* Enable L2. */ | ||
520 | ldr r7, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
521 | ldr r6, =0x1 | ||
522 | str r6, [r7, #0x100] | ||
523 | #endif | ||
524 | |||
525 | /* Enable L1 data cache. */ | ||
526 | mrc p15, 0, r6, c1, c0, 0 | ||
527 | orr r6, r6, #0x4 | ||
528 | mcr p15, 0, r6, c1, c0, 0 | ||
529 | |||
501 | /* Restore the TTBCR */ | 530 | /* Restore the TTBCR */ |
502 | dsb | 531 | dsb |
503 | isb | 532 | isb |
533 | |||
504 | /* Read TTBCR and set PD0=0, N = 0 */ | 534 | /* Read TTBCR and set PD0=0, N = 0 */ |
505 | mrc p15, 0, r6, c2, c0, 2 | 535 | mrc p15, 0, r6, c2, c0, 2 |
506 | bic r6, r6, #0x11 | 536 | bic r6, r6, #0x11 |
@@ -515,6 +545,15 @@ skip_power_down: | |||
515 | dsb | 545 | dsb |
516 | isb | 546 | isb |
517 | 547 | ||
548 | /* Enable Branch Prediction, Z bit in SCTLR. */ | ||
549 | mrc p15, 0, r6, c1, c0, 0 | ||
550 | orr r6, r6, #0x800 | ||
551 | mcr p15, 0, r6, c1, c0, 0 | ||
552 | |||
553 | /* Flush the Branch Target Address Cache (BTAC) */ | ||
554 | ldr r6, =0x0 | ||
555 | mcr p15, 0, r6, c7, c1, 6 | ||
556 | |||
518 | nop | 557 | nop |
519 | nop | 558 | nop |
520 | nop | 559 | nop |
diff --git a/arch/arm/mach-imx/mx6.h b/arch/arm/mach-imx/mx6.h index cac661ac7533..477c523745a2 100644 --- a/arch/arm/mach-imx/mx6.h +++ b/arch/arm/mach-imx/mx6.h | |||
@@ -44,7 +44,7 @@ | |||
44 | #define LPDDR2_FREQ_CODE_SIZE 0x600 | 44 | #define LPDDR2_FREQ_CODE_SIZE 0x600 |
45 | #define DDR3_FREQ_CODE_SIZE 0xC00 | 45 | #define DDR3_FREQ_CODE_SIZE 0xC00 |
46 | #define DDR3_IOMUX_SETTINGS_SIZE 0x400 | 46 | #define DDR3_IOMUX_SETTINGS_SIZE 0x400 |
47 | #define MX6SL_WFI_IRAM_CODE_SIZE 0x600 | 47 | #define MX6SL_WFI_IRAM_CODE_SIZE 0x700 |
48 | 48 | ||
49 | #define MX6_SUSPEND_IRAM_ADDR_OFFSET 0 | 49 | #define MX6_SUSPEND_IRAM_ADDR_OFFSET 0 |
50 | #define DDR3_FREQ_CODE_ADDR_OFFSET (MX6_SUSPEND_IRAM_ADDR_OFFSET + MX6_SUSPEND_IRAM_SIZE) | 50 | #define DDR3_FREQ_CODE_ADDR_OFFSET (MX6_SUSPEND_IRAM_ADDR_OFFSET + MX6_SUSPEND_IRAM_SIZE) |
diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index f21e1359bc5c..620181a4886b 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S | |||
@@ -640,6 +640,11 @@ ddr_io_save_dsm_done: | |||
640 | ldr r6, =0x0 | 640 | ldr r6, =0x0 |
641 | mcr p15, 0, r6, c7, c1, 6 | 641 | mcr p15, 0, r6, c7, c1, 6 |
642 | 642 | ||
643 | /* Disable Branch Prediction, Z bit in SCTLR. */ | ||
644 | mrc p15, 0, r6, c1, c0, 0 | ||
645 | bic r6, r6, #0x800 | ||
646 | mcr p15, 0, r6, c1, c0, 0 | ||
647 | |||
643 | ldr r6, =iram_tlb_phys_addr | 648 | ldr r6, =iram_tlb_phys_addr |
644 | ldr r6, [r6] | 649 | ldr r6, [r6] |
645 | dsb | 650 | dsb |
@@ -659,6 +664,23 @@ ddr_io_save_dsm_done: | |||
659 | ldr r6, =0x0 | 664 | ldr r6, =0x0 |
660 | mcr p15, 0, r6, c8, c3, 0 | 665 | mcr p15, 0, r6, c8, c3, 0 |
661 | 666 | ||
667 | /* Disable L1 data cache. */ | ||
668 | mrc p15, 0, r6, c1, c0, 0 | ||
669 | bic r6, r6, #0x4 | ||
670 | mcr p15, 0, r6, c1, c0, 0 | ||
671 | |||
672 | dsb | ||
673 | isb | ||
674 | |||
675 | #ifdef CONFIG_CACHE_L2X0 | ||
676 | ldr r8, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
677 | mov r6, #0x0 | ||
678 | str r6, [r8, #0x100] | ||
679 | |||
680 | dsb | ||
681 | isb | ||
682 | #endif | ||
683 | |||
662 | ldr r8, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) | 684 | ldr r8, =IMX_IO_P2V(MX6Q_MMDC_P0_BASE_ADDR) |
663 | /* | 685 | /* |
664 | * put DDR explicitly into self-refresh and | 686 | * put DDR explicitly into self-refresh and |
@@ -861,6 +883,18 @@ poll_dvfs_clear_2: | |||
861 | bic r7, r7, #0x1 | 883 | bic r7, r7, #0x1 |
862 | str r7, [r8, #MX6Q_MMDC_MAPSR] | 884 | str r7, [r8, #MX6Q_MMDC_MAPSR] |
863 | 885 | ||
886 | #ifdef CONFIG_CACHE_L2X0 | ||
887 | /* Enable L2. */ | ||
888 | ldr r8, =IMX_IO_P2V(MX6Q_L2_BASE_ADDR) | ||
889 | ldr r7, =0x1 | ||
890 | str r7, [r8, #0x100] | ||
891 | #endif | ||
892 | |||
893 | /* Enable L1 data cache. */ | ||
894 | mrc p15, 0, r6, c1, c0, 0 | ||
895 | orr r6, r6, #0x4 | ||
896 | mcr p15, 0, r6, c1, c0, 0 | ||
897 | |||
864 | /* Restore TTBCR */ | 898 | /* Restore TTBCR */ |
865 | dsb | 899 | dsb |
866 | isb | 900 | isb |
@@ -875,6 +909,15 @@ poll_dvfs_clear_2: | |||
875 | ldr r6, =0x0 | 909 | ldr r6, =0x0 |
876 | mcr p15, 0, r6, c8, c3, 0 | 910 | mcr p15, 0, r6, c8, c3, 0 |
877 | 911 | ||
912 | /* Enable Branch Prediction, Z bit in SCTLR. */ | ||
913 | mrc p15, 0, r6, c1, c0, 0 | ||
914 | orr r6, r6, #0x800 | ||
915 | mcr p15, 0, r6, c1, c0, 0 | ||
916 | |||
917 | /* Flush the Branch Target Address Cache (BTAC) */ | ||
918 | ldr r6, =0x0 | ||
919 | mcr p15, 0, r6, c7, c1, 6 | ||
920 | |||
878 | pop {r4-r12} | 921 | pop {r4-r12} |
879 | 922 | ||
880 | /* return to suspend finish */ | 923 | /* return to suspend finish */ |