blob: cd161e874ab5c17a272cf98f9cc7ba96a2754f03 [file] [log] [blame]
Yidi Lin24ea3f32021-01-07 20:25:54 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <device/device.h>
4#include <soc/emi.h>
Yidi Lin27be9042021-03-25 17:50:14 +08005#include <soc/mmu_operations.h>
Yidi Linbe8621d2021-04-19 16:06:55 +08006#include <soc/ufs.h>
Yidi Lin24ea3f32021-01-07 20:25:54 +08007#include <symbols.h>
8
9static void soc_read_resources(struct device *dev)
10{
11 ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
12}
13
14static void soc_init(struct device *dev)
15{
Yidi Lin27be9042021-03-25 17:50:14 +080016 mtk_mmu_disable_l2c_sram();
Yidi Linbe8621d2021-04-19 16:06:55 +080017 ufs_disable_refclk();
Yidi Lin24ea3f32021-01-07 20:25:54 +080018}
19
20static struct device_operations soc_ops = {
21 .read_resources = soc_read_resources,
22 .init = soc_init,
23};
24
25static void enable_soc_dev(struct device *dev)
26{
27 dev->ops = &soc_ops;
28}
29
30struct chip_operations soc_mediatek_mt8195_ops = {
31 CHIP_NAME("SOC Mediatek MT8195")
32 .enable_dev = enable_soc_dev,
33};