]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
binman: x86: Write skip-at-start when end-at-4gb is used
authorSimon Glass <sjg@chromium.org>
Sun, 16 Feb 2025 02:02:37 +0000 (19:02 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 27 May 2025 09:07:39 +0000 (10:07 +0100)
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>
arch/x86/cpu/intel_common/intel_opregion.c
arch/x86/lib/fsp2/fsp_init.c
tools/binman/etype/section.py

index 4a2717b35841bfe1c06e9c7a106f77580015e475..78caff0dc123b066392d970d0dea9ddc4c869de4 100644 (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);
index 0be892b14dc16e918c59d70f0cdda19b3defa38f..4b5f9889655242df266e4df604c8ca67f4bf8b20 100644 (file)
@@ -140,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)
index 4c4c8c417f81be6fc1e23d28ea971052e7aef9c9..1d50bb477534702019502d08f8648d4c9a367c0f 100644 (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()