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


24 Jul, 2013

1 commit


15 May, 2013

1 commit

  • This seems to be a common function for several architectures, so create
    a common function rather than duplicating the code in each arch.

    Also make an attempt to avoid introducing #ifdefs in the new code, partly
    by removing useless #ifdefs around function declarations in the image.h
    header.

    Signed-off-by: Simon Glass

    Simon Glass
     

09 Feb, 2013

1 commit

  • The libfdt.h file is the definition file for libfdt. It is unnecessary
    to include other fdt header files (the necessary ones are pulled in
    by libfdt.h).

    Signed-off-by: Gerald Van Baren
    Acked-by: Simon Glass
    Acked-by: Stefan Roese

    Gerald Van Baren
     

08 Feb, 2013

2 commits

  • trivial:

    fdt_support.c:89:64: warning: Using plain integer as NULL pointer
    fdt_support.c:325:65: warning: Using plain integer as NULL pointer
    fdt_support.c:352:65: warning: Using plain integer as NULL pointer

    For the following bad constant expression, We hardcode the max. number of
    memory banks to four for the foreseeable future, and add an error with
    instructions on what to do once it's exceeded:

    fdt_support.c:397:22: error: bad constant expression

    For the rest below, sparse found a couple of wrong endian conversions
    in of_bus_default_translate() and fdt_get_base_address(), but
    otherwise the rest is mostly annotation fixes:

    fdt_support.c:64:24: warning: cast to restricted __be32
    fdt_support.c:192:21: warning: incorrect type in assignment (different base types)
    fdt_support.c:192:21: expected unsigned int [unsigned] [usertype] tmp
    fdt_support.c:192:21: got restricted __be32 [usertype]
    fdt_support.c:201:21: warning: incorrect type in assignment (different base types)
    fdt_support.c:201:21: expected unsigned int [unsigned] [addressable] [usertype] tmp
    fdt_support.c:201:21: got restricted __be32 [usertype]
    fdt_support.c:304:13: warning: incorrect type in assignment (different base types)
    fdt_support.c:304:13: expected unsigned int [unsigned] [usertype] val
    fdt_support.c:304:13: got restricted __be32 [usertype]
    fdt_support.c:333:13: warning: incorrect type in assignment (different base types)
    fdt_support.c:333:13: expected unsigned int [unsigned] [usertype] val
    fdt_support.c:333:13: got restricted __be32 [usertype]
    fdt_support.c:359:13: warning: incorrect type in assignment (different base types)
    fdt_support.c:359:13: expected unsigned int [unsigned] [usertype] val
    fdt_support.c:359:13: got restricted __be32 [usertype]
    fdt_support.c:373:21: warning: cast to restricted __be32
    fdt_support.c:963:48: warning: incorrect type in argument 1 (different base types)
    fdt_support.c:963:48: expected restricted __be32 const [usertype] *p
    fdt_support.c:963:48: got unsigned int [usertype] *
    fdt_support.c:971:48: warning: incorrect type in argument 1 (different base types)
    fdt_support.c:971:48: expected restricted __be32 const [usertype] *p
    fdt_support.c:971:48: got unsigned int [usertype] *
    fdt_support.c:984:29: warning: incorrect type in argument 1 (different base types)
    fdt_support.c:984:29: expected restricted __be32 const [usertype] *cell
    fdt_support.c:984:29: got unsigned int [usertype] *addr
    fdt_support.c:996:32: warning: incorrect type in argument 1 (different base types)
    fdt_support.c:996:32: expected restricted __be32 const [usertype] *cell
    fdt_support.c:996:32: got unsigned int [usertype] *addr
    fdt_support.c:1041:41: warning: incorrect type in argument 1 (different base types)
    fdt_support.c:1041:41: expected restricted __be32 const [usertype] *cell
    fdt_support.c:1041:41: got unsigned int [usertype] *addr
    fdt_support.c:1053:41: warning: incorrect type in argument 2 (different base types)
    fdt_support.c:1053:41: expected restricted __be32 const [usertype] *range
    fdt_support.c:1053:41: got unsigned int const [usertype] *[assigned] ranges
    fdt_support.c:1064:53: warning: incorrect type in argument 2 (different base types)
    fdt_support.c:1064:53: expected restricted __be32 const [usertype] *addr
    fdt_support.c:1064:53: got unsigned int [usertype] *addr
    fdt_support.c:1110:50: warning: incorrect type in argument 2 (different base types)
    fdt_support.c:1110:50: expected restricted __be32 const [usertype] *addr
    fdt_support.c:1110:50: got unsigned int *
    fdt_support.c:1121:49: warning: incorrect type in argument 1 (different base types)
    fdt_support.c:1121:49: expected restricted __be32 const [usertype] *cell
    fdt_support.c:1121:49: got unsigned int *
    fdt_support.c:1147:60: warning: incorrect type in argument 2 (different base types)
    fdt_support.c:1147:60: expected restricted __be32 const [usertype] *addr
    fdt_support.c:1147:60: got unsigned int *
    fdt_support.c:1081:5: warning: symbol '__of_translate_address' was not declared. Should it be static?
    fdt_support.c:1154:5: error: symbol 'fdt_translate_address' redeclared with different type (originally declared at include/fdt_support.h:95) - incompatible argument 3 (different base types)
    fdt_support.c: In function 'fdt_node_offset_by_compat_reg':
    fdt_support.c:1173:17: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]

    See also linux kernel commit 0131d897 "of/address: use proper
    endianess in get_flags".

    Signed-off-by: Kim Phillips
    Cc: Jerry Van Baren

    Kim Phillips
     
  • and, if including libfdt.h which includes libfdt_env.h in
    the correct order, don't include fdt.h before libfdt.h.

    this is needed to get the fdt type definitions set from
    the project environment before fdt.h uses them.

    Signed-off-by: Kim Phillips
    Cc: Jerry Van Baren

    Kim Phillips
     

16 Feb, 2012

1 commit


14 Nov, 2011

1 commit


18 Oct, 2011

1 commit

  • Add common function fdt_set_node_status() to assist in various locations
    that we set a nodes status. This function utilizes the status values
    that are part of the EPAPR spec (on power.org).

    fdt_set_status_by_alias() is based on fdt_set_node_status() but uses an
    alias string to identify the node to update.

    We also add some shortcut functions to help the common cases of setting
    "okay" and "disabled":

    fdt_status_okay()
    fdt_status_disabled()
    fdt_status_okay_by_alias()
    fdt_status_disabled_by_alias()

    Finally, we fixup the corenet_ds ethernet code which previously had
    a function by the same name that can be replaced with the new helpers.

    Signed-off-by: Shengzhou Liu
    Signed-off-by: Kumar Gala
    Acked-by: Gerald Van Baren

    Shengzhou Liu
     

15 Oct, 2011

2 commits


30 Sep, 2011

1 commit