blob: 181536ce031db11b4120304cdba3cb6b3ac0a47e [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
Asami Doif7952422019-06-11 16:01:31 +09003#include <ramdetect.h>
4#include <symbols.h>
5#include <device/device.h>
Patrick Rudolph792fd512020-01-23 14:10:07 +01006#include <bootmem.h>
7
Patrick Rudolph792fd512020-01-23 14:10:07 +01008void bootmem_platform_add_ranges(void)
9{
Julius Werner82d16b12020-12-30 15:51:10 -080010 bootmem_add_range((uintptr_t)_bl31, REGION_SIZE(bl31), BM_MEM_BL31);
Patrick Rudolph792fd512020-01-23 14:10:07 +010011}
Asami Doif7952422019-06-11 16:01:31 +090012
13static void mainboard_enable(struct device *dev)
14{
15 int ram_size_mb = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
Kyösti Mälkki27d62992022-05-24 20:25:58 +030016 ram_resource_kb(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB);
Asami Doif7952422019-06-11 16:01:31 +090017}
18
19struct chip_operations mainboard_ops = {
Asami Doif7952422019-06-11 16:01:31 +090020 .enable_dev = mainboard_enable,
21};
Kyösti Mälkki3ae17a42020-05-26 08:27:42 +030022
23struct chip_operations mainboard_emulation_qemu_aarch64_ops = { };