From owner-freebsd-arm@FreeBSD.ORG Tue Oct 30 14:37:07 2012 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E9B0599 for ; Tue, 30 Oct 2012 14:37:07 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id C39C08FC15 for ; Tue, 30 Oct 2012 14:37:06 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q9UEb5fY062929 for ; Tue, 30 Oct 2012 08:37:05 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q9UEahJu005581; Tue, 30 Oct 2012 08:36:43 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: exynos4412 hangs on enabling MMU From: Ian Lepore To: Ruslan Bukin In-Reply-To: <20121030123231.GA91006@jail.io> References: <20121030123231.GA91006@jail.io> Content-Type: text/plain; charset="us-ascii" Date: Tue, 30 Oct 2012 08:36:43 -0600 Message-ID: <1351607803.1120.27.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 14:37:07 -0000 On Tue, 2012-10-30 at 16:32 +0400, Ruslan Bukin wrote: > hello! > > exynos hangs on mcr cmd in this context: > > /* Enable MMU */ > [..] > orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE) > mcr p15, 0, r0, c1, c0, 0 > [..] > > without CPU_CONTROL_MMU_ENABLE flag, mcr command works, > but board hangs again on line: > str r3, [r1], #0x0004 /* get zero init data */ > > any suggestions? > > -Ruslan 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. Shouldn't it have flushed the cache in there somewhere before turning it back on? 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. 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. -- Ian