Skip to contentSkip to conversation

Better support of booting VxWorks via 'bootvx'

PATCH New Bin Meng 2 participants 26 messages Oct 8, 2015 – Oct 18, 2015

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

v3 cover Better support of booting VxWorks via 'bootvx'

This series adds better support of booting VxWorks using 'bootvx'.

Tested by booting a VxWorks 6.9.4 kernel on Intel Crown Bay, and a VxWorks 7 kernel on Intel Galileo.

Rebased on u-boot/master branch and dropped the #1 and #2 patches in the v2 series as they were already applied in the main stream.

Changes in v3:
- New patch to avoid strlen() calls when constructing VxWorks bootline
- Avoid calls to strlen()

Changes in v2:
- New patch to move install_e820_map() out of zimage.c
- New patch to remove quotation mark in CONFIG_HOSTNAME
- Split the defconfig reorder to another patch, making this patch as CONFIG_CMD_ELF mods only
- Update sparc and avr32 boards to unset CONFIG_CMD_ELF
- Fix the endian issue for netmask
- New patch to add asmlinkage to the VxWorks x86 entry
- Describe typical values for bootaddr, e820data, e820info.

Bin Meng (12):
x86: Initialize GDT entry 1 to be the 32-bit CS as well
x86: Move install_e820_map() out of zimage.c
x86: Remove quotation mark in CONFIG_HOSTNAME
cmd: Convert CONFIG_CMD_ELF to Kconfig
cmd: Clean up cmd_elf a little bit
cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()
cmd: bootvx: Avoid strlen() calls when constructing VxWorks bootline
cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline
cmd: bootvx: Always get VxWorks bootline from env
cmd: bootvx: Pass E820 information to an x86 VxWorks kernel
cmd: bootvx: Add asmlinkage to the VxWorks x86 entry
doc: Complement document about booting VxWorks

 README                                          |  12 +-
 arch/x86/cpu/cpu.c                              |   7 +-
 arch/x86/include/asm/e820.h                     |   3 +
 arch/x86/include/asm/zimage.h                   |   3 -
 arch/x86/lib/Makefile                           |   1 +
 arch/x86/lib/e820.c                             |  37 +++
 arch/x86/lib/zimage.c                           |  26 --
 common/Kconfig                                  |   6 +
 common/cmd_elf.c                                | 406 +++++++++++++-----------
 configs/atngw100_defconfig                      |   1 +
 configs/atngw100mkii_defconfig                  |   1 +
 configs/atstk1002_defconfig                     |   1 +
 configs/dbau1000_defconfig                      |   1 +
 configs/dbau1100_defconfig                      |   1 +
 configs/dbau1500_defconfig                      |   1 +
 configs/dbau1550_defconfig                      |   1 +
 configs/dbau1550_el_defconfig                   |   1 +
 configs/dlvision-10g_defconfig                  |   1 +
 configs/dlvision_defconfig                      |   1 +
 configs/gr_cpci_ax2000_defconfig                |   1 +
 configs/gr_ep2s60_defconfig                     |   1 +
 configs/gr_xc3s_1500_defconfig                  |   1 +
 configs/grasshopper_defconfig                   |   1 +
 configs/grsim_defconfig                         |   1 +
 configs/grsim_leon2_defconfig                   |   1 +
 configs/io_defconfig                            |   1 +
 configs/iocon_defconfig                         |   1 +
 configs/neo_defconfig                           |   1 +
 configs/pb1000_defconfig                        |   1 +
 configs/sandbox_defconfig                       |   1 +
 configs/vct_platinum_onenand_small_defconfig    |   1 +
 configs/vct_platinum_small_defconfig            |   1 +
 configs/vct_platinumavc_onenand_small_defconfig |   1 +
 configs/vct_platinumavc_small_defconfig         |   1 +
 configs/vct_premium_onenand_small_defconfig     |   1 +
 configs/vct_premium_small_defconfig             |   1 +
 doc/README.vxworks                              |  82 ++++-
 doc/README.x86                                  |   2 +
 include/config_cmd_all.h                        |   1 -
 include/config_distro_defaults.h                |   1 -
 include/configs/B4860QDS.h                      |   1 -
 include/configs/BSC9131RDB.h                    |   1 -
 include/configs/BSC9132QDS.h                    |   1 -
 include/configs/C29XPCIE.h                      |   1 -
 include/configs/CPCI2DP.h                       |   1 -
 include/configs/CPCI4052.h                      |   1 -
 include/configs/M5208EVBE.h                     |   1 -
 include/configs/M52277EVB.h                     |   1 -
 include/configs/M5235EVB.h                      |   1 -
 include/configs/M5272C3.h                       |   1 -
 include/configs/M5275EVB.h                      |   1 -
 include/configs/M53017EVB.h                     |   1 -
 include/configs/M5329EVB.h                      |   1 -
 include/configs/M5373EVB.h                      |   1 -
 include/configs/M54418TWR.h                     |   1 -
 include/configs/M54451EVB.h                     |   1 -
 include/configs/M54455EVB.h                     |   1 -
 include/configs/M5475EVB.h                      |   1 -
 include/configs/M5485EVB.h                      |   1 -
 include/configs/MIP405.h                        |   1 -
 include/configs/MPC8536DS.h                     |   1 -
 include/configs/MPC8540ADS.h                    |   1 -
 include/configs/MPC8541CDS.h                    |   1 -
 include/configs/MPC8544DS.h                     |   1 -
 include/configs/MPC8548CDS.h                    |   1 -
 include/configs/MPC8555CDS.h                    |   1 -
 include/configs/MPC8560ADS.h                    |   1 -
 include/configs/MPC8568MDS.h                    |   1 -
 include/configs/MPC8569MDS.h                    |   1 -
 include/configs/MPC8572DS.h                     |   1 -
 include/configs/P1010RDB.h                      |   1 -
 include/configs/P1022DS.h                       |   1 -
 include/configs/P2041RDB.h                      |   1 -
 include/configs/PIP405.h                        |   1 -
 include/configs/PLU405.h                        |   1 -
 include/configs/PMC405DE.h                      |   1 -
 include/configs/PMC440.h                        |   1 -
 include/configs/T102xQDS.h                      |   1 -
 include/configs/T102xRDB.h                      |   1 -
 include/configs/T1040QDS.h                      |   1 -
 include/configs/T104xRDB.h                      |   1 -
 include/configs/T208xQDS.h                      |   1 -
 include/configs/T208xRDB.h                      |   1 -
 include/configs/T4240RDB.h                      |   1 -
 include/configs/TQM823L.h                       |   1 -
 include/configs/TQM823M.h                       |   1 -
 include/configs/TQM850L.h                       |   1 -
 include/configs/TQM850M.h                       |   1 -
 include/configs/TQM855L.h                       |   1 -
 include/configs/TQM855M.h                       |   1 -
 include/configs/TQM860L.h                       |   1 -
 include/configs/TQM860M.h                       |   1 -
 include/configs/TQM862L.h                       |   1 -
 include/configs/TQM862M.h                       |   1 -
 include/configs/TQM866M.h                       |   1 -
 include/configs/UCP1020.h                       |   1 -
 include/configs/VCMA9.h                         |   1 -
 include/configs/VOM405.h                        |   1 -
 include/configs/amcc-common.h                   |   1 -
 include/configs/arcangel4.h                     |   1 -
 include/configs/astro_mcf5373l.h                |   1 -
 include/configs/axs101.h                        |   1 -
 include/configs/bf537-minotaur.h                |   1 -
 include/configs/bf537-srv1.h                    |   1 -
 include/configs/bfin_adi_common.h               |   1 -
 include/configs/blackstamp.h                    |   1 -
 include/configs/blackvme.h                      |   1 -
 include/configs/controlcenterd.h                |   1 -
 include/configs/corenet_ds.h                    |   1 -
 include/configs/dbau1x00.h                      |   1 -
 include/configs/digsy_mtc.h                     |   1 -
 include/configs/dlvision-10g.h                  |   1 -
 include/configs/dlvision.h                      |   1 -
 include/configs/io.h                            |   1 -
 include/configs/iocon.h                         |   1 -
 include/configs/km/km_arm.h                     |   1 -
 include/configs/lsxl.h                          |   1 -
 include/configs/malta.h                         |   1 -
 include/configs/mecp5123.h                      |   1 -
 include/configs/motionpro.h                     |   1 -
 include/configs/munices.h                       |   1 -
 include/configs/neo.h                           |   1 -
 include/configs/nitrogen6x.h                    |   1 -
 include/configs/openrisc-generic.h              |   1 -
 include/configs/origen.h                        |   1 -
 include/configs/p1_p2_rdb_pc.h                  |   1 -
 include/configs/p1_twr.h                        |   1 -
 include/configs/pb1x00.h                        |   2 -
 include/configs/qemu-mips.h                     |   1 -
 include/configs/qemu-mips64.h                   |   1 -
 include/configs/qemu-ppce500.h                  |   1 -
 include/configs/sandbox.h                       |   1 -
 include/configs/sbc8548.h                       |   1 -
 include/configs/smdk2410.h                      |   1 -
 include/configs/smdkc100.h                      |   1 -
 include/configs/smdkv310.h                      |   1 -
 include/configs/t4qds.h                         |   1 -
 include/configs/tb100.h                         |   1 -
 include/configs/vct.h                           |   2 -
 include/configs/vme8349.h                       |   1 -
 include/configs/x86-common.h                    |   3 +-
 include/configs/xilinx-ppc.h                    |   1 -
 include/configs/xilinx_zynqmp.h                 |   1 -
 include/configs/xpedite1000.h                   |   1 -
 include/configs/xpedite517x.h                   |   1 -
 include/configs/xpedite520x.h                   |   1 -
 include/configs/xpedite537x.h                   |   1 -
 include/configs/xpedite550x.h                   |   1 -
 include/configs/zmx25.h                         |   1 -
 include/configs/zynq-common.h                   |   1 -
 include/vxworks.h                               |  51 +--
 151 files changed, 408 insertions(+), 371 deletions(-)
 create mode 100644 arch/x86/lib/e820.c
Signature · 1 line
1.8.2.1
author
#1 lore raw

PATCH v3 1/12 x86: Initialize GDT entry 1 to be the 32-bit CS as well

Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS.

---

Changes in v3: None
Changes in v2: None

 arch/x86/cpu/cpu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/x86/cpu/cpu.c +6 -1
index 1b76ca1..812c5e4 100644
@@ -142,7 +142,12 @@ void arch_setup_gd(gd_t *new_gd)
 
 	gdt_addr = new_gd->arch.gdt;
 
-	/* CS: code, read/execute, 4 GB, base 0 */
+	/*
+	 * CS: code, read/execute, 4 GB, base 0
+	 *
+	 * Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS
+	 */
+	gdt_addr[X86_GDT_ENTRY_UNUSED] = GDT_ENTRY(0xc09b, 0, 0xfffff);
 	gdt_addr[X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xfffff);
 
 	/* DS: data, read/write, 4 GB, base 0 */
Signature · 1 line
1.8.2.1
author
#3 lore raw

PATCH v3 2/12 x86: Move install_e820_map() out of zimage.c

In reply to Bin Meng

install_e820_map() has nothing to do with zimage related codes. Move it to a dedicated place.

---

Changes in v3: None
Changes in v2:
- New patch to move install_e820_map() out of zimage.c

 arch/x86/include/asm/e820.h   |  3 +++
 arch/x86/include/asm/zimage.h |  3 ---
 arch/x86/lib/Makefile         |  1 +
 arch/x86/lib/e820.c           | 37 +++++++++++++++++++++++++++++++++++++
 arch/x86/lib/zimage.c         | 26 --------------------------
 5 files changed, 41 insertions(+), 29 deletions(-)
 create mode 100644 arch/x86/lib/e820.c
