summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2018-04-11 22:02:07 -0700
committerBin Meng <bmeng.cn@gmail.com>2018-04-16 16:54:51 +0800
commit2902be86c1496244800ee15a148a4907bf9a3492 (patch)
treea654074e5d69612b7dfe44a496e0ea8c9e7105a2 /cmd
parent2ad3d088d2177908bd9bc7a988bd75fe55c6874c (diff)
bootvx: x86: Prepare e820 related stuff from the given kernel memory base address
At present two environment variables 'e820data'/'e820info' are required to boot a VxWorks x86 kernel, but this is superfluous. The offset of these two tables are actually at a fixed offset from the kernel memory base address and we can provide the kernel memory base address to U-Boot via only one variable 'vx_phys_mem_base'. Note as it name indicates, the physical address should be provided. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/elf.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/cmd/elf.c b/cmd/elf.c
index 19479bb706..ea09506c64 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -209,6 +209,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
char build_buf[128]; /* Buffer for building the bootline */
int ptr = 0;
#ifdef CONFIG_X86
+ ulong base;
struct e820info *info;
struct e820entry *data;
#endif
@@ -335,25 +336,18 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#ifdef CONFIG_X86
/*
- * Since E820 information is critical to the kernel, if we don't
- * specify these in the environments, use a default one.
+ * Get VxWorks's physical memory base address from environment,
+ * if we don't specify it in the environment, use a default one.
*/
- tmp = env_get("e820data");
- if (tmp)
- data = (struct e820entry *)simple_strtoul(tmp, NULL, 16);
- else
- data = (struct e820entry *)VXWORKS_E820_DATA_ADDR;
- tmp = env_get("e820info");
- if (tmp)
- info = (struct e820info *)simple_strtoul(tmp, NULL, 16);
- else
- info = (struct e820info *)VXWORKS_E820_INFO_ADDR;
+ base = env_get_hex("vx_phys_mem_base", VXWORKS_PHYS_MEM_BASE);
+ data = (struct e820entry *)(base + E820_DATA_OFFSET);
+ info = (struct e820info *)(base + E820_INFO_OFFSET);
memset(info, 0, sizeof(struct e820info));
info->sign = E820_SIGNATURE;
info->entries = install_e820_map(E820MAX, data);
info->addr = (info->entries - 1) * sizeof(struct e820entry) +
- VXWORKS_E820_DATA_ADDR;
+ E820_DATA_OFFSET;
#endif
/*