rockchip: updata the style of reporting sdram cap

updata the style of reporting sdram capacity to uboot

Change-Id: I6a652f233d8d26e842398edcc184cbbe89099401
Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
This commit is contained in:
Zhihuan He 2018-02-01 15:45:51 +08:00 committed by Kever Yang
parent 52f7b21d4b
commit d14f7e1ef9
2 changed files with 22 additions and 41 deletions

View File

@ -6,6 +6,8 @@
#include <common.h>
#include <asm/io.h>
#include <ram.h>
#include <asm/arch/sdram_common.h>
#include <asm/arch/hardware.h>
#include <asm/arch/grf_rv1108.h>
@ -32,3 +34,23 @@ void board_debug_uart_init(void)
#endif /*CONFIG_SPL_BUILD*/
}
int dram_init(void)
{
struct rv1108_grf *grf = (void *)GRF_BASE;
gd->ram_size = rockchip_sdram_size((phys_addr_t)&grf->os_reg2);
return 0;
}
int dram_init_banksize(void)
{
size_t max_size = min((unsigned long)(gd->ram_size +
CONFIG_SYS_SDRAM_BASE), gd->ram_top);
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
gd->bd->bi_dram[0].size = max_size - gd->bd->bi_dram[0].start;
return 0;
}

View File

@ -3,44 +3,3 @@
* Authors: Andy Yan <andy.yan@rock-chips.com>
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <asm/io.h>
#include <fdtdec.h>
#include <asm/arch/grf_rv1108.h>
#include <asm/arch/hardware.h>
DECLARE_GLOBAL_DATA_PTR;
int mach_cpu_init(void)
{
int node;
struct rv1108_grf *grf;
node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf");
grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
/*evb board use UART2 m0 for debug*/
rk_clrsetreg(&grf->gpio2d_iomux,
GPIO2D2_MASK | GPIO2D1_MASK,
GPIO2D2_UART2_SOUT_M0 << GPIO2D2_SHIFT |
GPIO2D1_UART2_SIN_M0 << GPIO2D1_SHIFT);
rk_clrreg(&grf->gpio3c_iomux, GPIO3C3_MASK | GPIO3C2_MASK);
return 0;
}
int dram_init(void)
{
gd->ram_size = 0x8000000;
return 0;
}
int dram_init_banksize(void)
{
gd->bd->bi_dram[0].start = 0x60000000;
gd->bd->bi_dram[0].size = 0x8000000;
return 0;
}