From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 15.mo4.mail-out.ovh.net ([91.121.62.11] helo=mo4.mail-out.ovh.net) by bombadil.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U21GZ-0007G2-Ok for barebox@lists.infradead.org; Sun, 03 Feb 2013 15:14:00 +0000 Received: from mail403.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo4.mail-out.ovh.net (Postfix) with SMTP id 40080104ED59 for ; Sun, 3 Feb 2013 16:22:03 +0100 (CET) From: Jean-Christophe PLAGNIOL-VILLARD Date: Sun, 3 Feb 2013 16:10:30 +0100 Message-Id: <1359904236-11622-30-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1359904236-11622-1-git-send-email-plagnioj@jcrosoft.com> References: <20130203150333.GE18068@game.jcrosoft.org> <1359904236-11622-1-git-send-email-plagnioj@jcrosoft.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 30/36] ARM mmu: pickup already enabled mmu To: barebox@lists.infradead.org From: Sascha Hauer Signed-off-by: Sascha Hauer --- arch/arm/cpu/mmu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index 8f9a43e..73dd0d3 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -276,7 +276,14 @@ static int mmu_init(void) pte_flags_uncached = PTE_FLAGS_UNCACHED_V4; } - ttb = memalign(0x10000, 0x4000); + if (get_cr() & CR_M) { + asm volatile ("mrc p15,0,%0,c2,c0,0" : "=r"(ttb)); + + if (!request_sdram_region("ttb", (unsigned long)ttb, SZ_16K)) + pr_err("Error: Can't request SDRAM region for ttb\n"); + } else { + ttb = memalign(0x10000, 0x4000); + } pr_debug("ttb: 0x%p\n", ttb); -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox