blob: 501ae19583a87de05fe8832b51b9b270794fff36 [file] [log] [blame]
Tristan Shieh0eb92df2018-06-08 18:21:45 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2018 MediaTek Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <device/device.h>
Tristan Shieh9315a042018-08-06 13:57:50 +080017#include <soc/emi.h>
Yanjie Jiang64dea2e2019-05-07 10:31:07 +080018#include <soc/md_ctrl.h>
Tristan Shieh0eb92df2018-06-08 18:21:45 +080019#include <soc/mmu_operations.h>
Tristan Shieh9315a042018-08-06 13:57:50 +080020#include <symbols.h>
21
Tristan Shieh9315a042018-08-06 13:57:50 +080022static void soc_read_resources(struct device *dev)
23{
24 ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
25}
Tristan Shieh0eb92df2018-06-08 18:21:45 +080026
27static void soc_init(struct device *dev)
28{
29 mtk_mmu_disable_l2c_sram();
Yanjie Jiang64dea2e2019-05-07 10:31:07 +080030 mtk_md_early_init();
Tristan Shieh0eb92df2018-06-08 18:21:45 +080031}
32
33static struct device_operations soc_ops = {
Tristan Shieh9315a042018-08-06 13:57:50 +080034 .read_resources = soc_read_resources,
Tristan Shieh0eb92df2018-06-08 18:21:45 +080035 .init = soc_init,
36};
37
38static void enable_soc_dev(struct device *dev)
39{
40 dev->ops = &soc_ops;
41}
42
43struct chip_operations soc_mediatek_mt8183_ops = {
44 CHIP_NAME("SOC Mediatek MT8183")
45 .enable_dev = enable_soc_dev,
46};