Yidi Lin | 24ea3f3 | 2021-01-07 20:25:54 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/device.h> |
Nina Wu | c25aa5b | 2021-06-21 09:13:19 +0800 | [diff] [blame] | 4 | #include <soc/devapc.h> |
Yidi Lin | 24ea3f3 | 2021-01-07 20:25:54 +0800 | [diff] [blame] | 5 | #include <soc/emi.h> |
Rex-BC Chen | 8316db2 | 2021-08-13 16:34:26 +0800 | [diff] [blame] | 6 | #include <soc/hdmi.h> |
alex.miao | 4a2887f | 2021-05-17 21:58:55 +0800 | [diff] [blame] | 7 | #include <soc/mcupm.h> |
Yidi Lin | 27be904 | 2021-03-25 17:50:14 +0800 | [diff] [blame] | 8 | #include <soc/mmu_operations.h> |
Rex-BC Chen | ab2cbf7 | 2021-05-03 20:44:09 +0800 | [diff] [blame] | 9 | #include <soc/sspm.h> |
Yidi Lin | be8621d | 2021-04-19 16:06:55 +0800 | [diff] [blame] | 10 | #include <soc/ufs.h> |
Yidi Lin | 24ea3f3 | 2021-01-07 20:25:54 +0800 | [diff] [blame] | 11 | #include <symbols.h> |
| 12 | |
| 13 | static void soc_read_resources(struct device *dev) |
| 14 | { |
| 15 | ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB); |
| 16 | } |
| 17 | |
| 18 | static void soc_init(struct device *dev) |
| 19 | { |
Yidi Lin | 27be904 | 2021-03-25 17:50:14 +0800 | [diff] [blame] | 20 | mtk_mmu_disable_l2c_sram(); |
Nina Wu | c25aa5b | 2021-06-21 09:13:19 +0800 | [diff] [blame] | 21 | dapc_init(); |
alex.miao | 4a2887f | 2021-05-17 21:58:55 +0800 | [diff] [blame] | 22 | mcupm_init(); |
Rex-BC Chen | ab2cbf7 | 2021-05-03 20:44:09 +0800 | [diff] [blame] | 23 | sspm_init(); |
Yidi Lin | be8621d | 2021-04-19 16:06:55 +0800 | [diff] [blame] | 24 | ufs_disable_refclk(); |
Rex-BC Chen | 8316db2 | 2021-08-13 16:34:26 +0800 | [diff] [blame] | 25 | hdmi_low_power_setting(); |
Yidi Lin | 24ea3f3 | 2021-01-07 20:25:54 +0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | static struct device_operations soc_ops = { |
| 29 | .read_resources = soc_read_resources, |
| 30 | .init = soc_init, |
| 31 | }; |
| 32 | |
| 33 | static void enable_soc_dev(struct device *dev) |
| 34 | { |
| 35 | dev->ops = &soc_ops; |
| 36 | } |
| 37 | |
| 38 | struct chip_operations soc_mediatek_mt8195_ops = { |
| 39 | CHIP_NAME("SOC Mediatek MT8195") |
| 40 | .enable_dev = enable_soc_dev, |
| 41 | }; |