Skip to content
Snippets Groups Projects
  1. Oct 07, 2022
  2. Oct 06, 2022
  3. Oct 03, 2022
    • Tom Rini's avatar
      Merge branch 'next' · 2d459135
      Tom Rini authored
      2d459135
    • Tom Rini's avatar
      Prepare v2022.10 · 4debc57a
      Tom Rini authored
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      4debc57a
    • Fabio Estevam's avatar
      imx8mn-ddr4-evk-u-boot: Fix broken boot · 0bd7811c
      Fabio Estevam authored and Tom Rini's avatar Tom Rini committed
      
      When the imx8mn.dtsi file was pulled in from Linux, the UARTs
      were moved into an spba sub-node which wasn't being included
      in the SPL device tree.  This meant the references to the UART
      weren't being handled properly and when booting the system would
      constantly reboot.  Fix this by adding the spba node to the spl
      device tree to restore normal booting.
      
      Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot
      board.
      
      Fixes: 4e5114da ("imx8mn: synchronise device tree with linux")
      Signed-off-by: default avatarFabio Estevam <festevam@denx.de>
      0bd7811c
    • Fabio Estevam's avatar
      imx8mn-venice-u-boot: Fix broken boot · a2bf0373
      Fabio Estevam authored and Tom Rini's avatar Tom Rini committed
      
      When the imx8mn.dtsi file was pulled in from Linux, the UARTs
      were moved into an spba sub-node which wasn't being included
      in the SPL device tree.  This meant the references to the UART
      weren't being handled properly and when booting the system would
      constantly reboot.  Fix this by adding the spba node to the spl
      device tree to restore normal booting.
      
      Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot
      board.
      
      Fixes: 4e5114da ("imx8mn: synchronise device tree with linux")
      Signed-off-by: default avatarFabio Estevam <festevam@denx.de>
      a2bf0373
  4. Sep 30, 2022
    • Tom Rini's avatar
      Merge branch '2022-09-29-dm-core-support-multiple-device-trees-in-ofnode' into next · 6ee6e159
      Tom Rini authored
      To quote the author:
      At present the ofnode interface is somewhat limited, in that it cannot
      access the device tree provided by the OS, only the one used by U-Boot
      itself (assuming these are separate). This prevents using ofnode functions
      to handle device tree fixups, i.e. ft_board_setup() and the like.
      
      The ofnode interface was introduced to allow a consistent API to access
      the device tree, whether a flat tree or a live tree (OF_LIVE) is in use.
      
      With the flat tree, adding nodes and properties at the start of the tree
      (as often happens when writing to the /chosen node) requires copying a
      lot of data for each operation. With live tree, such operations are
      quite a bit faster, since there is no memory copying required. This has to
      be weighed against the required memory allocation with OF_LIVE, as well
      as the cost of unflattening and flattening the device tree which U-Boot
      is running.
      
      This series enables support for access to multiple device trees with the
      ofnode interface. This is already available to some extent with OF_LIVE,
      but some of the ofnode functions need changes to allow the tree to be
      specified.
      
      The mechanism works by using the top 1-4 bits of the device tree offset.
      The sign bit is not affected, since negative values must be supported.
      
      With this implemented, it becomes possible to use the ofnode interface
      to do device tree fixups. The only current user is the EVT_FT_FIXUP
      event.
      
      This has two main benefits:
      
      - ofnode can now be used everywhere, in preference to the libfdt calls
      - live tree can eventually be used everywhere, with potential speed
        improvements when larger number of fixups are used
      
      This series is only a step along the way. Firstly, while it is possible
      to access the 'fix-up' tree using OF_LIVE, most of the fixup functions use
      flat tree directly, rather than the ofnode interface. These need to be
      updated. Also the tree must be flattened again before it is passed to the
      OS. This is not currently implemented.
      
      With OFNODE_MULTI_TREE disabled this has almost no effect on code size:
      around 4 bytes if EVENT is enabled, 0 if not. With the feature enabled,
      the increase is around 700 bytes, e.g. on venice2:
      
      $ buildman -b ofn2a venice2 -sS --step 0
      Summary of 2 commits for 1 boards (1 thread, 64 jobs per thread)
      01: image: Drop some other #ifdefs in image-board.c
             arm:  w+   venice2
      48: wip
             arm: (for 1/1 boards) all +668.0 text +668.0
      
      This size increase is not too bad, considering the extra functionality,
      but is too large to enable everywhere. So for now this features needs to
      be opt-in only, based on EVENT.
      6ee6e159
    • Tom Rini's avatar
      Merge tag 'efi-2022-10-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi · d3ccdc0f
      Tom Rini authored
      Pull request for efi-2022-10-rc6
      
      Documentation:
      
      * doc: improve description of autostart
      
      UEFI:
      
      * prefix test functions with efi_st_ in the LoadImage unit test
      * avoid a warning message in efi_initrd_deregister()
      d3ccdc0f
    • Simon Glass's avatar
      dm: core: Support copying properties with ofnode · db1ef1e1
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Add a function to copy properties from one node to another.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      db1ef1e1
    • Simon Glass's avatar
      dm: core: Allow copying ofnode property data when writing · 0b58eaa8
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      At present ofnode_write_prop() is inconsistent between livetree and
      flattree, in that livetree requires the caller to ensure the property
      value is stable (e.g. in rodata or allocated) but flattree does not, since
      it makes a copy.
      
      This makes the API call a bit painful to use, since the caller must do
      different things depending on OF_LIVE.
      
      Add a new 'copy' argument which tells the function to make a copy if
      needed. Add some tests to cover this behaviour.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      0b58eaa8
    • Simon Glass's avatar
      vbe: Allow test to run with live/flat tree · 0d63213c
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      This test can operate in all conditions now. Update the test and comments.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      0d63213c
    • Simon Glass's avatar
      dm: core: Expand ofnode tests · 47a677c2
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      The current tests do not cover all functions, nor do they cover the new
      multi-tree functionality. Add and update the tests accordingly and update
      the 'future work' notes in the documentation.
      
      There is a still more testing needed for the failure cases, since at
      present some ofnode functions return a libfdt error code instead of
      converting it to an errno.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      47a677c2
    • Simon Glass's avatar
      dm: core: Create a function to get a live tree in a test · 88a1ae81
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Move this logic out of the test into separate functions, so we can use it
      in other tests.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      88a1ae81
    • Simon Glass's avatar
      dm: core: Update comments for default-FDT ofnode functions · 988f1468
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Some ofnode functions can only operate on the default device tree, i.e.
      U-Boot's control FDT. Add comments to that effect. Fix up the reference to
      device tree bindings while we are here.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      988f1468
    • Simon Glass's avatar
      dm: core: Complete phandle implementation using the other FDT · 5e96925b
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      We need to be able to look up phandles in any FDT, not just the control
      FDT. Use the 'other' FDT to test this, with a helper function which gets
      this as an oftree that can then we used as needed.
      
      Add a few more tests and some comments at the top of the file, to explain
      what is going on.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      5e96925b
    • Simon Glass's avatar
      dm: core: Add the ofnode multi-tree implementation · 92291652
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Add the logic to redirect requests for the device tree through a function
      which can look up the tree ID. This works by using the top bits of
      ofnode.of_offset to encode a tree.
      
      It is assumed that there will only be a few device trees used at runtime,
      typically the control FDT (always tree ID 0) and possibly a separate FDT
      to be passed the OS.
      
      The maximum number of device trees supported at runtime is 8, with this
      implementation. That would use bits 30:28 of the node-offset value,
      meaning that the positive offset range is limited to bits 27:0, versus
      30:1 with this feature disabled. That still allows a device tree of up
      to 256MB, which should be enough for most FITs. Larger ones can be
      supported by using external data with the FIT, or by enabling OF_LIVE.
      
      Update the documentation a little and fix up the comment for
      ofnode_valid().
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      92291652
    • Simon Glass's avatar
      dm: core: Add definitions for multiple ofnode trees · 41b65d68
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      At present, unless OF_LIVE is enabled, ofnode only supports access to one
      device tree, the control FDT. This is because only the node offset is
      encoded in ofnode, with the tree being implicit.
      
      This makes ofnode (without OF_LIVE) unsuitable for device tree fixups, as
      implemented by ft_board_setup() and other such functions.
      
      To solve this, we can use the top bits of the node offset to hold a tree
      ID.
      
      Add the definitions for this.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      41b65d68
    • Simon Glass's avatar
      dm: core: Split ofnode_path_root() into two functions · b7bd94f1
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      This function turns out to be a little confusing since it looks up a path
      and also registers the tree. Split it into two, one that gets the root
      node and one that looks up a path, so the purpose is clear.
      
      Registering the tree will happen in a function to be added in a later
      patch, called oftree_from_fdt().
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      b7bd94f1
    • Simon Glass's avatar
      dm: core: Allow obtaining a node offset in the same tree · 2187cb7e
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      In some cases we want to obtain an ofnode in the same tree as a different
      ofnode, such as when looking up a subnode. At present this is trivial,
      since there is only one tree. When there are multiple trees, this
      implementation will change.
      
      Also move the ofnode_to_offset() function up higher in the header file,
      since we will need to provide a different implementation with multiple
      trees.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      2187cb7e
    • Simon Glass's avatar
      dm: core: Add a way to look up a phandle in an oftree · 928d267a
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      When we have multiple trees, the ofnode logic needs to be told which one
      to use. Create a new function which takes an oftree argument, along with
      a helper to obtain the FDT pointer from an oftree.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      928d267a
    • Simon Glass's avatar
      dm: core: Add ofnode functions to obtain an oftree · 085d5941
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      At present dm_test_ofnode_root() does this manually. Add some inline
      functions to handle it, so this code can be centralised.
      
      Add oftree functions to produce a null tree and to check whether a tree
      is valid or not.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      085d5941
    • Simon Glass's avatar
      dm: core: Add an ofnode function to obtain the flat tree · a3f50d03
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      The flat device tree is assumed to be the control FDT but this is not
      always the case. Update the ofnode implementation to obtain the node via
      an function call so we can eventually add support for selecting different
      trees.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      a3f50d03
    • Simon Glass's avatar
      dm: core: Provide a way to reset the device tree · ee88ba71
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      At present there is only one device tree used by the ofnode functions,
      except for some esoteric use of live tree. In preparation for supporting
      more than one, add a way to reset the list of device trees.
      
      For now this does nothing.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      ee88ba71
    • Simon Glass's avatar
      dm: core: Expand integer-reading tests · 66d0d0c1
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      The current tests do not cover all the behaviour. Add some more.
      
      Tidy up a few inconsistencies between livetree and flattree which come to
      light with these tests. Also drop the -ENODATA error since it is never
      actually returned.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      66d0d0c1
    • Heinrich Schuchardt's avatar
      efi_loader: fix efi_initrd_deregister() · 8d805929
      Heinrich Schuchardt authored
      
      Don't try to delete a non-existent handle.
      
      Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      8d805929
    • Heinrich Schuchardt's avatar
      efi_selftest: prefix test functions with efi_st_ · 0dfc4c84
      Heinrich Schuchardt authored
      
      An upcoming patch set creates a global function flush(). To make debugging
      easier we should not use the same name for a static function.
      
      Rename static functions in the LoadImage() unit test adding an efi_st_
      prefix.
      
      Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      0dfc4c84
    • Heinrich Schuchardt's avatar
      doc: improve description of autostart · 0e21943b
      Heinrich Schuchardt authored
      
      Complete the list of commands influenced by the autostart environment
      variable.
      
      Make it clearer what values qualifies at 'yes'.
      
      Eventually the list of environment variables is to be alphabetically
      sorted. Move autostart up.
      
      Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      0e21943b
  5. Sep 29, 2022
Loading