History log of /rk3399_rockchip-uboot/drivers/core/uclass.c (Results 1 – 25 of 73)
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 ...


# d1cab63e 12-Oct-2022 Michal Suchanek <msuchanek@suse.de>

UPSTREAM: dm: core: Switch uclass_*_device_err to use uclass_*_device_check

The _err variant iterators use the simple iterators without suffix as
basis.

However, there is no user that uclass_next_d

UPSTREAM: dm: core: Switch uclass_*_device_err to use uclass_*_device_check

The _err variant iterators use the simple iterators without suffix as
basis.

However, there is no user that uclass_next_device_err for iteration,
many users of uclass_first_device_err use it to get the first and
(assumed) only device of an uclass, and a couple that use
uclass_next_device_err to get the device following a known device in the
uclass list.

While there are some truly singleton device classes in which more than
one device cannot exist these are quite rare, and most classes can have
multiple devices even if it is not the case on the SoC's EVB.

In a later patch the simple iterators will be updated to not stop on
error and return next device instead. With this in many cases the code
that expects the first device or an error if it fails to probe may get
the next device instead. Use the _check iterators as the basis of _err
iterators to preserve the old behavior.

Change-Id: Ia4a249c906a12db0cda69d44097a4fd3682d2ed9
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit e44d7e73fe0d649693d8d0a110cd7632bc919273)
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 ...


# d07fa43e 24-Oct-2018 Patrice Chotard <patrice.chotard@st.com>

UPSTREAM: dm: uclass: Add uclass_next_device_err() to return a valid device

Similarly to uclass_first_device_err(), add uclass_next_device_err()
which returns an error if there are no next devices i

UPSTREAM: dm: uclass: Add uclass_next_device_err() to return a valid device

Similarly to uclass_first_device_err(), add uclass_next_device_err()
which returns an error if there are no next devices in that uclass.

Change-Id: I44e34260045b15db3b19eeb0bbea725d80a956d2
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit f6abd5389ceab5fce185126c2364a324465fafbe)
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>

show more ...


# d9da4b44 08-Oct-2021 Joseph Chen <chenjh@rock-chips.com>

dm: core: add kernel dtb version 2 mechanism support

The V2 mechanism:
- both of U-Boot and kernel's *ALL* devices are exist in dm tree.
- put the necessary U-Boot devices in the head of device

dm: core: add kernel dtb version 2 mechanism support

The V2 mechanism:
- both of U-Boot and kernel's *ALL* devices are exist in dm tree.
- put the necessary U-Boot devices in the head of device uclass list.
- the both existence policy don't require phandle fixup any more.
- it is for the next generation(rk3588 ...) or necessary platforms.
- traverse u-boot fdt phandle if not found in kernel fdt, because
the U-Boot framework gets phandle by of_root(from fdt) but not dm_root(from dm).
The V1 mechanism(legacy):
- U-Boot: only some necessary U-Boot devices(storage, crypto...) in dm tree.
- kernel: all the devices(except the U-Boot only) in dm tree.

The commit (bd3ad955a3 scripts/dtc: phandle index start from 0x1000000) is
necessary for this v2 mechanism.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I0964f176a17725f9bb7c4e491373c278ed2bfcc5

show more ...


# 7862d7bf 14-Jan-2021 Jianqun Xu <jay.xu@rock-chips.com>

UPSTREAM: core: uclass: fix to u32 for phandle of fdt

The function has a little fix during upstream review, do fix to sync
with upstream.

Change-Id: I9e1c43a660b2f83395d1639aa962988ca04494e5
Signed

UPSTREAM: core: uclass: fix to u32 for phandle of fdt

The function has a little fix during upstream review, do fix to sync
with upstream.

Change-Id: I9e1c43a660b2f83395d1639aa962988ca04494e5
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

show more ...


# 1a4f6af8 02-Mar-2020 Joseph Chen <chenjh@rock-chips.com>

Merge branch 'next-dev' into thunder-boot


# 94fbbf0f 05-Jul-2019 Jean-Jacques Hiblot <jjhiblot@ti.com>

UPSTREAM: dm: Add a No-op uclass

This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used t

UPSTREAM: dm: Add a No-op uclass

This uclass is intended for devices that do not need any features from the
uclass, including binding children.
This will typically be used by devices that are used to bind child devices
but do not use dm_scan_fdt_dev() to do it. That is for example the case of
several USB wrappers that have 2 child devices (1 for device and 1 for
host) but bind only one at a any given time.

