11 Feb, 2020
1 commit
-
sandbox conversion to SDL2
TPM TEE driver
Various minor sandbox video enhancements
New driver model core utility functions
07 Feb, 2020
1 commit
-
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.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
06 Feb, 2020
1 commit
-
These conditions are not needed and just reduce build coverage. Drop them.
Signed-off-by: Simon Glass
28 Oct, 2019
1 commit
-
Use log() insted of debug() for uclass_find_device_by_seq function,
since this print is very much and we can filter it out with log()
interface.Signed-off-by: Kever Yang
Reviewed-by: Simon Glass
Move #define to top of file as per docs:
Signed-off-by: Simon Glass
15 Oct, 2019
1 commit
-
For CONFIG_OF_PRIOR_STAGE, in the absence of a device tree alias for a
given device, use the next request number for that type of device.
This allows aliases to be used when they're available, while still
allowing unaliased devices to be probed.Signed-off-by: Thomas Fitzsimmons
Cc: Bin Meng
Cc: Simon Glass
08 Oct, 2019
2 commits
-
This function returns -ENODEV when there is no device. This is
inconsistent with other functions, such as uclass_find_next_device(),
which returns 0.Update it and tidy up the incorrect '-1' values in the comments.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Bin Meng -
Two functions in this file return early for no good reason. Adjust the
code to match the standard DM style of returning 0 at the end of the
function on success.Oddly enough this save 12 bytes of code size on ARM.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
13 Jul, 2019
1 commit
-
`if (!strncmp(dev->name, name, strlen(name)))` might find out
the wrong device, it might find out `dram_pll_ref_sel`, when name is
`dram_pll`. So use strcmp to avoid such issue.Signed-off-by: Peng Fan
Reviewed-by: Simon Glass
Reviewed-by: Bin Meng
05 Jul, 2019
1 commit
-
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.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Simon Glass
09 Feb, 2019
1 commit
-
While uclass_find_device() fails with -ENODEV in case of list_empty
strangely uclass_find_first_device() returns 0.Fix uclass_find_first_device() to also fail with -ENODEV instead.
Signed-off-by: Marcel Ziswiler
Reviewed-by: Simon Glass
10 Dec, 2018
1 commit
-
If OF_CONTROL is not enabled and DM_SEQ_ALIAS is enabled, we must
assign an alias (requested sequence number) to devices that belongs to a
class with the DM_UC_FLAG_SEQ_ALIAS flag. Otherwise
uclass_find_device_by_seq() cannot be used to get/probe a device. In
particular i2c_get_chip_for_busnum() cannot be used.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Simon Glass
Reviewed-by: Heiko Schocher
30 Nov, 2018
1 commit
-
This function may be useful to code outside of the code driver-model
implementation. Export it and add a test.Signed-off-by: Simon Glass
17 Nov, 2018
1 commit
-
Similarly to uclass_first_device_err(), add uclass_next_device_err()
which returns an error if there are no next devices in that uclass.Signed-off-by: Patrice Chotard
Reviewed-by: Simon Glass
15 Nov, 2018
2 commits
-
Use the uclass_foreach_dev() macro instead of the open coded version.
Signed-off-by: Liviu Dudau
Reviewed-by: Simon Glass -
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
21 Aug, 2018
1 commit
-
This function is the reciprocal of uclass_find_device().
It will be used to print the index information in dm tree dump.Signed-off-by: Jean-Jacques Hiblot
09 Jul, 2018
1 commit
-
Add additional logging so that common errors when finding a device by
ofnode are easier to debug.Signed-off-by: Simon Glass
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
31 Mar, 2018
1 commit
-
Add api for who can not get phandle from a device property.
Signed-off-by: Kever Yang
Reviewed-by: Philipp Tomsich
04 Feb, 2018
1 commit
-
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.
Signed-off-by: Simon Glass
12 Jul, 2017
2 commits
-
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
-
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
01 Jun, 2017
2 commits
-
Adjust this function to work with livetree.
Signed-off-by: Simon Glass
-
Add a function which looks up a device by its node (either in live tree
or flat tree).Signed-off-by: Simon Glass
14 Apr, 2017
1 commit
-
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
Acked-by: Simon Glass
05 Apr, 2017
1 commit
-
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
08 Feb, 2017
1 commit
-
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
11 Oct, 2016
1 commit
-
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
Reviewed-by: Bin Meng
26 Jul, 2016
1 commit
-
Some SoCs have a single clock device. Provide a way to find it given its
driver name. This is handled by the linker so will fail if the name is not
found, avoiding strange errors when names change and do not match. It is
also faster than a string comparison.Signed-off-by: Simon Glass
15 Mar, 2016
1 commit
-
A common pattern is to call uclass_first_device() and then check if it
actually returns a device. Add a new function which does this, returning
an error if there are no devices in that uclass.Signed-off-by: Simon Glass
22 Jan, 2016
1 commit
-
It is sometimes useful to be able to find a device before probing it,
perhaps to set up some platform data for it. Allow finding by of_offset
also.Signed-off-by: Simon Glass
21 Jan, 2016
2 commits
-
At present the uclass's post_bind() method is called before the driver's
bind() method. This means that the uclass cannot use any of the information
set up by the driver. Move it later in the sequence to permit this.This is an ordering change which is always fairly major in nature. The main
impact is that devices which have children will not see them appear in their
bind() method. From what I can see, existing drivers do not look at their
children in the bind() method, so this should be safe.Conceptually this change seems to result in a 'more correct' ordering, since
the uclass (which is broader than the device) gets the last word.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
This function cannot be used unless support is enabled for device tree
control. Adjust the code to reflect that.Signed-off-by: Simon Glass
30 Oct, 2015
1 commit
-
dev->uclass->uc_drv->per_device_auto_alloc_size is to be freed in
device_free(), so is dev->seq. Remove these unnecessary codes.Signed-off-by: Bin Meng
Acked-by: Simon Glass
03 Sep, 2015
1 commit
-
When a uclass definition is missing, no drivers in that uclass can operate.
This can happen if a board has a strange collection of options (e.g. the
driver is enabled but the uclass is not).Unfortunately this is very confusing at present. Starting up driver model
results in a -ENOENT error, which is pretty generic. Quite a big of digging
is needed to get to the root cause.To help with this, change the error to a very strange one with no other
users in U-Boot. Also add a debug message.Signed-off-by: Simon Glass
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
06 Aug, 2015
1 commit
-
It is common for one node to reference another via a phandle. Add support
for obtaining an attached device by this method. As an example, a node may
have a 'power-supply' property which references a regulator, allowing the
driver to turn on its power.Signed-off-by: Simon Glass
05 Aug, 2015
1 commit
-
This function needs to check the list has entries before traversing it.
Fix this bug.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
22 Jul, 2015
1 commit
-
The command "dm uclass" tries to display all the UClasses, but
some of them might be disabled by Kconfig.The function do_dm_dump_uclass() iterates over all the UClass IDs
and calls uclass_get() for each of them. Then, it displays annoying
message "Cannot find uclass for id ..." every time it fails to get
the UClass.As a result, we get much noisier log for the "dm uclass" command.
=> dm uclass
uclass 0: root
- * root_driver @ bfb54028, seq 0, (req -1)Cannot find uclass for id 1: please add the UCLASS_DRIVER() ...
Cannot find uclass for id 2: please add the UCLASS_DRIVER() ...
Cannot find uclass for id 3: please add the UCLASS_DRIVER() ...
Cannot find uclass for id 4: please add the UCLASS_DRIVER() ...
Cannot find uclass for id 5: please add the UCLASS_DRIVER() ...
Cannot find uclass for id 6: please add the UCLASS_DRIVER() ...This commit suppresses these warnings.
Signed-off-by: Masahiro Yamada
Acked-by: Simon Glass
29 Apr, 2015
1 commit
-
These functions now rely on uclass_find_first/next_device() and assume that
they will either return failure (-ve error code) or a device. In fact,
coming to the end of a list is not considered failure and they return 0
in that case.The logic to deal with this was replaced in commit acb9ca2a with just using
uclass_get_device_tail(). Add back the missing logic. This bug was
caught by unit tests but since they were broken for other reasons at the
time, this was not noticed.Signed-off-by: Simon Glass