1 /*
2  * (C) Copyright 2015 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <dm.h>
9 #include <asm/io.h>
10 #include <asm/arch/uart.h>
11 #include <asm/arch/sdram_rk3036.h>
12 
13 DECLARE_GLOBAL_DATA_PTR;
14 
15 void get_ddr_config(struct rk3036_ddr_config *config)
16 {
17 	/* K4B4G1646Q config */
18 	config->ddr_type = 3;
19 	config->rank = 2;
20 	config->cs0_row = 15;
21 	config->cs1_row = 15;
22 
23 	/* 8bank */
24 	config->bank = 3;
25 	config->col = 10;
26 
27 	/* 16bit bw */
28 	config->bw = 1;
29 }
30 
31 int board_init(void)
32 {
33 	return 0;
34 }
35 
36 int dram_init(void)
37 {
38 	gd->ram_size = sdram_size();
39 
40 	return 0;
41 }
42 
43 #ifndef CONFIG_SYS_DCACHE_OFF
44 void enable_caches(void)
45 {
46 	/* Enable D-cache. I-cache is already enabled in start.S */
47 	dcache_enable();
48 }
49 #endif
50