From 2902be86c1496244800ee15a148a4907bf9a3492 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 11 Apr 2018 22:02:07 -0700 Subject: 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 Reviewed-by: Christian Gmeiner --- cmd/elf.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'cmd/elf.c') 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 /* -- cgit v1.2.3