1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <soc/cpu_input_gating.h>
7 #include <soc/devapc.h>
11 #include <soc/mcupm.h>
12 #include <soc/mmu_operations.h>
17 #define OPTEE_ADDRESS 0x43000000
18 #define OPTEE_SIZE (70 * MiB)
20 void bootmem_platform_add_ranges(void)
23 bootmem_add_range(DFD_DUMP_ADDRESS
, DFD_DUMP_SIZE
, BM_MEM_RESERVED
);
24 if (CONFIG(ARM64_BL31_OPTEE_WITH_SMC
))
25 bootmem_add_range(OPTEE_ADDRESS
, OPTEE_SIZE
, BM_MEM_RESERVED
);
28 static void soc_read_resources(struct device
*dev
)
30 ram_range(dev
, 0, (uintptr_t)_dram
, sdram_size());
33 static void soc_init(struct device
*dev
)
35 mtk_mmu_disable_l2c_sram();
37 disable_cpu_input_gating();
44 printk(BIOS_ERR
, "dpm init failed, DVFS may not work\n");
47 * For MT8188, SPM will handshake with DPM to do initialization, so
48 * this must run after dpm_init().
51 printk(BIOS_ERR
, "spm init failed, system suspend may not work\n");
57 static struct device_operations soc_ops
= {
58 .read_resources
= soc_read_resources
,
59 .set_resources
= noop_set_resources
,
63 static void enable_soc_dev(struct device
*dev
)
68 struct chip_operations soc_mediatek_mt8188_ops
= {
69 .name
= "SOC Mediatek MT8188",
70 .enable_dev
= enable_soc_dev
,