2018-06-08 12:21:45 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright 2018 MediaTek Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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>
|
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();
|
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,
|
|
|
|
};
|