blob: bf9e8e794e565a65ab00c3b0be2db4db66dae69a [file] [log] [blame]
CK Hu958ab462020-04-07 12:06:31 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <device/device.h>
4#include <soc/emi.h>
Yidi Linf4bf8f5f2020-07-29 19:18:38 +08005#include <soc/mcupm.h>
CK Hu3398f3152020-06-16 11:54:38 +08006#include <soc/mmu_operations.h>
TingHan.Shenbe404c22020-11-20 14:42:23 +08007#include <soc/sspm.h>
CK Hu958ab462020-04-07 12:06:31 +08008#include <symbols.h>
9
10static void soc_read_resources(struct device *dev)
11{
12 ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
13}
14
15static void soc_init(struct device *dev)
16{
CK Hu3398f3152020-06-16 11:54:38 +080017 mtk_mmu_disable_l2c_sram();
Yidi Linf4bf8f5f2020-07-29 19:18:38 +080018 mcupm_init();
TingHan.Shenbe404c22020-11-20 14:42:23 +080019 sspm_init();
CK Hu958ab462020-04-07 12:06:31 +080020}
21
22static struct device_operations soc_ops = {
23 .read_resources = soc_read_resources,
24 .init = soc_init,
25};
26
27static void enable_soc_dev(struct device *dev)
28{
29 dev->ops = &soc_ops;
30}
31
32struct chip_operations soc_mediatek_mt8192_ops = {
33 CHIP_NAME("SOC Mediatek MT8192")
34 .enable_dev = enable_soc_dev,
35};