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>
This commit is contained in:
committed by
Patrick Georgi
parent
87c4f11c64
commit
6d6945b807
@ -12,7 +12,6 @@
|
|||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
#include <arch/early_variables.h>
|
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <fsp/util.h>
|
#include <fsp/util.h>
|
||||||
#include <memory_info.h>
|
#include <memory_info.h>
|
||||||
@ -21,11 +20,11 @@
|
|||||||
#include <fsp/soc_binding.h>
|
#include <fsp/soc_binding.h>
|
||||||
#include <string.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)
|
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)
|
static void accumulate_channel_memory(int density, int dual_rank)
|
||||||
@ -61,7 +60,7 @@ static void accumulate_channel_memory(int density, int dual_rank)
|
|||||||
|
|
||||||
sz *= GiB / MiB;
|
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)
|
size_t iohole_in_mib(void)
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arch/early_variables.h>
|
|
||||||
#include <boot_device.h>
|
#include <boot_device.h>
|
||||||
#include <cbfs.h>
|
#include <cbfs.h>
|
||||||
#include <commonlib/region.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 mem_region_device shadow_dev;
|
||||||
static struct xlate_region_device real_dev CAR_GLOBAL;
|
static struct xlate_region_device real_dev;
|
||||||
|
|
||||||
static void bios_mmap_init(void)
|
static void bios_mmap_init(void)
|
||||||
{
|
{
|
||||||
size_t size, start, bios_mapped_size;
|
size_t size, start, bios_mapped_size;
|
||||||
uintptr_t base;
|
uintptr_t base;
|
||||||
|
|
||||||
size = car_get_var(bios_size);
|
size = bios_size;
|
||||||
|
|
||||||
/* If bios_size is initialized, then bail out. */
|
/* If bios_size is initialized, then bail out. */
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
@ -83,34 +82,25 @@ static void bios_mmap_init(void)
|
|||||||
*/
|
*/
|
||||||
bios_mapped_size = size - 256 * KiB;
|
bios_mapped_size = size - 256 * KiB;
|
||||||
|
|
||||||
struct mem_region_device *shadow_dev_ptr;
|
mem_region_device_ro_init(&shadow_dev, (void *)base,
|
||||||
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,
|
|
||||||
bios_mapped_size);
|
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,
|
start, bios_mapped_size,
|
||||||
CONFIG_ROM_SIZE);
|
CONFIG_ROM_SIZE);
|
||||||
|
|
||||||
car_set_var(bios_size, size);
|
bios_size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct region_device *boot_device_ro(void)
|
const struct region_device *boot_device_ro(void)
|
||||||
{
|
{
|
||||||
bios_mmap_init();
|
bios_mmap_init();
|
||||||
|
|
||||||
struct xlate_region_device *real_dev_ptr;
|
return &real_dev.rdev;
|
||||||
real_dev_ptr = car_get_var_ptr(&real_dev);
|
|
||||||
|
|
||||||
return &real_dev_ptr->rdev;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iafw_boot_region_properties(struct cbfs_props *props)
|
static int iafw_boot_region_properties(struct cbfs_props *props)
|
||||||
{
|
{
|
||||||
struct xlate_region_device *real_dev_ptr;
|
|
||||||
struct region *real_dev_reg;
|
struct region *real_dev_reg;
|
||||||
struct region regn;
|
struct region regn;
|
||||||
|
|
||||||
@ -123,8 +113,7 @@ static int iafw_boot_region_properties(struct cbfs_props *props)
|
|||||||
|
|
||||||
/* Check that we are within the memory mapped area. It's too
|
/* Check that we are within the memory mapped area. It's too
|
||||||
easy to forget the SRAM mapping when crafting an FMAP file. */
|
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.sub_region;
|
||||||
real_dev_reg = &real_dev_ptr->sub_region;
|
|
||||||
if (region_is_subregion(real_dev_reg, ®n)) {
|
if (region_is_subregion(real_dev_reg, ®n)) {
|
||||||
printk(BIOS_DEBUG, "CBFS @ %zx size %zx\n",
|
printk(BIOS_DEBUG, "CBFS @ %zx size %zx\n",
|
||||||
props->offset, props->size);
|
props->offset, props->size);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
#include <arch/early_variables.h>
|
|
||||||
#include <device/pci_ops.h>
|
#include <device/pci_ops.h>
|
||||||
#include <arch/symbols.h>
|
#include <arch/symbols.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -57,7 +56,7 @@ static const uint8_t hob_variable_guid[16] = {
|
|||||||
0x8d, 0xe6, 0xc0, 0x44, 0x64, 0x1d, 0xe9, 0x42,
|
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 */
|
/* High Performance Event Timer Configuration */
|
||||||
#define P2SB_HPTC 0x60
|
#define P2SB_HPTC 0x60
|
||||||
@ -236,7 +235,7 @@ asmlinkage void car_stage_entry(void)
|
|||||||
&var_size);
|
&var_size);
|
||||||
if (new_var_data)
|
if (new_var_data)
|
||||||
mrc_cache_stash_data(MRC_VARIABLE_DATA,
|
mrc_cache_stash_data(MRC_VARIABLE_DATA,
|
||||||
car_get_var(fsp_version), new_var_data,
|
fsp_version, new_var_data,
|
||||||
var_size);
|
var_size);
|
||||||
else
|
else
|
||||||
printk(BIOS_ERR, "Failed to determine variable data\n");
|
printk(BIOS_ERR, "Failed to determine variable data\n");
|
||||||
@ -410,7 +409,7 @@ void platform_fsp_memory_init_params_cb(FSPM_UPD *mupd, uint32_t version)
|
|||||||
mupd->FspmConfig.VariableNvsBufferPtr = rdev_mmap_full(&rdev);
|
mupd->FspmConfig.VariableNvsBufferPtr = rdev_mmap_full(&rdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
car_set_var(fsp_version, version);
|
fsp_version = version;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user