x86: zboot: Move environment setting into zboot_load()

The only difference between the command and the underlying logic is the
setting of envrionment variables. Move this out of the command
processing since it needs to be done in any case.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 1d1249f..b72e2f0 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -370,6 +370,7 @@
 int zboot_load(void)
 {
 	struct boot_params *base_ptr;
+	int ret;
 
 	if (state.base_ptr) {
 		struct boot_params *from = (struct boot_params *)state.base_ptr;
@@ -389,6 +390,12 @@
 	}
 	state.base_ptr = base_ptr;
 
+	ret = env_set_hex("zbootbase", map_to_sysmem(state.base_ptr));
+	if (!ret)
+		ret = env_set_hex("zbootaddr", state.load_address);
+	if (ret)
+		return ret;
+
 	return 0;
 }