21 Aug, 2018

1 commit


06 Aug, 2018

1 commit


09 Jul, 2018

1 commit


08 May, 2018

1 commit


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
     

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
     

22 Jan, 2018

1 commit


09 Oct, 2017

1 commit


05 Oct, 2017

1 commit

  • As we discussed before in ML, dm_dbg() causes undefined reference
    error if #define DEBUG is added to users, but not drivers/core/util.c

    We do not need this macro because we can use pr_debug() instead, and
    it is pretty easy to enable it for the DM core by using ccflags-y.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

01 Jun, 2017

5 commits


14 Apr, 2017

1 commit

  • There is a strange interaction with drivers which use DMA if the cache
    starts off in a dirty state. Buffer space which the driver reads (but has
    not previously written) can contain zero bytes from alloc_priv(). This can
    cause corruption of the memory used by DMA for incoming data.

    Fix this and add a comment to explain the problem.

    This allows the dwc2 driver to work correctly with driver model, for
    example.

    Signed-off-by: Simon Glass

    Simon Glass
     

05 Apr, 2017

1 commit

  • This patch adds the flags parameter to device_remove() and changes all
    calls to this function to provide the default value of DM_REMOVE_NORMAL
    for "normal" device removal.

    This is in preparation for the driver specific pre-OS (e.g. DMA
    cancelling) remove support.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Acked-by: Simon Glass

    Stefan Roese
     

08 Feb, 2017

1 commit

  • At present devices use a simple integer offset to record the device tree
    node associated with the device. In preparation for supporting a live
    device tree, which uses a node pointer instead, refactor existing code to
    access this field through an inline function.

    Signed-off-by: Simon Glass

    Simon Glass
     

03 Dec, 2016

1 commit

  • The currently available functions accessing the 'reg' property of a
    device only retrieve the address. Sometimes its also necessary to
    retrieve the size described by the 'reg' property. This patch adds
    the new function dev_get_addr_size_index() which retrieves both,
    the address and the size described by the 'reg' property.

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Acked-by: Simon Glass

    Stefan Roese
     

24 Oct, 2016

1 commit


14 Oct, 2016

1 commit

  • These have now landed upstream. The naming is different and in one case the
    function signature has changed. Update the code to match.

    This applies the following upstream commits by
    Thierry Reding :

    604e61e fdt: Add functions to retrieve strings
    8702bd1 fdt: Add a function to get the index of a string
    2218387 fdt: Add a function to count strings

    Signed-off-by: Simon Glass

    Simon Glass
     

12 Aug, 2016

1 commit

  • Some code may want to read reg values from DT, but from nodes that aren't
    associated with DM devices, so using dev_get_addr_index() isn't
    appropriate. In this case, fdtdec_get_addr_size_*() are the functions to
    use. However, "translation" (via the chain of ranges properties in parent
    nodes) may still be desirable. Add a function parameter to request that,
    and implement it. Update all call sites to default to the original
    behaviour.

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

    Stephen Warren
     

15 Jul, 2016

3 commits

  • Devices which use of-platdata have their own platdata. However, in many
    cases the driver will have its own auto-alloced platdata, for use with the
    device tree. The ofdata_to_platdata() method converts the device tree
    settings to platdata.

    With of-platdata we would not normally allocate the platdata since it is
    provided by the U_BOOT_DEVICE() declaration. However this is inconvenient
    since the of-platdata struct is closely tied to the device tree properties.
    It is unlikely to exactly match the platdata needed by the driver.

    In fact a useful approach is to declare platdata in the driver like this:

    struct r3288_mmc_platdata {
    struct dtd_rockchip_rk3288_dw_mshc of_platdata;
    /* the 'normal' fields go here */
    };

    In this case we have dt_platadata available, but the normal fields are not
    present, since ofdata_to_platdata() is never called. In fact driver model
    doesn't allocate any space for the 'normal' fields, since it sees that there
    is already platform data attached to the device.

    To make this easier, adjust driver model to allocate the full size of the
    struct (i.e. platdata_auto_alloc_size from the driver) and copy in the
    of-platdata. This means that when the driver's bind() method is called,
    the of-platdata will be present, followed by zero bytes for the empty
    'normal field' portion.

    A new DM_FLAG_OF_PLATDATA flag is available that indicates that the platdata
    came from of-platdata. When the allocation/copy happens, the
    DM_FLAG_ALLOC_PDATA flag will be set as well. The dtoc tool is updated to
    output the platdata_size field, since U-Boot has no other way of knowing
    the size of the of-platdata struct.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This is a flag. Adjust the name to be consistent with the other flags.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • When CONFIG_SPL_OF_PLATDATA is enabled we should not access the device
    tree. Remove all references to this in the core driver-model code.

    Signed-off-by: Simon Glass

    Simon Glass
     

09 Jul, 2016

1 commit

  • This API helps to map physical register addresss pace of device to
    virtual address space easily. Its just a wrapper around map_physmem()
    with MAP_NOCACHE flag.

    Signed-off-by: Vignesh R
    Suggested-by: Simon Glass
    Reviewed-by: Jagan Teki
    Reviewed-by: Simon Glass
    Signed-off-by: Jagan Teki

    Vignesh R
     

