Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Oct 2012 10:08:21 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Ian Lepore <freebsd@damnhippie.dyndns.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: exynos4412 hangs on enabling MMU
Message-ID:  <7FA4A9AA-F217-4425-9A21-E0967237540C@bsdimp.com>
In-Reply-To: <1351607803.1120.27.camel@revolution.hippie.lan>
References:  <20121030123231.GA91006@jail.io> <1351607803.1120.27.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help

On Oct 30, 2012, at 8:36 AM, Ian Lepore wrote:

> On Tue, 2012-10-30 at 16:32 +0400, Ruslan Bukin wrote:
>> hello!
>>=20
>> exynos hangs on mcr cmd in this context:
>>=20
>> /* Enable MMU */
>> [..]
>> orr     r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE)
>> mcr     p15, 0, r0, c1, c0, 0
>> [..]
>>=20
>> without CPU_CONTROL_MMU_ENABLE flag, mcr command works,
>> but board hangs again on line:
>> str r3, [r1], #0x0004 /* get zero init data */
>>=20
>> any suggestions?
>>=20
>> -Ruslan
>=20
> I don't have a direct answer to your question, but there is something
> related that I've always wondered about locore.S...  It starts by
> assuming the bootloader turned on the data cache, so it disables it,
> then it sets up TTB and TLB and other MMU-related stuff, then it turns
> back on the cache. =20
>=20
> Shouldn't it have flushed the cache in there somewhere before turning =
it
> back on? =20
>=20
> The part I don't know is whether the cache flush happens implicitly as =
a
> side effect of some of the other cp15 commands for setting up the MMU.
>=20
> Also, I have no idea whether this is related or not, but on armv4
> platforms on -current, the kernel init locks up somewhere in initarm()
> about 20% of the time.  It locks up at different points, sometimes it
> only makes it few lines into initarm(), sometimes it gets almost to =
the
> end before locking up.  The variability makes me think it's somehow
> related to caching or the MMU or something like that.  It's a problem
> that never happens on freebsd 8, but I haven't had time yet to start
> bisecting the changes to see where it quit working.

I'd be interested in tracking that down...  I've been booting lots of =
armv5 boards lately and haven't seen this hang with current.

Warner=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7FA4A9AA-F217-4425-9A21-E0967237540C>