Change-Id: Iad9ba5f368bd2de9940cf069baf9bec9d668920c
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit 07e33711fec4f1106f36805b5dc830da07c783c5)

show more ...


# 33ffdd24 01-Mar-2018 Kever Yang <kever.yang@rock-chips.com>

debug: convert to use pr_debug for pte init and find dev

These two op have too much print, convert to pr_debug and not print
by default.

Change-Id: I5b3c738db783419717441e24ee0b04ab6f02d61e
Signed-

debug: convert to use pr_debug for pte init and find dev

These two op have too much print, convert to pr_debug and not print
by default.

Change-Id: I5b3c738db783419717441e24ee0b04ab6f02d61e
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

show more ...


# 440e24d7 28-Dec-2017 Simon Glass <sjg@chromium.org>

UPSTREAM: dm: core: Add a function to look up a uclass by name

Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the ca

UPSTREAM: dm: core: Add a function to look up a uclass by name

Each uclass has a driver name which we can use to look up the uclass. This
is useful for logging, where the uclass ID is used as the category.

Add a function to handle this, as well as a test.

Change-Id: Id221809d6f9f818b52a5bf88f4e12d409a070f05
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 6e43d1b19982b1756b7c607569d1778e556d6577)

show more ...


# 1d5894f2 08-Feb-2018 Kever Yang <kever.yang@rock-chips.com>

core: add uclass_get_device_by_phandle_id() api

Add to api for who can not get phandle from a device property.

Change-Id: I8395f02d1731a4bbb00af1e4fa9d151830fc54b0
Signed-off-by: Kever Yang <kever.

core: add uclass_get_device_by_phandle_id() api

Add to api for who can not get phandle from a device property.

Change-Id: I8395f02d1731a4bbb00af1e4fa9d151830fc54b0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

show more ...


# b96443cc 31-Jan-2018 Kever Yang <kever.yang@rock-chips.com>

core: break when uclass_find() get UCLASS_ROOT

After reloc and before dm_scan_init again, the dm_root is broken.

Change-Id: Ia5b1f762a396daa78d2498b160f89a951a4ec544
Signed-off-by: Kever Yang <keve

core: break when uclass_find() get UCLASS_ROOT

After reloc and before dm_scan_init again, the dm_root is broken.

Change-Id: Ia5b1f762a396daa78d2498b160f89a951a4ec544
Signed-off-by: Kever Yang <kever.yang@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 ...


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

dm: core: Clarify uclass_first/next_device() comments

These are not as clear as they could be. Tidy them up a bit. Also fix a
tiny code-style nit.

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


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

dm: core: Update uclass_find_device_by_phandle() for livetree

Adjust this function to work with livetree.

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


# 40bb637d 19-May-2017 Simon Glass <sjg@chromium.org>

dm: core: Add a way to find a device by ofnode

Add a function which looks up a device by its node (either in live tree
or flat tree).

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


# b7b24a7a 13-Apr-2017 Tom Rini <trini@konsulko.com>

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

Here with some DM changes as well as the long-standing AT91 DM/DT
conversion patches which I have picked up via dm.


# ea168e33 04-Apr-2017 Alexandru Gagniuc <alex.g@adaptrum.com>

core/uclass: Print name of device in uclass_find_device_by_seq()

uclass_find_device_by_seq() prints seq and req_seq when debugging is
enabled, but this information is not very useful by itself. Add

core/uclass: Print name of device in uclass_find_device_by_seq()

uclass_find_device_by_seq() prints seq and req_seq when debugging is
enabled, but this information is not very useful by itself. Add the
name of he driver to this information. This improves debugging as it
shows which devices are being considered.

Signed-off-by: Alexandru Gagniuc <alex.g@adaptrum.com>
Acked-by: Simon Glass <sjg@chromium.org>

show more ...


# 433647a7 05-Apr-2017 Tom Rini <trini@konsulko.com>

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


# 706865af 20-Mar-2017 Stefan Roese <sr@denx.de>

dm: core: Add flags parameter to device_remove()

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 "n

dm: core: Add flags parameter to device_remove()

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 <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>

show more ...


# 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 ...


# 5ebd27d8 12-Oct-2016 Tom Rini <trini@konsulko.com>

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


# 0a5f6f86 06-Oct-2016 Simon Glass <sjg@chromium.org>

dm: core: Add a function to get a uclass name

It is useful in debug() statements to display the name of the uclass for a
device. Add a simple function to provide this.

Signed-off-by: Simon Glass <s

dm: core: Add a function to get a uclass name

It is useful in debug() statements to display the name of the uclass for a
device. Add a simple function to provide this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

show more ...


123