1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2007-2018 Michal Simek
5 * Michal SIMEK <monstr@monstr.eu>
9 * This is a board specific file. It's OK to include board specific
17 #include <linux/sizes.h>
19 DECLARE_GLOBAL_DATA_PTR;
21 int dram_init_banksize(void)
23 return fdtdec_setup_memory_banksize();
28 if (fdtdec_setup_mem_size_base() != 0)
34 int board_late_init(void)
36 ulong max_size, lowmem_size;
38 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYSRESET_MICROBLAZE)
41 ret = device_bind_driver(gd->dm_root, "mb_soft_reset",
44 printf("Warning: No reset driver: ret=%d\n", ret);
47 if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
48 debug("Saved variables - Skipping\n");
52 max_size = gd->start_addr_sp - CONFIG_STACK_SIZE;
53 max_size = round_down(max_size, SZ_16M);
55 /* Linux default LOWMEM_SIZE is 0x30000000 = 768MB */
56 lowmem_size = gd->ram_base + 768 * 1024 * 1024;
58 env_set_addr("initrd_high", (void *)min_t(ulong, max_size,
60 env_set_addr("fdt_high", (void *)min_t(ulong, max_size, lowmem_size));