summaryrefslogtreecommitdiffstats
path: root/drivers/core/lists.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-23 06:55:03 -0600
committerSimon Glass <sjg@chromium.org>2014-07-23 14:07:24 +0100
commit00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9 (patch)
tree53f8d51b84e75120a3b673946e515ffcbe250ceb /drivers/core/lists.c
parent6133683320ece056e49051e52a180adb21992b40 (diff)
downloadtalos-obmc-uboot-00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9.tar.gz
talos-obmc-uboot-00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9.zip
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>
Diffstat (limited to 'drivers/core/lists.c')
-rw-r--r--drivers/core/lists.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 87164a5cf9..5f1c85fd6e 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -62,7 +62,7 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id)
return NULL;
}
-int lists_bind_drivers(struct udevice *parent)
+int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only)
{
struct driver_info *info =
ll_entry_start(struct driver_info, driver_info);
@@ -73,8 +73,8 @@ int lists_bind_drivers(struct udevice *parent)
int ret;
for (entry = info; entry != info + n_ents; entry++) {
- ret = device_bind_by_name(parent, entry, &dev);
- if (ret) {
+ ret = device_bind_by_name(parent, pre_reloc_only, entry, &dev);
+ if (ret && ret != -EPERM) {
dm_warn("No match for driver '%s'\n", entry->name);
if (!result || ret != -ENOENT)
result = ret;
OpenPOWER on IntegriCloud