Commit 60f7da1f421cbbf6f54f3e9cde4e25b0a23a928a

Authored by Heiko Schocher
Committed by Wolfgang Denk
1 parent a7d54346e0

env: fix cmd_env_sub fct pointers if CONFIG_RELOC_FIXUP_WORKS is not defined

commit ea882baf9c17cd142c99e3ff640d3ab01daa5cec introduces
a command_sub_table for the "env" command. On arm, avr32, m68k,
mips and sparc architectures, relocation needs manual fixups,
so add these fixups for this sub command table too.

Tested on arm/qong board.
          mips board (Ben NanoNote) from Xiangfu Liu
          arm/AT91 board from Reinhard Meyer

Signed-off-by: Heiko Schocher <hs@denx.de>

cc: Wolfgang Denk <wd@denx.de>
cc: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
cc: Xiangfu Liu <xiangfu@openmobilefree.net>
cc: Reinhard Meyer <u-boot@emk-elektronik.de>
cc: sshtylyov@mvista.com

Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff

... ... @@ -837,6 +837,13 @@
837 837 U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""),
838 838 };
839 839  
  840 +#if !defined(CONFIG_RELOC_FIXUP_WORKS)
  841 +void env_reloc(void)
  842 +{
  843 + fixup_cmdtable(cmd_env_sub, ARRAY_SIZE(cmd_env_sub));
  844 +}
  845 +#endif
  846 +
840 847 static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
841 848 {
842 849 cmd_tbl_t *cp;
... ... @@ -227,6 +227,11 @@
227 227  
228 228 void env_relocate (void)
229 229 {
  230 +#if !defined(CONFIG_RELOC_FIXUP_WORKS)
  231 + extern void env_reloc(void);
  232 +
  233 + env_reloc();
  234 +#endif
230 235 if (gd->env_valid == 0) {
231 236 #if defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */
232 237 set_default_env(NULL);