#include <common.h>
#include <efi_loader.h>
+#include <environment.h>
#include <malloc.h>
#include <asm/global_data.h>
#include <libfdt_env.h>
/* Make sure that notification functions are not called anymore */
efi_tpl = TPL_HIGH_LEVEL;
+#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
+ /* save any EFI variables that have been written: */
+ env_save();
+#endif
+
board_quiesce_devices();
/* Fix up caches for EFI payloads if necessary */