summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-03-30 11:52:09 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-01 11:40:32 +0200
commit940e04d181707e1d5322aa7eadc15d641928712e (patch)
tree4aa393340162a5d2d8f67148c844595a49fabbcc /arch/arm/cpu
parent02f826830fe0925ef49faaecf001df52ac45726f (diff)
downloadbarebox-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.c2
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);