Add support for reserving initial memory. Signed-off-by: Simon Glass <s...@chromium.org> ---
arch/x86/cpu/cpu.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c index 8fa6953588..893bec5c5c 100644 --- a/arch/x86/cpu/cpu.c +++ b/arch/x86/cpu/cpu.c @@ -254,7 +254,7 @@ int cpu_init_r(void) } #ifndef CONFIG_EFI_STUB -int reserve_arch(void) +static int cpu_x86_reserve_arch(void) { #ifdef CONFIG_ENABLE_MRC_CACHE mrccache_reserve(); @@ -266,4 +266,43 @@ int reserve_arch(void) return 0; } + +#ifndef CONFIG_BOARD_ENABLE +int reserve_arch(void) +{ + return cpu_x86_reserve_arch(); +} +#endif + +#endif /* !CONFIG_EFI_STUB */ + +static int cpu_x86_phase(struct udevice *dev, enum board_phase_t phase) +{ +#ifndef CONFIG_EFI_STUB + return cpu_x86_reserve_arch(); +#else + return 0; #endif +} + +static int cpu_x86_board_probe(struct udevice *dev) +{ + return board_support_phase(dev, BOARD_F_RESERVE_ARCH); +} + +static const struct board_ops cpu_x86_board_ops = { + .phase = cpu_x86_phase, +}; + +/* Name this starting with underscore so it will be called last */ +U_BOOT_DRIVER(_cpu_x86_board_drv) = { + .name = "cpu_x86_board", + .id = UCLASS_BOARD, + .ops = &cpu_x86_board_ops, + .probe = cpu_x86_board_probe, + .flags = DM_FLAG_PRE_RELOC, +}; + +U_BOOT_DEVICE(cpu_x86_board) = { + .name = "cpu_x86_board", +}; -- 2.12.0.367.g23dc2f6d3c-goog _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot