2020-04-04 18:51:11 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2018-06-08 12:21:45 +02:00
|
|
|
|
|
|
|
#include <device/device.h>
|
2018-08-06 07:57:50 +02:00
|
|
|
#include <soc/emi.h>
|
2019-05-07 04:31:07 +02:00
|
|
|
#include <soc/md_ctrl.h>
|
2018-06-08 12:21:45 +02:00
|
|
|
#include <soc/mmu_operations.h>
|
2019-08-05 11:45:24 +02:00
|
|
|
#include <soc/rtc.h>
|
2019-07-16 04:08:33 +02:00
|
|
|
#include <soc/sspm.h>
|
2018-08-06 07:57:50 +02:00
|
|
|
#include <symbols.h>
|
|
|
|
|
|
|
|
static void soc_read_resources(struct device *dev)
|
|
|
|
{
|
|
|
|
ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
|
|
|
|
}
|
2018-06-08 12:21:45 +02:00
|
|
|
|
|
|
|
static void soc_init(struct device *dev)
|
|
|
|
{
|
|
|
|
mtk_mmu_disable_l2c_sram();
|
2019-05-07 04:31:07 +02:00
|
|
|
mtk_md_early_init();
|
2019-08-05 11:45:24 +02:00
|
|
|
mt6358_dcxo_disable_unused();
|
2019-07-16 04:08:33 +02:00
|
|
|
sspm_init();
|
2018-06-08 12:21:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct device_operations soc_ops = {
|
2018-08-06 07:57:50 +02:00
|
|
|
.read_resources = soc_read_resources,
|
2018-06-08 12:21:45 +02:00
|
|
|
.init = soc_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void enable_soc_dev(struct device *dev)
|
|
|
|
{
|
|
|
|
dev->ops = &soc_ops;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct chip_operations soc_mediatek_mt8183_ops = {
|
|
|
|
CHIP_NAME("SOC Mediatek MT8183")
|
|
|
|
.enable_dev = enable_soc_dev,
|
|
|
|
};
|