25 Jul, 2018

1 commit

  • The second argument of fdt_fixup_mtdparts() is an opaque pointer,
    'void *node_info', hence callers can pass any pointer.

    Obviously, fdt_fixup_mtdparts() expects 'struct node_info *'
    otherwise, it crashes run-time.

    Change the prototype so that it is compile-time checked.

    Also, add 'const' qualifier to it so that callers can constify
    the struct node_info arrays.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass

    Masahiro Yamada
     

09 Jul, 2018

1 commit

  • Support a default memory bank, specified in reg, as well as
    board-specific memory banks in subtree board-id nodes.

    This allows memory information to be provided in the device tree,
    rather than hard-coded in, which will make it simpler to handle
    similar devices with different memory banks, as the board-id values
    or masks can be used to match devices.

    Signed-off-by: Michael Pratt
    Signed-off-by: Simon Glass
    Reviewed-by: Vadim Bendebury

    Michael Pratt
     

07 May, 2018

1 commit

  • 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: Tom Rini

    Tom Rini
     

05 Mar, 2018

1 commit

  • Thomas reported U-Boot failed to build host tools if libfdt-devel
    package is installed because tools include libfdt headers from
    /usr/include/ instead of using internal ones.

    This commit moves the header code:
    include/libfdt.h -> include/linux/libfdt.h
    include/libfdt_env.h -> include/linux/libfdt_env.h

    and replaces include directives:
    #include -> #include
    #include -> #include

    Reported-by: Thomas Petazzoni
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

31 Jan, 2018

1 commit

  • For for case of lazyapply method, API fdt_fixup_board_enet() gets
    invoked before DPL being deployed. This leads to an issue that
    fsl-mc fdt fixup status marked as fail and dprc driver didn't get
    registered in linux boot.

    Fixes this issue by calling fdt_fixup_board_enet() for case when
    DPL is deployed successfully in lazyapply method.

    Signed-off-by: Yogesh Gaur
    Reviewed-by: York Sun

    Yogesh Gaur
     

25 Dec, 2017

1 commit


26 Nov, 2017

2 commits

  • A minor code-size increase from the changes for tracking the os-type
    of FIT images and from infrastructure for recording the loadables into
    the the loaded FDT, broke the builds for sun50i and some OMAP2+ devices.

    This change adds a new config option (enabled by default for
    MACH_SUN50I, MACH_SUN50I_H5 and ARCH_OMAP2PLUS) that does skips these
    processing steps (bringing code size down to below the limit
    again). The os-type is not evaluated, but assumed to be IH_OS_UBOOT
    (i.e. taking the code-paths intended for backward-compatibility).

    Note that enabling this config option precludes any useful downstream
    processing, such as utilising a special calling convention for ATF or
    OPTEE, based on the os-type of the loadables.

    Signed-off-by: Philipp Tomsich

    Philipp Tomsich
     
  • During the loading of more complex FIT images (e.g. when the invoked
    next stage needs to find additional firmware for a power-management
    core... or if there are multiple images for different privilege levels
    started in parallel), it is helpful to create a record of what images
    are loaded where: if a FDT is loaded for one of the next stages, it
    can be used to convey the status and location of loadables.

    This adds a fdt_record_loadable() function that can be invoked to
    record the status of each loadable below the /fit-images path.

    Signed-off-by: Philipp Tomsich
    Reviewed-by: Simon Glass

    Philipp Tomsich
     

15 Sep, 2017

1 commit

  • Introduce fdt_overlay_apply_verbose, a method that applies an
    overlay but in the case of an error produces a helpful message.

    In addition if a base tree is found to be missing the __symbols__
    node the message will point out that the probable reason is that
    the base tree was miscompiled without the -@ option.

    Signed-off-by: Pantelis Antoniou
    Acked-by: Simon Glass

    Pantelis Antoniou
     

01 Jun, 2017

2 commits


03 Dec, 2016

