ARM: pbl-multi: Fix SDRAM at end of address space
When SDRAM reaches to the end of the address space the comparison membase + memsize evaluates to 0, so pc - membase < memsize can never be true. Fix this by substracting membase on both sides of the comparison. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
02f826830f
commit
940e04d181
|
@ -60,7 +60,7 @@ void __noreturn barebox_multi_pbl_start(unsigned long membase,
|
|||
* to the current address. Otherwise it may be a readonly location.
|
||||
* Copy and relocate to the start of the memory in this case.
|
||||
*/
|
||||
if (pc > membase && pc < membase + memsize)
|
||||
if (pc > membase && pc - membase < memsize)
|
||||
relocate_to_current_adr();
|
||||
else
|
||||
relocate_to_adr(membase);
|
||||
|
|
Loading…
Reference in New Issue