]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
dm: Allow drivers to be marked 'before relocation'
authorSimon Glass <sjg@chromium.org>
Wed, 23 Jul 2014 12:55:03 +0000 (06:55 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 23 Jul 2014 13:07:24 +0000 (14:07 +0100)
commit00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9
tree53f8d51b84e75120a3b673946e515ffcbe250ceb
parent6133683320ece056e49051e52a180adb21992b40
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>
14 files changed:
common/board_r.c
doc/driver-model/README.txt
drivers/core/device.c
drivers/core/lists.c
drivers/core/root.c
include/dm/device-internal.h
include/dm/device.h
include/dm/lists.h
include/dm/root.h
test/dm/core.c
test/dm/test-driver.c
test/dm/test-fdt.c
test/dm/test-main.c
test/dm/test.dts