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
20 #include <linux/sizes.h>
22 DECLARE_GLOBAL_DATA_PTR;
24 int dram_init_banksize(void)
26 return fdtdec_setup_memory_banksize();
31 if (fdtdec_setup_mem_size_base() != 0)
37 int board_late_init(void)
39 ulong max_size, lowmem_size;
41 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYSRESET_MICROBLAZE)
44 ret = device_bind_driver(gd->dm_root, "mb_soft_reset",
47 printf("Warning: No reset driver: ret=%d\n", ret);
50 if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
51 debug("Saved variables - Skipping\n");
55 max_size = gd->start_addr_sp - CONFIG_STACK_SIZE;
56 max_size = round_down(max_size, SZ_16M);
58 /* Linux default LOWMEM_SIZE is 0x30000000 = 768MB */
59 lowmem_size = gd->ram_base + 768 * 1024 * 1024;
61 env_set_addr("initrd_high", (void *)min_t(ulong, max_size,
63 env_set_addr("fdt_high", (void *)min_t(ulong, max_size, lowmem_size));