From: Heiko Schocher Date: Tue, 5 Oct 2010 14:17:00 +0200 Subject: [U-Boot] [PATCH v2] env: fix cmd_env_sub fct pointers if CONFIG_RELOC_FIXUP_WORKS is not defined In-Reply-To: <1286257289-22313-1-git-send-email-hs@denx.de> References: <1286257289-22313-1-git-send-email-hs@denx.de> Message-ID: <1286281020-21895-1-git-send-email-hs@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 cc: Wolfgang Denk cc: Shinya Kuribayashi cc: Xiangfu Liu cc: Reinhard Meyer cc: sshtylyov at mvista.com --- - changes since v1: fix Coding Style issue, suggested by Sergei Shtylyov common/cmd_nvedit.c | 7 +++++++ common/env_common.c | 5 +++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index c3d63b8..3d30c32 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -837,6 +837,13 @@ static cmd_tbl_t cmd_env_sub[] = { U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 0, do_env_set, "", ""), }; +#if !defined(CONFIG_RELOC_FIXUP_WORKS) +void env_reloc(void) +{ + fixup_cmdtable(cmd_env_sub, ARRAY_SIZE(cmd_env_sub)); +} +#endif + static int do_env (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *cp; diff --git a/common/env_common.c b/common/env_common.c index a415ef8..88f068c 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -227,6 +227,11 @@ int env_import(const char *buf, int check) void env_relocate (void) { +#if !defined(CONFIG_RELOC_FIXUP_WORKS) + extern void env_reloc(void); + + env_reloc(); +#endif if (gd->env_valid == 0) { #if defined(CONFIG_ENV_IS_NOWHERE) /* Environment not changable */ set_default_env(NULL); -- 1.7.2.3