1 commit

  • Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option")
    allows us to skip memory setup of DTB, but a problem for ARM is that
    spin_table_update_dt() and psci_update_dt() are skipped as well if
    CONFIG_ARCH_FIXUP_FDT is disabled.

    This commit allows us to skip only fdt_fixup_memory_banks() instead
    of the whole of arch_fixup_fdt(). It will be useful when we want to
    use a memory node from a kernel DTB as is, but need some fixups for
    Spin-Table/PSCI.

    Signed-off-by: Masahiro Yamada
    Acked-by: Alexey Brodkin
    Acked-by: Simon Glass
    Fixed build error for x86:
    Signed-off-by: Simon Glass

    Masahiro Yamada
     

14 Oct, 2016

1 commit

  • Sometimes devicetree nodes and or properties are added out of the u-boot
    console, maybe through some script or manual interaction.

    The devicetree as loaded or embedded is quite small, so the devicetree
    has to be resized to take up those new nodes/properties.

    In original the devicetree was only extended by effective
    4 * add_mem_rsv.

    With this commit we can add an argument to the "fdt resize" command,
    which takes the extrasize to be added.

    Signed-off-by: Hannes Schmelzer

    Signed-off-by: Hannes Schmelzer
    Acked-by: Simon Glass

    Hannes Schmelzer
     

28 Sep, 2016

1 commit


12 Aug, 2016

1 commit

  • The next patch will call fdt_translate_address() from somewhere with a
    "const void *blob" rather than a "void *blob", so fdt_translate_address()
    must accept a const pointer too. Constify the minimum number of function
    parameters to achieve this.

    Signed-off-by: Stephen Warren
    Acked-by: Simon Glass
    Squashed in build fix from Stephen:
    Signed-off-by: Simon Glass

    Stephen Warren
     

20 Jul, 2016

1 commit


10 Apr, 2016

1 commit


20 Jul, 2015

1 commit

  • Avoid clearing the reg property in the memory DT node if no memory
    banks have been specified for a board (CONFIG_NR_DRAM_BANKS == 0).
    This allows boards to let U-Boot skip the DT memory tinkering in case
    other firmware has already setup the node properly before.
    This should be safe as all callers of fdt_fixup_memory_banks that use
    a computed value put at least 1 in there.
    Add some documentation comments to the header file.

    Signed-off-by: Andre Przywara
    Acked-by: Simon Glass

    Andre Przywara
     

05 Jun, 2015

2 commits

  • This instroduces comments that explain the purpose, parameters and return codes
    of a few fdt support functions, that are used to fill the fdt.

    Signed-off-by: Paul Kocialkowski
    Acked-by: Simon Glass

    Paul Kocialkowski
     
  • Before device-tree, the device serial number used to be passed to the kernel
    using ATAGs (on ARM). This is now deprecated and all the handover to the kernel
    should now be done using device-tree. Thus, this passes the serial-number
    property to the kernel using the serial-number property of the root node, as
    expected by the kernel.

    The serial number is a string that somewhat represents the device's serial
    number. It might come from some form of storage (e.g. an eeprom) and be
    programmed at factory-time by the manufacturer or come from identification
    bits available in e.g. the SoC.

    Signed-off-by: Paul Kocialkowski
    Reviewed-by: Simon Glass

    Paul Kocialkowski
     

22 Apr, 2015

1 commit

  • Add 'fdt_fixup_display' function to fixup device-tree native-mode property
    of display-timings node to select timings for a specific display.
    This is useful if a device-tree has configurations for multiple
    display timings for undetectable displays.

    see kernel Documentation/devicetree/bindings/video/display-timing.txt

    Signed-off-by: Tim Harvey
    Acked-by: Simon Glass

    Tim Harvey
     

18 Feb, 2015