arch/x86/include/asm/e820.h +3 -0
index 21bc633..351f021 100644
@@ -23,4 +23,7 @@ struct e820entry {
 
 #endif /* __ASSEMBLY__ */
 
+/* Implementation defined function to install an e820 map */
+unsigned install_e820_map(unsigned max_entries, struct e820entry *);
+
 #endif /* _ASM_X86_E820_H */
arch/x86/include/asm/zimage.h +0 -3
index bf351ed..94fa2a7 100644
@@ -31,9 +31,6 @@
 #define BZIMAGE_LOAD_ADDR  0x100000
 #define ZIMAGE_LOAD_ADDR   0x10000
 
-/* Implementation defined function to install an e820 map. */
-unsigned install_e820_map(unsigned max_entries, struct e820entry *);
-
 struct boot_params *load_zimage(char *image, unsigned long kernel_size,
 				ulong *load_addressp);
 int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
arch/x86/lib/Makefile +1 -0
index 6ecd6db..169062e 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-y	+= cmd_boot.o
 obj-$(CONFIG_HAVE_FSP) += cmd_hob.o
 obj-$(CONFIG_EFI) += efi/
+obj-y	+= e820.o
 obj-y	+= gcc.o
 obj-y	+= init_helpers.o
 obj-y	+= interrupts.o
arch/x86/lib/e820.c new file +37 -0
new file mode 100644
index 0000000..5babfde
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015, Bin Meng <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/e820.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Install a default e820 table with 4 entries as follows:
+ *
+ *	0x000000-0x0a0000	Useable RAM
+ *	0x0a0000-0x100000	Reserved for ISA
+ *	0x100000-gd->ram_size	Useable RAM
+ *	CONFIG_PCIE_ECAM_BASE	PCIe ECAM
+ */
+__weak unsigned install_e820_map(unsigned max_entries,
+				 struct e820entry *entries)
+{
+	entries[0].addr = 0;
+	entries[0].size = ISA_START_ADDRESS;
+	entries[0].type = E820_RAM;
+	entries[1].addr = ISA_START_ADDRESS;
+	entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
+	entries[1].type = E820_RESERVED;
+	entries[2].addr = ISA_END_ADDRESS;
+	entries[2].size = gd->ram_size - ISA_END_ADDRESS;
+	entries[2].type = E820_RAM;
+	entries[3].addr = CONFIG_PCIE_ECAM_BASE;
+	entries[3].size = CONFIG_PCIE_ECAM_SIZE;
+	entries[3].type = E820_RESERVED;
+
+	return 4;
+}
arch/x86/lib/zimage.c +0 -26
index a1ec57e..1b33c77 100644
@@ -42,32 +42,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define COMMAND_LINE_SIZE	2048
 
-/*
- * Install a default e820 table with 3 entries as follows:
- *
- *	0x000000-0x0a0000	Useable RAM
- *	0x0a0000-0x100000	Reserved for ISA
- *	0x100000-gd->ram_size	Useable RAM
- */
-__weak unsigned install_e820_map(unsigned max_entries,
-				 struct e820entry *entries)
-{
-	entries[0].addr = 0;
-	entries[0].size = ISA_START_ADDRESS;
-	entries[0].type = E820_RAM;
-	entries[1].addr = ISA_START_ADDRESS;
-	entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
-	entries[1].type = E820_RESERVED;
-	entries[2].addr = ISA_END_ADDRESS;
-	entries[2].size = gd->ram_size - ISA_END_ADDRESS;
-	entries[2].type = E820_RAM;
-	entries[3].addr = CONFIG_PCIE_ECAM_BASE;
-	entries[3].size = CONFIG_PCIE_ECAM_SIZE;
-	entries[3].type = E820_RESERVED;
-
-	return 4;
-}
-
 static void build_command_line(char *command_line, int auto_boot)
 {
 	char *env_command_line;
Signature · 1 line
1.8.2.1
#4 lore raw

PATCH v3 2/12 x86: Move install_e820_map() out of zimage.c

Quoted 12 lines · Bin Meng

install_e820_map() has nothing to do with zimage related codes. Move it to a dedicated place.

---

Changes in v3: None
Changes in v2:
- New patch to move install_e820_map() out of zimage.c

Quoted 7 lines
 arch/x86/include/asm/e820.h   |  3 +++
 arch/x86/include/asm/zimage.h |  3 ---
 arch/x86/lib/Makefile         |  1 +
 arch/x86/lib/e820.c           | 37 +++++++++++++++++++++++++++++++++++++
 arch/x86/lib/zimage.c         | 26 --------------------------
 5 files changed, 41 insertions(+), 29 deletions(-)
 create mode 100644 arch/x86/lib/e820.c

Applied to u-boot-x86, thanks!

author
#5 lore raw

PATCH v3 3/12 x86: Remove quotation mark in CONFIG_HOSTNAME

In reply to Bin Meng

CONFIG_HOSTNAME is an environment varible, so that quotation mark is not needed.

---

Changes in v3: None
Changes in v2:
- New patch to remove quotation mark in CONFIG_HOSTNAME

 include/configs/x86-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/x86-common.h +1 -1
index 3f153f2..44765f6 100644
@@ -217,7 +217,7 @@
 
 /* Default environment */
 #define CONFIG_ROOTPATH		"/opt/nfsroot"
-#define CONFIG_HOSTNAME		"x86"
+#define CONFIG_HOSTNAME		x86
 #define CONFIG_BOOTFILE		"bzImage"
 #define CONFIG_LOADADDR		0x1000000
 
Signature · 1 line
1.8.2.1
#6 lore raw

PATCH v3 3/12 x86: Remove quotation mark in CONFIG_HOSTNAME

Quoted 6 lines · Bin Meng

CONFIG_HOSTNAME is an environment varible, so that quotation mark is not needed.

Quoted 8 lines

---

Changes in v3: None
Changes in v2:
- New patch to remove quotation mark in CONFIG_HOSTNAME

 include/configs/x86-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-x86, thanks!

author
#7 lore raw

PATCH v3 4/12 cmd: Convert CONFIG_CMD_ELF to Kconfig

In reply to Bin Meng

Convert CONFIG_CMD_ELF to Kconfig and tidy up affected boards.

---

Changes in v3: None
Changes in v2:
- Split the defconfig reorder to another patch, making this patch as CONFIG_CMD_ELF mods only
- Update sparc and avr32 boards to unset CONFIG_CMD_ELF

 common/Kconfig                                  | 6 ++++++
 configs/atngw100_defconfig                      | 1 +
 configs/atngw100mkii_defconfig                  | 1 +
 configs/atstk1002_defconfig                     | 1 +
 configs/dbau1000_defconfig                      | 1 +
 configs/dbau1100_defconfig                      | 1 +
 configs/dbau1500_defconfig                      | 1 +
 configs/dbau1550_defconfig                      | 1 +
 configs/dbau1550_el_defconfig                   | 1 +
 configs/dlvision-10g_defconfig                  | 1 +
 configs/dlvision_defconfig                      | 1 +
 configs/gr_cpci_ax2000_defconfig                | 1 +
 configs/gr_ep2s60_defconfig                     | 1 +
 configs/gr_xc3s_1500_defconfig                  | 1 +
 configs/grasshopper_defconfig                   | 1 +
 configs/grsim_defconfig                         | 1 +
 configs/grsim_leon2_defconfig                   | 1 +
 configs/io_defconfig                            | 1 +
 configs/iocon_defconfig                         | 1 +
 configs/neo_defconfig                           | 1 +
 configs/pb1000_defconfig                        | 1 +
 configs/sandbox_defconfig                       | 1 +
 configs/vct_platinum_onenand_small_defconfig    | 1 +
 configs/vct_platinum_small_defconfig            | 1 +
 configs/vct_platinumavc_onenand_small_defconfig | 1 +
 configs/vct_platinumavc_small_defconfig         | 1 +
 configs/vct_premium_onenand_small_defconfig     | 1 +
 configs/vct_premium_small_defconfig             | 1 +
 include/config_cmd_all.h                        | 1 -
 include/config_distro_defaults.h                | 1 -
 include/configs/B4860QDS.h                      | 1 -
 include/configs/BSC9131RDB.h                    | 1 -
 include/configs/BSC9132QDS.h                    | 1 -
 include/configs/C29XPCIE.h                      | 1 -
 include/configs/CPCI2DP.h                       | 1 -
 include/configs/CPCI4052.h                      | 1 -
 include/configs/M5208EVBE.h                     | 1 -
 include/configs/M52277EVB.h                     | 1 -
 include/configs/M5235EVB.h                      | 1 -
 include/configs/M5272C3.h                       | 1 -
 include/configs/M5275EVB.h                      | 1 -
 include/configs/M53017EVB.h                     | 1 -
 include/configs/M5329EVB.h                      | 1 -
 include/configs/M5373EVB.h                      | 1 -
 include/configs/M54418TWR.h                     | 1 -
 include/configs/M54451EVB.h                     | 1 -
 include/configs/M54455EVB.h                     | 1 -
 include/configs/M5475EVB.h                      | 1 -
 include/configs/M5485EVB.h                      | 1 -
 include/configs/MIP405.h                        | 1 -
 include/configs/MPC8536DS.h                     | 1 -
 include/configs/MPC8540ADS.h                    | 1 -
 include/configs/MPC8541CDS.h                    | 1 -
 include/configs/MPC8544DS.h                     | 1 -
 include/configs/MPC8548CDS.h                    | 1 -
 include/configs/MPC8555CDS.h                    | 1 -
 include/configs/MPC8560ADS.h                    | 1 -
 include/configs/MPC8568MDS.h                    | 1 -
 include/configs/MPC8569MDS.h                    | 1 -
 include/configs/MPC8572DS.h                     | 1 -
 include/configs/P1010RDB.h                      | 1 -
 include/configs/P1022DS.h                       | 1 -
 include/configs/P2041RDB.h                      | 1 -
 include/configs/PIP405.h                        | 1 -
 include/configs/PLU405.h                        | 1 -
 include/configs/PMC405DE.h                      | 1 -
 include/configs/PMC440.h                        | 1 -
 include/configs/T102xQDS.h                      | 1 -
 include/configs/T102xRDB.h                      | 1 -
 include/configs/T1040QDS.h                      | 1 -
 include/configs/T104xRDB.h                      | 1 -
 include/configs/T208xQDS.h                      | 1 -
 include/configs/T208xRDB.h                      | 1 -
 include/configs/T4240RDB.h                      | 1 -
 include/configs/TQM823L.h                       | 1 -
 include/configs/TQM823M.h                       | 1 -
 include/configs/TQM850L.h                       | 1 -
 include/configs/TQM850M.h                       | 1 -
 include/configs/TQM855L.h                       | 1 -
 include/configs/TQM855M.h                       | 1 -
 include/configs/TQM860L.h                       | 1 -
 include/configs/TQM860M.h                       | 1 -
 include/configs/TQM862L.h                       | 1 -
 include/configs/TQM862M.h                       | 1 -
 include/configs/TQM866M.h                       | 1 -
 include/configs/UCP1020.h                       | 1 -
 include/configs/VCMA9.h                         | 1 -
 include/configs/VOM405.h                        | 1 -
 include/configs/amcc-common.h                   | 1 -
 include/configs/arcangel4.h                     | 1 -
 include/configs/astro_mcf5373l.h                | 1 -
 include/configs/axs101.h                        | 1 -
 include/configs/bf537-minotaur.h                | 1 -
 include/configs/bf537-srv1.h                    | 1 -
 include/configs/bfin_adi_common.h               | 1 -
 include/configs/blackstamp.h                    | 1 -
 include/configs/blackvme.h                      | 1 -
 include/configs/controlcenterd.h                | 1 -
 include/configs/corenet_ds.h                    | 1 -
 include/configs/dbau1x00.h                      | 1 -
 include/configs/digsy_mtc.h                     | 1 -
 include/configs/dlvision-10g.h                  | 1 -
 include/configs/dlvision.h                      | 1 -
 include/configs/io.h                            | 1 -
 include/configs/iocon.h                         | 1 -
 include/configs/km/km_arm.h                     | 1 -
 include/configs/lsxl.h                          | 1 -
 include/configs/malta.h                         | 1 -
 include/configs/mecp5123.h                      | 1 -
 include/configs/motionpro.h                     | 1 -
 include/configs/munices.h                       | 1 -
 include/configs/neo.h                           | 1 -
 include/configs/nitrogen6x.h                    | 1 -
 include/configs/openrisc-generic.h              | 1 -
 include/configs/origen.h                        | 1 -
 include/configs/p1_p2_rdb_pc.h                  | 1 -
 include/configs/p1_twr.h                        | 1 -
 include/configs/pb1x00.h                        | 2 --
 include/configs/qemu-mips.h                     | 1 -
 include/configs/qemu-mips64.h                   | 1 -
 include/configs/qemu-ppce500.h                  | 1 -
 include/configs/sandbox.h                       | 1 -
 include/configs/sbc8548.h                       | 1 -
 include/configs/smdk2410.h                      | 1 -
 include/configs/smdkc100.h                      | 1 -
 include/configs/smdkv310.h                      | 1 -
 include/configs/t4qds.h                         | 1 -
 include/configs/tb100.h                         | 1 -
 include/configs/vct.h                           | 2 --
 include/configs/vme8349.h                       | 1 -
 include/configs/x86-common.h                    | 1 -
 include/configs/xilinx-ppc.h                    | 1 -
 include/configs/xilinx_zynqmp.h                 | 1 -
 include/configs/xpedite1000.h                   | 1 -
 include/configs/xpedite517x.h                   | 1 -
 include/configs/xpedite520x.h                   | 1 -
 include/configs/xpedite537x.h                   | 1 -
 include/configs/xpedite550x.h                   | 1 -
 include/configs/zmx25.h                         | 1 -
 include/configs/zynq-common.h                   | 1 -
 140 files changed, 33 insertions(+), 114 deletions(-)
common/Kconfig +6 -0
index 2c42b8e..0d44993 100644
@@ -148,6 +148,12 @@ config CMD_BOOTM
 	help
 	  Boot an application image from the memory.
 
+config CMD_ELF
+	bool "bootelf, bootvx"
+	default y
+	help
+	  Boot an ELF/vxWorks image from the memory.
+
 config CMD_GO
 	bool "go"
 	default y
configs/atngw100_defconfig +1 -0
index 043f6bf..5b01c18 100644
@@ -5,6 +5,7 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
configs/atngw100mkii_defconfig +1 -0
index c8d9107..48ea9ba 100644
@@ -5,6 +5,7 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
configs/atstk1002_defconfig +1 -0
index d525868..1b108e5 100644
@@ -5,6 +5,7 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_XIMG is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SOURCE is not set
configs/dbau1000_defconfig +1 -0
index 5ffe104..c69d404 100644
@@ -3,6 +3,7 @@ CONFIG_TARGET_DBAU1X00=y
 CONFIG_SYS_EXTRA_OPTIONS="DBAU1000"
 CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_LOADB is not set
configs/dbau1100_defconfig +1 -0
index 84e369a..2e38812 100644
@@ -3,6 +3,7 @@ CONFIG_TARGET_DBAU1X00=y
 CONFIG_DBAU1100=y
 CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_LOADB is not set
configs/dbau1500_defconfig +1 -0
index 8a9583b..f61e7b6 100644
@@ -3,6 +3,7 @@ CONFIG_TARGET_DBAU1X00=y
 CONFIG_DBAU1500=y
 CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_LOADB is not set
configs/dbau1550_defconfig +1 -0
index 333a922..7f1bdf4 100644
@@ -3,6 +3,7 @@ CONFIG_TARGET_DBAU1X00=y
 CONFIG_DBAU1550=y
 CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FPGA is not set
configs/dbau1550_el_defconfig +1 -0
index 5970e43..6cd0161 100644
@@ -4,6 +4,7 @@ CONFIG_DBAU1550=y
 CONFIG_SYS_LITTLE_ENDIAN=y
 CONFIG_SYS_PROMPT="DbAu1xx0 # "
 # CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_FPGA is not set
configs/dlvision-10g_defconfig +1 -0
index 4ed14f8..04037ba 100644
@@ -3,4 +3,5 @@ CONFIG_4xx=y
 CONFIG_TARGET_DLVISION_10G=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_NFS is not set
configs/dlvision_defconfig +1 -0
index 7982c17..97bdd51 100644
@@ -1,4 +1,5 @@
 CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_DLVISION=y
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_NFS is not set
configs/gr_cpci_ax2000_defconfig +1 -0
index f003d77..ddac3ab 100644
@@ -1,4 +1,5 @@
 CONFIG_SPARC=y
 CONFIG_TARGET_GR_CPCI_AX2000=y
 CONFIG_SYS_TEXT_BASE=0x00000000
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_SETEXPR is not set
configs/gr_ep2s60_defconfig +1 -0
index bbf1808..0064554 100644
@@ -1,4 +1,5 @@
 CONFIG_SPARC=y
 CONFIG_TARGET_GR_EP2S60=y
 CONFIG_SYS_TEXT_BASE=0x00000000
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_SETEXPR is not set
configs/gr_xc3s_1500_defconfig +1 -0
index 5c1442d..a05b709 100644
@@ -1,4 +1,5 @@
 CONFIG_SPARC=y
 CONFIG_TARGET_GR_XC3S_1500=y
 CONFIG_SYS_TEXT_BASE=0x00000000
+# CONFIG_CMD_ELF is not sets
 # CONFIG_CMD_SETEXPR is not set
configs/grasshopper_defconfig +1 -0
index 92a73e2..6c5c9e3 100644
@@ -5,5 +5,6 @@ CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
configs/grsim_defconfig +1 -0
index b83abb6..f0fa23f 100644
@@ -2,6 +2,7 @@ CONFIG_SPARC=y
 CONFIG_TARGET_GRSIM=y
 CONFIG_SYS_TEXT_BASE=0x00000000
 # CONFIG_CMD_BOOTD is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_EDITENV is not set
configs/grsim_leon2_defconfig +1 -0
index 756a786..9c9c968 100644
@@ -2,6 +2,7 @@ CONFIG_SPARC=y
 CONFIG_TARGET_GRSIM_LEON2=y
 CONFIG_SYS_TEXT_BASE=0x00000000
 # CONFIG_CMD_BOOTD is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMI is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_EDITENV is not set
configs/io_defconfig +1 -0
index 722d95a..7b71805 100644
@@ -3,4 +3,5 @@ CONFIG_4xx=y
 CONFIG_TARGET_IO=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_NFS is not set
configs/iocon_defconfig +1 -0
index 89e5cf5..63f0c37 100644
@@ -3,4 +3,5 @@ CONFIG_4xx=y
 CONFIG_TARGET_IOCON=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_STOP_STR=" "
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_NFS is not set
configs/neo_defconfig +1 -0
index 77eefe9..1ef57ad 100644
@@ -1,4 +1,5 @@
 CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_NEO=y
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_NFS is not set
configs/pb1000_defconfig +1 -0
index f24cd07..131014d 100644
@@ -3,6 +3,7 @@ CONFIG_TARGET_PB1X00=y
 CONFIG_SYS_EXTRA_OPTIONS="PB1000"
 CONFIG_SYS_PROMPT="Pb1x00 # "
 # CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_RUN is not set
 # CONFIG_CMD_SAVEENV is not set
 # CONFIG_CMD_LOADB is not set
configs/sandbox_defconfig +1 -0
index ae96b63..3fd7813 100644
@@ -3,6 +3,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sandbox"
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_SIGNATURE=y
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
configs/vct_platinum_onenand_small_defconfig +1 -0
index 33ce32a..47985cd 100644
@@ -6,6 +6,7 @@ CONFIG_VCT_SMALL_IMAGE=y
 CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
configs/vct_platinum_small_defconfig +1 -0
index ceb61e1..f85d3f7 100644
@@ -5,6 +5,7 @@ CONFIG_VCT_SMALL_IMAGE=y
 CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
configs/vct_platinumavc_onenand_small_defconfig +1 -0
index 1958fcd..77dd414 100644
@@ -6,6 +6,7 @@ CONFIG_VCT_SMALL_IMAGE=y
 CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
configs/vct_platinumavc_small_defconfig +1 -0
index 0ac2def..8fe82fc 100644
@@ -5,6 +5,7 @@ CONFIG_VCT_SMALL_IMAGE=y
 CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
configs/vct_premium_onenand_small_defconfig +1 -0
index 471a005..ac6f422 100644
@@ -6,6 +6,7 @@ CONFIG_VCT_SMALL_IMAGE=y
 CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
configs/vct_premium_small_defconfig +1 -0
index 68c0d9a..3297434 100644
@@ -5,6 +5,7 @@ CONFIG_VCT_SMALL_IMAGE=y
 CONFIG_SYS_PROMPT="$ "
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
 # CONFIG_CMD_CRC32 is not set
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
include/config_cmd_all.h +0 -1
index 4c46dda..8832552 100644
@@ -29,7 +29,6 @@
 #define CONFIG_CMD_DOC		/* Disk-On-Chip Support		*/
 #define CONFIG_CMD_DTT		/* Digital Therm and Thermostat */
 #define CONFIG_CMD_EEPROM	/* EEPROM read/write support	*/
-#define CONFIG_CMD_ELF		/* ELF (VxWorks) load/boot cmd	*/
 #define CONFIG_CMD_EXT2		/* EXT2 Support			*/
 #define CONFIG_CMD_FAT		/* FAT support			*/
 #define CONFIG_CMD_FDC		/* Floppy Disk Support		*/
include/config_distro_defaults.h +0 -1
index d8165cc..9d1de55 100644
@@ -49,7 +49,6 @@
 #define CONFIG_CMD_BOOTZ
 #endif
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_EXT4
 #define CONFIG_CMD_FAT
include/configs/B4860QDS.h +0 -1
index 1e458f4..858e25d 100644
@@ -756,7 +756,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/BSC9131RDB.h +0 -1
index a7c9277..226a170 100644
@@ -342,7 +342,6 @@ extern unsigned long get_sdram_size(void);
  */
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ERRATA
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_IRQ
include/configs/BSC9132QDS.h +0 -1
index 804493e..e545447 100644
@@ -580,7 +580,6 @@ combinations. this should be removed later
  */
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
include/configs/C29XPCIE.h +0 -1
index 6c39b1e..f574994 100644
@@ -494,7 +494,6 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_ERRATA
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/CPCI2DP.h +0 -1
index 638a586..ce7bc35 100644
@@ -55,7 +55,6 @@
  */
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_IRQ
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_BSP
 #define CONFIG_CMD_EEPROM
include/configs/CPCI4052.h +0 -1
index 9c25751..2827a04 100644
@@ -72,7 +72,6 @@
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_FAT
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
include/configs/M5208EVBE.h +0 -1
index 5e15dd9..b38a349 100644
@@ -23,7 +23,6 @@
 
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
-#define CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/M52277EVB.h +0 -1
index d1cadc0..ffee225 100644
@@ -39,7 +39,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_REGINFO
include/configs/M5235EVB.h +0 -1
index 1472672..2a198e5 100644
@@ -37,7 +37,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PCI
include/configs/M5272C3.h +0 -1
index 006f2d8..718f31f 100644
@@ -59,7 +59,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
-#define CONFIG_CMD_ELF
 
 
 #define CONFIG_BOOTDELAY	5
include/configs/M5275EVB.h +0 -1
index 116e8e2..195595f 100644
@@ -58,7 +58,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_DHCP
 
include/configs/M53017EVB.h +0 -1
index a48ae6b..42cbb0f 100644
@@ -29,7 +29,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/M5329EVB.h +0 -1
index e806b7a..b2d544c 100644
@@ -29,7 +29,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/M5373EVB.h +0 -1
index 1df98f7..a906204 100644
@@ -29,7 +29,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/M54418TWR.h +0 -1
index db0ddcd..927b7da 100644
@@ -41,7 +41,6 @@
 #define CONFIG_CMD_CACHE
 #undef CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_UBI
include/configs/M54451EVB.h +0 -1
index de747a4..61ebb24 100644
@@ -42,7 +42,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #undef CONFIG_CMD_JFFS2
 #define CONFIG_CMD_MII
include/configs/M54455EVB.h +0 -1
index 06da5f0..f813dab 100644
@@ -42,7 +42,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
include/configs/M5475EVB.h +0 -1
index e30b645..81ecbc8 100644
@@ -31,7 +31,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #undef CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PCI
include/configs/M5485EVB.h +0 -1
index 051c940..8621d7a 100644
@@ -31,7 +31,6 @@
 /* Command line configuration */
 #define CONFIG_CMD_CACHE
 #undef CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PCI
include/configs/MIP405.h +0 -1
index cb21b73..0757e67 100644
@@ -55,7 +55,6 @@
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IDE
include/configs/MPC8536DS.h +0 -1
index 1312438..7c51eef 100644
@@ -638,7 +638,6 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8540ADS.h +0 -1
index a42c936..dc6e395 100644
@@ -353,7 +353,6 @@
  */
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 
 #if defined(CONFIG_PCI)
include/configs/MPC8541CDS.h +0 -1
index 8942aae..bf03603 100644
@@ -372,7 +372,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8544DS.h +0 -1
index 67fac70..bef28b3 100644
@@ -387,7 +387,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8548CDS.h +0 -1
index 842afe1..2bea604 100644
@@ -496,7 +496,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8555CDS.h +0 -1
index 2e8db5a..80b14cb 100644
@@ -370,7 +370,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8560ADS.h +0 -1
index fabe6bf..e1bc8cc 100644
@@ -389,7 +389,6 @@
  */
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8568MDS.h +0 -1
index 7a2131b..064bd85 100644
@@ -392,7 +392,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8569MDS.h +0 -1
index 9e38724..0af670b 100644
@@ -482,7 +482,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 
include/configs/MPC8572DS.h +0 -1
index f3334ad..4b5467b 100644
@@ -597,7 +597,6 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_REGINFO
 
 #if defined(CONFIG_PCI)
include/configs/P1010RDB.h +0 -1
index 8ac7000..b85e195 100644
@@ -813,7 +813,6 @@ extern unsigned long get_sdram_size(void);
  */
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_ERRATA
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/P1022DS.h +0 -1
index 06b293f..95c81ab 100644
@@ -678,7 +678,6 @@
 /*
  * Command line configuration.
  */
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_I2C
include/configs/P2041RDB.h +0 -1
index 5468495..de205e8 100644
@@ -618,7 +618,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/PIP405.h +0 -1
index c9d08e6..4601bc8 100644
@@ -53,7 +53,6 @@
 #define CONFIG_CMD_SCSI
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_USB
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_SDRAM
include/configs/PLU405.h +0 -1
index 3a71ff8..d5d3092 100644
@@ -66,7 +66,6 @@
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_FAT
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_I2C
include/configs/PMC405DE.h +0 -1
index 5712298..2f35ca9 100644
@@ -59,7 +59,6 @@
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_MII
include/configs/PMC440.h +0 -1
index 17bd180..fad5744 100644
@@ -276,7 +276,6 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
include/configs/T102xQDS.h +0 -1
index 92f51f6..c9e5ea9 100644
@@ -850,7 +850,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/T102xRDB.h +0 -1
index 324f710..0601d73 100644
@@ -852,7 +852,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/T1040QDS.h +0 -1
index 1f46160..4b735b5 100644
@@ -723,7 +723,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/T104xRDB.h +0 -1
index 5b61b56..7f8d110 100644
@@ -787,7 +787,6 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_rcw.cfg
 #define CONFIG_CMD_DATE
 #endif
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/T208xQDS.h +0 -1
index 23ca0cf..a804cbe 100644
@@ -792,7 +792,6 @@ unsigned long get_board_ddr_clk(void);
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/T208xRDB.h +0 -1
index ef42b88..307a0ea 100644
@@ -748,7 +748,6 @@ unsigned long get_board_ddr_clk(void);
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_I2C
include/configs/T4240RDB.h +0 -1
index d43f6b7..754d182 100644
@@ -318,7 +318,6 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/TQM823L.h +0 -1
index 9b9217e..cea3149 100644
@@ -109,7 +109,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM823M.h +0 -1
index 5240e0f..85215b1 100644
@@ -107,7 +107,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM850L.h +0 -1
index edadf55..97a9fa7 100644
@@ -97,7 +97,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM850M.h +0 -1
index 166bb2c..636ffc8 100644
@@ -97,7 +97,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM855L.h +0 -1
index 8b16ad2..3c82c73 100644
@@ -100,7 +100,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM855M.h +0 -1
index 8a05fa4..66f9a88 100644
@@ -129,7 +129,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_IDE
include/configs/TQM860L.h +0 -1
index bf3a25b..3e20c71 100644
@@ -100,7 +100,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM860M.h +0 -1
index 47e5c6c..be1cd3a 100644
@@ -100,7 +100,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM862L.h +0 -1
index fa892a9..f07b903 100644
@@ -103,7 +103,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM862M.h +0 -1
index 13319f2..c887a39 100644
@@ -103,7 +103,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/TQM866M.h +0 -1
index 0e378f2..a037b4f 100644
@@ -143,7 +143,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_JFFS2
include/configs/UCP1020.h +0 -1
index 629be99..0801117 100644
@@ -494,7 +494,6 @@
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_MII
include/configs/VCMA9.h +0 -1
index 5b2e092..bfcfb40 100644
@@ -55,7 +55,6 @@
 #define CONFIG_CMD_USB
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_BSP
include/configs/VOM405.h +0 -1
index ddd6377..99ee78b 100644
@@ -62,7 +62,6 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_BSP
 #define CONFIG_CMD_IRQ
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
include/configs/amcc-common.h +0 -1
index 37dac7d..c5ef650 100644
@@ -60,7 +60,6 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_DIAG
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
include/configs/arcangel4.h +0 -1
index a342d7e..63f61ae 100644
@@ -41,7 +41,6 @@
 /*
  * Command line configuration
  */
-#define CONFIG_CMD_ELF
 
 #define CONFIG_OF_LIBFDT
 
include/configs/astro_mcf5373l.h +0 -1
index 1c3a1c9..8606151 100644
@@ -61,7 +61,6 @@
 
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #if ENABLE_JFFS
 #define CONFIG_CMD_JFFS2
include/configs/axs101.h +0 -1
index 7cb8853..450291c 100644
@@ -123,7 +123,6 @@
  */
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MMC
include/configs/bf537-minotaur.h +0 -1
index 6674d28..c57c862 100644
@@ -153,7 +153,6 @@
 #define CONFIG_CMD_BOOTLDR
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_SF
 
include/configs/bf537-srv1.h +0 -1
index 15d912e..90aeeec 100644
@@ -152,7 +152,6 @@
 #define CONFIG_CMD_BOOTLDR
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_SF
 
include/configs/bfin_adi_common.h +0 -1
index 7b2faf2..a075050 100644
@@ -80,7 +80,6 @@
 # define CONFIG_CMD_BOOTLDR
 # define CONFIG_CMD_CACHE
 # define CONFIG_CMD_CPLBINFO
-# define CONFIG_CMD_ELF
 # define CONFIG_CMD_GPIO
 # define CONFIG_CMD_KGDB
 # define CONFIG_CMD_LDRINFO
include/configs/blackstamp.h +0 -1
index c0197ca..3b7a47f 100644
@@ -117,7 +117,6 @@
 #define CONFIG_CMD_CPLBINFO
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_SF
-#define CONFIG_CMD_ELF
 
 #define CONFIG_BOOTDELAY     5
 #define CONFIG_BOOTCOMMAND   "run ramboot"
include/configs/blackvme.h +0 -1
index 4752b07..5b15e0e 100644
@@ -156,7 +156,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_CPLBINFO
 #define CONFIG_CMD_SF
-#define CONFIG_CMD_ELF
 
 /*
  * Default: boot from SPI flash.
include/configs/controlcenterd.h +0 -1
index 9a1f6d0..c879048 100644
@@ -388,7 +388,6 @@
 
 #ifndef CONFIG_TRAILBLAZER
 
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
include/configs/corenet_ds.h +0 -1
index 2919220..878fda2 100644
@@ -628,7 +628,6 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/dbau1x00.h +0 -1
index 46e3a6c..3be44d4 100644
@@ -75,7 +75,6 @@
  * Command line configuration.
  */
 #undef CONFIG_CMD_BEDBUG
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_FAT
 #undef CONFIG_CMD_MII
 
include/configs/digsy_mtc.h +0 -1
index a7af351..02b8f91 100644
@@ -107,7 +107,6 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_DIAG
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
include/configs/dlvision-10g.h +0 -1
index e6bfe58..e39f8ba 100644
@@ -68,7 +68,6 @@
 #undef CONFIG_CMD_DHCP
 #undef CONFIG_CMD_DIAG
 #undef CONFIG_CMD_EEPROM
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_IRQ
 
include/configs/dlvision.h +0 -1
index 0299d16..3c05534 100644
@@ -64,7 +64,6 @@
 #undef CONFIG_CMD_DHCP
 #undef CONFIG_CMD_DIAG
 #undef CONFIG_CMD_EEPROM
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_IRQ
 
include/configs/io.h +0 -1
index f5b09b6..7d863fa 100644
@@ -68,7 +68,6 @@
 #undef CONFIG_CMD_DHCP
 #undef CONFIG_CMD_DIAG
 #undef CONFIG_CMD_EEPROM
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_IRQ
 
include/configs/iocon.h +0 -1
index f7ae663..a4d05e5 100644
@@ -64,7 +64,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_FPGAD
 #undef CONFIG_CMD_EEPROM
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_IRQ
 
include/configs/km/km_arm.h +0 -1
index 15fca1a..5e0f483 100644
@@ -122,7 +122,6 @@
 /*
  * Commands configuration
  */
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_MTDPARTS
 
 /*
include/configs/lsxl.h +0 -1
index 1837258..a57e328 100644
@@ -55,7 +55,6 @@
  */
 #define CONFIG_CMD_BOOTZ
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ENV
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
include/configs/malta.h +0 -1
index 2f33f63..4d3751a 100644
@@ -122,7 +122,6 @@
  */
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
include/configs/mecp5123.h +0 -1
index a8b4b24..84f1a40 100644
@@ -309,7 +309,6 @@
 #undef CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_JFFS2
-#define CONFIG_CMD_ELF
 #define CONFIG_DOS_PARTITION
 
 /*
include/configs/motionpro.h +0 -1
index 3b97d91..6eb6e51 100644
@@ -41,7 +41,6 @@
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IDE
include/configs/munices.h +0 -1
index b1b6acd..072bd95 100644
@@ -28,7 +28,6 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IMMAP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_REGINFO
include/configs/neo.h +0 -1
index 33cee43..f178366 100644
@@ -67,7 +67,6 @@
 #undef CONFIG_CMD_DHCP
 #undef CONFIG_CMD_DIAG
 #undef CONFIG_CMD_EEPROM
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_IRQ
 
include/configs/nitrogen6x.h +0 -1
index b113771..9160971 100644
@@ -330,7 +330,6 @@
 #define CONFIG_PCIE_IMX
 #endif
 
-#define CONFIG_CMD_ELF
 
 #define CONFIG_USB_GADGET
 #define CONFIG_CMD_USB_MASS_STORAGE
include/configs/openrisc-generic.h +0 -1
index 23929c2..d53e419 100644
@@ -115,7 +115,6 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_IRQ
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_BSP
 
 #define CONFIG_CMD_MII
include/configs/origen.h +0 -1
index 21d8e7a..ef80bf6 100644
@@ -51,7 +51,6 @@
 #define S5P_CHECK_LPA			0xABAD0000
 
 #undef CONFIG_CMD_PING
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FS_GENERIC
include/configs/p1_p2_rdb_pc.h +0 -1
index af89e6b..362cf30 100644
@@ -895,7 +895,6 @@
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_REGINFO
 
 /*
include/configs/p1_twr.h +0 -1
index e9cc274..588a6c5 100644
@@ -425,7 +425,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_REGINFO
 
 /*
include/configs/pb1x00.h +0 -2
index 516d381..41b7393 100644
@@ -168,13 +168,11 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 
 #undef CONFIG_CMD_FAT
 #undef CONFIG_CMD_IDE
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_BEDBUG
 
 #endif	/* __CONFIG_H */
include/configs/qemu-mips.h +0 -1
index a7ec8f5..9395bda 100644
@@ -45,7 +45,6 @@
 /*
  * Command line configuration.
  */
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_DHCP
include/configs/qemu-mips64.h +0 -1
index 4de15bf..53ff802 100644
@@ -45,7 +45,6 @@
 /*
  * Command line configuration.
  */
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_DHCP
include/configs/qemu-ppce500.h +0 -1
index 45f5e78..5cd0906 100644
@@ -158,7 +158,6 @@ extern unsigned long long get_phys_ccsrbar_addr_early(void);
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_BOOTZ
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/sandbox.h +0 -1
index 32e3a9b..c96ec90 100644
@@ -141,7 +141,6 @@
 #define CONFIG_IP_DEFRAG
 
 /* Can't boot elf images */
-#undef CONFIG_CMD_ELF
 
 #define CONFIG_CMD_HASH
 #define CONFIG_HASH_VERIFY
include/configs/sbc8548.h +0 -1
index 0717156..87e562e 100644
@@ -539,7 +539,6 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_MII
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_REGINFO
 
 #if defined(CONFIG_PCI)
include/configs/smdk2410.h +0 -1
index a6bfa76..fb38502 100644
@@ -79,7 +79,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_REGINFO
include/configs/smdkc100.h +0 -1
index 4ec9c65..1d9ce92 100644
@@ -68,7 +68,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_ONENAND
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_MTDPARTS
 
include/configs/smdkv310.h +0 -1
index dbba88b..217cfc0 100644
@@ -43,7 +43,6 @@
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_CMD_PING
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_DHCP
 
 /* MMC SPL */
include/configs/t4qds.h +0 -1
index d3138fe..26028df 100644
@@ -273,7 +273,6 @@
  * Command line configuration.
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_ERRATA
 #define CONFIG_CMD_GREPENV
 #define CONFIG_CMD_IRQ
include/configs/tb100.h +0 -1
index 41c2c72..e3c41ef 100644
@@ -69,7 +69,6 @@
  * Command line configuration
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_PING
 
 #define CONFIG_OF_LIBFDT
include/configs/vct.h +0 -2
index 80f6a60..92726c8 100644
@@ -84,7 +84,6 @@
  * Commands
  */
 #define CONFIG_CMD_DHCP
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_I2C
 
@@ -288,7 +287,6 @@ int vct_gpio_get(int pin);
 #undef CONFIG_CMD_DHCP
 #undef CONFIG_CMD_EEPROM
 #undef CONFIG_CMD_EEPROM
-#undef CONFIG_CMD_ELF
 #undef CONFIG_CMD_FAT
 #undef CONFIG_CMD_I2C
 #undef CONFIG_CMD_I2C
include/configs/vme8349.h +0 -1
index bc4a998..a6f5d6a 100644
@@ -373,7 +373,6 @@
     #undef CONFIG_CMD_ENV
 #endif
 
-#define CONFIG_CMD_ELF
 /* Pass Ethernet MAC to VxWorks */
 #define CONFIG_SYS_VXWORKS_MAC_PTR	0x000043f0
 
include/configs/x86-common.h +0 -1
index 44765f6..faadab8 100644
@@ -115,7 +115,6 @@
 #define CONFIG_CMD_EXT2
 
 #define CONFIG_CMD_ZBOOT
-#define CONFIG_CMD_ELF
 
 #define CONFIG_BOOTARGS		\
 	"root=/dev/sdb3 init=/sbin/init rootwait ro"
include/configs/xilinx-ppc.h +0 -1
index 309d68d..6bd6be8 100644
@@ -29,7 +29,6 @@
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DIAG
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_REGINFO
 #undef CONFIG_CMD_JFFS2
include/configs/xilinx_zynqmp.h +0 -1
index da87188..ed09b7f 100644
@@ -73,7 +73,6 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_FS_GENERIC
 #define CONFIG_DOS_PARTITION
-#define CONFIG_CMD_ELF
 #define CONFIG_MP
 
 #define CONFIG_CMD_MII
include/configs/xpedite1000.h +0 -1
index 4fafb5a..37a31c4 100644
@@ -191,7 +191,6 @@ extern void out32(unsigned int, unsigned long);
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_JFFS2
include/configs/xpedite517x.h +0 -1
index b5d1126..51781da 100644
@@ -532,7 +532,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_CMD_DS4510_INFO
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_JFFS2
include/configs/xpedite520x.h +0 -1
index 34a124c..e48960b 100644
@@ -315,7 +315,6 @@
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_MII
include/configs/xpedite537x.h +0 -1
index 0d24234..3645cb2 100644
@@ -387,7 +387,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_CMD_DS4510_INFO
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_MII
include/configs/xpedite550x.h +0 -1
index f30d199..7bf0cca 100644
@@ -371,7 +371,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_EEPROM
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_JFFS2
 #define CONFIG_CMD_MII
include/configs/zmx25.h +0 -1
index 81b9ce4..b7134eb 100644
@@ -84,7 +84,6 @@
  */
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_PING
-#define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_USB
 
include/configs/zynq-common.h +0 -1
index e7ab50a..873c42d 100644
@@ -289,7 +289,6 @@
 /* Boot FreeBSD/vxWorks from an ELF image */
 #if defined(CONFIG_ZYNQ_BOOT_FREEBSD)
 # define CONFIG_API
-# define CONFIG_CMD_ELF
 # define CONFIG_SYS_MMC_MAX_DEVICE	1
 #endif
 
Signature · 1 line
1.8.2.1
#8 lore raw

PATCH v3 4/12 cmd: Convert CONFIG_CMD_ELF to Kconfig

Quoted 145 lines · Bin Meng

Convert CONFIG_CMD_ELF to Kconfig and tidy up affected boards.

---

Changes in v3: None
Changes in v2:
- Split the defconfig reorder to another patch, making this patch as CONFIG_CMD_ELF mods only
- Update sparc and avr32 boards to unset CONFIG_CMD_ELF

 common/Kconfig                                  | 6 ++++++
 configs/atngw100_defconfig                      | 1 +
 configs/atngw100mkii_defconfig                  | 1 +
 configs/atstk1002_defconfig                     | 1 +
 configs/dbau1000_defconfig                      | 1 +
 configs/dbau1100_defconfig                      | 1 +
 configs/dbau1500_defconfig                      | 1 +
 configs/dbau1550_defconfig                      | 1 +
 configs/dbau1550_el_defconfig                   | 1 +
 configs/dlvision-10g_defconfig                  | 1 +
 configs/dlvision_defconfig                      | 1 +
 configs/gr_cpci_ax2000_defconfig                | 1 +
 configs/gr_ep2s60_defconfig                     | 1 +
 configs/gr_xc3s_1500_defconfig                  | 1 +
 configs/grasshopper_defconfig                   | 1 +
 configs/grsim_defconfig                         | 1 +
 configs/grsim_leon2_defconfig                   | 1 +
 configs/io_defconfig                            | 1 +
 configs/iocon_defconfig                         | 1 +
 configs/neo_defconfig                           | 1 +
 configs/pb1000_defconfig                        | 1 +
 configs/sandbox_defconfig                       | 1 +
 configs/vct_platinum_onenand_small_defconfig    | 1 +
 configs/vct_platinum_small_defconfig            | 1 +
 configs/vct_platinumavc_onenand_small_defconfig | 1 +
 configs/vct_platinumavc_small_defconfig         | 1 +
 configs/vct_premium_onenand_small_defconfig     | 1 +
 configs/vct_premium_small_defconfig             | 1 +
 include/config_cmd_all.h                        | 1 -
 include/config_distro_defaults.h                | 1 -
 include/configs/B4860QDS.h                      | 1 -
 include/configs/BSC9131RDB.h                    | 1 -
 include/configs/BSC9132QDS.h                    | 1 -
 include/configs/C29XPCIE.h                      | 1 -
 include/configs/CPCI2DP.h                       | 1 -
 include/configs/CPCI4052.h                      | 1 -
 include/configs/M5208EVBE.h                     | 1 -
 include/configs/M52277EVB.h                     | 1 -
 include/configs/M5235EVB.h                      | 1 -
 include/configs/M5272C3.h                       | 1 -
 include/configs/M5275EVB.h                      | 1 -
 include/configs/M53017EVB.h                     | 1 -
 include/configs/M5329EVB.h                      | 1 -
 include/configs/M5373EVB.h                      | 1 -
 include/configs/M54418TWR.h                     | 1 -
 include/configs/M54451EVB.h                     | 1 -
 include/configs/M54455EVB.h                     | 1 -
 include/configs/M5475EVB.h                      | 1 -
 include/configs/M5485EVB.h                      | 1 -
 include/configs/MIP405.h                        | 1 -
 include/configs/MPC8536DS.h                     | 1 -
 include/configs/MPC8540ADS.h                    | 1 -
 include/configs/MPC8541CDS.h                    | 1 -
 include/configs/MPC8544DS.h                     | 1 -
 include/configs/MPC8548CDS.h                    | 1 -
 include/configs/MPC8555CDS.h                    | 1 -
 include/configs/MPC8560ADS.h                    | 1 -
 include/configs/MPC8568MDS.h                    | 1 -
 include/configs/MPC8569MDS.h                    | 1 -
 include/configs/MPC8572DS.h                     | 1 -
 include/configs/P1010RDB.h                      | 1 -
 include/configs/P1022DS.h                       | 1 -
 include/configs/P2041RDB.h                      | 1 -
 include/configs/PIP405.h                        | 1 -
 include/configs/PLU405.h                        | 1 -
 include/configs/PMC405DE.h                      | 1 -
 include/configs/PMC440.h                        | 1 -
 include/configs/T102xQDS.h                      | 1 -
 include/configs/T102xRDB.h                      | 1 -
 include/configs/T1040QDS.h                      | 1 -
 include/configs/T104xRDB.h                      | 1 -
 include/configs/T208xQDS.h                      | 1 -
 include/configs/T208xRDB.h                      | 1 -
 include/configs/T4240RDB.h                      | 1 -
 include/configs/TQM823L.h                       | 1 -
 include/configs/TQM823M.h                       | 1 -
 include/configs/TQM850L.h                       | 1 -
 include/configs/TQM850M.h                       | 1 -
 include/configs/TQM855L.h                       | 1 -
 include/configs/TQM855M.h                       | 1 -
 include/configs/TQM860L.h                       | 1 -
 include/configs/TQM860M.h                       | 1 -
 include/configs/TQM862L.h                       | 1 -
 include/configs/TQM862M.h                       | 1 -
 include/configs/TQM866M.h                       | 1 -
 include/configs/UCP1020.h                       | 1 -
 include/configs/VCMA9.h                         | 1 -
 include/configs/VOM405.h                        | 1 -
 include/configs/amcc-common.h                   | 1 -
 include/configs/arcangel4.h                     | 1 -
 include/configs/astro_mcf5373l.h                | 1 -
 include/configs/axs101.h                        | 1 -
 include/configs/bf537-minotaur.h                | 1 -
 include/configs/bf537-srv1.h                    | 1 -
 include/configs/bfin_adi_common.h               | 1 -
 include/configs/blackstamp.h                    | 1 -
 include/configs/blackvme.h                      | 1 -
 include/configs/controlcenterd.h                | 1 -
 include/configs/corenet_ds.h                    | 1 -
 include/configs/dbau1x00.h                      | 1 -
 include/configs/digsy_mtc.h                     | 1 -
 include/configs/dlvision-10g.h                  | 1 -
 include/configs/dlvision.h                      | 1 -
 include/configs/io.h                            | 1 -
 include/configs/iocon.h                         | 1 -
 include/configs/km/km_arm.h                     | 1 -
 include/configs/lsxl.h                          | 1 -
 include/configs/malta.h                         | 1 -
 include/configs/mecp5123.h                      | 1 -
 include/configs/motionpro.h                     | 1 -
 include/configs/munices.h                       | 1 -
 include/configs/neo.h                           | 1 -
 include/configs/nitrogen6x.h                    | 1 -
 include/configs/openrisc-generic.h              | 1 -
 include/configs/origen.h                        | 1 -
 include/configs/p1_p2_rdb_pc.h                  | 1 -
 include/configs/p1_twr.h                        | 1 -
 include/configs/pb1x00.h                        | 2 --
 include/configs/qemu-mips.h                     | 1 -
 include/configs/qemu-mips64.h                   | 1 -
 include/configs/qemu-ppce500.h                  | 1 -
 include/configs/sandbox.h                       | 1 -
 include/configs/sbc8548.h                       | 1 -
 include/configs/smdk2410.h                      | 1 -
 include/configs/smdkc100.h                      | 1 -
 include/configs/smdkv310.h                      | 1 -
 include/configs/t4qds.h                         | 1 -
 include/configs/tb100.h                         | 1 -
 include/configs/vct.h                           | 2 --
 include/configs/vme8349.h                       | 1 -
 include/configs/x86-common.h                    | 1 -
 include/configs/xilinx-ppc.h                    | 1 -
 include/configs/xilinx_zynqmp.h                 | 1 -
Quoted 8 lines
 include/configs/xpedite1000.h                   | 1 -
 include/configs/xpedite517x.h                   | 1 -
 include/configs/xpedite520x.h                   | 1 -
 include/configs/xpedite537x.h                   | 1 -
 include/configs/xpedite550x.h                   | 1 -
 include/configs/zmx25.h                         | 1 -
 include/configs/zynq-common.h                   | 1 -
 140 files changed, 33 insertions(+), 114 deletions(-)

Updated pcm052 and lwmon5 also.

Applied to u-boot-x86, thanks!

author
#9 lore raw

PATCH v3 5/12 cmd: Clean up cmd_elf a little bit

In reply to Bin Meng

This commit cleans up cmd_elf.c per U-Boot coding convention, and removes the unnecessary DECLARE_GLOBAL_DATA_PTR and out-of-date powerpc comments (it actually supports not only powerpc targets).

---

Changes in v3: None
Changes in v2: None

 common/cmd_elf.c | 171 ++++++++++++++++++++++++-------------------------------
 1 file changed, 73 insertions(+), 98 deletions(-)
common/cmd_elf.c +73 -98
index 22475dc..c5e4432 100644
@@ -14,23 +14,17 @@
  */
 
 #include <common.h>
-#include <bootm.h>
 #include <command.h>
-#include <linux/ctype.h>
-#include <net.h>
 #include <elf.h>
+#include <net.h>
 #include <vxworks.h>
 
-#if defined(CONFIG_WALNUT) || defined(CONFIG_SYS_VXWORKS_MAC_PTR)
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
 static unsigned long load_elf_image_phdr(unsigned long addr);
 static unsigned long load_elf_image_shdr(unsigned long addr);
 
 /* Allow ports to override the default behavior */
 static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
-			       int argc, char * const argv[])
+				     int argc, char * const argv[])
 {
 	unsigned long ret;
 
@@ -54,18 +48,16 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
 	return ret;
 }
 
