summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-01-01 16:17:56 -0700
committerSimon Glass <sjg@chromium.org>2015-01-13 07:24:58 -0800
commit8a388085c70d0da306cbd0dc644606cf8be24486 (patch)
treeab8682dab9bf8f5de978e16e2efef8587baf41e8 /tools
parent6c911c4322a295e0e5ab07c12c793d1f00670028 (diff)
downloadblackbird-obmc-uboot-8a388085c70d0da306cbd0dc644606cf8be24486.tar.gz
blackbird-obmc-uboot-8a388085c70d0da306cbd0dc644606cf8be24486.zip
x86: Correct ifdtool microcode calculation
This currently assumes that U-Boot resides at the start of ROM. Update it to remove this assumption. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/ifdtool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ifdtool.c b/tools/ifdtool.c
index fe8366ba4f..590ccc914b 100644
--- a/tools/ifdtool.c
+++ b/tools/ifdtool.c
@@ -788,9 +788,9 @@ static int write_uboot(char *image, int size, struct input_file *uboot,
fdt_strerror(data_size));
return -ENOENT;
}
- offset = ucode_ptr - uboot->addr;
+ offset = (uint32_t)(ucode_ptr + size);
ptr = (void *)image + offset;
- ptr[0] = uboot->addr + (data - image);
+ ptr[0] = (data - image) - size;
ptr[1] = data_size;
debug("Wrote microcode pointer at %x: addr=%x, size=%x\n",
ucode_ptr, ptr[0], ptr[1]);
OpenPOWER on IntegriCloud