summaryrefslogtreecommitdiff
path: root/doc/driver-model
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'efi-2021-04-rc2' of ↵WIP/04Feb2021Tom Rini2021-02-041-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2021-04-rc2 Bug fixes: * do not allow creating of files with filenames on FAT file system * install UEFI System Partition GUID on ESP handle * in dtbdump.efi test tool use GUID to find ESP handle Documentation: * man-page for load command * describe end of life of plat_auto
| * doc: dm: describe end of life of plat_autoHeinrich Schuchardt2021-02-041-3/+3
| | | | | | | | | | | | | | | | | | Describe when plat_auto is freed. Fix a typo. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* | dm: core: Add documentation about device removalSimon Glass2021-02-031-0/+20
|/ | | | | | | Make mention of this feature in the core documentation so people can discover it without looking at a header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* MAINTAINERS: Update STi and STM32 maintainers emails in remaining filesPatrice Chotard2021-01-131-1/+1
| | | | | | | | | | A previous series already update STMicroelectronics emails maintainers but some files have been omitted (Makefile, .dts, .dtsi and .rst files). Update Patrick and my email address with the one dedicated to upstream activities. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
* dtoc: Drop dm_populate_phandle_data()Simon Glass2021-01-051-10/+6
| | | | | | | | | | | | | This has not been needed since parent information was added and we started using indicies for references to other drivers instead of pointers. It was kept around in the expectation that it might be needed later. However with the latest updates, it doesn't seem likely that we'll need this in the foreseeable future. Drop dm_populate_phandle_data() from dtoc and driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename U_BOOT_DRIVER_ALIAS to DM_DRIVER_ALIASSimon Glass2021-01-051-3/+3
| | | | | | | | | | | | | We use the U_BOOT_ prefix (i.e. U_BOOT_DRIVER) to declare a driver but in every other case we just use DM_. Update the alias macros to use the DM_ prefix. We could perhaps rename U_BOOT_DRIVER() to DM_DRIVER(), but this macro is widely used and there is at least some benefit to indicating it us a U-Boot driver, particularly for code ported from Linux. So for now, let's keep that name. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename DM_GET_DEVICE() to DM_DRVINFO_GET()Simon Glass2021-01-051-1/+1
| | | | | | | | | | | This does not get a device (struct udevice *) but a struct driver_info * so the name is confusing. Rename it accordingly. Since we plan to have several various of these macros, put GET at the end instead of the middle, so it is easier to spot the related macros. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO()Simon Glass2021-01-054-18/+18
| | | | | | | | | | | | | | | | | | | | The current macro is a misnomer since it does not declare a device directly. Instead, it declares driver_info record which U-Boot uses at runtime to create a device. The distinction seems somewhat minor most of the time, but is becomes quite confusing when we actually want to declare a device, with of-platdata. We are left trying to distinguish between a device which isn't actually device, and a device that is (perhaps an 'instance'?) It seems better to rename this macro to describe what it actually is. The macros is not widely used, since boards should use devicetree to declare devices. Rename it to U_BOOT_DRVINFO(), which indicates clearly that this is declaring a new driver_info record, not a device. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Update documentation for new sequence numbersSimon Glass2020-12-181-24/+35
| | | | | | | Update the driver model documention to describe how sequence numbers now work. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass2020-12-133-17/+17
| | | | | | | Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename ofdata_to_platdata() to of_to_plat()Simon Glass2020-12-136-32/+32
| | | | | | | This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass2020-12-133-6/+6
| | | | | | Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename 'platdata_size' to 'plat_size'Simon Glass2020-12-131-1/+1
| | | | | | Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass2020-12-136-48/+48
| | | | | | | | | | We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass2020-12-135-26/+26
| | | | | | | | | | | | This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: doc: Update the of-platadata documentationSimon Glass2020-10-291-23/+19
| | | | | | | Update this to incorporate the parent feature as well as other recent developments. Signed-off-by: Simon Glass <sjg@chromium.org>
* doc: add bind/unbind command documentationPatrice Chotard2020-08-222-0/+50
| | | | | | | | | | Add documentation in doc/drivel-model for the bind/unbind command. Part of this documentation is extracted from original patch commit message: commit 49c752c93a78 ("cmd: Add bind/unbind commands to bind a device to a driver from the command line") Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: Add new doc for soc ID driver modelDave Gerlach2020-07-252-0/+69
| | | | | | | | | Add a new documentation file for UCLASS_SOC and its usage to describe the SoC Device ID framework that allows SoC identification and device data matching. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini2020-07-242-69/+0
| | | | | | | | | | This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <trini@konsulko.com>
* doc: Add new doc for soc ID driver modelDave Gerlach2020-07-202-0/+69
| | | | | | | | | Add a new documentation file for UCLASS_SOC and its usage to describe the SoC Device ID framework that allows SoC identification and device data matching. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* treewide: convert bd_t to struct bd_info manuallyMasahiro Yamada2020-07-171-1/+1
| | | | | | | | | | | Some code was not converted by coccinelle, somehow. I manually fixed up the remaining, and comments, README docs. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> [trini: Add arch/arm/mach-davinci/include/mach/sdmmc_defs.h and include/fdt_support.h] Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spiWIP/11Jul2020Tom Rini2020-07-111-14/+1
|\ | | | | | | | | | | | | - Enable DM_SPI on siemens omap boards (Jagan) - Dropped some non-dm supported omap3 boards (Jagan) - Dropped non-dm code in omap3 spi driver (Jagan) - Dropped non-dm code in kirkwood spi driver (Bhargav)
| * doc: driver-model: Update SPI migration statusJagan Teki2020-07-101-14/+1
| | | | | | | | | | | | | | | | | | | | All SPI drivers are converted to DM_SPI but 3 drivers still operate in nondm mode for SPL due to footprint constraints. Update the migration status for it. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* | dm: doc: update of-plat with new phandle supportWalter Lozano2020-07-091-8/+16
| | | | | | | | | | | | | | | | | | Update documentation to reflect the new phandle support when OF_PLATDATA is used. Now phandles are implemented as pointers to U_BOOT_DEVICE, which makes it possible to get a pointer to the actual device. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | dm: doc: update of-plat with the support for driver aliasesWalter Lozano2020-07-091-1/+13
|/ | | | | | | | Update the documentation with the support for driver aliases using U_BOOT_DRIVER_ALIAS. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: driver-model: fix typo in design.rstDario Binacchi2020-06-111-1/+1
| | | | | | | Fix the 'memeber' typo in doc/driver-model/design.rst. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: driver-model: there is no UCLASS_SATAHeinrich Schuchardt2020-06-111-1/+1
| | | | | | | %s/UCLASS_SATA/UCLASS_AHCI/g Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: driver-model: Update SPI migration statusJagan Teki2020-06-011-2/+0
| | | | | | | | | | DM_SPI migration status fror v2020.07 removed: lpc32xx_ssp.c sh_spi.c Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* dm: core: Read parent ofdata before childrenSimon Glass2020-04-161-24/+70
| | | | | | | | | | | | | | At present a device can read its ofdata before its parent has done the same. This can cause problems in the case where the parent has a 'ranges' property, thus affecting the operation of dev_read_addr(), for example. We already probe parent devices before children so it does not seem to be a large step to do the same with ofdata. Make the change and update the documentation in this area. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ley Foon Tan <ley.foon.tan@intel.com>
* doc: driver-model: there is no UCLASS_ETHERNETHeinrich Schuchardt2020-04-161-1/+1
| | | | | | | %s/UCLASS_ETHERNET/UCLASS_ETH/g Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* sandbox: Update PCI nodes in dts filesTom Rini2020-04-161-5/+5
| | | | | | | | | | | The way the PCI nodes are written today causes a number of warnings if we stop disabling some of the warnings we pass to DTC. As these warnings aren't disabled in current Linux Kernel builds, we should aim to not disable them here either, so rewrite these slightly. Update the driver model doc as well. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* doc: net: Rewrite network driver documentationAndre Przywara2020-03-092-0/+322
| | | | | | | | | | | | | | | | | | | | | | doc/README.drivers.eth seems like a good source for understanding U-Boot's network subsystem, but is only talking about legacy network drivers. This is particularly sad as proper documentation would help in porting drivers over to the driver model. Rewrite the document to describe network drivers in the new driver model world. Most driver callbacks/methods are almost identical in their semantic, but recv() differs in some important details. Also keep some parts of the original text at the end, to help understanding old drivers. Add some hints on how to port drivers over. This also uses the opportunity to reformat the document in reST, on the way moving it into doc/driver-model and adding it into the structure there. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini2020-02-111-2/+2
|\ | | | | | | | | | | | | sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions
| * doc: dm: debugging: Fix the steps for activating debugFabio Estevam2020-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Following the recommendation of adding '#define DEBUG' at the top of drivers/core/lists.c does not cause the debug messages to be shown. Change it to '#define LOG_DEBUG' instead, which actually makes it work as per doc/README.log. While at it, provide the full path to lists.c to in order to make the instructions clearer. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | dm: fix design.rst documentDario Binacchi2020-02-101-4/+4
|/ | | | | | | The patch fixes some errors. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: doc: Add a note about of-platdata and header filesSimon Glass2019-12-151-0/+6
| | | | | | | | We don't want to include dt-structs.h in header files, so add a note about that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: doc: Correct of-platdata driver nameSimon Glass2019-11-031-1/+1
| | | | | | | | Add a note about the driver name in the of-platdata documentation since the naming must follow the compatible string. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: spi: Change cs_info op to return -EINVAL for invalid cs numBin Meng2019-10-251-2/+2
| | | | | | | | | | | | | | | | We need distinguish the following two situations in various SPI APIs: - given chip select num is invalid - given chip select num is valid, but no device is attached Currently -ENODEV is returned for both cases. For the first case, it's more reasonable to return -EINVAL instead of -ENODEV for invalid chip select numbers. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # SoPine Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* dm: spi: Return 0 if driver does not implement ops->cs_infoBin Meng2019-10-251-2/+2
| | | | | | | | | | If an SPI controller driver does not implement ops->cs_info, that probably means any chip select number could be valid, hence let's return 0 for spi_cs_info(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com> # SoPine Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* doc: add full path to patman READMERalph Siemsen2019-10-151-1/+1
| | | | | | | Make it a little easier to find the documentation. Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* pci: Correct 'specifified' and 'Plese' typosSimon Glass2019-10-081-1/+1
| | | | | | | | | Fix these spelling errors the header file and documentation. Fix a small typo in the PCI documentation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* pci: sandbox: Move the emulators into their own nodeSimon Glass2019-10-081-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sandbox pci works using emulation drivers which are currently children of the pci device: pci-controller { pci@1f,0 { compatible = "pci-generic"; reg = <0xf800 0 0 0 0>; emul@1f,0 { compatible = "sandbox,swap-case"; }; }; }; In this case the emulation device is attached to pci device on address f800 (device 1f, function 0) and provides the swap-case functionality. However this is not ideal, since every device on a PCI bus has a child device. This is only really the case for sandbox, but we want to avoid special-case code for sandbox. Worse, child devices cannot be probed before their parents. This forces us to use 'find' rather than 'get' to obtain the emulator device. In fact the emulator devices are never probed. There is code in sandbox_pci_emul_post_probe() which tries to track when emulators are active, but at present this does not work. A better approach seems to be to add a separate node elsewhere in the device tree, an 'emulation parent'. This could be given a bogus address (such as -1) to hide the emulators away from the 'pci' command, but it seems better to keep it at the root node to avoid such hacks. Then we can use a phandle to point from the device to the correct emulator, and only on sandbox. The code to find an emulator does not interfere with normal pci operation. Add a new UCLASS_PCI_EMUL_PARENT uclass which allows finding an emulator given a bus, and finding a bus given an emulator. Update the existing device trees and the code for finding an emulator. This brings PCI emulators more into line with I2C. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: fix 3 typos in the commit message; encode bus number in the labels of swap_case_emul nodes; mention commit 4345998ae9df in sandbox_pci_get_emul()] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* dm: core: Add documentation on how to debug driver modelSimon Glass2019-10-082-0/+63
| | | | | | | | | | | Sometimes devices don't appear and it can be confusing. Add a few notes to help with this situation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: fix 2 issues in the doc and include the doc in the index.rst] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* dm: MIGRATION: Add migration plan for CONFIG_DMWIP/2019-09-19-master-importsHeinrich Schuchardt2019-09-191-0/+10
| | | | | | | | | | | | For many sub-systems we already require the driver model to be used. Yet there is still a handful of boards that do not have CONFIG_DM enabled. We should make CONFIG_DM compulsory with release v2020.01 Conversion dates for CONFIG_DM_SPL and CONFIG_DM_TPL are yet to be defined. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: fix: Replace SPL_OF_PLATDATA with OF_PLATDATA in examplesLukasz Majewski2019-09-191-4/+4
| | | | | | | | | | | | | The of-plat.rst file till this change has been using This is at best misleading as SPL_OF_PLATDATA is always defined when we want to use this SPL tinification feature (also in U-Boot proper). As a result the OF_PLATDATA SPL specific code is also compiled in when U-Boot proper is build. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* doc: driver-model: Update SPI migration statusJagan Teki2019-09-161-2/+1
| | | | | | | Update SPI drivers, driver model conversion status for v2019.10 release. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
* network: set timeline for CONFIG_DM_ETH conversionHeinrich Schuchardt2019-09-041-0/+8
| | | | | | | | | The driver model has been supported for network drivers since 2015. It is time to convert the remaining boards. Set July 2020 as a timeline. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* doc: driver-model: Convert usb-info.txt to reSTBin Meng2019-07-242-88/+97
| | | | | | | Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* doc: driver-model: Convert spi-howto.txt to reSTBin Meng2019-07-243-623/+693
| | | | | | | Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* doc: driver-model: Convert serial-howto.txt to reSTBin Meng2019-07-242-5/+8
| | | | | | | Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>