Merge branch 'master' of git://git.denx.de/u-boot-uniphier
[oweals/u-boot.git] / board / ti / am65x / evm.c
1 // 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
14 DECLARE_GLOBAL_DATA_PTR;
15
16 int board_init(void)
17 {
18         return 0;
19 }
20
21 int 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
32 ulong 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
43 int 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 }
57
58 #ifdef CONFIG_SPL_LOAD_FIT
59 int 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