From patchwork Mon Jun 10 10:50:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 2696881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 00BC1DF264 for ; Mon, 10 Jun 2013 10:51:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ulzgh-00014W-E6; Mon, 10 Jun 2013 10:50:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ulzge-0007PZ-HC; Mon, 10 Jun 2013 10:50:56 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ulzgb-0007Op-MM for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2013 10:50:54 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 10 Jun 2013 11:50:25 +0100 Received: from e102654-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 Jun 2013 11:50:23 +0100 Received: by e102654-lin.cambridge.arm.com (sSMTP sendmail emulation); Mon, 10 Jun 2013 11:50:22 +0100 From: Javi Merino To: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Subject: [PATCH v2] ARM: document the bigger pagetables needed for LPAE Date: Mon, 10 Jun 2013 11:50:15 +0100 Message-Id: <1370861415-5587-1-git-send-email-javi.merino@arm.com> X-Mailer: git-send-email 1.7.9.5 X-OriginalArrivalTime: 10 Jun 2013 10:50:23.0248 (UTC) FILETIME=[4EEF1900:01CE65C8] X-MC-Unique: 113061011502500901 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130610_065053_927292_7ABE18CA X-CRM114-Status: GOOD ( 16.06 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [91.220.42.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Javi Merino , Rob Landley X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The Booting documentation assumes that the initial pagetables are 16KiB but since 1b6ba46 (ARM: LPAE: MMU setup for the 3-level page table format) they are 20KiB for LPAE kernels. Thus, the recommendation to put atags or the dtb in the first 16KiB is wrong, there's only 12KiB of space there in LPAE kernels, so update the documentation accordingly. Signed-off-by: Javi Merino Acked-by: Rob Landley --- Documentation/arm/Booting | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/arm/Booting b/Documentation/arm/Booting index 0c1f475..e3cab63 100644 --- a/Documentation/arm/Booting +++ b/Documentation/arm/Booting @@ -75,6 +75,16 @@ The boot loader must provide either a tagged list or a dtb image for passing configuration data to the kernel. The physical address of the boot data is passed to the kernel in register r2. +The low memory layout is as follows: + + 0k-12k boot data (tagged list or device tree) + 12k-32k page tables + 32k-xxx kernel image + +The page tables go from 16k-32k in !CONFIG_ARM_LPAE kernels but in +general it's safer to assume that you only have 12KiB for your boot +data. + 4a. Setup the kernel tagged list -------------------------------- @@ -105,7 +115,7 @@ The tagged list should be stored in system RAM. The tagged list must be placed in a region of memory where neither the kernel decompressor nor initrd 'bootp' program will overwrite -it. The recommended placement is in the first 16KiB of RAM. +it. The recommended placement is in the first 12KiB of RAM. 4b. Setup the device tree ------------------------- @@ -120,7 +130,7 @@ tagged list. The boot loader must pass at a minimum the size and location of the system memory, and the root filesystem location. The dtb must be placed in a region of memory where the kernel decompressor will not -overwrite it. The recommended placement is in the first 16KiB of RAM +overwrite it. The recommended placement is in the first 12KiB of RAM with the caveat that it may not be located at physical address 0 since the kernel interprets a value of 0 in r2 to mean neither a tagged list nor a dtb were passed. @@ -137,8 +147,9 @@ then it is legal for the boot loader to call the zImage in flash directly. The zImage may also be placed in system RAM (at any location) and -called there. Note that the kernel uses 16K of RAM below the image -to store page tables. The recommended placement is 32KiB into RAM. +called there. Note that the kernel may use up to 20KiB of RAM below +the image to store page tables. The recommended placement is 32KiB +into RAM. In either case, the following conditions must be met: