]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
cmd_bootm.c: Correct BOOTM_ERR_OVERLAP handling
authorTom Rini <trini@ti.com>
Fri, 28 Jun 2013 15:38:02 +0000 (11:38 -0400)
committerTom Rini <trini@ti.com>
Fri, 28 Jun 2013 20:24:13 +0000 (16:24 -0400)
commitd366438d8ac80fd10110dceda9f4792f4a16ac9d
tree8c7824cd287e5a9f8978e20aeb36212c38f7746d
parent20cb5fbec649ea3f4baaa7eab1ad77e9d7dfdca5
cmd_bootm.c: Correct BOOTM_ERR_OVERLAP handling

With 35fc84fa1 [Refactor the bootm command to reduce code duplication]
we stopped checking the return value of bootm_load_os (unintentionally!)
and simply returned if we had a non-zero return value from the function.
This broke the valid case of a legacy image file of a single kernel
loaded into an overlapping memory area (the default way of booting
nearly all TI platforms).

The best way to fix this problem in the new code is to make
bootm_load_os be the one to see if we have a problem with this, and if
it's fatal return BOOTM_ERR_RESET and if it's not BOOTM_ERR_OVERLAP, so
that we can avoid calling lmb_reserve() but continue with booting.  We
however still need to handle the other BOOTM_ERR values so re-work
do_bootm_states so that we have an error handler at the bottom we can
goto for problems from bootm_load_os, or problems from the other callers
(as the code was before).  Add a comment to do_bootm_states noting the
existing restriction on negative return values.

Signed-off-by: Tom Rini <trini@ti.com>
---
Changes in v2:
- Rework so that only bootm_load_os and boot_selected_os head down into
  the err case code, and other errors simply return back to the caller.
  Fixes 'spl export'.
common/cmd_bootm.c