Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2015 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. |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 14 | */ |
| 15 | |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 16 | #include <device/device.h> |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 17 | #include <symbols.h> |
Yidi Lin | c6d7dcc | 2016-02-04 17:26:48 +0800 | [diff] [blame] | 18 | #include <soc/emi.h> |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 19 | |
Elyes HAOUAS | b442669 | 2018-05-25 10:09:55 +0200 | [diff] [blame] | 20 | static void soc_read_resources(struct device *dev) |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 21 | { |
Yidi Lin | c6d7dcc | 2016-02-04 17:26:48 +0800 | [diff] [blame] | 22 | ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB); |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 23 | } |
| 24 | |
Elyes HAOUAS | b442669 | 2018-05-25 10:09:55 +0200 | [diff] [blame] | 25 | static void soc_init(struct device *dev) |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 26 | { |
| 27 | } |
| 28 | |
| 29 | static struct device_operations soc_ops = { |
| 30 | .read_resources = soc_read_resources, |
| 31 | .init = soc_init, |
| 32 | }; |
| 33 | |
Elyes HAOUAS | b442669 | 2018-05-25 10:09:55 +0200 | [diff] [blame] | 34 | static void enable_soc_dev(struct device *dev) |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 35 | { |
| 36 | dev->ops = &soc_ops; |
| 37 | } |
| 38 | |
| 39 | struct chip_operations soc_mediatek_mt8173_ops = { |
Paul Menzel | 3727776 | 2016-07-03 09:45:26 +0200 | [diff] [blame] | 40 | CHIP_NAME("SOC Mediatek MT8173") |
Yidi Lin | 47a9af4 | 2016-03-28 15:16:45 +0800 | [diff] [blame] | 41 | .enable_dev = enable_soc_dev, |
Yidi Lin | 3d7b606 | 2015-07-31 17:10:40 +0800 | [diff] [blame] | 42 | }; |