1. 14 10月, 2020 1 次提交
  2. 30 9月, 2020 1 次提交
  3. 29 7月, 2020 1 次提交
    • C
      find dtb in android boot image with header version 2 during bootm · 6e314584
      chenshuo 提交于
      This patch is about bootm process, android boot image and device tree.
      
      Android 10 updates the boot image header to version 2,
      which includes a section to store the device tree blob (DTB) image.
      
      include/android_image.h has updated the struct andr_img_hdr,
      but not used in bootm process. This patch avoid reporting
      "Device tree not found or missing FDT support"
      when bootm a correctly constructed android boot image.
      Signed-off-by: Nchenshuo <chenshuo@eswin.com>
      6e314584
  4. 17 7月, 2020 1 次提交
  5. 19 5月, 2020 3 次提交
  6. 06 2月, 2020 2 次提交
  7. 25 1月, 2020 1 次提交
  8. 18 1月, 2020 1 次提交
  9. 14 11月, 2019 1 次提交
    • H
      image: fdt: copy possible optee nodes to a loaded devicetree · 6ccb05ea
      Heiko Stuebner 提交于
      The loading convention for optee or any other tee on arm64 is as bl32
      parameter to the trusted-firmware. So TF-A gets invoked with the TEE as
      bl32 and main u-boot as bl33. Once it has done its startup TF-A jumps
      into the bl32 for the TEE startup, returns to TF-A and then jumps to bl33.
      
      All of them get passed a devicetree as parameter and all components often
      get loaded from a FIT image.
      
      OP-TEE will create additional nodes in that devicetree namely a firmware
      node and possibly multiple reserved-memory nodes.
      
      While this devicetree is used in main u-boot, in most cases it won't be
      the one passed to the actual kernel. Instead most boot commands will load
      a new devicetree from somewhere like mass storage of the network, so if
      that happens u-boot should transfer the optee nodes to that new devicetree.
      
      To make that happen introduce optee_copy_fdt_nodes() called from the dt
      setup function in image-fdt which after checking for the optee presence
      in the u-boot dt will make sure a optee node is present in the kernel dt
      and transfer any reserved-memory regions it can find.
      Signed-off-by: NHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
      Reviewed-by: NJens Wiklander <jens.wiklander@linaro.org>
      6ccb05ea
  10. 12 8月, 2019 1 次提交
  11. 12 7月, 2019 1 次提交
  12. 24 4月, 2019 5 次提交
    • E
      fdt: boot_get_fdt: android: use ENV 'fdtaddr' as fallback · 62392675
      Eugeniu Rosca 提交于
      Our platform doesn't store the DTB into the Android image second area,
      but rather copies the DTB to RAM from a dedicated dtb.img partition [0],
      prior to booting the Android image by calling bootm.
      
      Similar to [1], we find it useful to just call 'bootm' and have the
      right DTB being passed to OS (assuming its address has been previously
      stored in 'fdtaddr' by calling `fdt addr <dtb-addr>`).
      
      Booting Android with DTB from 'fdtaddr' will only occur if:
       - No DTB is embedded in the second area of Android image
       - 'fdtaddr' points to a valid DTB in RAM
      
      [0] https://source.android.com/devices/architecture/dto/partitions
      [1] https://patchwork.ozlabs.org/patch/1046652/
          ("Support boot Android image without address on bootm command")
      Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      62392675
    • E
      fdt: boot_get_fdt: android: compress handling (non-functional) · 18b8f2c4
      Eugeniu Rosca 提交于
      Prepare for booting Android images which lack any DTB in the second
      area by using 'fdtaddr' environment variable as source/address of FDT.
      No functional/behavioral change expected in this patch.
      Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      18b8f2c4
    • E
      fdt: boot_get_fdt: simplify no_fdt handling (non-functional) · 80281829
      Eugeniu Rosca 提交于
      Increase the readability of boot_get_fdt().
      No change in behavior is expected.
      Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      80281829
    • E
      fdt: boot_get_fdt: really boot w/o FDT when "goto no_fdt" · 9ee9cf31
      Eugeniu Rosca 提交于
      The 'no_fdt' goto label was introduced by v2015.01 commit [0] and it
      had two review stages [1-2]. The *documented* purpose behind commit [0]
      is (excerpt from commit description):
      
      > allows both FDT and non-FDT kernels to boot by making the
      > third parameter to the bootm/bootz optional
      
      While [1] and [2] share the same goal, they have very different
      implementations:
       - [1] was based on a very simple 'argc' check at function error out
         with returning success to the caller if the third parameter was NOT
         passed to bootm/bootz command. This approach had the downside of
         returning success to the caller even in case of legitimate internal
         errors, which should halt booting.
       - [2] added the "no_fdt" label and several "goto no_fdt" statements.
         This allowed to report the legitimate internal errors to the caller.
      
      IOW the major difference between [1] and [2] is:
       - [1] boot w/o FDT if FDT address is not passed to boot{m,z,*}
       - [2] give *freedom* to the developer to boot w/o FDT from any
         (more or less) arbitrary point in the function flow (and here
         comes the peculiar aspect, which looks to be a leftover from [1])
         with the precondition that the 3rd argument (FDT address) is NOT
         provided to boot{m,z,*}. In practice, this means that only a subset
         of "goto no_fdt" end up booting w/o FDT while the other subset is
         returning an error to the caller.
      
      This patch removes the peculiar behavior described above, such that
      "goto no_fdt" performs really what it tells to the developer.
      
      The motivation of this patch is to decrease the unneeded complexity
      and increase the readability of boot_get_fdt().
      
      [0] 48aead71 ("fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined")
      [1] https://patchwork.ozlabs.org/patch/412923/
          ("[U-Boot,v1] fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined")
      [2] https://patchwork.ozlabs.org/patch/415635/
          ("[U-Boot,v2] fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined")
      Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      9ee9cf31
    • E
      fdt: boot_get_fdt: remove redundant zeroing out · d9313efc
      Eugeniu Rosca 提交于
      Paranoid programming [1] lies at the foundation of proper software
      development, but the repetitive zeroing-out of output arguments in the
      context of the same function rather clutters the code and inhibits
      further refactoring/optimization than is doing any good.
      
      In boot_get_fdt(), we already perform zero/NULL-initialization of
      *of_flat_tree and *of_size at the beginning of the function, so doing
      the same at function error-out is redundant/superfluous.
      
      Moreover, keeping the code unchanged might encourage the developers to
      update *of_flat_tree and *of_size during some interim computations,
      which is against the current design of boot_get_fdt(). Currently,
      writing useful data into these arguments happens just before
      successfully returning from boot_get_fdt() and it should better stay so.
      
      [1] https://blog.regehr.org/archives/1106Signed-off-by: NEugeniu Rosca <erosca@de.adit-jv.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      d9313efc
  13. 23 4月, 2019 1 次提交
    • S
      Support boot Android image without address on bootm command · 5e218862
      Shawn Guo 提交于
      It works perfectly fine to boot an Android boot.img with bootm command
      followed by an explicit address argument that holds the image.  But if
      we have boot.img downloaded into default 'loadaddr', and then boot it
      using bootm command without the address argument, we will run into
      problem, because U-Boot fails to find ramdisk and fdt (second area) in
      boot.img.
      
      The current Android image support assumes there is always an address
      argument on bootm command.  However just like booting any other images,
      'loadaddr' should be used when address argument is missing from bootm
      command.  It patches boot_get_ramdisk() and boot_get_fdt() a bit to
      support this quite common usage of bootm command for Android image.
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Reviewed-by: NTom Rini <trini@konsulko.com>
      5e218862
  14. 09 3月, 2019 1 次提交
  15. 09 2月, 2019 1 次提交
  16. 17 1月, 2019 1 次提交
  17. 15 1月, 2019 1 次提交
  18. 26 9月, 2018 1 次提交
    • A
      sandbox: Fix set_working_fdt_addr users · eaac4fb2
      Alexander Graf 提交于
      When running sandbox with the new pointer sanitization we just recently
      introduced, we're running into a case with FIT images where we end up
      interpreting pointers as addresses.
      
      What happened is that most callers of set_working_fdt_addr() simply
      convert pointers into addresses without taking into account that they
      might be 2 separate address spaces. Fix the callers up to map their
      pointers into addresses.
      
      This makes sandbox tests pass for me again.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      eaac4fb2
  19. 07 5月, 2018 1 次提交
    • T
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini 提交于
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: NTom Rini <trini@konsulko.com>
      83d290c5
  20. 01 4月, 2018 1 次提交
  21. 05 3月, 2018 1 次提交
  22. 19 2月, 2018 1 次提交
    • A
      fdt: Implement weak arch_fixup_fdt() · 4280342a
      Alexey Brodkin 提交于
      Only ARM and in some configs MIPS really implement arch_fixup_fdt().
      Others just use the same boilerplate which is not good by itself,
      but what's worse if we try to build with disabled CONFIG_CMD_BOOTM
      and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was
      apparently implemented in arch/xxx/lib/bootm.c.
      
      Now with weak arch_fixup_fdt() right in image-fdt.c where it is
      used we get both items highlighted above fixed.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
      Cc: Simon Glass <sjg@chromium.org>
      Cc: York Sun <york.sun@nxp.com>
      Cc: Stefan Roese <sr@denx.de>
      Reviewed-by: NTom Rini <trini@konsulko.com>
      Reviewed-by: NDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
      4280342a
  23. 16 10月, 2017 1 次提交
  24. 15 9月, 2017 1 次提交
  25. 16 8月, 2017 2 次提交
  26. 01 5月, 2017 1 次提交
    • T
      fdt: Move fdt_fixup_ethernet to a common place · 26d61195
      Tom Rini 提交于
      With 3f66149d we no longer have a common call fdt_fixup_ethernet.
      This was fine to do on PowerPC as they largely had calls already in
      ft_cpu_fixup.  On ARM however we largely relied on this call.  Rather
      than introduce a large number of changes to ft_cpu_fixup /
      ft_board_fixup we recognize that this is a common enough call that we
      should be doing it in a central location.  Do it early enough that we
      can do any further updates in ft_cpu_fixup / ft_board_fixup.
      
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Cc: Thomas Chou <thomas@wytron.com.tw> (maintainer:NIOS)
      Cc: York Sun <york.sun@nxp.com> (maintainer:POWERPC MPC85XX)
      Cc: Stefan Roese <sr@denx.de> (maintainer:POWERPC PPC4XX)
      Cc: Simon Glass <sjg@chromium.org>
      Cc: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
      Fixes: 3f66149d ("Remove extra fdt_fixup_ethernet() call")
      Signed-off-by: NTom Rini <trini@konsulko.com>
      Acked-by: NStefan Roese <sr@denx.de>
      Acked-by: NYork Sun <york.sun@nxp.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      26d61195
  27. 08 4月, 2017 1 次提交
  28. 03 12月, 2016 1 次提交
  29. 14 10月, 2016 1 次提交
  30. 22 9月, 2016 1 次提交
    • P
      image-fit: Fix fit_get_node_from_config semantics · bd86ef11
      Paul Burton 提交于
      Commit bac17b78 ("image-fit: switch ENOLINK to ENOENT") changed
      fit_get_node_from_config to return -ENOENT when a property doesn't
      exist, but didn't change any of its callers which check return values.
      Notably it didn't change boot_get_ramdisk, which leads to U-Boot failing
      to boot FIT images which don't include ramdisks with the following
      message:
      
        Ramdisk image is corrupt or invalid
      
      It also didn't take into account that by returning -ENOENT to denote the
      lack of a property we lost the ability to determine from the return
      value of fit_get_node_from_config whether it was the property or the
      configuration node that was missing, which may potentially lead callers
      to accept invalid FIT images.
      
      Fix this by having fit_get_node_from_config return -EINVAL when the
      configuration node isn't found and -ENOENT when the property isn't
      found, which seems to make semantic sense. Callers that previously
      checked for -ENOLINK are adjusted to check for -ENOENT, which fixes the
      breakage introduced by commit bac17b78 ("image-fit: switch ENOLINK
      to ENOENT").
      
      The only other user of the return fit_get_node_from_config return value,
      indirectly, is bootm_find_os which already checked for -ENOENT. From a
      read-through of the code I suspect it ought to have been checking for
      -ENOLINK prior to bac17b78 ("image-fit: switch ENOLINK to ENOENT")
      anyway, which would make it right after this patch, but this would be
      good to get verified by someone who knows this x86 code or is able to
      test it.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Cc: Jonathan Gray <jsg@jsg.id.au>
      Cc: Marek Vasut <marex@denx.de>
      Acked-by: NMarek Vasut <marex@denx.de>
      Acked-by: NStefan Roese <sr@denx.de>
      Acked-by: NGeorge McCollister <george.mccollister@gmail.com>
      Tested-by: NGeorge McCollister <george.mccollister@gmail.com>
      bd86ef11
  31. 01 8月, 2016 1 次提交
  32. 16 3月, 2016 1 次提交
    • A
      efi_loader: Call fdt preparation functions · dea2174d
      Alexander Graf 提交于
      We have a nice framework around image fils to prepare a device tree
      for OS execution. That one patches in missing device tree nodes and
      fixes up the memory range bits.
      
      We need to call that one from the EFI boot path too to get all those
      nice fixups. This patch adds the call.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      dea2174d