From patchwork Thu Jun 14 07:07:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Zhu X-Patchwork-Id: 138549 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1949261lji; Thu, 14 Jun 2018 03:54:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIkcSXJmajDleoEMRjY/pHnyghvTVM1WBB2k8nsXxBlC82LLlD74Wpn8KTiOI4kc+xfV8Fx X-Received: by 2002:a50:b4a1:: with SMTP id w30-v6mr2200945edd.254.1528973645204; Thu, 14 Jun 2018 03:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973645; cv=none; d=google.com; s=arc-20160816; b=tw2oaGvFFTkE6k4CCiV1pxxAeU8TygKssm4r05S/AMNYkKhGGAtzBqJsFnXBlH1pX9 KrpxDGpRNzqdnG9Bh6o1dwU/Epbk8W6C/KVeV7kGyiSbSzLKMWNWsLObzI8lA7K5Js2B jFmE/Gi6zB1s+flri6A1MSHlsPtQxFiEGvSO6m07EttpZv3nOc9Lda3K9F0Lmz8xlObN uiYKI06/+umknoIxEI3SXtwa9hflJB1NwKIB6SpkvWkobkP+HTG5PcBIbiMXI8xcqlsh n2olVK3YnZmriDJ0d8bcT4fshH9orMxLMWinsePtOf6jqRjuIN2GQdjr3INLkIW7EL2Y zrog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=SAmdpGbZ0IH/DEXOBN13TWV7+7B16BrNhseRnKqQJa8=; b=AJkq4tcehopXRICrVRhmanKkOrcRMhEvqvzZ56L77wyAHC6PpLzyRIJAru3r1UBlXJ Nl11YLgSQCNPmC/b3CWtyHgPS9TAv7A5RngLpPMCjkkzaZ7AMJieQBc8gQpWz2A+G/W4 5D5hoLY3FJXOv2U9b4wPSuOvNqC1fDViz0+HENTYaZ+hf/2D7lAR7LVJnC9Xo26sDxaF 3UnjhS1qkcUIhtLJ4YrDkC96Lwq8rChFDonDdNWrpbPKgJSbsRStGxemooZPG705fJNX 7oqPFFiylTVg5VVsGDxftY4IjHdnE2XIH7BvvVkov4RiF0IU66lAGGPRg4E5z6kzgc/n VUKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id y5-v6si2937336edr.193.2018.06.14.03.54.03; Thu, 14 Jun 2018 03:54:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id C2797C21EA2; Thu, 14 Jun 2018 10:53:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=RCVD_IN_SORBS_WEB autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4DE2DC21C27; Thu, 14 Jun 2018 10:53:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 23074C21C27; Thu, 14 Jun 2018 07:07:42 +0000 (UTC) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.141]) by lists.denx.de (Postfix) with ESMTPS id 8C6BEC21BE5 for ; Thu, 14 Jun 2018 07:07:40 +0000 (UTC) Received: from jason.zhu?rock-chips.com (unknown [192.168.167.224]) by regular1.263xmail.com (Postfix) with ESMTP id 0F2696F; Thu, 14 Jun 2018 15:07:36 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 85A5E381; Thu, 14 Jun 2018 15:07:31 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: jason.zhu@rock-chips.com X-FST-TO: sjg@chromium.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: jason.zhu@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: jason.zhu@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 297373UPM7I; Thu, 14 Jun 2018 15:07:35 +0800 (CST) From: Jason Zhu To: Simon Glass Date: Thu, 14 Jun 2018 15:07:25 +0800 Message-Id: <1528960045-6651-1-git-send-email-jason.zhu@rock-chips.com> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Thu, 14 Jun 2018 10:53:50 +0000 Cc: u-boot@lists.denx.de, Alexander Graf Subject: [U-Boot] [PATCH] common: bootm: reserve memory bank X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Actually the DRAM is not only seperated in one bank. The DRAM bank information is stored in gd->bd->bi_dram, so reserve lmb according to gd->bd->bi_dram. Signed-off-by: Jason Zhu --- common/bootm.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index e789f68..46689fa 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -53,16 +53,23 @@ __weak void board_quiesce_devices(void) #ifdef CONFIG_LMB static void boot_start_lmb(bootm_headers_t *images) { + lmb_init(&images->lmb); +#ifdef CONFIG_NR_DRAM_BANKS + int i; + + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { + lmb_add(&images->lmb, gd->bd->bi_dram[i].start, + gd->bd->bi_dram[i].size); + } +#else ulong mem_start; phys_size_t mem_size; - lmb_init(&images->lmb); - mem_start = env_get_bootm_low(); mem_size = env_get_bootm_size(); lmb_add(&images->lmb, (phys_addr_t)mem_start, mem_size); - +#endif arch_lmb_reserve(&images->lmb); board_lmb_reserve(&images->lmb); }