Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • early-display
  • variant-emmc-nvme-boot
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
7 results

cmd_bootm.c

Blame
  • Forked from Reform / reform-boundary-uboot
    Source project has a limited visibility.
    • Stephen Warren's avatar
      d510859b
      image: Don't detect XIP images as overlapping. · d510859b
      Stephen Warren authored
      
      bootm_load_os() detects when it writes the decompressed image over
      the top of the compressed image. If this happens, the original image
      is corrupted. When the original image is a multi-component legacy image,
      or a (potentially multi-component) FIT image, this implies that other
      components may be corrupted. In turn, this means that booting is unlikely
      to be successful.
      
      However, in the case of no image compresssion coupled with an image with
      load address equal to where the image is already located (e.g. an XIP
      kernel, or IH_TYPE_KERNEL_ANYLOAD), there has been no copy and hence no
      corruption, no matter whether it's a single-component legacy image, a
      multi-component legacy image, or a FIT image. In this case, disable the
      overlap detection, and allow boot to continue.
      
      Without this change, when booting a single-component legacy image that
      contains an IH_TYPE_KERNEL_ANYLOAD, bootm_load_os() would have returned
      BOOTM_ERR_OVERLAP, but the caller ignores this, and boot continues and
      succeeds. Now, the false error is no longer even returned.
      
      Without this change, when booting a FIT image that contains an
      IH_TYPE_KERNEL_ANYLOAD, bootm_load_os() would have returned
      BOOTM_ERR_OVERLAP, which would then cause the caller to reset the board.
      Now, the false error is no longer returned, and boot succeeds.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarStefan Roese <sr@denx.de>
      d510859b
      History
      image: Don't detect XIP images as overlapping.
      Stephen Warren authored
      
      bootm_load_os() detects when it writes the decompressed image over
      the top of the compressed image. If this happens, the original image
      is corrupted. When the original image is a multi-component legacy image,
      or a (potentially multi-component) FIT image, this implies that other
      components may be corrupted. In turn, this means that booting is unlikely
      to be successful.
      
      However, in the case of no image compresssion coupled with an image with
      load address equal to where the image is already located (e.g. an XIP
      kernel, or IH_TYPE_KERNEL_ANYLOAD), there has been no copy and hence no
      corruption, no matter whether it's a single-component legacy image, a
      multi-component legacy image, or a FIT image. In this case, disable the
      overlap detection, and allow boot to continue.
      
      Without this change, when booting a single-component legacy image that
      contains an IH_TYPE_KERNEL_ANYLOAD, bootm_load_os() would have returned
      BOOTM_ERR_OVERLAP, but the caller ignores this, and boot continues and
      succeeds. Now, the false error is no longer even returned.
      
      Without this change, when booting a FIT image that contains an
      IH_TYPE_KERNEL_ANYLOAD, bootm_load_os() would have returned
      BOOTM_ERR_OVERLAP, which would then cause the caller to reset the board.
      Now, the false error is no longer returned, and boot succeeds.
      
      Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarStefan Roese <sr@denx.de>