summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/mediatek/common/Kconfig6
-rw-r--r--src/soc/mediatek/common/memory.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/Kconfig b/src/soc/mediatek/common/Kconfig
index cd3b2a223b..2adb34458d 100644
--- a/src/soc/mediatek/common/Kconfig
+++ b/src/soc/mediatek/common/Kconfig
@@ -50,4 +50,10 @@ config MTK_DFD
and dumps to internal RAM on the WDT reset. We reserve 1MB on DRAM
to store logs of DFD.
+config USE_CBMEM_DRAM_INFO
+ bool "Support filling dram information to cbmem"
+ help
+ The DRAM initialization will keep and return DRAM information (size,
+ geometry and other DDR info) so we can fill that into the CBMEM.
+
endif
diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c
index 0850d0f71a..ab1ccb5044 100644
--- a/src/soc/mediatek/common/memory.c
+++ b/src/soc/mediatek/common/memory.c
@@ -134,6 +134,12 @@ static void add_mem_chip_info(int unused)
struct mem_chip_info *mc;
size_t size;
+ if (!CONFIG(USE_CBMEM_DRAM_INFO)) {
+ printk(BIOS_DEBUG,
+ "DRAM-K: CBMEM DRAM info is unsupported (USE_CBMEM_DRAM_INFO)\n");
+ return;
+ }
+
size = sizeof(*mc) + sizeof(struct mem_chip_channel) * CHANNEL_MAX;
mc = cbmem_add(CBMEM_ID_MEM_CHIP_INFO, size);
assert(mc);