binman: x86: Write skip-at-start when end-at-4gb is used

The end-at-4gb property implies a value for skip-at-start so add it into
the output FDT so that U-Boot can read it.

Now that skip-at-start is implemented, we can drop the workarounds used
in the x86 code to obtain the correct image-pos value.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-02-15 19:02:37 -07:00
parent ee85034ab7
commit 13f3265ec4
3 changed files with 6 additions and 4 deletions

View File

@@ -31,7 +31,6 @@ static int locate_vbt(char **vbtp, int *sizep)
size = vbt.size;
if (size > sizeof(vbt_data))
return log_msg_ret("vbt", -E2BIG);
vbt.image_pos += CONFIG_ROM_SIZE;
ret = spi_flash_read_dm(dev, vbt.image_pos, size, vbt_data);
if (ret)
return log_msg_ret("read", ret);

View File

@@ -107,7 +107,6 @@ int fsp_locate_fsp(enum fsp_type_t type, struct binman_entry *entry,
bool use_spi_flash, struct udevice **devp,
struct fsp_header **hdrp, ulong *rom_offsetp)
{
ulong mask = CONFIG_ROM_SIZE - 1;
struct udevice *dev;
ulong rom_offset = 0;
uint map_size;
@@ -141,7 +140,7 @@ int fsp_locate_fsp(enum fsp_type_t type, struct binman_entry *entry,
if (ret)
return log_msg_ret("binman entry", ret);
if (!use_spi_flash)
rom_offset = map_base + CONFIG_ROM_SIZE;
rom_offset = map_base;
} else {
ret = -ENOENT;
if (false)

View File

@@ -189,7 +189,7 @@ class Entry_section(Entry):
self._sort = fdt_util.GetBool(self._node, 'sort-by-offset')
self._end_at_4gb = fdt_util.GetBool(self._node, 'end-at-4gb')
self._skip_at_start = fdt_util.GetInt(self._node, 'skip-at-start')
if self._end_at_4gb:
if self._end_at_4gb and self.GetImage().copy_to_orig:
if not self.size:
self.Raise("Section size must be provided when using end-at-4gb")
if self._skip_at_start is not None:
@@ -263,6 +263,8 @@ class Entry_section(Entry):
super().AddMissingProperties(have_image_pos)
if self.compress != 'none':
have_image_pos = False
if self._end_at_4gb:
state.AddZeroProp(self._node, 'skip-at-start')
for entry in self._entries.values():
entry.AddMissingProperties(have_image_pos)
@@ -505,6 +507,8 @@ class Entry_section(Entry):
def SetCalculatedProperties(self):
super().SetCalculatedProperties()
if self._end_at_4gb:
state.SetInt(self._node, 'skip-at-start', self._skip_at_start)
for entry in self._entries.values():
entry.SetCalculatedProperties()