From patchwork Fri Jul 15 22:25:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Becky Bruce X-Patchwork-Id: 104917 X-Patchwork-Delegate: galak@kernel.crashing.org 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 50987B6F62 for ; Sat, 16 Jul 2011 08:26:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2934328082; Sat, 16 Jul 2011 00:25:58 +0200 (CEST) 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 qX+JRyK4ae8Q; Sat, 16 Jul 2011 00:25:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A2FD728083; Sat, 16 Jul 2011 00:25:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 883552807C for ; Sat, 16 Jul 2011 00:25:47 +0200 (CEST) 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 bCxAj1uZSl1k for ; Sat, 16 Jul 2011 00:25:46 +0200 (CEST) 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 ch1outboundpool.messaging.microsoft.com (ch1ehsobe001.messaging.microsoft.com [216.32.181.181]) by theia.denx.de (Postfix) with ESMTPS id 332EE2807D for ; Sat, 16 Jul 2011 00:25:45 +0200 (CEST) Received: from mail42-ch1-R.bigfish.com (216.32.181.169) by CH1EHSOBE011.bigfish.com (10.43.70.61) with Microsoft SMTP Server id 14.1.225.22; Fri, 15 Jul 2011 22:25:43 +0000 Received: from mail42-ch1 (localhost.localdomain [127.0.0.1]) by mail42-ch1-R.bigfish.com (Postfix) with ESMTP id 775EF15A006B for ; Fri, 15 Jul 2011 22:25:43 +0000 (UTC) X-SpamScore: 2 X-BigFish: VS2(zzzz1202h10c0jzz8275dhz2dh2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail42-ch1 (localhost.localdomain [127.0.0.1]) by mail42-ch1 (MessageSwitch) id 1310768743335966_4775; Fri, 15 Jul 2011 22:25:43 +0000 (UTC) Received: from CH1EHSMHS005.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.252]) by mail42-ch1.bigfish.com (Postfix) with ESMTP id 45938175004B for ; Fri, 15 Jul 2011 22:25:43 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS005.bigfish.com (10.43.70.5) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 15 Jul 2011 22:25:42 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Fri, 15 Jul 2011 17:25:41 -0500 Received: from localhost (right.am.freescale.net [10.82.193.13]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p6FMPfCN013543 for ; Fri, 15 Jul 2011 17:25:41 -0500 (CDT) From: Becky Bruce To: Date: Fri, 15 Jul 2011 17:25:39 -0500 Message-ID: <13107687403141-git-send-email-beckyb@kernel.crashing.org> X-Mailer: git-send-email 1.5.3.rc2.29.gc4640f In-Reply-To: <13107687401917-git-send-email-beckyb@kernel.crashing.org> References: <13107687392389-git-send-email-beckyb@kernel.crashing.org> <13107687402100-git-send-email-beckyb@kernel.crashing.org> <13107687401917-git-send-email-beckyb@kernel.crashing.org> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH 3/3] board/tqm85xx: Create and tear down TLB for get_ram_size() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de We need a TLB entry to call get_ram_size(); the common code doesn't create one until *after* fixed_sdram() has determined the size. So we set up tlbs for the max possible size and tear them down once we're done with get_ram_size(); the common 85xx code will then set up a final set of tlb entries for the *actual* detected size of ddr. This prevents us from having TLB entries that are larger than DDR sitting around for very long, which is not a recommended scenario. Signed-off-by: Becky Bruce --- board/tqc/tqm85xx/sdram.c | 7 +++++++ include/configs/TQM85xx.h | 2 ++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/board/tqc/tqm85xx/sdram.c b/board/tqc/tqm85xx/sdram.c index 39a9e21..baf073e 100644 --- a/board/tqc/tqm85xx/sdram.c +++ b/board/tqc/tqm85xx/sdram.c @@ -363,6 +363,12 @@ static phys_size_t sdram_setup(int casl) udelay (1000); #endif /* CONFIG_TQM8548 */ + /* + * get_ram_size() depends on having tlbs for the DDR, but they are + * not yet setup because we don't know the size. Set up a temp + * mapping and delete it when done. + */ + setup_ddr_tlbs(CONFIG_SYS_DDR_EARLY_SIZE_MB); for (i = 0; i < N_DDR_CS_CONF; i++) { ddr->cs0_config = ddr_cs_conf[i].reg; @@ -376,6 +382,7 @@ static phys_size_t sdram_setup(int casl) break; } } + clear_ddr_tlbs(CONFIG_SYS_DDR_EARLY_SIZE_MB); #ifdef CONFIG_TQM8548 if (i < N_DDR_CS_CONF) { diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h index b4eef28..0eadcd2 100644 --- a/include/configs/TQM85xx.h +++ b/include/configs/TQM85xx.h @@ -152,8 +152,10 @@ defined(CONFIG_TQM8548_AG) || \ defined(CONFIG_TQM8548_BE) #define CONFIG_SYS_PPC_DDR_WIMGE (MAS2_I | MAS2_G) +#define CONFIG_SYS_DDR_EARLY_SIZE_MB (512) #else #define CONFIG_SYS_PPC_DDR_WIMGE (0) +#define CONFIG_SYS_DDR_EARLY_SIZE_MB (2 * 1024) #endif #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE