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>
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]);