diff options
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/common/block/ebda/ebda.c | 9 | ||||
-rw-r--r-- | src/soc/intel/common/block/include/intelblocks/ebda.h | 6 | ||||
-rw-r--r-- | src/soc/intel/skylake/memmap.c | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/soc/intel/common/block/ebda/ebda.c b/src/soc/intel/common/block/ebda/ebda.c index 87c18d9bc5..4f60490824 100644 --- a/src/soc/intel/common/block/ebda/ebda.c +++ b/src/soc/intel/common/block/ebda/ebda.c @@ -15,6 +15,7 @@ #include <arch/ebda.h> #include <intelblocks/ebda.h> +#include <string.h> /* * Mainboard Override function @@ -47,3 +48,11 @@ void fill_ebda_area(void) create_mainboard_ebda(cfg); write_ebda_data(cfg, sizeof(*cfg)); } + +void retrieve_ebda_object(struct ebda_config *cfg) +{ + read_ebda_data(cfg, sizeof(*cfg)); + + if (cfg->signature != EBDA_SIGNATURE) + memset(cfg, 0, sizeof(*cfg)); +} diff --git a/src/soc/intel/common/block/include/intelblocks/ebda.h b/src/soc/intel/common/block/include/intelblocks/ebda.h index 031cf1973d..16124df7e0 100644 --- a/src/soc/intel/common/block/include/intelblocks/ebda.h +++ b/src/soc/intel/common/block/include/intelblocks/ebda.h @@ -18,7 +18,7 @@ #include <soc/ebda.h> -#define EBDA_SIGNATURE 0xebda +#define EBDA_SIGNATURE 0xebdaebda /* * Mainboard Override function @@ -45,6 +45,10 @@ void fill_soc_memmap_ebda(struct ebda_config *cfg); */ void fill_ebda_area(void); +/* Fill the ebda object pointed to by cfg. Object will be zero filled + * if signature check fails. */ +void retrieve_ebda_object(struct ebda_config *cfg); + /* * EBDA structure * diff --git a/src/soc/intel/skylake/memmap.c b/src/soc/intel/skylake/memmap.c index 485b8c4cbb..eaf7d073ae 100644 --- a/src/soc/intel/skylake/memmap.c +++ b/src/soc/intel/skylake/memmap.c @@ -348,7 +348,7 @@ void *cbmem_top(void) if (sa_get_tseg_base() == 0) return NULL; - read_ebda_data(cfg, sizeof(*cfg)); + retrieve_ebda_object(cfg); return (void *)(uintptr_t)cfg->tolum_base; } |