soc/intel/common/pmc: Don't use CAR_GLOBAL

All platforms using this code use NO_CAR_GLOBAL_MIGRATION.

Change-Id: I426dee60521045db4711cd253432c65223a64b93
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33002
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
Arthur Heymans 2019-05-25 10:32:31 +02:00 committed by Patrick Georgi
parent a5eed800f3
commit ea6dd747e8

View file

@ -13,7 +13,6 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include <arch/early_variables.h>
#include <arch/io.h> #include <arch/io.h>
#include <device/mmio.h> #include <device/mmio.h>
#include <cbmem.h> #include <cbmem.h>
@ -27,7 +26,7 @@
#include <timer.h> #include <timer.h>
#include <security/vboot/vboot_common.h> #include <security/vboot/vboot_common.h>
static struct chipset_power_state power_state CAR_GLOBAL; static struct chipset_power_state power_state;
struct chipset_power_state *pmc_get_power_state(void) struct chipset_power_state *pmc_get_power_state(void)
{ {
@ -38,7 +37,7 @@ struct chipset_power_state *pmc_get_power_state(void)
/* cbmem is online but ptr is not populated yet */ /* cbmem is online but ptr is not populated yet */
if (ptr == NULL && !(ENV_RAMSTAGE || ENV_POSTCAR)) if (ptr == NULL && !(ENV_RAMSTAGE || ENV_POSTCAR))
return car_get_var_ptr(&power_state); return &power_state;
return ptr; return ptr;
} }
@ -46,16 +45,14 @@ struct chipset_power_state *pmc_get_power_state(void)
static void migrate_power_state(int is_recovery) static void migrate_power_state(int is_recovery)
{ {
struct chipset_power_state *ps_cbmem; struct chipset_power_state *ps_cbmem;
struct chipset_power_state *ps_car;
ps_car = car_get_var_ptr(&power_state);
ps_cbmem = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*ps_cbmem)); ps_cbmem = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*ps_cbmem));
if (ps_cbmem == NULL) { if (ps_cbmem == NULL) {
printk(BIOS_DEBUG, "Not adding power state to cbmem!\n"); printk(BIOS_DEBUG, "Not adding power state to cbmem!\n");
return; return;
} }
memcpy(ps_cbmem, ps_car, sizeof(*ps_cbmem)); memcpy(ps_cbmem, &power_state, sizeof(*ps_cbmem));
} }
ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state) ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state)