summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'dm-pull-21mar21-take3' of git://git.denx.de/u-boot-dm into nextWIP/23Mar2021-nextWIP/22Mar2021-nextTom Rini2021-03-22191-1533/+6510
|\ | | | | | | | | | | | | | | | | | | dtoc support for of-platdata-inst driver model support for of-platdata-inst support of-platdata-inst on x86 / coral binman support for exapanded entries binman convert docs to reST ti-sysc fix for duplicate uclass driver patman minor improvements
| * binman: Update various pieces of the documentationSimon Glass2021-03-222-39/+45
| | | | | | | | | | | | A few sections are a little out of date now. Update them. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Drop repetitive heading for each entrySimon Glass2021-03-2220-57/+57
| | | | | | | | | | | | | | | | Many entries start 'Entry containing a'. This looks fine in the source code but is annoying when viewed in the htmldocs table of contents. Drop these unnecessary words. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Incorporate entry documentationSimon Glass2021-03-2210-77/+87
| | | | | | | | | | | | | | Update this to avoid sphinx warnings and incorporate it into the new documentaiton tree. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Rearrange documentation into headingsSimon Glass2021-03-221-257/+266
| | | | | | | | | | | | | | Collect the material into different top-level headings to make it easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: doc: Add documentation to htmldocsSimon Glass2021-03-2211-245/+294
| | | | | | | | | | | | | | | | Add a link to binman's documentation and adjust the files so that it is accessible. Use the name README.rst so it is easy to discover when binman is installed without U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
| * doc: Move driver model docs under develop/Simon Glass2021-03-2220-11/+5
| | | | | | | | | | | | | | | | These docs are useful for developers, not users. Move them under that section. Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
| * doc: Move UEFI under develop/Simon Glass2021-03-227-14/+7
| | | | | | | | | | | | | | | | Much of the content here is useful only for development. Move it under that section. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * x86: dts: Drop unused CONFIG_SPLSimon Glass2021-03-221-5/+1
| | | | | | | | | | | | | | This cannot be used since the previous #elif has already dealt with SPL. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Make use of binman expanded entriesSimon Glass2021-03-221-10/+1
| | | | | | | | | | | | | | | | We don't need to spell out the separate pieces of U-Boot phase binaries anymore. Revert to using the simple entry and let binman do the expansion itself as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
| * Makefile: Pass new entry args to binmanSimon Glass2021-03-221-0/+8
| | | | | | | | | | | | | | | | To support the use of 'expanded' entries, binman needs to be told whether SPL and TPL have a devicetree and whether they need BSS padding. Add these to the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Automatically expand phase binaries into sectionsSimon Glass2021-03-2216-18/+571
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating an entry, check for an expanded version of that entry, then use it instead. This allows, for example use of: u-boot { }; instead of having to write out in full: u-boot { type = "section"; u-boot-nodtb { }; u-boot-dtb { }; }; Add an implementaion of this and associated documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Plumb expanded entries through fullySimon Glass2021-03-223-8/+36
| | | | | | | | | | | | | | | | Add support for this feature in the control, image and section modules, so that expanded entries will be selected by default. So far there are no expanded entry types, so this is a nop. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Allow a way to select expanded entriesSimon Glass2021-03-222-6/+16
| | | | | | | | | | | | | | | | | | | | Add a new command-line option to disable expanded entries. This is needed for most tests, since it is much easier to 'factor out' this function into a separate test and keep the existing packing tests simple. Add the option and select it by default from tests. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Allow using an an 'expanded' entry typeSimon Glass2021-03-222-9/+63
| | | | | | | | | | | | | | | | As the first step in supporting expanded entries, add a way for binman to automatically select an 'expanded' version of an entry type, if requested. This is controlled by a class method. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use standard filenames for SPL/TPL devicetreeSimon Glass2021-03-222-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present, before any entry expansion is done (such as a 'files' entry expanding out to individual entries for each file it contains), we check the binman definition (i.e. '/binman' node) to find out what devicetree files are used in the images. This is a pain, since the definition may change during expansion. For example if there is no u-boot-spl-dtb entry in the definition at the start, we assume that the SPL devicetree is not used. But if an entry later expands to include this, then we don't notice. In fact the flexibility provided by the current approach of checking the definition is not really useful. We know that we can have SPL and TPL devicetrees. We know the pathname to each, so we can simply check if the files are present. If they are present, we can prepare them and update them regardless of whether they are actually used. If they are not present, we cannot prepare/update them anyway, i.e. an error will be generated. Simplify state.Prepare() so it uses a hard-coded list of devicetree files. Note that state.PrepareFromLoadedData() is left untouched, since in that case we have a complete definition from the loaded file, but cannot of course rely on the devicetree files that created it still being present. So in that case we still check the image defitions. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Move the comment for GetFdts() to the base classSimon Glass2021-03-222-10/+1
| | | | | | | | | | | | Like with other methods this comment should be in the base class. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Drop unnecessary field in output_fdt_infoSimon Glass2021-03-221-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | At present we store an entry as the third field in output_fdt_info[]. This is only used to get the type of the entry. Of course multiple entries may have this same type. Also the entry type is the key to this dict, so we can use that instead. Drop the field and update GetUpdateNodes() to suit. Improve the comment for output_fdt_info a little while here. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the fake SPL/TPL only if requestedSimon Glass2021-03-221-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present we always use the main devicetree for SPL/TPL as well when setting up the state. But this it not needed if there is a real devicetree for SPL or TPL. In fact it confuses things since we cannot distinguish between one being provided and using the fake one. Update the code to create the fakes only when requested. Put the mapping in a constant so we can use it elsewhere. Rename 'other_fname' to 'fname' while we are here since there is nothing 'other' about it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Drop unnecessary 'type' property in testsSimon Glass2021-03-222-2/+0
| | | | | | | | | | | | | | A few tests declare a type when this can be inferred from the node name. Drop these lines, since it might cause confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add support for u-boot-tpl-bss-badSimon Glass2021-03-224-0/+101
| | | | | | | | | | | | | | | | This entry holds the padding between the end of of TPL binary and the end of BSS. This region must be left empty so that the devicetree can be appended correctly and remain accessible without interfering with BSS. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add support for u-boot-tpl-nodtbSimon Glass2021-03-224-0/+83
| | | | | | | | | | | | | | Allow this entry type to be placed in an image. This is the TPL binary, without a devicetree appended. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support symbols in u-boot-spl-nodtbSimon Glass2021-03-226-21/+81
| | | | | | | | | | | | | | | | | | | | Since this is an execuable we should be able insert symbol values into it. Add support for this. Use common code for this test and the original testSymbols. Use hex consistently for the values and add some more comments. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Correct the documentation for u-boot-spl-bss-padSimon Glass2021-03-222-14/+20
| | | | | | | | | | | | | | The documentation for this entry indicates that the SPL binary is included along with the padding. It is not, so update it to correct the error. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Tidy up underscores in entry documentationSimon Glass2021-03-227-24/+22
| | | | | | | | | | | | | | | | | | | | Several entries currently use an underscore in the entry-type name, but in fact a hyphen is used. Update the docs to fix this as it might be confusing. Also simplify the 'filename' comment and fix the 'operation' typo. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Update entry help for files-alignSimon Glass2021-03-221-0/+1
| | | | | | | | | | | | | | | | | | Regenerate the entry documentation, which step was missed when the files-align feature was added. Fixes: 6eb9932668f ("binman: Support alignment of files") Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Document ExpandEntries() in the base classSimon Glass2021-03-222-6/+11
| | | | | | | | | | | | | | Move the documentation to the base method as it is with other methods. Also update it a little while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Allow extracting to current directorySimon Glass2021-03-221-1/+1
| | | | | | | | | | | | | | | | Extracting files to the current directory is not normally a very friendly thing to do, but it can be warranted, e.g. in a new temporary dir. At present binman reports an error when such an attempt is made. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: apl: Use read-only SPL and new of-platdataSimon Glass2021-03-221-0/+2
| | | | | | | | | | | | | | | | With Apollo Lake, SPL is placed in read-only memory. Set this new option so that OF_PLATDATA_INST can be used. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: coral: Drop TPM and ACPI interrupts from TPLSimon Glass2021-03-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | These devices are not actually built in TPL but are currently active in the TPL devicetree. For of-platdata-inst this means that we will try to generate devices for them, which fails. Update them to be active only in U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: coral: Drop ACPI properties from of-platdataSimon Glass2021-03-221-0/+1
| | | | | | | | | | | | | | We don't use these in TPL or SPL, so drop them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Don't include reset driver in SPLSimon Glass2021-03-221-1/+1
| | | | | | | | | | | | | | | | We don't normally need this driver in TPL/SPL, so drop it for now. It can be enabled by individual boards if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Support a fake PCI device with of-platdata-instSimon Glass2021-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With TPL we don't need full PCI support and it adds to code size. Instead, a simple_bus driver is good enough to be able to read and write the PCI config and do a little basic setup. So at present there are two drivers in U-Boot called pci_x86. One is in UCLASS_PCI, used in SPL and U-Boot proper. The other is in UCLASS_SIMPLE_BUS and used only in TPL. Add a tag to tell dtoc about this, so it knows which one to use when generating the devices and uclasses. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: itss: Tidy up bind() for of-platdata-instSimon Glass2021-03-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | With the standard of-platdata we must fix up driver_data manually. With of-platadata-inst this is not necessary, since it is added to the device by dtoc. Update the code to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: apl: Tell of-platdata about a required header fileSimon Glass2021-03-221-0/+1
| | | | | | | | | | | | | | | | This enum is needed to generate build-time devices. Tell dtoc where to find the header, to avoid compile errors in the generated code. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: apl: Fix the header order in pmcSimon Glass2021-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | The dm.h header should come first. In fact it needs to, since otherwise the driver model definitions are not available to dt-structs.h Fix this, since it causes problems with OF_PLATDATA_INST. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * x86: Define a region for device priv/plat dataSimon Glass2021-03-221-0/+8
| | | | | | | | | | | | | | | | Collect this together in one place, so driver model can access set it up in a new place if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: doc: Add documentation for of-platdata-instSimon Glass2021-03-221-0/+587
| | | | | | | | | | | | | | | | Add a description of the new features, along with internal technical documentation. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: doc: Tidy up of-platdata docsSimon Glass2021-03-221-86/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | This doc has a few pieces that are out-of-date. Fix these. Also we have started to use 'devicetree' instead of 'device tree' or 'device-tree' since it is easier to see as a single term, so replace all ocurrences accordingly. Also move the caveats to the end, since this is a fairly solid part of U-Boot now. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add warnings to private / platform settersSimon Glass2021-03-222-0/+21
| | | | | | | | | | | | | | | | Add a warning to each of these functions so that people do not attempt to use them outside driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Use separate priv/plat data regionSimon Glass2021-03-223-6/+24
| | | | | | | | | | | | | | | | | | | | Make use of the new priv/plat data region if enabled. This is implemented as a simple offset from the position set up by dtoc to the new position. So long as all access goes through dm_priv_to_rw() this is safe. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Define a region for device priv/plat dataSimon Glass2021-03-221-0/+8
| | | | | | | | | | | | | | | | Collect this together in one place, so driver model can access set it up in a new place if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Allow storing priv/plat data separatelySimon Glass2021-03-223-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | At present the device priv/data data allocated by dtoc is stored in the data section along with other variables. On some platforms it is better to allocate space for it separately, e.g. if SPL is running from read-only memory. Create a new space with the same size as that allocated by dtoc, ready for use. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Move flags to device-runtime infoSimon Glass2021-03-222-0/+41
| | | | | | | | | | | | | | | | | | When of-platdata-inst is active, use the flags in the new udevice_rt table, dropping them from the main struct udevice. This ensures that the latter is not updated at runtime. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Create a struct for device runtime infoSimon Glass2021-03-225-4/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present when driver model needs to change a device it simply updates the struct udevice structure. But with of-platdata-inst most of the fields are not modified at runtime. In fact, typically only the flags need to change. For systems running SPL from read-only memory it is convenient to separate out the runtime information, so that the devices don't need to be copied before being used. Create a new udevice_rt table, similar to the existing driver_rt. For now it just holds the flags, although they are not used in this patch. Add a new Kconfig for the driver_rt data, since this is not needed when of-platdata-inst is used. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Add an option to support SPL in read-only memorySimon Glass2021-03-222-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some systems (e.g. x86 APL) run SPL from read-only memory. The device instances created by dtoc are therefore not writeable. To make things work we would need to copy the devices to read/write memory. To avoid this, add an option to use a separate runtime struct for devices, just as is done for drivers. This can be used to hold information that changes at runtime, avoiding the need for a copy. Also add a Kconfig option for read-only SPL, which selects this feature. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * azure/gitlab: Add tests for sandbox_noinstSimon Glass2021-03-222-1/+12
| | | | | | | | | | | | | | | | Add this new board to the test plans. Travis-CI is left out, since it is being removed soon due to lack of capacity. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * test: Run sandbox_spl tests on sandbox_noinstSimon Glass2021-03-221-0/+4
| | | | | | | | | | | | | | Run the tests on this build too, to prevent regressions. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: Create a new sandbox_noinst buildSimon Glass2021-03-224-0/+243
| | | | | | | | | | | | | | | | | | | | | | | | Move sandbox_spl over to use OF_PLATDATA_INST. Create a new board to test the case when this is not enabled, since we will be keeping that code around for several months and want to avoid regressions. Skip the dm_test_of_plat_dev() test since driver info is not available for OF_PLATDATA_INST. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
| * Revert "sandbox: Disable I2C emulators in SPL"Simon Glass2021-03-224-13/+8
| | | | | | | | | | | | | | | | | | With recent changes this can be supported again. Add it back. This reverts commit d85f2c4f2970d0ec2f5f075de734afd11200d153. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>