-/* ======================================================================
+/*
  * Determine if a valid ELF image exists at the given memory location.
- * First looks at the ELF header magic field, the makes sure that it is
- * executable and makes sure that it is for a PowerPC.
- * ====================================================================== */
+ * First look at the ELF header magic field, then make sure that it is
+ * executable.
+ */
 int valid_elf_image(unsigned long addr)
 {
-	Elf32_Ehdr *ehdr;		/* Elf header structure pointer */
-
-	/* -------------------------------------------------- */
+	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
 
-	ehdr = (Elf32_Ehdr *) addr;
+	ehdr = (Elf32_Ehdr *)addr;
 
 	if (!IS_ELF(*ehdr)) {
 		printf("## No elf image at address 0x%08lx\n", addr);
@@ -77,27 +69,17 @@ int valid_elf_image(unsigned long addr)
 		return 0;
 	}
 
-#if 0
-	if (ehdr->e_machine != EM_PPC) {
-		printf("## Not a PowerPC elf image at address 0x%08lx\n", addr);
-		return 0;
-	}
-#endif
-
 	return 1;
 }
 
-/* ======================================================================
- * Interpreter command to boot an arbitrary ELF image from memory.
- * ====================================================================== */
+/* Interpreter command to boot an arbitrary ELF image from memory */
 int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	unsigned long addr;		/* Address of the ELF image     */
-	unsigned long rc;		/* Return value from user code  */
+	unsigned long addr; /* Address of the ELF image */
+	unsigned long rc; /* Return value from user code */
 	char *sload, *saddr;
 	const char *ep = getenv("autostart");
 
-	/* -------------------------------------------------- */
 	int rcode = 0;
 
 	sload = saddr = NULL;
@@ -138,28 +120,27 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		rcode = 1;
 
 	printf("## Application terminated, rc = 0x%lx\n", rc);
+
 	return rcode;
 }
 
-/* ======================================================================
+/*
  * Interpreter command to boot VxWorks from a memory image.  The image can
  * be either an ELF image or a raw binary.  Will attempt to setup the
  * bootline and other parameters correctly.
- * ====================================================================== */
+ */
 int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	unsigned long addr;		/* Address of image            */
-	unsigned long bootaddr;	/* Address to put the bootline */
-	char *bootline;			/* Text of the bootline        */
-	char *tmp;			/* Temporary char pointer      */
-	char build_buf[128];		/* Buffer for building the bootline */
-
-	/* ---------------------------------------------------
-	 *
+	unsigned long addr; /* Address of image */
+	unsigned long bootaddr; /* Address to put the bootline */
+	char *bootline; /* Text of the bootline */
+	char *tmp; /* Temporary char pointer */
+	char build_buf[128]; /* Buffer for building the bootline */
+
+	/*
 	 * Check the loadaddr variable.
 	 * If we don't know where the image is then we're done.
 	 */
