From patchwork Tue Nov 25 17:04:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 414788 X-Patchwork-Delegate: yorksun@freescale.com 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 B4564140187 for ; Wed, 26 Nov 2014 04:05:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2959E4B605; Tue, 25 Nov 2014 18:05:17 +0100 (CET) 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 YhKxEWvYT2OJ; Tue, 25 Nov 2014 18:05:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7DAD84B5FA; Tue, 25 Nov 2014 18:05:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 957EF4B5FA for ; Tue, 25 Nov 2014 18:05:11 +0100 (CET) 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 PHPIyoQEWDWi for ; Tue, 25 Nov 2014 18:05:11 +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 na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0125.outbound.protection.outlook.com [65.55.169.125]) by theia.denx.de (Postfix) with ESMTPS id 105264B5E9 for ; Tue, 25 Nov 2014 18:05:06 +0100 (CET) Received: from BN3PR0301CA0069.namprd03.prod.outlook.com (25.160.152.165) by DM2PR0301MB0733.namprd03.prod.outlook.com (25.160.97.141) with Microsoft SMTP Server (TLS) id 15.1.26.15; Tue, 25 Nov 2014 17:05:03 +0000 Received: from BN1BFFO11FD009.protection.gbl (2a01:111:f400:7c10::1:125) by BN3PR0301CA0069.outlook.office365.com (2a01:111:e400:401e::37) with Microsoft SMTP Server (TLS) id 15.1.26.15 via Frontend Transport; Tue, 25 Nov 2014 17:05:03 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD009.mail.protection.outlook.com (10.58.144.72) with Microsoft SMTP Server (TLS) id 15.1.6.13 via Frontend Transport; Tue, 25 Nov 2014 17:05:02 +0000 Received: from oslab-l1.am.freescale.net ([10.214.82.66]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id sAPH50ij018699; Tue, 25 Nov 2014 10:05:01 -0700 From: York Sun To: Date: Tue, 25 Nov 2014 09:04:56 -0800 Message-ID: <1416935096-29641-1-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.9.5 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(97736003)(48376002)(21056001)(62966003)(104016003)(77156002)(95666004)(33646002)(84676001)(50466002)(47776003)(20776003)(6806004)(99396003)(86362001)(93916002)(575784001)(64706001)(110136001)(69596002)(68736004)(19580395003)(44976005)(92726001)(92566001)(19580405001)(46102003)(50986999)(88136002)(36756003)(87936001)(89996001)(106466001)(107046002)(87286001)(2351001)(229853001)(105606002)(104166001)(81156004)(102836001)(31966008)(120916001)(4396001)(50226001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0733; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0733; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0733; X-Forefront-PRVS: 040655413E Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=yorksun@freescale.com; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0733; X-OriginatorOrg: freescale.com Cc: Scott Wood , York Sun , Alexander Graf Subject: [U-Boot] [PATCH] powerpc/mpc85xx: Fix DDR TLB mapping leftover X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 Commit f29f804a93e87c17670607641d120f431a3b0633 generalized the TLB mapping function, but made the DDR mapping leftover size to zero, causing the message not printed. Signed-off-by: York Sun CC: Alexander Graf CC: Scott Wood --- arch/powerpc/cpu/mpc85xx/tlb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c index 129ec66..4f0f7d5 100644 --- a/arch/powerpc/cpu/mpc85xx/tlb.c +++ b/arch/powerpc/cpu/mpc85xx/tlb.c @@ -299,12 +299,15 @@ unsigned int setup_ddr_tlbs_phys(phys_addr_t p_addr, { unsigned int ram_tlb_address = (unsigned int)CONFIG_SYS_DDR_SDRAM_BASE; u64 memsize = (u64)memsize_in_meg << 20; + u64 size; - memsize = min(memsize, CONFIG_MAX_MEM_MAPPED); - memsize = tlb_map_range(ram_tlb_address, p_addr, memsize, TLB_MAP_RAM); + size = min(memsize, CONFIG_MAX_MEM_MAPPED); + size = tlb_map_range(ram_tlb_address, p_addr, size, TLB_MAP_RAM); - if (memsize) - print_size(memsize, " left unmapped\n"); + if ((size) || (memsize > CONFIG_MAX_MEM_MAPPED)) { + print_size(memsize - CONFIG_MAX_MEM_MAPPED + size, + " left unmapped\n"); + } return memsize_in_meg; }