2018-05-07 06:58:06 +09:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2017-09-14 01:00:12 +09:00
|
|
|
/*
|
2017-10-23 16:53:58 +09:00
|
|
|
* Copyright (C) 2017, STMicroelectronics - All Rights Reserved
|
2020-12-03 02:47:30 +09:00
|
|
|
* Author(s): Patrice Chotard, <patrice.chotard@foss.st.com> for STMicroelectronics.
|
2017-09-14 01:00:12 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <dm.h>
|
2019-11-15 04:57:46 +09:00
|
|
|
#include <init.h>
|
2020-05-11 02:40:05 +09:00
|
|
|
#include <log.h>
|
2020-10-31 12:38:53 +09:00
|
|
|
#include <asm/global_data.h>
|
2017-09-14 01:00:12 +09:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
int dram_init(void)
|
|
|
|
{
|
|
|
|
struct udevice *dev;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
|
|
|
|
if (ret) {
|
|
|
|
debug("DRAM init failed: %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2018-07-16 19:26:11 +09:00
|
|
|
if (fdtdec_setup_mem_size_base() != 0)
|
2017-09-14 01:00:12 +09:00
|
|
|
ret = -EINVAL;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
int dram_init_banksize(void)
|
|
|
|
{
|
|
|
|
fdtdec_setup_memory_banksize();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int board_early_init_f(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 get_board_rev(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int board_late_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int board_init(void)
|
|
|
|
{
|
|
|
|
gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
|
|
|
|
return 0;
|
|
|
|
}
|