24 May, 2019

2 commits

  • If a device has relevant power domain, we will check the power up
    result in probing the device. If the power up is failed, the device_probe
    will return failure immediately.

    The only exception is the new FLAG (DM_FLAG_IGNORE_POWER_ON) is set by driver
    to indicate ignore the power up result.

    Signed-off-by: Ye Li
    (cherry picked from commit 8524ca764d8fbd05da1593abfed62bb075c50cd4)

    Ye Li
     
  • Add a new driver FLAG (DM_FLAG_IGNORE_DEFAULT_CLKS). If any driver
    is set with this flag, then when probing the device, we will skip
    setting the default clocks.

    This is useful when clock driver can't work with some device driver.

    Signed-off-by: Ye Li

    Ye Li
     

20 Feb, 2019

1 commit

  • At present it is not possible to use the syscon devices for PCI devices
    since a regmap is required. Since PCI uses a 3-cell address the conversion
    of the 'reg' property to an address always fails. In any case, the regmap
    is not useful with PCI since devices are accessed through the PCI bus
    which regmap does not support.

    Add a special case for PCI syscon devices, so that they don't set up a
    regmap.

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

    Simon Glass
     

12 Feb, 2019

1 commit


09 Feb, 2019

1 commit


08 Feb, 2019

2 commits

  • It is wrapper for calling of_alias_get_highest_id() when live tree is
    enabled and fdtdec_get_alias_highest_id() if not.

    Signed-off-by: Michal Simek
    Reviewed-by: Heiko Schocher
    Reviewed-by: Simon Glass

    Michal Simek
     
  • The same functionality was added to Linux for i2c bus registration with this
    commit message:

    "
    of: base: add function to get highest id of an alias stem

    I2C supports adding adapters using either a dynamic or fixed id. The
    latter is provided by aliases in the DT case. To prevent id collisions
    of those two types, install this function which gives us the highest
    fixed id, so we can then let the dynamically created ones come after
    this highest number.

    Signed-off-by: Wolfram Sang
    Acked-by: Rob Herring
    Signed-off-by: Wolfram Sang
    "

    Add it also to U-Boot for DM I2C support.

    Signed-off-by: Michal Simek
    Reviewed-by: Heiko Schocher
    Reviewed-by: Simon Glass

    Michal Simek
     

18 Jan, 2019

1 commit


15 Jan, 2019

