public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] common: bootm: reserve memory bank
@ 2018-06-14  7:07 Jason Zhu
  2018-06-18 19:02 ` Tom Rini
  2018-06-25  2:31 ` Kever Yang
  0 siblings, 2 replies; 5+ messages in thread
From: Jason Zhu @ 2018-06-14  7:07 UTC (permalink / raw)
  To: 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 <jason.zhu@rock-chips.com>
---
 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);
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] common: bootm: reserve memory bank
@ 2018-06-14  8:06 Jason Zhu
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Zhu @ 2018-06-14  8:06 UTC (permalink / raw)
  To: 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 <jason.zhu@rock-chips.com>
---
 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);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-25  2:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-14  7:07 [U-Boot] [PATCH] common: bootm: reserve memory bank Jason Zhu
2018-06-18 19:02 ` Tom Rini
2018-06-19  1:20   ` jason.zhu at rock-chips.com
2018-06-25  2:31 ` Kever Yang
  -- strict thread matches above, loose matches on Subject: below --
2018-06-14  8:06 Jason Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox