x86: Move coreboot-table detection into common code

To support detecting booting from coreboot, move the code which locates
the coreboot tables into a common place. Adjust the algorithm slightly to
use a word comparison instead of string, since it is faster.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct the comments to 960KB]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass 2020-04-26 09:12:58 -06:00 committed by Bin Meng
parent ba974a0137
commit 33139a0bc7
3 changed files with 41 additions and 15 deletions

View file

@ -343,4 +343,11 @@ void *high_table_malloc(size_t bytes);
*/
void write_coreboot_table(u32 addr, struct memory_area *cfg_tables);
/**
* locate_coreboot_table() - Try to find coreboot tables at standard locations
*
* @return address of table that was found, or -ve error number
*/
long locate_coreboot_table(void);
#endif