| 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 ...
|
| 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 ...
|
| 4e8bc211 | 23-Jul-2014 |
Simon Glass <sjg@chromium.org> |
dm: Avoid activating devices in 'dm uclass' command
This command currently activates devices as it lists them. This is not desirable since it changes the system state. Fix it and avoid printing a ne
dm: Avoid activating devices in 'dm uclass' command
This command currently activates devices as it lists them. This is not desirable since it changes the system state. Fix it and avoid printing a newline if there are no devices in a uclass.
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 ...
|
| 4d907025 | 12-Jun-2014 |
Stephen Warren <swarren@nvidia.com> |
sandbox: restore ability to access host fs through standard commands
Commit 95fac6ab4589 "sandbox: Use os functions to read host device tree" removed the ability for get_device_and_partition() to ha
sandbox: restore ability to access host fs through standard commands
Commit 95fac6ab4589 "sandbox: Use os functions to read host device tree" removed the ability for get_device_and_partition() to handle the "host" device type, and redirect accesses to it to the host filesystem. This broke some unit tests that use this feature. So, revert that change. The code added back by this patch is slightly different to pacify checkpatch.
However, we're then left with "host" being both: - A pseudo device that accesses the hosts real filesystem. - An emulated block device, which accesses "sectors" inside a file stored on the host.
In order to resolve this discrepancy, rename the pseudo device from host to hostfs, and adjust the unit-tests for this change.
The "help sb" output is modified to reflect this rename, and state where the host and hostfs devices should be used.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Tested-by: Josh Wu <josh.wu@atmel.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
show more ...
|