blob: 784b2b0191d49e3e9adae36cc04d593638f293ae [file] [log] [blame]
Lokesh Vutla029f9212018-08-27 15:59:06 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Board specific initialization for AM654 EVM
4 *
5 * Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
6 * Lokesh Vutla <lokeshvutla@ti.com>
7 *
8 */
9
10#include <common.h>
11#include <asm/io.h>
12#include <spl.h>
13
14DECLARE_GLOBAL_DATA_PTR;
15
16int board_init(void)
17{
18 return 0;
19}
20
21int dram_init(void)
22{
23#ifdef CONFIG_PHYS_64BIT
24 gd->ram_size = 0x100000000;
25#else
26 gd->ram_size = 0x80000000;
27#endif
28
29 return 0;
30}
31
32ulong board_get_usable_ram_top(ulong total_size)
33{
34#ifdef CONFIG_PHYS_64BIT
35 /* Limit RAM used by U-Boot to the DDR low region */
36 if (gd->ram_top > 0x100000000)
37 return 0x100000000;
38#endif
39
40 return gd->ram_top;
41}
42
43int dram_init_banksize(void)
44{
45 /* Bank 0 declares the memory available in the DDR low region */
46 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
47 gd->bd->bi_dram[0].size = 0x80000000;
48
49#ifdef CONFIG_PHYS_64BIT
50 /* Bank 1 declares the memory available in the DDR high region */
51 gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE1;
52 gd->bd->bi_dram[1].size = 0x80000000;
53#endif
54
55 return 0;
56}
Lokesh Vutla8bfaf012018-08-27 15:59:08 +053057
58#ifdef CONFIG_SPL_LOAD_FIT
59int board_fit_config_name_match(const char *name)
60{
61#ifdef CONFIG_TARGET_AM654_A53_EVM
62 if (!strcmp(name, "k3-am654-base-board"))
63 return 0;
64#endif
65
66 return -1;
67}
68#endif