From cdb1d4f97e7e3599549852b89f2fd56cbf1e5322 Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Tue, 19 Oct 2010 11:13:22 +0200 Subject: [PATCH] ARM: fix relocation support for onenand device. We also have to relocate the onenand command table manually, otherwise onenand command don't work. Signed-off-by: Enric Balletbo i Serra --- arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index ffe261bd44..af9a414b88 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -716,6 +716,9 @@ void board_init_r (gd_t *id, ulong dest_addr) #if defined(CONFIG_CMD_I2C) i2c_reloc(); #endif +#if defined(CONFIG_CMD_ONENAND) + onenand_reloc(); +#endif #endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */ #ifdef CONFIG_LOGBUFFER diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index 83d967bd18..fe84c3be96 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -525,6 +525,12 @@ static cmd_tbl_t cmd_onenand_sub[] = { U_BOOT_CMD_MKENT(markbad, CONFIG_SYS_MAXARGS, 0, do_onenand_markbad, "", ""), }; +#ifndef CONFIG_RELOC_FIXUP_WORKS +void onenand_reloc(void) { + fixup_cmdtable(cmd_onenand_sub, ARRAY_SIZE(cmd_onenand_sub)); +} +#endif + static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { cmd_tbl_t *c; -- 2.39.5