Message ID | alpine.DEB.2.00.1105271549220.6109@localhost6.localdomain6 (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, 27 May 2011, Frank Hofmann wrote: > /* > * r0 = control register value > * r1 = v:p offset (preserved by cpu_do_resume) > + * if this is zero, do not reenable MMU (it's on) This is wrong. It is well possible for this to be zero when the MMU is active. The best way to determine if MMU is on or off is: mrc p15, 0, rx, c1, c0 @ load ctrl reg tst rx, #1 @ test M bit > I wonder; is there a proper/suggested way to switch MMU off (and not end in > binary nirvana), to have the reentry / reenable work ? This is slightly complicated. You first need to turn of and disable the caches, and ideally set up a 1:1 mapping for the transition. There are cpu_proc_fin() and cpu_reset(branch_location). You may also investigate how kexec is handled which purpose is to let the kernel boot another kernel. Nicolas
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 6398ead..d83123a 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -71,10 +71,13 @@ ENDPROC(cpu_suspend) /* * r0 = control register value * r1 = v:p offset (preserved by cpu_do_resume) + * if this is zero, do not reenable MMU (it's on) * r2 = phys page table base * r3 = L1 section flags */ ENTRY(cpu_resume_mmu) + teq r1, #0 + moveq pc, lr @ return if MMU already on adr r4, cpu_resume_turn_mmu_on mov r4, r4, lsr #20 orr r3, r3, r4, lsl #20