summaryrefslogtreecommitdiffstats
path: root/src/soc/mediatek/common/memory.c
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.com>2022-03-25 15:53:22 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-03-29 14:23:29 +0000
commitc69ea24ba8beb88c0d4948986e90769b6115d8bd (patch)
tree5f5e39c986fcafebfd48eeb29d38bcab0d7f307f /src/soc/mediatek/common/memory.c
parenta7477706a096af540a5ee0ef04d0fca921fdab45 (diff)
downloadcoreboot-c69ea24ba8beb88c0d4948986e90769b6115d8bd.tar.gz
coreboot-c69ea24ba8beb88c0d4948986e90769b6115d8bd.tar.bz2
coreboot-c69ea24ba8beb88c0d4948986e90769b6115d8bd.zip
soc/mediatek: Add a configurate "USE_CBMEM_DRAM_INFO"
The memory initialization reference code didn't support returning DRAM information in the old platforms, for example MT8192 and MT8195. So we have to add a new configuration USE_CBMEM_DRAM_INFO to make sure the common code will try to get DRAM information on new platforms supporting that. BUG=none TEST=build pass Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Change-Id: Iebe9ea0c1d01890b09fdf586813d85adde9702e1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63109 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek/common/memory.c')
-rw-r--r--src/soc/mediatek/common/memory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c
index 0850d0f71a39..ab1ccb5044a6 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);