-
 	if (argc < 2)
 		addr = load_addr;
 	else
@@ -167,7 +148,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	/*
-	 * Check to see if we need to tftp the image ourselves before starting
+	 * Check to see if we need to tftp the image ourselves
+	 * before starting
 	 */
 	if ((argc == 2) && (strcmp(argv[1], "tftp") == 0)) {
 		if (net_loop(TFTPGET) <= 0)
@@ -177,18 +159,18 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	}
 #endif
 
-	/* This should equate
-	 * to NV_RAM_ADRS + NV_BOOT_OFFSET + NV_ENET_OFFSET
+	/*
+	 * This should equate to
+	 * NV_RAM_ADRS + NV_BOOT_OFFSET + NV_ENET_OFFSET
 	 * from the VxWorks BSP header files.
 	 * This will vary from board to board
 	 */
-
 #if defined(CONFIG_WALNUT)
-	tmp = (char *) CONFIG_SYS_NVRAM_BASE_ADDR + 0x500;
+	tmp = (char *)CONFIG_SYS_NVRAM_BASE_ADDR + 0x500;
 	eth_getenv_enetaddr("ethaddr", (uchar *)build_buf);
 	memcpy(tmp, &build_buf[3], 3);
 #elif defined(CONFIG_SYS_VXWORKS_MAC_PTR)
