blob: 44b56416ff91432c392335f403381d98da0e66d9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Paul Burtona315bcd2017-04-30 21:22:42 +02002/*
3 * Copyright (C) 2016 Imagination Technologies
Paul Burtona315bcd2017-04-30 21:22:42 +02004 */
5
6#include <common.h>
7#include <fdt_support.h>
8
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +09009int ft_board_setup(void *blob, struct bd_info *bd)
Paul Burtona315bcd2017-04-30 21:22:42 +020010{
11 DECLARE_GLOBAL_DATA_PTR;
12 u64 mem_start[2], mem_size[2];
13 int mem_regions;
14
15 mem_start[0] = 0;
16 mem_size[0] = min_t(u64, 256llu << 20, gd->ram_size);
17 mem_regions = 1;
18
19 if (gd->ram_size > mem_size[0]) {
20 mem_start[1] = 0x80000000 + mem_size[0];
21 mem_size[1] = gd->ram_size - mem_size[0];
22 mem_regions++;
23 }
24
25 return fdt_fixup_memory_banks(blob, mem_start, mem_size, mem_regions);
26}