1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2016 Imagination Technologies
8 #include <asm/global_data.h>
12 #include "boston-regs.h"
14 DECLARE_GLOBAL_DATA_PTR;
18 u32 ddrconf0 = __raw_readl((uint32_t *)BOSTON_PLAT_DDRCONF0);
20 gd->ram_size = (phys_size_t)(ddrconf0 & BOSTON_PLAT_DDRCONF0_SIZE) <<
26 phys_size_t board_get_usable_ram_top(phys_size_t total_size)
28 DECLARE_GLOBAL_DATA_PTR;
30 if (gd->ram_top < CFG_SYS_SDRAM_BASE) {
31 /* 2GB wrapped around to 0 */
32 return CKSEG0ADDR(256 << 20);
35 return min_t(unsigned long, gd->ram_top, CKSEG0ADDR(256 << 20));