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