blob: d43eb89d09aa6c5b5b59eb6679cce52ac69cf46e [file] [log] [blame]
Angel Pons582472c2020-07-25 13:19:58 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Asami Doif7952422019-06-11 16:01:31 +09002
3#include <cbmem.h>
4#include <ramdetect.h>
5#include <symbols.h>
6#include <device/device.h>
Patrick Rudolph792fd512020-01-23 14:10:07 +01007#include <bootmem.h>
8
9extern u8 _secram[], _esecram[];
10
11void bootmem_platform_add_ranges(void)
12{
13 bootmem_add_range((uintptr_t)_secram, REGION_SIZE(secram), BM_MEM_BL31);
14}
Asami Doif7952422019-06-11 16:01:31 +090015
16static void mainboard_enable(struct device *dev)
17{
18 int ram_size_mb = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
19 ram_resource(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB);
20}
21
22struct chip_operations mainboard_ops = {
23 .name = "qemu_aarch64",
24 .enable_dev = mainboard_enable,
25};
Kyösti Mälkki3ae17a42020-05-26 08:27:42 +030026
27struct chip_operations mainboard_emulation_qemu_aarch64_ops = { };