CK Hu | 958ab46 | 2020-04-07 12:06:31 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/device.h> |
| 4 | #include <soc/emi.h> |
CK Hu | 3398f315 | 2020-06-16 11:54:38 +0800 | [diff] [blame] | 5 | #include <soc/mmu_operations.h> |
CK Hu | 958ab46 | 2020-04-07 12:06:31 +0800 | [diff] [blame] | 6 | #include <symbols.h> |
| 7 | |
| 8 | static void soc_read_resources(struct device *dev) |
| 9 | { |
| 10 | ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB); |
| 11 | } |
| 12 | |
| 13 | static void soc_init(struct device *dev) |
| 14 | { |
CK Hu | 3398f315 | 2020-06-16 11:54:38 +0800 | [diff] [blame] | 15 | mtk_mmu_disable_l2c_sram(); |
CK Hu | 958ab46 | 2020-04-07 12:06:31 +0800 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | static struct device_operations soc_ops = { |
| 19 | .read_resources = soc_read_resources, |
| 20 | .init = soc_init, |
| 21 | }; |
| 22 | |
| 23 | static void enable_soc_dev(struct device *dev) |
| 24 | { |
| 25 | dev->ops = &soc_ops; |
| 26 | } |
| 27 | |
| 28 | struct chip_operations soc_mediatek_mt8192_ops = { |
| 29 | CHIP_NAME("SOC Mediatek MT8192") |
| 30 | .enable_dev = enable_soc_dev, |
| 31 | }; |