From d921e873b848e6b140a1793960c0e31dc08fc0d2 Mon Sep 17 00:00:00 2001 From: Mike Lin Date: Wed, 25 Dec 2024 17:52:17 +0800 Subject: [PATCH] soc/mediatek/mt8189: Reserve DRAM buffers for HW TX TRACKING HW TX tracking works by writing a pattern to the designated DRAM buffer and then reading it back automatically to calculate the appropriate TX time delay. To avoid writing the pattern to system-used memory, we need to permanently reserve last 64KB memory on each rank for the HW TX tracking feature. BUG=b:379008996 BRANCH=none TEST=Reserve memory ok Firmware shows the following log : 000000013fff0000-000000013fffffff: RESERVED 000000023fff0000-000000023fffffff: RESERVED Signed-off-by: Mike Lin Change-Id: I2ecfe42dc9f1882163d03f50cf9b5ff8e98c2972 Reviewed-on: https://review.coreboot.org/c/coreboot/+/87039 Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin --- src/soc/mediatek/mt8189/Makefile.mk | 1 + src/soc/mediatek/mt8189/soc.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index bdee1fb33e..7631bc6118 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -19,6 +19,7 @@ romstage-y += ../common/emi.c romstage-y += ../common/memory.c ../common/memory_test.c romstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c +ramstage-y += ../common/dramc_info.c ramstage-y += ../common/emi.c ramstage-y += ../common/memory.c ramstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c diff --git a/src/soc/mediatek/mt8189/soc.c b/src/soc/mediatek/mt8189/soc.c index e4dfc2312a..e53136d16b 100644 --- a/src/soc/mediatek/mt8189/soc.c +++ b/src/soc/mediatek/mt8189/soc.c @@ -1,9 +1,16 @@ /* SPDX-License-Identifier: GPL-2.0-only OR MIT */ +#include #include +#include #include #include +void bootmem_platform_add_ranges(void) +{ + reserve_buffer_for_dramc(); +} + static void soc_read_resources(struct device *dev) { ram_range(dev, 0, (uintptr_t)_dram, sdram_size());