blob: 51b121ce05f31319364c98f0fd5a64dc6e8cfa98 [file] [log] [blame]
Lokesh Vutla1a9dd212019-06-13 10:29:49 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Board specific initialization for J721E EVM
4 *
5 * Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
6 * Lokesh Vutla <lokeshvutla@ti.com>
7 *
8 */
9
10#include <common.h>
Simon Glass6980b6b2019-11-14 12:57:45 -070011#include <init.h>
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053012#include <asm/io.h>
13#include <spl.h>
Suman Anna8eac9e62019-06-13 10:29:50 +053014#include <asm/arch/sys_proto.h>
Lokesh Vutla1a9dd212019-06-13 10:29:49 +053015
16DECLARE_GLOBAL_DATA_PTR;
17
18int board_init(void)
19{
20 return 0;
21}
22
23int dram_init(void)
24{
25#ifdef CONFIG_PHYS_64BIT
26 gd->ram_size = 0x100000000;
27#else
28 gd->ram_size = 0x80000000;
29#endif
30
31 return 0;
32}
33
34ulong board_get_usable_ram_top(ulong total_size)
35{
36#ifdef CONFIG_PHYS_64BIT
37 /* Limit RAM used by U-Boot to the DDR low region */
38 if (gd->ram_top > 0x100000000)
39 return 0x100000000;
40#endif
41
42 return gd->ram_top;
43}
44
45int dram_init_banksize(void)
46{
47 /* Bank 0 declares the memory available in the DDR low region */
48 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
49 gd->bd->bi_dram[0].size = 0x80000000;
50 gd->ram_size = 0x80000000;
51
52#ifdef CONFIG_PHYS_64BIT
53 /* Bank 1 declares the memory available in the DDR high region */
54 gd->bd->bi_dram[1].start = CONFIG_SYS_SDRAM_BASE1;
55 gd->bd->bi_dram[1].size = 0x80000000;
56 gd->ram_size = 0x100000000;
57#endif
58
59 return 0;
60}
61
62#ifdef CONFIG_SPL_LOAD_FIT
63int board_fit_config_name_match(const char *name)
64{
65 if (!strcmp(name, "k3-j721e-common-proc-board"))
66 return 0;
67
68 return -1;
69}
70#endif
Suman Anna8eac9e62019-06-13 10:29:50 +053071
72#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
73int ft_board_setup(void *blob, bd_t *bd)
74{
75 int ret;
76
77 ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", "sram@70000000");
78 if (ret)
79 printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
80
81 return ret;
82}
83#endif