aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-05-07 16:04:16 -0700
committerAaron Durbin <adurbin@chromium.org>2020-05-14 15:06:15 +0000
commit1085fee761b381bbc2f9d18fb9cdc8a9e1c90884 (patch)
treed43761b7082ae3767b92a6d973b4b0af7fd1455a /src/soc/intel/common/block
parent6b95507ec5b087658178a325bdc68570bc48bb20 (diff)
soc/intel/common/block/systemagent: Use TOUUD as base for MMIO above 4G
This change sets the base for MMIO above 4G to TOUDD. It matches what is used by resource allocator if MMIO resources are allocated above 4G and also matches the expectation in northbridge.asl. This change also gets rid of the macro ABOVE_4GB_MEM_BASE_ADDRESS since it is now unused. BUG=b:149186922 TEST=Verified that kernel does not complain about MMIO windows above 4G. Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: Ibbbfbdad867735a43cf57c256bf206a3f040f383 Reviewed-on: https://review.coreboot.org/c/coreboot/+/41155 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/systemagent/systemagent.c59
1 files changed, 31 insertions, 28 deletions
diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c
index e7230bcbf4..3da837c0af 100644
--- a/src/soc/intel/common/block/systemagent/systemagent.c
+++ b/src/soc/intel/common/block/systemagent/systemagent.c
@@ -41,34 +41,6 @@ __weak unsigned long sa_write_acpi_tables(const struct device *dev,
}
/*
- * This function will get above 4GB mmio enable config specific to soc.
- *
- * Return values:
- * 0 = Above 4GB memory is not enable
- * 1 = Above 4GB memory is enable
- */
-static int get_enable_above_4GB_mmio(void)
-{
- const struct soc_intel_common_config *common_config;
- common_config = chip_get_common_soc_structure();
-
- return common_config->enable_above_4GB_mmio;
-}
-
-/* Fill MMIO resource above 4GB into GNVS */
-void sa_fill_gnvs(global_nvs_t *gnvs)
-{
- if (get_enable_above_4GB_mmio()) {
- gnvs->e4gm = 1;
- gnvs->a4gb = ABOVE_4GB_MEM_BASE_ADDRESS;
- gnvs->a4gs = ABOVE_4GB_MEM_BASE_SIZE;
- printk(BIOS_DEBUG,
- "PCI space above 4GB MMIO is from 0x%llx to len = 0x%llx\n",
- gnvs->a4gb, gnvs->a4gs);
- }
-}
-
-/*
* Add all known fixed MMIO ranges that hang off the host bridge/memory
* controller device.
*/
@@ -124,6 +96,37 @@ static void sa_read_map_entry(struct device *dev,
*result = value;
}
+/*
+ * This function will get above 4GB mmio enable config specific to soc.
+ *
+ * Return values:
+ * 0 = Above 4GB memory is not enable
+ * 1 = Above 4GB memory is enable
+ */
+static int get_enable_above_4GB_mmio(void)
+{
+ const struct soc_intel_common_config *common_config;
+ common_config = chip_get_common_soc_structure();
+
+ return common_config->enable_above_4GB_mmio;
+}
+
+/* Fill MMIO resource above 4GB into GNVS */
+void sa_fill_gnvs(global_nvs_t *gnvs)
+{
+ if (!get_enable_above_4GB_mmio())
+ return;
+
+ struct device *sa_dev = pcidev_path_on_root(SA_DEVFN_ROOT);
+
+ gnvs->e4gm = 1;
+ sa_read_map_entry(sa_dev, &sa_memory_map[SA_TOUUD_REG], &gnvs->a4gb);
+ gnvs->a4gs = ABOVE_4GB_MEM_BASE_SIZE;
+ printk(BIOS_DEBUG, "PCI space above 4GB MMIO is from 0x%llx to len = 0x%llx\n",
+ gnvs->a4gb, gnvs->a4gs);
+}
+
+
static void sa_get_mem_map(struct device *dev, uint64_t *values)
{
int i;