diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-03-30 11:52:09 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-01 11:40:32 +0200 |
commit | 940e04d181707e1d5322aa7eadc15d641928712e (patch) | |
tree | 4aa393340162a5d2d8f67148c844595a49fabbcc /arch/arm/cpu | |
parent | 02f826830fe0925ef49faaecf001df52ac45726f (diff) | |
download | barebox-940e04d181707e1d5322aa7eadc15d641928712e.tar.gz barebox-940e04d181707e1d5322aa7eadc15d641928712e.tar.xz |
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>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/uncompress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/cpu/uncompress.c b/arch/arm/cpu/uncompress.c index 5bcce6b9e3..b8e2e9ffd7 100644 --- a/arch/arm/cpu/uncompress.c +++ b/arch/arm/cpu/uncompress.c @@ -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); |