mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
committed by
Eugen Hristev
parent
094f19c527
commit
73c1589f02
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <debug_uart.h>
|
#include <debug_uart.h>
|
||||||
|
#include <fdtdec.h>
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
#include <asm/global_data.h>
|
#include <asm/global_data.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
@@ -68,7 +69,7 @@ int board_early_init_f(void)
|
|||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
/* address of boot parameters */
|
/* 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
|
#ifdef CONFIG_CMD_USB
|
||||||
board_usb_hw_init();
|
board_usb_hw_init();
|
||||||
@@ -77,11 +78,14 @@ int board_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dram_init_banksize(void)
|
||||||
|
{
|
||||||
|
return fdtdec_setup_memory_banksize();
|
||||||
|
}
|
||||||
|
|
||||||
int dram_init(void)
|
int dram_init(void)
|
||||||
{
|
{
|
||||||
gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
|
return fdtdec_setup_mem_size_base();
|
||||||
CONFIG_SYS_SDRAM_SIZE);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAC24AA_MAC_OFFSET 0xfa
|
#define MAC24AA_MAC_OFFSET 0xfa
|
||||||
|
|||||||
Reference in New Issue
Block a user