| 1 |
|
| 2 |
|
| 3 |
#include <bootmem.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <soc/adsp.h> |
| 6 |
#include <soc/devapc.h> |
| 7 |
#include <soc/dfd.h> |
| 8 |
#include <soc/emi.h> |
| 9 |
#include <soc/mmu_operations.h> |
| 10 |
#include <soc/mtcmos.h> |
| 11 |
#include <soc/sspm.h> |
| 12 |
#include <symbols.h> |
| 13 |
|
| 14 |
void bootmem_platform_add_ranges(void) |
| 15 |
{ |
| 16 |
if (CONFIG(MTK_DFD)) |
| 17 |
bootmem_add_range(DFD_DUMP_ADDRESS, DFD_DUMP_SIZE, BM_MEM_RESERVED); |
| 18 |
} |
| 19 |
|
| 20 |
static void soc_read_resources(struct device *dev) |
| 21 |
{ |
| 22 |
ram_range(dev, 0, (uintptr_t)_dram, sdram_size()); |
| 23 |
} |
| 24 |
|
| 25 |
static void soc_init(struct device *dev) |
| 26 |
{ |
| 27 |
mtk_mmu_disable_l2c_sram(); |
| 28 |
sspm_init(); |
| 29 |
|
| 30 |
|
| 31 |
mtcmos_adsp_power_on(); |
| 32 |
mtcmos_protect_adsp_bus(); |
| 33 |
mtk_adsp_init(); |
| 34 |
|
| 35 |
dapc_init(); |
| 36 |
|
| 37 |
if (CONFIG(MTK_DFD)) |
| 38 |
dfd_init(); |
| 39 |
} |
| 40 |
|
| 41 |
static struct device_operations soc_ops = { |
| 42 |
.read_resources = soc_read_resources, |
| 43 |
.set_resources = noop_set_resources, |
| 44 |
.init = soc_init, |
| 45 |
}; |
| 46 |
|
| 47 |
static void enable_soc_dev(struct device *dev) |
| 48 |
{ |
| 49 |
dev->ops = &soc_ops; |
| 50 |
} |
| 51 |
|
| 52 |
struct chip_operations soc_mediatek_mt8186_ops = { |
| 53 |
.name = "SOC Mediatek MT8186", |
| 54 |
.enable_dev = enable_soc_dev, |
| 55 |
}; |