-	tmp = (char *) CONFIG_SYS_VXWORKS_MAC_PTR;
+	tmp = (char *)CONFIG_SYS_VXWORKS_MAC_PTR;
 	eth_getenv_enetaddr("ethaddr", (uchar *)build_buf);
 	memcpy(tmp, build_buf, 6);
 #else
@@ -199,7 +181,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	 * Use bootaddr to find the location in memory that VxWorks
 	 * will look for the bootline string. The default value for
 	 * PowerPC is LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET which
-	 * defaults to 0x4200
+	 * defaults to 0x4200.
 	 */
 	tmp = getenv("bootaddr");
 	if (!tmp)
@@ -210,7 +192,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	/*
 	 * Check to see if the bootline is defined in the 'bootargs'
 	 * parameter. If it is not defined, we may be able to
-	 * construct the info
+	 * construct the info.
 	 */
 	bootline = getenv("bootargs");
 	if (bootline) {
@@ -222,10 +204,10 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		tmp = getenv("bootfile");
 		if (tmp)
 			sprintf(&build_buf[strlen(build_buf)],
-				 "%s:%s ", CONFIG_SYS_VXWORKS_SERVERNAME, tmp);
+				"%s:%s ", CONFIG_SYS_VXWORKS_SERVERNAME, tmp);
 		else
 			sprintf(&build_buf[strlen(build_buf)],
-				 "%s:file ", CONFIG_SYS_VXWORKS_SERVERNAME);
+				"%s:file ", CONFIG_SYS_VXWORKS_SERVERNAME);
 
 		tmp = getenv("ipaddr");
 		if (tmp)
@@ -241,7 +223,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #ifdef CONFIG_SYS_VXWORKS_ADD_PARAMS
 		sprintf(&build_buf[strlen(build_buf)],
-			 CONFIG_SYS_VXWORKS_ADD_PARAMS);
+			CONFIG_SYS_VXWORKS_ADD_PARAMS);
 #endif
 
 		memcpy((void *)bootaddr, build_buf,
@@ -252,51 +234,49 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	/*
 	 * If the data at the load address is an elf image, then
 	 * treat it like an elf image. Otherwise, assume that it is a
-	 * binary image
+	 * binary image.
 	 */
-
-	if (valid_elf_image(addr)) {
+	if (valid_elf_image(addr))
 		addr = load_elf_image_shdr(addr);
-	} else {
+	else
 		puts("## Not an ELF image, assuming binary\n");
-		/* leave addr as load_addr */
-	}
 
 	printf("## Using bootline (@ 0x%lx): %s\n", bootaddr,
-			(char *) bootaddr);
+	       (char *)bootaddr);
 	printf("## Starting vxWorks@0x%08lx ...\n", addr);
 
 	dcache_disable();
-	((void (*)(int)) addr) (0);
+	((void (*)(int))addr)(0);
 
 	puts("## vxWorks terminated\n");
+
 	return 1;
 }
 
-/* ======================================================================
+/*
  * A very simple elf loader, assumes the image is valid, returns the
  * entry point address.
- * ====================================================================== */
+ */
 static unsigned long load_elf_image_phdr(unsigned long addr)
 {
-	Elf32_Ehdr *ehdr;		/* Elf header structure pointer     */
-	Elf32_Phdr *phdr;		/* Program header structure pointer */
+	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
+	Elf32_Phdr *phdr; /* Program header structure pointer */
 	int i;
 
-	ehdr = (Elf32_Ehdr *) addr;
-	phdr = (Elf32_Phdr *) (addr + ehdr->e_phoff);
+	ehdr = (Elf32_Ehdr *)addr;
+	phdr = (Elf32_Phdr *)(addr + ehdr->e_phoff);
 
 	/* Load each program header */
 	for (i = 0; i < ehdr->e_phnum; ++i) {
-		void *dst = (void *)(uintptr_t) phdr->p_paddr;
-		void *src = (void *) addr + phdr->p_offset;
+		void *dst = (void *)(uintptr_t)phdr->p_paddr;
+		void *src = (void *)addr + phdr->p_offset;
 		debug("Loading phdr %i to 0x%p (%i bytes)\n",
-			i, dst, phdr->p_filesz);
+		      i, dst, phdr->p_filesz);
 		if (phdr->p_filesz)
 			memcpy(dst, src, phdr->p_filesz);
 		if (phdr->p_filesz != phdr->p_memsz)
 			memset(dst + phdr->p_filesz, 0x00,
-				phdr->p_memsz - phdr->p_filesz);
+			       phdr->p_memsz - phdr->p_filesz);
 		flush_cache((unsigned long)dst, phdr->p_filesz);
 		++phdr;
 	}
@@ -306,50 +286,46 @@ static unsigned long load_elf_image_phdr(unsigned long addr)
 
 static unsigned long load_elf_image_shdr(unsigned long addr)
 {
-	Elf32_Ehdr *ehdr;		/* Elf header structure pointer     */
-	Elf32_Shdr *shdr;		/* Section header structure pointer */
-	unsigned char *strtab = 0;	/* String table pointer             */
-	unsigned char *image;		/* Binary image pointer             */
-	int i;				/* Loop counter                     */
-
-	/* -------------------------------------------------- */
+	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
+	Elf32_Shdr *shdr; /* Section header structure pointer */
+	unsigned char *strtab = 0; /* String table pointer */
+	unsigned char *image; /* Binary image pointer */
+	int i; /* Loop counter */
 
-	ehdr = (Elf32_Ehdr *) addr;
+	ehdr = (Elf32_Ehdr *)addr;
 
 	/* Find the section header string table for output info */
-	shdr = (Elf32_Shdr *) (addr + ehdr->e_shoff +
-			       (ehdr->e_shstrndx * sizeof(Elf32_Shdr)));
+	shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
+			     (ehdr->e_shstrndx * sizeof(Elf32_Shdr)));
 
 	if (shdr->sh_type == SHT_STRTAB)
-		strtab = (unsigned char *) (addr + shdr->sh_offset);
+		strtab = (unsigned char *)(addr + shdr->sh_offset);
 
 	/* Load each appropriate section */
 	for (i = 0; i < ehdr->e_shnum; ++i) {
-		shdr = (Elf32_Shdr *) (addr + ehdr->e_shoff +
-				       (i * sizeof(Elf32_Shdr)));
+		shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
+				     (i * sizeof(Elf32_Shdr)));
 
-		if (!(shdr->sh_flags & SHF_ALLOC)
-		   || shdr->sh_addr == 0 || shdr->sh_size == 0) {
+		if (!(shdr->sh_flags & SHF_ALLOC) ||
+		    shdr->sh_addr == 0 || shdr->sh_size == 0) {
 			continue;
 		}
 
 		if (strtab) {
 			debug("%sing %s @ 0x%08lx (%ld bytes)\n",
-				(shdr->sh_type == SHT_NOBITS) ?
-					"Clear" : "Load",
-				&strtab[shdr->sh_name],
-				(unsigned long) shdr->sh_addr,
-				(long) shdr->sh_size);
+			      (shdr->sh_type == SHT_NOBITS) ? "Clear" : "Load",
+			       &strtab[shdr->sh_name],
+			       (unsigned long)shdr->sh_addr,
+			       (long)shdr->sh_size);
 		}
 
 		if (shdr->sh_type == SHT_NOBITS) {
-			memset((void *)(uintptr_t) shdr->sh_addr, 0,
-				shdr->sh_size);
+			memset((void *)(uintptr_t)shdr->sh_addr, 0,
+			       shdr->sh_size);
 		} else {
-			image = (unsigned char *) addr + shdr->sh_offset;
-			memcpy((void *)(uintptr_t) shdr->sh_addr,
-				(const void *) image,
-				shdr->sh_size);
+			image = (unsigned char *)addr + shdr->sh_offset;
+			memcpy((void *)(uintptr_t)shdr->sh_addr,
+			       (const void *)image, shdr->sh_size);
 		}
 		flush_cache(shdr->sh_addr, shdr->sh_size);
 	}
@@ -357,9 +333,8 @@ static unsigned long load_elf_image_shdr(unsigned long addr)
 	return ehdr->e_entry;
 }
 
-/* ====================================================================== */
 U_BOOT_CMD(
-	bootelf,      3,      0,      do_bootelf,
+	bootelf, 3, 0, do_bootelf,
 	"Boot from an ELF image in memory",
 	"[-p|-s] [address]\n"
 	"\t- load ELF image at [address] via program headers (-p)\n"
@@ -367,7 +342,7 @@ U_BOOT_CMD(
 );
 
 U_BOOT_CMD(
-	bootvx,      2,      0,      do_bootvx,
+	bootvx, 2, 0, do_bootvx,
 	"Boot vxWorks from an ELF image",
 	" [address] - load address of vxWorks ELF image."
 );
Signature · 1 line
1.8.2.1
#10 lore raw

PATCH v3 5/12 cmd: Clean up cmd_elf a little bit

Quoted 6 lines · Bin Meng

This commit cleans up cmd_elf.c per U-Boot coding convention, and removes the unnecessary DECLARE_GLOBAL_DATA_PTR and out-of-date powerpc comments (it actually supports not only powerpc targets).

Quoted 7 lines

---

Changes in v3: None
Changes in v2: None

 common/cmd_elf.c | 171 ++++++++++++++++++++++++-------------------------------
 1 file changed, 73 insertions(+), 98 deletions(-)

Applied to u-boot-x86, thanks!

author
#11 lore raw

PATCH v3 6/12 cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()

In reply to Bin Meng

Move load_elf_image_phdr() and load_elf_image_shdr() to the beginning of the cmd_elf.c so that forward declaration is not needed.

---

Changes in v3: None
Changes in v2: None

 common/cmd_elf.c | 161 +++++++++++++++++++++++++++----------------------------
 1 file changed, 79 insertions(+), 82 deletions(-)
common/cmd_elf.c +79 -82
index c5e4432..62863df 100644
@@ -19,8 +19,85 @@
 #include <net.h>
 #include <vxworks.h>
 
-static unsigned long load_elf_image_phdr(unsigned long addr);
-static unsigned long load_elf_image_shdr(unsigned long addr);
+/*
+ * A very simple elf loader, assumes the image is valid, returns the
+ * entry point address.
+ */
+static unsigned long load_elf_image_phdr(unsigned long addr)
+{
+	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
+	Elf32_Phdr *phdr; /* Program header structure pointer */
+	int i;
+
+	ehdr = (Elf32_Ehdr *)addr;
+	phdr = (Elf32_Phdr *)(addr + ehdr->e_phoff);
+
+	/* Load each program header */
+	for (i = 0; i < ehdr->e_phnum; ++i) {
+		void *dst = (void *)(uintptr_t)phdr->p_paddr;
+		void *src = (void *)addr + phdr->p_offset;
+		debug("Loading phdr %i to 0x%p (%i bytes)\n",
+		      i, dst, phdr->p_filesz);
+		if (phdr->p_filesz)
+			memcpy(dst, src, phdr->p_filesz);
+		if (phdr->p_filesz != phdr->p_memsz)
+			memset(dst + phdr->p_filesz, 0x00,
+			       phdr->p_memsz - phdr->p_filesz);
+		flush_cache((unsigned long)dst, phdr->p_filesz);
+		++phdr;
+	}
+
+	return ehdr->e_entry;
+}
+
+static unsigned long load_elf_image_shdr(unsigned long addr)
+{
+	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
+	Elf32_Shdr *shdr; /* Section header structure pointer */
+	unsigned char *strtab = 0; /* String table pointer */
+	unsigned char *image; /* Binary image pointer */
+	int i; /* Loop counter */
+
+	ehdr = (Elf32_Ehdr *)addr;
+
+	/* Find the section header string table for output info */
+	shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
+			     (ehdr->e_shstrndx * sizeof(Elf32_Shdr)));
+
+	if (shdr->sh_type == SHT_STRTAB)
+		strtab = (unsigned char *)(addr + shdr->sh_offset);
+
+	/* Load each appropriate section */
+	for (i = 0; i < ehdr->e_shnum; ++i) {
+		shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
+				     (i * sizeof(Elf32_Shdr)));
+
+		if (!(shdr->sh_flags & SHF_ALLOC) ||
+		    shdr->sh_addr == 0 || shdr->sh_size == 0) {
+			continue;
+		}
+
+		if (strtab) {
+			debug("%sing %s @ 0x%08lx (%ld bytes)\n",
+			      (shdr->sh_type == SHT_NOBITS) ? "Clear" : "Load",
+			       &strtab[shdr->sh_name],
+			       (unsigned long)shdr->sh_addr,
+			       (long)shdr->sh_size);
+		}
+
+		if (shdr->sh_type == SHT_NOBITS) {
+			memset((void *)(uintptr_t)shdr->sh_addr, 0,
+			       shdr->sh_size);
+		} else {
+			image = (unsigned char *)addr + shdr->sh_offset;
+			memcpy((void *)(uintptr_t)shdr->sh_addr,
+			       (const void *)image, shdr->sh_size);
+		}
+		flush_cache(shdr->sh_addr, shdr->sh_size);
+	}
+
+	return ehdr->e_entry;
+}
 
 /* Allow ports to override the default behavior */
 static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
