| 1 |
|
| 2 |
|
| 3 |
#include <bootmem.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <soc/dramc_info.h> |
| 6 |
#include <soc/emi.h> |
| 7 |
#include <soc/mcupm.h> |
| 8 |
#include <soc/mtk_fsp.h> |
| 9 |
#include <soc/pi_image.h> |
| 10 |
#include <soc/sspm.h> |
| 11 |
#include <symbols.h> |
| 12 |
|
| 13 |
void bootmem_platform_add_ranges(void) |
| 14 |
{ |
| 15 |
reserve_buffer_for_dramc(); |
| 16 |
} |
| 17 |
|
| 18 |
static void soc_read_resources(struct device *dev) |
| 19 |
{ |
| 20 |
ram_range(dev, 0, (uintptr_t)_dram, sdram_size()); |
| 21 |
} |
| 22 |
|
| 23 |
static void soc_init(struct device *dev) |
| 24 |
{ |
| 25 |
mtk_fsp_init(RAMSTAGE_SOC_INIT); |
| 26 |
pi_image_add_mtk_fsp_params(); |
| 27 |
mtk_fsp_load_and_run(); |
| 28 |
|
| 29 |
mcupm_init(); |
| 30 |
sspm_init(); |
| 31 |
} |
| 32 |
|
| 33 |
static struct device_operations soc_ops = { |
| 34 |
.read_resources = soc_read_resources, |
| 35 |
.set_resources = noop_set_resources, |
| 36 |
.init = soc_init, |
| 37 |
}; |
| 38 |
|
| 39 |
static void enable_soc_dev(struct device *dev) |
| 40 |
{ |
| 41 |
dev->ops = &soc_ops; |
| 42 |
} |
| 43 |
|
| 44 |
struct chip_operations soc_mediatek_mt8189_ops = { |
| 45 |
.name = "SOC Mediatek MT8189", |
| 46 |
.enable_dev = enable_soc_dev, |
| 47 |
}; |