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