@@ -253,86 +330,6 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	return 1;
 }
 
-/*
- * A very simple elf loader, assumes the image is valid, returns the
- * entry point address.
- */
-static unsigned long load_elf_image_phdr(unsigned long addr)
-{
-	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
-	Elf32_Phdr *phdr; /* Program header structure pointer */
-	int i;
-
-	ehdr = (Elf32_Ehdr *)addr;
-	phdr = (Elf32_Phdr *)(addr + ehdr->e_phoff);
-
-	/* Load each program header */
-	for (i = 0; i < ehdr->e_phnum; ++i) {
-		void *dst = (void *)(uintptr_t)phdr->p_paddr;
-		void *src = (void *)addr + phdr->p_offset;
-		debug("Loading phdr %i to 0x%p (%i bytes)\n",
-		      i, dst, phdr->p_filesz);
-		if (phdr->p_filesz)
-			memcpy(dst, src, phdr->p_filesz);
-		if (phdr->p_filesz != phdr->p_memsz)
-			memset(dst + phdr->p_filesz, 0x00,
-			       phdr->p_memsz - phdr->p_filesz);
-		flush_cache((unsigned long)dst, phdr->p_filesz);
-		++phdr;
-	}
-
-	return ehdr->e_entry;
-}
-
-static unsigned long load_elf_image_shdr(unsigned long addr)
-{
-	Elf32_Ehdr *ehdr; /* Elf header structure pointer */
-	Elf32_Shdr *shdr; /* Section header structure pointer */
-	unsigned char *strtab = 0; /* String table pointer */
-	unsigned char *image; /* Binary image pointer */
-	int i; /* Loop counter */
-
-	ehdr = (Elf32_Ehdr *)addr;
-
-	/* Find the section header string table for output info */
-	shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
-			     (ehdr->e_shstrndx * sizeof(Elf32_Shdr)));
-
-	if (shdr->sh_type == SHT_STRTAB)
-		strtab = (unsigned char *)(addr + shdr->sh_offset);
-
-	/* Load each appropriate section */
-	for (i = 0; i < ehdr->e_shnum; ++i) {
-		shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
-				     (i * sizeof(Elf32_Shdr)));
-
-		if (!(shdr->sh_flags & SHF_ALLOC) ||
-		    shdr->sh_addr == 0 || shdr->sh_size == 0) {
-			continue;
-		}
-
-		if (strtab) {
-			debug("%sing %s @ 0x%08lx (%ld bytes)\n",
-			      (shdr->sh_type == SHT_NOBITS) ? "Clear" : "Load",
-			       &strtab[shdr->sh_name],
-			       (unsigned long)shdr->sh_addr,
-			       (long)shdr->sh_size);
-		}
-
-		if (shdr->sh_type == SHT_NOBITS) {
-			memset((void *)(uintptr_t)shdr->sh_addr, 0,
-			       shdr->sh_size);
-		} else {
-			image = (unsigned char *)addr + shdr->sh_offset;
-			memcpy((void *)(uintptr_t)shdr->sh_addr,
-			       (const void *)image, shdr->sh_size);
-		}
-		flush_cache(shdr->sh_addr, shdr->sh_size);
-	}
-
-	return ehdr->e_entry;
-}
-
 U_BOOT_CMD(
 	bootelf, 3, 0, do_bootelf,
 	"Boot from an ELF image in memory",
Signature · 1 line
1.8.2.1
#12 lore raw

PATCH v3 6/12 cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()

Quoted 5 lines · Bin Meng

Move load_elf_image_phdr() and load_elf_image_shdr() to the beginning of the cmd_elf.c so that forward declaration is not needed.

Quoted 7 lines

---

Changes in v3: None
Changes in v2: None

 common/cmd_elf.c | 161 +++++++++++++++++++++++++++----------------------------
 1 file changed, 79 insertions(+), 82 deletions(-)

Applied to u-boot-x86, thanks!

author
#13 lore raw

PATCH v3 7/12 cmd: bootvx: Avoid strlen() calls when constructing VxWorks bootline

In reply to Bin Meng

Remember the position in the VxWorks bootline buffer to avoid the call to strlen() each time.

---

Changes in v3:
- New patch to avoid strlen() calls when constructing VxWorks bootline

Changes in v2: None

 common/cmd_elf.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
common/cmd_elf.c +10 -10
index 62863df..6c95851 100644
@@ -213,6 +213,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	char *bootline; /* Text of the bootline */
 	char *tmp; /* Temporary char pointer */
 	char build_buf[128]; /* Buffer for building the bootline */
+	int ptr = 0;
 
 	/*
 	 * Check the loadaddr variable.
@@ -277,30 +278,29 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		       max(strlen(bootline), (size_t)255));
 		flush_cache(bootaddr, max(strlen(bootline), (size_t)255));
 	} else {
-		sprintf(build_buf, CONFIG_SYS_VXWORKS_BOOT_DEVICE);
+		ptr = sprintf(build_buf, CONFIG_SYS_VXWORKS_BOOT_DEVICE);
 		tmp = getenv("bootfile");
 		if (tmp)
-			sprintf(&build_buf[strlen(build_buf)],
-				"%s:%s ", CONFIG_SYS_VXWORKS_SERVERNAME, tmp);
+			ptr += sprintf(build_buf + ptr, "%s:%s ",
+				       CONFIG_SYS_VXWORKS_SERVERNAME, tmp);
 		else
-			sprintf(&build_buf[strlen(build_buf)],
-				"%s:file ", CONFIG_SYS_VXWORKS_SERVERNAME);
+			ptr += sprintf(build_buf + ptr, "%s:file ",
+				       CONFIG_SYS_VXWORKS_SERVERNAME);
 
 		tmp = getenv("ipaddr");
 		if (tmp)
-			sprintf(&build_buf[strlen(build_buf)], "e=%s ", tmp);
+			ptr += sprintf(build_buf + ptr, "e=%s ", tmp);
 
 		tmp = getenv("serverip");
 		if (tmp)
-			sprintf(&build_buf[strlen(build_buf)], "h=%s ", tmp);
+			ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
 
 		tmp = getenv("hostname");
 		if (tmp)
-			sprintf(&build_buf[strlen(build_buf)], "tn=%s ", tmp);
+			ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
 
 #ifdef CONFIG_SYS_VXWORKS_ADD_PARAMS
-		sprintf(&build_buf[strlen(build_buf)],
-			CONFIG_SYS_VXWORKS_ADD_PARAMS);
+		ptr += sprintf(build_buf + ptr, CONFIG_SYS_VXWORKS_ADD_PARAMS);
 #endif
 
 		memcpy((void *)bootaddr, build_buf,
Signature · 1 line
1.8.2.1
#14 lore raw

PATCH v3 7/12 cmd: bootvx: Avoid strlen() calls when constructing VxWorks bootline

Quoted 7 lines · Bin Meng

Remember the position in the VxWorks bootline buffer to avoid the call to strlen() each time.

---

Quoted 7 lines

Changes in v3:
- New patch to avoid strlen() calls when constructing VxWorks bootline

Changes in v2: None

 common/cmd_elf.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
#15 lore raw

PATCH v3 7/12 cmd: bootvx: Avoid strlen() calls when constructing VxWorks bootline

Quoted 11 lines · Simon Glass
Quoted 10 lines · Bin Meng

Remember the position in the VxWorks bootline buffer to avoid the call to strlen() each time.

---

Changes in v3:
- New patch to avoid strlen() calls when constructing VxWorks bootline

Quoted 6 lines
Quoted 4 lines

Changes in v2: None

 common/cmd_elf.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Applied to u-boot-x86, thanks!

author
#16 lore raw

PATCH v3 8/12 cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline

In reply to Bin Meng

There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip.

---

Changes in v3:
- Avoid calls to strlen()

Changes in v2:
- Fix the endian issue for netmask

 common/cmd_elf.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
common/cmd_elf.c +15 -2
index 6c95851..6a09378 100644
@@ -288,13 +288,26 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 				       CONFIG_SYS_VXWORKS_SERVERNAME);
 
 		tmp = getenv("ipaddr");
-		if (tmp)
-			ptr += sprintf(build_buf + ptr, "e=%s ", tmp);
+		if (tmp) {
+			ptr += sprintf(build_buf + ptr, "e=%s", tmp);
+			tmp = getenv("netmask");
+			if (tmp) {
+				__be32 addr = getenv_ip("netmask").s_addr;
+				ptr += sprintf(build_buf + ptr, ":%08x ",
+					       ntohl(addr));
+			} else {
+				ptr += sprintf(build_buf + ptr, " ");
+			}
+		}
 
 		tmp = getenv("serverip");
 		if (tmp)
 			ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
 
+		tmp = getenv("gatewayip");
+		if (tmp)
+			ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
+
 		tmp = getenv("hostname");
 		if (tmp)
 			ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
Signature · 1 line
1.8.2.1
#17 lore raw

PATCH v3 8/12 cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline

Quoted 8 lines · Bin Meng

There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip.

---

Quoted 8 lines

Changes in v3:
- Avoid calls to strlen()

Changes in v2:
- Fix the endian issue for netmask

 common/cmd_elf.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
#18 lore raw

PATCH v3 8/12 cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline

Quoted 12 lines · Simon Glass
Quoted 11 lines · Bin Meng

There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip.

---

Changes in v3:
- Avoid calls to strlen()

Quoted 7 lines
Quoted 5 lines

Changes in v2:
- Fix the endian issue for netmask

 common/cmd_elf.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

Applied to u-boot-x86, thanks!

author
#19 lore raw

PATCH v3 9/12 cmd: bootvx: Always get VxWorks bootline from env

In reply to Bin Meng

So far VxWorks bootline can be contructed from various environment variables, but when these variables do not exist we get these from corresponding config macros. This is not helpful as it requires rebuilding U-Boot, and to make sure these config macros take effect we should not have these environment variables. This is a little bit complex and confusing.

Now we change the logic to always contruct the bootline from environments (the only single source), by adding two new variables "bootdev" and "othbootargs", and adding some comments about network related settings mentioning they are optional. The doc about the bootline handling is also updated.

---

Changes in v3: None
Changes in v2: None

 README            |  12 +-----
 common/cmd_elf.c  | 119 ++++++++++++++++++++++++++++++------------------------
 include/vxworks.h |  22 ----------
 3 files changed, 68 insertions(+), 85 deletions(-)
README +2 -10
index c22b60b..f2350ed 100644
@@ -794,18 +794,10 @@ The following options need to be configured:
 - vxWorks boot parameters:
 
 		bootvx constructs a valid bootline using the following
-		environments variables: bootfile, ipaddr, serverip, hostname.
+		environments variables: bootdev, bootfile, ipaddr, netmask,
+		serverip, gatewayip, hostname, othbootargs.
 		It loads the vxWorks image pointed bootfile.
 
-		CONFIG_SYS_VXWORKS_BOOT_DEVICE - The vxworks device name
-		CONFIG_SYS_VXWORKS_MAC_PTR - Ethernet 6 byte MA -address
-		CONFIG_SYS_VXWORKS_SERVERNAME - Name of the server
-		CONFIG_SYS_VXWORKS_BOOT_ADDR - Address of boot parameters
-
-		CONFIG_SYS_VXWORKS_ADD_PARAMS
-
-		Add it at the end of the bootline. E.g "u=username pw=secret"
-
 		Note: If a "bootargs" environment is defined, it will overwride
 		the defaults discussed just above.
 
common/cmd_elf.c +66 -53

142 lines not on this page · raw message

include/vxworks.h +0 -22
index 122043c..297a70f 100644
@@ -13,26 +13,4 @@ void boot_prep_vxworks(bootm_headers_t *images);
 void boot_jump_vxworks(bootm_headers_t *images);
 void do_bootvx_fdt(bootm_headers_t *images);
 
-/*
- * Use bootaddr to find the location in memory that VxWorks
- * will look for the bootline string. The default value for
- * PowerPC is LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET which
- * defaults to 0x4200
- */
-#ifndef CONFIG_SYS_VXWORKS_BOOT_ADDR
-#define CONFIG_SYS_VXWORKS_BOOT_ADDR 0x4200
-#endif
-
-#ifndef CONFIG_SYS_VXWORKS_BOOT_DEVICE
-#if defined(CONFIG_4xx)
-#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "emac(0,0)"
-#else
-#define		CONFIG_SYS_VXWORKS_BOOT_DEVICE "eth(0,0)"
-#endif
-#endif
-
-#ifndef CONFIG_SYS_VXWORKS_SERVERNAME
-#define CONFIG_SYS_VXWORKS_SERVERNAME	"srv"
-#endif
-
 #endif
Signature · 1 line
1.8.2.1
#20 lore raw

PATCH v3 9/12 cmd: bootvx: Always get VxWorks bootline from env

Quoted 18 lines · Bin Meng

So far VxWorks bootline can be contructed from various environment variables, but when these variables do not exist we get these from corresponding config macros. This is not helpful as it requires rebuilding U-Boot, and to make sure these config macros take effect we should not have these environment variables. This is a little bit complex and confusing.

Now we change the logic to always contruct the bootline from environments (the only single source), by adding two new variables "bootdev" and "othbootargs", and adding some comments about network related settings mentioning they are optional. The doc about the bootline handling is also updated.

---

Quoted 7 lines

Changes in v3: None
Changes in v2: None

 README            |  12 +-----
 common/cmd_elf.c  | 119 ++++++++++++++++++++++++++++++------------------------
 include/vxworks.h |  22 ----------
 3 files changed, 68 insertions(+), 85 deletions(-)

Applied to u-boot-x86, thanks!

author
#21 lore raw

PATCH v3 10/12 cmd: bootvx: Pass E820 information to an x86 VxWorks kernel

In reply to Bin Meng

E820 is critical to the kernel as it provides system memory map information. Pass it to an x86 VxWorks kernel.

---

Changes in v3: None
Changes in v2: None

 common/cmd_elf.c  | 30 ++++++++++++++++++++++++++++++
 include/vxworks.h | 29 +++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
common/cmd_elf.c +30 -0
index da70ef3..d6a2036 100644
@@ -18,6 +18,9 @@
 #include <elf.h>
 #include <net.h>
 #include <vxworks.h>
+#ifdef CONFIG_X86
+#include <asm/e820.h>
+#endif
 
 /*
  * A very simple elf loader, assumes the image is valid, returns the
@@ -214,6 +217,10 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	char *tmp; /* Temporary char pointer */
 	char build_buf[128]; /* Buffer for building the bootline */
 	int ptr = 0;
+#ifdef CONFIG_X86
+	struct e820info *info;
+	struct e820entry *data;
+#endif
 
 	/*
 	 * Check the loadaddr variable.
@@ -336,6 +343,29 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		       (char *)bootaddr);
 	}
 
+#ifdef CONFIG_X86
+	/*
+	 * Since E820 information is critical to the kernel, if we don't
+	 * specify these in the environments, use a default one.
+	 */
+	tmp = getenv("e820data");
+	if (tmp)
+		data = (struct e820entry *)simple_strtoul(tmp, NULL, 16);
+	else
+		data = (struct e820entry *)VXWORKS_E820_DATA_ADDR;
+	tmp = getenv("e820info");
+	if (tmp)
+		info = (struct e820info *)simple_strtoul(tmp, NULL, 16);
+	else
+		info = (struct e820info *)VXWORKS_E820_INFO_ADDR;
+
+	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;
+#endif
+
 	/*
 	 * If the data at the load address is an elf image, then
 	 * treat it like an elf image. Otherwise, assume that it is a
include/vxworks.h +29 -0
index 297a70f..f69b008 100644
@@ -8,6 +8,35 @@
 #ifndef _VXWORKS_H_
 #define _VXWORKS_H_
 
+/*
+ * VxWorks x86 E820 related stuff
+ *
+ * VxWorks on x86 gets E820 information from pre-defined address @
+ * 0x4a00 and 0x4000. At 0x4a00 it's an information table defined
+ * by VxWorks and the actual E820 table entries starts from 0x4000.
+ * As defined by the BIOS E820 spec, the maximum number of E820 table
+ * entries is 128 and each entry occupies 20 bytes, so it's 128 * 20
+ * = 2560 (0xa00) bytes in total. That's where VxWorks stores some
+ * information that is retrieved from the BIOS E820 call and saved
+ * later for sanity test during the kernel boot-up.
+ */
+#define VXWORKS_E820_DATA_ADDR	0x4000
+#define VXWORKS_E820_INFO_ADDR	0x4a00
+
+/* E820 info signatiure "SMAP" - System MAP */
+#define E820_SIGNATURE	0x534d4150
+
+struct e820info {
+	u32 sign;	/* "SMAP" signature */
+	u32 x0;		/* don't care, used by VxWorks */
+	u32 x1;		/* don't care, used by VxWorks */
+	u32 x2;		/* don't care, used by VxWorks */
+	u32 addr;	/* last e820 table entry addr */
+	u32 x3;		/* don't care, used by VxWorks */
+	u32 entries;	/* e820 table entry count */
+	u32 error;	/* must be zero */
+};
+
 int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 void boot_prep_vxworks(bootm_headers_t *images);
 void boot_jump_vxworks(bootm_headers_t *images);
Signature · 1 line
1.8.2.1
author
#22 lore raw

PATCH v3 11/12 cmd: bootvx: Add asmlinkage to the VxWorks x86 entry

In reply to Bin Meng

VxWorks on x86 uses stack to pass parameters.

---

Changes in v3: None
Changes in v2:
- New patch to add asmlinkage to the VxWorks x86 entry

 common/cmd_elf.c | 6 ++++++
 1 file changed, 6 insertions(+)
common/cmd_elf.c +6 -0
index d6a2036..86e694a 100644
@@ -20,6 +20,7 @@
 #include <vxworks.h>
 #ifdef CONFIG_X86
 #include <asm/e820.h>
+#include <linux/linkage.h>
 #endif
 
 /*
@@ -379,7 +380,12 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	printf("## Starting vxWorks at 0x%08lx ...\n", addr);
 
 	dcache_disable();
+#ifdef CONFIG_X86
+	/* VxWorks on x86 uses stack to pass parameters */
+	((asmlinkage void (*)(int))addr)(0);
+#else
 	((void (*)(int))addr)(0);
+#endif
 
 	puts("## vxWorks terminated\n");
 
Signature · 1 line
1.8.2.1
#23 lore raw

PATCH v3 11/12 cmd: bootvx: Add asmlinkage to the VxWorks x86 entry

Quoted 6 lines · Bin Meng

VxWorks on x86 uses stack to pass parameters.

Quoted 8 lines

---

Changes in v3: None
Changes in v2:
- New patch to add asmlinkage to the VxWorks x86 entry

 common/cmd_elf.c | 6 ++++++
 1 file changed, 6 insertions(+)

Applied to u-boot-x86, thanks!

author
#24 lore raw

PATCH v3 12/12 doc: Complement document about booting VxWorks

In reply to Bin Meng

Current document about how to boot VxWorks is limited. Add several chapters in README.vxworks to document this.

---

Changes in v3: None
Changes in v2:
- Describe typical values for bootaddr, e820data, e820info.

 doc/README.vxworks | 82 ++++++++++++++++++++++++++++++++++++++++++++++++------
 doc/README.x86     |  2 ++
 2 files changed, 76 insertions(+), 8 deletions(-)
doc/README.vxworks +74 -8
index 4cb302e..3433e4f 100644
@@ -1,19 +1,85 @@
-From VxWorks 6.9+ (not include 6.9), VxWorks starts adopting device tree as its hardware
-decription mechansim (for PowerPC and ARM), thus requiring boot interface changes.
+#
+# Copyright (C) 2013, Miao Yan <[email protected]>
+# Copyright (C) 2015, Bin Meng <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+VxWorks Support
+===============
+
+This document describes the information about U-Boot loading VxWorks kernel.
+
+Status
+------
+U-Boot supports loading VxWorks kernels via 'bootvx' and 'bootm' commands.
+For booting old kernels (6.9.x) on PowerPC and ARM, and all kernel versions
+on other architectures, 'bootvx' shall be used. For booting VxWorks 7 kernels
+on PowerPC and ARM, 'bootm' shall be used.
+
+64-bit x86 kernel cannot be loaded as of today.
+
+VxWork 7 on PowerPC and ARM
+---------------------------
+From VxWorks 7, VxWorks starts adopting device tree as its hardware decription
+mechansim (for PowerPC and ARM), thus requiring boot interface changes.
 This section will describe the new interface.
 
-For PowerPC, the calling convention of the new VxWorks entry point conforms to the ePAPR standard,
-which is shown below (see ePAPR for more details):
+For PowerPC, the calling convention of the new VxWorks entry point conforms to
+the ePAPR standard, which is shown below (see ePAPR for more details):
 
-    void (*kernel_entry)(fdt_addr,
-              0, 0, EPAPR_MAGIC, boot_IMA, 0, 0)
+    void (*kernel_entry)(fdt_addr, 0, 0, EPAPR_MAGIC, boot_IMA, 0, 0)
 
 For ARM, the calling convention is show below:
 
     void (*kernel_entry)(void *fdt_addr)
 
-When booting new VxWorks kernel (uImage format), the parameters passed to bootm is like below:
+When booting new VxWorks kernel (uImage format), the parameters passed to bootm
+is like below:
 
     bootm <kernel image address> - <device tree address>
 
-The do_bootvx command still works as it was for older VxWorks kernels.
+VxWorks bootline
+----------------
+When using 'bootvx', the kernel bootline must be prepared by U-Boot at a
+board-specific address before loading VxWorks. U-Boot supplies its address
+via "bootaddr" environment variable. To check where the bootline should be
+for a specific board, go to the VxWorks BSP for that board, and look for a
+parameter called BOOT_LINE_ADRS. Assign its value to "bootaddr". A typical
+value for "bootaddr" is 0x101200.
+
+If a "bootargs" variable is defined, its content will be copied to the memory
+location pointed by "bootaddr" as the kernel bootline. If "bootargs" is not
+there, command 'bootvx' can construct a valid bootline using the following
+environments variables: bootdev, bootfile, ipaddr, netmask, serverip,
+gatewayip, hostname, othbootargs.
+
+When using 'bootm', just define "bootargs" in the environment and U-Boot will
+handle bootline fix up for the kernel dtb automatically.
+
+Serial console
+--------------
+It's very common that VxWorks BSPs configure a different baud rate for the
+serial console from what is being used by U-Boot. For example, VxWorks tends
+to use 9600 as the default baud rate on all x86 BSPs while U-Boot uses 115200.
+Please configure both U-Boot and VxWorks to use the same baud rate, or it may
+look like VxWorks hangs somewhere as nothing outputs on the serial console.
+
+x86-specific information
+------------------------
+Before loading an x86 kernel, two additional environment variables need to be
+provided. They are "e820data" and "e820info", which represent the address of
+E820 table and E820 information (defined by VxWorks) in system memory.
+
+Check VxWorks kernel configuration to look for BIOS_E820_DATA_START and
+BIOS_E820_INFO_START, and assign their values to "e820data" and "e820info"
+accordingly. If neither of these two are supplied, U-Boot assumes a default
+location at 0x4000 for "e820data" and 0x4a00 for "e820info". Typical values
+for "e820data" and "e820info" are 0x104000 and 0x104a00. But there is one
+exception on Intel Galileo, where "e820data" and "e820info" should be left
+unset, which assume the default location for VxWorks.
+
+Note since currently U-Boot does not support ACPI yet, VxWorks kernel must
+be configured to use MP table and virtual wire interrupt mode. This requires
+INCLUDE_MPTABLE_BOOT_OP and INCLUDE_VIRTUAL_WIRE_MODE to be included in a
+VxWorks kernel configuration.
doc/README.x86 +2 -0
index 6cf293b..a4f5321 100644
@@ -25,6 +25,8 @@ targets and all Intel boards support running U-Boot 'bare metal'.
 
 As for loading an OS, U-Boot supports directly booting a 32-bit or 64-bit
 Linux kernel as part of a FIT image. It also supports a compressed zImage.
+U-Boot supports loading an x86 VxWorks kernel. Please check README.vxworks
+for more details.
 
 Build Instructions for U-Boot as coreboot payload
 -------------------------------------------------
Signature · 1 line
1.8.2.1
#25 lore raw

PATCH v3 12/12 doc: Complement document about booting VxWorks

Quoted 8 lines · Bin Meng

Current document about how to boot VxWorks is limited. Add several chapters in README.vxworks to document this.

---

Quoted 7 lines

Changes in v3: None
Changes in v2:
- Describe typical values for bootaddr, e820data, e820info.

 doc/README.vxworks | 82 ++++++++++++++++++++++++++++++++++++++++++++++++------
 doc/README.x86     |  2 ++
 2 files changed, 76 insertions(+), 8 deletions(-)

Applied to u-boot-x86, thanks!