aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-01-11 13:35:06 +0100
committerJohn Rigby <john.rigby@linaro.org>2012-01-19 17:08:53 -0700
commit3e306c74990d447704805d2746744819ede81b9f (patch)
tree9fa72675f2fbf0226610ae9150c15b45bc0b92a8 /common
parentd8affe005c8875ba4992d4e4246adefaec1cd197 (diff)
common/image.c: align usage of fdt_high with initrd_high
The commit message of a28afca (Add uboot "fdt_high" enviroment variable) states that fdt_high behaves similarly to the existing initrd_high. But fdt_high actually has an outstanding difference from initrd_high. The former specifies the start address, while the later specifies the end address. As fdt_high and initrd_high will likely be used together, it'd be nice to have them behave same. The patch changes the behavior of fdt_high to have it aligned with initrd_high. The document of fdt_high in README is updated with an example to demonstrate the usage of this environment variable. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'common')
-rw-r--r--common/image.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/common/image.c b/common/image.c
index 77ca6e470..8c4137c60 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1288,16 +1288,14 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
if (((ulong) desired_addr) == ~0UL) {
/* All ones means use fdt in place */
- desired_addr = fdt_blob;
+ of_start = fdt_blob;
+ lmb_reserve(lmb, (ulong)of_start, of_len);
disable_relocation = 1;
- }
- if (desired_addr) {
+ } else if (desired_addr) {
of_start =
(void *)(ulong) lmb_alloc_base(lmb, of_len, 0x1000,
- ((ulong)
- desired_addr)
- + of_len);
- if (desired_addr && of_start != desired_addr) {
+ (ulong)desired_addr);
+ if (of_start == 0) {
puts("Failed using fdt_high value for Device Tree");
goto error;
}