diff options
author | Clément Léger <clement.leger@bootlin.com> | 2021-08-16 14:25:42 +0200 |
---|---|---|
committer | Eugen Hristev <eugen.hristev@microchip.com> | 2021-09-21 10:05:38 +0300 |
commit | 8f5972ca2b62de6b1e3214906d5ced7605b8d047 (patch) | |
tree | b14880a26931dbc076946a6fdd472d3f3061eb43 /board | |
parent | b25d7618beb342773591900b1dc24452ec0f4642 (diff) | |
download | u-boot-8f5972ca2b62de6b1e3214906d5ced7605b8d047.tar.gz u-boot-8f5972ca2b62de6b1e3214906d5ced7605b8d047.tar.bz2 u-boot-8f5972ca2b62de6b1e3214906d5ced7605b8d047.zip |
board: sama5d2_xplained: 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/sama5d2_xplained/sama5d2_xplained.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 5110ec8969..8b5cd533d0 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -68,7 +68,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 +77,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 AT24MAC_MAC_OFFSET 0x9a |