diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/mediatek/mt8186/Makefile.inc | 1 | ||||
-rw-r--r-- | src/soc/mediatek/mt8186/include/soc/dfd.h | 12 | ||||
-rw-r--r-- | src/soc/mediatek/mt8186/soc.c | 11 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8186/Makefile.inc b/src/soc/mediatek/mt8186/Makefile.inc index f99bd47d47..0d56f15009 100644 --- a/src/soc/mediatek/mt8186/Makefile.inc +++ b/src/soc/mediatek/mt8186/Makefile.inc @@ -46,6 +46,7 @@ romstage-y += ../common/rtc.c ../common/rtc_osc_init.c rtc.c ramstage-y += ../common/auxadc.c ramstage-y += ../common/ddp.c ddp.c ramstage-y += devapc.c +ramstage-y += ../common/dfd.c ramstage-y += ../common/dsi.c ../common/mtk_mipi_dphy.c ramstage-y += emi.c ramstage-y += ../common/flash_controller.c diff --git a/src/soc/mediatek/mt8186/include/soc/dfd.h b/src/soc/mediatek/mt8186/include/soc/dfd.h new file mode 100644 index 0000000000..b2f1388693 --- /dev/null +++ b/src/soc/mediatek/mt8186/include/soc/dfd.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_MT8186_DFD_H +#define SOC_MEDIATEK_MT8186_DFD_H + +#include <soc/dfd_common.h> + +/* DFD dump address and size need to be the same as defined in Kernel DTS. */ +#define DFD_DUMP_ADDRESS 0x6A000000 +#define DFD_DUMP_SIZE (1 * MiB) + +#endif diff --git a/src/soc/mediatek/mt8186/soc.c b/src/soc/mediatek/mt8186/soc.c index 3ad83f7a65..7686986e71 100644 --- a/src/soc/mediatek/mt8186/soc.c +++ b/src/soc/mediatek/mt8186/soc.c @@ -1,12 +1,20 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <bootmem.h> #include <device/device.h> #include <soc/devapc.h> +#include <soc/dfd.h> #include <soc/emi.h> #include <soc/mmu_operations.h> #include <soc/sspm.h> #include <symbols.h> +void bootmem_platform_add_ranges(void) +{ + if (CONFIG(MTK_DFD)) + bootmem_add_range(DFD_DUMP_ADDRESS, DFD_DUMP_SIZE, BM_MEM_RESERVED); +} + static void soc_read_resources(struct device *dev) { ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB); @@ -17,6 +25,9 @@ static void soc_init(struct device *dev) mtk_mmu_disable_l2c_sram(); sspm_init(); dapc_init(); + + if (CONFIG(MTK_DFD)) + dfd_init(); } static struct device_operations soc_ops = { |