diff mbox series

[10/11] vexpress64: pick DRAM size from DT

Message ID 20220304163018.3167841-11-andre.przywara@arm.com
State Accepted
Commit 1a1143a45457161e90ea4cd5f3b0561d924ed8fe
Delegated to: Tom Rini
Headers show
Series vexpress64: OF_CONTROL and ARMv8-R64 support | expand

Commit Message

Andre Przywara March 4, 2022, 4:30 p.m. UTC
So far the DRAM size for both the Juno and the FVP model were hardcoded
in our config header file. For the Juno this is fine, as all models have
8 GiB of DRAM, but the DRAM size can be configured on the model command
line.

Drop the fixed DRAM size setup, instead look up the size in the device
tree, that we now have for every board. This allows a user to inject
a DT with the proper size, and be able to use the full amount of DRAM.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 board/armltd/vexpress64/vexpress64.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Comments

Tom Rini April 3, 2022, 12:14 a.m. UTC | #1
On Fri, Mar 04, 2022 at 04:30:17PM +0000, Andre Przywara wrote:

> So far the DRAM size for both the Juno and the FVP model were hardcoded
> in our config header file. For the Juno this is fine, as all models have
> 8 GiB of DRAM, but the DRAM size can be configured on the model command
> line.
> 
> Drop the fixed DRAM size setup, instead look up the size in the device
> tree, that we now have for every board. This allows a user to inject
> a DT with the proper size, and be able to use the full amount of DRAM.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c
index c3ad1fcc78..709ebf3fb0 100644
--- a/board/armltd/vexpress64/vexpress64.c
+++ b/board/armltd/vexpress64/vexpress64.c
@@ -88,20 +88,12 @@  int board_init(void)
 
 int dram_init(void)
 {
-	gd->ram_size = PHYS_SDRAM_1_SIZE;
-	return 0;
+	return fdtdec_setup_mem_size_base();
 }
 
 int dram_init_banksize(void)
 {
-	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-#ifdef PHYS_SDRAM_2
-	gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-	gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
-#endif
-
-	return 0;
+	return fdtdec_setup_memory_banksize();
 }
 
 /* Assigned in lowlevel_init.S