summaryrefslogtreecommitdiff
path: root/src/northbridge/intel/x4x
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2018-08-06 15:35:28 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-10-24 10:00:31 +0000
commit17ad4598e9d3d302cc45c86a8e11aac62928c83c (patch)
treec2f108634585b63c50822e5bdaa2ee57291d105e /src/northbridge/intel/x4x
parent794f56bdf5acc5d153472bb583d51bb9fe56166f (diff)
nb/intel/*: Account for cbmem_top alignment
Having cbmem floating between two ram regions is a bad idea and some payloads (e.g. tianocore) even bail out on this. To overcome this issue mark the region between tom and cbmem as uma. Change-Id: Ifab37b0003f09a680024d5b155ab0bb157920952 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/27871 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/northbridge/intel/x4x')
-rw-r--r--src/northbridge/intel/x4x/northbridge.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/northbridge/intel/x4x/northbridge.c b/src/northbridge/intel/x4x/northbridge.c
index d1926b29f9..bc7a5b39ae 100644
--- a/src/northbridge/intel/x4x/northbridge.c
+++ b/src/northbridge/intel/x4x/northbridge.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <cbmem.h>
#include <console/console.h>
#include <arch/io.h>
#include <stdint.h>
@@ -35,7 +36,7 @@ static void mch_domain_read_resources(struct device *dev)
{
u8 index, reg8;
u64 tom, touud;
- u32 tomk, tseg_sizek = 0, tolud;
+ u32 tomk, tseg_sizek = 0, tolud, delta_cbmem;
u32 pcie_config_base, pcie_config_size;
u32 uma_sizek = 0;
@@ -100,6 +101,15 @@ static void mch_domain_read_resources(struct device *dev)
printk(BIOS_DEBUG, "%dM\n", tseg_sizek >> 10);
+ /* cbmem_top can be shifted downwards due to alignment.
+ Mark the region between cbmem_top and tomk as unusable */
+ delta_cbmem = tomk - ((uint32_t)cbmem_top() >> 10);
+ tomk -= delta_cbmem;
+ uma_sizek += delta_cbmem;
+
+ printk(BIOS_DEBUG, "Unused RAM between cbmem_top and TOM: 0x%xK\n",
+ delta_cbmem);
+
printk(BIOS_INFO, "Available memory below 4GB: %uM\n", tomk >> 10);
/* Report the memory regions */