summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'dm-pull-15oct19' of ↵WIP/15Oct2019Tom Rini2019-10-1598-275/+1290
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-dm binman enhancements: - Dropping some test Elf files and building them from source instead - Refactoring of x86 16-bit entries - Support for SPL symbols within sections - Handle the 'notes' sections and hidden symbols in recent binutils - Improved error reporting with a tool fails libfdt and documentation fixes vboot required-key test driver model power-domain controls patman Message-Id enhancement
| * sandbox: fix build error due to missing struct udevice definitionAKASHI Takahiro2019-10-151-0/+2
| | | | | | | | | | | | | | Without this patch, compiling may potentially fail. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: Tidy up dump output when there are many devicesPatrick Delaunay2019-10-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the 'Index' column of 'dm tree' assumes there is two digits, this patch increase it to 3 digits. It also aligns output of 'dm uclass', assuming the same 3 digits index. The boards with CONFIG_PINCTRL_FULL activated have one pinconfig by pin configuration, so they can have more than 100 devices pinconfig (for example with stm32mp157c-ev1 board we have 106 pinconfig node). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: pinctrl: introduce PINCONF_RECURSIVE optionPatrick Delaunay2019-10-152-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the Linux pinctrl binding, the pin configuration nodes don't need to be direct children of the pin controller device (may be grandchildren for example). This behavior is managed with the pinconfig u-class which recursively bind all the sub-node of the pin controller. But for some binding (when pin configuration is only children of pin controller) that is not necessary. U-Boot can save memory and reduce the number of pinconf instance when this feature is deactivated (for arch stm32mp for example for SPL). This patch allows to control this feature with a new option CONFIG_PINCONF_RECURSIVE when it is possible for each individual pin controller device. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Fixed CONFIG_IF_ENABLED() condition, added __maybe_unused: Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: device: switch off power domain after device removalAnatolij Gustschin2019-10-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The power domain associated with a device is enabled when probing, but currently the domain remains enabled when the device is removed. Some boards started to disable power domains for selected devices via custom board_quiesce_devices(), but it doesn't work in many cases, i. e. because devices still can be accessed later in .remove() callback on behalf of dm_remove_devices_flags(). Utilize the DM core to power off the device power domain, but add a device flag to be able to selectively let the power domain enabled after device removal. This might be required for devices that must remain enabled when booting OS, i. e. serial console for debug output, etc. Signed-off-by: Anatolij Gustschin <agust@denx.de> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * power: domain: Introduce dev_power_domain_offLokesh Vutla2019-10-152-7/+45
| | | | | | | | | | | | | | | | Add dev_power_domain_off() api to disable all the power-domains corresponding to a device Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * remoteproc: k3_arm64: Enable DM_FLAG_DEFAULT_PD_CTRL_OFFLokesh Vutla2019-10-151-0/+1
| | | | | | | | | | | | | | | | Enable DM_FLAG_DEFAULT_PD_CTRL_OFF for arm64 remote core so that pd can be enabled after loading the image. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: core: Allow for not controlling the power-domain by DM frameworkLokesh Vutla2019-10-152-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In some remoteproc cases, enabling the power domain of the core will start running the core. In such cases image should be loaded before enabling the power domain. But the current DM framework enables the power-domain by default during probe. This is causing the remotecore to start and crash as there is no valid image loaded. In order to avoid this introduce a DM flag that doesn't allow for enabling/disabling the power-domain by DM framework. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: device: Fix typo in the non-DEVRES version of devm_kmalloc_array()Jean-Jacques Hiblot2019-10-151-2/+2
| | | | | | | | | | | | | | | | | | When DEVRES is not set, devm_kmalloc_array() is spelled devm_kmaloc_array() (with one 'l' only). Fixing it so that the name is the same with and without DEVRES. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * patman: Use the Change-Id, version, and prefix in the Message-IdDouglas Anderson2019-10-154-5/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per the centithread on ksummit-discuss [1], there are folks who feel that if a Change-Id is present in a developer's local commit that said Change-Id could be interesting to include in upstream posts. Specifically if two commits are posted with the same Change-Id there's a reasonable chance that they are either the same commit or a newer version of the same commit. Specifically this is because that's how gerrit has trained people to work. There is much angst about Change-Id in upstream Linux, but one thing that seems safe and non-controversial is to include the Change-Id as part of the string of crud that makes up a Message-Id. Let's give that a try. In theory (if there is enough adoption) this could help a tool more reliably find various versions of a commit. This actually might work pretty well for U-Boot where (I believe) quite a number of developers use patman, so there could be critical mass (assuming that enough of these people also use a git hook that adds Change-Id to their commits). I was able to find this git hook by searching for "gerrit change id git hook" in my favorite search engine. In theory one could imagine something like this could be integrated into other tools, possibly even git-send-email. Getting it into patman seems like a sane first step, though. NOTE: this patch is being posted using a patman containing this patch, so you should be able to see the Message-Id of this patch and see that it contains my local Change-Id, which ends in 2b9 if you want to check. [1] https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2019-August/006739.html Signed-off-by: Douglas Anderson <dianders@chromium.org>
| * cmd: aes: use map_sysmem when accessing memoryPhilippe Reynes2019-10-151-4/+10
| | | | | | | | | | | | | | The aes command used to segfault when accessing memory in sandbox. The pointer accesses should be mapped. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * sandbox64: enable command aesPhilippe Reynes2019-10-151-0/+1
| | | | | | | | | | | | | | This commit add the support of command aes. Then, it may be used on pytest. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * sandbox: enable command aesPhilippe Reynes2019-10-151-0/+1
| | | | | | | | | | | | | | This commit enable the command aes on sandbox. Then, it may be used on pytest. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * libfdt: fix typo on commentGiulio Benetti2019-10-151-1/+1
| | | | | | | | Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
| * rsa: Return immediately if required-key verification failsDaniele Alessandrelli2019-10-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Currently, if image verification with a required key fails, rsa_verify() code tries to find another key to verify the FIT image. This however, is not the intended behavior as the documentation says that required keys "must be verified for the image / configuration to be considered valid". This patch fixes the issue by making rsa_verify() return immediately if the verification of a required key fails. Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
| * pytest: vboot: add a test for required keyPhilippe Reynes2019-10-152-0/+103
| | | | | | | | | | | | | | | | This commit add a test in the vboot test to check that when a required key is asked, only FIT signed with this key is used/accepted by u-boot. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
| * dm: pinctrl: Skip not associated gpio phandle and rise a warning messageMichael Trimarchi2019-10-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | Skip not associated gpio phandle let register the other gpios on a group. We need anyway to send out a warning to the user to fix their uboot-board.dtsi. Thhe handle id can be found inside the decompiled dtb dtc -I dtb -O dts -o devicetree.dts spl/u-boot-spl.dtb Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * core: device: use dev_power_domain_onPeng Fan2019-10-151-3/+3
| | | | | | | | | | | | | | When multiple power domains attached to a device, need power on them all, so use dev_power_domain_on to do that. Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * power: domain: add dev_power_domain_onPeng Fan2019-10-152-0/+38
| | | | | | | | | | | | | | | | | | | | Add this new API to power on multiple domains attached to a device. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Changed to static inline and added a condition into C file: Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: spi: Do not assume first SPI busThomas Fitzsimmons2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | When CONFIG_OF_PRIOR_STAGE is enabled, this workaround was needed before device_bind_common assigned request numbers sequentially in the absence of aliases. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org>
| * dm: device: Request next sequence numberThomas Fitzsimmons2019-10-152-1/+8
| | | | | | | | | | | | | | | | | | | | | | For CONFIG_OF_PRIOR_STAGE, in the absence of a device tree alias for a given device, use the next request number for that type of device. This allows aliases to be used when they're available, while still allowing unaliased devices to be probed. Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org>
| * tpm2: Don't assume active low reset valueKayla Theil2019-10-151-2/+2
| | | | | | | | | | | | | | | | The reset function sets the pin to 0 then 1 but if the pin is marked ACTIVE_LOW in the DT it gets inverted and leaves the TPM in reset. Let the gpio driver take care of the reset polarity. Signed-off-by: Kayla Theil <kayla.theil@mixed-mode.de>
| * dm: Fix default address cells return valueMatthias Brugger2019-10-151-1/+1
| | | | | | | | | | | | | | | | Default address cells value on the livetree access function returns the wrong value. Fix this so that the value returned corresponds to the device tree specification. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
| * libfdt: Allow #size-cells of 0Matthias Brugger2019-10-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit "libfdt: fdt_address_cells() and fdt_size_cells()" introduced a bug as it consolidated code between the helpers for getting be 0, and is frequently found so in practice for /cpus. IEEE1275 only requires implementations to handle 1..4 for #address-cells, although one could make a case for #address-cells == #size-cells == 0 being used to represent a bridge with a single port. While we're there, it's not totally obvious that the existing implicit cast of a u32 to int will give the correct results according to strict C, although it does work in practice. Straighten that up to cast only after we've made our range checks. This is based on upstream commit: b8d6eca ("libfdt: Allow #size-cells of 0") but misses the test cases,as we don't implement them in U-Boot. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
| * libfdt: return correct value if #size-cells property is not presentMatthias Brugger2019-10-152-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the device tree specification, the default value for was not present. This patch also makes fdt_address_cells() and fdt_size_cells() conform to the behaviour documented in libfdt.h. The defaults are only returned if fdt_getprop() returns -FDT_ERR_NOTFOUND, otherwise the actual error is returned. This is based on upstream commit: aa7254d ("libfdt: return correct value if #size-cells property is not present") but misses the test case part, as we don't implement them in U-Boot. Signed-off-by: Matthias Brugger <mbrugger@suse.com>
| * libfdt: fdt_address_cells() and fdt_size_cells()Matthias Brugger2019-10-152-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | Add internal fdt_cells() to avoid copy and paste. Fix typo in fdt_size_cells() documentation comment. This is based in upstream commit: c12b2b0 ("libfdt: fdt_address_cells() and fdt_size_cells()") but misses the test cases, as we don't implement them in U-Boot. Signed-off-by: Matthias Brugger <mbrugger@suse.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * sandbox: fix cpu property in test.dts for pytestAKASHI Takahiro2019-10-151-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I tried to run some new efi tests with pytest, efi_smbios_register() triggered a segmentation fault. Here is the location where it happened: efi_init_obj_list() efi_smbios_register() write_smbios_table() smbios_write_type4() smbios_write_type4_dm() where dev_get_parent_platdata() should return a pointer to struct cpu_platdata, but it is actually NULL because any cpu device on sandbox is attached to "root_driver." With this patch, this issue will be fixed by moving all the definitions of cpus under "cpus" node so that they have a "cpu_bus" parent. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * 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>
| * dm: pinctrl: introduce PINCONF_RECURSIVE optionPatrick Delaunay2019-10-152-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the Linux pinctrl binding, the pin configuration nodes don't need to be direct children of the pin controller device (may be grandchildren for example). This behavior is managed with the pinconfig u-class which recursively bind all the sub-node of the pin controller. But for some binding (when pin configuration is only children of pin controller) that is not necessary. U-Boot can save memory and reduce the number of pinconf instance when this feature is deactivated (for arch stm32mp for example for SPL). This patch allows to control this feature with a new option CONFIG_PINCONF_RECURSIVE when it is possible for each individual pin controller device. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * binman: Drop comment-out code in testUpdateFdtOutput()Simon Glass2019-10-151-2/+0
| | | | | | | | | | | | This code is not needed so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add logging for the number of pack passesSimon Glass2019-10-151-0/+1
| | | | | | | | | | | | | | Sometimes binman takes multiple passes to complete packing an image. Add logging to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Write symbol info before image inclusionSimon Glass2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the symbol information is written to binaries just before binman exits. This is fine for entries within sections since the section contents is calculated when it is needed, so the updated symbol values are included in the image that is written. However some binaries are inside entries which have already generated their contents and do not notice that the entries have changed (e.g. Intel IFWI). Move the symbol writing earlier to cope with this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support writing symbols into entries within an IFWISimon Glass2019-10-151-0/+5
| | | | | | | | | | | | | | | | The Intel IFWI (Integrated Firmware Image) is effectively a section with other entries inside it. Support writing symbol information into entries within it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Update IFWI entry to support updatesSimon Glass2019-10-151-18/+28
| | | | | | | | | | | | | | Add support for the ProcessContents() method in this entry so that it is possible to support entries which change after initial creation. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Update IFWI entry to read entries outside constructorSimon Glass2019-10-151-0/+3
| | | | | | | | | | | | | | At present this class reads its entries in the constructor. This is not how things should be done now. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Fix entry comment for Intel descriptorSimon Glass2019-10-151-1/+1
| | | | | | | | | | | | This comment references another entry type. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add support for Intel FSP meminitSimon Glass2019-10-154-0/+66
| | | | | | | | | | | | | | The Intel FSP supports initialising memory early during boot using a binary blob called 'fspm'. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Allow support for writing a size symbol to binariesSimon Glass2019-10-154-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is useful to be able to access the size of an image in SPL, with something like: binman_sym_declare(unsigned long, u_boot_any, size); ... ulong u_boot_size = binman_sym(ulong, u_boot_any, size); Add support for this and update the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Increase size of TPL and SPL test dataSimon Glass2019-10-157-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | At present these are large enough to hold 20 bytes of symbol data. Add four more bytes so we can add another test. Unfortunately at present this involves changing a few test files to make room. We could adjust the test files to not specify sizes for entries. Then we could make the tests check the actual sizes. But for now, leave it as it is, since the effort is minor. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Avoid needing the section size in advanceSimon Glass2019-10-153-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Entries which include a section and need to obtain its contents call GetData(), as with any other entry. But the current implementation of this method in entry_Section requires the size of the section to be known. If it is unknown, an error is produced, since size is None: TypeError: can't multiply sequence by non-int of type 'NoneType' There is no need to know the size in advance since the code can be adjusted to build up the section piece by piece, instead of patching each entry into an existing bytearray. Update the code to handle this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Rename some two-digit test filesSimon Glass2019-10-153-2/+2
| | | | | | | | | | | | | | Two of the test files somehow were not converted to three digits. Fix them, using the next available numbers. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use underscore in test filenamesSimon Glass2019-10-1514-14/+14
| | | | | | | | | | | | | | At present a small number of test files use hyphens instead of underscores. Rename them for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Allow symbols to be resolved inside sectionsSimon Glass2019-10-154-10/+67
| | | | | | | | | | | | | | | | | | | | | | | | At present we only support symbols inside binaries which are at the top level of an image. This restrictions seems unreasonable since more complex images may want to group binaries within different sections. Relax the restriction, adding a new _SetupTplElf() helper function. Also fix a typo in the comment for testTpl(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Clean up unnecessary code related to ELF test filesSimon Glass2019-10-153-12/+4
| | | | | | | | | | | | | | | | | | | | We use the Makefile for all ELF test files now, so drop all the code that checks whether to get the test file from the Makefile or from the git repo. Also add a comment to the Makefile indicating that it is run from binman. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the Makefile for u_boot_binman_syms_badSimon Glass2019-10-153-3/+3
| | | | | | | | | | | | Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the Makefile for u_boot_binman_syms_sizeSimon Glass2019-10-153-3/+4
| | | | | | | | | | | | Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the Makefile for u_boot_binman_symsSimon Glass2019-10-155-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove this file from git and instead build it using the Makefile. With this change a few things need to be adjusted: 1. The 'notes' section no-longer appears at the start of the ELF file (before the code), so update testSymbols to adjust the offsets. 2. The dynamic linker is disabled to avoid errors like: "Not enough room for program headers, try linking with -N" 3. The interpreter note is moved to the end of the image, so that the binman symbols appear first. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the Makefile for u_boot_no_ucode_ptrSimon Glass2019-10-153-6/+6
| | | | | | | | | | | | Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the Makefile for u_boot_ucode_ptrSimon Glass2019-10-156-14/+26
| | | | | | | | | | | | | | | | | | | | Remove this file from git and instead build it using the Makefile. Update tools.GetInputFilename() to support reading files from an absolute path, so that we can read the Elf test files easily. Also make sure that the temp directory is report in ELF tests as this was commented out. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Use the Makefile to build ELF test filesSimon Glass2019-10-154-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | At present the ELF test files are checked into the U-Boot tree. This is covenient since the files never change and can be used on non-x86 platforms. However it is not good practice to check in binaries and in this case it does not seem essential. Update the binman test-file Makefile to support having source in a different directory. Adjust binman to run it to build bss_data, as a start. We can add other files as needed. Signed-off-by: Simon Glass <sjg@chromium.org>