| #
ae27120c |
| 06-Aug-2015 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
f5c67ea0 |
| 30-Jul-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add a way to set a device name
Some devices are bound entirely by probing and do not have the benefit of a device tree to give them a name. This is very common with PCI and USB. In most ca
dm: core: Add a way to set a device name
Some devices are bound entirely by probing and do not have the benefit of a device tree to give them a name. This is very common with PCI and USB. In most cases this is fine, but we should add an official way to set a device name. This should be called in the device's bind() method.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
| #
e2282d70 |
| 25-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
devres: make Devres optional with CONFIG_DEVRES
Currently, Devres requires additional 16 byte for each allocation, which is not so insignificant in some cases.
Add CONFIG_DEVRES to make this framew
devres: make Devres optional with CONFIG_DEVRES
Currently, Devres requires additional 16 byte for each allocation, which is not so insignificant in some cases.
Add CONFIG_DEVRES to make this framework optional. If the option is disabled, devres functions fall back to non-managed variants. For example, devres_alloc() to kzalloc(), devm_kmalloc() to kmalloc(), etc.
Because devres_head is also surrounded by an ifdef conditional, there is no memory overhead when CONFIG_DEVRES is disabled.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Suggested-by: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
608f26c5 |
| 25-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
devres: introduce Devres (Managed Device Resource) framework
In U-Boot's driver model, memory is basically allocated and freed in the core framework. So, low level drivers generally only have to sp
devres: introduce Devres (Managed Device Resource) framework
In U-Boot's driver model, memory is basically allocated and freed in the core framework. So, low level drivers generally only have to specify the size of needed memory with .priv_auto_alloc_size, .platdata_auto_alloc_size, etc. Nevertheless, some drivers still need to allocate/free memory on their own in case they cannot statically know the necessary memory size. So, I believe it is reasonable enough to port Devres into U-boot.
Devres, which originates in Linux, manages device resources for each device and automatically releases them on driver detach. With devres, device resources are guaranteed to be freed whether initialization fails half-way or the device gets detached.
The basic idea is totally the same to that of Linux, but I tweaked it a bit so that it fits in U-Boot's driver model.
In U-Boot, drivers are activated in two steps: binding and probing. Binding puts a driver and a device together. It is just data manipulation on the system memory, so nothing has happened on the hardware device at this moment. When the device is really used, it is probed. Probing initializes the real hardware device to make it really ready for use.
So, the resources acquired during the probing process must be freed when the device is removed. Likewise, what has been allocated in binding should be released when the device is unbound. The struct devres has a member "probe" to remember when the resource was allocated.
CONFIG_DEBUG_DEVRES is also supported for easier debugging. If enabled, debug messages are printed each time a resource is allocated/freed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
aed1a4dd |
| 25-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
dm: add DM_FLAG_BOUND flag
Currently, we only have DM_FLAG_ACTIVATED to indicate the device status, but we still cannot know in which stage is in progress, binding or probing.
This commit introduce
dm: add DM_FLAG_BOUND flag
Currently, we only have DM_FLAG_ACTIVATED to indicate the device status, but we still cannot know in which stage is in progress, binding or probing.
This commit introduces a new flag, DM_FLAG_BOUND, which is set when the device is really bound, and cleared when it is unbound.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
f3301771 |
| 08-Jul-2015 |
Simon Glass <sjg@chromium.org> |
dm: Support address translation for simple-bus
The 'ranges' property can be used to specify a translation from the system address to the bus address. Add support for this using the dev_get_addr() fu
dm: Support address translation for simple-bus
The 'ranges' property can be used to specify a translation from the system address to the bus address. Add support for this using the dev_get_addr() function, which devices should use to find their address.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
36d7cc17 |
| 06-Jul-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add \n to two dm_warn() messages
These should finish with a newline like the others.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
1f5dd470 |
| 09-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
dm: do not set DM_FLAG_ACTIVATED twice
Currently, DM_FLAG_ACTIVATED is set twice; before calling uclass_pre_probe_device() and again before calling drv->probe().
It looks like Simon's intention is
dm: do not set DM_FLAG_ACTIVATED twice
Currently, DM_FLAG_ACTIVATED is set twice; before calling uclass_pre_probe_device() and again before calling drv->probe().
It looks like Simon's intention is the first one. The DM_FLAG_ACTIVATED was moved twice, by commit 02eeb1bbb174 (dm: core: Mark device as active before calling its probe() method), and then by commit 206d4d2b4b30 (dm: core: Mark device as active before calling uclass probe() methods). The first marking was added by the last move.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
132f9bfc |
| 23-Jun-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Correct device_get_child_by_of_offset() parameter
This parameter is named 'seq' but should be named 'of_offset'.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
2693047a |
| 23-Jun-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add a function to find any device from device tree
In some rare cases it is useful to be able to locate a device given a device tree node offset. An example is when you have an alias that
dm: core: Add a function to find any device from device tree
In some rare cases it is useful to be able to locate a device given a device tree node offset. An example is when you have an alias that points to a node and you want to find the associated device. The device may be SPI, MMC or something else, but you don't need to know the uclass to find it.
Add a function to do a global search for a device, given its device tree offset.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
b939689c |
| 05-May-2015 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
|
| #
4842c589 |
| 28-Apr-2015 |
Tom Rini <trini@konsulko.com> |
Merge branch 'master' of git://www.denx.de/git/u-boot-dm
|
| #
f0f932d6 |
| 24-Apr-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
dm: core: drop device removal error path correctly
Trivial bug fix for commit 5a87c4174d18 (dm: core: Drop device removal error path when not supported).
Signed-off-by: Masahiro Yamada <yamada.masa
dm: core: drop device removal error path correctly
Trivial bug fix for commit 5a87c4174d18 (dm: core: Drop device removal error path when not supported).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
5f757cdc |
| 23-Apr-2015 |
Tom Rini <trini@konsulko.com> |
Merge branch 'master' of git://git.denx.de/u-boot-dm
|
| #
5a87c417 |
| 28-Feb-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Drop device removal error path when not supported
When CONFIG_DM_DEVICE_REMOVE is not enabled, such as in SPL, we cannot remove or unbind devices and do not expect to get errors when bindi
dm: core: Drop device removal error path when not supported
When CONFIG_DM_DEVICE_REMOVE is not enabled, such as in SPL, we cannot remove or unbind devices and do not expect to get errors when binding and probing devices. So drop the error path to reduce code size.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
36fa61dc |
| 28-Feb-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Allow sequence alias support to be removed for SPL
In many cases SPL only uses a single serial port and there is no need for alias sequence support. We will just use the serial port pointe
dm: core: Allow sequence alias support to be removed for SPL
In many cases SPL only uses a single serial port and there is no need for alias sequence support. We will just use the serial port pointed to by stdout-path in the /chosen node.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
f9c370dc |
| 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: device: add function: dev_get_uclass_name()
This commit extends the driver model device's API by function: - dev_get_uclass_name()
And this function returns the device's uclass driver nam
dm: core: device: add function: dev_get_uclass_name()
This commit extends the driver model device's API by function: - dev_get_uclass_name()
And this function returns the device's uclass driver name if: - given dev pointer, is non_NULL otherwise, the NULL pointer is returned.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
cc73d37b |
| 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: device: add function: dev_get_driver_ops()
This commit extends the driver model device's API by function: - dev_get_driver_ops()
And this function returns the device's driver's operations
dm: core: device: add function: dev_get_driver_ops()
This commit extends the driver model device's API by function: - dev_get_driver_ops()
And this function returns the device's driver's operations if given: - dev pointer, is non-NULL - dev->driver->ops pointer, is non-NULL in other case the, the NULL pointer is returned.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
5eaed880 |
| 15-Apr-2015 |
Przemyslaw Marczak <p.marczak@samsung.com> |
dm: core: Extend struct udevice by '.uclass_platdata' field.
This commit adds 'uclass_platdata' field to 'struct udevice', which can be automatically allocated at bind. The allocation size is define
dm: core: Extend struct udevice by '.uclass_platdata' field.
This commit adds 'uclass_platdata' field to 'struct udevice', which can be automatically allocated at bind. The allocation size is defined in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'.
New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used for memory freeing at device unbind method.
As for other udevice's fields, a complementary function is added: - dev_get_uclass_platdata()
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
c5785673 |
| 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add device children and sibling functions
Add some utility functions to check for children and for the last sibling in a device's parent.
Signed-off-by: Simon Glass <sjg@chromium.org> Rev
dm: core: Add device children and sibling functions
Add some utility functions to check for children and for the last sibling in a device's parent.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
206d4d2b |
| 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Mark device as active before calling uclass probe() methods
The uclass pre-probe functions may end up calling back into the device in some circumstances. This can fail if recursion takes p
dm: core: Mark device as active before calling uclass probe() methods
The uclass pre-probe functions may end up calling back into the device in some circumstances. This can fail if recursion takes place. Adjust the ordering so that we mark the device as active early, then retract this later if needed.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
39de8433 |
| 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Rename driver data function to dev_get_driver_data()
The existing get_get_of_data() function provides access to both the driver's compatible string and its driver data. However only the la
dm: core: Rename driver data function to dev_get_driver_data()
The existing get_get_of_data() function provides access to both the driver's compatible string and its driver data. However only the latter is actually useful. Update the interface to reflect this and fix up existing users.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
3479253d |
| 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Convert driver_bind() to use const
The driver is not modified by driver model, so update driver_bind() to recognise that.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek
dm: core: Convert driver_bind() to use const
The driver is not modified by driver model, so update driver_bind() to recognise that.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
2c03c463 |
| 25-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Support allocating driver-private data for DMA
Some driver want to put DMA buffers in their private data. Add a flag to tell driver model to align driver-private data to a cache boundary s
dm: core: Support allocating driver-private data for DMA
Some driver want to put DMA buffers in their private data. Add a flag to tell driver model to align driver-private data to a cache boundary so that DMA will work correctly in this case.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
02c07b37 |
| 05-Mar-2015 |
Simon Glass <sjg@chromium.org> |
dm: core: Add a uclass pre_probe() method for devices
Some uclasses want to set up a device before it is probed. Add a method for this.
An example is with PCI, where a PCI uclass wants to set up it
dm: core: Add a uclass pre_probe() method for devices
Some uclasses want to set up a device before it is probed. Add a method for this.
An example is with PCI, where a PCI uclass wants to set up its private data for later use. This allows the device's uclass() method to make calls whcih use that data (for example, read PCI memory regions from device tree, set up bus numbers).
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|