Patrick Georgi merged this change.
soc/intel/apollolake: Don't use CAR_GLOBAL
All platforms using this code have NO_CAR_GLOBAL_MIGRATION.
Change-Id: I0f393385aa94f18c2e05af3b5a54999575323d18
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/30510
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
---
M src/soc/intel/apollolake/meminit.c
M src/soc/intel/apollolake/mmap_boot.c
M src/soc/intel/apollolake/romstage.c
3 files changed, 15 insertions(+), 28 deletions(-)
diff --git a/src/soc/intel/apollolake/meminit.c b/src/soc/intel/apollolake/meminit.c
index 038fa9f..219b661 100644
--- a/src/soc/intel/apollolake/meminit.c
+++ b/src/soc/intel/apollolake/meminit.c
@@ -12,7 +12,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
-#include <arch/early_variables.h>
#include <console/console.h>
#include <fsp/util.h>
#include <memory_info.h>
@@ -21,11 +20,11 @@
#include <fsp/soc_binding.h>
#include <string.h>
-static size_t memory_size_mib CAR_GLOBAL;
+static size_t memory_size_mib;
size_t memory_in_system_in_mib(void)
{
- return car_get_var(memory_size_mib);
+ return memory_size_mib;
}
static void accumulate_channel_memory(int density, int dual_rank)
@@ -61,7 +60,7 @@
sz *= GiB / MiB;
- car_set_var(memory_size_mib, car_get_var(memory_size_mib) + sz);
+ memory_size_mib += sz;
}
size_t iohole_in_mib(void)
diff --git a/src/soc/intel/apollolake/mmap_boot.c b/src/soc/intel/apollolake/mmap_boot.c
index 1c3077e..614b603 100644
--- a/src/soc/intel/apollolake/mmap_boot.c
+++ b/src/soc/intel/apollolake/mmap_boot.c
@@ -16,7 +16,6 @@
* GNU General Public License for more details.
*/
-#include <arch/early_variables.h>
#include <boot_device.h>
#include <cbfs.h>
#include <commonlib/region.h>
@@ -57,17 +56,17 @@
*
*/
-static size_t bios_size CAR_GLOBAL;
+static size_t bios_size;
-static struct mem_region_device shadow_dev CAR_GLOBAL;
-static struct xlate_region_device real_dev CAR_GLOBAL;
+static struct mem_region_device shadow_dev;
+static struct xlate_region_device real_dev;
static void bios_mmap_init(void)
{
size_t size, start, bios_mapped_size;
uintptr_t base;
- size = car_get_var(bios_size);
+ size = bios_size;
/* If bios_size is initialized, then bail out. */
if (size != 0)
@@ -83,34 +82,25 @@
*/
bios_mapped_size = size - 256 * KiB;
- struct mem_region_device *shadow_dev_ptr;
- struct xlate_region_device *real_dev_ptr;
- shadow_dev_ptr = car_get_var_ptr(&shadow_dev);
- real_dev_ptr = car_get_var_ptr(&real_dev);
-
- mem_region_device_ro_init(shadow_dev_ptr, (void *)base,
+ mem_region_device_ro_init(&shadow_dev, (void *)base,
bios_mapped_size);
- xlate_region_device_ro_init(real_dev_ptr, &shadow_dev_ptr->rdev,
+ xlate_region_device_ro_init(&real_dev, &shadow_dev.rdev,
start, bios_mapped_size,
CONFIG_ROM_SIZE);
- car_set_var(bios_size, size);
+ bios_size = size;
}
const struct region_device *boot_device_ro(void)
{
bios_mmap_init();
- struct xlate_region_device *real_dev_ptr;
- real_dev_ptr = car_get_var_ptr(&real_dev);
-
- return &real_dev_ptr->rdev;
+ return &real_dev.rdev;
}
static int iafw_boot_region_properties(struct cbfs_props *props)
{
- struct xlate_region_device *real_dev_ptr;
struct region *real_dev_reg;
struct region regn;
@@ -123,8 +113,7 @@
/* Check that we are within the memory mapped area. It's too
easy to forget the SRAM mapping when crafting an FMAP file. */
- real_dev_ptr = car_get_var_ptr(&real_dev);
- real_dev_reg = &real_dev_ptr->sub_region;
+ real_dev_reg = &real_dev.sub_region;
if (region_is_subregion(real_dev_reg, ®n)) {
printk(BIOS_DEBUG, "CBFS @ %zx size %zx\n",
props->offset, props->size);
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c
index c976ac2..5bf501d 100644
--- a/src/soc/intel/apollolake/romstage.c
+++ b/src/soc/intel/apollolake/romstage.c
@@ -17,7 +17,6 @@
*/
#include <arch/cpu.h>
-#include <arch/early_variables.h>
#include <device/pci_ops.h>
#include <arch/symbols.h>
#include <assert.h>
@@ -57,7 +56,7 @@
0x8d, 0xe6, 0xc0, 0x44, 0x64, 0x1d, 0xe9, 0x42,
};
-static uint32_t fsp_version CAR_GLOBAL;
+static uint32_t fsp_version;
/* High Performance Event Timer Configuration */
#define P2SB_HPTC 0x60
@@ -236,7 +235,7 @@
&var_size);
if (new_var_data)
mrc_cache_stash_data(MRC_VARIABLE_DATA,
- car_get_var(fsp_version), new_var_data,
+ fsp_version, new_var_data,
var_size);
else
printk(BIOS_ERR, "Failed to determine variable data\n");
@@ -410,7 +409,7 @@
mupd->FspmConfig.VariableNvsBufferPtr = rdev_mmap_full(&rdev);
}
- car_set_var(fsp_version, version);
+ fsp_version = version;
}
To view, visit change 30510. To unsubscribe, or for help writing mail filters, visit settings.