summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2023-08-09video: Add a Kconfig option for SPL video handoffSimon Glass1-2/+1
At present this feature is enabled in SPL if a bloblist is available. Some platforms may not want to use this, so add an option to allow the feature to be disabled. Note that the feature unfortunately only fills in part of the video-handoff information, so causes failures on x86 platforms. For now, disable it there. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> # qemu-x86_64
2023-08-09bootstd: Rename bootdev_setup_sibling_blk()Simon Glass1-1/+1
This name is a little confusing since it suggests that it sets up the sibling block device. In fact it sets up a bootdev for it. Rename the function to make this clearer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-08-07common: Drop duplicate space in SPL_BMP descriptionMarek Vasut1-1/+1
Drop duplicate space in Kconfig symbol description. Signed-off-by: Marek Vasut <marex@denx.de>
2023-08-07common: fix detection of SYS_MALLOC_F_LEN=0x0Heinrich Schuchardt1-1/+1
CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN is defined as hex. If set to zero manually, .config contains '0x0' and not '0' as value. The default value for CONFIG_SPL_SYS_MALLOC_F_LEN should not be set to 0 but to 0x0 if CONFIG_SPL_FRAMEWORK=n to match a manually set value. Fixes: c0126bd862a0 ("spl: Support bootstage, log, hash and early malloc in TPL") Fixes: b61694705217 ("SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-07spl: move SPL_CRC32 option to lib/KconfigOleksandr Suvorov1-11/+0
All SPL hash algorithm options are collected in lib/Kconfig. Move SPL_CRC32 there as well. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-07spl: remove duplicate SPL_MD5 optionOleksandr Suvorov1-12/+0
There is another SPL_MD5 option defined in lib/Kconfig. Renaming SPL_MD5_SUPPORT introduced duplicate option with different description. As for now FIT and hash algorithm options are not related to each others, removing a duplicate option seems OK. Fixes: 4b00fd1a84c ("Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5") Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2023-08-07bloblist: Enforce CRC32Tom Rini1-0/+3
In the common bloblist code we call crc32 to get a checksum for the data. Ensure we will have the CRC32 code via select. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-05event: Fix a wrong type_name from dm_post_init to dm_post_init_fJaehoon Chung1-1/+1
DM_POST_INIT was changed to DM_POST_INIT_F. To debug correct message, change type_name from dm_post_init to dm_post_init_f. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> s/an/a/ : Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-02console: Print out complete stdio device listBin Meng1-9/+21
At present if both CONSOLE_MUX and SYS_CONSOLE_IS_IN_ENV are on, during boot, the printed out stdio devices are incomplete, e.g.: with "stdout=serial,vidconsole", only "vidconsole" is printed. For such case, we can print out the stdio device name from the environment variables. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-02console: Refactor stdio_print_current_devices() a little bitBin Meng1-15/+15
In preparation to future changes, refactor this routine a little bit. Signed-off-by: Bin Meng <bmeng@tinylab.org>
2023-08-02console: Make stdio_print_current_devices() staticBin Meng1-1/+1
As it is only called in common/console.c Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
2023-08-02console: kconfig: Drop the redundant VIDEO dependencyBin Meng1-1/+1
The VIDEO dependency is described twice in CONSOLE_MUX. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-30spl: initialize PCI before bootingHeinrich Schuchardt2-5/+7
MMC, SATA, and USB may be using PCI based controllers. Initialize the PCI sub-system before trying to boot. Remove the initialization for NVMe that is now redundant. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
2023-07-30spl: blk: partition numbers are hexadecimalHeinrich Schuchardt1-1/+1
Loading u-boot.itb from device 0x00, partition 0x0f fails with: Trying to boot from NVME Device 0: Vendor: 0x4x Rev: 8.0.50 Prod: nvme-1 Type: Hard Disk Capacity: 3814.6 MB = 3.7 GB (7812500 x 512) ** Invalid partition 21 ** Couldn't find partition nvme 0:15 Like the command line interface fs_det_blk_dev() expects that the device number and the partition number are hexadecimal. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
2023-07-30spl: blk: use CONFIG_SPL_FS_LOAD_PAYLOAD_NAMEHeinrich Schuchardt1-1/+1
We should target to unify the code for different block devices in SPL to reduce code size. MMC, USB, SATA, and Semihosting use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to indicate the filename to load. NVMe uses CONFIG_SPL_PAYLOAD in spl_blk_load_image(). CONFIG_SPL_PAYLOAD is meant to define which binary to integrate into u-boot-with-spl.bin. See commit 7550dbe38b3f ("spl: Add option SPL_PAYLOAD"). Change spl_blk_load_image() to use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Mayuresh Chitale <mchitale@ventanamicro.com>
2023-07-21common: Kconfig: Fix CMD_BMP/BMP dependencySamuel Dionne-Riel1-1/+0
Using `default y` will not select BMP when CMD_BMP has been enabled, if it was already configured. By using `select`, if `CMD_BMP` is turned on, it will force the presence of `BMP`. Fixes: 072b0e16c4 ("common: Kconfig: Add BMP configs") Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com> Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-21common: spl: spl: Remove video driverNikhil M Jain1-11/+11
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to remove video if required. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-21common: board_f: Pass frame buffer info from SPL to u-bootNikhil M Jain1-1/+10
U-boot proper can use frame buffer address passed from SPL to reserve the memory area used by framebuffer set in SPL so that splash image set in SPL continues to get displayed while u-boot proper is running. Put the framebuffer address and size in a bloblist to make them available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-21common: spl: spl: Update stack pointer addressNikhil M Jain1-0/+1
At SPL stage when stack is relocated, the stack pointer needs to be updated, the stack pointer may point to stack in on chip memory even though stack is relocated. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-07-21common: splash_source: Fix type casting errorsNikhil M Jain1-3/+3
During compilation splash_source puts out below warning for type conversion in splash_load_fit for bmp_load_addr and fit_header. Change their type to uintptr_t to fix the warnings. common/splash_source.c: In function ‘splash_load_fit’: common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 366 | img_header = (struct legacy_img_hdr *)bmp_load_addr; | ^ common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 376 | res = splash_storage_read_raw(location, (u32)fit_header, fit_size); | ^ common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 401 | memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size); The above warnings are generated if CONFIG_FIT is enabled. Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-21event: Add fpga load eventChristian Taedcke1-0/+3
This enables implementing custom logic after a bitstream was loaded into the fpga. Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Link: https://lore.kernel.org/r/20230720072724.11516-1-christian.taedcke-oss@weidmueller.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-07-21arm64: zynqmp: Switch to amd.com emailsMichal Simek1-1/+1
Update my and DPs email address to match current setup. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/aba5b19b9c5a95608829e86ad5cc4671c940f1bb.1688992543.git.michal.simek@amd.com
2023-07-17android_ab: Try backup booloader_messageJoshua Watt1-0/+9
Some devices keep 2 copies of the bootloader_message in the misc partition and write each in sequence when updating. This ensures that there is always one valid copy of the bootloader_message. Teach u-boot to optionally try a backup bootloader_message from a specified offset if the primary one fails its CRC check. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-07-17log: Support outputing function names in SPLSimon Glass1-2/+8
The output is garbled when tiny printf() is used. Correct this by adding a special case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Pass video settings from SPL to U-Boot properSimon Glass1-0/+1
When video is set up in SPL, U-Boot proper needs to use the correct parameters so it can write to the display. Put these in a bloblist so they are available to U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bdinfo: Show the malloc base with the bdinfo commandSimon Glass1-3/+4
It is useful to see the base of the malloc region. This is visible when debugging but not in normal usage. Add it to the global data so that it can be shown. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Nikhil M Jain <n-jain1@ti.com>
2023-07-17x86: Improve the trampoline in 64-bit modeSimon Glass1-5/+7
At present this leaves the stack at the pre-relocation value. This is not ideal since we want to have U-Boot running entirely from the top of memory. In addition, the new global_data pointer is not actually used, since the global_data pointer itself is relocated, then the pre-relocation value is changed, so the effective value (after relocation) does not update. Adjust the implementation to follow the 32-bit code more closely, with a trampoline function which is passed the new stack and global_data pointer. This ensures that the correct values come through even when relocating. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17log: Tidy up an ambiguous commentSimon Glass1-1/+1
Add a bit more detail so it is clear that multiple devices are supported, but only one per driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-14board_f: Relocate fdt even if GD_FLG_SKIP_RELOC is setKunihiko Hayashi1-2/+0
In case of OF_SEPARATE (!OF_EMBED), the devicetree blob is placed after _end, and fdt_find_separate() always returns _end. There is a .bss section after _end and the section is cleared before relocation. When GD_FLG_SKIP_RELOC is set, relocation is skipped, so the blob is still in .bss section, but will be cleared. As a result, the devicetree become invalid. To avoid this issue, should relocate it regardless of GD_FLG_SKIP_RELOC in reloc_fdt(). Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-14hash: fix a memory leakSergei Antonov1-2/+6
memalign() returns a pointer which is to be freed by free(). To call unmap_sysmem() is incorrect, furthermore it was called in a wrong scope. Also add a check for allocation error. Fixes: d7af2baa49c6 ("crypto/fsl: Fix HW accelerated hash commands") Cc: Breno Lima <breno.lima@nxp.com> Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-14bootstd: Add a separate log category for expoSimon Glass1-0/+1
This feature is different enough from bootstd that it probably deserves its own log category. It cannot use a uclass since it is not a device. Add a new category. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-07tpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIALYing Sun1-0/+1
As implemented in the arch/arm/mach-rockchip/tpl.c file, the CONFIG_TPL_BANNER_PRINT option will not work if either of these options is not enabled. Add dependency constraints to the CONFIG_TPL_BANNER_PRINT option definition to prevent configuration problems where option is enabled but do not take effect. Suggested-by: Yanjie Ren <renyanjie01@gmail.com> Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
2023-07-07common: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENVYing Sun1-0/+1
CONFIG_SYS_CONSOLE_ENV_OVERWRITE is implemented in common/console.c when "#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)" is met. It is recommended to add dependency constraints to its definition. Suggested-by: Yanjie Ren <renyanjie01@gmail.com> Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
2023-07-06RISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS descriptionHeinrich Schuchardt1-2/+4
Describe which numeric values can be used for as scratch options for OpenSBI. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2023-07-05Merge tag 'v2023.07-rc6' into nextTom Rini4-10/+23
Prepare v2023.07-rc6
2023-07-03spl: spl_legacy: Fix spl_end addressFabio Estevam1-1/+1
Currently, spl_end points to the __bss_end address, which is an external RAM address instead of the end of the SPL text section in the internal RAM. This causes boot failures on imx6-colibri, for example: ``` Trying to boot from MMC1 SPL: Image overlaps SPL resetting ... ``` Fix this problem by assigning spl_end to _image_binary_end, as this symbol properly represents the end of the SPL text section. From u-boot-spl.map: .end *(.__end) 0x00000000009121a4 _image_binary_end = . Fixes: 77aed22b48ab ("spl: spl_legacy: Add extra address checks") Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com> Signed-off-by: Fabio Estevam <festevam@denx.de> Tested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Marek Vasut <marex@denx.de> Tested-by: Marek Vasut <marex@denx.de> # DH i.MX6Q DHCOM PDK2
2023-06-24imx: hab: Simplify the mechanismMarek Vasut1-7/+0
The current mechanism is unnecessarily complex. Simplify the whole mechanism such that the entire fitImage is signed, IVT is placed at the end, followed by CSF, and this entire bundle is also authenticated. This makes the signing scripting far simpler. Signed-off-by: Marek Vasut <marex@denx.de>
2023-06-24spl: spl_legacy: Add extra address checksMarek Vasut1-0/+20
Check whether the loaded image or entry point does not overlap SPL. Signed-off-by: Marek Vasut <marex@denx.de>
2023-06-23menu: Re-enable the ANSI codesSimon Glass1-1/+1
The intent here was to allow ANSI codes to be disabled, since it was proving impoosible to test operation of the menu code when it kept moving the cursor. Unfortunately this ended up in the patch. Correct this by enabling ANSI again. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Pali Rohár <pali@kernel.org> Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl> Reported-by: Frank Wunderlich <frank-w@public-files.de> Fixes: 32bab0eae51b ("menu: Make use of CLI character processing") Tested-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2023-06-21common/memsize.c: Fix get_ram_size() when cache is enabledEmanuele Ghidoli1-0/+24
Ensure that every write is flushed to memory and afterward reads are from memory. Since the algorithm rely on the fact that accessing to not existent memory lead to write at addr / 2 without this modification accesses to aliased (not physically present) addresses are cached and wrong size is returned. This was discovered while working on a TI AM625 based board where cache is normally enabled, see commit c02712a74849 ("arm: mach-k3: Enable dcache in SPL"). Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2023-06-21stdio: Remove stdio_init()Masahiro Yamada1-8/+0
This function is not used by anyone. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-06-20spl: spl-nor: return error if no valid image was loadedMario Kicherer1-1/+1
If only FIT images are enabled and loading the FIT image fails, spl_nor_load_image() should return an error instead of zero. Without this patch: >>SPL: board_init_r() spl_init Trying to boot from NOR Unsupported OS image.. Jumping nevertheless.. image entry point: 0x0 With patch: >>SPL: board_init_r() spl_init Trying to boot from NOR SPL: failed to boot from all boot devices (err=-6) .### ERROR ### Please RESET the board ### Signed-off-by: Mario Kicherer <dev@kicherer.org>
2023-06-20common: spl: Add spl NVMe boot supportMayuresh Chitale2-0/+33
Add support to load the next stage image from an NVMe disk which may be formatted as an EXT or FAT filesystem. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> [trini: Drop hunk changing disk/part.c as that breaks other users] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-06-20spl: blk: Support loading images from fsMayuresh Chitale3-0/+136
Add a generic API to support loading of SPL payload from any supported filesystem on a given partition of a block device. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
2023-06-20spl: Add Kconfig options for NVMEMayuresh Chitale1-0/+26
Add kconfig options to enable NVME and PCI NVMe support in SPL Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-06-16fdt_support: add fdt_copy_fixed_partitions functionPatrick Delaunay1-0/+73
Add a new function fdt_copy_fixed_partitions to copy the fixed partition nodes from U-Boot device tree to Linux kernel device tree and to dynamically configure the MTD partitions. This function fdt_copy_fixed_partitions is only based on device tree with livetree compatible function and replace the function fdt_fixup_mtdparts based on mtdparts variable. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-06-16fdt_support: include dm/ofnode.hPatrick Delaunay1-1/+1
This patch is a preliminary patch to use ofnode function is fdt_support to read the U-Boot device tree with livetree compatible functions. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-06-14spl: ext: Use partition size for mountMayuresh Chitale1-2/+2
Since commit 9905cae65e03 ("fs: ext4: check the minimal partition size to mount"), a valid size needs to be provided when mounting an ext filesystem. Fix the spl ext driver to use the parition size instead of 0 when mounting the filesystem. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
2023-06-12Merge tag 'xilinx-for-v2023.10-rc1' of ↵Tom Rini2-2/+2
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2023.10-rc1 global: - Use proper U-Boot project name Fix sparse warnings in zynqmp-clk, zynqmp handoff, board cmd: - Cover incorrect 0 length entries Versal NET: - Add bootmode logic - Support SPP production version - Add loadpdi command ZynqMP: - Clear pmufw node command ID handling - Change power domain behavior around zynqmp_pmufw_node() - Fix zynqmp cmd return values and pmufw command - Fix R5 tcm init and modes mmc: - Sync Versal NET emmc DT binding pcie: - Add support for ZynqMP PCIe root port video: - Add support for ZynqMP DP tools: - Fix debug message in relocate-rela
2023-06-12Merge tag v2023.07-rc4 into nextTom Rini1-1/+1
Signed-off-by: Tom Rini <trini@konsulko.com>