[U-Boot] [PATCH 03/22] x86: Correct ifdtool microcode calculation
Bin Meng
bmeng.cn at gmail.com
Wed Dec 31 08:05:23 CET 2014
On Wed, Dec 31, 2014 at 10:47 AM, Bin Meng <bmeng.cn at gmail.com> wrote:
> On Sun, Dec 28, 2014 at 10:20 AM, Simon Glass <sjg at chromium.org> wrote:
>> This currently assumes that U-Boot resides at the start of ROM. Update
>> it to remove this assumption.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>>
>> tools/ifdtool.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/ifdtool.c b/tools/ifdtool.c
>> index fe8366b..590ccc9 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]);
>> --
>
> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
>
> Tested on Intel Crown Bay by adjusting ROM_SIZE to 2MB
>
> Tested-by: Bin Meng <bmeng.cn at gmail.com>
Oops, one additional space after 'Tested-by:' should be removed.
Tested-by: Bin Meng <bmeng.cn at gmail.com>
More information about the U-Boot
mailing list