History log of /rk3399_rockchip-uboot/test/dm/test-fdt.c (Results 1 – 25 of 29)
Revision Date Author Comments
# 1f383ee4 12-Oct-2022 Michal Suchanek <msuchanek@suse.de>

UPSTREAM: dm: core: Do not stop uclass iteration on error

When probing a device fails NULL pointer is returned, and following
devices in uclass list cannot be iterated. Skip to next device on error

UPSTREAM: dm: core: Do not stop uclass iteration on error

When probing a device fails NULL pointer is returned, and following
devices in uclass list cannot be iterated. Skip to next device on error
instead.

With that the only condition under which these simple iteration
functions return error is when the dm is not initialized at uclass_get
time. This is not all that interesting, change return type to void.

Fixes: 6494d708bf ("dm: Add base driver model support")
Change-Id: Ie327dc21db7ee80f9fc32e7913be2af71bb074a7
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit f21954750aa8ed445ab83998bb099e366136c428)
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>

show more ...


# 771aadba 06-Feb-2020 Simon Glass <sjg@chromium.org>

UPSTREAM: dm: core: Add a function to find a device by drvdata

It is sometimes useful to find a device in a uclass using only its driver
data. The driver data often indicates the 'subtype' of the de

UPSTREAM: dm: core: Add a function to find a device by drvdata

It is sometimes useful to find a device in a uclass using only its driver
data. The driver data often indicates the 'subtype' of the device, e,g,
via its compatible string.

Add a function to handle this.

Change-Id: I6668a2a29c29346f57d3d975838459c0ac90fdea
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit 50162348f0d3b915004733131acd81805e202c76)
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>

show more ...


# 2c3c84fc 06-Feb-2020 Simon Glass <sjg@chromium.org>

UPSTREAM: dm: core: Allow iterating devices without uclass_get()

At present we have uclass_foreach_dev() which requires that uclass_get()
be called beforehand to find the uclass. This is good if we

UPSTREAM: dm: core: Allow iterating devices without uclass_get()

At present we have uclass_foreach_dev() which requires that uclass_get()
be called beforehand to find the uclass. This is good if we suspect that
that function might fail, but often we know that the uclass is available.

Add a new helper which does this uclass_get() automatically, so that only
the uclass ID is needed.

Change-Id: I3106b199653bf8a32d2d1a0025b77261881716fc
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
(cherry picked from commit 3cf0fba4ff862d833545f82fb2209ff3c79d17b5)
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>

show more ...


# 8d3a2568 12-Jul-2017 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-dm


# 95ce385a 24-Apr-2017 Simon Glass <sjg@chromium.org>

dm: core: Add uclass_first/next_device_check()

Sometimes it is useful to iterate through all devices in a uclass and
skip over those which do not work correctly (e.g fail to probe). Add two
new func

dm: core: Add uclass_first/next_device_check()

Sometimes it is useful to iterate through all devices in a uclass and
skip over those which do not work correctly (e.g fail to probe). Add two
new functions to provide this feature.

The caller must check the return value each time to make sure that the
device is valid. But the device pointer is always returned.

Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# 98561572 24-Apr-2017 Simon Glass <sjg@chromium.org>

dm: core: Test uclass_first/next_device() on probe failure

Add some tests which check the behaviour of uclass_first_device() and
uclass_next_device() when probing of a device fails.

Signed-off-by:

dm: core: Test uclass_first/next_device() on probe failure

Add some tests which check the behaviour of uclass_first_device() and
uclass_next_device() when probing of a device fails.

Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# 86b54ece 19-May-2017 Simon Glass <sjg@chromium.org>

dm: test: Disable the fdt_offset test with livetree

We cannot run this test with livetree since it uses device tree offsets.
Mark it as flat tree only.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 21342d4a 08-Feb-2017 Tom Rini <trini@konsulko.com>

Merge git://git.denx.de/u-boot-dm


# e160f7d4 17-Jan-2017 Simon Glass <sjg@chromium.org>

dm: core: Replace of_offset with accessor

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,

dm: core: Replace of_offset with accessor

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 <sjg@chromium.org>

show more ...


# e721b882 20-May-2015 Joe Hershberger <joe.hershberger@ni.com>

test: Generalize the unit test framework

Separate the ability to define tests and assert status of test functions
from the dm tests so they can be used more consistently throughout all
tests.

Signe

test: Generalize the unit test framework

Separate the ability to define tests and assert status of test functions
from the dm tests so they can be used more consistently throughout all
tests.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

show more ...


# e1cc4d31 24-Feb-2015 Albert ARIBAUD <albert.u.boot@aribaud.net>

Merge remote-tracking branch 'u-boot/master' into 'u-boot-arm/master'


# e72d3443 13-Feb-2015 Stefano Babic <sbabic@denx.de>

