Rex-BC Chen | 73e6b8e | 2021-11-02 10:31:53 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/device.h> |
| 4 | #include <soc/emi.h> |
Rex-BC Chen | f8eed65 | 2021-11-11 15:50:42 +0800 | [diff] [blame] | 5 | #include <soc/mmu_operations.h> |
Rex-BC Chen | d8e8c87 | 2021-11-08 14:28:54 +0800 | [diff] [blame] | 6 | #include <soc/sspm.h> |
Rex-BC Chen | 73e6b8e | 2021-11-02 10:31:53 +0800 | [diff] [blame] | 7 | #include <symbols.h> |
| 8 | |
| 9 | static void soc_read_resources(struct device *dev) |
| 10 | { |
| 11 | ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB); |
| 12 | } |
| 13 | |
| 14 | static void soc_init(struct device *dev) |
| 15 | { |
Rex-BC Chen | f8eed65 | 2021-11-11 15:50:42 +0800 | [diff] [blame] | 16 | mtk_mmu_disable_l2c_sram(); |
Rex-BC Chen | d8e8c87 | 2021-11-08 14:28:54 +0800 | [diff] [blame] | 17 | sspm_init(); |
Rex-BC Chen | 73e6b8e | 2021-11-02 10:31:53 +0800 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | static struct device_operations soc_ops = { |
| 21 | .read_resources = soc_read_resources, |
| 22 | .init = soc_init, |
| 23 | }; |
| 24 | |
| 25 | static void enable_soc_dev(struct device *dev) |
| 26 | { |
| 27 | dev->ops = &soc_ops; |
| 28 | } |
| 29 | |
| 30 | struct chip_operations soc_mediatek_mt8186_ops = { |
| 31 | CHIP_NAME("SOC Mediatek MT8186") |
| 32 | .enable_dev = enable_soc_dev, |
| 33 | }; |