blob: 874a21cec61ed5ee7d63208efb72a8543b1b024b [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
Paul Burtona315bcd2017-04-30 21:22:42 +02006#include <fdt_support.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06007#include <asm/global_data.h>
Paul Burtona315bcd2017-04-30 21:22:42 +02008
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}