diff options
author | Jon Loeliger <jdl@jdl.com> | 2006-06-17 18:51:09 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-21 01:01:27 -0400 |
commit | 8a30088794ff426cd3e21557db8f3d2687ac6695 (patch) | |
tree | c6265fec921408ba689ef6c0e59236c88149c52c /arch/powerpc/kernel/prom.c | |
parent | 2198c070498850c16d65c09bc587e3f5042126ef (diff) |
[POWERPC] Prevent duplicate lmb reservations for Device Tree blob.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index d77d24a89b39..629023240ece 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -1267,13 +1267,16 @@ static void __init early_reserve_mem(void) | |||
1267 | { | 1267 | { |
1268 | u64 base, size; | 1268 | u64 base, size; |
1269 | u64 *reserve_map; | 1269 | u64 *reserve_map; |
1270 | unsigned long self_base; | ||
1271 | unsigned long self_size; | ||
1270 | 1272 | ||
1271 | reserve_map = (u64 *)(((unsigned long)initial_boot_params) + | 1273 | reserve_map = (u64 *)(((unsigned long)initial_boot_params) + |
1272 | initial_boot_params->off_mem_rsvmap); | 1274 | initial_boot_params->off_mem_rsvmap); |
1273 | 1275 | ||
1274 | /* before we do anything, lets reserve the dt blob */ | 1276 | /* before we do anything, lets reserve the dt blob */ |
1275 | lmb_reserve(__pa((unsigned long)initial_boot_params), | 1277 | self_base = __pa((unsigned long)initial_boot_params); |
1276 | initial_boot_params->totalsize); | 1278 | self_size = initial_boot_params->totalsize; |
1279 | lmb_reserve(self_base, self_size); | ||
1277 | 1280 | ||
1278 | #ifdef CONFIG_PPC32 | 1281 | #ifdef CONFIG_PPC32 |
1279 | /* | 1282 | /* |
@@ -1289,6 +1292,9 @@ static void __init early_reserve_mem(void) | |||
1289 | size_32 = *(reserve_map_32++); | 1292 | size_32 = *(reserve_map_32++); |
1290 | if (size_32 == 0) | 1293 | if (size_32 == 0) |
1291 | break; | 1294 | break; |
1295 | /* skip if the reservation is for the blob */ | ||
1296 | if (base_32 == self_base && size_32 == self_size) | ||
1297 | continue; | ||
1292 | DBG("reserving: %x -> %x\n", base_32, size_32); | 1298 | DBG("reserving: %x -> %x\n", base_32, size_32); |
1293 | lmb_reserve(base_32, size_32); | 1299 | lmb_reserve(base_32, size_32); |
1294 | } | 1300 | } |
@@ -1300,6 +1306,9 @@ static void __init early_reserve_mem(void) | |||
1300 | size = *(reserve_map++); | 1306 | size = *(reserve_map++); |
1301 | if (size == 0) | 1307 | if (size == 0) |
1302 | break; | 1308 | break; |
1309 | /* skip if the reservation is for the blob */ | ||
1310 | if (base == self_base && size == self_size) | ||
1311 | continue; | ||
1303 | DBG("reserving: %llx -> %llx\n", base, size); | 1312 | DBG("reserving: %llx -> %llx\n", base, size); |
1304 | lmb_reserve(base, size); | 1313 | lmb_reserve(base, size); |
1305 | } | 1314 | } |