]> git.baikalelectronics.ru Git - uboot.git/commitdiff
board: ti: am62x: Use fdt functions for ram and bank init
authorGeorgi Vlaev <g-vlaev@ti.com>
Tue, 14 Jun 2022 14:45:32 +0000 (17:45 +0300)
committerTom Rini <trini@konsulko.com>
Wed, 6 Jul 2022 18:30:08 +0000 (14:30 -0400)
Use the appropriate fdtdec_setup_mem_size_base() call in
dram_init() and fdtdec_setup_bank_size() in dram_bank_init()
to pull these values from DT, where they are already available,
instead of hardcoding them.

Signed-off-by: Georgi Vlaev <g-vlaev@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
board/ti/am62x/evm.c

index 4dd5e64299bfbeff6afe87335184b0beb730d1d9..fb5106d1f3c8f88d08ee1e202caa37b6173e2599 100644 (file)
@@ -23,17 +23,10 @@ int board_init(void)
 
 int dram_init(void)
 {
-       gd->ram_size = 0x80000000;
-
-       return 0;
+       return fdtdec_setup_mem_size_base();
 }
 
 int dram_init_banksize(void)
 {
-       /* Bank 0 declares the memory available in the DDR low region */
-       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
-       gd->bd->bi_dram[0].size = 0x80000000;
-       gd->ram_size = 0x80000000;
-
-       return 0;
+       return fdtdec_setup_memory_banksize();
 }