27 Apr, 2020
3 commits
-
Since the orginal way to call interrupts handle function of DM usb
gadget driver is through dm_usb_gadget_handle_interrupts(), when we want
to use two or more different gadget drivers at the same time, it will
cause error of duplicate names.So here add a handle_interrupts function pointer instead of driectly
call dm_usb_gadget_handle_interrupts(), then the error can be avoided.Signed-off-by: Sherry Sun
(cherry picked from commit 2458ddd952a6a2d2304dfe7ea34e4192cd1d5ed4) -
For dual ethernet controllers, the HW design may connect ETH phys to
one MDIO ports. So two different ethernet drivers have to share MDIO bus.
Since two ethernet drivers are independent, we can't ensure their probe order.To resolve this problem, introduce an eth phy generic driver and uclass.
After eth-uclass binds, we search the mdio node and binds the phy node with
the eth-phy-generic driver.When one eth driver get its phy device, the parent of phy device will probe prior than
phy device. So this ensure the eth driver ownes the MDIO bus will be probed
before using its MDIO.Signed-off-by: Ye Li
-
Add a new driver FLAG (DM_FLAG_IGNORE_DEFAULT_CLKS). If any driver
is set with this flag, then when probing the device, we will skip
setting the default clocks.This is useful when clock driver can't work with some device driver.
Signed-off-by: Ye Li
(cherry picked from commit 5dd4ff270dc387111f5feb85e4020adf2d60a32f)
03 Mar, 2020
1 commit
-
In various cases a power domain must stay enabled after device
removal when booting OS (i.e. serial debug console or display).
Add a flag to selectively skip switching off a power domain.Fixes: 52edfed65de9 ("dm: core: device: switch off power domain after device removal")
Signed-off-by: Anatolij Gustschin
Acked-by: Neil Armstrong
Tested-by: Guillaume La Roque
Reviewed-by: Simon Glass
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
2 commits
-
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 -
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.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
06 Feb, 2020
13 commits
-
Most files don't need this header and it pulls in quite of lots of stuff,
malloc() in particular. Drop it.Signed-off-by: Simon Glass
-
At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.Move the compatibility features into a separate header file.
Signed-off-by: Simon Glass
-
At present devres.h is included in all files that include dm.h but few
make use of it. Also this pulls in linux/compat which adds several more
headers. Drop the automatic inclusion and require files to include devres
themselves. This provides a good indication of which files use devres.Signed-off-by: Simon Glass
Reviewed-by: Anatolij Gustschin -
This adds a subcommand to dm to dump out what drivers are installed, and their
compatible strings. I have found this useful in ensuring that I have the correct
drivers compiled, and that I have put in the correct compatible strings.Signed-off-by Sean Anderson
Reviewed-by: Simon Glass -
It is sometimes useful to process all children, making sure they are
probed first. Add functions to help with this and a macro to make it more
convenient.Signed-off-by: Simon Glass
-
When generating ACPI tables we need to make sure that all devices have
read their platform data, so that they can generate the tables correctly.Rather than adding this code in ACPI, create a core function to handle it.
Signed-off-by: Simon Glass
-
Add a function to read a property from the chosen node, providing access
to its length. Update ofnode_get_chosen_string() to make use of it.Signed-off-by: Simon Glass
-
Add a new function to read a property that supports reading the length as
well.Reimplement ofnode_read_string() using it and fix its comment.
Signed-off-by: Simon Glass
-
This function is actually intended to read a string rather than a
property. All of its current callers use it that way. Also there is no way
to return the length of the property from this function.Rename it to better indicate its purpose, using ofnode_read as the prefix
since this matches most other functions.Also add some tests which are missing for these functions.
Signed-off-by: Simon Glass
-
The current comment is a big vague and misleading. Rewrite it to state
precisely what the function does.Signed-off-by: Simon Glass
-
These functions do not modify the device so should use a const pointer to
it. Update the code accordingly.Signed-off-by: Simon Glass
-
These functions do not modify the device so should use a const pointer to
it. Update the code accordingly.Signed-off-by: Simon Glass
-
Update this header file to use const devices where possible, to permit
callers to also use const.Signed-off-by: Simon Glass
09 Jan, 2020
1 commit
-
dm: Increased separation of ofdata_to_platdata() and probe methods
08 Jan, 2020
7 commits
-
The devres functionality has very few users in U-Boot, but it still should
have tests. Add a few basic tests of the main functions.Signed-off-by: Simon Glass
-
Add a driver which does devres allocations so that we can write tests for
devres.Signed-off-by: Simon Glass
-
At present these functions are lumped in with the core device functions.
They have their own #ifdef to control their availability, so it seems
better to split them out.Move them into their own header file.
Signed-off-by: Simon Glass
-
We want to avoid allocating platform data twice. This could happen if
device_probe() is called after device_ofdata_to_platdata() for the same
device.Add a flag to track whether device_ofdata_to_platdata() has been called on
a device. Check the flag to make sure it doesn't happen twice, and clear
the flag when the data is freed.Signed-off-by: Simon Glass
-
Add a new internal function, device_ofdata_to_platdata() to handle
allocating private space associated with each device and reading the
platform data from the device tree.Call this new function from device_probe().
Signed-off-by: Simon Glass
-
This flag is missing a comment. Add one.
Signed-off-by: Simon Glass
-
Add a uclass for reading a random number seed from a random number
generator device.Signed-off-by: Sughosh Ganu
Reviewed-by: Patrice Chotard
Reviewed-by: Heinrich Schuchardt
Reviewed-by: Simon Glass
15 Dec, 2019
4 commits
-
The Primary-to-Sideband bus (P2SB) is used to access various peripherals
through memory-mapped I/O in a large chunk of PCI space. The space is
segmented into different channels and peripherals are accessed by
device-specific means within those channels. Devices should be added in
the device tree as subnodes of the p2sb.This adds a uclass and enables it for sandbox.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
Intel x86 SoCs have a power manager/controller which handles several
power-related aspects of the platform. Add a uclass for this, with a few
useful operations.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
Early in boot it is necessary to decode the PCI device/function values for
particular peripherals in the device tree or of-platdata. This is needed
in TPL where CONFIG_PCI is not defined.To handle this, move pci_get_devfn() into a file that is built even when
CONFIG_PCI is not defined.Also add a function for use by of-platdata, to convert a reg property to
a pci_dev_t.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
If the offset is -1 this function correctly sets up a null ofnode. But if
the offset is any other negative number (e.g. -FDT_ERR_BADPATH) then it
does the wrong thing.An offset of -1 in ofnode indicates that the ofnode is not valid. Any
other negative value is not handled by ofnode_valid(). We could of course
change that function, but it seems much better to always use the same
value for an invalid node.Fix it by setting the offset to -1 if it is invalid for any reason.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
14 Nov, 2019
1 commit
-
Remove the pinctrl_decode_pin_config() API, because this
function is unused and not compatible with livetree
(it uses fdtdec_get_bool instead of ofnode API).Signed-off-by: Patrick Delaunay
Reviewed-by: Simon Glass
24 Oct, 2019
1 commit
-
Add Support for UFS Host Controller Interface (UFSHCI) for communicating
with Universal Flash Storage (UFS) devices. The steps to initialize the
host controller interface are the following:- Initiate the Host Controller Initialization process by writing to the
Host controller enable register.
- Configure the Host Controller base address registers by allocating a
host memory space and related data structures.
- Unipro link startup procedure
- Check for connected device
- Configure UFS host controller to process requestsAlso register this host controller as a SCSI host controller.
Taken from Linux Kernel v5.2 (drivers/scsi/ufs/ufshcd.c) and ported to
U-boot.Signed-off-by: Faiz Abbas
15 Oct, 2019
3 commits
-
In some remoteproc cases, enabling the power domain of the core will
start running the core. In such cases image should be loaded before
enabling the power domain. But the current DM framework enables the
power-domain by default during probe. This is causing the remotecore
to start and crash as there is no valid image loaded.In order to avoid this introduce a DM flag that doesn't allow for
enabling/disabling the power-domain by DM framework.Signed-off-by: Lokesh Vutla
Reviewed-by: Simon Glass -
When DEVRES is not set, devm_kmalloc_array() is spelled
devm_kmaloc_array() (with one 'l' only).
Fixing it so that the name is the same with and without DEVRES.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Simon Glass -
Default address cells value on the livetree access function
returns the wrong value. Fix this so that the value returned
corresponds to the device tree specification.Signed-off-by: Matthias Brugger
14 Oct, 2019
1 commit
-
Display Serial Interface (DSI) host can usefully be modelled
as their own uclass.
DSI defines a serial bus and a communication protocol
between the host and the device (panel, bridge).Signed-off-by: Yannick Fertré
11 Oct, 2019
1 commit
-
Add a function to count the available children of a device.
Signed-off-by: Lokesh Vutla
08 Oct, 2019
1 commit
-
At present PCI address transaction is not supported so drivers must
manually read the correct BAR after reading the device tree info. The
ns16550 has a suitable implementation, so move this code into the core
DM support.Note that there is no live-tree equivalent at present.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Bin Meng
[bmeng: correct the unclear comments in test.dts]
Signed-off-by: Bin Meng