coreboot/src/cpu/x86
Michał Żygowski 04f83ff7dc cpu/x86/mtrr: Simplify MTRR solution calculation on AMD systems
AMD systems have a TOM2WB bit in SYS_CFG MSR to forcefully cover the
address space between 4GB-TOM2 as WB. Any WB MTRR that falls into that
range may be skipped from programming. It can save a lot of MTRRs when
calculating the MTRR solution. It is especially needed when using a
temporary MTRR to cover the flash as WP, as the MTRR space gets more
fragmented.

Add checks for SYS_CFG TOM2WB in the MTRR driver and skip the WB MTRR
ranges when possible.

TEST=Successfully enable temporary MTRR range for flash on Gigabyte
MZ33-AR1.

Change-Id: Ie9af9b54a1037c843d8f019506af761a8d8769d0
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89199
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-12-11 00:11:52 +00:00
..
64bit arch/x86: Unify GDT entries 2025-05-08 12:29:24 +00:00
cache cpu/x86: Conditionally invalidate caches based on self-snooping support 2025-04-09 02:07:32 +00:00
lapic cpu/x86/lapic/lapic.c: Set spurious interrupt vector to 0xF 2025-12-11 00:10:44 +00:00
mtrr cpu/x86/mtrr: Simplify MTRR solution calculation on AMD systems 2025-12-11 00:11:52 +00:00
name cpu: Rename Makefiles from .inc to .mk 2024-01-24 08:35:01 +00:00
pae cpu/x86/pae/pgtbl.c: extract reusable code from memset_pae() 2024-05-29 13:04:30 +00:00
smm cpu/x86/smm/smm_module_loader: Install bigger page tables 2025-05-14 18:09:28 +00:00
tsc cpu: Rename Makefiles from .inc to .mk 2024-01-24 08:35:01 +00:00
backup_default_smm.c
copy_data_section.inc soc/amd/common/block/cpu/noncar: Move BSS and DATA out of PT_LOAD 2025-07-18 16:50:07 +00:00
early_reset.S
entry16.S cpu/x86/entry16.S: Move reset vector to this file 2025-09-02 17:06:35 +00:00
entry32.S arch/x86: Unify GDT entries 2025-05-08 12:29:24 +00:00
Kconfig cpu/x86/Kconfig: Remove SOC_SETS_MSRS option 2025-12-09 16:28:05 +00:00
Kconfig.debug_cpu arch to cpu: Add SPDX license headers to Kconfig files 2024-02-18 01:58:52 +00:00
Makefile.mk cpu/x86/entry16.S: Move reset vector to this file 2025-09-02 17:06:35 +00:00
mp_init.c cpu/x86/mp_init: Refactor ICR wait logic 2025-08-19 20:56:58 +00:00
sipi_vector.S arch/x86: Unify GDT entries 2025-05-08 12:29:24 +00:00
smi_trigger.c cpu/x86/smi_trigger: use call_smm 2024-01-11 22:35:32 +00:00
smm_start32_offset.h.template
topology.c cpu/x86/topology: Add tile and die ID CPU topology fields 2025-10-13 17:09:18 +00:00