From patchwork Fri Oct 11 12:56:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 282738 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id B9B612C0377 for ; Fri, 11 Oct 2013 23:57:12 +1100 (EST) Received: from mailhub1.si.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by ozlabs.org (Postfix) with ESMTP id CF9CF2C00E3 for ; Fri, 11 Oct 2013 23:56:46 +1100 (EST) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 2A0E61C84C0; Fri, 11 Oct 2013 14:56:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from mailhub1.si.c-s.fr ([192.168.12.234]) by localhost (mailhub1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hy4YpOA5J2Ym; Fri, 11 Oct 2013 14:56:43 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 131461C84AB; Fri, 11 Oct 2013 14:56:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 04860C7392; Fri, 11 Oct 2013 14:56:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id aXMIOgxfJMnx; Fri, 11 Oct 2013 14:56:42 +0200 (CEST) Received: from localhost.localdomain (unknown [192.168.4.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9D321C7391; Fri, 11 Oct 2013 14:56:42 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.8/8.13.8) with ESMTP id r9BCueEm006246; Fri, 11 Oct 2013 14:56:40 +0200 Received: (from root@localhost) by localhost.localdomain (8.13.8/8.13.8/Submit) id r9BCuepM006243; Fri, 11 Oct 2013 14:56:40 +0200 Date: Fri, 11 Oct 2013 14:56:40 +0200 Message-Id: <201310111256.r9BCuepM006243@localhost.localdomain> From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras Subject: [PATCH] powerpc 8xx: Fixing memory init issue with CONFIG_PIN_TLB Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Activating CONFIG_PIN_TLB allows access to the 24 first Mbytes of memory at bootup instead of 8. It is needed for "big" kernels for instance when activating CONFIG_LOCKDEP_SUPPORT. This needs to be taken into account in init_32 too, otherwise memory allocation soon fails after startup. Signed-off-by: Christophe Leroy Acked-by: Joakim Tjernlund diff -ur linux-3.11.org/arch/powerpc/kernel/head_8xx.S linux-3.11/arch/powerpc/kernel/head_8xx.S --- linux-3.11.org/arch/powerpc/mm/init_32.c 2013-09-02 22:46:10.000000000 +0200 +++ linux-3.11/arch/powerpc/mm/init_32.c 2013-09-09 11:28:54.000000000 +0200 @@ -213,7 +213,12 @@ */ BUG_ON(first_memblock_base != 0); +#ifdef CONFIG_PIN_TLB + /* 8xx can only access 24MB at the moment */ + memblock_set_current_limit(min_t(u64, first_memblock_size, 0x01800000)); +#else /* 8xx can only access 8MB at the moment */ memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000)); +#endif } #endif /* CONFIG_8xx */