From patchwork Mon Sep 28 09:11:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 523266 X-Patchwork-Delegate: sjg@chromium.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 884D314017E for ; Mon, 28 Sep 2015 19:10:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=n7mgjKgr; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4DBB14B8CB; Mon, 28 Sep 2015 11:10:35 +0200 (CEST) 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 Dg6gK_z1Myk3; Mon, 28 Sep 2015 11:10:35 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AA2684B8B6; Mon, 28 Sep 2015 11:10:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F084A4B88C for ; Mon, 28 Sep 2015 11:10:11 +0200 (CEST) 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 mUkw4JdZBTGb for ; Mon, 28 Sep 2015 11:10:11 +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 mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by theia.denx.de (Postfix) with ESMTPS id 881844B88A for ; Mon, 28 Sep 2015 11:10:07 +0200 (CEST) Received: by pablk4 with SMTP id lk4so72356363pab.3 for ; Mon, 28 Sep 2015 02:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iqZUfUOy1WwYKXgV1DFgcwuXWDMIkcaY3pm9hFoBWC4=; b=n7mgjKgrQ3IAjM2vAmbX53LZOUbRaEqjHbMN5WkSn2JycIUUUmn4DIOAEaenu0SVij VzLKAJMtOSSIcKpXrRAVQP/rXt3Jm7eWbfjlLyRjZr9tj3dQJTqwyVSB846Oo1SlDFFI QBAufVxUV9htnWbMovM7cePy1iW+Q5A25FMZpEyJMiLGJxcofm2T2zEYsbM6WjYZ1zFk 08gEoo482g+xjUe57MYvCzCoRR8nZLN50HR6W8E0u3ZRqylyZW1CLj7HajzdpWxD+sVV 8l8P0XILnHRu7dIhkn4+HThUmpab25rv9N0IU0A7zclY5OH46+/BWMBygmHxwLpH/b0V itiw== X-Received: by 10.66.121.195 with SMTP id lm3mr21837302pab.84.1443431405775; Mon, 28 Sep 2015 02:10:05 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-157-139.windriver.com. [147.11.157.139]) by smtp.gmail.com with ESMTPSA id jv5sm18028246pbc.47.2015.09.28.02.10.04 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Sep 2015 02:10:05 -0700 (PDT) From: Bin Meng To: Tom Rini , Simon Glass , U-Boot Mailing List Date: Mon, 28 Sep 2015 02:11:59 -0700 Message-Id: <1443431530-472-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1443431530-472-1-git-send-email-bmeng.cn@gmail.com> References: <1443431530-472-1-git-send-email-bmeng.cn@gmail.com> Cc: Miao Yan Subject: [U-Boot] [PATCH v2 02/13] x86: fsp: Report correct number of E820 table entries X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The logic to calculate the number of E820 table entries is wrong when walking through the FSP HOB tables. Fix it. Signed-off-by: Bin Meng Tested-by: Jian Luo Acked-by: Simon Glass --- Simon, I think we need get this fix in v2015.10 release. Changes in v2: None arch/x86/lib/fsp/fsp_dram.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/lib/fsp/fsp_dram.c b/arch/x86/lib/fsp/fsp_dram.c index 28552fa..e51ca96 100644 --- a/arch/x86/lib/fsp/fsp_dram.c +++ b/arch/x86/lib/fsp/fsp_dram.c @@ -72,9 +72,10 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries) entries[num_entries].type = E820_RAM; else if (res_desc->type == RES_MEM_RESERVED) entries[num_entries].type = E820_RESERVED; + + num_entries++; } hdr = get_next_hob(hdr); - num_entries++; } /* Mark PCIe ECAM address range as reserved */