blob: 2b030bed957d67a3a79b52592dd580b3f001ece5 [file] [log] [blame]
Angel Ponse67ab182020-04-04 18:51:11 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Tristan Shieh0eb92df2018-06-08 18:21:45 +08002
3#include <device/device.h>
Tristan Shieh9315a042018-08-06 13:57:50 +08004#include <soc/emi.h>
Yanjie Jiang64dea2e2019-05-07 10:31:07 +08005#include <soc/md_ctrl.h>
Tristan Shieh0eb92df2018-06-08 18:21:45 +08006#include <soc/mmu_operations.h>
Weiyi Lue78d1402019-08-05 17:45:24 +08007#include <soc/rtc.h>
Erin Lobbeed7a2019-07-16 10:08:33 +08008#include <soc/sspm.h>
Tristan Shieh9315a042018-08-06 13:57:50 +08009#include <symbols.h>
10
Tristan Shieh9315a042018-08-06 13:57:50 +080011static void soc_read_resources(struct device *dev)
12{
Kyösti Mälkki27d62992022-05-24 20:25:58 +030013 ram_resource_kb(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
Tristan Shieh9315a042018-08-06 13:57:50 +080014}
Tristan Shieh0eb92df2018-06-08 18:21:45 +080015
16static void soc_init(struct device *dev)
17{
18 mtk_mmu_disable_l2c_sram();
Yanjie Jiang64dea2e2019-05-07 10:31:07 +080019 mtk_md_early_init();
Weiyi Lue78d1402019-08-05 17:45:24 +080020 mt6358_dcxo_disable_unused();
Erin Lobbeed7a2019-07-16 10:08:33 +080021 sspm_init();
Tristan Shieh0eb92df2018-06-08 18:21:45 +080022}
23
24static struct device_operations soc_ops = {
Tristan Shieh9315a042018-08-06 13:57:50 +080025 .read_resources = soc_read_resources,
Yu-Ping Wu39e6f852022-03-14 16:53:59 +080026 .set_resources = noop_set_resources,
Tristan Shieh0eb92df2018-06-08 18:21:45 +080027 .init = soc_init,
28};
29
30static void enable_soc_dev(struct device *dev)
31{
32 dev->ops = &soc_ops;
33}
34
35struct chip_operations soc_mediatek_mt8183_ops = {
36 CHIP_NAME("SOC Mediatek MT8183")
37 .enable_dev = enable_soc_dev,
38};