summaryrefslogtreecommitdiffstats
path: root/doc/driver-model
Commit message (Collapse)AuthorAgeFilesLines
* dm: Add child_pre_probe() and child_post_remove() methodsSimon Glass2014-07-231-1/+67
| | | | | | | | | | | 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>
* dm: Introduce per-child data for devicesSimon Glass2014-07-231-8/+17
| | | | | | | | | | | | | 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>
* dm: Add functions to access a device's childrenSimon Glass2014-07-231-1/+2
| | | | | | | | | | | | | | | | | 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>
* dm: Provide a function to scan child FDT nodesSimon Glass2014-07-231-1/+5
| | | | | | | | | | | | | | At present only root nodes in the device tree are scanned for devices. But some devices can have children. For example a SPI bus may have several children for each of its chip selects. Add a function which scans subnodes and binds devices for each one. This can be used for the root node scan also, so change it. A device can call this function in its bind() or probe() methods to bind its children. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Avoid accessing uclasses before they are readySimon Glass2014-07-231-1/+2
| | | | | | Don't allow access to uclasses before they have been initialised. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Allow a device to be found by its FDT offsetSimon Glass2014-07-231-1/+2
| | | | | | | | Each device that was bound from a device tree has an node that caused it to be bound. Add functions that find and return a device based on a device tree offset. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Introduce device sequence numberingSimon Glass2014-07-231-6/+95
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dm: Allow drivers to be marked 'before relocation'Simon Glass2014-07-231-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* dm: Expand and improve the device lifecycle docsSimon Glass2014-06-201-7/+213
| | | | | | | | | The lifecycle of a device is an important part of driver model. Add to the existing documentation and clarify it. Reported-by: Jon Loeliger <jdl@jdl.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename struct device_id to udevice_idSimon Glass2014-06-201-1/+1
| | | | | | | 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>
* docs: driver-model: Fix spellingChris Packham2014-06-111-5/+5
| | | | Signed-off-by: Chris Packham <judge.packham@gmail.com>
* dm: rename device struct to udeviceHeiko Schocher2014-05-271-4/+4
| | | | | | | | | | | | 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>
* dm: Remove old driver model documentationSimon Glass2014-03-0421-3662/+0
| | | | | | | | | | | This documentation pertains to the planned implementation of driver model in U-Boot for each subsystem, but it has not been superseded. It is probably better to have this documentation in the source code for each subsystem where possible, so that docbook will pick it up. Where this does not make sense, new documentation can be placed in some suitable file in doc/driver-model. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add README for driver modelSimon Glass2014-03-041-0/+368
| | | | | | This adds a README to help with understanding of this series. Signed-off-by: Simon Glass <sjg@chromium.org>
* ARM: serial: Remove the IXP UART driverMarek Vasut2014-02-061-4/+0
| | | | | | | | | This driver is no longer used, remove it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Michael Schwingen <michael@schwingen.org> Cc: Tom Rini <trini@ti.com>
* ARM: PCI: Remove the IXP PCI driverMarek Vasut2014-02-061-4/+0
| | | | | | | | | The driver is no longer used, remove it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Michael Schwingen <michael@schwingen.org> Cc: Tom Rini <trini@ti.com>
* cosmetic: UDM-net: clean up the remainders of dead driverMasahiro Yamada2013-11-081-6/+0
| | | | | | | This commit omits non-existing drivers/net/netarm_eth.c from the list. This driver is deleted by commit b411eb30f. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* cosmetic: UDM-serial: clean up the remainders of dead driverMasahiro Yamada2013-11-081-16/+0
| | | | | | | | | | | | | The following serial drivers do not exist any more. - ns9750_serial.c: deleted by commit 4cfc611b4 - s3c4510b_uart.c: deleted by commit afad40299 - serial_clps7111.c: deleted by commit f2e080156 - serial_netarm.c: deleted by commit b411eb30f This commit cleans up UDM-serial.txt. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* cosmetic: doc: driver-model: Do not number driver listsMasahiro Yamada2013-11-0816-594/+594
| | | | | | | | | | | | | Everytime a dead driver is removed from the list, we must re-number. This is a painful task. Try git show e53232250 -- doc/driver-model/UDM-serial.txt git show 6f62f4207 -- doc/driver-model/UDM-serial.txt git show b9f4bc34a -- doc/driver-model/UDM-serial.txt to see what I mean. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Coding Style cleanup: drop some excessive empty linesWolfgang Denk2013-10-141-1/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Coding Style cleanup: replace leading SPACEs by TABsWolfgang Denk2013-10-1411-71/+71
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Drop changes for PEP 4 following python tools] Signed-off-by: Tom Rini <trini@ti.com>
* drivers: s3c44b0_rtc: delete an unused driverMasahiro Yamada2013-09-191-10/+5
| | | | | | | | | Since commit 5dc5f36 removed B2 board support, there are no boards enabling s3c44b0_rtc. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Andrea Scian <andrea.scian@dave-tech.it>
* drivers: serial_s3c44b0: delete an unused driverMasahiro Yamada2013-09-191-10/+6
| | | | | | | | | Since commit 5dc5f36 removed B2 board support, there are no boards enabling serial_s3c44b0. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Andrea Scian <andrea.scian@dave-tech.it>
* block: constify sect_buf argument of ide_write_dataGabor Juhos2013-07-241-1/+1
| | | | | | | | | | | | | | | | | Add a const keyword to the sect_buf argument of ide_write_data to fix the following warning: cmd_ide.c: In function '__ide_output_data': cmd_ide.c:548: warning: passing argument 2 of 'ide_write_data' discards qualifiers from pointer target type /devel/u-boot.git/include/ide.h:76: note: expected 'ulong *' but argument is of type 'const ulong *' Also modify the driver-model documentation to match with the new prototype. Compile tested only. Cc: Macpaul Lin <macpaul@andestech.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
* Power: remove support for Freescale MPC8220Wolfgang Denk2013-05-151-5/+1
| | | | | | | | | | The Freescale MPC8220 Power Architecture processors have long reached EOL; Freescale does not even list these any more on their web site. Remove the code to avoid wasting maitaining efforts on dead stuff. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Andy Fleming <afleming@gmail.com>
* arm: Remove support for unused s3c64xxBenoît Thébaudeau2013-04-121-23/+19
| | | | | | | | Following the removal of the smdk6400 board, the s3c64xx SoC becomes unused, so remove associated code. It will still be possible to restore it later from the Git history if necessary. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-03-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Albert's rework of the linker scripts conflicted with Simon's making everyone use __bss_end. We also had a minor conflict over README.scrapyard being added to in mainline and enhanced in u-boot-arm/master with proper formatting. Conflicts: arch/arm/cpu/ixp/u-boot.lds arch/arm/cpu/u-boot.lds arch/arm/lib/Makefile board/actux1/u-boot.lds board/actux2/u-boot.lds board/actux3/u-boot.lds board/dvlhost/u-boot.lds board/freescale/mx31ads/u-boot.lds doc/README.scrapyard include/configs/tegra-common.h Build tested for all of ARM and run-time tested on am335x_evm. Signed-off-by: Tom Rini <trini@ti.com>
| * ARM: ns9750dev: remove remainders of dead boardWolfgang Denk2013-02-281-1/+1
| | | | | | | | | | | | | | | | Commit 8b710b1 started removing code for the unmaintained "ns9750dev" board; the board support is still broken, and not included anywhere in the Makefile or boards.cfg. Remove the remaining dead code. Signed-off-by: Wolfgang Denk <wd@denx.de>
* | ppc: Remove PCIPPC2 and PCIPPC6 boardsStefan Roese2013-03-112-9/+0
|/ | | | | | | | | | These boards seem to be unmaintained for quite some time. So lets remove support for them completely. This also cleans up some common drivers/files. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Guillaume Alexandre <guillaume.alexandre@gespac.ch> Acked-by: Wolfgang Denk <wd@denx.de>
* arm: Remove support for lpc2292Marek Vasut2012-10-261-17/+13
| | | | | | This stuff has been rotting in the tree for a year now. Remove it. Signed-off-by: Marek Vasut <marex@denx.de>
* Remove lh7a40x cpu and serial driverAlbert ARIBAUD2012-10-161-18/+14
| | | | | | | Since commit 957731ed (ARM: remove broken "lpd7a40x" boards), lh7a40x cpu and serial driver have become unused. Remove them. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* dm: Add twserial device documentTomáš Hlaváček2012-09-021-0/+47
| | | | Signed-off-by: Tomas Hlavacek<tmshlvck@gmail.com>
* dm: RTC subsystem analysis added.Tomas Hlavacek2012-09-021-0/+258
| | | | Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* dm: Add pcmcia design documentViktor Krivak2012-09-021-0/+78
| | | | Signed-off-by: Viktor Krivak <viktor.krivak@gmail.com>
* dm: add PCI design documentPavel Herrmann2012-09-021-0/+265
| | | | Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
* dm: Driver model analysis document for Watchdog subsystem has been added.Tomas Hlavacek2012-09-021-0/+334
| | | | Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* dm: Hwmon UDM subsystem analysis added.Tomas Hlavacek2012-09-021-0/+118
| | | | Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* dm: Add POWER API transition documentViktor Krivak2012-09-021-0/+88
| | | | Signed-off-by: Viktor Krivak <viktor.krivak@gmail.com>
* dm: Add block device documentPavel Herrmann2012-09-021-0/+279
| | | | Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
* dm: Add SPI API transition documentViktor Krivak2012-09-021-0/+200
| | | | Signed-off-by: Viktor Krivak <viktor.krivak@gmail.com>
* dm: Add networking subsystem analysisMarek Vasut2012-09-021-0/+434
| | | | Signed-off-by: Marek Vasut <marex@denx.de>
* dm: Add MMC subsystem analysisMarek Vasut2012-09-021-0/+319
| | | | Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
* dm: Add GPIO API transition documentViktor Křivák2012-09-021-0/+106
| | | | Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
* dm: Add Driver cores design documentPavel Herrmann2012-09-021-0/+126
| | | | Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
* dm: Initial import of design documentsMarek Vasut2012-09-028-0/+1075
This patch contains UDM-design.txt, which is document containing general description of the driver model. The remaining files contains descriptions of conversion process of particular subsystems. Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
OpenPOWER on IntegriCloud