From patchwork Thu Jun 14 08:06:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Zhu X-Patchwork-Id: 138550 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1949639lji; Thu, 14 Jun 2018 03:54:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI6G3UZMW8TLnI6inGy6Y/JQY/JqwO5/vFn0yUs2GjclqIEX+QZkvBKbDTkHPvuAK30z89y X-Received: by 2002:a50:90cb:: with SMTP id d11-v6mr2235532eda.54.1528973670890; Thu, 14 Jun 2018 03:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528973670; cv=none; d=google.com; s=arc-20160816; b=f7muLtrs7d2Q53l9gO5tWfRsXLZ9/RkyvrLRhLNkokkAONdEDK9TVM0uJP0aD5QpXN 9JKjiCA2kKRRf8ZIJ0JqH9xCmF1x7+riKGNWqNMBI9X3cc0hffRjjADK8PXYJV5OV+42 f8NtjyV4kUfetOvx6I+6hk78BtVPVC8g94z6/V1znqIGCHkAb0z0T6+H6e9ZFU3litwi i3+cdq/4G0ueWhI06YNj+e5KE3XN7j02HiwC0Msh/lQzYD8BtpxfN9+j8tP7LO5oK5m1 4qmd7HMcqw31YLa6wCB17Nj5gSpQgzMLrsEOGCB7yjTXFCUN4grYQJ3cUhkJy+d6/mj/ IMRg== 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=G/NN7PHPpSNjcW8QFn2YjMKLQbytlF29qmTfzGS3UZc=; b=zKhrvPrY2RUrLgK7BuhIuQ/CxV1MlU3hSZwhnCDuv6Yn1D7ojXkpwEwXzlzCqSzgm3 zYMRZRbY5z6MQtuueFjp/SAQJAV2B/g9JdQXxK4XFzMfu44DHNcTT8ev0eq2886UtJ7C O9cLIAHYxg/R0wXnn0p7KVuIeK2U+LZuJ9M3vBNrWL/gieerxoW1kdXBK3oAlEw/zCvU /aGabbnuXzbZuus58gig6gc7qAMd+ysprM7DhHaol+wnzDW/E3Fzw+ia5+XI2RxS+2mx AjpDsDIvC/K81xgZKOy3RxxZL/smxtMbQ5Y4FacqtpvxwglGJHp4kqzf818j4U1Rau6F Ub7g== 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 c53-v6si2200129edc.322.2018.06.14.03.54.30; Thu, 14 Jun 2018 03:54:30 -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 70634C21E2C; Thu, 14 Jun 2018 10:54:21 +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 210E3C21DA2; Thu, 14 Jun 2018 10:53:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 496DEC21C27; Thu, 14 Jun 2018 08:06:17 +0000 (UTC) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.99.138]) by lists.denx.de (Postfix) with ESMTPS id 03F8EC21BE5 for ; Thu, 14 Jun 2018 08:06:15 +0000 (UTC) Received: from jason.zhu?rock-chips.com (unknown [192.168.167.164]) by regular1.263xmail.com (Postfix) with ESMTP id 8464C7A2E; Thu, 14 Jun 2018 16:06:09 +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 649F639E; Thu, 14 Jun 2018 16:06:05 +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 3617X29RTP; Thu, 14 Jun 2018 16:06:08 +0800 (CST) From: Jason Zhu To: Simon Glass Date: Thu, 14 Jun 2018 16:06:07 +0800 Message-Id: <1528963567-15372-1-git-send-email-jason.zhu@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Thu, 14 Jun 2018 10:53:51 +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); }