[U-Boot] [PATCH 0/2] Fix onenand command after ARM relocation changes.

Hello,
After ARM relocation support the onenand command seems broken, these patches attempt to solve this issue.
The first patch fixes the usage help for onenand command when no arguments are passed.
The second patch relocate the onenand command table manually, I think this is required after relocation changes but I'm not sure if this is the best solution, so comments are welcome.
Tested on IGEP v2 and OMAP3 IGEP module boards.
Cheers, Enric
$ git diff --stat origin/master arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 9 +++++++++ 2 files changed, 12 insertions(+), 0 deletions(-)

Running the onenand command without arguments does nothing, with this patch shows the command usage.
Signed-off-by: Enric Balletbo i Serra eballetbo@iseebcn.com --- common/cmd_onenand.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c index 83d967b..317968f 100644 --- a/common/cmd_onenand.c +++ b/common/cmd_onenand.c @@ -529,6 +529,9 @@ static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[] { cmd_tbl_t *c;
+ if (argc < 2) + return cmd_usage(cmdtp); + mtd = &onenand_mtd;
/* Strip off leading 'onenand' command argument */

Dear Enric Balletbo i Serra,
In message 1287479602-21721-2-git-send-email-eballetbo@iseebcn.com you wrote:
Running the onenand command without arguments does nothing, with this patch shows the command usage.
Signed-off-by: Enric Balletbo i Serra eballetbo@iseebcn.com
common/cmd_onenand.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

We also have to relocate the onenand command table manually, otherwise onenand command don't work.
Signed-off-by: Enric Balletbo i Serra eballetbo@iseebcn.com --- arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 108e6c4..8a981e9 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -715,6 +715,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 317968f..5550b40 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;

Hello Enric,
Enric Balletbo i Serra wrote:
We also have to relocate the onenand command table manually, otherwise onenand command don't work.
Signed-off-by: Enric Balletbo i Serra eballetbo@iseebcn.com
arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
Could you try
git://git.denx.de/u-boot-arm.git elf_reloc
branch? With this branch, it is not longer necessary to do such fixups.
bye, Heiko

Hello Heiko,
2010/10/19 Heiko Schocher hs@denx.de:
Hello Enric,
Enric Balletbo i Serra wrote:
We also have to relocate the onenand command table manually, otherwise onenand command don't work.
Signed-off-by: Enric Balletbo i Serra eballetbo@iseebcn.com
arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
Could you try
git://git.denx.de/u-boot-arm.git elf_reloc
branch?
Of course :-)
With this branch, it is not longer necessary to do such fixups.
Here my tests:
U-Boot # onenand erase OneNAND erase: whole chip OK
Yes, seems the patch 2/2 it's not longer necessary, the onenand command works without this patch.
U-Boot # onenand (hang)
I think the patch 1/2 it's also necessary, otherwise the onenand command without arguments hangs.
Cheers, Enric

Dear Enric Balletbo i Serra,
In message 1287479602-21721-3-git-send-email-eballetbo@iseebcn.com you wrote:
We also have to relocate the onenand command table manually, otherwise onenand command don't work.
Signed-off-by: Enric Balletbo i Serra eballetbo@iseebcn.com
arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk

On 10/23/2010 1:56 PM, Wolfgang Denk wrote:
Dear Enric Balletbo i Serra,
In message1287479602-21721-3-git-send-email-eballetbo@iseebcn.com you wrote:
We also have to relocate the onenand command table manually, otherwise onenand command don't work.
Signed-off-by: Enric Balletbo i Serraeballetbo@iseebcn.com
arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
Is this patch still necessary? I thought the relocation change made it OBE.
Best Regards, Bill Campbell
Applied, thanks.
Best regards,
Wolfgang Denk

Hello,
2010/10/24 J. William Campbell jwilliamcampbell@comcast.net:
On 10/23/2010 1:56 PM, Wolfgang Denk wrote:
Dear Enric Balletbo i Serra,
In message1287479602-21721-3-git-send-email-eballetbo@iseebcn.com you wrote:
We also have to relocate the onenand command table manually, otherwise onenand command don't work.
Signed-off-by: Enric Balletbo i Serraeballetbo@iseebcn.com
arch/arm/lib/board.c | 3 +++ common/cmd_onenand.c | 6 ++++++ 2 files changed, 9 insertions(+), 0 deletions(-)
Is this patch still necessary? I thought the relocation change made it OBE.
As I reply to Heiko this patch [2/2] it's not necessary if elf_reloc branch is merged. OTOH I think the patch [1/2] of the same series it's necessary.
[PATCH 1/2] cmd_onenand.c: Fix command usage help.
Cheers, Enric
participants (6)
-
Enric Balletbo i Serra
-
Enric Balletbò i Serra
-
Enric Balletbò i Serra
-
Heiko Schocher
-
J. William Campbell
-
Wolfgang Denk