| f7d6fcf7 | 12-Jun-2017 |
Simon Glass <sjg@chromium.org> |
dm: core: Add dev_read_enabled() to check if a device is enabled
This function allows a device's status to be read. This indicates whether the device should be enabled or disabled.
Note: In normal
dm: core: Add dev_read_enabled() to check if a device is enabled
This function allows a device's status to be read. This indicates whether the device should be enabled or disabled.
Note: In normal operation disabled devices will not be present in the driver-model tree.
Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
show more ...
|
| a4481012 | 12-Jun-2017 |
Simon Glass <sjg@chromium.org> |
dm: core: Add dev_read_resource() to read device resources
Add a function which reads resources from a device, such as the device hardware address. This uses the "reg" property in the device.
Unlik
dm: core: Add dev_read_resource() to read device resources
Add a function which reads resources from a device, such as the device hardware address. This uses the "reg" property in the device.
Unlike other functions there is little sense in inlining this when livetree is not being used because it has some logic in it and this would just bloat the code size.
Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1
show more ...
|
| 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 ...
|
| f11c7ab9 | 19-May-2017 |
Simon Glass <sjg@chromium.org> |
dm: core: Add device-based 'read' functions to access DT
It is common to read a device-tree property from the node associated with a device. Add convenience functions to do this so that drivers do n
dm: core: Add device-based 'read' functions to access DT
It is common to read a device-tree property from the node associated with a device. Add convenience functions to do this so that drivers do not need to deal with accessing the ofnode from the device.
These functions all start with 'dev_read_' to provide consistent naming for all functions which read information from a device's device tree node.
These are inlined when using the flat DT to save code size. The live tree implementation is added in a later commit.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 9e512045 | 19-May-2017 |
Simon Glass <sjg@chromium.org> |
dm: core: Add operations on device tree references
Since U-Boot supports both a live tree and a flat tree, we need an easy way to access the tree without worrying about which is currently active. To
dm: core: Add operations on device tree references
Since U-Boot supports both a live tree and a flat tree, we need an easy way to access the tree without worrying about which is currently active. To support this, U-Boot has the concept of an ofnode, which can refer either to a live tree node or a flat tree node.
For the live tree, the reference contains a pointer to the node (struct device_node *) or NULL if the node is invalid. For the flat tree, the reference contains the node offset or -1 if the node is invalid.
Add a basic set of operations using ofnodes. These are implemented by using either libfdt functions (in the case of a flat DT reference) or the live-tree of_...() functions.
Note that it is not possible to have both live and flat references active at the same time. As soon as the live tree is available, everything in U-Boot should switch to using that. This avoids confusion and allows us to assume that the type of a reference is simply based on whether we have a live tree yet, or not.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 644ec0a9 | 19-May-2017 |
Simon Glass <sjg@chromium.org> |
dm: core: Add livetree access functions
Add a basic assortment of functions to access the live device tree. These come from Linux v4.9 and are modified for U-Boot to the minimum extent possible. Whi
dm: core: Add livetree access functions
Add a basic assortment of functions to access the live device tree. These come from Linux v4.9 and are modified for U-Boot to the minimum extent possible. While these functions are now very stable in Linux, it will be possible to merge in fixes if needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|