mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 20:58:22 +00:00
common: command: Fix manual relocation for repeatable command
All platforms which are using MANUAL_RELOC are jumping back to origin
location when repeatable command is called. The reason is that cmd_rep link
is not updated properly. Issue can be reproduced by rewriting origin
U-Boot location through (for example) file download by tftp command.
Fixes: 80a48dd47e
("common: command: Rework the 'cmd is repeatable' logic")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
f3035cf299
commit
6f94daf915
1 changed files with 5 additions and 0 deletions
|
@ -496,6 +496,11 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size)
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
ulong addr;
|
ulong addr;
|
||||||
|
|
||||||
|
addr = (ulong)(cmdtp->cmd_rep) + gd->reloc_off;
|
||||||
|
cmdtp->cmd_rep =
|
||||||
|
(int (*)(struct cmd_tbl_s *, int, int,
|
||||||
|
char * const [], int *))addr;
|
||||||
|
|
||||||
addr = (ulong)(cmdtp->cmd) + gd->reloc_off;
|
addr = (ulong)(cmdtp->cmd) + gd->reloc_off;
|
||||||
#ifdef DEBUG_COMMANDS
|
#ifdef DEBUG_COMMANDS
|
||||||
printf("Command \"%s\": 0x%08lx => 0x%08lx\n",
|
printf("Command \"%s\": 0x%08lx => 0x%08lx\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue