cpu/intel/common: Define build time physical address reserved bits
According the Intel Software Developer Manual,
CPUID.80000008H:EAX[15:8] reports the physical-address width supported
by the processor. Unfortunately, it does not necessarily reflect the
physical-address space the system can actulally use as some of those
bits can be reserved for internal hardware use.
It is critical for coreboot to know the actual physical address size.
Overestimating this size can lead to device resource overlaps due to
the hardware ignoring upper reserved bits. On rex for instance, it
creates some reboot hangs due to an overlap between thunderbolt and
Input Output Manager (IOM) address space.
As some SoCs, such as Meteor Lake, have physical address reserved bits
which cannot be probed at runtime, this commit introduces
`CPU_INTEL_COMMON_RESERVED_PHYS_ADDR_BITS' Kconfig to set the number
of physical address reserved bits at compilation time for those SoCs.
A runtime detection by hardware probing will be attempted if the value
is 0 (default).
BUG=b:288978352
Change-Id: I8748fa3e5bdfd339e973d562c5a201d5616f813e
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78451
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
diff --git a/src/cpu/intel/common/Kconfig b/src/cpu/intel/common/Kconfig
index 51b8ccb..0f6bd68 100644
--- a/src/cpu/intel/common/Kconfig
+++ b/src/cpu/intel/common/Kconfig
@@ -31,6 +31,14 @@
config CPU_INTEL_COMMON_TIMEBASE
bool
+config CPU_INTEL_COMMON_RESERVED_PHYS_ADDR_BITS
+ int
+ help
+ Specify the number of physical address reserved bits. This
+ config can be set for SoCs with reserved bits which cannot
+ be probed at runtime. A runtime detection by hardware
+ probing will be attempted if the value is -1.
+
endif
config CPU_INTEL_COMMON_VOLTAGE
diff --git a/src/cpu/intel/common/common_init.c b/src/cpu/intel/common/common_init.c
index 55bc59e..83a21e0 100644
--- a/src/cpu/intel/common/common_init.c
+++ b/src/cpu/intel/common/common_init.c
@@ -258,6 +258,9 @@
unsigned int get_reserved_phys_addr_bits(void)
{
+ if (CONFIG_CPU_INTEL_COMMON_RESERVED_PHYS_ADDR_BITS)
+ return CONFIG_CPU_INTEL_COMMON_RESERVED_PHYS_ADDR_BITS;
+
if (!is_tme_supported())
return 0;