Merge branch 'master' of git://git.denx.de/u-boot


# 8e3da9dd 30-Jan-2015 Tom Rini <trini@ti.com>

Merge branch 'master' of git://git.denx.de/u-boot-dm


# 83c7e434 25-Jan-2015 Simon Glass <sjg@chromium.org>

dm: core: Allow uclass to set up a device's child before it is probed

Some buses need to set up their devices before they can be used. This setup
may well be common to all buses in a particular ucla

dm: core: Allow uclass to set up a device's child before it is probed

Some buses need to set up their devices before they can be used. This setup
may well be common to all buses in a particular uclass. Support a common
pre-probe method for the uclass, called before any bus devices are probed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

show more ...


# 9cc36a2b 25-Jan-2015 Simon Glass <sjg@chromium.org>

dm: core: Add a flag to control sequence numbering

At present we try to use the 'reg' property and device tree aliases to give
devices a sequence number. The 'reg' property is often actually a memor

dm: core: Add a flag to control sequence numbering

At present we try to use the 'reg' property and device tree aliases to give
devices a sequence number. The 'reg' property is often actually a memory
address, so the sequence numbers thus-obtained are not useful. It would be
better if the devices were just sequentially numbered in that case. In fact
neither I2C nor SPI use this feature, so drop it.

Some devices need us to look up an alias to number them within the uclass.
Add a flag to control this, so it is not done unless it is needed.

Adjust the tests to test this new behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

show more ...


# f8a85449 25-Jan-2015 Simon Glass <sjg@chromium.org>

dm: core: Allocate platform data when binding a device

When using allocated platform data, allocate it when we bind the device.
This makes it possible to fill in this information before the device i

dm: core: Allocate platform data when binding a device

When using allocated platform data, allocate it when we bind the device.
This makes it possible to fill in this information before the device is
probed.

This fits with the platform data model (when not using device tree),
since platform data exists at bind-time.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

show more ...


# c23154aa 08-Aug-2014 Stefano Babic <sbabic@denx.de>

Merge branch 'master' of git://git.denx.de/u-boot-arm


# 1ca7e206 23-Jul-2014 Simon Glass <sjg@chromium.org>

dm: Provide a function to scan child FDT nodes

At present only root nodes in the device tree are scanned for devices.
But some devices can have children. For example a SPI bus may have
several child

dm: Provide a function to scan child FDT nodes

At present only root nodes in the device tree are scanned for devices.
But some devices can have children. For example a SPI bus may have
several children for each of its chip selects.

Add a function which scans subnodes and binds devices for each one. This
can be used for the root node scan also, so change it.

A device can call this function in its bind() or probe() methods to bind
its children.

Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# f4cdead2 23-Jul-2014 Simon Glass <sjg@chromium.org>

dm: Allow a device to be found by its FDT offset

Each device that was bound from a device tree has an node that caused it to
be bound. Add functions that find and return a device based on a device t

dm: Allow a device to be found by its FDT offset

Each device that was bound from a device tree has an node that caused it to
be bound. Add functions that find and return a device based on a device tree
offset.

Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# 5a66a8ff 23-Jul-2014 Simon Glass <sjg@chromium.org>

dm: Introduce device sequence numbering

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 a

dm: Introduce device sequence numbering

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 <sjg@chromium.org>

show more ...


# 00606d7e 23-Jul-2014 Simon Glass <sjg@chromium.org>

dm: Allow drivers to be marked 'before relocation'

Driver model currently only operates after relocation is complete. In this
state U-Boot typically has a small amount of memory available. In adding

dm: Allow drivers to be marked 'before relocation'

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 <sjg@chromium.org>

show more ...


# eb9ef5fe 23-Jul-2014 Simon Glass <sjg@chromium.org>

dm: Use an explicit expect value in core tests

Rather than reusing the 'reg' property, use an explicit property for the
expected ping value used in testing.

Signed-off-by: Simon Glass <sjg@chromium

dm: Use an explicit expect value in core tests

Rather than reusing the 'reg' property, use an explicit property for the
expected ping value used in testing.

Signed-off-by: Simon Glass <sjg@chromium.org>

show more ...


# dab5e346 16-Jul-2014 Stefano Babic <sbabic@denx.de>

Merge branch 'master' of git://git.denx.de/u-boot

Signed-off-by: Stefano Babic <sbabic@denx.de>

Conflicts:
boards.cfg


# ed1d98d8 25-Jun-2014 Albert ARIBAUD <albert.u.boot@aribaud.net>

Merge branch 'u-boot/master' into 'u-boot-arm/master'


# 39b6d07f 21-Jun-2014 Tom Rini <trini@ti.com>

Merge branch 'master' of git://git.denx.de/u-boot-dm


12