08 Oct, 2019

1 commit


09 Feb, 2019

1 commit


09 Oct, 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
     

04 Feb, 2018

1 commit


05 Apr, 2017

2 commits

  • Add a test for the correct device removal. Currently two different ways
    for device removal are supported:

    - Normal device removal via the device_remove() API
    - Removal via selective device driver flags (DM_FLAG_ACTIVE_DMA)

    This new test "remove_active_dma" adds tests cases for those both ways
    of removal. This is done by adding a new test driver, which has this
    flag set.

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

    Stefan Roese
     
  • 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
     

15 Apr, 2016

1 commit

  • LLVM 3.5 noted:
    test/dm/core.c:41:35: warning: unused variable 'test_pdata_pre_reloc' [-Wunused-const-variable]
    static const struct dm_test_pdata test_pdata_pre_reloc = {

    And the correct fix here is that the driver_info_pre_reloc test should
    use the test_pdata_pre_reloc not test_pdata_manual variable

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

    Tom Rini
     

05 Oct, 2015

1 commit


21 May, 2015

1 commit


23 Apr, 2015

4 commits

  • We must not clear global_data even in tests, since the ram_buffer (which
    is used by malloc()) will also be lost, and subsequent tests will fail.

    Zero only the global_data fields that are required for the test to function.

    Signed-off-by: Simon Glass
    Reviewed-by: Joe Hershberger
    Tested-by: Joe Hershberger

    Simon Glass
     
  • This commit introduces simple tests for functions:
    - uclass_find_device_by_name()
    - uclass_get_device_by_name()

    Tests added by this commit:
    - Test: dm_test_uclass_devices_find_by_name: for uclass id: UCLASS_TEST_FDT
    * get uclass's devices by uclass_find_first/next_device() each as 'testdev',
    * for each returned device, call: uclass_find_device_by_name(),
    with previously returned device's name as an argument ('testdev->name').
    * for the found device ('founddev') check if:
    * founddev != NULL
    * testdev == founddev
    * testdev->name == founddev->name (by strcmp)

    - Test: dm_test_uclass_devices_get_by_name: for uclass id: UCLASS_TEST_FDT
    * get uclass's devices by uclass_get_first/next_device() each as 'testdev',
    * for each returned device, call: uclass_get_device_by_name(),
    with previously returned device's name as an argument ('testdev->name').
    * for the found device ('founddev') check if:
    * founddev != NULL
    * founddev is active
    * testdev == founddev
    * testdev->name == founddev->name (by strcmp)

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

    Przemyslaw Marczak
     
  • This commit introduces simple tests for functions:
    - uclass_find_first_device()
    - uclass_find_next_device()
    - uclass_first_device()
    - uclass_next_device()

    Tests added by this commit:
    - Test: dm_test_uclass_devices_find:
    * call uclass_find_first_device(), then check if: (dev != NULL), (ret == 0)
    * for the rest devices, call uclass_find_next_device() and do the same check

    - Test: dm_test_uclass_devices_get:
    * call uclass_first_device(), then check if:
    -- (dev != NULL), (ret == 0), device_active()
    * for the rest devices, call uclass_next_device() and do the same check

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

    Przemyslaw Marczak
     
  • This test introduces new test structure type:dm_test_perdev_uc_pdata.
    The structure consists of three int values only. For the test purposes,
    three pattern values are defined by enum, starting with TEST_UC_PDATA_INTVAL1.

    This commit adds two test cases for uclass platform data:
    - Test: dm_test_autobind_uclass_pdata_alloc - this tests if:
    * uclass driver sets: .per_device_platdata_auto_alloc_size field
    * the devices's: dev->uclass_platdata is non-NULL

    - Test: dm_test_autobind_uclass_pdata_valid - this tests:
    * if the devices's: dev->uclass_platdata is non-NULL
    * the structure of type 'dm_test_perdev_uc_pdata' allocated at address
    pointed by dev->uclass_platdata. Each structure field, should be equal
    to proper pattern data, starting from .intval1 == TEST_UC_PDATA_INTVAL1.

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

    Przemyslaw Marczak
     

17 Apr, 2015

2 commits


30 Jan, 2015

1 commit


24 Oct, 2014

1 commit


23 Jul, 2014

3 commits

  • Don't allow access to uclasses before they have been initialised.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Driver model currently only operates after relocation is complete. In this
    state U-Boot typically has a small amount of memory available. In adding
    support for driver model prior to relocation we must try to use as little
    memory as possible.

    In addition, on some machines the memory has not be inited and/or the CPU
    is not running at full speed or the data cache is off. These can reduce
    execution performance, so the less initialisation that is done before
    relocation the better.

    An immediately-obvious improvement is to only initialise drivers which are
    actually going to be used before relocation. On many boards the only such
    driver is a serial UART, so this provides a very large potential benefit.

    Allow drivers to mark themselves as 'pre-reloc' which means that they will
    be initialised prior to relocation. This can be done either with a driver
    flag or with a 'dm,pre-reloc' device tree property.

    To support this, the various dm scanning function now take a 'pre_reloc_only'
    parameter which indicates that only drivers marked pre-reloc should be
    bound.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The root device should be probed just like any other device. The effect of
    this is to mark the device as activated, so that it can be removed (along
    with its children) if required.

    Signed-off-by: Simon Glass
    Acked-by: Marek Vasut

    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 some tests of driver model functionality. Coverage includes:

    - basic init
    - binding of drivers to devices using platform_data
    - automatic probing of devices when referenced
    - availability of platform data to devices
    - lifecycle from bind to probe to remove to unbind
    - renumbering within a uclass when devices are probed/removed
    - calling driver-defined operations
    - deactivation of drivers when removed
    - memory leak across creation and destruction of drivers/uclasses
    - uclass init/destroy methods
    - automatic probe/remove of children/parents when needed

    This function is enabled for sandbox, using CONFIG_DM_TEST.

    Signed-off-by: Simon Glass

    Simon Glass