1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <device/device.h>
5 #include <program_loading.h>
9 int payload_arch_usable_ram_quirk(uint64_t start
, uint64_t size
)
11 if (size
> REGION_SIZE(sram
))
14 if (start
>= (uintptr_t)_sram
&& (start
+ size
) <= (uintptr_t)_esram
) {
15 printk(BIOS_DEBUG
, "MT8173 uses SRAM for loading BL31.\n");
22 void bootmem_platform_add_ranges(void)
24 bootmem_add_range(0x101000, 124 * KiB
, BM_MEM_BL31
);
27 static void soc_read_resources(struct device
*dev
)
29 ram_range(dev
, 0, (uintptr_t)_dram
, sdram_size());
32 static void soc_init(struct device
*dev
)
36 static struct device_operations soc_ops
= {
37 .read_resources
= soc_read_resources
,
38 .set_resources
= noop_set_resources
,
42 static void enable_soc_dev(struct device
*dev
)
47 struct chip_operations soc_mediatek_mt8173_ops
= {
48 .name
= "SOC Mediatek MT8173",
49 .enable_dev
= enable_soc_dev
,