From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 05 Apr 2003 18:23:30 +0200 From: Thomas Gleixner Subject: Re: check MMU state In-reply-to: <1049556246.654.7.camel@zion.wanadoo.fr> To: Benjamin Herrenschmidt Cc: linuxppc-dev Reply-To: tglx@linutronix.de Message-id: <200304051823.30693.tglx@linutronix.de> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-15 References: <200304051735.25831.tglx@linutronix.de> <200304051815.40797.tglx@linutronix.de> <1049556246.654.7.camel@zion.wanadoo.fr> Sender: owner-linuxppc-dev@lists.linuxppc.org List-Id: On Saturday 05 April 2003 17:24, Benjamin Herrenschmidt wrote: > On Sat, 2003-04-05 at 18:15, Thomas Gleixner wrote: > > On Saturday 05 April 2003 16:49, Benjamin Herrenschmidt wrote: > > > > Is there a clean way to check, if the MMU is enabled on kernel entry > > > > ? I have to port Linux to a PMC-module, where the bootloader code > > > > should not be changed. > > > > > > The kernel entry can cope with both cases, provided that early_init > > > properly returns the physical address where the kernel is loaded, > > > regardless of the translations setup by the bootloader. Also, the > > > kernel has to be contiguous in physical memory. > > > > I don't reach early_init. The CPU is a 860 and I'm using 2.4.20-ben8. I > > get lost in initial_mmu. If I turn off the mmu before "bl initial_mmu" > > everything is fine. > > Ah well, I was talking about the "common" CPU case (CONFIG_6xx), I don't > know about 8xx but since the first thing the code in head_8xx.S does is > "tlbia", I think you are in a bad situation running that with > translation enabled and no vectors around to handle the TLB miss... > > For machines without BATs, I tend to think that a bootloader loading > you with MMU on shall be shot. What I'd suggest is that you hack a piggy > back loader in the zImage wrapper that shuts MMU off before entering the > kernel. If you _have_ to run vmlinux as is, then stuff a bl to some code > to disable the MMU before reaching initial_mmu in head_8xx.S I have done this already, but just wanted to know, if there is a way to check the mmu-state in case that the bootloader code is corrected some day. -- Thomas ________________________________________________________________________ linutronix - competence in embedded & realtime linux http://www.linutronix.de mail: tglx@linutronix.de ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/