Asami Doi | f795242 | 2019-06-11 16:01:31 +0900 | [diff] [blame] | 1 | /* |
Asami Doi | f795242 | 2019-06-11 16:01:31 +0900 | [diff] [blame] | 2 | * |
Asami Doi | f795242 | 2019-06-11 16:01:31 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #include <cbmem.h> |
| 8 | #include <ramdetect.h> |
| 9 | #include <symbols.h> |
| 10 | #include <device/device.h> |
Patrick Rudolph | 792fd51 | 2020-01-23 14:10:07 +0100 | [diff] [blame] | 11 | #include <bootmem.h> |
| 12 | |
| 13 | extern u8 _secram[], _esecram[]; |
| 14 | |
| 15 | void bootmem_platform_add_ranges(void) |
| 16 | { |
| 17 | bootmem_add_range((uintptr_t)_secram, REGION_SIZE(secram), BM_MEM_BL31); |
| 18 | } |
Asami Doi | f795242 | 2019-06-11 16:01:31 +0900 | [diff] [blame] | 19 | |
| 20 | static void mainboard_enable(struct device *dev) |
| 21 | { |
| 22 | int ram_size_mb = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB); |
| 23 | ram_resource(dev, 0, (uintptr_t)_dram / KiB, ram_size_mb * KiB); |
| 24 | } |
| 25 | |
| 26 | struct chip_operations mainboard_ops = { |
| 27 | .name = "qemu_aarch64", |
| 28 | .enable_dev = mainboard_enable, |
| 29 | }; |
Kyösti Mälkki | 3ae17a4 | 2020-05-26 08:27:42 +0300 | [diff] [blame] | 30 | |
| 31 | struct chip_operations mainboard_emulation_qemu_aarch64_ops = { }; |