01 Jun, 2017

1 commit


22 Jan, 2016

1 commit


19 Aug, 2015

1 commit

  • We do not want to compile the DM remove code for SPL. Currently,
    we undef it in include/config_uncmd_spl.h (for C files) and in
    scripts/Makefile.uncmd_spl (for Makefiles). This is really ugly.

    This commit demonstrates how we can deprecate those two files.

    Use $(SPL_) for the entry in the Makfile and CONFIG_IS_ENABLED()
    in C files.

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

    Masahiro Yamada
     

23 Apr, 2015

5 commits

  • The CONFIG_DM_DEVICE_REMOVE option takes out code related to removing
    devices. It should also remove the 'unbind' code since if we cannot
    remove we probably don't need to unbind.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The functions:
    - uclass_find_device_by_name()
    - uclass_get_device_by_name()
    searches the required device for the exactly given name.
    This patch, presice this fact for both function's comments.

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Acked-by: Simon Glass

    Przemyslaw Marczak
     
  • Uclass API provides a few functions for get/find the device.
    To provide a complete function set of uclass-internal functions,
    for use by the drivers, the function uclass_get_device_tail()
    should be non-static.

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Acked-by: Simon Glass

    Przemyslaw Marczak
     
  • This commit extends the driver model uclass's API by function:
    - uclass_find_device_by_name()

    And this function returns the device if:
    - uclass with given ID, exists,
    - device with exactly given name(dev->name), exists.

    The returned device is not activated - need to be probed before use.

    Note:
    This function returns the first device, which name is equal
    to the given one. This means, that using this function you must
    assume, that the device name is unique in the given uclass's ID
    device list.

    uclass-internal.h: cleanup - move the uclass_find_device_by_seq()
    declaration and description, near the other uclass_find*() functions.

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Acked-by: Simon Glass

    Przemyslaw Marczak
     
  • This commit extends the uclass-internal functions by:
    - uclass_find_first_device()
    - uclass_find_next_device()
    For both functions, the returned device is not probed.

    After some cleanup, the above functions are called by:
    - uclass_first_device()
    - uclass_next_device()
    for which, the returned device is probed.

    Signed-off-by: Przemyslaw Marczak
    Cc: Simon Glass
    Acked-by: Simon Glass

    Przemyslaw Marczak
     

17 Apr, 2015

1 commit

  • Some uclasses want to set up a device before it is probed. Add a method
    for this.

    An example is with PCI, where a PCI uclass wants to set up its private
    data for later use. This allows the device's uclass() method to make calls
    whcih use that data (for example, read PCI memory regions from device
    tree, set up bus numbers).

    Signed-off-by: Simon Glass

    Simon Glass
     

30 Jan, 2015

1 commit


23 Jul, 2014

1 commit

  • In U-Boot it is pretty common to number devices from 0 and access them
    on the command line using this numbering. While it may come to pass that
    we will move away from this numbering, the possibility seems remote at
    present.

    Given that devices within a uclass will have an implied numbering, it
    makes sense to build this into driver model as a core feature. The cost
    is fairly small in terms of code and data space.

    With each uclass having numbered devices we can ask for SPI port 0 or
    serial port 1 and receive a single device.

    Devices typically request a sequence number using aliases in the device
    tree. These are resolved when the device is probed, to deal with conflicts.
    Sequence numbers need not be sequential and holes are permitted.

    At present there is no support for sequence numbers using static platform
    data. It could easily be added to 'struct driver_info' if needed, but it
    seems better to add features as we find a use for them, and the use of -1
    to mean 'no sequence' makes the default value somewhat painful.

    Signed-off-by: Simon Glass

    Simon Glass
     

27 May, 2014

1 commit

  • using UBI and DM together leads in compiler error, as
    both define a "struct device", so rename "struct device"
    in include/dm/device.h to "struct udevice", as we use
    linux code (MTD/UBI/UBIFS some USB code,...) and cannot
    change the linux "struct device"

    Signed-off-by: Heiko Schocher
    Cc: Simon Glass
    Cc: Marek Vasut

    Heiko Schocher
     

05 Mar, 2014

1 commit

  • Add driver model functionality for generic board.

    This includes data structures and base code for registering devices and
    uclasses (groups of devices with the same purpose, e.g. all I2C ports will
    be in the same uclass).

    The feature is enabled with CONFIG_DM.

    Signed-off-by: Simon Glass
    Signed-off-by: Marek Vasut
    Signed-off-by: Pavel Herrmann
    Signed-off-by: Viktor Křivák
    Signed-off-by: Tomas Hlavacek

    Simon Glass