From patchwork Fri Nov 30 23:01:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 203068 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2F4132C0082 for ; Sat, 1 Dec 2012 10:01:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0D5CA4A056; Sat, 1 Dec 2012 00:01:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oeMl3n5cxo2i; Sat, 1 Dec 2012 00:01:45 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 648004A047; Sat, 1 Dec 2012 00:01:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BAE14A048 for ; Sat, 1 Dec 2012 00:01:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bXW0Cd44lnfq for ; Sat, 1 Dec 2012 00:01:37 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bk0-f74.google.com (mail-bk0-f74.google.com [209.85.214.74]) by theia.denx.de (Postfix) with ESMTPS id 1FFE44A046 for ; Sat, 1 Dec 2012 00:01:35 +0100 (CET) Received: by mail-bk0-f74.google.com with SMTP id je9so65141bkc.3 for ; Fri, 30 Nov 2012 15:01:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=9yM1z9TE50/QO96DL1LVqI4NOWvpUzuAbPIzVRotRmI=; b=XvcaecYY02qFmSA7L9XnjiAVghzuYk/D+33IuWZbwtw1HeWHXDuHPP7iYrEwWyuy2B KIZexmflVNTvgu7ND5Vscz7PL5cLFRbT8EPUw57uYRQ7qwwHE1CC7WR+zbHSJlnchL5Z oXggQf3YLhpfveSw9BLHOmLULwRXI8PXvLoGGWir79ud9bPAuPnzMu+i2yyM9/Ps4j/m qWf41+guJ4GiBKlKy+LV9fObncf73Pk5soqAAqK/oJw3bPP0AWqprw6vYL5/1ArixWyo xPrOhv+jRd/R8S7fMj0CbFpdQdwNYrXO4k8ZTkvWKwxNAuTs3dmahduk30X576CzCxyd yKqQ== Received: by 10.14.173.136 with SMTP id v8mr3548351eel.2.1354316493640; Fri, 30 Nov 2012 15:01:33 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si1491356een.1.2012.11.30.15.01.33 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 30 Nov 2012 15:01:33 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 477EF20004E; Fri, 30 Nov 2012 15:01:33 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 8ACEC160341; Fri, 30 Nov 2012 15:01:32 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 30 Nov 2012 15:01:15 -0800 Message-Id: <1354316484-23515-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1354316484-23515-1-git-send-email-sjg@chromium.org> References: <1354316484-23515-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkhQiiDVJcprr/uR7h0IxiZ+qmmha3YSmuhU3hQcRWnP6fWMsDtbs5M6lHya7QEd1yxteB5/N6WDLWuI3suk2GTdePQ29PISBHDM3VsPCdHvtnPDXu4NHENNtRFjyIDBmDycgFsjNk3JThRJcP0HqgVQrYxsbzwxYfmhr/x+5lA6toRND4J/qDxPaXU72KDXcNkWoxR Cc: Gabe Black Subject: [U-Boot] [PATCH v2 02/10] arm: Keep track of the tlb size as well as its location X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Gabe Black It may be necessary to know where the TLB area ends as well as where it starts. This allows board code to complete a secure memory erase without destroying the page tables. Signed-off-by: Gabe Black Signed-off-by: Simon Glass --- Changes in v2: None arch/arm/include/asm/global_data.h | 1 + arch/arm/lib/board.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 2b9af93..41a26ed 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -73,6 +73,7 @@ typedef struct global_data { unsigned long reloc_off; #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) unsigned long tlb_addr; + unsigned long tlb_size; #endif const void *fdt_blob; /* Our device tree, NULL if none */ void **jt; /* jump table */ diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 22a4d9c..e03fc6d 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -353,13 +353,14 @@ void board_init_f(ulong bootflag) #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) /* reserve TLB table */ - addr -= (4096 * 4); + gd->tlb_size = 4096 * 4; + addr -= gd->tlb_size; /* round down to next 64 kB limit */ addr &= ~(0x10000 - 1); gd->tlb_addr = addr; - debug("TLB table at: %08lx\n", addr); + debug("TLB table from %08lx to %08lx\n", addr, addr + gd->tlb_size); #endif /* round down to next 4 kB limit */