Commit 7346c1e192d63cd35f99c7e845e53c5d4d0bdc24

Authored by Teddy Reed
Committed by Tom Rini
1 parent 72239fc85f

vboot: Do not use hashed-strings offset

The hashed-strings signature property includes two uint32_t values.
The first is unneeded as there should never be a start offset into the
strings region. The second, the size, is needed because the added
signature node appends to this region.

See tools/image-host.c, where a static 0 value is used for the offset.

Signed-off-by: Teddy Reed <teddy.reed@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 6 additions and 2 deletions Side-by-side Diff

... ... @@ -377,8 +377,11 @@
377 377 /* Add the strings */
378 378 strings = fdt_getprop(fit, noffset, "hashed-strings", NULL);
379 379 if (strings) {
380   - fdt_regions[count].offset = fdt_off_dt_strings(fit) +
381   - fdt32_to_cpu(strings[0]);
  380 + /*
  381 + * The strings region offset must be a static 0x0.
  382 + * This is set in tool/image-host.c
  383 + */
  384 + fdt_regions[count].offset = fdt_off_dt_strings(fit);
382 385 fdt_regions[count].size = fdt32_to_cpu(strings[1]);
383 386 count++;
384 387 }
... ... @@ -135,6 +135,7 @@
135 135  
136 136 ret = fdt_setprop(fit, noffset, "hashed-nodes",
137 137 region_prop, region_proplen);
  138 + /* This is a legacy offset, it is unused, and must remain 0. */
138 139 strdata[0] = 0;
139 140 strdata[1] = cpu_to_fdt32(string_size);
140 141 if (!ret) {