21 Aug, 2018

4 commits


08 Aug, 2018

1 commit


06 Aug, 2018

1 commit


09 Jul, 2018

6 commits


01 Jun, 2018

1 commit


08 May, 2018

5 commits

  • Add the regmap_update_bits() to simply the read/modify/write of registers
    in a single command. The function is taken from Linux regmap
    implementation.

    Signed-off-by: Neil Armstrong
    Reviewed-by: Simon Glass

    Neil Armstrong
     
  • The syscon implementation in U-Boot is different from that in Linux.
    Thus, DT files imported from Linux do not work for U-Boot.

    In U-Boot driver model, each node is bound to a dedicated driver
    that is the most compatible to it. This design gets along with the
    concept of DT, and the syscon in Linux originally worked like that.

    However, Linux commit bdb0066df96e ("mfd: syscon: Decouple syscon
    interface from platform devices") changed the behavior because it is
    useful to let a device bind to another driver, but still work as a
    syscon provider.

    That change had happened before U-Boot initially supported the syscon
    driver by commit 6f98b7504f70 ("dm: Add support for generic system
    controllers (syscon)"). So, the U-Boot's syscon works differently
    from the beginning. I'd say this is mis-implementation given that
    DT is not oriented to a particular project, but Linux is the canon
    of DT in practice.

    The problem typically arises in the combination of "syscon" and
    "simple-mfd" compatibles.

    In Linux, they are orthogonal, i.e., the order between "syscon" and
    "simple-mfd" does not matter at all.

    Assume the following compatible.

    compatible = "foo,bar-syscon", "syscon", "simple-mfd";

    In U-Boot, this device node is bound to the syscon driver
    (driver/core/syscon-uclass.c) since the "syscon" is found to be the
    most compatible. Then, syscon_get_regmap() succeeds.

    However,

    compatible = "foo,bar-syscon", "simple-mfd", "syscon";

    does not work because this node is bound to the simple-bus driver
    (drivers/core/simple-bus.c) in favor of "simple-mfd" compatible.
    The compatible string "syscon" is just dismissed.

    Moreover,

    compatible = "foo,bar-syscon", "syscon";

    works like the first case because the syscon driver populates the
    child devices. This is wrong because populating children is the job
    of "simple-mfd" (or "simple-bus").

    This commit ports syscon_node_to_regmap() from Linux. This API
    does not require the given node to be bound to a driver in any way.

    Reported-by: Kunihiko Hayashi
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Currently, regmap_init_mem() takes a udevice. This requires the node
    has already been associated with a device. It prevents syscon/regmap
    from behaving like those in Linux.

    Change the first argumenet to take a device node.

    Signed-off-by: Masahiro Yamada
    Acked-by: Neil Armstrong
    Reviewed-by: Simon Glass

    Masahiro Yamada
     
  • device_is_compatible() takes udevice, but there is no such a helper
    that takes ofnode.

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

    Masahiro Yamada
     
  • Putting zero length array at the end of struct is a common technique
    to embed arbitrary length of members. There is no good reason to let
    regmap_alloc_count() branch by "if (count base is an alias of
    regmap->ranges[0].start, but it is not helpful but make the code
    just ugly.

    Rename regmap_alloc_count() to regmap_alloc() because the _count
    suffix seems pointless.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass
    [trini: fixup cpu_info-rcar.c]
    Signed-off-by: Tom Rini

    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
     

01 Apr, 2018

2 commits

  • Commit 286ede6 ("drivers: core: Add translation in live tree case") made
    dev_get_addr always use proper bus translations for addresses read from
    the device tree. But this leads to problems with certain busses, e.g.
    I2C busses, which run into an error during translation, and hence stop
    working.

    It turns out that of_translate_address() and fdt_translate_address()
    stop the address translation with an error when they're asked to
    translate addresses for busses where #size-cells == 0 (comment from
    drivers/core/of_addr.c):

    * Note: We consider that crossing any level with #size-cells == 0 to mean
    * that translation is impossible (that is we are not dealing with a value
    * that can be mapped to a cpu physical address). This is not really specified
    * that way, but this is traditionally the way IBM at least do things

    To fix this case, we check in both the live-tree and non-live tree-case,
    whether the bus of the device whose address is about to be translated
    has size-cell size zero. If this is the case, we just read the address
    as a plain integer and return it, and only apply bus translations if the
    size-cell size if greater than zero.

    Signed-off-by: Mario Six
    Signed-off-by: Martin Fuzzey
    Reported-by: Martin Fuzzey
    Fixes: 286ede6 ("drivers: core: Add translation in live tree case")
    Reviewed-by: Simon Glass

    Mario Six
     
  • dm_scan_fdt_node can't work when live dt is active,
    we should use dm_scan_fdt_live instead.

    Signed-off-by: Andy Yan
    Reviewed-by: Simon Glass

    Andy Yan
     

31 Mar, 2018

1 commit


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
     

24 Feb, 2018

2 commits

  • We need to get ofnode from a phandle, add interface to support
    both live dt and fdt.

    Signed-off-by: Kever Yang
    Reviewed-by: Simon Glass
    Reviewed-by: Philipp Tomsich
    Tested-by: Klaus Goger
    Signed-off-by: Philipp Tomsich

    Kever Yang
     
  • The Rockchip video drivers need to walk the ofnode-parrents to find
    an enclosing device that has a UCLASS_DISPLAY driver bound. This
    adds a ofnode_get_parent()-function that returns the parent-node.

    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger
    Reviewed-by: Anatolij Gustschin

    Philipp Tomsich
     

04 Feb, 2018

1 commit


29 Jan, 2018

1 commit

  • Linux uses the properties 'assigned-clocks', 'assigned-clock-parents'
    and 'assigned-clock-rates' to configure the clock subsystem for use
    with various peripheral nodes.

    This implements clk_set_defaults() and hooks it up with the general
    device probibin in drivers/core/device.c: when a new device is probed,
    clk_set_defaults() will be called for it and will process the
    properties mentioned above.

    Note that this functionality is designed to fail gracefully (i.e. if a
    clock-driver does not implement set_parent(), we simply accept this
    and ignore the error) as not to break existing board-support.

    Signed-off-by: Philipp Tomsich
    Tested-by: David Wu

    Series-changes: 2
    - Fixed David's email address.

    Series-version: 2

    Cover-letter:
    clk: support assigned-clock, assigned-clock-parents, assigned-clock-rates

    For various peripherals on Rockchip SoCs (e.g. for the Ethernet GMAC),
    the parent-clock needs to be set via the DTS. This adds the required
    plumbing and implements the GMAC case for the RK3399.
    END

    Philipp Tomsich
     

25 Jan, 2018

1 commit


22 Jan, 2018

6 commits


16 Jan, 2018

3 commits


17 Nov, 2017

1 commit

  • This currently causes a warning in sandbox and will not do the right
    thing:

    drivers/core/read.c: In function ‘dev_read_addr_ptr’:
    drivers/core/read.c:64:44: warning: cast to pointer from integer of
    different size [-Wint-to-pointer-cast]
    return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;

    Use map_sysmem() which is the correct way to convert an address to a
    pointer.

    Fixes: c131c8bca8 (dm: core: add dev_read_addr_ptr())
    Signed-off-by: Simon Glass
    Reviewed-by: Philipp Tomsich
    Reviewed-by: Bin Meng
    Tested-by: Bin Meng
    Acked-by: Philipp Tomsich

    Simon Glass
     

24 Oct, 2017

1 commit


09 Oct, 2017

1 commit

  • The livetree codepath of ofnode_get_addr_size always used the "reg"
    property for of_get_property. Use the property parameter of the function
    call instead and check the return value if the property exists.
    Otherwise return FDT_ADDR_T_NONE.

    This was discoverd while using SPI NOR with livetree.
    spi_flash_decode_fdt checks for memory-map and will not fail with
    livetree even if the property does not exist.

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

    Klaus Goger