blob: db349e033cf9ab75c0b359f25b5332fd6b5639da [file] [log] [blame]
Angel Ponse67ab182020-04-04 18:51:11 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Yidi Lin3d7b6062015-07-31 17:10:40 +08002
Ting Shendff29e02019-01-28 18:15:00 +08003#include <bootmem.h>
Yidi Lin3d7b6062015-07-31 17:10:40 +08004#include <device/device.h>
Yidi Lin3d7b6062015-07-31 17:10:40 +08005#include <symbols.h>
Yidi Linc6d7dcc2016-02-04 17:26:48 +08006#include <soc/emi.h>
Yidi Lin3d7b6062015-07-31 17:10:40 +08007
Ting Shendff29e02019-01-28 18:15:00 +08008void bootmem_platform_add_ranges(void)
9{
10 bootmem_add_range(0x101000, 124 * KiB, BM_MEM_BL31);
11}
12
Elyes HAOUASb4426692018-05-25 10:09:55 +020013static void soc_read_resources(struct device *dev)
Yidi Lin3d7b6062015-07-31 17:10:40 +080014{
Kyösti Mälkki27d62992022-05-24 20:25:58 +030015 ram_resource_kb(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
Yidi Lin3d7b6062015-07-31 17:10:40 +080016}
17
Elyes HAOUASb4426692018-05-25 10:09:55 +020018static void soc_init(struct device *dev)
Yidi Lin3d7b6062015-07-31 17:10:40 +080019{
20}
21
22static struct device_operations soc_ops = {
23 .read_resources = soc_read_resources,
Yu-Ping Wu39e6f852022-03-14 16:53:59 +080024 .set_resources = noop_set_resources,
Yidi Lin3d7b6062015-07-31 17:10:40 +080025 .init = soc_init,
26};
27
Elyes HAOUASb4426692018-05-25 10:09:55 +020028static void enable_soc_dev(struct device *dev)
Yidi Lin3d7b6062015-07-31 17:10:40 +080029{
30 dev->ops = &soc_ops;
31}
32
33struct chip_operations soc_mediatek_mt8173_ops = {
Paul Menzel37277762016-07-03 09:45:26 +020034 CHIP_NAME("SOC Mediatek MT8173")
Yidi Lin47a9af42016-03-28 15:16:45 +080035 .enable_dev = enable_soc_dev,
Yidi Lin3d7b6062015-07-31 17:10:40 +080036};