aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-08-31 18:26:18 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-20 18:33:42 -0400
commit62b2d07c0ea9db40a1787d2d0ab49f03c3e0613c (patch)
tree55c2f172adea7fba22fdedbb922f4628ba9523df /arch
parent1aede681ac159884c77817d33230eed9185b6f6c (diff)
ARM: pm: get rid of cpu_resume_turn_mmu_on
We don't require cpu_resume_turn_mmu_on as we can combine the ldr instruction with the following code provided we ensure that cpu_resume_mmu is aligned for older CPUs. Note that we also align to a 32-byte boundary to ensure that the code can't cross a section boundary. Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/sleep.S8
-rw-r--r--arch/arm/kernel/suspend.c4
2 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 25d42dfb0a92..c9a43caaea80 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -72,19 +72,15 @@ ENDPROC(cpu_suspend_abort)
72/* 72/*
73 * r0 = control register value 73 * r0 = control register value
74 */ 74 */
75 .align 5
75ENTRY(cpu_resume_mmu) 76ENTRY(cpu_resume_mmu)
76 ldr r3, =cpu_resume_after_mmu 77 ldr r3, =cpu_resume_after_mmu
77 b cpu_resume_turn_mmu_on
78ENDPROC(cpu_resume_mmu)
79 .ltorg
80 .align 5
81ENTRY(cpu_resume_turn_mmu_on)
82 mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc 78 mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc
83 mrc p15, 0, r0, c0, c0, 0 @ read id reg 79 mrc p15, 0, r0, c0, c0, 0 @ read id reg
84 mov r0, r0 80 mov r0, r0
85 mov r0, r0 81 mov r0, r0
86 mov pc, r3 @ jump to virtual address 82 mov pc, r3 @ jump to virtual address
87ENDPROC(cpu_resume_turn_mmu_on) 83ENDPROC(cpu_resume_mmu)
88cpu_resume_after_mmu: 84cpu_resume_after_mmu:
89 bl cpu_init @ restore the und/abt/irq banked regs 85 bl cpu_init @ restore the und/abt/irq banked regs
90 mov r0, #0 @ return zero on success 86 mov r0, #0 @ return zero on success
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index 2beda56e4574..ed4160b64e66 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -9,7 +9,7 @@
9static pgd_t *suspend_pgd; 9static pgd_t *suspend_pgd;
10 10
11extern int __cpu_suspend(int, long, unsigned long, int (*)(unsigned long)); 11extern int __cpu_suspend(int, long, unsigned long, int (*)(unsigned long));
12extern void cpu_resume_turn_mmu_on(void); 12extern void cpu_resume_mmu(void);
13 13
14/* 14/*
15 * Hide the first two arguments to __cpu_suspend - these are an implementation 15 * Hide the first two arguments to __cpu_suspend - these are an implementation
@@ -43,7 +43,7 @@ static int __init cpu_suspend_init(void)
43{ 43{
44 suspend_pgd = pgd_alloc(&init_mm); 44 suspend_pgd = pgd_alloc(&init_mm);
45 if (suspend_pgd) { 45 if (suspend_pgd) {
46 unsigned long addr = virt_to_phys(cpu_resume_turn_mmu_on); 46 unsigned long addr = virt_to_phys(cpu_resume_mmu);
47 identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE); 47 identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE);
48 } 48 }
49 return suspend_pgd ? 0 : -ENOMEM; 49 return suspend_pgd ? 0 : -ENOMEM;