blob: fbdc3cde050223effa05f9f43044215051679bf8 [file] [log] [blame]
Bin Meng828d9af2015-02-02 22:35:27 +08001/*
2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <asm/post.h>
9#include <asm/arch/quark.h>
10
11DECLARE_GLOBAL_DATA_PTR;
12
13int dram_init(void)
14{
15 /* hardcode the DRAM size for now */
16 gd->ram_size = DRAM_MAX_SIZE;
17 post_code(POST_DRAM);
18
19 return 0;
20}
21
22void dram_init_banksize(void)
23{
24 gd->bd->bi_dram[0].start = 0;
25 gd->bd->bi_dram[0].size = gd->ram_size;
26}
27
28/*
29 * This function looks for the highest region of memory lower than 4GB which
30 * has enough space for U-Boot where U-Boot is aligned on a page boundary.
31 * It overrides the default implementation found elsewhere which simply
32 * picks the end of ram, wherever that may be. The location of the stack,
33 * the relocation address, and how far U-Boot is moved by relocation are
34 * set in the global data structure.
35 */
36ulong board_get_usable_ram_top(ulong total_size)
37{
38 return gd->ram_size;
39}