1 commit

  • At present the 'Index' column assumes there is only one digit. But on some
    devices (e.g. snow) there are a lot of regulators and GPIO banks. Adjust
    the output to allow for two digits without messing up the display.

    Also capatalise the heading to match.

    Fixes: 5197dafc42 (dm: core: Widen the dump tree to show more of the
    driver's name.)

    Signed-off-by: Simon Glass
    Reviewed-by: Liviu Dudau

    Simon Glass
     

16 Dec, 2018

1 commit


14 Dec, 2018

1 commit

  • The current dev_read...() functions use s32 and u32 which are convenient
    for device tree but not so useful for normal code, which often wants to
    use normal integers for values.

    Add a helper which supports returning an unsigned int. Also add signed
    versions of the unsigned readers.

    Signed-off-by: Simon Glass

    Simon Glass
     

10 Dec, 2018

4 commits


07 Dec, 2018

1 commit


05 Dec, 2018

1 commit


30 Nov, 2018

3 commits


21 Nov, 2018

1 commit


17 Nov, 2018

1 commit


15 Nov, 2018

13 commits

  • Use the uclass_foreach_dev() macro instead of the open coded version.

    Signed-off-by: Liviu Dudau
    Reviewed-by: Simon Glass

    Liviu Dudau
     
  • Some buses need to set up their child devices after they are probed.
    Support a common child_post_probe() method for the uclass.

    With this change, the two APIs uclass_pre_probe_device() and
    uclass_post_probe_device() become symmetric.

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

    Bin Meng
     
  • Add support for switching the endianness of regmap accesses via the
    "little-endian", "big-endian", and "native-endian" boolean properties in
    the device tree.

    The default endianness is native endianness.

    Signed-off-by: Mario Six
    Reviewed-by: Simon Glass
    Reviewed-by: Daniel Schwierzeck

    Mario Six
     
  • It is useful to be able to treat the different ranges of a regmap
    separately to be able to use distinct offset for them, but this is
    currently not implemented in the regmap API.

    To preserve backwards compatibility, add regmap_read_range and
    regmap_write_range functions that take an additional parameter
    'range_num' that identifies the range to operate on.

    Reviewed-by: Anatolij Gustschin
    Reviewed-by: Simon Glass
    Signed-off-by: Mario Six

    Mario Six
     
  • The regmap functions currently assume that all register map accesses
    have a data width of 32 bits, but there are maps that have different
    widths.

    To rectify this, implement the regmap_raw_read and regmap_raw_write
    functions from the Linux kernel API that specify the width of a desired
    read or write operation on a regmap.

    Implement the regmap_read and regmap_write functions using these raw
    functions in a backwards-compatible manner.

    Reviewed-by: Anatolij Gustschin
    Signed-off-by: Mario Six
    Reviewed-by: Simon Glass

    Mario Six
     
  • Add some debug output in cases where the initialization of a regmap
    fails.

    Reviewed-by: Anatolij Gustschin
    Reviewed-by: Simon Glass
    Signed-off-by: Mario Six

    Mario Six
     
  • Both fdtdec_get_addr_size_fixed and of_address_to_resource can fail with
    an error, which is not currently checked during regmap initialization.

    Since the indentation depth is already quite deep, extract a new
    'init_range' method to do the initialization.

    Reviewed-by: Anatolij Gustschin
    Reviewed-by: Simon Glass
    Signed-off-by: Mario Six

    Mario Six
     
  • A newly created property is currently not freed if a name could not be
    allocated. This patch fixes the resulting memory leak in the error
    patch.

    Reported-by: Coverity (CID: 184085)
    Fixes: e369e58df79c ("core: Add functions to set properties in live-tree")
    Signed-off-by: Mario Six

    Mario Six
     
  • ofnode_read_simple_addr_cells may fail and return a negative error code.
    Check for this when initializing regmaps.

    Also check if both_len is zero, since this is perfectly possible, and
    would lead to a division-by-zero further down the line.

    Reviewed-by: Anatolij Gustschin
    Reviewed-by: Simon Glass
    Signed-off-by: Mario Six

    Mario Six
     
  • Document the regmap_alloc() function.

    Reviewed-by: Anatolij Gustschin
    Reviewed-by: Simon Glass
    Signed-off-by: Mario Six

    Mario Six
     
  • Commit f2006808f099: ("dm: core: parse chosen node") added a logic
    to parse the chosen node during dm_scan_fdt_node(), but unfortunately
    it missed adding the same logic in dm_scan_fdt_live(). This mirrors
    the logic in the livetree version.

    The weird thing is that commit f2006808f099 did update the test case
    to test such logic, but even if I reset to that commit, the test case
    still fails, and I have no idea how it could pass.

    With this fix, the following 2 test cases now pass:

    Test: dm_test_bus_children: bus.c
    test/dm/bus.c:112, dm_test_bus_children(): num_devices ==
    list_count_items(&uc->dev_head): Expected 7, got 6

    Test: dm_test_fdt: test-fdt.c
    test/dm/test-fdt.c:184, dm_test_fdt(): num_devices ==
    list_count_items(&uc->dev_head): Expected 7, got 6

    Fixes: f2006808f099 ("dm: core: parse chosen node")
    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Currently the comments of several APIs (eg: dm_init_and_scan()) say:

    @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
    flag. If false bind all drivers.

    The 'Pre-Relocation Support' chapter in doc/driver-model/README.txt
    documents the same that both device tree properties and driver flag
    are supported.

    However the implementation only checks these special device tree
    properties without checking the driver flag at all. This updates
    lists_bind_fdt() to consider both scenarios.

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass
    Squashed in http://patchwork.ozlabs.org/patch/996473/ :
    Signed-off-by: Simon Glass

    Bin Meng
     
  • This adds a new API dm_ofnode_pre_reloc(), a livetree equivalent
    API of dm_fdt_pre_reloc().

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

    Bin Meng
     

09 Oct, 2018

5 commits