lib/*_stage_cache.c: drop CAR_GLOBAL_MIGRATION support

Change-Id: I23d5367150649a64ec6d95601f38940dbb5972f8
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37034
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Arthur Heymans 2019-11-20 20:01:11 +01:00 committed by Patrick Georgi
parent ff168e9e63
commit 7c2994bb73
2 changed files with 7 additions and 14 deletions

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 <cbmem.h> #include <cbmem.h>
#include <stage_cache.h> #include <stage_cache.h>
#include <string.h> #include <string.h>

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 <bootstate.h> #include <bootstate.h>
#include <cbmem.h> #include <cbmem.h>
#include <console/console.h> #include <console/console.h>
@ -21,12 +20,7 @@
#include <stage_cache.h> #include <stage_cache.h>
#include <string.h> #include <string.h>
static struct imd imd_stage_cache CAR_GLOBAL = { }; static struct imd imd_stage_cache;
static inline struct imd *imd_get(void)
{
return car_get_var_ptr(&imd_stage_cache);
}
static void stage_cache_create_empty(void) static void stage_cache_create_empty(void)
{ {
@ -34,7 +28,7 @@ static void stage_cache_create_empty(void)
void *base; void *base;
size_t size; size_t size;
imd = imd_get(); imd = &imd_stage_cache;
stage_cache_external_region(&base, &size); stage_cache_external_region(&base, &size);
imd_handle_init(imd, (void *)(size + (uintptr_t)base)); imd_handle_init(imd, (void *)(size + (uintptr_t)base));
@ -50,7 +44,7 @@ static void stage_cache_recover(void)
void *base; void *base;
size_t size; size_t size;
imd = imd_get(); imd = &imd_stage_cache;
stage_cache_external_region(&base, &size); stage_cache_external_region(&base, &size);
imd_handle_init(imd, (void *)(size + (uintptr_t)base)); imd_handle_init(imd, (void *)(size + (uintptr_t)base));
if (imd_recover(imd)) if (imd_recover(imd))
@ -64,7 +58,7 @@ void stage_cache_add(int stage_id, const struct prog *stage)
struct stage_cache *meta; struct stage_cache *meta;
void *c; void *c;
imd = imd_get(); imd = &imd_stage_cache;
e = imd_entry_add(imd, CBMEM_ID_STAGEx_META + stage_id, sizeof(*meta)); e = imd_entry_add(imd, CBMEM_ID_STAGEx_META + stage_id, sizeof(*meta));
if (e == NULL) { if (e == NULL) {
@ -99,7 +93,7 @@ void stage_cache_add_raw(int stage_id, const void *base, const size_t size)
const struct imd_entry *e; const struct imd_entry *e;
void *c; void *c;
imd = imd_get(); imd = &imd_stage_cache;
e = imd_entry_add(imd, CBMEM_ID_STAGEx_RAW + stage_id, size); e = imd_entry_add(imd, CBMEM_ID_STAGEx_RAW + stage_id, size);
if (e == NULL) { if (e == NULL) {
printk(BIOS_DEBUG, "Error: Can't add %x raw data to imd\n", printk(BIOS_DEBUG, "Error: Can't add %x raw data to imd\n",
@ -122,7 +116,7 @@ void stage_cache_get_raw(int stage_id, void **base, size_t *size)
struct imd *imd; struct imd *imd;
const struct imd_entry *e; const struct imd_entry *e;
imd = imd_get(); imd = &imd_stage_cache;
e = imd_entry_find(imd, CBMEM_ID_STAGEx_RAW + stage_id); e = imd_entry_find(imd, CBMEM_ID_STAGEx_RAW + stage_id);
if (e == NULL) { if (e == NULL) {
printk(BIOS_DEBUG, "Error: Can't find %x raw data to imd\n", printk(BIOS_DEBUG, "Error: Can't find %x raw data to imd\n",
@ -142,7 +136,7 @@ void stage_cache_load_stage(int stage_id, struct prog *stage)
void *c; void *c;
size_t size; size_t size;
imd = imd_get(); imd = &imd_stage_cache;
e = imd_entry_find(imd, CBMEM_ID_STAGEx_META + stage_id); e = imd_entry_find(imd, CBMEM_ID_STAGEx_META + stage_id);
if (e == NULL) { if (e == NULL) {
printk(BIOS_DEBUG, "Error: Can't find %x metadata in imd\n", printk(BIOS_DEBUG, "Error: Can't find %x metadata in imd\n",