06 Dec, 2019

1 commit

  • Add support for setting linux,usable-memory property in the memory
    node of device tree for the kernel [1].

    This property holds a base address and size, describing a
    limited region in which memory may be considered available for use by
    the kernel. Memory outside of this range is not available for use.

    [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt

    Signed-off-by: Igor Opaniuk
    Signed-off-by: Sanchayan Maity
    Signed-off-by: Stefan Agner
    Reviewed-by: Oleksandr Suvorov

    Igor Opaniuk
     

28 Oct, 2019

1 commit


12 Aug, 2019

1 commit


25 Jul, 2019

2 commits


22 Jul, 2019

1 commit

  • Add the following functions to translate DMA address to CPU address:
    - dev_translate_dma_address()
    - ofnode_translate_dma_address()
    - of_translate_dma_address()
    - fdt_translate_dma_address()
    These functions work the same way as xxx_translate_address(), with the
    difference that the translation relies on the "dma-ranges" property
    instead of the "ranges" property.

    Add related test. Test report:
    => ut dm fdt_translation
    Test: dm_test_fdt_translation: test-fdt.c
    Test: dm_test_fdt_translation: test-fdt.c (flat tree)
    Failures: 0

    Signed-off-by: Fabien Dessenne

    Fabien Dessenne
     

22 May, 2019

1 commit

  • When using fdt_fixup_mtdparts() offset and length cell sizes
    are limited to 4 bytes (1 cell). However if the mtd device is
    bigger then 4GiB, then #address-cells and #size-cells are
    8 bytes (2 cells) [1].

    This patch read #size-cells and uses either fdt32_t or
    fdt64_t cell size. The default is fdt32_t.

    [1] Documentation/devicetree/bindings/mtd/partition.txt

    Signed-off-by: Stefan Mavrodiev
    Reviewed-by: Simon Glass

    Stefan Mavrodiev
     

10 May, 2019

1 commit


12 Apr, 2019

1 commit

  • Commit 6d29cc7dcf2d ("fdt: Fixup only valid memory banks") ended up
    being merged twice, first as:

    commit 6d29cc7dcf2d35966aa0b6119fd1cbca0d21d5e6
    Author: Thierry Reding
    AuthorDate: Tue Jan 30 11:34:17 2018 +0100
    Commit: Simon Glass
    CommitDate: Sun Feb 18 12:53:38 2018 -0700

    fdt: Fixup only valid memory banks

    Memory banks with address 0 and size 0 are empty and should not be
    passed to the OS via device tree.

    Signed-off-by: Thierry Reding
    Acked-by: Stephen Warren

    and later again, though this time it was v2:

    commit ed5af03f9bb8905f1e94d68ab49f22d7f061d75f
    Author: Thierry Reding
    AuthorDate: Thu Feb 15 19:05:59 2018 +0100
    Commit: Tom Rini
    CommitDate: Fri Feb 23 10:40:50 2018 -0500

    fdt: Fixup only valid memory banks

    Memory banks with address 0 and size 0 are empty and should not be
    passed to the OS via device tree.

    Acked-by: Stephen Warren
    Signed-off-by: Thierry Reding

    The second version was slightly different, so the main hunk of the patch
    was applied twice. This isn't harmful because the code is idempotent,
    but it's wasteful to run the same code twice.

    Signed-off-by: Thierry Reding
    Reviewed-by: Simon Glass

    Thierry Reding
     

15 Jan, 2019

1 commit


03 Dec, 2018

1 commit


11 Sep, 2018

1 commit

  • In int-ll64.h, we always use the following typedefs:

    typedef unsigned int u32;
    typedef unsigned long uintptr_t;
    typedef unsigned long long u64;

    This does not need to match to the compiler's .
    Do not include it.

    The use of PRI* makes the code super-ugly. You can simply use
    "l" for printing uintptr_t, "ll" for u64, and no modifier for u32.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

17 Aug, 2018

1 commit


07 Aug, 2018

1 commit


28 Jul, 2018

1 commit

  • This reverts commit 5e5745465c94605720295fab942eacbdd215db90.

    The reverted commit didn't support the scenario where there are less
    DRAM banks in U-Boot than in Linux.
    Also, it didn't introduce any new functionality, only limitaion.
    User could just increase MEMORY_BANKS_MAX if it's too small.
    Reviewed-by: Simon Glass

    Ramon Fried
     

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
     

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
     

23 Feb, 2018

1 commit


19 Feb, 2018

1 commit


13 Feb, 2018

1 commit

  • The fdt_record_loadable()-function was wedged between other functions
    that were guarded by ARCH_FIXUP_FDT_MEMORY. This could lead to linker
    errors on some configurations.

    With this change, fdt_record_loadable() is moved out of the
    ARCH_FIXUP_FDT_MEMORY guard (plus I tried to retain alphabetical
    ordering for functions by placing it appropriately).

    References: 9f45aeb ("spl: fit: implement fdt_record_loadable")
    Signed-off-by: Philipp Tomsich
    Reported-by: Michal Simek
    Tested-by: Michal Simek

    Philipp Tomsich
     

25 Dec, 2017

1 commit

  • The MAC addresses get fixed in the device tree for "ethernet" nodes
    is by using trailing number behind "ethernet" found in "/aliases".
    It may not be necessary for the "ethernet" nodes to be sequential.
    There can be gaps in between or any node disabled

    So provide a support to fetch MAC addr sequentially from env
    and apply them to "ethernet" nodes in the order they appear in
    device tree only if "ethernet" is not "disabled"

    Signed-off-by: Prabhakar Kushwaha
    Reviewed-by: York Sun

    Prabhakar Kushwaha
     

26 Nov, 2017

1 commit

  • 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
     

16 Aug, 2017

1 commit

  • We are now using an env_ prefix for environment functions. Rename these
    two functions for consistency. Also add function comments in common.h.

    Quite a few places use getenv() in a condition context, provoking a
    warning from checkpatch. These are fixed up in this patch also.

    Suggested-by: Wolfgang Denk
    Signed-off-by: Simon Glass

    Simon Glass
     

01 Aug, 2017

1 commit

  • This function appears to obtain the value of the 'ranges' property rather
    than 'reg'. As such it does not behave as documented or expected.

    In addition it picks up the second field of the property which is the size
    (with prop += naddr) rather than the first which is the address.

    Fix it.

    Signed-off-by: Simon Glass

    Simon Glass
     

04 Jul, 2017

1 commit

  • There was for long time no activity in the 4xx area.
    We need to go further and convert to Kconfig, but it
    turned out, nobody is interested anymore in 4xx,
    so remove it.

    Signed-off-by: Heiko Schocher

    Heiko Schocher
     

01 Jun, 2017

2 commits


26 Mar, 2017

1 commit

  • The Raspberry Pi device tree files since Linux v4.9 have a "ethernet"
    alias pointing to the on-board Ethernet device node. However,
    U-Boot's fdt_fixup_ethernet() only looks at ethernet aliases ending
    in digits.

    As the spec doesn't mandate that aliases must end in numbers and there
    have been much older uses of an "ethernet" aliases in the wild
    (according to Tom Rini), change the code to accept "ethernet" as well.

    Without this Linux isn't told of the MAC address provided by the
    RPI firmware and the ethernet interface is always assigned a random MAC
    address.

    Signed-off-by: Tuomas Tynkkynen
    Reviewed-by: Tom Rini
    Acked-by: Joe Hershberger

    Tuomas Tynkkynen
     

10 Feb, 2017

1 commit


08 Feb, 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
     

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
     

26 May, 2016

2 commits

  • Provide some documentation for the fields of struct of_bus, for
    consistency with that provided for the new match field.

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

    Paul Burton
     
  • Support ISA busses in much the same way as Linux does. This allows for
    ISA bus addresses to be translated, and only if CONFIG_OF_ISA_BUS is
    selected in order to avoid including the code in builds which won't need
    it.

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

    Paul Burton
     

04 May, 2016

1 commit

  • For multiple ethernet interfaces the FDT offset of '/aliases' will change as we
    are adding MAC addresses to the FDT.
    Therefore only the first interface ('ethernet0') will get properly updated in
    the FDT, with the rest getting FDT errors when we try to set their MAC address.

    Signed-off-by: Lev Iserovich
    Acked-by: Joe Hershberger

    Lev Iserovich
     

18 Mar, 2016

1 commit

  • This reverts commit 71105f50fedddfa5b0535d102c3d5078671721ad.

    The reverted commit was applied for a temporary to unbreak
    few Exynos boards on the release.

    After the discussion about the change, this commit should be avoided.
    Fixed device-tree for Exynos, allows reverting it without any issues.

    Signed-off-by: Przemyslaw Marczak
    Cc: Stefan Roese
    Cc: Tom Rini
    Cc: Simon Glass
    Cc: Stephen Warren
    Cc: Stephen Warren
    Tested-by: Simon Glass
    Acked-by: Simon Glass

    Przemyslaw Marczak