aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2021-07-17Merge tag 'u-boot-imx-20210717' of ↵WIP/17Jul2021Tom Rini1-13/+24
https://gitlab.denx.de/u-boot/custodians/u-boot-imx i.MX ---- - mx7ulp : fix WDOG - imx8 : Phytec - USB3 support for i.MX8 CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/8277
2021-07-15image: android: Automatically detect more compression typesStephan Gerhold1-1/+1
At the moment android_image_get_kcomp() can automatically detect LZ4 compressed kernels and the compression specified in uImages. However, especially on ARM64 Linux is often compressed with GZIP. Attempting to boot an Android image with a GZIP compressed kernel image currently results in a very strange crash, e.g. Starting kernel ... "Synchronous Abort" handler, esr 0x02000000 ... Code: 5555d555 55555d55 555f5555 5d555d55 (00088b1f) Note the 1f8b, which are the "magic" bytes for GZIP images. U-Boot already has the image_decomp_type() function that checks for the magic bytes of bzip2, gzip, lzma and lzo. It's easy to make use of it here to increase the chance that we do the right thing and the user does not become confused with strange crashes. This allows booting Android boot images that contain GZIP-compressed kernel images. Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
2021-07-15fit: Load DTO into temporary buffer and ignore load addressMarek Vasut1-4/+28
The current fitImage DTO implementation expects each fitImage image subnode containing DTO to have 'load' property, pointing somewhere into memory where the DTO will be loaded. The address in the 'load' property must be different then the base DT load address and there must be sufficient amount of space between those two addresses. Selecting and using such hard-coded addresses is fragile, error prone and difficult to port even across devices with the same SoC and different DRAM sizes. The DTO cannot be applied in-place because fdt_overlay_apply_verbose() modifies the DTO when applying it onto the base DT, so if the DTO was used in place within the fitImage, call to fdt_overlay_apply_verbose() would corrupt the fitImage. Instead of copying the DTO to a specific hard-coded load address, allocate a buffer, copy the DTO into that buffer, apply the DTO onto the base DT, and free the buffer. The upside of this approach is that it is no longer necessary to select and hard-code specific DTO load address into the DTO. The slight downside is the new malloc()/free() overhead for each DTO, but that is negligible (*). (*) on iMX8MM/MN and STM32MP1 Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Add <linux/sizes.h>] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-14board-info: Call sysinfo_detect() before sysinfo_get_str()Marek Vasut1-2/+6
The sysinfo_get_str() implementation checks whether the sysinfo was even detected. In U-Boot proper, sysinfo_detect() is not called anywhere but on one specific board. Call sysinfo_detect() before sysinfo_get_str() to make sure the sysinfo is detected and sysinfo_get_str() returns valid value instead of -EPERM. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-14board-info: Use sysinfo_get()Marek Vasut1-1/+1
Replace uclass_first_device_err(UCLASS_SYSINFO, &dev) with sysinfo_get(&dev). The board_info code may use sysinfo to print board information, so use the sysinfo functions consistently. The sysinfo_get() is internally implemented as return uclass_first_device_err(UCLASS_SYSINFO, &dev) anyway, so there is no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-10spl: mmc: Factor out eMMC boot partition selection codeMarek Vasut1-13/+24
Factor out eMMC boot partition selection code into default_spl_mmc_emmc_boot_partition() function and implement weak spl_mmc_emmc_boot_partition(), so that architecture or board code can override the eMMC boot partition selection. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Faiz Abbas <faiz_abbas@ti.com> Cc: Harald Seiler <hws@denx.de> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Fabio Estevam <festevam@gmail.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Ye Li <ye.li@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-07Merge tag 'dm-pull-6jul21' of https://source.denx.de/u-boot/custodians/u-boot-dmWIP/07Jul2021Tom Rini1-1/+3
various minor sandbox improvements
2021-07-07bootstage: Eliminate when not enabledTom Rini2-0/+4
When we do not have bootstage enabled, rather than include an empty dummy function, we just don't reference it. This saves us space in some tight builds. This also shows a few cases where show_boot_progress was incorrectly guarded before. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-06sandbox: don't refer to symbol _initHeinrich Schuchardt1-1/+3
GCC provides a symbol _init in crti.o on x86_64 and aarch64 but not on RISC-V. The following lines leads to a build error for sandbox_defconfig on RISC-V due to the missing symbol: common/board_f.c:269: #elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP) gd->mon_len = (ulong)&_end - (ulong)_init; The sandbox code is not copied into the memory allocated using mmap(). Hence we can safely use gd->mon_len = 0 to avoid the reference to _init. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com>
2021-07-05Merge branch 'next'Tom Rini6-16/+66
2021-07-02autoboot: fix MENUKEYDa Xue1-1/+1
replace CONFIG_AUTOBOOT_USE_MENUKEY with CONFIG_AUTOBOOT_MENUKEY Signed-off-by: Da Xue <da@libre.computer>
2021-07-01Merge tag 'xilinx-for-v2021.10' of ↵WIP/01Jul2021-nextTom Rini2-2/+5
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2021.10 clk: - Add driver for Xilinx Clocking Wizard IP fdt: - Also record architecture in /fit-images net: - Fix plat/priv data handling in axi emac - Add support for 10G/25G speeds pca953x: - Add missing dependency on i2c serial: - Fix dependencies for DEBUG uart for pl010/pl011 - Add setconfig option for cadence serial driver watchdog: - Add cadence wdt expire now function zynq: - Update DT bindings to reflect the latest state and descriptions zynqmp: - Update DT bindings to reflect the latest state and descriptions - SPL: Add support for ECC DRAM initialization - Fix R5 core 1 handling logic - Enable firmware driver for mini configurations - Enable secure boot, regulators, wdt - Add support xck devices and 67dr - Add psu init for sm/smk-k26 SOMs - Add handling for MMC seq number via mmc_get_env_dev() - Handle reserved memory locations - Add support for u-boot.itb generation for secure OS - Handle BL32 handoffs for secure OS - Add support for 64bit addresses for u-boot.its generation - Change eeprom handling via nvmem aliases
2021-06-28Merge tag 'v2021.07-rc5' into nextTom Rini2-4/+14
Prepare v2021.07-rc5 # gpg: Signature made Mon 28 Jun 2021 03:39:36 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # configs/am64x_evm_r5_defconfig
2021-06-23malloc: add SPDX license identifiersHeinrich Schuchardt1-0/+10
The original code is in the public domain. Licenses/README states that the general license for U-Boot is GPL 2.0+. So we can mark the malloc code as GPL 2.0+ too. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-23spl: fit: Also record architecture in /fit-imagesMichal Simek2-2/+5
On ARM64 secure OS can run as 64bit or 32bit that's why it is necessary to record information about architecture that other code can read it and properly pass it to TF-A and start in 64bit or 32bit mode. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-06-22autoboot: fix typos of CONFIG_AUTOBOOT_USE_MENUKEYDa Xue1-4/+4
Replace typo CONFIG_USE_AUTOBOOT_MENUKEY with CONFIG_AUTOBOOT_USE_MENUKEY as when they were introduced initially there was some mismatch in which name was used where. Fixes: 8fc31e23aa83 ("autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEY") Signed-off-by: Da Xue <da@libre.computer>
2021-06-11common: fit: Update board_fit_image_post_process() to pass fit and node_offsetLokesh Vutla2-2/+2
board_fit_image_post_process() passes only start and size of the image, but type of the image is not passed. So pass fit and node_offset, to derive information about image to be processed. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tero Kristo <kristo@kernel.org>
2021-06-08log: Add support for logging a bufferSimon Glass1-0/+30
The print_buffer() function is very useful for debugging. Add a version of this in the log system also. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-06-08console: Report an error when output buffer is exhaustedSimon Glass1-4/+14
If the console output buffer is exhausted, characters are silently dropped from the end. Detect this condition and report an error when reading back the characters. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-06-07image-fdt: save no-map parameter of reserve-memoryPatrick Delaunay1-8/+15
Save the 'no-map' information present in 'reserved-memory' node to allow correct handling when the MMU is configured in board to avoid speculative access. This binding is defined in doc/device-tree-bindings/reserved-memory/reserved-memory.txt Additional properties: ... no-map (optional) - empty property - Indicates the operating system must not create a virtual mapping of the region as part of its standard mapping of system memory, nor permit speculative access to it under any circumstances other than under the control of the device driver using the region. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-05-31board: sifive: add HiFive Unmatched board supportGreen Wan1-2/+2
Add defconfig and board support for HiFive Unmatched. Signed-off-by: Green Wan <green.wan@sifive.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com>
2021-05-28Revert "lib: introduce HASH_CALCULATE option"Alexandru Gagniuc1-1/+0
When we think of Kconfig, we usually think of features that we like to enable or not. Ideally, we wouldn't use Kconfig to fix a build issue, although sometimes it might make sense. With Kconfig it's hard to guarantee that the fix is universal. We can only say that it works for the set of tested configurations. In the majority of cases, it's preferable to let the linker figure things out for us. The reverted commit attempted to fix a build issue by adding an invisible Kconfig option. This is wrong in several ways: It invents a new Kconfig variable when CONFIG_HASH already exists for the same purpose. Second, hash-checksum.c makes use of the hash_progressive_lookup_algo() symbol, which is only provided with CONFIG_HASH, but this dependency was not expressed in the reverted patch. It feels like Kconfig is turning into a listing of all available source files, and a buffet to 'select' which ones to compile. The purpose of this revert is to enable the next change to make use of CONFIG_HASH instead of adding to Kconfig. This reverts commit 87316da05f2fd49d3709275e64ef0c5980366ade. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Acked-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2021-05-26spl: Kconfig: Use tabs instead of space for alignmentMichal Simek1-12/+12
A lot of entries were using spaces instead of tab for alignment that's why it is good to fix it to use the same style everywhere. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-19riscv: Drop USE_SPL_FIT_GENERATORBin Meng1-2/+1
Now that we have switched to binman to generate u-boot.itb for all RISC-V boards, USE_SPL_FIT_GENERATOR is no longer needed and can be dropped. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-19common: kconfig: Correct a typo in SPL_LOAD_FITBin Meng1-1/+1
It should be FDT, not FTD. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Rick Chen <rick@andestech.com>
2021-05-18Merge branch '2021-05-17-assorted-fixes'WIP/18May2021Tom Rini1-2/+2
2021-05-18lib: introduce HASH_CALCULATE optionMasahisa Kojima1-0/+1
Build error occurs when CONFIG_EFI_SECURE_BOOT or CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled, because hash-checksum.c is not compiled. Since hash_calculate() implemented in hash-checksum.c can be commonly used aside from FIT image signature verification, this commit itroduces HASH_CALCULATE option to decide if hash-checksum.c shall be compiled. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-18hash: Kconfig option for SHA512 hardware accelerationHeinrich Schuchardt1-4/+4
Commit a479f103dc1c ("hash: Allow for SHA512 hardware implementations") defined function definitions for hardware accelerated SHA384 and SHA512. If CONFIG_SHA_HW_ACCEL=y, these functions are used. We already have boards using CONFIG_SHA_HW_ACCEL=y but none implements the new functions hw_sha384() and hw_sha512(). For implementing the EFI TCG2 protocol we need SHA384 and SHA512. The missing hardware acceleration functions lead to build errors on boards like peach-pi_defconfig. Introduce a new Kconfig symbol CONFIG_SHA512_HW_ACCEL to control if the functions hw_sha384() and hw_sha512() shall be used to implement the SHA384 and SHA512 algorithms. Fixes: a479f103dc1c ("hash: Allow for SHA512 hardware implementations") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-05-17cli: slighly more clear error messagespeng.wang@smartm.com1-2/+2
This patch tries to distinguish two error messages. Signed-off-by: peng.wang@smartm.com <peng.wang@smartm.com>
2021-05-13fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.cKory Maincent1-0/+46
Move the fdt_valid function to fdt_support. This changes allow to be able to test the validity of a devicetree in other c files. Update code syntax. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Maxime Ripard <maxime@cerno.tech>
2021-05-12Revert "fdt: translate address if #size-cells = <0>"Dario Binacchi1-4/+2
This reverts commit d64b9cdcd475eb7f07b49741ded87e24dae4a5fc. As pointed by [1] and [2], the reverted patch made every DT 'reg' property translatable. What the patch was trying to fix was fixed in a different way from previously submitted patches which instead of correcting the generic address translation function fixed the issue with appropriate platform code. [1] https://patchwork.ozlabs.org/project/uboot/patch/1614324949-61314-1-git-send-email-bmeng.cn@gmail.com/ [2] https://lore.kernel.org/linux-clk/20210402192054.7934-1-dariobin@libero.it/T/ Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-05-04fdt_support.c: Allow late kernel cmdline modificationNiko Mauno1-1/+11
By declaring board-specific board_fdt_chosen_bootargs() the kernel command line arguments can be adjusted before injecting to flat dt chosen node. Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
2021-05-04env: allow environment to be amended from control dtbRasmus Villemoes1-0/+2
It can be useful to use the same U-Boot binary for multiple purposes, say the normal one, one for developers that allow breaking into the U-Boot shell, and one for use during bootstrapping which runs a special-purpose bootcmd. Or one can have several board variants that can share almost all boot logic, but just needs a few tweaks in the variables used by the boot script. To that end, allow the control dtb to contain a /config/enviroment node (or whatever one puts in fdt_env_path variable), whose property/value pairs are used to update the run-time environment after it has been loaded from its persistent location. The indirection via fdt_env_path is for maximum flexibility - for example, should the user wish (or board logic dictate) that the values in the DTB should no longer be applied, one simply needs to delete the fdt_env_path variable; that can even be done automatically by including a fdt_env_path = ""; property in the DTB node. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2021-05-04sysinfo: Require that sysinfo_detect be called before other methodsSean Anderson1-0/+4
This has the uclass enforce calling detect() before other methods. This allows drivers to cache information in detect() and perform (cheaper) retrieval in the other accessors. This also modifies the only instance where this sequencing was not followed. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-27IOMUX: Fix buffer overflow in iomux_replace_device()Yuichiro Goto1-2/+6
Use of strcat() against an uninitialized buffer would lead to buffer overflow. This patch fixes it. Fixes: 694cd5618c ("IOMUX: Introduce iomux_replace_device()") Signed-off-by: Yuichiro Goto <goto@k-tech.co.jp> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Peter Robinson <pbrobinson@gmail.com>
2021-04-24common: edid: Search for valid timing in extension blockJernej Skrabec1-0/+18
One of my monitors have only 4k@60 timing in base EDID block which is out of range for devices with HDMI 1.4. It turns out that it has additional detailed timings in CTA-861 Extension Block and two of them are appropriate for HDMI 1.4. Add additional search for valid detailed timing in extension block. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Acked-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-04-24common: edid: extract code for detailed timing searchJernej Skrabec1-21/+28
Code which searches for valid detailed timing entry will be used in more places. Extract it. No functional change is made. However, descriptors are casted to edid_detailed_timing instead of edid_monitor_descriptor. Descriptor can be of either type, but since we're interested only in DTD, it is more fitting to cast to edid_detailed_timing. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-04-24common: edid: check for digital display earlierJernej Skrabec1-4/+5
When searching for detailed timing in EDID, check for digital display earlier. There is no point parsing other parameters if this flag is not present. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-04-20Add support for stack-protectorJoel Peshkin3-0/+38
Add support for stack protector for UBOOT, SPL, and TPL as well as new pytest for stackprotector Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com> Adjust UEFI build flags. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-19Revert "spl: Drop bd_info in the data section"Alexandru Gagniuc2-21/+8
This reverts commit 38d6b7ebdaee3e0e8426ef1b9df88bdce8ae2e75. struct global_data contains a pointer to the bd_info structure. This pointer was populated spl_set_bd() to a pre-allocated bd_info in the ".data" section. The referenced commit replaced this mechanism to one that uses malloc(). That new mechanism is only used if SPL_ALLOC_BD=y. which very few boards do. The result is that (struct global_data)->bd is NULL in SPL on most platforms. This breaks falcon mode, since arch_fixup_fdt() tries to access (struct global_data)->bd and set the "/memory" node in the devicetree. The result is that the "/memory" node contains garbage values, causing linux to panic() as it sets up the page table. Instead of trying to fix the mess, potentially causing other issues, revert to the code that worked, while this change is reworked. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14image-fit: Accept OP-TEE images when booting a FITAlexandru Gagniuc1-0/+2
OP-TEE images are normally packaged with type = "tee; os = "tee"; However, fit_image_load() thinks that is somehow invalid. However if they were declared as type = "kernel", os = "linux", fit_image_load() would happily accept them and allow the boot to continue. There is no technical limitation to excluding "tee". Allowing "tee" images is useful in a boot flow where OP-TEE is executed before linux. In fact, I think it's unintuitive for a "load"ing function to also do parsing and contain a bunch ad-hoc heuristics that only its caller might know. But I don't make the rules, I just write fixes. In more polite terms: refactoring the fit_image API is beyond the scope of this change. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14image-fit: Accept IH_TYPE_FIRMWARE in fit_image_load() as validAlexandru Gagniuc1-0/+2
Consider the following FIT: images { whipple {}; }; configurations { conf-1 { firmware = "whipple"; }; }; Getting the 'firmware' image with fit_image_load() is not possible, as it doesn't understand 'firmware =' properties. Although one could pass IH_TYPE_FIRMWARE for 'image_type', this needs to be converted to a "firmware" string for FDT lookup -- exactly what this change does. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14spl: LOAD_FIT_FULL: Support 'kernel' and 'firmware' propertiesAlexandru Gagniuc1-1/+18
The 'firmware' property of a config node takes precedence over the 'kernel' property. 'standalone' is deprecated. However, give users a couple of releases where 'standalone' still works, but warns loudly. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14spl: LOAD_FIT_FULL: Relocate FDT for u-boot payloadsAlexandru Gagniuc1-1/+11
U-Boot expects the FDT to be located right after the _end linker symbol (see fdtdec.c: board_fdt_blob_setup()) The "basic" LOAD_FIT path is aware of this limitation, and relocates the FDT at the expected location. Guessing the expected location probably only works reliably on 32-bit arm, and it feels like a hack. One proposal would be to pass the FDT address to u-boot (e.g. using 'r2' on arm platforms). The variable is named "fdt_hack" to remind future contributors that, "hey! we should fix the underlying problem". However, that is beyond the scope of this patch. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14spl: LOAD_FIT_FULL: Do not hard-code os to IH_OS_U_BOOTAlexandru Gagniuc1-2/+3
The information on the OS should be contained in the FIT, as the self-explanatory "os" property of a node under /images. Hard-coding this to U_BOOT might send us down the wrong path later in the boot process. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14spl: LOAD_FIT_FULL: Fix selection of the "fdt" nodeAlexandru Gagniuc1-3/+1
The correct FDT to use is described by the "fdt" property of the configuration node. When the fit_unamep argument to fit_image_load() is "fdt", we get the "/images/fdt" node. This is incorrect, as it ignores the "fdt" property of the config node, and in most cases, the "/images/fdt" node doesn't exist. Use NULL for the 'fit_unamep' argument. With NULL, fit_image_load() uses the IH_TYPE_FLATDT value to read the config property "fdt", which points to the correct FDT node(s). fit_image_load() should probably be split into a function that reads an image by name, and one that reads an image by config reference. I don't make those decisions, I just point out the craziness. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14common: fit: Add weak board_fit_config_name_matchSean Anderson1-0/+5
Several architectures had a default board_fit_config_name_match already; this provides a generic weak version. We default to rejecting all configs. This will use the FIT's default config, instead of the first config. This may result in boot failures if there are multiple configurations and the first config is *not* the default. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2021-04-14Kconfig: Document the limitations of the simple SPL_LOAD_FIT pathAlexandru Gagniuc1-0/+10
The "simple" SPL_LOAD_FIT path is the most compliant with the format documented in doc/uImage.FIT/source_file_format.txt. The other two paths to load a FIT are SPL_LOAD_FIT_FULL and the "bootm" command. Since the Kconfig menu is the most likely place for a new user to see these options, it seems like the most logical candidate to document the limitations. This documents the _known_ issues, and is not intended to be a complete list of all follies. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-14spl: fit: Support loading FPGA images from list of "loadables"Alexandru Gagniuc1-0/+24
Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify syntax") and delegated FPGA images to be added via the list of "loadables" in lieu of the "fpga" property. Now actually implement this in code. Note that the "compatible" property is ignored for the time being, as implementing "compatible" loading is beyond the scope of this change. However, "u-boot,fpga-legacy" is accepted without warning. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-04-14spl: fit: Warn if FIT contains "fpga" property in config nodeAlexandru Gagniuc1-0/+8
Commit 4afc4f37c70e ("doc: FIT image: Clarify format and simplify syntax") requires that FPGA images be referenced through the "loadables" in the config node. This means that "fpga" properties in config nodes are deprecated. Given that there are likely FIT images which use "fpga", let's not break those right away. Print a warning message that such use is deprecated, and give users a couple of releases to update their Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>