summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorClément Léger <clement.leger@bootlin.com>2021-08-16 15:25:39 +0300
committerEugen Hristev <eugen.hristev@microchip.com>2021-09-21 10:05:38 +0300
commit73c1589f025d93e6709fd1c88f1f7e068935e6aa (patch)
tree318a28e138bc03a03fa5259f2b6e4f8151430939 /board
parent094f19c5274b758a243158f69367626049f283e5 (diff)
downloadu-boot-73c1589f025d93e6709fd1c88f1f7e068935e6aa.tar.xz
board: sama5d27_som1_ek: Get dram size and base from device tree
In order to make it more flexible and allow modifying the base address of DRAM without recompiling U-Boot, use memory node from device tree with fdtdec functions. Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Diffstat (limited to 'board')
-rw-r--r--board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
index 1b7d946b50..8c0cf3da54 100644
--- a/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
+++ b/board/atmel/sama5d27_som1_ek/sama5d27_som1_ek.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <debug_uart.h>
+#include <fdtdec.h>
#include <init.h>
#include <asm/global_data.h>
#include <asm/io.h>
@@ -68,7 +69,7 @@ int board_early_init_f(void)
int board_init(void)
{
/* address of boot parameters */
- gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+ gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
#ifdef CONFIG_CMD_USB
board_usb_hw_init();
@@ -77,11 +78,14 @@ int board_init(void)
return 0;
}
+int dram_init_banksize(void)
+{
+ return fdtdec_setup_memory_banksize();
+}
+
int dram_init(void)
{
- gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
- CONFIG_SYS_SDRAM_SIZE);
- return 0;
+ return fdtdec_setup_mem_size_base();
}
#define MAC24AA_MAC_OFFSET 0xfa