27 May, 2016

1 commit

  • This will allow a driver's bind function to use the driver data. One
    example is the Tegra186 GPIO driver, which instantiates child devices
    for each of its GPIO ports, yet supports two different HW instances each
    with a different set of ports, and identified by the udevice_id .data
    field.

    Signed-off-by: Stephen Warren
    Acked-by: Simon Glass

    Stephen Warren
     

25 May, 2016

1 commit


17 May, 2016

2 commits


25 Apr, 2016

1 commit

  • On some platforms (e.g. x86), the return value of dev_get_addr() can't
    be assigned to a pointer type variable directly. As there might be a
    difference between the size of fdt_addr_t and the pointer type. On
    x86 for example, "fdt_addr_t" is 64bit but "void *" only 32bit. So
    assigning the register base directly in dev_get_addr() results in this
    compilation warning:
    warning: cast to pointer from integer of different size

    This patch introduces the new function dev_get_addr_ptr() that
    returns a pointer to the 'reg' address that can be used by drivers
    in this case.

    Signed-off-by: Stefan Roese
    Reviewed-by: Simon Glass
    Reviewed-by: Bin Meng

    Stefan Roese
     

15 Apr, 2016

3 commits

  • This function parses the reg property based on an index found in the
    reg-names property. This is required for bindings that are written
    using reg-names rather than hard-coding indices in reg.

    Signed-off-by: Stephen Warren
    Acked-by: Simon Glass

    Stephen Warren
     
  • Fix multi-line comment indentation in device_bind()

    Signed-off-by: Stefan Roese
    Cc: Simon Glass
    Reviewed-by: Bin Meng

    Stefan Roese
     
  • We may have pinmux settings for pinctrl device, like the following
    example:
    "
    &iomuxc {
    pinctrl-names = "default";
    pinctrl-0 = ;
    imx6ul-evk {
    pinctrl_hog_1: hoggrp-1 {
    fsl,pins = <
    MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */
    MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */
    MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */
    MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x80000000
    >;
    };
    [......]
    };
    "

    We should not only select pinctrl state for non pinctrl devices, we
    need also to handle pin mux settings such as pinctrl_log for pinctrl
    devices.

    So at the end of probing process of pinctrl device, select the default
    state of pinctrl device.

    Signed-off-by: Peng Fan
    Cc: Simon Glass
    Reviewed-by: Simon Glass
    Reviewed-by: Masahiro Yamada

    Peng Fan
     

29 Jan, 2016

1 commit


22 Jan, 2016

1 commit

  • There is sort-of race condition when a pinctrl device is probed. The pinctrl
    function is called which may end up using the same device as is being
    probed. This results in operations being used before the device is actually
    probed.

    For now, disallow pinctrl operations on pinctrl devices while probing. An
    alternative solution would be to move the operation to later in the
    device_probe() function (for pinctrl devices only) but this needs more
    thought.

    Signed-off-by: Simon Glass

    Simon Glass
     

21 Jan, 2016

1 commit

  • At present the uclass's post_bind() method is called before the driver's
    bind() method. This means that the uclass cannot use any of the information
    set up by the driver. Move it later in the sequence to permit this.

    This is an ordering change which is always fairly major in nature. The main
    impact is that devices which have children will not see them appear in their
    bind() method. From what I can see, existing drivers do not look at their
    children in the bind() method, so this should be safe.

    Conceptually this change seems to result in a 'more correct' ordering, since
    the uclass (which is broader than the device) gets the last word.

    Signed-off-by: Simon Glass
    Reviewed-by: Tom Rini

    Simon Glass
     

14 Jan, 2016

1 commit


13 Jan, 2016

3 commits

  • Add new api to get device address based on index.

    Signed-off-by: Mugunthan V N
    Acked-by: Jagan Teki
    [Rebased on master]
    Signed-off-by: Jagan Teki

    Mugunthan V N
     
  • The Device Model sequence alias feature is required by some Uclasses.
    Instead of disabling the feature for all SPL targets allow it to be
    configured.

    The config option is disabled by default to reduce code size for targets
    that are not interested or do not require this feature.

    Signed-off-by: Nathan Rossi
    Acked-by: Simon Glass
    Acked-by: Michal Simek
    Cc: Simon Glass
    Cc: Masahiro Yamada
    Cc: Linus Walleij
    Cc: Marek Vasut
    Cc: Michal Simek
    Cc: Stefan Roese
    Signed-off-by: Michal Simek

    Nathan Rossi
     
  • Some platforms need to ability to configure an offset to the standard
    addresses extracted from the device-tree. This patch allows this by
    adding a function to DM to configure this offset (if needed).

    Signed-off-by: Stefan Roese
    Acked-by: Simon Glass
    Cc: Simon Glass
    Fixed space before tab:
    Signed-off-by: Simon Glass

    Stefan Roese