blob: 688bc0ffded2e2de2e3f5a5e0903eb449fce1cad [file] [log] [blame]
Simon Glass2444dae2015-08-30 16:55:38 -06001/*
2 * (C) Copyright 2015 Google, Inc
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <dm.h>
9#include <ram.h>
10
11DECLARE_GLOBAL_DATA_PTR;
12
13int board_init(void)
14{
15 return 0;
16}
17
18int dram_init(void)
19{
20 struct ram_info ram;
21 struct udevice *dev;
22 int ret;
23
24 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
25 if (ret) {
26 debug("DRAM init failed: %d\n", ret);
27 return ret;
28 }
29 ret = ram_get_info(dev, &ram);
30 if (ret) {
31 debug("Cannot get DRAM size: %d\n", ret);
32 return ret;
33 }
34 debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
35 gd->ram_size = ram.size;
36
37 return 0;
38}
39
40#ifndef CONFIG_SYS_DCACHE_OFF
41void enable_caches(void)
42{
43 /* Enable D-cache. I-cache is already enabled in start.S */
44 dcache_enable();
45}
46#endif