1 commit

  • Commit 90bac29a76bc8d649b41a55f2786c0abef9bb2c1 claims to fix this bug
    that was introduced in commit a92fd6577ea17751ead9b50243e3c562125cf581
    but doesn't actually make the change that the commit message describes.

    Actually fix the bug this time.

    Signed-off-by: Joe Hershberger
    Acked-by: Simon Glass

    Joe Hershberger
     

27 Nov, 2014

1 commit


25 Nov, 2014

1 commit

  • Add a generic helper to fill and enable simplefb nodes.

    The first user of this will be the sunxi display code.

    lcd_dt_simplefb_configure_node is also a good candidate to be converted
    to use this, but that requires someone to run some tests first, as
    lcd_dt_simplefb_configure_node does not honor #address-cells and #size-cells,
    but simply assumes 1 and 1 for both.

    Signed-off-by: Hans de Goede
    Tested-by: Stephen Warren
    Acked-by: Simon Glass

    Hans de Goede
     

21 Nov, 2014

4 commits

  • Add an additional function for adding information to the device tree before
    booting. This permits additions which are not board-specific.

    Signed-off-by: Simon Glass
    Acked-by: Anatolij Gustschin
    Reviewed-by: Tom Rini

    Simon Glass
     
  • The message about needing to reset should be printed no matter what error
    is printed. Also, an error should always be printed.

    Signed-off-by: Simon Glass
    Acked-by: Anatolij Gustschin
    Reviewed-by: Tom Rini

    Simon Glass
     
  • This function is useful for ensuring that a node exists. Export it so it
    can be used more widely.

    Signed-off-by: Simon Glass
    Acked-by: Anatolij Gustschin
    Reviewed-by: Tom Rini

    Simon Glass
     
  • This function can fail if the device tree runs out of space. Rather than
    silently booting with an incomplete device tree, allow the failure to be
    detected.

    Unfortunately this involves changing a lot of places in the code. I have
    not changed behvaiour to return an error where one is not currently
    returned, to avoid unexpected breakage.

    Eventually it would be nice to allow boards to register functions to be
    called to update the device tree. This would avoid all the many functions
    to do this. However it's not clear yet if this should be done using driver
    model or with a linker list. This work is left for later.

    Signed-off-by: Simon Glass
    Acked-by: Anatolij Gustschin

    Simon Glass
     

26 Oct, 2014

1 commit


25 Sep, 2014

2 commits


09 Aug, 2014

1 commit


03 Jul, 2014

1 commit

  • Adding support to load and start the Layerscape Management Complex (MC)
    firmware. First, the MC GCR register is set to 0 to reset all cores. MC
    firmware and DPL images are copied from their location in NOR flash to
    DDR. MC registers are updated with the location of these images.
    Deasserting the reset bit of MC GCR register releases core 0 to run.
    Core 1 will be released by MC firmware. Stop bits are not touched for
    this step. U-boot waits for MC until it boots up. In case of a failure,
    device tree is updated accordingly. The MC firmware image uses FIT format.

    Signed-off-by: J. German Rivera
    Signed-off-by: York Sun
    Signed-off-by: Lijun Pan
    Signed-off-by: Shruti Kanetkar

    J. German Rivera
     

19 Jun, 2014

2 commits


09 May, 2014

1 commit


23 Apr, 2014

2 commits

  • This patch adds a helper function that can be used to interpret most
    "ranges" properties in the device tree.

    It reads the n'th range out of a "ranges" array and returns the node's
    virtual address of the range, the physical address that range starts at
    and the size of the range.

    Signed-off-by: Alexander Graf
    Acked-by: Scott Wood
    Reviewed-by: York Sun

    Alexander Graf
     
  • We already have a nice helper to give us a property cell value with default
    fall back from a path. Split that into two helpers - one for the old path
    based lookup and one to give us a value based on a node offset.

    Signed-off-by: Alexander Graf
    Acked-by: Scott Wood
    Reviewed-by: York Sun

    Alexander Graf
     

18 Apr, 2014

1 commit


22 Mar, 2014

1 commit