| #
1739564e |
| 24-Nov-2014 |
Tom Rini <trini@ti.com> |
Merge git://git.denx.de/u-boot-dm
Conflicts: drivers/serial/serial-uclass.c
Signed-off-by: Tom Rini <trini@ti.com>
|
| #
479728cb |
| 11-Nov-2014 |
Simon Glass <sjg@chromium.org> |
dm: core: Add functions to find parent and OF data
Add dev_get_parent() as a convenience to obtain the parent of a device.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini
dm: core: Add functions to find parent and OF data
Add dev_get_parent() as a convenience to obtain the parent of a device.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com> Acked-by: Heiko Schocher <hs@denx.de>
show more ...
|
| #
2ef249b4 |
| 11-Nov-2014 |
Simon Glass <sjg@chromium.org> |
dm: core: Allow access to the device's driver_id data
When the device is created from a device tree node, it matches a compatible string. Allow access to that string and the associated data.
Signed
dm: core: Allow access to the device's driver_id data
When the device is created from a device tree node, it matches a compatible string. Allow access to that string and the associated data.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com> Acked-by: Heiko Schocher <hs@denx.de>
show more ...
|
| #
68e80fdd |
| 22-Oct-2014 |
Tom Rini <trini@ti.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
547cea19 |
| 14-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: core: Add a clarifying comment on struct udevice's seq member
The sequence number is unique within the uclass, so state this clearly.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jag
dm: core: Add a clarifying comment on struct udevice's seq member
The sequence number is unique within the uclass, so state this clearly.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
show more ...
|
| #
accd4b19 |
| 14-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: core: Allow parents to pass data to children during probe
Buses sometimes want to pass data to their children when they are probed. For example, a SPI bus may want to tell the slave device about
dm: core: Allow parents to pass data to children during probe
Buses sometimes want to pass data to their children when they are probed. For example, a SPI bus may want to tell the slave device about the chip select it is connected to.
Add a new function to permit the parent data to be supplied to the child.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
show more ...
|
| #
a8981d4f |
| 14-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: core: Add functions for iterating through device children
Buses need to iterate through their children in some situations. Add a few functions to make this easy.
Signed-off-by: Simon Glass <sjg
dm: core: Add functions for iterating through device children
Buses need to iterate through their children in some situations. Add a few functions to make this easy.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
show more ...
|
| #
f887cb6d |
| 07-Oct-2014 |
Masahiro Yamada <yamada.m@jp.panasonic.com> |
dm: add of_match_ptr() macro
The driver model supports two ways for passing device parameters; Device Tree and platform_data (board file). Each driver should generally support both of them because s
dm: add of_match_ptr() macro
The driver model supports two ways for passing device parameters; Device Tree and platform_data (board file). Each driver should generally support both of them because some popular IPs are used on various platforms.
Assume the following scenario: - The driver Foo is used on SoC Bar and SoC Baz - The SoC Bar uses Device Tree control (CONFIG_OF_CONTROL=y) - The SoC Baz does not support Device Tree; uses a board file
In this situation, the device driver Foo should work with/without the device tree control. The driver should have .of_match and .ofdata_to_platdata members for SoC Bar, while they are meaningless for SoC Baz; therefore those device-tree control code should go inside #ifdef CONFIG_OF_CONTROL.
The driver code will be like this:
#ifdef CONFIG_OF_CONTROL static const struct udevice_id foo_of_match = { { .compatible = "foo_driver" }, {}, }
static int foo_ofdata_to_platdata(struct udevice *dev) { ... } #endif
U_BOOT_DRIVER(foo_driver) = { ... .of_match = of_match_ptr(foo_of_match), .ofdata_to_platdata = of_match_ptr(foo_ofdata_to_platdata), ... }
This idea has been borrowed from Linux. (In Linux, this macro is defined in include/linux/of.h)
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
c23154aa |
| 08-Aug-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot-arm
|
| #
a327dee0 |
| 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Add child_pre_probe() and child_post_remove() methods
Some devices (particularly bus devices) must track their children, knowing when a new child is added so that it can be set up for communicat
dm: Add child_pre_probe() and child_post_remove() methods
Some devices (particularly bus devices) must track their children, knowing when a new child is added so that it can be set up for communication on the bus.
Add a child_pre_probe() method to provide this feature, and a corresponding child_post_remove() method.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
e59f458d |
| 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Introduce per-child data for devices
Some device types can have child devices and want to store information about them. For example a USB flash stick attached to a USB host controller would like
dm: Introduce per-child data for devices
Some device types can have child devices and want to store information about them. For example a USB flash stick attached to a USB host controller would likely use this space. The controller can hold information about the USB state of each of its children.
The data is stored attached to the child device in the 'parent_priv' member. It can be auto-allocated by dm when the child is probed. To do this, add a per_child_auto_alloc_size value to the parent driver.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
997c87bb |
| 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Add functions to access a device's children
Devices can have childen that can be addressed by a simple index, the sequence number or a device tree offset. Add functions to access a child in each
dm: Add functions to access a device's children
Devices can have childen that can be addressed by a simple index, the sequence number or a device tree offset. Add functions to access a child in each of these ways.
The index is typically used as a fallback when the sequence number is not available. For example we may use a serial UART with sequence number 0 as the console, but if no UART has sequence number 0, then we can fall back to just using the first UART (index 0).
The device tree offset function is useful for buses, where they want to locate one of their children. The device tree can be scanned to find the offset of each child, and that offset can then find the device.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
0040b944 |
| 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Tidy up some header file comments
Fix up the style of a few comments and add/clarify a few others.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
5a66a8ff |
| 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Introduce device sequence numbering
In U-Boot it is pretty common to number devices from 0 and access them on the command line using this numbering. While it may come to pass that we will move a
dm: Introduce device sequence numbering
In U-Boot it is pretty common to number devices from 0 and access them on the command line using this numbering. While it may come to pass that we will move away from this numbering, the possibility seems remote at present.
Given that devices within a uclass will have an implied numbering, it makes sense to build this into driver model as a core feature. The cost is fairly small in terms of code and data space.
With each uclass having numbered devices we can ask for SPI port 0 or serial port 1 and receive a single device.
Devices typically request a sequence number using aliases in the device tree. These are resolved when the device is probed, to deal with conflicts. Sequence numbers need not be sequential and holes are permitted.
At present there is no support for sequence numbers using static platform data. It could easily be added to 'struct driver_info' if needed, but it seems better to add features as we find a use for them, and the use of -1 to mean 'no sequence' makes the default value somewhat painful.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
00606d7e |
| 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Allow drivers to be marked 'before relocation'
Driver model currently only operates after relocation is complete. In this state U-Boot typically has a small amount of memory available. In adding
dm: Allow drivers to be marked 'before relocation'
Driver model currently only operates after relocation is complete. In this state U-Boot typically has a small amount of memory available. In adding support for driver model prior to relocation we must try to use as little memory as possible.
In addition, on some machines the memory has not be inited and/or the CPU is not running at full speed or the data cache is off. These can reduce execution performance, so the less initialisation that is done before relocation the better.
An immediately-obvious improvement is to only initialise drivers which are actually going to be used before relocation. On many boards the only such driver is a serial UART, so this provides a very large potential benefit.
Allow drivers to mark themselves as 'pre-reloc' which means that they will be initialised prior to relocation. This can be done either with a driver flag or with a 'dm,pre-reloc' device tree property.
To support this, the various dm scanning function now take a 'pre_reloc_only' parameter which indicates that only drivers marked pre-reloc should be bound.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
dab5e346 |
| 16-Jul-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
Conflicts: boards.cfg
|
| #
ed1d98d8 |
| 25-Jun-2014 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
|
| #
39b6d07f |
| 21-Jun-2014 |
Tom Rini <trini@ti.com> |
Merge branch 'master' of git://git.denx.de/u-boot-dm
|
| #
f2bc6fc3 |
| 12-Jun-2014 |
Simon Glass <sjg@chromium.org> |
dm: Tidy up four minor code nits
There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_g
dm: Tidy up four minor code nits
There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation.
Fix these problems.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
show more ...
|
| #
ae7f4513 |
| 12-Jun-2014 |
Simon Glass <sjg@chromium.org> |
dm: Rename struct device_id to udevice_id
It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
54c5d08a |
| 22-May-2014 |
Heiko Schocher <hs@denx.de> |
dm: rename device struct to udevice
using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we u
dm: rename device struct to udevice
using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device"
Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
show more ...
|
| #
1cad23c5 |
| 04-Apr-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot-arm into master
Conflicts: arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
Signed-off-by: Stefano Babic
Merge branch 'master' of git://git.denx.de/u-boot-arm into master
Conflicts: arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
Signed-off-by: Stefano Babic <sbabic@denx.de>
show more ...
|
| #
6494d708 |
| 26-Feb-2014 |
Simon Glass <sjg@chromium.org> |
dm: Add base driver model support
Add driver model functionality for generic board.
This includes data structures and base code for registering devices and uclasses (groups of devices with the same
dm: Add base driver model support
Add driver model functionality for generic board.
This includes data structures and base code for registering devices and uclasses (groups of devices with the same purpose, e.g. all I2C ports will be in the same uclass).
The feature is enabled with CONFIG_DM.
Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
show more ...
|